Extract AdminOrderWorkflowService and status rules API; split AdminPage into composables and components; share order status constants; update tests. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
551 B
TypeScript
15 lines
551 B
TypeScript
import type { Page } from '@playwright/test'
|
|
import { expect } from '@playwright/test'
|
|
|
|
export async function loginAsAdmin(page: Page) {
|
|
await page.goto('/logga-in')
|
|
await page.getByLabel('E-postadress').fill('admin@bilhalsning.se')
|
|
await page.getByLabel('Lösenord').fill('test1234')
|
|
await page.getByRole('button', { name: 'Logga in' }).click()
|
|
await page.waitForURL('/')
|
|
}
|
|
|
|
export async function openAdminDashboard(page: Page) {
|
|
await page.goto('/admin')
|
|
await expect(page.locator('.admin__loading')).toBeHidden({ timeout: 30_000 })
|
|
}
|