Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Karimov committed Jan 9, 2024
1 parent 0c4a296 commit 93adcd7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
1 change: 0 additions & 1 deletion tests/e2e/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const e2ePaths = {
subscriptions: path.resolve( __dirname, '../specs/subscriptions' ),
blocks: path.resolve( __dirname, '../specs/blocks' ),
upe: path.resolve( __dirname, '../specs/upe' ),
upeSplit: path.resolve( __dirname, '../specs/upe-split' ),
};

// Allow E2E tests to run specific tests - wcpay, subscriptions, blocks, all (default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ import {
} from '../../../utils/payments';
const { shopper, merchant } = require( '@woocommerce/e2e-utils' );

// const UPE_METHOD_CHECKBOXES = [
// "//label[contains(text(), 'giropay')]/preceding-sibling::span/input[@type='checkbox']",
// // "//label[contains(text(), 'Bancontact')]/preceding-sibling::span/input[@type='checkbox']",
// // "//label[contains(text(), 'EPS')]/preceding-sibling::span/input[@type='checkbox']",
// // "//label[contains(text(), 'iDEAL')]/preceding-sibling::span/input[@type='checkbox']",
// // "//label[contains(text(), 'Sofort')]/preceding-sibling::span/input[@type='checkbox']",
// ];

const UPE_METHOD_CHECKBOXES = [
"//label[contains(text(), 'giropay')]/preceding-sibling::span/input[@type='checkbox']",
"//label[contains(text(), 'Bancontact')]/preceding-sibling::span/input[@type='checkbox']",
"//label[contains(text(), 'EPS')]/preceding-sibling::span/input[@type='checkbox']",
"//label[contains(text(), 'iDEAL')]/preceding-sibling::span/input[@type='checkbox']",
"//label[contains(text(), 'Sofort')]/preceding-sibling::span/input[@type='checkbox']",
'#inspector-checkbox-control-7', // giropay
];

describe( 'Enabled UPE with deferred intent creation', () => {
Expand All @@ -28,6 +32,7 @@ describe( 'Enabled UPE with deferred intent creation', () => {
await merchantWCP.enablePaymentMethod( UPE_METHOD_CHECKBOXES );
await merchant.logout();
await shopper.login();
console.log( 'a' );

Check warning on line 35 in tests/e2e/specs/upe/shopper/shopper-deferred-intent-creation-upe-enabled.spec.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
} );

afterAll( async () => {
Expand All @@ -39,11 +44,15 @@ describe( 'Enabled UPE with deferred intent creation', () => {

describe( 'Enabled UPE with deferred intent creation', () => {
it( 'should successfully place order with Giropay', async () => {
console.log( 'b' );

Check warning on line 47 in tests/e2e/specs/upe/shopper/shopper-deferred-intent-creation-upe-enabled.spec.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
await shopperWCP.goToShopWithCurrency( 'EUR' );
console.log( 'c' );

Check warning on line 49 in tests/e2e/specs/upe/shopper/shopper-deferred-intent-creation-upe-enabled.spec.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
await setupProductCheckout(
config.get( 'addresses.customer.billing' )
);
console.log( 'd' );

Check warning on line 53 in tests/e2e/specs/upe/shopper/shopper-deferred-intent-creation-upe-enabled.spec.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
await selectGiropayOnCheckout( page );
console.log( 'e' );

Check warning on line 55 in tests/e2e/specs/upe/shopper/shopper-deferred-intent-creation-upe-enabled.spec.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
await shopper.placeOrder();
await completeGiropayPayment( page, 'success' );
await page.waitForNavigation( {
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/utils/flows.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ export const shopperWCP = {
},

goToShopWithCurrency: async ( currency ) => {
console.log( 't' );

Check warning on line 72 in tests/e2e/utils/flows.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
await page.goto( SHOP_PAGE + `/?currency=${ currency }`, {
waitUntil: 'networkidle0',
} );
console.log( 'h' );

Check warning on line 76 in tests/e2e/utils/flows.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
},

goToOrders: async () => {
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/utils/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,14 @@ export async function setupProductCheckout(
) {
const cartItemsCounter = '.cart-contents .count';

console.log( 'productcheckout1' );

Check warning on line 260 in tests/e2e/utils/payments.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
await shopper.goToShop();

// Get the current number of items in the cart
let cartSize = await page.$eval( cartItemsCounter, ( e ) =>
Number( e.innerText.replace( /\D/g, '' ) )
);
console.log( 'productcheckout2' );

Check warning on line 267 in tests/e2e/utils/payments.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement

// Add items to the cart
for ( const line of lineItems ) {
Expand All @@ -279,6 +281,7 @@ export async function setupProductCheckout(
}
}

console.log( 'productcheckout3' );

Check warning on line 284 in tests/e2e/utils/payments.js

View workflow job for this annotation

GitHub Actions / JS linting

Unexpected console statement
await setupCheckout( billingDetails );
}

Expand Down

0 comments on commit 93adcd7

Please sign in to comment.