mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-17 03:01:35 +02:00
Add end to end test for repo name autodetection
This commit is contained in:
parent
f2a1dbf9cd
commit
dd755a0d85
1 changed files with 30 additions and 0 deletions
|
@ -7,6 +7,36 @@ import {test, save_visual, test_context} from './utils_e2e.ts';
|
|||
|
||||
test.use({user: 'user2'});
|
||||
|
||||
|
||||
test('Migration Repo Name detection', async ({page, browser}, workerInfo) => {
|
||||
test.skip(workerInfo.project.name === 'Mobile Safari', 'Flaky actionability checks on Mobile Safari');
|
||||
|
||||
await page.goto('/repo/migrate?service_type=2');
|
||||
|
||||
const form = page.locator('form');
|
||||
|
||||
// Test trailing slashes are stripped
|
||||
await form.getByRole('textbox', {name: 'Migrate / Clone from URL'}).fill('https://github.com/example/test/');
|
||||
await form.getByRole('textbox', {name: 'Migrate / Clone from URL'}).blur();
|
||||
await expect(form.getByRole('textbox', {name: 'Repository Name'})).toHaveValue("test")
|
||||
await save_visual(page);
|
||||
|
||||
// Test trailing .git is stripped
|
||||
await page.reload();
|
||||
await form.getByRole('textbox', {name: 'Migrate / Clone from URL'}).fill('https://github.com/example/test.git');
|
||||
await form.getByRole('textbox', {name: 'Migrate / Clone from URL'}).blur();
|
||||
await expect(form.getByRole('textbox', {name: 'Repository Name'})).toHaveValue("test")
|
||||
await save_visual(page);
|
||||
|
||||
// Test trailing .git and trailing / together is stripped
|
||||
await page.reload();
|
||||
await form.getByRole('textbox', {name: 'Migrate / Clone from URL'}).fill('https://github.com/example/test.git/');
|
||||
await form.getByRole('textbox', {name: 'Migrate / Clone from URL'}).blur();
|
||||
await expect(form.getByRole('textbox', {name: 'Repository Name'})).toHaveValue("test")
|
||||
await save_visual(page);
|
||||
});
|
||||
|
||||
|
||||
test('Migration Progress Page', async ({page, browser}, workerInfo) => {
|
||||
test.skip(workerInfo.project.name === 'Mobile Safari', 'Flaky actionability checks on Mobile Safari');
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue