Skip to content

Commit

Permalink
chore(e2e): payments tests stability improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Dec 4, 2024
1 parent 4ae0b7e commit 08a72b0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class JWPSubscriptionService extends SubscriptionService {
protected readonly accountService: JWPAccountService;
protected readonly apiService: JWPAPIService;

constructor(@named('JWP') accountService: AccountService, @inject(JWPAPIService) apiService: JWPAPIService) {
constructor(@named('JWP') @inject(AccountService) accountService: AccountService, @inject(JWPAPIService) apiService: JWPAPIService) {
super();

this.accountService = accountService as JWPAccountService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ const Checkout = () => {

const paymentMethod = paymentMethods?.find((method) => method.id === parseInt(paymentMethodId));
const noPaymentRequired = !order?.requiredPaymentDetails;
const isStripePayment = paymentMethod?.methodName === 'card' && paymentMethod?.provider === 'stripe';
const isAdyenPayment = paymentMethod?.methodName === 'card' && paymentMethod?.paymentGateway === 'adyen';
const isPayPalPayment = paymentMethod?.methodName === 'paypal';
const isStripePayment = !noPaymentRequired && paymentMethod?.methodName === 'card' && paymentMethod?.provider === 'stripe';
const isAdyenPayment = !noPaymentRequired && paymentMethod?.methodName === 'card' && paymentMethod?.paymentGateway === 'adyen';
const isPayPalPayment = !noPaymentRequired && paymentMethod?.methodName === 'paypal';

return (
<CheckoutForm
Expand Down
2 changes: 1 addition & 1 deletion platforms/web/test-e2e/utils/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function formatDate(date: Date) {
export async function finishSubscription(I: CodeceptJS.I) {
I.click('Continue');
I.waitForText(`Welcome to JW OTT Web App (SVOD)`, longTimeout);
I.waitForText(`Thank you for subscribing to JW OTT Web App (SVOD). Please enjoy all our content.`);
I.waitForText(`Thank you for subscribing to JW OTT Web App (SVOD). Please enjoy all our content.`, longTimeout);

I.click('Start watching');
}
Expand Down
4 changes: 2 additions & 2 deletions platforms/web/test-e2e/utils/steps_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TestConfig } from '@jwp/ott-testing/constants';

import { randomDate } from './randomizers';

import constants, { makeShelfXpath, normalTimeout, ShelfId } from '#utils/constants';
import constants, { longTimeout, makeShelfXpath, normalTimeout, ShelfId } from '#utils/constants';
import passwordUtils, { LoginContext } from '#utils/password_utils';

const configFileQueryKey = 'app-config';
Expand Down Expand Up @@ -235,7 +235,7 @@ const stepsObj = {
});
},
waitForLoaderDone: function (this: CodeceptJS.I) {
this.dontSeeElement(loaderElement);
this.limitTime(longTimeout).dontSeeElement(loaderElement);
},
openSignUpModal: async function (this: CodeceptJS.I) {
const { isMobile } = await this.openSignInMenu();
Expand Down

0 comments on commit 08a72b0

Please sign in to comment.