Files
payload/test/_community/e2e.spec.ts
2023-07-21 14:13:18 -04:00

27 lines
750 B
TypeScript

import type { Page } from '@playwright/test';
import { expect, test } from '@playwright/test';
import { AdminUrlUtil } from '../helpers/adminUrlUtil';
import { initPayloadE2E } from '../helpers/configHelpers';
const { beforeAll, describe } = test;
let url: AdminUrlUtil;
describe('Admin Panel', () => {
let page: Page;
beforeAll(async ({ browser }) => {
const { serverURL } = await initPayloadE2E(__dirname);
url = new AdminUrlUtil(serverURL, 'posts');
const context = await browser.newContext();
page = await context.newPage();
});
test('example test', async () => {
await page.goto(url.list);
const textCell = page.locator('.row-1 .cell-text');
await expect(textCell).toHaveText('example post');
});
});