tests: add local-first-new-page test

This commit is contained in:
tzhangchi
2022-12-23 22:06:48 +08:00
parent 07e1589706
commit 18bddad56e
+27
View File
@@ -0,0 +1,27 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
loadPage();
test.describe('Local first new page', () => {
test('Click btn new page', async ({ page }) => {
const originPageUrl = page.url();
await page.getByText('New Page').click();
const newPageUrl = page.url();
expect(newPageUrl).not.toBe(originPageUrl);
expect(newPageUrl.length).toBe(originPageUrl.length);
});
test('Click btn bew page and find it in all pages', async ({ page }) => {
await page.getByText('New Page').click();
await page.getByPlaceholder('Title').click();
await page.getByPlaceholder('Title').fill('this is a new page');
await page.getByRole('link', { name: 'All pages' }).click();
const cell = await page.getByRole('cell', { name: 'this is a new page' });
expect(cell).not.toBeUndefined();
});
});