Files
myeasycms-v2/apps/e2e/tests/user-billing/user-billing.spec.ts
giancarlo 2ff08a971d Update Zod package, improve code formatting, and add awaiting indicators
This commit includes three main changes. First, it updates the Zod library from version 3.23.4 to 3.23.5 across all relevant packages. Second, code readability has been enhanced by formatting modifications in several TypeScript files. Lastly, the user feedback on certain operations such as creating a team or charging for a payment is strengthened, by displaying an awaiting indicator until the operation is complete.
2024-04-30 13:16:51 +07:00

33 lines
852 B
TypeScript

import { Page, expect, test } from '@playwright/test';
import { UserBillingPageObject } from './user-billing.po';
test.describe('User Billing', () => {
let page: Page;
let po: UserBillingPageObject;
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
po = new UserBillingPageObject(page);
await po.setup();
});
test('user can subscribe to a plan', async ({ page }) => {
await po.billing.selectPlan(0);
await po.billing.proceedToCheckout();
await po.billing.stripe.fillForm();
await po.billing.stripe.submitForm();
await expect(po.billing.successStatus()).toBeVisible({
timeout: 30000,
});
await po.billing.returnToBilling();
await expect(po.billing.getStatus()).toContainText('Active');
await expect(po.billing.manageBillingButton()).toBeVisible();
});
});