Skip to content

Commit

Permalink
fix: e2e tests navigation (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Riippi authored Aug 8, 2024
1 parent 66c7b7a commit 62659a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion e2e/tests/create-profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ test('Same email address cannot be used for multiple accounts', async ({
await newPage.goto(PROFILE_URL);
await clickLoginButton(newPage);
await newPage.locator('.login-method-helsinki_tunnus a').click();
await newPage.locator('a:text("Luo Helsinki-profiili")').click();
await newPage
.locator('a.hds-button:has-text("Luo Helsinki-profiili")')
.click();
await newPage
.getByPlaceholder('sähköpostiosoite@email.com')
.fill(mailbox.emailAddress);
Expand Down
5 changes: 3 additions & 2 deletions e2e/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export const clickLoginButton = async (page: Page) => {

export const clickServiceConnectionsLink = async (page: Page) => {
await page
.getByRole('link', { name: 'Käyttämäsi palvelut', exact: true })
.getByRole('navigation')
.getByRole('link', { name: 'Käyttämäsi palvelut' })
.click();
};

Expand Down Expand Up @@ -92,7 +93,7 @@ export const createProfile = async (page: Page, mailbox: Mailbox) => {
await page.goto(PROFILE_URL);
await clickLoginButton(page);
await page.locator('.login-method-helsinki_tunnus a').click();
await page.locator('a:text("Luo Helsinki-profiili")').click();
await page.locator('a.hds-button:has-text("Luo Helsinki-profiili")').click();
await page
.getByPlaceholder('sähköpostiosoite@email.com')
.fill(mailbox.emailAddress);
Expand Down

0 comments on commit 62659a2

Please sign in to comment.