This commit introduces end-to-end tests for the user and team billing features. It also enhances existing billing configurations, logging, and error handling mechanisms. Refactoring has been done to simplify the code and make it more readable. Adjustments have also been made in the visual aspects of some components. The addition of these tests will help ensure the reliability of the billing features.
24 lines
662 B
TypeScript
24 lines
662 B
TypeScript
import { expect, Page, test } from '@playwright/test';
|
|
import { TeamBillingPageObject } from './team-billing.po';
|
|
|
|
test.describe('Team Billing', () => {
|
|
let page: Page;
|
|
let billing: TeamBillingPageObject;
|
|
|
|
test.beforeAll(async ({ browser }) => {
|
|
page = await browser.newPage();
|
|
billing = new TeamBillingPageObject(page);
|
|
|
|
await billing.setup();
|
|
});
|
|
|
|
test('a team can subscribe to a plan', async () => {
|
|
await billing.stripe.selectPlan(0);
|
|
await billing.stripe.proceedToCheckout();
|
|
|
|
await billing.stripe.fillForm();
|
|
await billing.stripe.submitForm();
|
|
|
|
await expect(billing.stripe.successStatus()).toBeVisible();
|
|
});
|
|
}); |