Skip to content

Commit 24ca06f

Browse files
committed
test(auth): fix failing test (login before accessing page)
1 parent f2560ab commit 24ca06f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cypress/e2e/repo.cy.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
describe('Repo', () => {
22
beforeEach(() => {
3+
// Log in with default admin user
4+
cy.visit('/login');
5+
6+
cy.intercept('GET', '**/api/auth/me').as('getUser');
7+
8+
cy.get('[data-test="username"]').type('admin');
9+
cy.get('[data-test="password"]').type('admin');
10+
cy.get('[data-test="login"]').click();
11+
12+
cy.wait('@getUser');
13+
314
cy.visit('/dashboard/repo');
415

516
// prevent failures on 404 request and uncaught promises

0 commit comments

Comments
 (0)