Skip to content

Commit

Permalink
update surcharges
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Jun 3, 2024
1 parent 1f54647 commit 6afc07a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/Playwright/tests/Shared/products.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const allProducts = {
surcharge: {
'id': 16,//117,
'id': 14,//117,
"title": "Surcharge",
'link': '/product/surcharge/',
'sku': 'woo-surcharge',
Expand All @@ -11,7 +11,7 @@ const allProducts = {
'downloadable': 'no',
},
simple: {
'id': 15,//11,
'id': 13,//11,
"title": "Beanie",
'link': '/product/beanie/',
'sku': 'woo-beanie',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,18 @@ for (const [testAction, testActionData] of Object.entries(testData)) {
await updateMethodSetting(methodName, testActionData.payload);
if(!beforeAllRan) {
await emptyCart(baseURL);
await addProductToCart(baseURL, products.surcharge.id, testActionData.productQuantity);
let productQuantity = testActionData.productQuantity;
if(methodName === 'in3' || methodName === 'klarnasliceit'){
productQuantity = 10;
}
await addProductToCart(baseURL, products.surcharge.id, productQuantity);
const keys = Object.keys(testActionData.methods);
randomMethod = keys[Math.floor(Math.random() * Object.entries(testActionData.methods).length)];
console.log('randomMethod', randomMethod)
beforeAllRan = true;
}
await page.goto('/checkout/');
await
await selectPaymentMethodInCheckout(page, methodName);
let totalAmount = await captureTotalAmountCheckout(page);
totalAmount = parseTotalAmount(totalAmount);
Expand Down

0 comments on commit 6afc07a

Please sign in to comment.