Skip to content

Commit 0718f46

Browse files
authored
Merge pull request #129 from liip/feat/migrate-e2etest-to-playwright
feat(): Migrate e2e tests to playwright
2 parents ec7b7d9 + e56f693 commit 0718f46

134 files changed

Lines changed: 17058 additions & 12060 deletions

File tree

Some content is hidden

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

.browserslistrc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
> 1%
2-
ie >= 11
3-
last 1 Android versions
4-
last 1 ChromeAndroid versions
5-
last 2 Chrome versions
6-
last 2 Firefox versions
7-
last 2 Safari versions
8-
last 2 iOS versions
9-
last 2 Edge versions
10-
last 2 Opera versions
1+
extends @wordpress/browserslist-config

.editorconfig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ trim_trailing_whitespace = true
1414
indent_style = tab
1515
indent_size = 4
1616

17-
[*.yml]
17+
[*.{yml,yaml}]
1818
indent_style = space
1919
indent_size = 2
2020

21-
[*.md]
22-
trim_trailing_whitespace = false
21+
[*.{gradle,java,kt}]
22+
indent_style = space
23+
24+
[packages/react-native-*/**.xml]
25+
indent_style = space

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ node_modules
22
vendor
33
build
44
!.*.js
5-
snapshots.js
6-
cypress/index.d.ts
75
release/

.eslintrc.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
module.exports = {
22
root: true,
33
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
4-
parserOptions: {
5-
requireConfigFile: false,
6-
babelOptions: {
7-
presets: [ require.resolve( '@wordpress/babel-preset-default' ) ],
8-
},
9-
},
10-
overrides: [
11-
{
12-
// Use cypress/recommended plugin for cypress tests.
13-
files: [ 'cypress/**/*.js' ],
14-
extends: [ 'plugin:cypress/recommended' ],
15-
},
16-
],
174
};

.github/workflows/lint-test-deploy.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Run PHP linter
2828
run: |
2929
npm run wp-env start
30-
npm run lint:php
30+
npm run lint:php:ci
3131
3232
tests:
3333
name: Tests
@@ -36,7 +36,7 @@ jobs:
3636

3737
strategy:
3838
matrix:
39-
wp: [ '5.7', '5.8', '5.9', '6.0', '6.1' ]
39+
wp: [ '6.2', '6.3', '6.4' ]
4040

4141
steps:
4242
- uses: actions/checkout@v3
@@ -51,13 +51,16 @@ jobs:
5151
npm ci
5252
composer install
5353
54+
- name: Install Playwright dependencies
55+
run: |
56+
npx playwright install chromium firefox webkit --with-deps
57+
5458
- name: "Configure environment with WP ${{ matrix.wp }}"
5559
run: |
5660
echo -e '{\n\t"core": "WordPress/WordPress#${{ matrix.wp }}"\n}' > ./.wp-env.override.json
5761
5862
- name: Install WordPress
5963
run: |
60-
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
6164
npm run wp-env start
6265
6366
- name: Running JavaScript E2E tests
@@ -66,6 +69,13 @@ jobs:
6669
- name: Running PHP unit tests
6770
run: npm run test:unit:php:ci
6871

72+
- uses: actions/upload-artifact@v3
73+
if: always()
74+
with:
75+
name: playwright-report
76+
path: artifacts/
77+
retention-days: 7
78+
6979
deploy-dry-run:
7080
name: '[DRY RUN] Deploy'
7181

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ build/*
99
!build/settings.css
1010
composer.phar
1111
/release
12-
cypress/videos
13-
cypress/screenshots
1412
.DS_Store
13+
/test-results/
14+
/artifacts/
15+
/blob-report/
16+
/playwright/.cache/
17+
.phpunit.result.cache

.prettierrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Import the default config file and expose it in the project root.
2+
// Useful for editor integrations.
3+
module.exports = require( '@wordpress/prettier-config' );

.wp-env.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"core": "WordPress/WordPress#6.1",
2+
"core": "WordPress/WordPress#6.4.1",
33
"plugins": [ "." ],
44
"themes": [
55
"./test-themes/bootstrap"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The support is still experimental since it's also marked as experimental in the
8787

8888
## Bootstrap library
8989

90-
Please be aware that this plugin does not include the Bootstrap library in your website. You need to do this by yourself.
90+
Please be aware that this plugin does not include the Bootstrap library in your website. You need to do this by yourself.
9191
We decided not to include the library so that you can modify Bootstrap to your own needs before loading it.
9292

9393
The easiest way to do this is to add the following to your theme's `functions.php`:
@@ -864,7 +864,7 @@ The following commands can be used to set up a local dev environment. See the of
864864
There are two types of tests for this plugin:
865865

866866
* PHPUnit Tests: Used to validate generated block output. Since this plugin uses dynamic blocks which are rendered on the server side we need to test them with PHPUnit tests.
867-
* Cypress E2E Tests: Used to validate block behaviour in the editor.
867+
* Playwright E2E Tests: Used to validate block behaviour in the editor.
868868

869869
#### PHPUnitTests
870870

@@ -890,9 +890,9 @@ or the following command to run a specific test:
890890
npm run test:unit:php -- --filter 'my_test'
891891
```
892892

893-
#### Cypress E2E Tests
893+
#### Playwright E2E Tests
894894

895-
The Cypress E2E Tests are stored in the `cypress` directory.
895+
The Playwright E2E Tests are stored in the `playwright` directory.
896896

897897
To run the tests use the following command:
898898

build/index.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'd3457b9a3c8cbcffa04f');
1+
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n'), 'version' => '711b66ceb1a605b9118c');

0 commit comments

Comments
 (0)