Update Electron 28 (#11304)

* chore: update electron

Close #11303

* chore: update deps

* fix(test): utils import
This commit is contained in:
Andelf
2024-05-13 12:59:18 +08:00
committed by GitHub
parent b419b955cc
commit e6173e8810
8 changed files with 47 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
import * as fs from 'fs'
import * as path from 'path'
import fs from 'fs'
import path from 'path'
import { test as base, expect, ConsoleMessage, Locator } from '@playwright/test';
import { ElectronApplication, Page, BrowserContext, _electron as electron } from 'playwright'
import { loadLocalGraph, openLeftSidebar, randomString } from './utils';

View File

@@ -1,5 +1,6 @@
import { test } from './fixtures'
import { expect } from '@playwright/test'
import { callPageAPI } from './utils'
test('block related apis',
async ({ page }) => {
@@ -92,14 +93,3 @@ test('block related apis',
// await page.pause()
})
/**
* @param page
* @param method
* @param args
*/
export async function callPageAPI(page, method, ...args) {
return await page.evaluate(([method, args]) => {
// @ts-ignore
return window.logseq.api[method]?.(...args)
}, [method, args])
}

View File

@@ -1,6 +1,6 @@
import { expect } from '@playwright/test'
import { test } from './fixtures'
import { callPageAPI } from './logseq-api.spec'
import { callPageAPI } from './utils'
test.skip('enabled plugin system default', async ({ page }) => {
const callAPI = callPageAPI.bind(null, page)

View File

@@ -303,3 +303,15 @@ export async function getCursorPos(page: Page): Promise<number | null> {
return cursorPosition;
}
/**
* @param page
* @param method
* @param args
*/
export async function callPageAPI(page, method, ...args) {
return await page.evaluate(([method, args]) => {
// @ts-ignore
return window.logseq.api[method]?.(...args)
}, [method, args])
}