Repository navigation
Commit f0c6398
authored
fix(e2e): repair new-post spec and add Playwright E2E job to CI (#1873)
* fix(e2e): use editor helpers and dismiss welcome dialog in new-post spec
The editor-new-post E2E spec was failing on develop because:
- Gutenberg's first-visit welcome dialog blocked the title locator.
- The publish flow is now two-step (top bar + pre-publish panel).
- The obsolete meta-box-loader response wait timed out (no meta boxes
registered, so that request never fires).
- The Stream plugin is deactivated by the shared setup, so post-publish
was not being logged.
Refactor to use the official @wordpress/e2e-test-utils-playwright Editor
helpers (setContent, publishPost), reactivate Stream in beforeAll, and
deactivate it again in afterAll to keep the network spec's preconditions.
Closes #1872
* ci: add Playwright E2E job to lint-and-test workflow
Runs the Playwright E2E suite against the Dockerized WordPress stack
after the lint job succeeds. The job:
- maps stream.wpenv.net to localhost so the existing hardcoded test
URLs resolve;
- installs Playwright's Chromium with system deps;
- builds the plugin so the mounted build/ directory contains the
current assets;
- starts the Docker stack, waits for MySQL and HTTP readiness, then
runs wp core multisite-install;
- runs npm run test-e2e;
- uploads the playwright-report directory as a workflow artifact on
both success and failure for easier triage.
* ci: fix MySQL wait, bump login-action, opt actions into Node 24, set timeouts
- Use mariadb-admin instead of mysqladmin in the readiness probe; the
mariadb:11.4.2 image only ships the mariadb-admin binary.
- Bump docker/login-action from v2 to v3 to drop a Node 20 runtime.
- Set FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true at the workflow level so
the remaining v4 JavaScript actions execute under Node 24 ahead of
the June 2026 forced switch.
- Add timeout-minutes to both jobs (lint 10, e2e 12) so a hung step
fails fast instead of consuming the default 6h limit.
* ci: add diagnostics to the WordPress HTTP wait step
Print the HTTP status on each attempt and dump 'docker compose ps' plus
recent wordpress container logs on timeout so the next CI failure
gives us something actionable.
* ci: install Composer deps in the E2E job so wp-cli is available
The WordPress container's PATH includes the project's vendor/bin
directory, where wp-cli/wp-cli-bundle installs the 'wp' binary. Without
composer install, 'docker compose run wordpress wp ...' fails with
'wp: not found'.
* ci: probe MySQL with a real connection instead of mariadb-admin ping
mariadb-admin ping returns success as soon as the server process is
up, even while the server is still refusing TCP connections during
init. Run an actual 'SELECT 1' as the wordpress user against the
wordpress database so the wait reflects what wp-cli will see.
* ci: use xwp/wait-for for MySQL and WordPress readiness probes
The project already ships xwp/wait-for as a dev dependency. Replace the
hand-rolled curl/docker exec loops with a single PHP one-liner that
uses XWP\\Wait_For\\Tcp_Connection to verify both services are
accepting TCP connections, and dump container state in a separate
on-failure step.
* ci: wait for MySQL from inside the wordpress container
The host-mapped 3306 port becomes available before the in-network
'mysql' hostname is reachable from a freshly created sibling
container. wp-cli runs inside a one-shot 'docker compose run wordpress'
which connects over the docker network, so the readiness check needs
to happen there too. Use 'npm run cli -- php -r ...' to run the
wait-for probe in the same context wp-cli will use.
* ci: run container-state dump after install/e2e steps
Previously the diagnostic step sat between wait-for and install-wordpress,
so it only triggered on a wait-for failure. Move it after the e2e step
so any failure in install-wordpress or test-e2e also dumps state.1 parent 7e8a23e commit f0c6398
2 files changed
Lines changed: 159 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
18 | 28 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
24 | 47 | | |
25 | 48 | | |
26 | 49 | | |
27 | 50 | | |
28 | 51 | | |
29 | 52 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
41 | 56 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
45 | 68 | | |
46 | | - | |
47 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
48 | 76 | | |
49 | 77 | | |
50 | | - | |
51 | 78 | | |
52 | | - | |
53 | 79 | | |
54 | 80 | | |
55 | 81 | | |
56 | | - | |
57 | 82 | | |
58 | | - | |
59 | 83 | | |
60 | 84 | | |
61 | 85 | | |
0 commit comments