Skip to content

Commit 950396c

Browse files
authored
[2.0] Remove E2E test utils that are now available upstream (#5755)
* Update @wordpress/e2e-test-utils to v4.16.0 * Remove E2E test utils that are now available upstream * Use new arg format for `deleteTheme()` * Set default timeout to 10s
1 parent 79895f9 commit 950396c

File tree

14 files changed

+100
-252
lines changed

14 files changed

+100
-252
lines changed

package-lock.json

Lines changed: 90 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@wordpress/browserslist-config": "2.6.0",
4545
"@wordpress/components": "10.0.5",
4646
"@wordpress/data": "4.22.3",
47-
"@wordpress/e2e-test-utils": "4.9.0",
47+
"@wordpress/e2e-test-utils": "4.16.0",
4848
"@wordpress/edit-post": "3.19.0",
4949
"@wordpress/eslint-plugin": "7.0.0",
5050
"@wordpress/hooks": "2.8.0",

tests/e2e/config/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ beforeAll( async () => {
200200
observeConsoleLogging();
201201
await setBrowserViewport( 'large' );
202202
await page.setDefaultNavigationTimeout( 10000 );
203-
await page.setDefaultTimeout( 3000 );
203+
await page.setDefaultTimeout( 10000 );
204204
} );
205205

206206
// eslint-disable-next-line jest/require-top-level-describe

tests/e2e/specs/admin/amp-options.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import { visitAdminPage } from '@wordpress/e2e-test-utils';
4+
import { visitAdminPage, activateTheme, installTheme } from '@wordpress/e2e-test-utils';
55

66
/**
77
* Internal dependencies
88
*/
99
import { completeWizard, cleanUpSettings, clickMode } from '../../utils/onboarding-wizard-utils';
10-
import { installTheme } from '../../utils/install-theme';
11-
import { activateTheme } from '../../utils/activate-theme';
1210

1311
describe( 'AMP settings screen newly activated', () => {
1412
beforeEach( async () => {

tests/e2e/specs/amp-onboarding/template-mode.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/**
2-
* Internal dependencies
2+
* WordPress dependencies
33
*/
4+
import { activateTheme, deleteTheme, installTheme } from '@wordpress/e2e-test-utils';
5+
46
/**
5-
* WordPress dependencies
7+
* Internal dependencies
68
*/
79
import {
810
moveToTemplateModeScreen,
@@ -11,9 +13,6 @@ import {
1113
testPreviousButton,
1214
cleanUpSettings,
1315
} from '../../utils/onboarding-wizard-utils';
14-
import { installTheme } from '../../utils/install-theme';
15-
import { activateTheme } from '../../utils/activate-theme';
16-
import { deleteTheme } from '../../utils/delete-theme';
1716

1817
describe( 'Template mode', () => {
1918
beforeEach( async () => {
@@ -93,7 +92,7 @@ describe( 'Template mode recommendations with non-reader-theme active', () => {
9392
} );
9493

9594
afterEach( async () => {
96-
await deleteTheme( 'hestia', 'twentytwenty' );
95+
await deleteTheme( 'hestia', { newThemeSlug: 'twentytwenty' } );
9796
} );
9897

9998
it( 'makes correct recommendations when user is not technical and the current theme is not a reader theme', async () => {

tests/e2e/specs/block-editor/amp-preview-button.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import { createNewPost, visitAdminPage } from '@wordpress/e2e-test-utils';
4+
import { createNewPost, visitAdminPage, activatePlugin, deactivatePlugin } from '@wordpress/e2e-test-utils';
55

66
/**
77
* Internal dependencies
88
*/
99
import { cleanUpSettings } from '../../utils/onboarding-wizard-utils';
10-
import { activatePlugin, deactivatePlugin } from '../../utils';
1110

1211
const postPreviewBtnSelector = '.components-button.editor-post-preview';
1312
const ampPreviewBtnSelector = `${ postPreviewBtnSelector } + .amp-wrapper-post-preview > .amp-editor-post-preview`;

tests/e2e/specs/block-editor/amp-toggle.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import { createNewPost } from '@wordpress/e2e-test-utils';
5-
6-
/**
7-
* Internal dependencies
8-
*/
9-
import { activatePlugin, deactivatePlugin } from '../../utils';
4+
import { createNewPost, activatePlugin, deactivatePlugin } from '@wordpress/e2e-test-utils';
105

116
describe( 'Enable AMP Toggle', () => {
127
it( 'should display even when Gutenberg is not active', async () => {

tests/e2e/utils/activate-plugin.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

tests/e2e/utils/activate-theme.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

tests/e2e/utils/deactivate-plugin.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)