Skip to content

Commit

Permalink
Define a global high actionTimeout for perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Oct 18, 2023
1 parent 2d265b1 commit c9a0e43
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions test/performance/fixtures/perf-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ export class PerfUtils {
* @return URL of the saved draft.
*/
async saveDraft() {
await this.page
.getByRole( 'button', { name: 'Save draft' } )
.click( { timeout: 60_000 } );
await this.page.getByRole( 'button', { name: 'Save draft' } ).click();
await expect(
this.page.getByRole( 'button', { name: 'Saved' } )
).toBeDisabled();
Expand Down
1 change: 1 addition & 0 deletions test/performance/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const config = defineConfig( {
),
use: {
...baseConfig.use,
actionTimeout: 120_000, // 2 minutes.
video: 'off',
},
} );
Expand Down
4 changes: 1 addition & 3 deletions test/performance/specs/post-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ test.describe( 'Post Editor Performance', () => {
const canvas = await perfUtils.getCanvas();

// Wait for the first block.
await canvas.locator( '.wp-block' ).first().waitFor( {
timeout: 120_000,
} );
await canvas.locator( '.wp-block' ).first().waitFor();

// Get the durations.
const loadingDurations = await metrics.getLoadingDurations();
Expand Down
6 changes: 2 additions & 4 deletions test/performance/specs/site-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ test.describe( 'Site Editor Performance', () => {
const canvas = await perfUtils.getCanvas();

// Wait for the first block.
await canvas.locator( '.wp-block' ).first().waitFor( {
timeout: 120_000,
} );
await canvas.locator( '.wp-block' ).first().waitFor();

// Get the durations.
const loadingDurations = await metrics.getLoadingDurations();
Expand Down Expand Up @@ -142,7 +140,7 @@ test.describe( 'Site Editor Performance', () => {
// Spinner was used instead of the progress bar in an earlier version of the site editor.
'.edit-site-canvas-loader, .edit-site-canvas-spinner'
)
.waitFor( { state: 'hidden', timeout: 120_000 } );
.waitFor( { state: 'hidden' } );

const canvas = await perfUtils.getCanvas();

Expand Down

0 comments on commit c9a0e43

Please sign in to comment.