* 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
30 lines
876 B
TypeScript
30 lines
876 B
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
import { AuthPageObject } from '../authentication/auth.po';
|
|
import { TeamBillingPageObject } from './team-billing.po';
|
|
|
|
test.describe('Team Billing', () => {
|
|
test('a team can subscribe to a plan', async ({ page }) => {
|
|
const po = new TeamBillingPageObject(page);
|
|
|
|
await po.teamAccounts.setup();
|
|
await po.teamAccounts.goToBilling();
|
|
|
|
await po.billing.selectPlan(0);
|
|
await po.billing.proceedToCheckout();
|
|
|
|
await po.billing.stripe.waitForForm();
|
|
await po.billing.stripe.fillForm();
|
|
await po.billing.stripe.submitForm();
|
|
|
|
await expect(po.billing.successStatus()).toBeVisible({
|
|
timeout: 20_000,
|
|
});
|
|
|
|
await po.billing.returnToBilling();
|
|
|
|
await expect(po.billing.getStatus()).toContainText('Active');
|
|
await expect(po.billing.manageBillingButton()).toBeVisible();
|
|
});
|
|
});
|