2023-02-05 13:41:18 +03:00
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
import { test } from './libs/playwright.js';
|
2023-01-09 07:20:53 +03:00
|
|
|
import { loadPage } from './libs/load-page.js';
|
2023-01-01 19:14:57 +03:00
|
|
|
|
|
|
|
loadPage();
|
|
|
|
|
|
|
|
test.describe('web console', () => {
|
2023-01-09 07:20:53 +03:00
|
|
|
// TODO: playwright need to support json import in esm
|
|
|
|
test.skip('editor version', async ({ page }) => {
|
|
|
|
// TODO: playwright need to support json import in esm
|
|
|
|
// const pkg = await import('./../packages/app/package.json', {
|
|
|
|
// assert: { type: 'json' },
|
|
|
|
// });
|
|
|
|
const pkg = {} as any;
|
|
|
|
|
2023-01-01 19:14:57 +03:00
|
|
|
// https://playwright.dev/docs/evaluating
|
|
|
|
// https://github.com/microsoft/playwright/issues/13059
|
|
|
|
// Get the handle to a specific function.
|
|
|
|
//Later on, call this function with some arguments.
|
|
|
|
// const msg = await getEditoVersionHandle.evaluate((post, args) => post);
|
|
|
|
// console.log(getEditoVersionHandle);
|
2023-01-04 11:13:40 +03:00
|
|
|
const editoVersion = await page.evaluate(() => window.__editoVersion);
|
2023-01-01 20:11:19 +03:00
|
|
|
// const documentEditorVersion = await page.inputValue('input#editor-version');
|
2023-01-01 19:14:57 +03:00
|
|
|
const pkgEditorVersion = pkg.dependencies['@blocksuite/editor'];
|
|
|
|
|
2023-01-01 20:11:19 +03:00
|
|
|
expect(editoVersion).toBe(pkgEditorVersion);
|
2023-01-01 19:14:57 +03:00
|
|
|
});
|
|
|
|
});
|