Files
chore/frontend/vue-app/e2e/auth-cc.setup.ts
Ryan Kegel ef9cb01d92
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m39s
feat: add enable/disable toggle for chore scheduling in ScheduleModal
- Introduced a toggle button to enable or disable chores in the scheduler.
- The toggle will be available in both types of schedulers.
- Added UI design proposal and considerations for mobile dimensions.
- Included E2E tests to ensure toggle state persistence and correct behavior in child view.
2026-03-20 16:42:13 -04:00

43 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test as setup } from '@playwright/test'
import { STORAGE_STATE_CC, E2E_CC_EMAIL, E2E_CC_PASSWORD, E2E_CC_PIN } from './e2e-constants'
const BACKEND = 'http://localhost:5000'
setup('authenticate create-child isolated user', async ({ page }) => {
// Create the isolated create-child test user (separate from the main E2E user).
// This user starts with no children so deleteAllChildren() in the empty-state test
// never interferes with concurrent tests running under the main E2E user.
const createRes = await page.request.post(`${BACKEND}/auth/e2e-create-cc-user`)
if (!createRes.ok()) {
throw new Error(`e2e-create-cc-user failed: ${createRes.status()} ${await createRes.text()}`)
}
await page.goto('/auth/login')
await page.getByLabel('Email address').fill(E2E_CC_EMAIL)
await page.getByLabel('Password').fill(E2E_CC_PASSWORD)
await page.getByRole('button', { name: 'Sign in' }).click()
await page.waitForURL(/\/(parent|child)/)
await page.getByRole('button', { name: 'Parent login' }).click()
const pinInput = page.getByPlaceholder('46 digits')
await pinInput.waitFor({ timeout: 5000 })
await pinInput.fill(E2E_CC_PIN)
await page.getByLabel('Stay in parent mode on this device').check()
await page.getByRole('button', { name: 'OK' }).click()
await page.waitForURL(/\/parent(\/|$)/)
try {
await page.getByRole('button', { name: 'Add Child' }).waitFor({ timeout: 5000 })
} catch (e) {
await page.screenshot({ path: 'auth-setup-cc-parent-fail.png' })
throw new Error(
'CC user parent mode not reached after PIN entry. See auth-setup-cc-parent-fail.png for details.',
)
}
await page.context().storageState({ path: STORAGE_STATE_CC })
})