Add end to end test for repo name autodetection

This commit is contained in:
YuviPanda 2025-03-22 12:36:31 -07:00
parent f2a1dbf9cd
commit dd755a0d85

View file

@ -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');