summaryrefslogtreecommitdiffstats
path: root/tests/e2e/repo-migrate.test.e2e.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-12-12 23:57:56 +0100
commite68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch)
tree97775d6c13b0f416af55314eb6a89ef792474615 /tests/e2e/repo-migrate.test.e2e.js
parentInitial commit. (diff)
downloadforgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz
forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to '')
-rw-r--r--tests/e2e/repo-migrate.test.e2e.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/e2e/repo-migrate.test.e2e.js b/tests/e2e/repo-migrate.test.e2e.js
new file mode 100644
index 0000000..63328e0
--- /dev/null
+++ b/tests/e2e/repo-migrate.test.e2e.js
@@ -0,0 +1,32 @@
+// @ts-check
+import {expect} from '@playwright/test';
+import {test, login_user, load_logged_in_context} from './utils_e2e.js';
+
+test.beforeAll(({browser}, workerInfo) => login_user(browser, workerInfo, 'user2'));
+
+test('Migration Progress Page', async ({page: unauthedPage, browser}, workerInfo) => {
+ test.skip(workerInfo.project.name === 'Mobile Safari', 'Flaky actionability checks on Mobile Safari');
+
+ const page = await (await load_logged_in_context(browser, workerInfo, 'user2')).newPage();
+
+ await expect((await page.goto('/user2/invalidrepo'))?.status(), 'repo should not exist yet').toBe(404);
+
+ await page.goto('/repo/migrate?service_type=1');
+
+ const form = page.locator('form');
+ await form.getByRole('textbox', {name: 'Repository Name'}).fill('invalidrepo');
+ await form.getByRole('textbox', {name: 'Migrate / Clone from URL'}).fill('https://codeberg.org/forgejo/invalidrepo');
+ await form.locator('button.primary').click({timeout: 5000});
+ await expect(page).toHaveURL('user2/invalidrepo');
+
+ await expect((await unauthedPage.goto('/user2/invalidrepo'))?.status(), 'public migration page should be accessible').toBe(200);
+ await expect(unauthedPage.locator('#repo_migrating_progress')).toBeVisible();
+
+ await page.reload();
+ await expect(page.locator('#repo_migrating_failed')).toBeVisible();
+ await page.getByRole('button', {name: 'Delete this repository'}).click();
+ const deleteModal = page.locator('#delete-repo-modal');
+ await deleteModal.getByRole('textbox', {name: 'Confirmation string'}).fill('user2/invalidrepo');
+ await deleteModal.getByRole('button', {name: 'Delete repository'}).click();
+ await expect(page).toHaveURL('/');
+});