-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate settings e2e tests to playwright
- Loading branch information
1 parent
ed5a5ff
commit 09d4d5c
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'Settings page', () => { | ||
test.beforeEach( async ( { admin } ) => { | ||
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' ) | ||
.inputValue() | ||
).toBe( '5' ); | ||
|
||
const enableCssGridCheckbox = await page.getByLabel( | ||
'Enable CSS grid (Experimental)' | ||
); | ||
|
||
expect( await enableCssGridCheckbox.isChecked() ).toBeFalsy(); | ||
await expect( enableCssGridCheckbox ).not.toBeDisabled(); | ||
} ); | ||
|
||
test( 'Respects constants', async ( { page, requestUtils } ) => { | ||
await requestUtils.activatePlugin( | ||
'wp-bootstrap-blocks-test-css-grid' | ||
); | ||
|
||
await expect( | ||
await page.locator( '#wp-bootstrap-blocks_bootstrap_version' ) | ||
).toBeDisabled(); | ||
Check failure on line 32 in playwright/e2e/settings/settings.spec.ts GitHub Actions / Tests (6.2)[chromium] › settings/settings.spec.ts:25:2 › Settings page › Respects constants
Check failure on line 32 in playwright/e2e/settings/settings.spec.ts GitHub Actions / Tests (6.3)[chromium] › settings/settings.spec.ts:25:2 › Settings page › Respects constants
Check failure on line 32 in playwright/e2e/settings/settings.spec.ts GitHub Actions / Tests (6.4)[chromium] › settings/settings.spec.ts:25:2 › Settings page › Respects constants
|
||
|
||
expect( | ||
await page | ||
.locator( '#wp-bootstrap-blocks_bootstrap_version' ) | ||
.inputValue() | ||
).toBe( '5' ); | ||
|
||
const enableCssGridCheckbox = await page.locator( | ||
'#wp-bootstrap-blocks_enable_css_grid' | ||
); | ||
|
||
expect( await enableCssGridCheckbox.isChecked() ).toBeTruthy(); | ||
await expect( enableCssGridCheckbox ).toBeDisabled(); | ||
|
||
await requestUtils.deactivatePlugin( | ||
'wp-bootstrap-blocks-test-css-grid' | ||
); | ||
} ); | ||
} ); |