Skip to content

Commit

Permalink
fix flaky settings test
Browse files Browse the repository at this point in the history
  • Loading branch information
tschortsch committed Nov 13, 2023
1 parent 09d4d5c commit 5aa9f34
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions playwright/e2e/settings/settings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

test.describe( 'Settings page', () => {
test.beforeEach( async ( { admin } ) => {
test( 'Default values are selected', async ( { admin, page } ) => {
await admin.visitAdminPage(
'options-general.php?page=wp-bootstrap-blocks_settings'
);
} );

test( 'Default values are selected', async ( { page } ) => {
expect(
await page
.locator( '#wp-bootstrap-blocks_bootstrap_version' )
Expand All @@ -22,11 +20,15 @@ test.describe( 'Settings page', () => {
await expect( enableCssGridCheckbox ).not.toBeDisabled();
} );

test( 'Respects constants', async ( { page, requestUtils } ) => {
test( 'Respects constants', async ( { admin, page, requestUtils } ) => {
await requestUtils.activatePlugin(
'wp-bootstrap-blocks-test-css-grid'
);

await admin.visitAdminPage(
'options-general.php?page=wp-bootstrap-blocks_settings'
);

await expect(
await page.locator( '#wp-bootstrap-blocks_bootstrap_version' )
).toBeDisabled();
Expand Down

0 comments on commit 5aa9f34

Please sign in to comment.