2023-01-01 19:14:57 +03:00
|
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
import { loadPage } from './libs/load-page';
|
|
|
|
import pkg from './../packages/app/package.json';
|
|
|
|
|
|
|
|
loadPage();
|
|
|
|
|
|
|
|
test.describe('web console', () => {
|
|
|
|
test('editor version', async ({ page }) => {
|
|
|
|
// 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
|
|
|
});
|
|
|
|
});
|