PluginProbe ʕ •ᴥ•ʔ
Starter Sites & Templates by Neve / 1.4.1
Starter Sites & Templates by Neve v1.4.1
1.4.1 1.4.0 1.3.0 1.2.29 1.2.28 1.2.6 1.2.7 1.2.8 1.2.9 trunk 1.0.10 1.0.11 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.20 1.1.21 1.1.22 1.1.23 1.1.24 1.1.25 1.1.26 1.1.27 1.1.28 1.1.29 1.1.3 1.1.30 1.1.31 1.1.32 1.1.33 1.1.34 1.1.35 1.1.36 1.1.37 1.1.38 1.1.39 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.3 1.2.4 1.2.5
templates-patterns-collection / e2e-tests / config / global-setup.ts
templates-patterns-collection / e2e-tests / config Last commit date
flaky-tests-reporter.ts 1 year ago global-setup.ts 1 year ago
global-setup.ts
45 lines
1 /**
2 * External dependencies
3 */
4 import { request } from '@playwright/test';
5 import type { FullConfig } from '@playwright/test';
6
7 /**
8 * WordPress dependencies
9 */
10 import { RequestUtils } from '@wordpress/e2e-test-utils-playwright';
11
12 async function globalSetup( config: FullConfig ) {
13 const { storageState, baseURL } = config.projects[ 0 ].use;
14 const storageStatePath =
15 typeof storageState === 'string' ? storageState : undefined;
16
17 const requestContext = await request.newContext( {
18 baseURL,
19 } );
20
21 const requestUtils = new RequestUtils( requestContext, {
22 storageStatePath,
23 } );
24
25 // Authenticate and save the storageState to disk.
26 await requestUtils.setupRest();
27
28 // Reset the test environment before running the tests.
29 await Promise.all( [
30 // requestUtils.activateTheme( 'twentytwentyone' ),
31 // // Disable this test plugin as it's conflicting with some of the tests.
32 // // We already have reduced motion enabled and Playwright will wait for most of the animations anyway.
33 // requestUtils.deactivatePlugin(
34 // 'gutenberg-test-plugin-disables-the-css-animations'
35 // ),
36 requestUtils.deleteAllPosts(),
37 requestUtils.deleteAllBlocks(),
38 requestUtils.resetPreferences(),
39 ] );
40
41 await requestContext.dispose();
42 }
43
44 export default globalSetup;
45