Skip to content

Commit b786aad

Browse files
authored
Tests: Extract e2e test utils to their own package (#13228)
* Tests: Move e2e tests dependent on plugins to their own folder * Tests: Extract e2e test utils to their own package
1 parent feb8bfc commit b786aad

File tree

192 files changed

+241
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+241
-168
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
build
22
build-module
33
node_modules
4-
packages/tests-e2e/plugins
4+
packages/e2e-tests/plugins
55
vendor
66
packages/block-serialization-spec-parser/parser.js

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ module.exports = {
182182
},
183183
overrides: [
184184
{
185-
files: [ 'packages/tests-e2e/**/*.js' ],
185+
files: [ 'packages/e2e-test*/**/*.js' ],
186186
env: {
187187
browser: true,
188188
},

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,29 @@ jobs:
6767
install:
6868
- ./bin/setup-local-env.sh
6969
script:
70-
- $( npm bin )/wp-scripts test-e2e --testPathPattern=/packages/tests-e2e/specs/ --listTests > ~/.jest-e2e-tests
70+
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
7171
- npm run test-e2e -- --ci --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 2 == 0' < ~/.jest-e2e-tests )
7272

7373
- name: E2E tests (Admin with plugins) (2/2)
7474
env: WP_VERSION=latest POPULAR_PLUGINS=true
7575
install:
7676
- ./bin/setup-local-env.sh
7777
script:
78-
- $( npm bin )/wp-scripts test-e2e --testPathPattern=/packages/tests-e2e/specs/ --listTests > ~/.jest-e2e-tests
78+
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
7979
- npm run test-e2e -- --ci --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 2 == 1' < ~/.jest-e2e-tests )
8080

8181
- name: E2E tests (Author without plugins) (1/2)
8282
env: WP_VERSION=latest E2E_ROLE=author
8383
install:
8484
- ./bin/setup-local-env.sh
8585
script:
86-
- $( npm bin )/wp-scripts test-e2e --testPathPattern=/packages/tests-e2e/specs/ --listTests > ~/.jest-e2e-tests
86+
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
8787
- npm run test-e2e -- --ci --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 2 == 0' < ~/.jest-e2e-tests )
8888

8989
- name: E2E tests (Author without plugins) (2/2)
9090
env: WP_VERSION=latest E2E_ROLE=author
9191
install:
9292
- ./bin/setup-local-env.sh
9393
script:
94-
- $( npm bin )/wp-scripts test-e2e --testPathPattern=/packages/tests-e2e/specs/ --listTests > ~/.jest-e2e-tests
94+
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
9595
- npm run test-e2e -- --ci --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 2 == 1' < ~/.jest-e2e-tests )

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ services:
1212
volumes:
1313
- wordpress:/var/www/html
1414
- .:/var/www/html/wp-content/plugins/gutenberg
15-
- ./packages/tests-e2e/plugins:/var/www/html/wp-content/plugins/gutenberg-test-plugins
16-
- ./packages/tests-e2e/mu-plugins:/var/www/html/wp-content/mu-plugins
15+
- ./packages/e2e-tests/plugins:/var/www/html/wp-content/plugins/gutenberg-test-plugins
16+
- ./packages/e2e-tests/mu-plugins:/var/www/html/wp-content/mu-plugins
1717
depends_on:
1818
- mysql
1919

@@ -59,8 +59,8 @@ services:
5959
volumes:
6060
- wordpress_e2e_tests:/var/www/html
6161
- .:/var/www/html/wp-content/plugins/gutenberg
62-
- ./packages/tests-e2e/plugins:/var/www/html/wp-content/plugins/gutenberg-test-plugins
63-
- ./test/e2e/mu-plugins:/var/www/html/wp-content/mu-plugins
62+
- ./packages/e2e-tests/plugins:/var/www/html/wp-content/plugins/gutenberg-test-plugins
63+
- ./packages/e2e-tests/mu-plugins:/var/www/html/wp-content/mu-plugins
6464

6565
cli_e2e_tests:
6666
image: wordpress:cli

docs/manifest.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,18 @@
593593
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/dom/README.md",
594594
"parent": "packages"
595595
},
596+
{
597+
"title": "@wordpress/e2e-test-utils",
598+
"slug": "packages-e2e-test-utils",
599+
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/e2e-test-utils/README.md",
600+
"parent": "packages"
601+
},
602+
{
603+
"title": "@wordpress/e2e-tests",
604+
"slug": "packages-e2e-tests",
605+
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/e2e-tests/README.md",
606+
"parent": "packages"
607+
},
596608
{
597609
"title": "@wordpress/edit-post",
598610
"slug": "packages-edit-post",
@@ -737,12 +749,6 @@
737749
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/shortcode/README.md",
738750
"parent": "packages"
739751
},
740-
{
741-
"title": "@wordpress/tests-e2e",
742-
"slug": "packages-tests-e2e",
743-
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/tests-e2e/README.md",
744-
"parent": "packages"
745-
},
746752
{
747753
"title": "@wordpress/token-list",
748754
"slug": "packages-token-list",

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build",
1010
"build-module",
1111
"node_modules",
12-
"packages/tests-e2e/plugins",
12+
"packages/e2e-tests/plugins",
1313
"vendor"
1414
]
1515
}

package-lock.json

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@
6060
"@wordpress/babel-preset-default": "file:packages/babel-preset-default",
6161
"@wordpress/browserslist-config": "file:packages/browserslist-config",
6262
"@wordpress/custom-templated-path-webpack-plugin": "file:packages/custom-templated-path-webpack-plugin",
63+
"@wordpress/e2e-test-utils": "file:packages/e2e-test-utils",
64+
"@wordpress/e2e-tests": "file:packages/e2e-tests",
6365
"@wordpress/eslint-plugin": "file:packages/eslint-plugin",
6466
"@wordpress/jest-console": "file:packages/jest-console",
6567
"@wordpress/jest-preset-default": "file:packages/jest-preset-default",
6668
"@wordpress/library-export-default-webpack-plugin": "file:packages/library-export-default-webpack-plugin",
6769
"@wordpress/npm-package-json-lint-config": "file:packages/npm-package-json-lint-config",
6870
"@wordpress/postcss-themes": "file:packages/postcss-themes",
6971
"@wordpress/scripts": "file:packages/scripts",
70-
"@wordpress/tests-e2e": "file:packages/tests-e2e",
7172
"babel-loader": "8.0.0",
7273
"benchmark": "2.1.4",
7374
"browserslist": "3.2.8",
@@ -176,7 +177,7 @@
176177
"publish:prod": "npm run build:packages && lerna publish",
177178
"test": "npm run lint && npm run test-unit",
178179
"pretest-e2e": "concurrently \"./bin/reset-e2e-tests.sh\" \"npm run build\"",
179-
"test-e2e": "wp-scripts test-e2e --setupTestFrameworkScriptFile=./packages/tests-e2e/support/setup-test-framework.js --testPathPattern=/packages/tests-e2e/specs/",
180+
"test-e2e": "wp-scripts test-e2e --config packages/e2e-tests/jest.config.js",
180181
"test-e2e:watch": "npm run test-e2e -- --watch",
181182
"test-php": "npm run lint-php && npm run test-unit-php",
182183
"test-unit": "wp-scripts test-unit-js --config test/unit/jest.config.json",
Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)