Commit 44a2064
authored
[Website] Fix flaky phpMyAdmin test (#2977)
## Motivation for the change, related issues
The phpMyAdmin E2E test seems to be flaky in Firefox:
```
✘ 32 [firefox] › packages/playground/website/playwright/e2e/website-ui.spec.ts:433:6 › Database panel › should load and open phpMyAdmin (retry #3) (42.0s)
1) [firefox] › packages/playground/website/playwright/e2e/website-ui.spec.ts:433:6 › Database panel › should load and open phpMyAdmin
Error: expect(locator).toBeVisible() failed
Locator: locator('form#insertForm, form[name="insertForm"]')
Expected: visible
Received: <element(s) not found>
Timeout: 10000ms
Call log:
- Expect "toBeVisible" with timeout 10000ms
- waiting for locator('form#insertForm, form[name="insertForm"]')
472 | 'form#insertForm, form[name="insertForm"]'
473 | );
> 474 | await expect(pmaForm).toBeVisible({ timeout: 10000 });
| ^
475 | await expect(pmaForm).toContainText('Welcome to WordPress.');
476 |
477 | // Update the post content
at /home/runner/work/wordpress-playground/wordpress-playground/packages/playground/website/playwright/e2e/website-ui.spec.ts:474:25
Error Context: packages/playground/website/test-results/website-ui-Database-panel-should-load-and-open-phpMyAdmin-firefox/error-context.md
```
## Implementation details
The issue appears to be that phpMyAdmin handles screen navigation using
custom AJAX handlers, which may ignore link clicks when another AJAX
request is still in progress. This is implemented in their [AJAX
module](https://github.com/phpmyadmin/phpmyadmin/blob/3925c2237701050ee34f5ba79d74fda808673d4f/resources/js/modules/ajax.ts)
that is exposed globally on `window.AJAX`.
I tried other approaches like waiting for a loader to disappear, but no
luck. This approach seems to be the only reliable one.
## Testing Instructions (or ideally a Blueprint)
See the CI passing.1 parent 1acf498 commit 44a2064
File tree
1 file changed
+20
-9
lines changed- packages/playground/website/playwright/e2e
1 file changed
+20
-9
lines changedLines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
453 | 464 | | |
454 | 465 | | |
455 | 466 | | |
456 | 467 | | |
457 | 468 | | |
458 | | - | |
| 469 | + | |
| 470 | + | |
459 | 471 | | |
460 | 472 | | |
461 | 473 | | |
462 | 474 | | |
463 | 475 | | |
464 | 476 | | |
| 477 | + | |
465 | 478 | | |
466 | 479 | | |
467 | 480 | | |
468 | 481 | | |
469 | 482 | | |
470 | 483 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
476 | 487 | | |
477 | 488 | | |
478 | | - | |
| 489 | + | |
479 | 490 | | |
480 | 491 | | |
481 | 492 | | |
| |||
0 commit comments