chore: setup payload 3 + next 16 foundation with ipal-kit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { Page } from '@playwright/test'
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
export interface LoginOptions {
|
||||
page: Page
|
||||
serverURL?: string
|
||||
user: {
|
||||
email: string
|
||||
password: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the user into the admin panel via the login page.
|
||||
*/
|
||||
export async function login({
|
||||
page,
|
||||
serverURL = 'http://localhost:3000',
|
||||
user,
|
||||
}: LoginOptions): Promise<void> {
|
||||
await page.goto(`${serverURL}/admin/login`)
|
||||
|
||||
await page.fill('#field-email', user.email)
|
||||
await page.fill('#field-password', user.password)
|
||||
await page.click('button[type="submit"]')
|
||||
|
||||
await page.waitForURL(`${serverURL}/admin`)
|
||||
|
||||
const dashboardArtifact = page.locator('.step-nav__first')
|
||||
await expect(dashboardArtifact).toBeVisible()
|
||||
}
|
||||
Reference in New Issue
Block a user