2023-02-05 13:41:18 +03:00
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
import { test } from './libs/playwright.js';
|
2023-01-09 07:20:53 +03:00
|
|
|
import { loadPage } from './libs/load-page.js';
|
|
|
|
import { newPage } from './libs/page-logic.js';
|
2022-12-30 16:40:15 +03:00
|
|
|
loadPage();
|
|
|
|
|
2023-02-05 12:53:14 +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();
|
|
|
|
});
|
|
|
|
});
|