diff --git a/e2e/api-group.test.ts b/e2e/api-group.test.ts index 922e1dd0..a9dd294c 100644 --- a/e2e/api-group.test.ts +++ b/e2e/api-group.test.ts @@ -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(); });