2022-12-30 16:40:15 +03:00
|
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
import { loadPage } from './libs/load-page';
|
2022-12-30 21:03:48 +03:00
|
|
|
import { newPage } from './libs/page-logic';
|
2022-12-30 16:40:15 +03:00
|
|
|
loadPage();
|
|
|
|
|
2022-12-30 21:03:48 +03:00
|
|
|
test.describe('local first new page', () => {
|
2022-12-30 16:40:15 +03:00
|
|
|
test('click btn new page', async ({ page }) => {
|
|
|
|
const originPageId = page.url().split('/').reverse()[0];
|
2022-12-30 21:03:48 +03:00
|
|
|
await newPage(page);
|
2022-12-30 16:40:15 +03:00
|
|
|
const newPageId = page.url().split('/').reverse()[0];
|
|
|
|
expect(newPageId).not.toBe(originPageId);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('click btn bew page and find it in all pages', async ({ page }) => {
|
2022-12-30 21:03:48 +03:00
|
|
|
await newPage(page);
|
2022-12-30 16:40:15 +03:00
|
|
|
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 = page.getByRole('cell', { name: 'this is a new page' });
|
|
|
|
expect(cell).not.toBeUndefined();
|
|
|
|
});
|
|
|
|
});
|