mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-15 07:20:26 +00:00
fix(e2e): Race condition in dialog modal test (#12554)
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
testing / semgrep/ci (push) Waiting to run
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
testing / semgrep/ci (push) Waiting to run
The race condition on the test is happening because, we are immediately calling `page.goto()` after the `Commit changes` button is clicked without waiting for the previous redirect to finish. This interruption leads to the error: `Error: page.goto: Target page, context or browser has been closed`. By adding the `await expect(page).toHaveURL`, Playwright waits for the redirection and verifies the URL and then finally go to the next `await page.goto()` to go to the `edit` page of the file. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12554 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
parent
c1000624c6
commit
e41d7b45f9
1 changed files with 1 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ test('Dialog modal', async ({page}) => {
|
|||
|
||||
await page.locator('.quick-pull-choice input[value="direct"]').click();
|
||||
await page.getByRole('button', {name: 'Commit changes'}).click();
|
||||
await expect(page).toHaveURL(`/user2/repo1/src/branch/master/${filename}`);
|
||||
|
||||
response = await page.goto(`/user2/repo1/_edit/master/${filename}`, {waitUntil: 'domcontentloaded'});
|
||||
expect(response?.status()).toBe(200);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue