Refactor billing process in e2e tests

Code for billing process was refactored in end-to-end tests for clean code and better structure. In the described tests, related codes and classes have been moved to a new class named BillingPageObject. All corresponding calls were updated accordingly.
This commit is contained in:
giancarlo
2024-04-14 17:54:15 +08:00
parent d078e0021c
commit 0824ac8e9f
8 changed files with 88 additions and 51 deletions

View File

@@ -45,7 +45,7 @@ export function CurrentPlanBadge(
}
return (
<Badge variant={variant}>
<Badge data-test={'current-plan-card-status-badge'} variant={variant}>
<Trans i18nKey={text} />
</Badge>
);

View File

@@ -73,7 +73,9 @@ export function CurrentSubscriptionCard({
}
/>
<span>{product.name}</span>
<span data-test={'current-plan-card-product-name'}>
{product.name}
</span>
<CurrentPlanBadge status={subscription.status} />
</div>
@@ -84,7 +86,7 @@ export function CurrentSubscriptionCard({
(e.g. trial ending soon, subscription canceled, etc.)
*/}
<If condition={!subscription.active}>
<div>
<div data-test={'current-plan-card-status-alert'}>
<CurrentPlanAlert status={subscription.status} />
</div>
</If>