Update user billing flow and improve error handling
Updated the user billing process to add a return to home function and redirect users to their specific account page after payment. Enhanced error handling in the billing event handler to handle scenarios where no account id is found in the subscription. Removed unused billing page object from the stripe page object.
This commit is contained in:
@@ -20,8 +20,11 @@ test.describe('User Billing', () => {
|
||||
await po.billing.stripe.submitForm();
|
||||
|
||||
await expect(po.billing.successStatus()).toBeVisible();
|
||||
await po.billing.returnToHome();
|
||||
|
||||
await page.goto('/home/billing');
|
||||
await page.locator('a', {
|
||||
hasText: 'Billing',
|
||||
}).click();
|
||||
|
||||
await expect(await po.billing.getStatus()).toContainText('active');
|
||||
await expect(po.billing.manageBillingButton()).toBeVisible();
|
||||
|
||||
@@ -29,6 +29,7 @@ export class BillingPageObject {
|
||||
}
|
||||
|
||||
async returnToHome() {
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.successStatus().locator('button').click();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { Page, expect } from '@playwright/test';
|
||||
import { BillingPageObject } from './billing.po';
|
||||
|
||||
export class StripePageObject {
|
||||
private readonly page: Page;
|
||||
public readonly billing: BillingPageObject;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.billing = new BillingPageObject(page);
|
||||
}
|
||||
|
||||
getStripeCheckoutIframe() {
|
||||
|
||||
Reference in New Issue
Block a user