Skip to content

Commit

Permalink
Set up permalinks
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadahmad21 committed Oct 11, 2024
1 parent 9eaf44b commit 75f5465
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e-mu-plugins/e2e-wp-rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function () {

update_option( $option_name, $option_value );

return new WP_REST_Response( true, 200 );
return new WP_REST_Response( [ 'success' => true ], 200 );
},
],
[
Expand All @@ -80,7 +80,7 @@ function () {

delete_option( $option_name );

return new WP_REST_Response( true, 200 );
return new WP_REST_Response( [ 'success' => true ], 200 );
},
],
]
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'],
},
],
});
Expand Down
14 changes: 14 additions & 0 deletions test/e2e/specs/site-setup.ts
Original file line number Diff line number Diff line change
@@ -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();
});

0 comments on commit 75f5465

Please sign in to comment.