Skip to content

Commit

Permalink
Update performance tests to work with themes that load editor into an…
Browse files Browse the repository at this point in the history
… iframe
  • Loading branch information
noisysocks committed Dec 20, 2022
1 parent b1234a7 commit 6c4a7ab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/e2e-tests/specs/performance/post-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
closeGlobalBlockInserter,
openListView,
closeListView,
canvas,
} from '@wordpress/e2e-test-utils';

/**
Expand Down Expand Up @@ -100,7 +101,8 @@ describe( 'Post Editor Performance', () => {
let i = 5;
while ( i-- ) {
await page.reload();
await page.waitForSelector( '.wp-block' );
await page.waitForSelector( 'iframe[name="editor-canvas"]' );
await canvas().waitForSelector( '.wp-block' );
const {
serverResponse,
firstPaint,
Expand Down Expand Up @@ -166,8 +168,8 @@ describe( 'Post Editor Performance', () => {
)
);
// Select the block where we type in
await page.waitForSelector( 'p[aria-label="Paragraph block"]' );
await page.click( 'p[aria-label="Paragraph block"]' );
await canvas().waitForSelector( 'p[aria-label="Paragraph block"]' );
await canvas().click( 'p[aria-label="Paragraph block"]' );
// Ignore firsted typed character because it's different
// It probably deserves a dedicated metric.
// (isTyping triggers so it's slower)
Expand Down Expand Up @@ -217,7 +219,7 @@ describe( 'Post Editor Performance', () => {
);
dispatch( 'core/block-editor' ).resetBlocks( blocks );
} );
const paragraphs = await page.$$( '.wp-block' );
const paragraphs = await canvas().$$( '.wp-block' );
await page.tracing.start( {
path: traceFile,
screenshots: false,
Expand Down

1 comment on commit 6c4a7ab

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3737293629
📝 Reported issues:

Please sign in to comment.