Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWC-7102 - Fix chromium e2e tests (locally) #5553

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion e2e/helpers/testUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function loginTestUser(
await acceptSiteCookies(page)

// Login
await page.getByRole('link', { name: 'Log in to Synapse' }).first().click()
await page.getByRole('button', { name: 'Login' }).first().click()
await page.getByRole('button', { name: 'Sign in with your email' }).click()

const usernameInput = page.getByLabel('Username or Email Address')
Expand Down
16 changes: 7 additions & 9 deletions e2e/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,25 @@ test.describe('Homepage - Unauthenticated', () => {
await page.goto('/')
await waitForInitialPageLoad(page)

await expect(page.getByRole('button', { name: 'Login' })).toHaveCount(1)
await expect(
page.getByRole('link', { name: 'Log in to Synapse' }),
).toHaveCount(1)
await expect(
page.getByRole('link', { name: 'View Your Dashboard' }),
page.getByRole('button', { name: 'View Dashboard' }),
).toHaveCount(0)
})
})

testAuth.describe('Homepage - Authenticated', () => {
testAuth(
'should show View Your Dashboard button when logged in',
'should show View Dashboard button when logged in',
async ({ userPage }) => {
await userPage.goto('/Home:x')
await waitForInitialPageLoad(userPage)

await expect(userPage.getByRole('button', { name: 'Login' })).toHaveCount(
0,
)
await expect(
userPage.getByRole('link', { name: 'Log in to Synapse' }),
).toHaveCount(0)
await expect(
userPage.getByRole('link', { name: 'View Your Dashboard' }),
userPage.getByRole('button', { name: 'View Dashboard' }),
).toHaveCount(1)
},
)
Expand Down