Files
myeasycms-v2/apps/e2e/tests/utils/billing.po.ts
giancarlo 736e377462 Update billing status wording and increase wait timeout
The commit changes the expected text for billing status in both 'user-billing.spec.ts' and 'team-billing.spec.ts' from 'active' to 'Active'. In addition, the waiting time for the page to return to home in 'billing.po.ts' has been increased from 500ms to 1000ms to improve testing reliability.
2024-04-14 18:56:31 +08:00

44 lines
972 B
TypeScript

import { Page } from '@playwright/test';
import { StripePageObject } from './stripe.po';
export class BillingPageObject {
public readonly stripe: StripePageObject;
constructor(
private readonly page: Page,
) {
this.stripe = new StripePageObject(page);
}
plans() {
return this.page.locator('[data-test-plan]');
}
selectPlan(index: number = 0) {
const plans = this.plans();
return plans.nth(index).click();
}
manageBillingButton() {
return this.page.locator('manage-billing-redirect-button');
}
successStatus() {
return this.page.locator('[data-test="payment-return-success"]');
}
async returnToHome() {
await this.page.waitForTimeout(1000);
await this.successStatus().locator('button').click();
}
proceedToCheckout() {
return this.page.click('[data-test="checkout-submit-button"]');
}
async getStatus() {
return this.page.locator('[data-test="current-plan-card-status-badge"]');
}
}