Refactor e2e test code and reduce test timeout
The end-to-end tests have been refactored for clarity and maintainability. This includes changes in how the 'Billing' link is accessed, addition of comments and small coding improvements. Moreover, the test timeout has been reduced from 2 minutes to 1 for efficiency. Changes were also applied to the text content in locales file and minor fixes in component styling.
This commit is contained in:
@@ -32,8 +32,8 @@ export default defineConfig({
|
||||
trace: 'on-first-retry'
|
||||
},
|
||||
|
||||
// test timeout set to 2 minutes
|
||||
timeout: 2 * 60 * 1000,
|
||||
// test timeout set to 1 minutes
|
||||
timeout: 60 * 1000,
|
||||
expect: {
|
||||
// expect timeout set to 10 seconds
|
||||
timeout: 10 * 1000
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { expect, Page, test } from '@playwright/test';
|
||||
import { TeamBillingPageObject } from './team-billing.po';
|
||||
import exp from 'node:constants';
|
||||
|
||||
test.describe('Team Billing', () => {
|
||||
let page: Page;
|
||||
|
||||
@@ -22,9 +22,11 @@ test.describe('User Billing', () => {
|
||||
await expect(po.billing.successStatus()).toBeVisible();
|
||||
await po.billing.returnToHome();
|
||||
|
||||
await page.locator('a', {
|
||||
hasText: 'Billing',
|
||||
}).click();
|
||||
const link = page.locator('a', {
|
||||
hasText: 'Billing'
|
||||
});
|
||||
|
||||
await link.click();
|
||||
|
||||
await expect(await po.billing.getStatus()).toContainText('Active');
|
||||
await expect(po.billing.manageBillingButton()).toBeVisible();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Page } from '@playwright/test';
|
||||
import { expect, Page } from '@playwright/test';
|
||||
import { StripePageObject } from './stripe.po';
|
||||
|
||||
export class BillingPageObject {
|
||||
@@ -29,6 +29,7 @@ export class BillingPageObject {
|
||||
}
|
||||
|
||||
async returnToHome() {
|
||||
// wait a bit for the webhook to be processed
|
||||
await this.page.waitForTimeout(1000);
|
||||
|
||||
await this.successStatus().locator('button').click();
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
"resetPasswordError": "Sorry, we could not reset your password. Please try again.",
|
||||
"emailPlaceholder": "your@email.com",
|
||||
"inviteAlertHeading": "You have been invited to join a team",
|
||||
"inviteAlertBody": "You have been invited to join a team. Please sign in or sign up to accept the invite.",
|
||||
"inviteAlertBody": "Please sign in or sign up to accept the invite and join the team.",
|
||||
"errors": {
|
||||
"Invalid login credentials": "The credentials entered are invalid",
|
||||
"User already registered": "This credential is already in use. Please try with another one.",
|
||||
|
||||
@@ -17,7 +17,7 @@ export function LineItemDetails(
|
||||
}>,
|
||||
) {
|
||||
return (
|
||||
<div className={'flex flex-col space-y-1 px-1'}>
|
||||
<div className={'flex flex-col space-y-1'}>
|
||||
{props.lineItems.map((item) => {
|
||||
// If the item has a description, we render it as a simple text
|
||||
// and pass the item as values to the translation so we can use
|
||||
|
||||
Reference in New Issue
Block a user