From 829e661c39ef453cc0c8b5c9b11462fc59c554ae Mon Sep 17 00:00:00 2001 From: Solomon Victorino Date: Thu, 29 Aug 2024 13:29:09 -0600 Subject: [PATCH] test: assert navigation URLs in release E2E test - last one waits for release deletion before the next browser run - disambiguates failures due to error responses --- tests/e2e/release.test.e2e.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/e2e/release.test.e2e.js b/tests/e2e/release.test.e2e.js index 9d5d12848b..cf39ff2f2e 100644 --- a/tests/e2e/release.test.e2e.js +++ b/tests/e2e/release.test.e2e.js @@ -22,6 +22,7 @@ test('External Release Attachments', async ({browser, isMobile}, workerInfo) => await page.click('.button.small.primary'); // Fill out form and create new release + await expect(page).toHaveURL('/user2/repo2/releases/new'); await page.fill('input[name=tag_name]', '2.0'); await page.fill('input[name=title]', '2.0'); await page.click('#add-external-link'); @@ -33,6 +34,7 @@ test('External Release Attachments', async ({browser, isMobile}, workerInfo) => await page.click('.button.small.primary'); // Validate release page and click edit + await expect(page).toHaveURL('/user2/repo2/releases'); await expect(page.locator('.download[open] li')).toHaveCount(3); await expect(page.locator('.download[open] li:nth-of-type(3)')).toContainText('Test'); await expect(page.locator('.download[open] li:nth-of-type(3) a')).toHaveAttribute('href', 'https://forgejo.org/'); @@ -40,6 +42,7 @@ test('External Release Attachments', async ({browser, isMobile}, workerInfo) => await page.locator('.octicon-pencil').first().click(); // Validate edit page and edit the release + await expect(page).toHaveURL('/user2/repo2/releases/edit/2.0'); await expect(page.locator('.attachment_edit:visible')).toHaveCount(2); await expect(page.locator('.attachment_edit:visible').nth(0)).toHaveValue('Test'); await expect(page.locator('.attachment_edit:visible').nth(1)).toHaveValue('https://forgejo.org/'); @@ -53,6 +56,7 @@ test('External Release Attachments', async ({browser, isMobile}, workerInfo) => await page.click('.button.small.primary'); // Validate release page and click edit + await expect(page).toHaveURL('/user2/repo2/releases'); await expect(page.locator('.download[open] li')).toHaveCount(4); await expect(page.locator('.download[open] li:nth-of-type(3)')).toContainText('Test2'); await expect(page.locator('.download[open] li:nth-of-type(3) a')).toHaveAttribute('href', 'https://gitea.io/'); @@ -62,6 +66,8 @@ test('External Release Attachments', async ({browser, isMobile}, workerInfo) => await page.locator('.octicon-pencil').first().click(); // Delete release + await expect(page).toHaveURL('/user2/repo2/releases/edit/2.0'); await page.click('.delete-button'); await page.click('.button.ok'); + await expect(page).toHaveURL('/user2/repo2/releases'); });