PluginProbe
Extendify / 3.1.0
Extendify v3.1.0
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / tests / playwright / Launch / launch.spec.ts

launch.spec.ts in Extendify 3.1.0, at tests/playwright/Launch/launch.spec.ts

40 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // e2e:disabled
2 import { expect, test } from '../fixtures';
3
4 type OptionResponse = { success: boolean; data: string | null };
5
6 test.beforeEach(async ({ requestUtils, admin }) => {
7 await requestUtils.login();
8 // wp-playground's default admin user matches `admin_email`, so the first
9 // /wp-admin/ visit with no `extendify_launch_loaded` option seeded fires
10 // AdminPageRouter::redirectOnce — it writes `extendify_attempted_redirect`
11 // synchronously in PHP and redirects to ?page=extendify-launch, where the
12 // React mount writes `extendify_launch_loaded` via POST /launch/options.
13 await admin.visitAdminPage('index.php', '');
14 });
15
16 test('Tests the Launch redirect and db value', async ({
17 page,
18 requestUtils,
19 }) => {
20 await expect(page).toHaveURL(/admin\.php\?page=extendify-launch/);
21
22 await expect
23 .poll(async () => {
24 const res = await requestUtils.rest<OptionResponse>({
25 path: '/extendify/v1/launch/options?option=extendify_attempted_redirect',
26 });
27 return res.data ?? '';
28 })
29 .toMatch(/\d{4}-\d{2}-\d{2}/);
30
31 await expect
32 .poll(async () => {
33 const res = await requestUtils.rest<OptionResponse>({
34 path: '/extendify/v1/launch/options?option=extendify_launch_loaded',
35 });
36 return res.data ?? '';
37 })
38 .toMatch(/\d{4}-\d{2}-\d{2}/);
39 });
40