Update e2e

This commit is contained in:
Ilyas Foo 2022-04-14 09:33:26 +08:00
parent adbc101312
commit 0fb4b5d9f5
3 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,8 @@
- Update test for payment task. #32467 - Update test for payment task. #32467
- Increase timeout threshold for payment task. #32605
# 1.0.0 # 1.0.0
- Add returned type annotations and remove unused vars. #8020 - Add returned type annotations and remove unused vars. #8020

View File

@ -32,6 +32,7 @@ export class PaymentsSetup extends BasePage {
`${ selector }[aria-expanded=false]` `${ selector }[aria-expanded=false]`
); );
await toggleButton?.click(); await toggleButton?.click();
await waitForElementByText( 'h2', 'Offline payment methods' );
} }
async goToPaymentMethodSetup( async goToPaymentMethodSetup(

View File

@ -54,6 +54,9 @@ const testAdminPaymentSetupTask = () => {
it( 'Saving valid bank account transfer details enables the payment method', async () => { it( 'Saving valid bank account transfer details enables the payment method', async () => {
await paymentsSetup.showOtherPaymentMethods(); await paymentsSetup.showOtherPaymentMethods();
await takeScreenshotFor(
'Payment setup task show other payment methods'
);
await paymentsSetup.goToPaymentMethodSetup( 'bacs' ); await paymentsSetup.goToPaymentMethodSetup( 'bacs' );
await bankTransferSetup.saveAccountDetails( { await bankTransferSetup.saveAccountDetails( {
accountNumber: '1234', accountNumber: '1234',
@ -78,6 +81,9 @@ const testAdminPaymentSetupTask = () => {
await homeScreen.clickOnTaskList( 'Set up payments' ); await homeScreen.clickOnTaskList( 'Set up payments' );
await paymentsSetup.isDisplayed(); await paymentsSetup.isDisplayed();
await paymentsSetup.showOtherPaymentMethods(); await paymentsSetup.showOtherPaymentMethods();
await takeScreenshotFor(
'Payment setup task show other payment methods'
);
await paymentsSetup.enableCashOnDelivery(); await paymentsSetup.enableCashOnDelivery();
await waitForTimeout( 1500 ); await waitForTimeout( 1500 );
expect( await settings.paymentMethodIsEnabled( 'cod' ) ).toBe( expect( await settings.paymentMethodIsEnabled( 'cod' ) ).toBe(