Skip to content

Commit

Permalink
fix(e2e): fix cleeng tests (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh authored Sep 26, 2024
1 parent 0e5af77 commit 5231d86
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions platforms/web/test-e2e/tests/offers/choose_offer_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const jwProps: ProviderProps = {
fieldWrapper: '',
hasInlineOfferSwitch: true,
};

const cleengProps: ProviderProps = {
config: testConfigs.svod,
monthlyOffer: constants.offers.monthlyOffer.cleeng,
Expand Down
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 5231d86

Please sign in to comment.