Files
myeasycms-v2/apps/e2e/tests/team-billing/team-billing.spec.ts
giancarlo b8f00f0a2d Refactor E2E tests, update utils, and modify plan-picker validation
Several changes have been made to optimize the testing and validation workflows. The end-to-end tests for user billing, invitations, account, team billing, and team accounts have been retouched for improved performance and better accuracy. There has been a minor modification in the validation rules for plan-picker in the billing component. Furthermore, modifications are made to several utility functions to fine-tune their operations.
2024-05-05 18:15:11 +07:00

35 lines
931 B
TypeScript

import { Page, expect, test } from '@playwright/test';
import { TeamBillingPageObject } from './team-billing.po';
test.describe('Team Billing', () => {
let page: Page;
let po: TeamBillingPageObject;
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.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: 25_000,
});
await po.billing.returnToBilling();
await expect(po.billing.getStatus()).toContainText('Active');
await expect(po.billing.manageBillingButton()).toBeVisible();
});
});