Add end-to-end tests for user and team billing features

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.
This commit is contained in:
giancarlo
2024-04-14 17:15:04 +08:00
parent 1321b31ae4
commit d078e0021c
20 changed files with 330 additions and 140 deletions

View File

@@ -0,0 +1,24 @@
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();
});
});