Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update performance tests to work with themes that load editor into an iframe #46665

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 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,10 @@ describe( 'Post Editor Performance', () => {
let i = 5;
while ( i-- ) {
await page.reload();
await page.waitForSelector( '.wp-block' );
await page.waitForSelector( '.edit-post-layout', {
timeout: 120000,
} );
await canvas().waitForSelector( '.wp-block', { timeout: 120000 } );
Copy link
Member Author

Choose a reason for hiding this comment

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

Copied this approach from the site editor performance tests:

await page.waitForSelector( '.edit-site-visual-editor', {
timeout: 120000,
} );
await canvas().waitForSelector( '.wp-block', { timeout: 120000 } );

Not sure if the large timeout is necessary. Should be harmless though.

Copy link
Member

Choose a reason for hiding this comment

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

personally I've raised questions about them too and I think we'd benefit but cutting out earlier. in cases like these we have to wait two extra minutes before calling it a failure, but the threshold is far earlier than two minutes where we know something went wrong.

const {
serverResponse,
firstPaint,
Expand Down Expand Up @@ -166,8 +170,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 +221,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