test(editor): enable basic test for cross platform (#11667)

This commit is contained in:
Saul-Mirone 2025-04-14 07:36:56 +00:00
parent ee15b364d1
commit efecce9bf2
No known key found for this signature in database
GPG Key ID: 0D941B4A9125B742
6 changed files with 13 additions and 10 deletions

View File

@ -248,7 +248,7 @@ jobs:
- name: Run playwright tests - name: Run playwright tests
env: env:
BROWSER: ${{ matrix.browser }} BROWSER: ${{ matrix.browser }}
run: yarn workspace @affine-test/blocksuite test "inline-editor.spec.ts" --forbid-only --shard=${{ matrix.shard }}/${{ strategy.job-total }} run: yarn workspace @affine-test/blocksuite test "cross-platform/" --forbid-only --shard=${{ matrix.shard }}/${{ strategy.job-total }}
- name: Upload test results - name: Upload test results
if: always() if: always()

View File

@ -31,7 +31,7 @@ import {
undoByKeyboard, undoByKeyboard,
waitDefaultPageLoaded, waitDefaultPageLoaded,
waitNextFrame, waitNextFrame,
} from './utils/actions/index.js'; } from '../utils/actions/index.js';
import { import {
assertBlockChildrenIds, assertBlockChildrenIds,
assertEmpty, assertEmpty,
@ -39,9 +39,9 @@ import {
assertRichTexts, assertRichTexts,
assertText, assertText,
assertTitle, assertTitle,
} from './utils/asserts.js'; } from '../utils/asserts.js';
import { scoped, test } from './utils/playwright.js'; import { scoped, test } from '../utils/playwright.js';
import { getFormatBar } from './utils/query.js'; import { getFormatBar } from '../utils/query.js';
const BASIC_DEFAULT_SNAPSHOT = 'basic test default'; const BASIC_DEFAULT_SNAPSHOT = 'basic test default';

View File

@ -2,20 +2,21 @@ import type { InlineEditor, InlineRange } from '@blocksuite/affine/std/inline';
import type { DeltaInsert } from '@blocksuite/affine/store'; import type { DeltaInsert } from '@blocksuite/affine/store';
import { expect, type Page, test } from '@playwright/test'; import { expect, type Page, test } from '@playwright/test';
import { press } from '../database/actions.js'; import { press } from '../../database/actions.js';
import { import {
pressArrowLeft, pressArrowLeft,
pressBackspace, pressBackspace,
pressEnter, pressEnter,
type, type,
} from '../utils/actions/keyboard.js'; } from '../../utils/actions/keyboard.js';
import { import {
enterPlaygroundRoom, enterPlaygroundRoom,
focusRichText, focusRichText,
initEmptyParagraphState, initEmptyParagraphState,
} from '../utils/actions/misc.js'; } from '../../utils/actions/misc.js';
import { assertRichTextInlineDeltas } from '../utils/asserts.js'; import { assertRichTextInlineDeltas } from '../../utils/asserts.js';
import { ZERO_WIDTH_FOR_EMPTY_LINE } from '../utils/inline-editor.js'; import { ZERO_WIDTH_FOR_EMPTY_LINE } from '../../utils/inline-editor.js';
// FIXME(mirone): copy paste from framework/inline/__tests__/utils.ts // FIXME(mirone): copy paste from framework/inline/__tests__/utils.ts
const defaultPlaygroundURL = new URL( const defaultPlaygroundURL = new URL(
`http://localhost:${process.env.CI ? 4173 : 5173}/` `http://localhost:${process.env.CI ? 4173 : 5173}/`

View File

@ -151,6 +151,8 @@ export async function enterPlaygroundRoom(
'Running frontend commit', 'Running frontend commit',
// Github timeout: // Github timeout:
'Failed to load resource: the server responded with a status of 403', 'Failed to load resource: the server responded with a status of 403',
// font download warning:
'[JavaScript Warning: "downloadable font:',
].some(text => message.text().startsWith(text)) ].some(text => message.text().startsWith(text))
) { ) {
return; return;