Skip to content

Commit

Permalink
Normalize preload test by resetting preferences before the test starts
Browse files Browse the repository at this point in the history
This test kept failing for me, and I isolated it to if a test before it had run await admin.visitSiteEditor(), then the preload test would fail because the user had previously visited the site editor. By resetting preferences before the test runs, it allows a cleaner enviroment and the test has consistent results.
  • Loading branch information
jeryj committed Dec 6, 2024
1 parent 0e05eb3 commit 011597d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/e2e/specs/site-editor/preload.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );
test.describe( 'Preload', () => {
test.beforeAll( async ( { requestUtils } ) => {
await requestUtils.activateTheme( 'emptytheme' );
await requestUtils.resetPreferences();
} );

test.afterAll( async ( { requestUtils } ) => {
Expand Down

0 comments on commit 011597d

Please sign in to comment.