Refactor E2E tests and mock APIs for improved reliability and maintainability

- Updated E2E tests to use specific role-based heading selectors for better robustness.
- Enhanced mock routes in `auth.ts` to handle detailed organization endpoints more effectively.
- Improved test flow by adding `waitUntil: 'networkidle'` to navigation steps.
- Refined `admin-access.spec.ts` interactions to use optimized wait and click implementations for better performance.
- Updated dialog texts and field labels to match latest UI changes.
This commit is contained in:
Felipe Cardoso
2025-11-07 00:02:01 +01:00
parent f99de75dc6
commit f8b77200f0
5 changed files with 45 additions and 37 deletions

View File

@@ -150,17 +150,17 @@ test.describe('Admin Organization Members - AddMemberDialog E2E Tests', () => {
});
test('should display dialog description', async ({ page }) => {
await expect(page.getByText(/Add a new member to this organization/i)).toBeVisible();
await expect(page.getByText(/Add a user to this organization and assign them a role/i)).toBeVisible();
});
test('should display user email select field', async ({ page }) => {
const dialog = page.locator('[role="dialog"]');
await expect(dialog.getByText('User Email')).toBeVisible();
await expect(dialog.getByText('User Email *')).toBeVisible();
});
test('should display role select field', async ({ page }) => {
const dialog = page.locator('[role="dialog"]');
await expect(dialog.getByText('Role')).toBeVisible();
await expect(dialog.getByText('Role *')).toBeVisible();
});
test('should display add member and cancel buttons', async ({ page }) => {