Skip to content
Merged
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
8 changes: 6 additions & 2 deletions playwright-plugin/tests/auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
// password field carries data-test=new-password either way, so key off whether
// the confirm field is present rather than off the labels, which change text
// between the two states.
//
// The data-test attributes sit on the v-text-field, which Vuetify renders as a
// wrapper div around the real <input>. Playwright can only fill the input, so
// fill() has to reach inside the wrapper.

import { test as setup, expect, Page } from '@playwright/test'
import { STORAGE_STATE } from '../playwright.config'
Expand Down Expand Up @@ -68,11 +72,11 @@ setup('sign in', async ({ page }) => {
await expect(page.locator('[data-test=new-password]')).toBeVisible({
timeout: 60 * 1000,
})
await page.locator('[data-test=new-password]').fill(PASSWORD)
await page.locator('[data-test=new-password] input').fill(PASSWORD)

if (await page.locator('[data-test=confirm-password]').isVisible()) {
// First run, COSMOS wants the password created
await page.locator('[data-test=confirm-password]').fill(PASSWORD)
await page.locator('[data-test=confirm-password] input').fill(PASSWORD)
await page.locator('[data-test=set-password]').click()
} else {
// A password already exists, e.g. re-running against a stack still up
Expand Down
Loading