mirror of
https://gitee.com/eolink_admin/postcat.git
synced 2024-12-03 12:18:22 +08:00
test: init e2e
This commit is contained in:
parent
64750d87c7
commit
d91b0b8e4f
@ -2,8 +2,30 @@ import { test, expect } from '@playwright/test';
|
|||||||
|
|
||||||
test('test', async ({ page }) => {
|
test('test', async ({ page }) => {
|
||||||
await page.goto('http://localhost:4200/');
|
await page.goto('http://localhost:4200/');
|
||||||
|
|
||||||
|
//Add group
|
||||||
await page.getByRole('banner').getByRole('button').hover();
|
await page.getByRole('banner').getByRole('button').hover();
|
||||||
await page.locator('a').filter({ hasText: 'New Group' }).click();
|
await page.locator('a').filter({ hasText: 'New Group' }).click();
|
||||||
await page.getByLabel('Group Name').fill('test');
|
await page.getByLabel('Group Name').fill('Parent Group');
|
||||||
|
await page.getByRole('button', { name: 'Confirm' }).click();
|
||||||
|
|
||||||
|
//Add sub group
|
||||||
|
await page.getByTitle('Parent Group').locator('div').nth(1).hover();
|
||||||
|
await page.getByTitle('Parent Group').getByRole('button').click();
|
||||||
|
await page.getByText('Add Subgroup').click();
|
||||||
|
await page.getByLabel('Group Name').fill('Sub Group');
|
||||||
|
await page.getByRole('button', { name: 'Confirm' }).click();
|
||||||
|
|
||||||
|
//Edit group
|
||||||
|
await page.getByTitle('Sub Group').locator('div').nth(1).hover();
|
||||||
|
await page.getByTitle('Sub Group').getByRole('button').click();
|
||||||
|
await page.getByText('Edit').click();
|
||||||
|
await page.getByLabel('Group Name').fill('Sub Group after');
|
||||||
|
await page.getByRole('button', { name: 'Confirm' }).click();
|
||||||
|
|
||||||
|
//Delete group
|
||||||
|
await page.getByTitle('Sub Group after').locator('div').nth(1).hover();
|
||||||
|
await page.getByTitle('Sub Group after').getByRole('button').click();
|
||||||
|
await page.getByText('Delete').click();
|
||||||
await page.getByRole('button', { name: 'Confirm' }).click();
|
await page.getByRole('button', { name: 'Confirm' }).click();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user