mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
Update Electron 28 (#11304)
* chore: update electron Close #11303 * chore: update deps * fix(test): utils import
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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])
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user