From 873d04e9e8797a40337bae919b5de0ed1166cccf Mon Sep 17 00:00:00 2001 From: Irshad Ahmad Date: Fri, 11 Oct 2024 13:00:22 +0530 Subject: [PATCH] Set up permalinks --- test/e2e/playwright.config.ts | 7 +++++++ test/e2e/specs/site-setup.ts | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/e2e/specs/site-setup.ts diff --git a/test/e2e/playwright.config.ts b/test/e2e/playwright.config.ts index e98f3072..e83ff925 100644 --- a/test/e2e/playwright.config.ts +++ b/test/e2e/playwright.config.ts @@ -11,10 +11,15 @@ const config = defineConfig({ new URL('./config/global-setup.ts', import.meta.url).href, ), projects: [ + { + name: 'site-setup', + testMatch: /site-setup\.ts/, + }, { name: 'chromium', use: { ...devices['Desktop Chrome'] }, grepInvert: /-chromium/, + dependencies: ['site-setup'], }, { name: 'webkit', @@ -24,12 +29,14 @@ const config = defineConfig({ }, grep: /@webkit/, grepInvert: /-webkit/, + dependencies: ['site-setup'], }, { name: 'firefox', use: { ...devices['Desktop Firefox'] }, grep: /@firefox/, grepInvert: /-firefox/, + dependencies: ['site-setup'], }, ], }); diff --git a/test/e2e/specs/site-setup.ts b/test/e2e/specs/site-setup.ts new file mode 100644 index 00000000..a91e8c62 --- /dev/null +++ b/test/e2e/specs/site-setup.ts @@ -0,0 +1,14 @@ +import { test as setup } from '@wordpress/e2e-test-utils-playwright'; + +setup('Use pretty permalinks', async ({ page, admin }) => { + await admin.visitAdminPage('options-permalink.php'); + + await page.getByRole('radio', { name: 'Post name' }).check(); + + await page.getByRole('button', { name: 'Save Changes' }).click(); + + await page + .getByRole('paragraph') + .filter({ hasText: 'Permalink structure updated.' }) + .waitFor(); +});