Skip to content

Commit

Permalink
Add e2e test for Make a 🍊 payment with "Review test cancel" names
Browse files Browse the repository at this point in the history
  • Loading branch information
mescalantea committed Feb 4, 2025
1 parent 8feb2a4 commit d2ec1c3
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests-e2e/specs/001-checkout-product.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.describe('Product checkout', () => {
await checkoutPage.waitForOrderSuccess();
});

test.only('Make a 🍊 payment with "Review test approve" names', async ({ helper, dataProvider, backOffice, productPage, checkoutPage }) => {
test('Make a 🍊 payment with "Review test approve" names', async ({ helper, dataProvider, backOffice, productPage, checkoutPage }) => {
// Setup
const { dummy_config } = helper.webhooks;
await helper.executeWebhook({ webhook: dummy_config }); // Setup for physical products.
Expand All @@ -44,18 +44,21 @@ test.describe('Product checkout', () => {
await checkoutPage.fillForm(shopper);
await checkoutPage.placeOrder({ ...shopper, product: 'i1' });
await checkoutPage.waitForOrderSuccess();
await checkoutPage.expectOrderChangeTo(backOffice, { toStatus: 'Processing' });
await checkoutPage.expectOrderChangeTo(backOffice, { fromStatus: 'Pending Payment', toStatus: 'Processing' });
});

// test('Make a 🍊 payment with "Review test cancel" names', async ({ productPage, checkoutPage }) => {
// await checkoutPage.setupForPhysicalProducts();
// await productPage.addToCart({ slug: 'sunglasses', quantity: 1 });

// await checkoutPage.goto();
// await checkoutPage.fillWithReviewTest({ shopper: 'cancel' });
// await checkoutPage.expectPaymentMethodsBeingReloaded();
// await checkoutPage.placeOrderUsingI1({});
// await checkoutPage.waitForOrderOnHold();
// await checkoutPage.expectOrderChangeTo({ toStatus: 'wc-cancelled' });
// });
test('Make a 🍊 payment with "Review test cancel" names', async ({ helper, dataProvider, backOffice, productPage, checkoutPage }) => {
// Setup
const { dummy_config } = helper.webhooks;
await helper.executeWebhook({ webhook: dummy_config }); // Setup for physical products.
const shopper = dataProvider.shopper('cancel');

// Execution
await productPage.addToCart({ slug: 'push-it-messenger-bag', quantity: 1 });
await checkoutPage.goto();
await checkoutPage.fillForm(shopper);
await checkoutPage.placeOrder({ ...shopper, product: 'i1' });
await checkoutPage.waitForOrderSuccess();
await checkoutPage.expectOrderChangeTo(backOffice, { fromStatus: 'Pending Payment', toStatus: 'Canceled' });
});
});

0 comments on commit d2ec1c3

Please sign in to comment.