Skip to content

Commit

Permalink
fix(e2e): fix cleeng tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Sep 26, 2024
1 parent 0e5af77 commit 4e54760
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions platforms/web/test-e2e/tests/payments/payments_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const jwProps: ProviderProps = {
canRenewSubscription: false,
fieldWrapper: '',
hasInlineOfferSwitch: true,
cardInfo: Array.of(['Card number', '•••• •••• •••• 1111'], ['Expiry date', '03/2030'], ['Security code', '******']),
};

const cleengProps: ProviderProps = {
Expand All @@ -27,6 +28,7 @@ const cleengProps: ProviderProps = {
canRenewSubscription: true,
fieldWrapper: 'iframe',
hasInlineOfferSwitch: false,
cardInfo: Array.of(['Card number', '•••• •••• •••• 1115'], ['Expiry date', '03/2030'], ['Security code', '******']),
};

runTestSuite(jwProps, 'JW Player');
Expand All @@ -37,8 +39,6 @@ function runTestSuite(props: ProviderProps, providerName: string) {

const today = new Date();

const cardInfo = Array.of(['Card number', '•••• •••• •••• 1111'], ['Expiry date', '03/2030'], ['Security code', '******']);

Feature(`payments - ${providerName}`).retry(Number(process.env.TEST_RETRY_COUNT) || 0);

Before(async ({ I }) => {
Expand Down Expand Up @@ -84,7 +84,7 @@ function runTestSuite(props: ProviderProps, providerName: string) {

await checkSubscription(I, addYear(today), today, props.yearlyOffer.price, props.hasInlineOfferSwitch);

cardInfo.forEach(([label, value]) => I.seeInField(label, value));
props.cardInfo.forEach(([label, value]) => I.seeInField(label, value));
});

Scenario(`I can cancel my subscription - ${providerName}`, async ({ I }) => {
Expand All @@ -93,7 +93,7 @@ function runTestSuite(props: ProviderProps, providerName: string) {
await cancelPlan(I, addYear(today), props.canRenewSubscription, providerName);

// Still see payment info
cardInfo.forEach(([label, value]) => I.seeInField(label, value));
props.cardInfo.forEach(([label, value]) => I.seeInField(label, value));
});

Scenario(`I can renew my subscription - ${providerName}`, async ({ I }) => {
Expand Down
2 changes: 1 addition & 1 deletion platforms/web/test-e2e/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ export default {
},
creditCard: {
inplayer: '4111111111111111',
cleeng: '5555444433331111',
cleeng: '5555341244441115',
},
};
1 change: 1 addition & 0 deletions platforms/web/test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ export type ProviderProps = {
locale?: string | undefined;
fieldWrapper?: string;
hasInlineOfferSwitch: boolean;
cardInfo: string[][];
};

0 comments on commit 4e54760

Please sign in to comment.