test: init e2e

This commit is contained in:
scarqin 2023-02-25 01:06:28 +08:00
parent 64750d87c7
commit d91b0b8e4f

View File

@ -2,8 +2,30 @@ import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
await page.goto('http://localhost:4200/');
//Add group
await page.getByRole('banner').getByRole('button').hover();
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();
});