Enhance E2E Tests and Configuration (#358)

* Enhance E2E Tests and Configuration

- Updated `.gitignore` to exclude `.auth/` directory for cleaner test environment.
- Added `test:fast` script in `package.json` for faster Playwright test execution.
- Configured Playwright to include a setup project for initializing tests.
- Introduced `AUTH_STATES` utility for managing authentication states in tests.
- Created `auth.setup.ts` for user authentication tests, ensuring proper login flows.
- Refactored various test files to utilize the new authentication state management, improving test reliability and maintainability.
- Adjusted team and user billing tests to streamline setup and enhance clarity.
- Refactored some dialogs
This commit is contained in:
Giancarlo Buomprisco
2025-09-21 12:28:42 +08:00
committed by GitHub
parent f157cc7f3e
commit 02e2502dcc
27 changed files with 661 additions and 407 deletions

View File

@@ -1,18 +1,13 @@
import { Page, expect, test } from '@playwright/test';
import { expect, test } from '@playwright/test';
import { AuthPageObject } from '../authentication/auth.po';
import { TeamBillingPageObject } from './team-billing.po';
test.describe('Team Billing', () => {
let page: Page;
let po: TeamBillingPageObject;
test('a team can subscribe to a plan', async ({ page }) => {
const po = new TeamBillingPageObject(page);
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
po = new TeamBillingPageObject(page);
});
test('a team can subscribe to a plan', async () => {
await po.setup();
await po.teamAccounts.setup();
await po.teamAccounts.goToBilling();
await po.billing.selectPlan(0);
@@ -23,7 +18,7 @@ test.describe('Team Billing', () => {
await po.billing.stripe.submitForm();
await expect(po.billing.successStatus()).toBeVisible({
timeout: 25_000,
timeout: 20_000,
});
await po.billing.returnToBilling();