Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/e2e/repo.test.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// @ts-check
import {test, expect} from '@playwright/test';
import {load_logged_in_context, login_user} from './utils_e2e.js';

test.beforeAll(async ({browser}, workerInfo) => {
await login_user(browser, workerInfo, 'user2');
});

test('Create Repo', async ({browser}, workerInfo) => {
const context = await load_logged_in_context(browser, workerInfo, 'user2');
const page = await context.newPage();

const response = await page.goto('/repo/create');
await expect(response?.status()).toBe(200); // Status OK
Copy link

@kdumontnu kdumontnu Jul 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some visual assertions to make sure the new repo page elements are loading correctly?

Maybe select some of (or all) of the dropdowns and make sure they appear? We've had issues with that breaking before.

Might want to look at the code for this and see if there is any javascript that's running and see if we can stress those code paths.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's reasonable to add ids to make the selectors a little less finicky

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of the dropdowns have selectors that collide which makes it a little tricky. Adding ids would be useful for more comprehensive testing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we should add an ID where the selectors are more tricky.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we tackle that in this PR?


await page.type('input[name=repo_name]', `test-repo-${workerInfo.workerIndex}`);
await page.click('form button.ui.green.button:visible');

await expect(page.url()).toBe(`${workerInfo.project.use.baseURL}/user2/test-repo-${workerInfo.workerIndex}`);
});