Adds various helpers to make it easier and more standard to manage array fields within e2e tests. Retrofits existing tests to ensure consistent interactions across the board, and also organizes existing blocks and relationship field helpers in the same way. --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1211094073049046
22 lines
534 B
TypeScript
22 lines
534 B
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
import { wait } from 'payload/shared'
|
|
|
|
export async function openDocDrawer({
|
|
page,
|
|
selector,
|
|
withMetaKey = false,
|
|
}: {
|
|
page: Page
|
|
selector: string
|
|
withMetaKey?: boolean
|
|
}): Promise<void> {
|
|
let clickProperties = {}
|
|
if (withMetaKey) {
|
|
clickProperties = { modifiers: ['ControlOrMeta'] }
|
|
}
|
|
await wait(500) // wait for parent form state to initialize
|
|
await page.locator(selector).click(clickProperties)
|
|
await wait(500) // wait for drawer form state to initialize
|
|
}
|