From 2c04bf800e911b137900aab8326451abfaec60cd Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Thu, 16 May 2024 11:00:35 +0200 Subject: [PATCH] Update autotest to fit kb --- .idea/WooCommerce.iml | 10 +- .idea/phpunit.xml | 2 +- tests/Playwright/.gitignore | 10 +- tests/Playwright/README.md | 13 + tests/Playwright/globalSetup.js | 12 + tests/Playwright/package.json | 16 +- tests/Playwright/playwright.config.js | 183 +++-- tests/Playwright/tests/Shared/base-test.js | 22 + tests/Playwright/tests/Shared/gateways.js | 17 + tests/Playwright/tests/Shared/manualOrder.js | 38 + .../tests/Shared/methodsConfig.json | 346 +++++++++ tests/Playwright/tests/Shared/mollieUtils.js | 275 +++++++ tests/Playwright/tests/Shared/products.js | 70 ++ .../Shared/setup-default-settings-merchant.js | 8 + tests/Playwright/tests/Shared/sharedUrl.js | 7 + tests/Playwright/tests/Shared/test-logo.png | Bin 0 -> 4767 bytes .../tests/Shared/testMollieInWooPage.js | 55 ++ tests/Playwright/tests/Shared/wooUtils.js | 250 +++++++ tests/Playwright/tests/Shared/wpUtils.js | 77 ++ .../_transaction_scenarios_chargeback.spec.js | 15 + ...rios_apple_pay_button_-_block_cart.spec.js | 25 + ...os_apple_pay_button_-_classic_cart.spec.js | 25 + ...s_apple_pay_button__-_product_page.spec.js | 40 + ...enarios_paypal_button_-_block_cart.spec.js | 45 ++ ...arios_paypal_button_-_classic_cart.spec.js | 45 ++ ...arios_paypal_button_-_product_page.spec.js | 60 ++ .../merchant-setup/API Keys Configuration.md | 32 + .../Connect to Test or Prod Platform.md | 52 ++ .../Test Connection with WLOP Platform.md | 34 + .../Error Handling/_error_handling.spec.js | 20 + .../Error Handling/testData.js | 37 + .../tests/plugin-foundation/Logging.md | 46 ++ .../Accessing Documentation Support.md | 27 + .../_mollie_settings_tab_advanced.spec.js | 104 +++ ...llie_settings_tab_apple_pay_button.spec.js | 55 ++ .../Backend Configuration Page.md | 37 + ...ance with UI Design in Payment Settings.md | 25 + .../Define Checkout Language.md | 39 + .../Edit Payment Button Title.md | 41 ++ .../plugin-settings/Edit Payment method.md | 37 + ...ce 3DSv2 Strong Customer Authentication.md | 27 + .../plugin-settings/Group Card Brands.md | 33 + ...gration Listing in WooCommerce Settings.md | 27 + ...lie_settings_tab_mollie_components.spec.js | 35 + ...ttings_tab_payment_method_settings.spec.js | 94 +++ ...thod_settings_credit_card_settings.spec.js | 162 +++++ ...ethod_settings_gift_cards_settings.spec.js | 71 ++ ...t_method_settings_voucher_settings.spec.js | 79 ++ .../Selecting Checkout Types.md | 27 + ...Translate Default Payment Button Titles.md | 27 + ...ios_3rd_party_plugin_compatibility.spec.js | 40 + ...transaction_scenarios_versions_php.spec.js | 39 + ...e-activated-with-php-version-lower-than.md | 28 + ...successful-transaction-with-php-version.md | 27 + .../compatibility/theme-compatibility.md | 28 + ...ion_scenarios_versions_woocommerce.spec.js | 242 +++++++ ...-when-woocommerce-not-available-warning.md | 28 + ...ted-when-woocommerce-version-lower-than.md | 30 + ...ivated-while-woocommerce-is-deactivated.md | 29 + ...running-on-woocommerce-expected-version.md | 30 + ...ction_scenarios_versions_wordpress.spec.js | 111 +++ ...tivated-on-wordpress-version-lower-than.md | 29 + ...ng Coupons with Selected Payment Method.md | 35 + ...ry-Specific Payment Method Availability.md | 37 + ...laying Payment Methods on Checkout Page.md | 29 + ...orm Validation and Plugin Compatibility.md | 28 + ...ment Method Limitations Based on Amount.md | 46 ++ ...nt Method Limitations Based on Currency.md | 42 ++ ...hod Visibility for Different User Types.md | 37 + ...ng Charges with Selected Payment Method.md | 29 + ...ting Taxes with Selected Payment Method.md | 28 + .../User Notification on Plugin Errors.md | 27 + .../_woocommerce_payments_tab.spec.js | 36 + .../_transaction_scenarios.spec.js | 35 + .../_transaction_scenarios_boundaries.spec.js | 20 + ...scenarios_different_curencies_euro.spec.js | 22 + ..._scenarios_different_curencies_usd.spec.js | 22 + .../merchant-setup/API Keys Configuration.md | 32 + .../merchant-setup/Account link.md | 26 + .../Auto Trim Spaces at End of Keys.md | 29 + .../Connect to Test or Prod Platform.md | 52 ++ .../merchant-setup/Contact Us.md | 27 + .../Create account - Sign Up.md | 31 + .../End-Point URL Configuration.md | 58 ++ .../_mollie_settings_tab_general.spec.js | 72 ++ .../shared-stories/merchant-setup/PSPID.md | 33 + .../Test Connection with WLOP Platform.md | 34 + .../merchant-setup/Tooltips for fields.md | 26 + .../merchant-setup/documentation link.md | 26 + ...review-future-progress-on-a-test-system.md | 33 + ...er-QA-PO-support-I-can-create-a-package.md | 29 + .../Plugins page/_plugins_page.spec.js | 40 + ...ugin-version-is-displayed-per-ui-design.md | 27 + ...activation-of-the-latest-plugin-version.md | 31 + .../validate-automatic-plugin-update.md | 29 + ...activation-of-the-latest-plugin-version.md | 30 + ...stallation-of-the-latest-plugin-version.md | 28 + .../validate-manual-plugin-update.md | 40 + ...-uninstalling-the-latest-plugin-version.md | 31 + ...Adding Order Note for Successful Refund.md | 31 + ...fund Status Update to an Existing Order.md | 31 + ...Refund Status in WooCommerce Order Page.md | 53 ++ ... Refunds from the Worldline Back Office.md | 48 ++ .../Refund from the WooCommerce Order Page.md | 43 ++ ...ng Orders with Discounts and Promotions.md | 41 ++ .../_transaction_scenarios_refunds.spec.js | 280 +++++++ .../Backend Order Data Management.md | 27 + .../Backend Order Transaction ID.md | 27 + .../transaction/Map Statuses.md | 25 + .../transaction/Merchant Reference.md | 32 + .../Authorization-Sale Modes.md | 33 + ...thorization from WooCommerce Order Page.md | 45 ++ .../Cancelling Payment Action.md | 29 + .../Capture Payment Action.md | 52 ++ ...n_scenarios_coupons_fixed_discount.spec.js | 64 ++ ...ios_coupons_fixed_product_discount.spec.js | 82 +++ ...narios_coupons_percentage_discount.spec.js | 52 ++ ...rios_cross-browser_chrome_(latest).spec.js | 22 + ...narios_cross-browser_edge_(latest).spec.js | 22 + ...ios_cross-browser_firefox_(latest).spec.js | 22 + ...ser_microsoft_internet_explorer_11.spec.js | 22 + ...arios_cross-browser_opera_(latest).spec.js | 22 + ...rios_cross-browser_safari_(latest).spec.js | 22 + ...grity with Coupons, Taxes, and Shipping.md | 75 ++ .../_transaction_scenarios_shipment.spec.js | 30 + ...ios_shipping_and_tax_excluding_tax.spec.js | 22 + ...enarios_shipping_and_tax_flat_rate.spec.js | 22 + ...nd_tax_flat_rate_and_excluding_tax.spec.js | 22 + ...nd_tax_flat_rate_and_inculding_tax.spec.js | 22 + ...ios_shipping_and_tax_free_shipping.spec.js | 22 + ...ios_shipping_and_tax_including_tax.spec.js | 22 + .../cross-browser-successful-transaction.md | 27 + .../cross-devices-successful-transaction.md | 27 + ...tion_scenarios_different_languages.spec.js | 15 + .../translation/validate-translations.md | 30 + .../webhooks/Copy Webhooks Destination URL.md | 29 + .../webhooks/Handle Captured Payments.md | 26 + .../shared-stories/webhooks/Log Webhooks.md | 26 + ... the transaction status when it changes.md | 36 + .../Updating Transaction Status Failed.md | 28 + .../Updating Transaction Status Success.md | 38 + .../Verifying Payment Webhook Authenticity.md | 28 + .../webhooks/Webhooks Configuration.md | 38 + .../surcharge/Add Surcharge as Line Item.md | 30 + .../Display Surcharge Warning on Checkout.md | 31 + ...ng on Cards (For non-EU countries only).md | 30 + .../Playwright/tests/surcharge/Enable eDCC.md | 30 + ...rror Handling for Inconsistent Settings.md | 30 + .../Pass Additional Object for HPP.md | 30 + ..._payment_method_settings_surcharge.spec.js | 373 ++++++++++ ..._payment_statuses_-_block_checkout.spec.js | 37 + ...tatuses_-_block_checkout_apple_pay.spec.js | 16 + ...t_statuses_-_block_checkout_billie.spec.js | 34 + ...tuses_-_block_checkout_credit_card.spec.js | 111 +++ ...atuses_-_block_checkout_gift_cards.spec.js | 22 + ...ment_statuses_-_block_checkout_in3.spec.js | 34 + ..._statuses_-_block_checkout_voucher.spec.js | 40 + .../demo.spec.js | 7 + .../testData.js | 585 +++++++++++++++ ...cenarios_payment_statuses_checkout.spec.js | 56 ++ ...ayment_statuses_checkout_apple_pay.spec.js | 22 + ...ment_statuses_checkout_credit_card.spec.js | 108 +++ ...yment_statuses_checkout_gift_cards.spec.js | 21 + ..._payment_statuses_checkout_voucher.spec.js | 36 + .../Payment statuses - Checkout/testData.js | 685 ++++++++++++++++++ ...ment_statuses_-_pay_for_order_page.spec.js | 58 ++ ...ses_-_pay_for_order_page_apple_pay.spec.js | 16 + ...s_-_pay_for_order_page_credit_card.spec.js | 76 ++ ...es_-_pay_for_order_page_gift_cards.spec.js | 22 + ...tuses_-_pay_for_order_page_voucher.spec.js | 40 + ...cenarios_payment_statuses_checkout.spec.js | 17 + .../testData.js | 684 +++++++++++++++++ ... and shipping address data to Worldline.md | 27 + ...nd WooCommerce order discount to Mollie.md | 27 + ...erce order line items data to Worldline.md | 28 + ...mmerce order shipping cost to Worldline.md | 26 + ...s_different_cards_american_express.spec.js | 34 + ...enarios_different_cards_mastercard.spec.js | 34 + ...ion_scenarios_different_cards_visa.spec.js | 34 + ...action_scenarios_recurrent_payment.spec.js | 60 ++ ...n_scenarios_coupons_fixed_discount.spec.js | 64 ++ ...ios_coupons_fixed_product_discount.spec.js | 82 +++ ...narios_coupons_percentage_discount.spec.js | 52 ++ ...rios_cross-browser_chrome_(latest).spec.js | 22 + ...narios_cross-browser_edge_(latest).spec.js | 22 + ...ios_cross-browser_firefox_(latest).spec.js | 22 + ...ser_microsoft_internet_explorer_11.spec.js | 22 + ...arios_cross-browser_opera_(latest).spec.js | 22 + ...rios_cross-browser_safari_(latest).spec.js | 22 + ...grity with Coupons, Taxes, and Shipping.md | 75 ++ ...s_different_cards_american_express.spec.js | 34 + ...enarios_different_cards_mastercard.spec.js | 34 + ...ion_scenarios_different_cards_visa.spec.js | 34 + .../_transaction_scenarios_shipment.spec.js | 30 + ...ios_shipping_and_tax_excluding_tax.spec.js | 22 + ...enarios_shipping_and_tax_flat_rate.spec.js | 22 + ...nd_tax_flat_rate_and_excluding_tax.spec.js | 22 + ...nd_tax_flat_rate_and_inculding_tax.spec.js | 22 + ...ios_shipping_and_tax_free_shipping.spec.js | 22 + ...ios_shipping_and_tax_including_tax.spec.js | 22 + .../cross-browser-successful-transaction.md | 27 + .../cross-devices-successful-transaction.md | 27 + 202 files changed, 10631 insertions(+), 87 deletions(-) create mode 100644 tests/Playwright/README.md create mode 100644 tests/Playwright/globalSetup.js create mode 100644 tests/Playwright/tests/Shared/base-test.js create mode 100644 tests/Playwright/tests/Shared/gateways.js create mode 100644 tests/Playwright/tests/Shared/manualOrder.js create mode 100644 tests/Playwright/tests/Shared/methodsConfig.json create mode 100644 tests/Playwright/tests/Shared/mollieUtils.js create mode 100644 tests/Playwright/tests/Shared/products.js create mode 100644 tests/Playwright/tests/Shared/setup-default-settings-merchant.js create mode 100644 tests/Playwright/tests/Shared/sharedUrl.js create mode 100644 tests/Playwright/tests/Shared/test-logo.png create mode 100644 tests/Playwright/tests/Shared/testMollieInWooPage.js create mode 100644 tests/Playwright/tests/Shared/wooUtils.js create mode 100644 tests/Playwright/tests/Shared/wpUtils.js create mode 100644 tests/Playwright/tests/chargeback/_transaction_scenarios_chargeback.spec.js create mode 100644 tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_block_cart.spec.js create mode 100644 tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_classic_cart.spec.js create mode 100644 tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button__-_product_page.spec.js create mode 100644 tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_block_cart.spec.js create mode 100644 tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_classic_cart.spec.js create mode 100644 tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_product_page.spec.js create mode 100644 tests/Playwright/tests/merchant-setup/API Keys Configuration.md create mode 100644 tests/Playwright/tests/merchant-setup/Connect to Test or Prod Platform.md create mode 100644 tests/Playwright/tests/merchant-setup/Test Connection with WLOP Platform.md create mode 100644 tests/Playwright/tests/plugin-foundation/Error Handling/_error_handling.spec.js create mode 100644 tests/Playwright/tests/plugin-foundation/Error Handling/testData.js create mode 100644 tests/Playwright/tests/plugin-foundation/Logging.md create mode 100644 tests/Playwright/tests/plugin-settings/Accessing Documentation Support.md create mode 100644 tests/Playwright/tests/plugin-settings/Advanced/_mollie_settings_tab_advanced.spec.js create mode 100644 tests/Playwright/tests/plugin-settings/Apple Pay Button/_mollie_settings_tab_apple_pay_button.spec.js create mode 100644 tests/Playwright/tests/plugin-settings/Backend Configuration Page.md create mode 100644 tests/Playwright/tests/plugin-settings/Compliance with UI Design in Payment Settings.md create mode 100644 tests/Playwright/tests/plugin-settings/Define Checkout Language.md create mode 100644 tests/Playwright/tests/plugin-settings/Edit Payment Button Title.md create mode 100644 tests/Playwright/tests/plugin-settings/Edit Payment method.md create mode 100644 tests/Playwright/tests/plugin-settings/Enforce 3DSv2 Strong Customer Authentication.md create mode 100644 tests/Playwright/tests/plugin-settings/Group Card Brands.md create mode 100644 tests/Playwright/tests/plugin-settings/Integration Listing in WooCommerce Settings.md create mode 100644 tests/Playwright/tests/plugin-settings/Mollie Components/_mollie_settings_tab_mollie_components.spec.js create mode 100644 tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings.spec.js create mode 100644 tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_credit_card_settings.spec.js create mode 100644 tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_gift_cards_settings.spec.js create mode 100644 tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_voucher_settings.spec.js create mode 100644 tests/Playwright/tests/plugin-settings/Selecting Checkout Types.md create mode 100644 tests/Playwright/tests/plugin-settings/Translate Default Payment Button Titles.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/3rd-party-plugin-compatibility/_transaction_scenarios_3rd_party_plugin_compatibility.spec.js create mode 100644 tests/Playwright/tests/shared-stories/compatibility/php-compatibility/_transaction_scenarios_versions_php.spec.js create mode 100644 tests/Playwright/tests/shared-stories/compatibility/php-compatibility/plugin-cant-be-activated-with-php-version-lower-than.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/php-compatibility/successful-transaction-with-php-version.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/theme-compatibility.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/_transaction_scenarios_versions_woocommerce.spec.js create mode 100644 tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/install-plugin-when-woocommerce-not-available-warning.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-when-woocommerce-version-lower-than.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-while-woocommerce-is-deactivated.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/successful-transaction-while-running-on-woocommerce-expected-version.md create mode 100644 tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/_transaction_scenarios_versions_wordpress.spec.js create mode 100644 tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/plugin-cant-be-activated-on-wordpress-version-lower-than.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Applying Coupons with Selected Payment Method.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Country-Specific Payment Method Availability.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Displaying Payment Methods on Checkout Page.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Form Validation and Plugin Compatibility.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Amount.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Currency.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Visibility for Different User Types.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Updating Shipping Charges with Selected Payment Method.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/Updating Taxes with Selected Payment Method.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/User Notification on Plugin Errors.md create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios.spec.js create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_boundaries.spec.js create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_euro.spec.js create mode 100644 tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_usd.spec.js create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/API Keys Configuration.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/Account link.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/Auto Trim Spaces at End of Keys.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/Connect to Test or Prod Platform.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/Contact Us.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/Create account - Sign Up.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/End-Point URL Configuration.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/General/_mollie_settings_tab_general.spec.js create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/PSPID.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/Test Connection with WLOP Platform.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/Tooltips for fields.md create mode 100644 tests/Playwright/tests/shared-stories/merchant-setup/documentation link.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/As-a-client-I-can-review-future-progress-on-a-test-system.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/As-a-developer-QA-PO-support-I-can-create-a-package.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/Plugins page/_plugins_page.spec.js create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/the-latest-plugin-version-is-displayed-per-ui-design.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-activation-of-the-latest-plugin-version.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-automatic-plugin-update.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-deactivation-of-the-latest-plugin-version.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-installation-of-the-latest-plugin-version.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-manual-plugin-update.md create mode 100644 tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-uninstalling-the-latest-plugin-version.md create mode 100644 tests/Playwright/tests/shared-stories/refund/Adding Order Note for Successful Refund.md create mode 100644 tests/Playwright/tests/shared-stories/refund/Connecting Refund Status Update to an Existing Order.md create mode 100644 tests/Playwright/tests/shared-stories/refund/Displaying Refund Status in WooCommerce Order Page.md create mode 100644 tests/Playwright/tests/shared-stories/refund/Performing Refunds from the Worldline Back Office.md create mode 100644 tests/Playwright/tests/shared-stories/refund/Refund from the WooCommerce Order Page.md create mode 100644 tests/Playwright/tests/shared-stories/refund/Refunding Orders with Discounts and Promotions.md create mode 100644 tests/Playwright/tests/shared-stories/refund/_transaction_scenarios_refunds.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/Backend Order Data Management.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/Backend Order Transaction ID.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/Map Statuses.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/Merchant Reference.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Authorization-Sale Modes.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Authorization from WooCommerce Order Page.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Payment Action.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Capture Payment Action.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-browser-successful-transaction.md create mode 100644 tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-devices-successful-transaction.md create mode 100644 tests/Playwright/tests/shared-stories/translation/_transaction_scenarios_different_languages.spec.js create mode 100644 tests/Playwright/tests/shared-stories/translation/validate-translations.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Copy Webhooks Destination URL.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Handle Captured Payments.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Log Webhooks.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Saving the transaction status when it changes.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Failed.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Success.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Verifying Payment Webhook Authenticity.md create mode 100644 tests/Playwright/tests/shared-stories/webhooks/Webhooks Configuration.md create mode 100644 tests/Playwright/tests/surcharge/Add Surcharge as Line Item.md create mode 100644 tests/Playwright/tests/surcharge/Display Surcharge Warning on Checkout.md create mode 100644 tests/Playwright/tests/surcharge/Enable Surcharging on Cards (For non-EU countries only).md create mode 100644 tests/Playwright/tests/surcharge/Enable eDCC.md create mode 100644 tests/Playwright/tests/surcharge/Error Handling for Inconsistent Settings.md create mode 100644 tests/Playwright/tests/surcharge/Pass Additional Object for HPP.md create mode 100644 tests/Playwright/tests/surcharge/_mollie_settings_tab_payment_method_settings_surcharge.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_apple_pay.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_billie.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_credit_card.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_gift_cards.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_in3.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_voucher.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/demo.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Block Checkout/testData.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_apple_pay.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_credit_card.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_gift_cards.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_voucher.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Checkout/testData.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_apple_pay.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_credit_card.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_gift_cards.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_voucher.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_checkout.spec.js create mode 100644 tests/Playwright/tests/transaction/Payment statuses - Pay for order page/testData.js create mode 100644 tests/Playwright/tests/transaction/Send WooCommerce order billing and shipping address data to Worldline.md create mode 100644 tests/Playwright/tests/transaction/Send WooCommerce order discount to Mollie.md create mode 100644 tests/Playwright/tests/transaction/Send WooCommerce order line items data to Worldline.md create mode 100644 tests/Playwright/tests/transaction/Send WooCommerce order shipping cost to Worldline.md create mode 100644 tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_american_express.spec.js create mode 100644 tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_mastercard.spec.js create mode 100644 tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_visa.spec.js create mode 100644 tests/Playwright/tests/transaction/subscriptions/_transaction_scenarios_recurrent_payment.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_american_express.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_mastercard.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_visa.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js create mode 100644 tests/Playwright/tests/transaction/transaction integrity/cross-browser-successful-transaction.md create mode 100644 tests/Playwright/tests/transaction/transaction integrity/cross-devices-successful-transaction.md diff --git a/.idea/WooCommerce.iml b/.idea/WooCommerce.iml index 9aa75e6b5..09827d3d3 100644 --- a/.idea/WooCommerce.iml +++ b/.idea/WooCommerce.iml @@ -3,12 +3,8 @@ - - - - - + @@ -79,8 +75,10 @@ + + - \ No newline at end of file + diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml index 4f8104cfb..776785bf0 100644 --- a/.idea/phpunit.xml +++ b/.idea/phpunit.xml @@ -7,4 +7,4 @@ - \ No newline at end of file + diff --git a/tests/Playwright/.gitignore b/tests/Playwright/.gitignore index 68c5d18f0..d6ff675a6 100644 --- a/tests/Playwright/.gitignore +++ b/tests/Playwright/.gitignore @@ -1,5 +1,5 @@ -node_modules/ -/test-results/ -/playwright-report/ -/blob-report/ -/playwright/.cache/ +node_modules +pw-browsers +test-results +.env +yarn.lock diff --git a/tests/Playwright/README.md b/tests/Playwright/README.md new file mode 100644 index 000000000..832dbe952 --- /dev/null +++ b/tests/Playwright/README.md @@ -0,0 +1,13 @@ + +### Setup E2E tests +In your test environment +- Import the products +- -Check the language of the site, must be English unless specified +- Update the env with url and credentials +- VSCode has a playwright plugin +- Install and activate basic auth plugin: https://github.com/WP-API/Basic-Auth +- Run ngrok to expose the site and be able to test the webhooks +``` +$ npx playwright test +``` + diff --git a/tests/Playwright/globalSetup.js b/tests/Playwright/globalSetup.js new file mode 100644 index 000000000..3533e20c2 --- /dev/null +++ b/tests/Playwright/globalSetup.js @@ -0,0 +1,12 @@ +import { chromium } from '@playwright/test'; +const { loginAdmin } = require('./tests/Shared/wpUtils'); +async function globalSetup(config) { + const { baseURL, storageState } = config.projects[0].use; + const browser = await chromium.launch(); + const page = await browser.newPage({ baseURL: baseURL, extraHTTPHeaders: {'ngrok-skip-browser-warning': '123'}}); + await loginAdmin(page); + await page.context().storageState({ path: storageState }); + await browser.close(); +} + +export default globalSetup; diff --git a/tests/Playwright/package.json b/tests/Playwright/package.json index d4530e4dd..e2e3e6465 100644 --- a/tests/Playwright/package.json +++ b/tests/Playwright/package.json @@ -1,14 +1,8 @@ { - "name": "playwright", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": {}, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@playwright/test": "^1.43.1", - "@types/node": "^20.12.7" + "license": "MIT", + "dependencies": { + "@playwright/test": "^1.34.2", + "@woocommerce/woocommerce-rest-api": "^1.0.1", + "dotenv": "^16.0.3" } } diff --git a/tests/Playwright/playwright.config.js b/tests/Playwright/playwright.config.js index b15af2e18..cd83cfc75 100644 --- a/tests/Playwright/playwright.config.js +++ b/tests/Playwright/playwright.config.js @@ -1,79 +1,134 @@ // @ts-check -const { defineConfig, devices } = require('@playwright/test'); +const {defineConfig, devices} = require('@playwright/test'); /** * Read environment variables from file. * https://github.com/motdotla/dotenv */ -// require('dotenv').config(); - +require('dotenv').config(); +const testRailOptions = { + // Whether to add with all annotations; default is false + embedAnnotationsAsProperties: true, + // Where to put the report. + outputFile: './test-results/junit-report.xml' +}; /** * @see https://playwright.dev/docs/test-configuration */ module.exports = defineConfig({ - testDir: './tests', - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Base URL to use in actions like `await page.goto('/')`. */ - // baseURL: 'http://127.0.0.1:3000', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, + retries: 1, + testDir: './tests', + /* Run tests in files in parallel */ + fullyParallel: false, + //timeout: 120000, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: [ + ['line'], + ['junit', testRailOptions] + ], + globalSetup: './globalSetup.js', - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + baseURL: process.env.BASEURL_DEFAULT_80, + storageState: './storageState.json', + //extraHTTPHeaders: {'ngrok-skip-browser-warning': '123'}, + actionTimeout: 120000, + ignoreHTTPSErrors: true, + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + video: { + mode: 'on-first-retry', + size: {width: 1280, height: 720}, + dir: './videos' + } }, - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, - - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { ...devices['Pixel 5'] }, - // }, - // { - // name: 'Mobile Safari', - // use: { ...devices['iPhone 12'] }, - // }, - - /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { ...devices['Desktop Edge'], channel: 'msedge' }, - // }, - // { - // name: 'Google Chrome', - // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, - // }, - ], - - /* Run your local dev server before starting the tests */ - // webServer: { - // command: 'npm run start', - // url: 'http://127.0.0.1:3000', - // reuseExistingServer: !process.env.CI, - // }, + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + /*{ + name: 'setup-default-settings-merchant', + testMatch: './tests/Shared/setup-default-settings-merchant.spec.js', + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_DEFAULT_80 + } + }, + { + name: 'setup-settings-merchant', + testMatch: './tests/Shared/setup-default-settings-merchant.spec.js', + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_SETTINGS_80 + } + }, + { + name: 'setup-payment-api-merchant', + testMatch: './tests/Shared/setup-default-settings-merchant.spec.js', + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_PAYMENT_80 + } + }, + { + name: 'plugins-page-80', + testDir: './tests/Plugins page', + dependencies: ['setup-settings-merchant'], + use: { + ...devices['Desktop Chrome'], + testIdAttribute: 'data-slug', + baseURL: process.env.BASEURL_SETTINGS_80 + } + }, + { + name: 'woo-payments-tab-80', + testDir: './tests/WooCommerce Payments tab', + dependencies: ['setup-default-settings-merchant'], + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_DEFAULT_80 + } + },*/ + /*{ + name: 'transaction-scenarios-orders-80', + testDir: './tests/transaction', + //dependencies: ['setup-default-settings-merchant'], + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_DEFAULT_80 + } + },*/ + /*{ + name: 'transaction-scenarios-payments-80', + testDir: './tests/Transaction Scenarios', + dependencies: ['setup-payment-api-merchant'], + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_PAYMENT_80 + } + }, + { + name: 'mollie-settings-tab-80', + testDir: './tests/Mollie Settings tab', + dependencies: ['setup-settings-merchant'], + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_SETTINGS_80 + } + }, + { + name: 'error-handling-80', + testDir: './tests/Error Handling', + dependencies: ['setup-default-settings-merchant'], + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_DEFAULT_80 + } + },*/ + ], }); diff --git a/tests/Playwright/tests/Shared/base-test.js b/tests/Playwright/tests/Shared/base-test.js new file mode 100644 index 000000000..d73d82459 --- /dev/null +++ b/tests/Playwright/tests/Shared/base-test.js @@ -0,0 +1,22 @@ +const base = require('@playwright/test'); +const {allProducts} = require('./products'); +const {allMethods} = require('./gateways'); + +exports.test = base.test.extend({ + products: [allProducts, { option: true }], + gateways: [allMethods, { option: true }], + baseURL: async ({}, use) => { + await use(process.env.BASEURL_DEFAULT_80); + }, + context: async ({ browser, baseURL }, use) => { + // Additional options can be included when creating the context + const context = await browser.newContext({baseURL}); + await use(context); + await context.close(); + }, + page: async ({ context }, use) => { + const page = await context.newPage(); + await use(page); + await page.close(); + }, +}); diff --git a/tests/Playwright/tests/Shared/gateways.js b/tests/Playwright/tests/Shared/gateways.js new file mode 100644 index 000000000..b6e3138be --- /dev/null +++ b/tests/Playwright/tests/Shared/gateways.js @@ -0,0 +1,17 @@ +const methodsConfig = require('./methodsConfig.json') + + +const banktransfer = methodsConfig.banktransfer; +const ideal = methodsConfig.ideal; +const creditcard = methodsConfig.creditcard; +const paypal = methodsConfig.paypal; +const normalizedName = (name) => { + name = name.replace('\", \"mollie-payments-for-woocommerce\")', ''); + return name.replace('__(\"', ''); +} +const getMethodNames = () => { + return Object.values(methodsConfig).map((method) => normalizedName(method.defaultTitle)); +}; +const allMethodsIds = Object.keys(methodsConfig); +const allMethods = methodsConfig; +module.exports = {banktransfer, ideal, creditcard, paypal, normalizedName, getMethodNames, allMethods, allMethodsIds}; diff --git a/tests/Playwright/tests/Shared/manualOrder.js b/tests/Playwright/tests/Shared/manualOrder.js new file mode 100644 index 000000000..cd58ef5eb --- /dev/null +++ b/tests/Playwright/tests/Shared/manualOrder.js @@ -0,0 +1,38 @@ +export const manualOrder = { + set_paid: false, + billing: { + first_name: "Tester", + last_name: "testing", + address_1: "969 Market", + address_2: "", + city: "San Francisco", + state: "CA", + postcode: "94103", + country: "US", + email: "john.doe@example.com", + phone: "(555) 555-5555" + }, + shipping: { + first_name: "John", + last_name: "Doe", + address_1: "969 Market", + address_2: "", + city: "San Francisco", + state: "CA", + postcode: "94103", + country: "US" + }, + line_items: [ + { + product_id: 14, + quantity: 1 + } + ], + shipping_lines: [ + { + method_id: "flat_rate", + method_title: "Flat Rate", + total: "0.00" + } + ] +}; diff --git a/tests/Playwright/tests/Shared/methodsConfig.json b/tests/Playwright/tests/Shared/methodsConfig.json new file mode 100644 index 000000000..d228637b4 --- /dev/null +++ b/tests/Playwright/tests/Shared/methodsConfig.json @@ -0,0 +1,346 @@ +{ + "applepay": { + "id": "applepay", +"country": "Germany", + "defaultTitle": "__(\"Apple Pay\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "__(\"To accept payments via Apple Pay\", \"mollie-payments-for-woocommerce\")", + "defaultDescription": "", + "paymentFields": false, + "instructions": true, + "supports": [ + "products", + "refunds", + "subscriptions" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "Subscription": true + }, + "bancontact": { + "id": "bancontact", +"country": "Germany", + "defaultTitle": "__(\"Bancontact\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": true, + "SEPA": true + }, + "banktransfer": { + "id": "banktransfer", +"country": "Germany", + "defaultTitle": "__(\"Bank transfer\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": true, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": true, + "confirmationDelayed": true, + "SEPA": false, + "customRedirect": true + }, + "belfius": { + "id": "belfius", +"country": "Germany", + "defaultTitle": "__(\"Belfius Pay Button\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": true, + "SEPA": true + }, + "billie": { + "id": "billie", +"country": "Germany", + "defaultTitle": "__(\"Billie\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "__(\"To accept payments via Billie, all default WooCommerce checkout fields should be enabled and required.\",\"mollie-payments-for-woocommerce\")", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "orderMandatory": true, + "errorMessage": "__(\"Company field is empty. To proceed with Billie payment the company field is required.\",\"mollie-payments-for-woocommerce\")", + "companyPlaceholder": "__(\"To proceed with Billie, please enter your company name here.\", \"mollie-payments-for-woocommerce\")" + }, + "creditcard": { + "id": "creditcard", +"country": "Germany", + "defaultTitle": "__(\"Credit/Debit Card\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": true, + "supports": [ + "products", + "refunds", + "subscriptions" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "Subscription": true + }, + "eps": { + "id": "eps", +"country": "Germany", + "defaultTitle": "__(\"eps\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": true, + "SEPA": true + }, + "giftcard": { + "id": "giftcard", +"country": "Germany", + "defaultTitle": "__(\"Gift cards\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "__(\"Select your gift card\", \"mollie-payments-for-woocommerce\")", + "paymentFields": true, + "instructions": false, + "supports": [ + "products" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false + }, + "giropay": { + "id": "giropay", +"country": "Germany", + "defaultTitle": "__(\"giropay\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": true, + "SEPA": true + }, + "ideal": { + "id": "ideal", +"country": "Germany", + "defaultTitle": "__(\"iDEAL\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "__(\"Select your bank\", \"mollie-payments-for-woocommerce\")", + "paymentFields": true, + "instructions": true, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": true, + "SEPA": true + }, + "in3": { + "id": "in3", +"country": "Netherlands", + "defaultTitle": "__(\"iDEAL Pay in 3 instalments, 0% interest\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "__(\"iDEAL Pay in 3 instalments, 0% interest\",\"mollie-payments-for-woocommerce\")", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "orderMandatory": true + }, + "kbc": { + "id": "kbc", +"country": "Germany", + "defaultTitle": "__(\"KBC/CBC Payment Button\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "__(\"Select your bank\", \"mollie-payments-for-woocommerce\")", + "paymentFields": true, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": true, + "SEPA": true + }, + "klarnapaylater": { + "id": "klarnapaylater", +"country": "Germany", + "defaultTitle": "__(\"Pay later.\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "__(\"To accept payments via Klarna, all default WooCommerce checkout fields should be enabled and required.\", \"mollie-payments-for-woocommerce\")", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "orderMandatory": true + }, + "klarnapaynow": { + "id": "klarnapaynow", +"country": "Germany", + "defaultTitle": "__(\"Pay now.\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "__(\"To accept payments via Klarna, all default WooCommerce checkout fields should be enabled and required.\", \"mollie-payments-for-woocommerce\")", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "orderMandatory": true + }, + "klarnasliceit": { + "id": "klarnasliceit", +"country": "Germany", + "defaultTitle": "__(\"Slice it.\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "__(\"To accept payments via Klarna, all default WooCommerce checkout fields should be enabled and required.\", \"mollie-payments-for-woocommerce\")", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "orderMandatory": true + }, + "mybank": { + "id": "mybank", +"country": "Germany", + "defaultTitle": "__(\"MyBank\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "__(\"To accept payments via MyBank\", \"mollie-payments-for-woocommerce\")", + "defaultDescription": "", + "paymentFields": false, + "instructions": true, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": true + }, + "paypal": { + "id": "paypal", +"country": "Germany", + "defaultTitle": "__(\"PayPal\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": true, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false + }, + "paysafecard": { + "id": "paysafecard", +"country": "Germany", + "defaultTitle": "__(\"paysafecard\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false + }, + "przelewy24": { + "id": "przelewy24", +"country": "Germany", + "defaultTitle": "__(\"Przelewy24\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "__(\"To accept payments via Przelewy24, a customer email is required for every payment.\", \"mollie-payments-for-woocommerce\")", + "defaultDescription": "", + "paymentFields": false, + "instructions": true, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false + }, + "sofort": { + "id": "sofort", +"country": "Germany", + "defaultTitle": "__(\"SOFORT Banking\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": true, + "supports": [ + "products", + "refunds" + ], + "filtersOnBuild": false, + "confirmationDelayed": true, + "SEPA": true + }, + "voucher": { + "id": "voucher", +"country": "Germany", + "defaultTitle": "__(\"Vouchers\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [ + "products" + ], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "orderMandatory": true + } +} diff --git a/tests/Playwright/tests/Shared/mollieUtils.js b/tests/Playwright/tests/Shared/mollieUtils.js new file mode 100644 index 000000000..66a84f7f7 --- /dev/null +++ b/tests/Playwright/tests/Shared/mollieUtils.js @@ -0,0 +1,275 @@ +const {sharedUrl: {mollieSettingsTab}} = require('../Shared/sharedUrl'); +const {loginAdmin, selectOptionSetting, fillNumberSettings} = require("./wpUtils"); +const {wooOrderPaidPage, wooOrderDetailsPageOnPaid, wooOrderRetryPage, wooOrderDetailsPageOnFailed, wooOrderCanceledPage, wooOrderDetailsPageOnCanceled} = require('../Shared/testMollieInWooPage'); +const {addProductToCart} = require('../Shared/wooUtils'); +const {normalizedName} = require("./gateways"); +const {expect} = require("@playwright/test"); +const {fillCustomerInCheckoutBlock, selectPaymentMethodInCheckout, captureTotalAmountCheckout, + captureTotalAmountBlockCheckout, parseTotalAmount +} = require("./wooUtils"); + +const settingsNames = { + surcharge: 'payment_surcharge', + noFee: 'no_fee', + fixedFee: 'fixed_fee', + percentage: 'percentage', + fixedFeePercentage: 'fixed_fee_percentage', + limitFee: 'maximum_limit', + components: 'mollie_components_enabled', +} + +const noticeLines = { + paid: (method) => `Order completed using Mollie - ${method} payment`, + open: (method) => `${method} payment started`, + completed: (method) => `Order completed using Mollie - ${method} payment`, + failed: (method) => `${method} payment started`, + canceled: (method) => `${method} payment started`, + expired: (method) => `${method} payment started`, + authorized: (method) => `Order authorized using Mollie - ${method} payment`, +} +/** + * @param {import('@playwright/test').Page} page + */ +const setOrderAPI = async (page) => { + await page.goto(mollieSettingsTab + '§ion=advanced'); + await page.selectOption('select#mollie-payments-for-woocommerce_api_switch', 'order') + await Promise.all([ + page.waitForNavigation(), + page.locator('text=Save changes').click() + ]); +} + +/** + * @param {import('@playwright/test').Page} page + */ +const setPaymentAPI = async (page) => { + await page.goto(mollieSettingsTab + '§ion=advanced'); + await page.selectOption('select#mollie-payments-for-woocommerce_api_switch', 'payment') + await Promise.all([ + page.waitForNavigation(), + page.locator('text=Save changes').click() + ]); +} + +/** + * @param {import('@playwright/test').Page} page + * @param status + */ +const markStatusInMollie = async (page, status) =>{ + const mollieHeader = await page.innerText('.header__info'); + const mollieOrder = mollieHeader.substring(6, mollieHeader.length) + await page.locator('text=' + status).click(); + await page.locator('text=Continue').click(); + return mollieOrder; +} + +const fillCreditCardForm = async (page) => { + let container = await page.locator('div[data-testid="mollie-container--cardHolder"]'); + let input = await container.locator('input[data-component-type="cardHolder"][type="text"]'); + await input.fill('Name'); + container = await page.locator('div[data-testid="mollie-container--cardNumber"]'); + input = await container.locator('input[data-component-type="cardNumber"][type="text"]'); + await input.fill('4543474002249996'); + container = await page.locator('div[data-testid="mollie-container--expiryDate"]'); + input = await container.locator('input[data-component-type="expiryDate"][type="text"]'); + await input.fill('12/25'); + container = await page.locator('div[data-testid="mollie-container--verificationCode"]'); + input = await container.locator('input[data-component-type="verificationCode"][type="text"]'); + await input.fill('123'); + + await page.getByRole('button', { name: 'Pay ›' }).click(); +}; +const processMollieCheckout = async (page, status) => { + const expectedUrl = 'https://www.mollie.com/checkout/test-mode?'; + const creditCardUrl = 'https://www.mollie.com/checkout/credit-card'; + if (page.url().toString().startsWith(creditCardUrl)) { + await fillCreditCardForm(page); + await page.waitForTimeout(5000); + return await markStatusInMollie(page, status);} + + if (page.url().toString().startsWith(expectedUrl)) { + return await markStatusInMollie(page, status); + } else { + // find the first button + const button = await page.$('button'); + await button.click(); + return await markStatusInMollie(page, status); + } +} + +/** + * @param {import('@playwright/test').Page} page + */ +const insertCorrectAPIKeys = async (page) =>{ + await page.goto(mollieSettingsTab); + await page.locator(`input[name="mollie-payments-for-woocommerce_live_api_key"]`).fill(process.env.MOLLIE_LIVE_API_KEY); + await page.locator(`input[name="mollie-payments-for-woocommerce_test_mode_enabled"]`).check(); + await page.locator(`input[name="mollie-payments-for-woocommerce_test_api_key"]`).fill(process.env.MOLLIE_TEST_API_KEY); + await Promise.all([ + page.waitForNavigation(), + page.locator('text=Save changes').click() + ]); +} + +/** + * @param {import('@playwright/test').Page} page + */ +const insertIncorrectAPIKeys = async (page) =>{ + await page.goto(mollieSettingsTab); + await page.locator(`input[name="mollie-payments-for-woocommerce_live_api_key"]`).fill('live_1234567890'); + await page.locator(`input[name="mollie-payments-for-woocommerce_test_mode_enabled"]`).check(); + await page.locator(`input[name="mollie-payments-for-woocommerce_test_api_key"]`).fill('test_1234567890'); + await Promise.all([ + page.waitForNavigation(), + page.locator('text=Save changes').click() + ]); +} + +/** + * @param {import('@playwright/test').Page} page + */ +const resetSettings = async (page) => { + await page.goto(mollieSettingsTab + '§ion=advanced'); + await Promise.all([ + page.waitForNavigation(), + await page.locator('text=clear now').click() + ]); +} + +/** + * @param {import('@playwright/test').Page} page + * @param testedProduct + * @param testedGateway + * @param productQuantity + */ +const beforePlacingOrder = async (page, testedProduct, testedGateway, productQuantity, checkoutUrl) => { + //Capture WooCommerce total amount + const totalAmount = await captureTotalAmountCheckout(page); + + // CUSTOMER DETAILS + await fillCustomerInCheckoutBlock(page, testedGateway.country); + + // Check testedGateway option NO ISSUERS DROPDOWN + const title = normalizedName(testedGateway.defaultTitle); + await selectPaymentMethodInCheckout(page, title); + if (testedGateway.paymentFields) { + await page.locator(`select[name="mollie-payments-for-woocommerce_issuer_mollie_wc_gateway_${testedGateway.id}"]`).selectOption({index: 1}); + } + if (testedGateway.id === 'billie') { + const billie = page.getByText('Pay by Invoice for Businesses - Billie Company *'); + await billie.locator('input[id="billing_company"]').fill('My company name'); + } + const canFillBirthDate = await page.locator('input[name="billing_birthdate"]').first().isVisible(); + if (canFillBirthDate) { + await page.locator('input[name="billing_birthdate"]').first().fill('1990-01-01'); + } + // Click text=Place order + await Promise.all([ + page.waitForNavigation(/*{ url: 'https://www.mollie.com/checkout/test-mode?method=GATEWAY&token=XXX' }*/), + page.locator('text=Place order').click() + ]); + return totalAmount; +} + +const beforePlacingOrderBlock = async (page, testedProduct, testedGateway, productQuantity, checkoutUrl) => { + await page.goto(checkoutUrl); + + //Capture WooCommerce total amount + const totalAmount = await captureTotalAmountBlockCheckout(page); + // CUSTOMER DETAILS + await fillCustomerInCheckoutBlock(page); + + // Check testedGateway option NO ISSUERS DROPDOWN + const title = normalizedName(testedGateway.defaultTitle); + await page.getByText(title, { exact: true }).click(); + if (testedGateway.paymentFields) { + await page.locator(`select[name="mollie-payments-for-woocommerce_issuer_mollie_wc_gateway_${testedGateway.id}"]`).selectOption({index: 1}); + } + if (testedGateway.id === 'billie') { + const billie = page.getByText('Pay by Invoice for Businesses - Billie Company *'); + await billie.locator('input[id="billing_company"]').fill('My company name'); + } + const canFillBirthDate = await page.locator('input[name="billing_birthdate"]').first().isVisible(); + if (canFillBirthDate) { + await page.locator('input[name="billing_birthdate"]').first().fill('1990-01-01'); + } + await page.getByRole('button', { name: 'Place Order' }).click(); + await page.waitForTimeout(2000) + return totalAmount; +} + +/** + * @param {import('@playwright/test').Page} page + * @param testedProduct + * @param testedGateway + * @param productQuantity + * @param status + */ +const checkoutTransaction = async (page, testedProduct, testedGateway, productQuantity = 1, status = "Paid", checkoutUrl ='/checkout/') => { + let totalAmount; + if (checkoutUrl === 'checkout') { + totalAmount = await beforePlacingOrder(page, testedProduct, testedGateway, productQuantity, checkoutUrl); + } else { + totalAmount = await beforePlacingOrderBlock(page, testedProduct, testedGateway, productQuantity, checkoutUrl); + } + // IN MOLLIE + // Capture order number in Mollie and mark as required + await page.waitForTimeout(2000); + const mollieOrder = await processMollieCheckout(page, status); + + return {mollieOrder: mollieOrder, totalAmount: totalAmount}; +} + +const classicCheckoutPaidTransactionFullRefund = async (page, testedProduct, testedGateway) => { + await beforePlacingOrder(page, testedProduct, testedGateway); + const mollieOrder = await markStatusInMollie(page, "Paid"); + await wooOrderDetailsPageOnPaid(page, mollieOrder, testedGateway); + await page.locator('text=This order is no longer editable. Refund >> button').click(); + await page.locator('input[class="refund_order_item_qty"]').fill('1'); + page.on('dialog', dialog => dialog.accept()); + await page.getByRole('button', {name: 'Mollie'}).click(); + await expect(page.locator('#select2-order_status-container')).toContainText("Refunded"); +} + +const classicCheckoutPaidTransactionPartialRefund = async (page, testedProduct, testedGateway) => { + await beforePlacingOrder(page, testedProduct, testedGateway); + const mollieOrder = await markStatusInMollie(page, "Paid"); + await wooOrderDetailsPageOnPaid(page, mollieOrder, testedGateway); + await page.locator('text=This order is no longer editable. Refund >> button').click(); + await page.locator('input[class="refund_order_item_qty"]').fill('0.5'); + page.on('dialog', dialog => dialog.accept()); + await page.locator('#woocommerce-order-items > div.inside > div.wc-order-data-row.wc-order-refund-items.wc-order-data-row-toggle > div.refund-actions > button.button.button-primary.do-api-refund').click(); + await expect(page.locator('#select2-order_status-container')).toContainText("Processing"); + await expect(page.getByText('EUR9.90 refunded')).toBeVisible(); +} + +const checkExpiredAtMollie = async (page) => { + //this assumes the page is mollie checkout + await expect(page.getByText('The payment has been set to expired successfully.')).toBeVisible(); +} + +const noFeeAdded = async (page, method, products, expectedAmount) => { + const result = await checkoutTransaction(page, products.simple, method) + let received = result.totalAmount.slice(0, -1).trim(); + received = parseTotalAmount(received); + expect(received).toEqual(expectedAmount); +} + +module.exports = { + setOrderAPI, + setPaymentAPI, + markStatusInMollie, + insertAPIKeys: insertCorrectAPIKeys, + insertIncorrectAPIKeys, + resetSettings, + beforePlacingOrder, + beforePlacingOrderBlock, + checkoutTransaction, + classicCheckoutPaidTransactionFullRefund, + classicCheckoutPaidTransactionPartialRefund, + checkExpiredAtMollie, + processMollieCheckout, + settingsNames, + noticeLines, + noFeeAdded +}; diff --git a/tests/Playwright/tests/Shared/products.js b/tests/Playwright/tests/Shared/products.js new file mode 100644 index 000000000..7f039c5c7 --- /dev/null +++ b/tests/Playwright/tests/Shared/products.js @@ -0,0 +1,70 @@ +const allProducts = { + surcharge: { + 'id': 14,//117, + "title": "Surcharge", + 'link': '/product/surcharge/', + 'sku': 'woo-surcharge', + 'sale_price': '10,00 €', + 'regular_price': '10,00 €', + 'price': '10,00 €', + 'virtual': 'no', + 'downloadable': 'no', + }, + simple: { + 'id': 20,//11, + "title": "Beanie", + 'link': '/product/beanie/', + 'sku': 'woo-beanie', + 'sale_price': '18,00 €', + 'regular_price': '20,00 €', + 'price': '18,00 €', + 'virtual': 'no', + 'downloadable': 'no', + }, + virtual: { + 'id': 18, + "title": "Album", + 'link': '/product/album/', + 'sku': 'woo-album', + 'sale_price': '15,00 €', + 'regular_price': '20,00 €', + 'price': '15,00 €', + 'virtual': 'yes', + 'downloadable': 'yes', + }, + variation: { + 'id': 13, + "title": "V-Neck T-Shirt", + 'link': "/product/v-neck-t-shirt/", + 'sku': "woo-vneck-tee", + 'sale_price': '', + 'regular_price': '', + 'price': '', + 'virtual': 'no', + 'downloadable': 'no', + }, variationRed: { + 'id': 20, + "title": "V-Neck T-Shirt - Red", + 'link': '/product/v-neck-t-shirt/?attribute_pa_color=red', + 'sku': "woo-vneck-tee-red", + 'sale_price': '', + 'regular_price': '20,00 €', + 'price': '20,00 €', + 'virtual': 'no', + 'downloadable': 'no', + }, + variationGreen: { + 'id': 21, + "title": "V-Neck T-Shirt - Green", + 'link': '/product/v-neck-t-shirt/?attribute_pa_color=green', + 'sku': "woo-vneck-tee-green", + 'sale_price': '', + 'regular_price': '20,00 €', + 'price': '20,00 €', + 'virtual': 'no', + 'downloadable': 'no', + } +}; + + +module.exports = {allProducts}; diff --git a/tests/Playwright/tests/Shared/setup-default-settings-merchant.js b/tests/Playwright/tests/Shared/setup-default-settings-merchant.js new file mode 100644 index 000000000..1037ca141 --- /dev/null +++ b/tests/Playwright/tests/Shared/setup-default-settings-merchant.js @@ -0,0 +1,8 @@ +import { chromium } from '@playwright/test'; +const { loginAdmin } = require('./wpUtils'); +async function setupDefaultSettingsMerchant(config) { + + +} + +export default setupDefaultSettingsMerchant; diff --git a/tests/Playwright/tests/Shared/sharedUrl.js b/tests/Playwright/tests/Shared/sharedUrl.js new file mode 100644 index 000000000..d26064fb0 --- /dev/null +++ b/tests/Playwright/tests/Shared/sharedUrl.js @@ -0,0 +1,7 @@ +export const sharedUrl = { + mollieSettingsTab: '/wp-admin/admin.php?page=wc-settings&tab=mollie_settings', + gatewaySettingsRoot: '/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=mollie_wc_gateway_', + paypalSettings : '/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=mollie_wc_gateway_paypal', + blocksCheckout: '/checkout-block/', + ordersPage: '/wp-admin/edit.php?post_type=shop_order', +} diff --git a/tests/Playwright/tests/Shared/test-logo.png b/tests/Playwright/tests/Shared/test-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c493571d83b1eeb670d6ded0dd46834f37f3eae7 GIT binary patch literal 4767 zcmeHKc{tQ>*PpR(6B1%nV<$0|vNZ--8X;pz_I)r7#xgM~*=4e4ONf-1AzPGWr%;Bn zCbA{MWNniD8U1?u{jT@D-anr|p6hz<>pJ&2_c@<)&i6i_`=2iXdGS1mO^^)$0Due- zx@I&@IuI5n+O82e5CH&iz|lH7NCO=m2+|+xj`l(U00=_*Wo9e$F24J=caoFe(Xk*{ z8(2logr#xW0Os|$(vulj#9wP6D<8(OmD%ey$CTZc3e-9!<>FyV38~C4D2-!$xhBDg z`*gW6XpP(ux~I0Dr!?0iOCPr7S7wzHcLk6vc`~^@hC%+dM3Fqg1V|TZ;RIr_b7;KF zd+Zo6A9R1;XSqzr(etv9o6SCDzx;6*|I9i-t3deT+}!#a1P%Z=ka-N*0FXEMb!kQy zff$gdp;H7GG;PX=u`FW>$2cy!K}bUBj4_3=rN2#gqstFuU5h{GATfYkjQn8G&VL(# z^w6SYXQ~i5{RG>U-<{{EG|J1`i@Z2Hak~H3=@(<&!lifP#w_TfH>d5Es`sA??T@bc z7e*?SIz4nZIOmEAh`IVQOG(-;hRC&XyHE5XWGLciWHNN)*3m*Y109|td&R=gJP?Kn zCmc8(K;I^;9HnZN1{QcQ)2|fOA{0Btrd`CwuDZ&#s9ldtK5?Yz`-oK5k&^gmWjDl! zQ{tf+GASMDuj-&=11D*!qX(<%g%G1BQZjH>7q)i3=+<^b>>wntyO+Rzc`IJ-jm!B% zTZl)MRXehfMBdnQbVs(VoMXgPE$1EYWooKAdbwsK^AOv&*{Y^>c&RNP@pi#`zH%SL z!(-Fsi$yz6fE85v8zJ%tg&<0nRvK5)z$QeFCH7MME9vPm&q7TfiB3?;syo-qS^n43 z9n%CxU+t6MS2_H&arGi5^-|ejz9*f`j!Yr|FasS^a%;vRiEu9n<*PR(djE(r_nUFbP6z^2Y;x|s$#B+F*GPU-YlfZ|L;^cuI?Bx`#xL};dU z-)vLrJ+fMN<)~t7sP0_r>&VU7R*A*^jUC8#uCunpxh@2=sNw*#20^=B%SB4zu4f#0 zvawd>I526iLhZBBSb*>GiCtC`mfWaYQJ5&X)+dBkmo5|QM4&xV)5<#T`w2|At+ufW z46qTtfD{;h1q!2IV*6a-t9f(;RON*luOi9c?AsgVxLGTBL9>cSK%7%_JJtKHPdF*FAgoX8iFi!V` zg7zuy>+J&0B8>>H!{O~BT?oNDgjgx)LqlTSgM#5=aZ&+@B zd(%3EA~*9{vy)QPH1o8VX(}WV$(?kcq(C}1s7B%?UAO2Z!I8U&!Ge#bBLfzsw7RIe zgljq1;?E@&m2E6{=f*GRrN5 zYd0Vo>_VEh^r#M?s+e>p+sG0H!-p3>C%*E$-FSY zqR5cHzozfY*VzTR!B0ik?Kk@6A3B#hM>xmD4067NQ5wd5H9|GQ9f;#T4VY_r-vzd` zx74=YQo+<^fk~!7CIu#Qjv;W4;@4wk8e`X0vH1CwkTxv1ASN)TGNvD-0)7Vm0Tuv9 zA0;FV3Fe+&I5TwShf0sK1L{V1ZAX;PG)CmKHLA~LE$2a-lY+khZ@jX89`OOXm^gq- zMcllw-u^sLc3$NHt&C$k}Z5`3= zo$glCOnSeNRdfGLM_p%K&sG_T{JPh@$~b|1$+keYU%4YN_nY|HfgZBl+p;%H1sYeD zeW2Bj9usO2@~r_;p1R~%@F5H444nr$xo!04?K@aHTsrhSGDT(eAIICl*Sb5g7kw_i zxM-WR6yGPvt4zXMtQQaW1opt@PR^Ccoz8U19Fa4YE4TY*&ser-kF9(E>20N|knU{r@kB#^0 z+a~eFk1KAaBxP|9d!(9VLfcfxK@YK+dBhXL<*%0?G`-NA2rbz+&ybbLu1TdTHcM+A z_LZO17>(0N4S{j7bFiKQQCRxeF0ha|>P~p^eP{I%F;)H5kLkmH!*1nW zC6XHkt>U)pDLbp1#*80VbQ2lO;`LTXgALa2 z&4I~zO8f7j!c7C|#p#F(KBrb3Dx8HIk+l`BDQ^pE;u_P}40|)x($h0Tth;S*>oa*6Ib(g=q9n7RBy?PtaUH2?s4mx2*hRR2EN9&$-_+U$@#ZNvt*SeyQ*+@QF9LcI% z?<;GzH>MtB(S(<Kv-t^_iUE7dmrUb6{w#qo-#OM)T*((PiedV`l~BuGx9j z%>)x)1mNZ>-`>nLv16_G-#R(B5RFM0Rxg*dYYG;n>JJ<5kv*RKV;k!1@!RXUYC)_) zhRf(NnIw7#OQ`d?lOfY$BnrHiX z#scOyYv(>e+oAA{j2+^p2h}h;lX-7#zoY@{<+vf!RT4fNH}SP;=+=vI29i>~BVxFkub1OXPNHm(~%cj{gMoA1l|ZZlE`&4ICxfn3Y1 zNdC+R%C(nMmt|1;QQKh&m5%-EeJxE2ukNqkst<+JXOU!nZtg($vTx}7Q!ibm{ZQOS zSsAz+8v{<#Y!(0mP!PaKvw$>#1Hpf6eV`P8{+FK)0Jwz)F#N_`r0Ii|Op}A0zcl@w z7yvWvbeJaie7ZkqQa=6PHZ2CwHrFvQplNege-z3mz!Qs8PjIlKIaqxW)&T$jpZI|Q z4a~$=X!VEC7FIYbVtUn5(EGI7~F9K(SKp-%GH+OY2UH#wbw3CL2Cl2SU4uu8< z1<3^|$zlCHpbBbgYEXGasG_1Q4Ivv4?1OX0%lZU}{#E3E>gb{ZT>a6$I5gG=a!}XV z1$z~zAtG|n=+FA=J5hM_-<^B{eqW1rLFhpQsvsv1{ZpHk3On$sBhh%2m$fe1n>I6A z54eJgJnR?#|3v=o_>WAh|2Oj=k^h}}DFEfKgY~Ah#KHfj>v!9K27f2Qpa(bq$0Yt5 z^Di%L&Tuvu^bconw$Ip+A{vcCXk8Nvnx;LnU+WTWm!ipmrU~$~_dREBnl3lc)waL` zDSbdtvpfewWrnRa=Mccl%ydSKSsS;!3!k&S7(T_QT-?ULHZBV|$wHvZmvCPbE9MYm z3%hr>D>Yv+SqgB)MZzTFjaC7mn2-fyJxTvx(7$H{J2dw8_sxb>vuV_o9#Hq~zr_6~ byto}=;`jDD<9Ylv0s#hk7j?_dIYs;n@t`rs literal 0 HcmV?d00001 diff --git a/tests/Playwright/tests/Shared/testMollieInWooPage.js b/tests/Playwright/tests/Shared/testMollieInWooPage.js new file mode 100644 index 000000000..4d23da41b --- /dev/null +++ b/tests/Playwright/tests/Shared/testMollieInWooPage.js @@ -0,0 +1,55 @@ + +import {normalizedName} from "./gateways"; +import {fetchOrderNotes, fetchOrderStatus} from "./wooUtils"; + + +const { expect } = require('@playwright/test'); +const {sharedUrl} = require("./sharedUrl"); + +async function gotoWPPage(page, url) { + await page.goto(url); +} + +async function gotoMollieGeneralSettings(page) { + await gotoWPPage(page, sharedUrl.mollieSettingsTab); +} + +export const wooOrderPaidPage = async (page, mollieOrder, totalAmount, testedGateway) => { + page.reload(); + // Check order number + await expect(page.getByText(/Order number: .+/)).toContainText(mollieOrder); + // Check total amount in order + await expect(page.getByText(/Total: .+/)).toContainText(totalAmount); + + if(testedGateway.id !== 'paypal'){ + // Check customer in billing details + await expect(page.getByText('My company nameJulia CallasCalle Drutal22100 BerlinGermany 1234566788 test@test.')).toBeVisible; + } + // Check Mollie method appears + const methodName = normalizedName(testedGateway.defaultTitle); + + await expect(page.getByText(methodName).first()).toBeVisible(); +} + +export const wooOrderRetryPage = async (page) => { + // Check we are in retry page + const regex = new RegExp(/checkout-block\/order-pay/); + await expect(page).toHaveURL(regex); +} + +export const wooOrderCanceledPage = async (page, mollieOrder, totalAmount, testedGateway) => { + await expect(page.locator('#wp--skip-link--target > div.wp-container-7.entry-content.wp-block-post-content > div > div > p')).toContainText('cancelled'); +} + +export const wooOrderDetailsPage = async (page, mollieOrder, testedGateway, status, notice) => { + // Check order is in status processing + const orderStatus = await fetchOrderStatus(mollieOrder); + await expect(orderStatus.toUpperCase()).toBe(status.toUpperCase()); + + // Check order notes has correct text + const orderNotesArray = await fetchOrderNotes(mollieOrder); + const lastOrderNote = orderNotesArray[0].note; + + //await expect(lastOrderNote.toLowerCase()).toContain(notice.toLowerCase()); +} + diff --git a/tests/Playwright/tests/Shared/wooUtils.js b/tests/Playwright/tests/Shared/wooUtils.js new file mode 100644 index 000000000..5a9119bd6 --- /dev/null +++ b/tests/Playwright/tests/Shared/wooUtils.js @@ -0,0 +1,250 @@ +const path = require("path"); +const fs = require("fs"); +const { request } = require('@playwright/test'); +const wooUrls = { + settingsPaymentTab: '/wp-admin/admin.php?page=wc-settings&tab=checkout' +} +const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default; +async function gotoWPPage(page, url) { + await page.goto(url); +} +async function gotoWooPaymentTab(page) { + await gotoWPPage(page, wooUrls.settingsPaymentTab); +} +/** + * + * @param baseUrl + * @param productId + * @param productQuantity + */ +const addProductToCart = async (baseUrl, productId, productQuantity) => { + //console.log('Adding product to cart:', productId, productQuantity) + const context = await request.newContext(); + const cartResponse = await context.post(`${baseUrl}/wp-json/wc/store/v1/cart/add-item`, { + data: { + id: productId, + quantity: productQuantity + } + }); + + // Check if the product was added successfully + if (cartResponse.ok()) { + //console.log('Product added to cart:', await cartResponse.json()); + } else { + console.error('Failed to add product to cart:', cartResponse.status(), await cartResponse.text()); + } +} + +const emptyCart = async (baseUrl) => { + const context = await request.newContext(); + const cartItemsResponse = await context.get(`${baseUrl}/wp-json/wc/store/v1/cart/items`); + + if (cartItemsResponse.ok()) { + const items = await cartItemsResponse.json(); + for (const item of items) { + const removeResponse = await context.post(`${baseUrl}/wp-json/wc/store/v1/cart/remove-item`, { + data: { + key: item.key + } + }); + if (!removeResponse.ok()) { + console.error('Failed to remove item from cart:', removeResponse.status(), await removeResponse.text()); + } + } + //console.log('All items removed from cart'); + } else { + console.error('Failed to retrieve cart items:', cartItemsResponse.status(), await cartItemsResponse.text()); + } +} + +/** + * @param {import('@playwright/test').Page} page + */ +const fillCustomerInCheckoutBlock = async (page, country = 'Germany') => { + if(await page.getByText(country).first().isVisible()) { + return; + } + if (await page.getByText('Edit').isVisible()) { + await page.getByText('Edit').click(); + } + await page.getByLabel('First name').first().fill('Julia'); + await page.getByLabel('Last name').first().fill('Callas'); + if(await page.getByText('Use same address for billing').isVisible()) { + await page.locator('#shipping-country').click(); + await page.getByRole('option', { name: country }).click(); + }else{ + await page.selectOption('select#billing_country', country); + } + + + await page.getByLabel('City').first().fill('Berlin'); + await page.getByLabel(/address|Address/).first().fill('Calle Drutal'); + await page.getByLabel(/Postcode|Postal code/).first().fill('22100'); + if(country === 'Netherlands') { + await page.getByLabel('Postcode').first().fill('1234 AB'); + } + await page.getByLabel('Phone').first().fill('+341234566788'); + await page.getByLabel('Email address').first().fill('test@test.com'); + +} + +const selectPaymentMethodInCheckout = async (page, paymentMethod) => { + await page.locator('label').filter({ hasText: paymentMethod }).click(); +} + +const placeOrderCheckout = async (page) => { + // Click text=Place order + await page.locator('text=Place order').click() +} + +const placeOrderPayPage = async (page) => { + // Click text=Place order + await page.getByRole('button', { name: 'Pay for order' }).click() +} + +const captureTotalAmountCheckout = async (page) => { + return await page.innerText('.order-total > td > strong > span > bdi'); +} + +const parseTotalAmount = (totalAmount) => { + // "€30.80" => 30.80 + const numberStr = totalAmount.replace(/[^\d.]/g, ''); + return parseFloat(numberStr); +} + +const captureTotalAmountPayPage = async (page) => { + const totalSelector = 'tr:last-child >> td.product-total >> .woocommerce-Price-amount.amount >> bdi'; + return await page.innerText(totalSelector); +} + +const captureTotalAmountBlockCheckout = async (page) => { + let totalLine = await page.locator('div').filter({ hasText: /^Total/ }).first() + let totalAmount = await totalLine.innerText('.woocommerce-Price-amount amount > bdi'); + // totalAmount is "Total\n72,00 €" and we need to remove the "Total\n" part + return totalAmount.substring(6, totalAmount.length); +} + +const WooCommerce = new WooCommerceRestApi({ + url: process.env.BASEURL_DEFAULT_80, + consumerKey: process.env.WOO_REST_CONSUMER_KEY, + consumerSecret: process.env.WOO_REST_CONSUMER_SECRET, + version: 'wc/v3' +}); +const createManualOrder = async (page, productId, quantity=1, country='DE', postcode='') => { + try { + const order = manualOrder(productId, quantity, country, postcode) + const response = await WooCommerce.post("orders", order); + const url = `/checkout/order-pay/${response.data.id}?pay_for_order=true&key=${response.data.order_key}`; + return { + url: url, + orderId: response.data.id, + orderKey: response.data.order_key + }; + } catch (error) { + console.log(error.response.data); + } +} + +const updateMethodSetting = async (method, payload) => { + method = 'mollie_wc_gateway_'+method.toLowerCase(); + try { + const response = await WooCommerce.put( + `payment_gateways/${method}`, + payload); + return response.data; + } catch (error) { + console.log(error.response.data); + } +} + +const fetchOrderStatus = async (orderId) => { + try { + const response = await WooCommerce.get(`orders/${orderId}`); + return response.data.status; // This will contain the order's status + } catch (error) { + console.log('Error fetching order status:', error); + return null; + } +}; +const fetchOrderNotes = async (orderId) => { + try { + const response = await WooCommerce.get(`orders/${orderId}/notes`); + return response.data; // This will contain an array of order notes + } catch (error) { + console.log('Error fetching order notes:', error); + return null; + } +}; + +const getLogByName = async (name, dirname) => { + const currentDate = new Date().toISOString().split('T')[0]; + // Construct the relative path to the log file + const logsDirectory = path.join(dirname, '..', '..', '..', '.ddev', 'wordpress', 'wp-content', 'uploads', 'wc-logs'); + const files = fs.readdirSync(logsDirectory); + const matchingFiles = files.filter(file => file.includes(`${name}-${currentDate}-`)); + // Select the first matching file + const logFileName = matchingFiles[0]; + const logFilePath = path.join(logsDirectory, logFileName); + return fs.readFileSync(logFilePath, 'utf-8'); +} + +const manualOrder = (productId, productQuantity, country, postcode) => { + return { + set_paid: false, + billing: { + first_name: "Tester", + last_name: "testing", + address_1: "969 Market", + address_2: "", + city: "San Francisco", + state: "CA", + postcode: postcode, + country: country, + email: "john.doe@example.com", + phone: "(555) 555-5555" + }, + shipping: { + first_name: "John", + last_name: "Doe", + address_1: "969 Market", + address_2: "", + city: "San Francisco", + state: "CA", + postcode: postcode, + country: country + }, + line_items: [ + { + product_id: productId, + quantity: productQuantity + } + ], + shipping_lines: [ + { + method_id: "flat_rate", + method_title: "Flat Rate", + total: "0.00" + } + ] + }; +}; + + +module.exports = { + addProductToCart, + fillCustomerInCheckoutBlock, + gotoWooPaymentTab, + placeOrderCheckout, + emptyCart, + placeOrderPayPage, + selectPaymentMethodInCheckout, + captureTotalAmountCheckout, + captureTotalAmountBlockCheckout, + captureTotalAmountPayPage, + createManualOrder, + getLogByName, + fetchOrderStatus, + fetchOrderNotes, + updateMethodSetting, + parseTotalAmount +} diff --git a/tests/Playwright/tests/Shared/wpUtils.js b/tests/Playwright/tests/Shared/wpUtils.js new file mode 100644 index 000000000..ae8e4a110 --- /dev/null +++ b/tests/Playwright/tests/Shared/wpUtils.js @@ -0,0 +1,77 @@ +async function gotoWPPage(page, url) { + await page.goto(url); +} + +async function gotoWPLogin(page) { + await gotoWPPage(page, '/wp-login.php'); +} + +async function gotoWPPlugins(page) { + await gotoWPPage(page, '/wp-admin/plugins.php'); +} + +const loginAdmin = async (page) => { + await gotoWPLogin(page); + await page.locator('#user_login').fill(process.env.E2E_AUTH_USERNAME); + await page.locator('#user_pass').fill(process.env.E2E_AUTH_PW); + await Promise.all([ + page.waitForNavigation(), + page.locator('input:has-text("Log In")').click() + ]); +} + +async function deactivateWPPlugin(page, pluginName) { + await page.getByRole('link', {name: `Deactivate ${pluginName}`, exact: true}).click(); +} + +async function activateWPPlugin(page, pluginName) { + await page.getByRole('cell', {name: `${pluginName} Activate ${pluginName} | Delete ${pluginName}`}).getByRole('link', {name: `Activate ${pluginName}`}).click(); +} + +const enableCheckboxSetting = async (page, settingName, settingsTabUrl) => { + await page.goto(settingsTabUrl); + await page.locator(`input[name="${settingName}"]`).check(); + await Promise.all([ + page.waitForNavigation(), + page.locator('text=Save changes').click() + ]); +} + +const disableCheckboxSetting = async (page, settingName, settingsTabUrl) => { + await page.goto(settingsTabUrl); + await page.locator(`input[name="${settingName}"]`).uncheck(); + await Promise.all([ + page.waitForNavigation(), + page.locator('text=Save changes').click() + ]); +} + +async function saveSettings(page) { + await Promise.all([ + page.waitForNavigation(), + page.locator('text=Save changes').click() + ]); +} + +const selectOptionSetting = async (page, settingName, settingsTabUrl, optionValue) => { + await page.goto(settingsTabUrl); + await page.selectOption(`select[name="${settingName}"]`, optionValue); + await saveSettings(page); +} + +const fillTextSettings = async (page, settingName, settingsTabUrl, value) => { + await page.goto(settingsTabUrl); + let field = await page.locator(`input[name="${settingName}"]`); + await field.fill(value); + await saveSettings(page); +} + +const fillNumberSettings = async (page, settingName, settingsTabUrl, value) => { + await page.goto(settingsTabUrl); + await page.locator(`input#${settingName}`).fill(''); + await page.type(`input#${settingName}`, value.toString()); + await saveSettings(page); +} + +module.exports = {loginAdmin, deactivateWPPlugin, activateWPPlugin, gotoWPPlugins, enableCheckboxSetting, disableCheckboxSetting, selectOptionSetting, fillTextSettings, fillNumberSettings}; + diff --git a/tests/Playwright/tests/chargeback/_transaction_scenarios_chargeback.spec.js b/tests/Playwright/tests/chargeback/_transaction_scenarios_chargeback.spec.js new file mode 100644 index 000000000..a575b5ca3 --- /dev/null +++ b/tests/Playwright/tests/chargeback/_transaction_scenarios_chargeback.spec.js @@ -0,0 +1,15 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Chargeback', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3443] Validate the creation of a chargeback on an order paid with Credit Card', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_block_cart.spec.js b/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_block_cart.spec.js new file mode 100644 index 000000000..b8fe02fb2 --- /dev/null +++ b/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_block_cart.spec.js @@ -0,0 +1,25 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Apple Pay button - Block Cart', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420208] Validate that Apple Pay button is displayed per UI design in block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420209] Validate that Apple Pay button is hidden when usupported product type is in the block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420210] Validate the submission of an order with Apple Pay button as payment method and payment mark as "Paid" from block cart', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_classic_cart.spec.js b/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_classic_cart.spec.js new file mode 100644 index 000000000..1ce9dd56a --- /dev/null +++ b/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button_-_classic_cart.spec.js @@ -0,0 +1,25 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Apple Pay button - Classic Cart', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420205] Validate that Apple Pay button is displayed per UI design in classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420206] Validate that Apple Pay button is hidden when usupported product type is in the classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420207] Validate the submission of an order with Apple Pay button as payment method and payment mark as "Paid" from classic cart', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button__-_product_page.spec.js b/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button__-_product_page.spec.js new file mode 100644 index 000000000..364f52693 --- /dev/null +++ b/tests/Playwright/tests/express-button/Apple-pay-button/_transaction_scenarios_apple_pay_button__-_product_page.spec.js @@ -0,0 +1,40 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Apple Pay button - Product page', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420199] Validate that Apple Pay button is displayed per UI design on the product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420200] Validate that Apple Pay button is hidden when visiting usupported product type page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420201] Validate the submission of an order with Apple Pay button as payment method and payment mark as "Paid" from product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420202] Validate that Apple Pay button is hidden if simple virtual product is out of stock', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420203] Validate that Apple Pay button is hidden if variable virtual product is out of stock', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420204] Validate that Apple Pay button is hidden for non-selected variation', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_block_cart.spec.js b/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_block_cart.spec.js new file mode 100644 index 000000000..95542ffa9 --- /dev/null +++ b/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_block_cart.spec.js @@ -0,0 +1,45 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - PayPal button - Block Cart', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420180] Validate that PayPal button is displayed per UI design in block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420181] Validate that PayPal button is hidden when usupported product type is in the block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420182] Validate the submission of an order with Paypal as payment method and payment mark as "Paid" from block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420183] Validate the submission of an order with Paypal as payment method and payment mark as "Pending" from block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420184] Validate the submission of an order with Paypal as payment method and payment mark as "Failed" from block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420185] Validate the submission of an order with Paypal as payment method and payment mark as "Cancelled" from block cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420186] Validate the submission of an order with Paypal as payment method and payment mark as "Expired" from block cart', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_classic_cart.spec.js b/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_classic_cart.spec.js new file mode 100644 index 000000000..7c031cb86 --- /dev/null +++ b/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_classic_cart.spec.js @@ -0,0 +1,45 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - PayPal button - Classic Cart', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420175] Validate that PayPal button is displayed per UI design in classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420173] Validate that PayPal button is hidden when usupported product type is in the classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420174] Validate the submission of an order with Paypal as payment method and payment mark as "Paid" from classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420176] Validate the submission of an order with Paypal as payment method and payment mark as "Pending" from classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420177] Validate the submission of an order with Paypal as payment method and payment mark as "Failed" from classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420178] Validate the submission of an order with Paypal as payment method and payment mark as "Cancelled" from classic cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420179] Validate the submission of an order with Paypal as payment method and payment mark as "Expired" from classic cart', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_product_page.spec.js b/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_product_page.spec.js new file mode 100644 index 000000000..f82deb4b2 --- /dev/null +++ b/tests/Playwright/tests/express-button/PayPal-button/_transaction_scenarios_paypal_button_-_product_page.spec.js @@ -0,0 +1,60 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - PayPal button - Product page', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420187] Validate that PayPal button is displayed per UI design on the product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420188] Validate that PayPal button is hidden when visiting usupported product type page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420189] Validate the submission of an order with Paypal as payment method and payment mark as "Paid" from product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420190] Validate the submission of an order with Paypal as payment method and payment mark as "Pending" from product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420191] Validate the submission of an order with Paypal as payment method and payment mark as "Failed" from product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420192] Validate the submission of an order with Paypal as payment method and payment mark as "Cancelled" from product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420193] Validate the submission of an order with Paypal as payment method and payment mark as "Expired" from product page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420194] Validate that PayPal button is hidden if simple virtual product is out of stock', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420195] Validate that PayPal button is hidden if variable virtual product is out of stock', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420196] Validate that PayPal button is hidden for non-selected variation', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/merchant-setup/API Keys Configuration.md b/tests/Playwright/tests/merchant-setup/API Keys Configuration.md new file mode 100644 index 000000000..d10f78738 --- /dev/null +++ b/tests/Playwright/tests/merchant-setup/API Keys Configuration.md @@ -0,0 +1,32 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: API Keys Configuration +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I need to enter API Key & Secret in the configuration, +So that they can be used for the connection to the Mollie platform via the API/SDK. + +#### Scenario: Merchant setup - Configuring API Keys + + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Mollie settings page] +WHEN @[Insert API credentials, with test type, with default values] +THEN @[Successful connection to API] should be established + +Data:live, test, API credentials: key, secret, PSPID + diff --git a/tests/Playwright/tests/merchant-setup/Connect to Test or Prod Platform.md b/tests/Playwright/tests/merchant-setup/Connect to Test or Prod Platform.md new file mode 100644 index 000000000..a5fe07882 --- /dev/null +++ b/tests/Playwright/tests/merchant-setup/Connect to Test or Prod Platform.md @@ -0,0 +1,52 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Connect to Test or Prod Platform +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want separate credential fields for Test and Live environments, +So that I can manage my integration settings for different deployment stages. + +#### Scenario: Merchant setup - Entering Live Credentials + + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Mollie settings page] +WHEN I @[check, the "Live mode" checkbox] +THEN I @[should see, +- Create a Mollie account link +- Enable Mollie Payments checkbox +- PSPID input field +- Use the live environment checkbox +- Live API Key input field +- Live API Secret input field +- Checkout type dropdown selected as - Full redirection to Mollie Payment page +- Payment button title input field] + +#### Scenario: Merchant setup - Entering Test Credentials + + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Mollie settings page] +WHEN I @[uncheck, the "Live mode" checkbox] +THEN I @[should see, +- Create a Mollie account link +- Enable Mollie Payments checkbox +- PSPID input field +- Use the live environment checkbox +- Test API Key input field +- Test API Secret input field +- Checkout type dropdown selected as - Full redirection to Mollie Payment page +- Payment button title input field] diff --git a/tests/Playwright/tests/merchant-setup/Test Connection with WLOP Platform.md b/tests/Playwright/tests/merchant-setup/Test Connection with WLOP Platform.md new file mode 100644 index 000000000..df94f9000 --- /dev/null +++ b/tests/Playwright/tests/merchant-setup/Test Connection with WLOP Platform.md @@ -0,0 +1,34 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Test Connection with WLOP Platform +Background: + - default + - webhooks +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to verify the validity of my credentials, +So that I can ensure they are correct for connecting to the WLOP platform. + +#### Scenario: Merchant setup - Testing Connection + + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Mollie settings page] +WHEN @[Insert API credentials, in test type, with incorrect values] +THEN @[Failed connection to API] should be established + +Params: live, test +API credentials: key, secret, PSPID +``` diff --git a/tests/Playwright/tests/plugin-foundation/Error Handling/_error_handling.spec.js b/tests/Playwright/tests/plugin-foundation/Error Handling/_error_handling.spec.js new file mode 100644 index 000000000..0758c49da --- /dev/null +++ b/tests/Playwright/tests/plugin-foundation/Error Handling/_error_handling.spec.js @@ -0,0 +1,20 @@ +const { test } = require('../Shared/base-test'); +const {getLogByName} = require("../Shared/wooUtils"); +const assert = require('assert'); +const {testData} = require("./testData"); + +test.describe(' - Error Handling', () => { + let log; + test.beforeAll(async () => { + const searchString = `mollie-payments-for-woocommerce`; + log = await getLogByName(searchString, __dirname); + }); + + testData.forEach(({ testId, mollieStatus, searchLine }) => { + test(`[${testId}] Validate that "${mollieStatus} transaction is logged"`, async ({ page, products, context }) => { + const pattern = new RegExp(searchLine, 'g'); + const containsPattern = pattern.test(log); + assert.ok(containsPattern, 'The file content does not contain the desired string'); + }); + }); +}); diff --git a/tests/Playwright/tests/plugin-foundation/Error Handling/testData.js b/tests/Playwright/tests/plugin-foundation/Error Handling/testData.js new file mode 100644 index 000000000..2d6cf5a4f --- /dev/null +++ b/tests/Playwright/tests/plugin-foundation/Error Handling/testData.js @@ -0,0 +1,37 @@ +export const testData = [ + { + testId: "C419987", + mollieStatus: "Paid", + searchLine: "onWebhookPaid processing paid order via Mollie plugin fully completed" + }, + { + testId: "C420052", + mollieStatus: "Authorized", + searchLine: "onWebhookAuthorized called for order", + }, + { + testId: "C420052", + mollieStatus: "Open", + searchLine: "Customer returned to store, but payment still pending for order", + }, + { + testId: "C419988", + mollieStatus: "Failed", + searchLine: "onWebhookFailed called for order", + }, + { + testId: "C420050", + mollieStatus: "Canceled", + searchLine: "Pending payment", + }, + { + testId: "C420051", + mollieStatus: "Expired", + searchLine: "Pending payment", + }, + { + testId: "C420054", + mollieStatus: "Pending", + wooStatus: "Pending payment", + }, +]; diff --git a/tests/Playwright/tests/plugin-foundation/Logging.md b/tests/Playwright/tests/plugin-foundation/Logging.md new file mode 100644 index 000000000..b71b7d2b0 --- /dev/null +++ b/tests/Playwright/tests/plugin-foundation/Logging.md @@ -0,0 +1,46 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Logging +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to see logs of payment process and other plugin events, +so that I can monitor and troubleshoot payment processes. + +As a supporter, +I want to receive logs from the merchants submitting support tickets, +so that I can understand the problem better and troubleshooting is made easier. + +#### Scenario: Logging Errors + +GIVEN @[Woocommerce store is configured] +WHEN @[an error occurred] during the plugin execution +AND I @[visit, the WooCommerce Logs page] +THEN I @[should see, in the log, the detailed info about this error] + +#### Scenario: Logging Events + +GIVEN @[Woocommerce store is configured] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +WHEN I @[visit, the WooCommerce Logs page] +THEN I @[should see, in the log, the detailed info about this transaction like the order ID] + +#### Scenario: Enabling Detailed Logs + +GIVEN @[Woocommerce store is configured] +WHEN I @[visit, the Worldline settings page] +AND I @[check, the "Enable debug logging" checkbox] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce Logs page] +THEN I @[should see, in the log, more detailed logs, such as HTTP requests and responses for the Worldline API] diff --git a/tests/Playwright/tests/plugin-settings/Accessing Documentation Support.md b/tests/Playwright/tests/plugin-settings/Accessing Documentation Support.md new file mode 100644 index 000000000..7119204c7 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Accessing Documentation Support.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Accessing Documentation & Support +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to access documentation support through the plugin payment method settings page, +So that I can easily find help and guidance for configuring and using the payment method. + +#### Scenario: Finding Documentation Support + +GIVEN @[WooCommerce store is configured] +WHEN @[I visit, Worldline settings page] +THEN @[I should see, on the page, a link to the documentation page] + +Data: link to documentation page diff --git a/tests/Playwright/tests/plugin-settings/Advanced/_mollie_settings_tab_advanced.spec.js b/tests/Playwright/tests/plugin-settings/Advanced/_mollie_settings_tab_advanced.spec.js new file mode 100644 index 000000000..746be36d4 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Advanced/_mollie_settings_tab_advanced.spec.js @@ -0,0 +1,104 @@ +const { expect, webkit, devices} = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); +const {addProductToCart, emptyCart} = require("../../Shared/wooUtils"); +const {allMethods, normalizedName} = require("../../Shared/gateways"); + +const orderGateways = Object.keys(allMethods); + +const paymentGateways = Object.entries(allMethods).reduce((acc, [key, method]) => { + if (!method.orderMandatory) { + acc[key] = method; + } + return acc; +}, {}); +test.describe('_Mollie Settings tab - Advanced', () => { + test.beforeAll(async ({page, baseURL, products}) => { + await addProductToCart(baseURL, products.simple.id, 10); + await page.goto('wp-admin/admin.php?page=wc-settings&tab=mollie_settings§ion=advanced'); + await page.selectOption('select[name="mollie-payments-for-woocommerce_api_switch"]', 'order'); + await page.click('text=Save changes'); + }); + + test('[C420152] Validate that Mollie Advanced section is displayed per UI design', async ({page}) => { + await page.goto('wp-admin/admin.php?page=wc-settings&tab=mollie_settings§ion=advanced'); + await expect(await page.isVisible('text=Mollie Settings')).toBeTruthy(); + await expect(await page.isVisible('text=Advanced |')).toBeTruthy(); + }); + + test('[C420154] Validate correct gateways shown with Order API on Classic checkout', async ({page}) => { + await page.goto('/checkout'); + //select germany country as is the one that has all gateways + await page.selectOption('select[name="billing_country"]', 'DE'); + //wait one second + await page.waitForTimeout(1000); + for (const gateway of orderGateways) { + if (gateway === 'in3' || gateway === 'applepay') { + continue; + } + let gatewayName = normalizedName(allMethods[gateway].defaultTitle) + await expect(await page.isVisible(`text=${gatewayName}`)).toBeTruthy(); + } + //select netherlands country as is the one that has in3 + await page.selectOption('select[name="billing_country"]', 'NL'); + await page.waitForTimeout(1000); + let gatewayName = normalizedName(allMethods['in3'].defaultTitle) + await expect(await page.isVisible(`text=${gatewayName}`)).toBeTruthy(); + }); + + + + test.skip('[C420155] Validate correct gateways shown with Order API on Block checkout', async ({page}) => { + }); + + test.skip('[C420156] Validate correct gateways shown with Order API on order pay page', async ({page}) => { + + }); + +//beforeAll + test.afterAll(async ({page, baseURL, products}) => { + await emptyCart(baseURL); + }); + + test.skip('[C420157] Validate correct gateways shown with Payment API on Classic checkout', async ({page}) => { + + }); + + test.skip('[C420158] Validate correct gateways shown with Payment API on Block checkout', async ({page}) => { + + }); + + test.skip('[C420159] Validate correct gateways shown with Payment API on order pay page', async ({page}) => { + + }); + + test.skip('[C420160] Validate change of the API Payment description', async ({page}) => { + // Your code here... + }); + + /*test.afterAll(async ({page, baseURL, products}) => { + await emptyCart(baseURL); + await page.goto('wp-admin/admin.php?page=wc-settings&tab=mollie_settings§ion=advanced'); + await page.selectOption('select[name="mollie-payments-for-woocommerce_api_switch"]', 'order'); + await page.click('text=Save changes'); + });*/ + + test.skip('[C5813] Validate that merchant can clear Mollie data from database using clear now function', async ({page}) => { + // Your code here... + }); + + test.skip('[C3332] Validate that the ecommerce admin can activate the use of Single-Click purchase', async ({page}) => { + // Your code here... + }); + + test.skip('[C420153] Validate change of the payment screen language', async ({page}) => { + // Your code here... + }); + + test.skip('[C420164] Validate that merchant can clear Mollie data from database on plugin uninstall', async ({page}) => { + // Your code here... + }); + test.skip('[C3347] Validate that the ecommerce admin can change the Description sent to Mollie regarding the order generated', async ({page}) => { + // this is the same as C420160 + }); + +}); diff --git a/tests/Playwright/tests/plugin-settings/Apple Pay Button/_mollie_settings_tab_apple_pay_button.spec.js b/tests/Playwright/tests/plugin-settings/Apple Pay Button/_mollie_settings_tab_apple_pay_button.spec.js new file mode 100644 index 000000000..d25db6550 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Apple Pay Button/_mollie_settings_tab_apple_pay_button.spec.js @@ -0,0 +1,55 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Mollie Settings tab - Apple Pay Button', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420165] Validate that Apple Pay button section is displayed per UI design', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3334] Validate that Apple Pay button can be activated', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420166] Validate change of the Apple Pay button title', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420167] Validate that Apple Pay button logo is displayed', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420168] Validate that Apple Pay button logo is hidden', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420169] Validate change of the Apple Pay button description', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420170] Validate tha Apple Pay button is enabled on classic cart page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420171] Validate tha Apple Pay button is enabled on block cart page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420172] Validate tha Apple Pay button is enabled on product page', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/plugin-settings/Backend Configuration Page.md b/tests/Playwright/tests/plugin-settings/Backend Configuration Page.md new file mode 100644 index 000000000..e63c8b700 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Backend Configuration Page.md @@ -0,0 +1,37 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Backend Configuration Page +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want a backend configuration page in the admin panel, +This page is integrated in the WooCommerce payments admin panel +So I can set up the integration and design the checkout page experience. + +#### Scenario: Plugin settings - Accessing and Configuring Plugin settings Page +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +WHEN I @[visit, Worldline settings page] +THEN I @[should see, +- Create a Worldline account link +- Enable Worldline Payments checkbox +- PSPID input field +- Use the live environment checkbox +- Test API Key input field +- Test API Secret input field +- Checkout type dropdown selected as - Full redirection to Worldline Payment page +- Payment button title input field] diff --git a/tests/Playwright/tests/plugin-settings/Compliance with UI Design in Payment Settings.md b/tests/Playwright/tests/plugin-settings/Compliance with UI Design in Payment Settings.md new file mode 100644 index 000000000..73e6104a9 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Compliance with UI Design in Payment Settings.md @@ -0,0 +1,25 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Compliance with UI Design in Payment Settings +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want the plugin payment method settings to be displayed per UI design within WooCommerce payment settings, +So that I have a consistent and user-friendly interface. + +#### Scenario: Checking UI Design Compliance + +GIVEN @[install, the Worldline plugin] +WHEN I @[visit, the WooCommerce payment settings page] +THEN I @[should see, the Worldline payment method settings] diff --git a/tests/Playwright/tests/plugin-settings/Define Checkout Language.md b/tests/Playwright/tests/plugin-settings/Define Checkout Language.md new file mode 100644 index 000000000..ce9d2cebc --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Define Checkout Language.md @@ -0,0 +1,39 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Define Checkout Language +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to send the store’s country/language to the Worldline redirected payment page, +So that the checkout process is presented in the appropriate language to the customer.(FR/NL/DE/ES/IT) + +#### Scenario: Configuring Checkout Language +@[xrayKey: + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, WooCommerce settings page] +AND I @[select, the store’s country/language, from one of the expected languages (FR/NL/DE/ES/IT)] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status success] +THEN I @[should see, this language used on the Worldline Payment Page] + +Data: languages: FR, NL, DE, ES, IT + +#### Scenario: Configuring Checkout Language with none expected languages +@[xrayKey: + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, WooCommerce settings page] +AND I @[select, the store’s country/language, is not one of the expected languages (FR/NL/DE/ES/IT)] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status success] +THEN I @[should see, the English language to be used on the Worldline Payment Page] diff --git a/tests/Playwright/tests/plugin-settings/Edit Payment Button Title.md b/tests/Playwright/tests/plugin-settings/Edit Payment Button Title.md new file mode 100644 index 000000000..4f27f5943 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Edit Payment Button Title.md @@ -0,0 +1,41 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Edit Payment Button Title +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to edit the title of the payment button for Full Redirection and Hosted Tokenization Page, +So that it aligns with my store’s branding and customer expectations. + +#### Scenario: Plugin settings - Customizing Payment Button Title +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[fill in, "Payment button title" field, with the value "My custom title"] +AND I @[click, Save settings button] +AND I @[visit, the checkout page] +AND I @[select, in checkout payment methods, the Worldline gateway] +THEN I @[should see, on the Place order button, "My custom title"] + +#### Scenario: Plugin settings - Keeping Default Payment Button Title +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[fill in, "Payment button title" field, with empty value] +AND I @[click, Save settings button] +AND I @[visit, the checkout page] +AND I @[select, in checkout payment methods, the Worldline gateway] +THEN I @[should see, on the Place order button, "Place order"] diff --git a/tests/Playwright/tests/plugin-settings/Edit Payment method.md b/tests/Playwright/tests/plugin-settings/Edit Payment method.md new file mode 100644 index 000000000..d3942eea8 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Edit Payment method.md @@ -0,0 +1,37 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Edit Payment Method Title +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to edit the title of the payment method for WooCommerce Payments Page, +So that it aligns with the merchants expectations. + +#### Scenario: Plugin settings - Customizing Payment method Title + +GIVEN @[WooCommerce Plugin is installed] +AND I @[visit, Worldline settings page] +WHEN I @[fill in, "Payment payment title" field, with the value "My custom payment title"] +AND I @[click, Save settings button] +AND I @[visit, WooCommerce Payments page] +THEN I @[should see, under Method, "My custom payment title"] + +#### Scenario: Plugin settings - Keeping Default Payment Button Title + +GIVEN @[WooCommerce Plugin is installed] +AND I @[visit, Worldline settings page] +WHEN I @[fill in, "Payment payment title" field, with empty value] +AND I @[click, Save settings button] +AND I @[visit, WooCommerce Payments page] +THEN I @[should see, under Method, "Worldline payments"] diff --git a/tests/Playwright/tests/plugin-settings/Enforce 3DSv2 Strong Customer Authentication.md b/tests/Playwright/tests/plugin-settings/Enforce 3DSv2 Strong Customer Authentication.md new file mode 100644 index 000000000..e6c1ef1a7 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Enforce 3DSv2 Strong Customer Authentication.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Enforce 3DSv2 Strong Customer Authentication +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to enforce strong customer authentication (SCA) for every transaction, +So that I can provide enhanced security for my customers. + +#### Scenario: Setting SCA Enforcement +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, Worldline settings page] +AND I @[select, in the payment settings, enforce 3DSv2] +AND I @[click, save button] +AND I @[perform a transaction, with any product, with Worldline gateway] +THEN I @[should see, the transaction processed with 3DSv2 authentication] diff --git a/tests/Playwright/tests/plugin-settings/Group Card Brands.md b/tests/Playwright/tests/plugin-settings/Group Card Brands.md new file mode 100644 index 000000000..2b3b30174 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Group Card Brands.md @@ -0,0 +1,33 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Group Card Brands +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant using the Hosted Checkout Page, +I want to choose whether to show card brands individually or grouped together, +So that I can provide a tailored checkout experience for my customers. + +#### Scenario: Configuring Card Brand Display Grouped + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, WooCommerce settings page] +WHEN I @[select, the card brand display setting, to grouped] +THEN I @[should see, on the checkout page, the card brands grouped together] + +#### Scenario: Configuring Card Brand Display + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, WooCommerce settings page] +WHEN I @[select, the card brand display setting, to individual] +THEN I @[should see, on the checkout page, the card brands displayed individually] diff --git a/tests/Playwright/tests/plugin-settings/Integration Listing in WooCommerce Settings.md b/tests/Playwright/tests/plugin-settings/Integration Listing in WooCommerce Settings.md new file mode 100644 index 000000000..d2a253973 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Integration Listing in WooCommerce Settings.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Integration Listing in WooCommerce Settings +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to list the Worldline integration within the WooCommerce payments settings page, +So that I can manage its activation status and configure it as needed. + +#### Scenario: Viewing Integration in WooCommerce Settings + +GIVEN I @[activate, the Worldline plugin] +AND I @[visit, the WooCommerce payment settings page] +WHEN I @[click, the Worldline payment method] +THEN I @[should see, in the page, the Worldline payment method settings] + diff --git a/tests/Playwright/tests/plugin-settings/Mollie Components/_mollie_settings_tab_mollie_components.spec.js b/tests/Playwright/tests/plugin-settings/Mollie Components/_mollie_settings_tab_mollie_components.spec.js new file mode 100644 index 000000000..4d5f4f7a2 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Mollie Components/_mollie_settings_tab_mollie_components.spec.js @@ -0,0 +1,35 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Mollie Settings tab - Mollie Components', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420151] Validate that Mollie Components section is displayed per UI design', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420144] Validate base style change of Mollie components on classic checkout', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420145] Validate base style change of Mollie components on block checkout', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420146] Validate invalid status style change of Mollie components on block checkout', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420147] Validate invalid status style change of Mollie components on classic checkout', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings.spec.js b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings.spec.js new file mode 100644 index 000000000..44bf42983 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings.spec.js @@ -0,0 +1,94 @@ +const {test} = require('../../Shared/base-test'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); +const {normalizedName} = require("../../Shared/gateways"); +const {resetSettings, insertAPIKeys, setOrderAPI, beforePlacingOrder} = require("../../Shared/mollieUtils"); +const {addProductToCart, emptyCart} = require("../../Shared/wooUtils"); +const {expect} = require("@playwright/test"); + +test.describe('_Mollie Settings tab - Payment method settings', () => { + // Set up parameters or perform actions before all tests + test.beforeAll(async ({baseURL, products}) => { + await addProductToCart(baseURL, products.simple.id, 5); + }); + test.afterAll(async ({baseURL}) => { + await emptyCart(baseURL); + }); + + test.beforeEach(async ({page, context, gateways}) => { + context.method = gateways.bancontact; + context.tabUrl = gatewaySettingsRoot + context.method.id; + context.title = normalizedName(context.method.defaultTitle); + await page.goto(context.tabUrl); + }); + +test('[C3325] Validate that the ecommerce admin can change the payment name', async ({page, context}) => { + await page.locator(`input[name="mollie_wc_gateway_${context.method.id}_title"]`).fill(`${context.title} edited`); + await page.click('text=Save changes'); + await page.goto('/checkout'); + await expect(await page.isVisible(`text=${title} edited`)).toBeTruthy(); + }); + +test('[C3326] Validate that the ecommerce admin can change the payment logo', async ({page, context}) => { + await page.getByLabel('Enable custom logo').check(); + await page.click('text=Save changes'); + await page.getByLabel('Upload custom logo').setInputFiles('tests/e2e/Shared/test-logo.png'); + await page.click('text=Save changes'); + await page.goto('/checkout'); + const url = await page.$eval(`text=${context.title} edited >> img`, img => img.src); + await expect(url).toContain(`test-logo.png`) + }); + +test('[C3327] Validate that the ecommerce admin can change the payment description', async ({page}) => { + await page.locator(`textarea[name="mollie_wc_gateway_${context.method.id}_description"]`).fill(`${context.title} description edited`); + await page.click('text=Save changes'); + await page.goto('/checkout'); + await expect(await page.isVisible(`text=${context.title} description edited`)).toBeTruthy(); + }); + +test('[C420329] Validate selling only to specific countries', async ({page, context}) => { + const previousValue = await page.getByRole('link', {name: 'Select none'}).isVisible(); + if (previousValue) { + await page.click('text=Select none'); + await page.click('text=Save changes'); + } + await page.locator('[placeholder="Choose countries…"]').click(); + await page.locator('[placeholder="Choose countries…"]').fill('spa'); + await page.locator('li[role="option"]:has-text("Spain")').click(); + await page.click('text=Save changes'); + await page.goto('/checkout'); + await expect(await page.getByText(`${context.title} edited`).count()).toEqual(0); + + }); + +test.skip('[C420330] Validate that order expiry time can be activated and changed', async ({page}) => { + await page.getByLabel('Activate expiry time setting').check(); + await page.getByLabel('Expiry time', {exact: true}).fill('1'); + await page.click('text=Save changes'); + await expect(await page.getByLabel('Activate expiry time setting').isChecked()).toBeTruthy(); + await expect(await page.getByLabel('Expiry time', {exact: true})).toHaveValue('1'); + }); + +test.skip('[C420331] Validate that initial order status can be set to "On Hold"', async ({page}) => { + await expect(await page.getByRole('combobox', {name: 'Initial order status'})).toHaveValue('on-hold'); + }); + +test.skip('[C420332] Validate that initial order status can be set to "Pending payment"', async ({page}) => { + await page.getByLabel('Initial order status').selectOption('pending'); + await page.click('text=Save changes'); + await expect(await page.getByRole('combobox', {name: 'Initial order status'})).toHaveValue('pending'); + }); + test.skip('[C93487] Validate expiry time for Bancontact', async ({ page}) => { + // Your code here... + }); + test.skip('[C3362] Validate that the iDEAL issuer list available in payment selection', async ({ page}) => { + // Your code here... + }); + + + test.skip('[C89358] Validate expiry time for IDEAL', async ({ page}) => { + // Your code here... + }); + test.skip('[C127228] Validate expiry time for SEPA Bank Transfer', async ({ page}) => { + // Your code here... + }); +}); diff --git a/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_credit_card_settings.spec.js b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_credit_card_settings.spec.js new file mode 100644 index 000000000..c860cd084 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_credit_card_settings.spec.js @@ -0,0 +1,162 @@ +const { test } = require('../../Shared/base-test'); +const { + settingsNames, + classicCheckoutTransaction +} = require('../../Shared/mollieUtils'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); +const {selectOptionSetting, fillNumberSettings} = require("../../Shared/wpUtils"); + +test.describe('_Mollie Settings tab_Payment method settings - Credit card settings', () => { + test.beforeEach(async ({page, context, gateways}) => { + context.method = gateways.creditcard; + context.tabUrl = gatewaySettingsRoot + context.method.id; + await page.goto(context.tabUrl); + context.surchargeSetting = settingsNames.surcharge(context.method.id); + }); + + +test.skip('[C3331] Validate that the ecommerce admin can activate the use of Mollie Components', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3730] Validate that the ecommerce admin has activated Mollie Components by default for new installations', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C89350] Validate Credit card surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'no_fee'); + const result = await classicCheckoutTransaction(page, products.simple, context.method) + let total = result.totalAmount.slice(0, -1).trim(); + let expected = products.simple.price.slice(0, -1).trim(); + expect(expected).toEqual(total); +}); + + +test('[C89351] Validate percentage fee for Credit card surcharge', async ({ page, products, context}) => { + const fee = 10; + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'percentage'); + const percentageFeeSetting = settingsNames.percentage(context.method.id); + await fillNumberSettings(page,percentageFeeSetting, context.tabUrl, fee); + const result = await classicCheckoutTransaction(page, products.simple, context.method) + let total = parseFloat(result.totalAmount.replace(",", ".").replace(/[^d.-]/g, "")); + let productPrice = parseFloat(products.simple.price.replace(",", ".").replace(/[^d.-]/g, "")); + let expected = productPrice + (productPrice * fee/100); + expect(total).toEqual(expected); +}); + + +test('[C89352] Validate fixed fee and percentage for Credit card surcharge', async ({ page, products, context}) => { + const fee = 10; + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'fixed_fee_percentage'); + const fixedFeeSetting = settingsNames.fixedFee(context.method.id); + await fillNumberSettings(page,fixedFeeSetting, context.tabUrl, fee); + const percentageFeeSetting = settingsNames.percentage(context.method.id); + await fillNumberSettings(page,percentageFeeSetting, context.tabUrl, fee); + const result = await classicCheckoutTransaction(page, products.simple, context.method) + let total = parseFloat(result.totalAmount.replace(",", ".").replace(/[^d.-]/g, "")); + let productPrice = parseFloat(products.simple.price.replace(",", ".").replace(/[^d.-]/g, "")); + let expected = productPrice + fee + (productPrice * fee/100); + expect(total).toEqual(expected); +}); + + +test('[C89353] Validate Credit card surcharge for fixed fee if surcharge limit in € is setup, gateway fee will not be added if surcharge exceeded limit', async ({ page, products, context}) => { + const fee = 10; + const limit = 30; + const productQuantity = 2; + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'fixed_fee'); + const fixedFeeSetting = settingsNames.fixedFee(context.method.id); + await fillNumberSettings(page,fixedFeeSetting, context.tabUrl, fee); + const limitFeeSetting = settingsNames.limitFee(context.method.id); + await fillNumberSettings(page,limitFeeSetting, context.tabUrl, limit); + const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity) + let total = parseFloat(result.totalAmount.replace(",", ".").replace(/[^d.-]/g, "")); + let expected = parseFloat(products.simple.price.replace(",", ".").replace(/[^d.-]/g, "")) * productQuantity; + expect(total).toEqual(expected); +}); + + +test('[C89354] Validate surcharge for Credit card when is selected fixed fee for payment surcharge and surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page, products, context}) => { + const fee = 10; + const limit = 30; + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'fixed_fee'); + const fixedFeeSetting = settingsNames.fixedFee(context.method.id); + await fillNumberSettings(page,fixedFeeSetting, context.tabUrl, fee); + const limitFeeSetting = settingsNames.limitFee(context.method.id); + await fillNumberSettings(page,limitFeeSetting, context.tabUrl, limit); + const result = await classicCheckoutTransaction(page, products.simple, context.method) + let total = parseFloat(result.totalAmount.replace(",", ".").replace(/[^d.-]/g, "")); + let expected = parseFloat(products.simple.price.replace(",", ".").replace(/[^d.-]/g, "")) + fee; + expect(total).toEqual(expected); +}); + + +test('[C89355] Validate surcharge for Credit card when is selected fixed fee and percentage fee for payment surcharge and Surcharge only under this limit in € is setup, surcharge will no be added for price above limit', async ({ page, products, context}) => { + const fee = 10; + const limit = 30; + const productQuantity = 2; + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'fixed_fee_percentage'); + const fixedFeeSetting = settingsNames.fixedFee(context.method.id); + await fillNumberSettings(page,fixedFeeSetting, context.tabUrl, fee); + const percentageFeeSetting = settingsNames.percentage(context.method.id); + await fillNumberSettings(page,percentageFeeSetting, context.tabUrl, fee); + const limitFeeSetting = settingsNames.limitFee(context.method.id); + await fillNumberSettings(page,limitFeeSetting, context.tabUrl, limit); + const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity) + let total = parseFloat(result.totalAmount.replace(",", ".").replace(/[^d.-]/g, "")); + let productPrice = parseFloat(products.simple.price.replace(",", ".").replace(/[^d.-]/g, "")) * productQuantity; + expect(total).toEqual(productPrice); +}); + + +test('[C89356] Validate surcharge for Credit card when is selected percentage fee for payment surcharge and Surcharge only under this limit in € is setup, surcharge will no be added for price above limit', async ({ page, products, context}) => { + const fee = 10; + const limit = 30; + const productQuantity = 2; + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'percentage'); + const percentageFeeSetting = settingsNames.percentage(context.method.id); + await fillNumberSettings(page,percentageFeeSetting, context.tabUrl, fee); + const limitFeeSetting = settingsNames.limitFee(context.method.id); + await fillNumberSettings(page,limitFeeSetting, context.tabUrl, limit); + const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity) + let total = parseFloat(result.totalAmount.replace(",", ".").replace(/[^d.-]/g, "")); + let productPrice = parseFloat(products.simple.price.replace(",", ".").replace(/[^d.-]/g, "")) * productQuantity; + expect(total).toEqual(productPrice); +}); + + +test.skip('[C89357] Validate surcharge for Credit card if merchant change currency in store, currency is also changed in surcharge section for Mollie payment method', async ({ page}) => { + // Your code here... +}); + + +test('[C94865] Validate fixed fee for Credit card surcharge', async ({ page, products, context}) => { + const fee = 10; + await selectOptionSetting(page, context.surchargeSetting, context.tabUrl, 'fixed_fee'); + const fixedFeeSetting = settingsNames.fixedFee(context.method.id); + await fillNumberSettings(page,fixedFeeSetting, context.tabUrl, fee); + const result = await classicCheckoutTransaction(page, products.simple, context.method) + let total = parseFloat(result.totalAmount.replace(",", ".").replace(/[^d.-]/g, "")); + let expected = parseFloat(products.simple.price.replace(",", ".").replace(/[^d.-]/g, "")) + fee; + expect(total).toEqual(expected); +}); + + +test.skip('[C100198] Validate surcharge for Credit card when is selected percentage for payment surcharge and Surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C100199] Validate surcharge for Credit card when is selected fixed fee and percentage for payment surcharge and Surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C94864] Validate expiry time for Credit card', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_gift_cards_settings.spec.js b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_gift_cards_settings.spec.js new file mode 100644 index 000000000..fae0882f0 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_gift_cards_settings.spec.js @@ -0,0 +1,71 @@ +const { test } = require('../../Shared/base-test'); +const { + settingsNames, + noFeeAdded, fixedFeeTest, percentageFeeTest, fixedAndPercentageFeeTest, + fixedFeeUnderLimitTest, percentageFeeUnderLimitTest, fixedAndPercentageUnderLimit, fixedFeeOverLimit, + percentageFeeOverLimit, fixedFeeAndPercentageOverLimit +} = require('../../Shared/mollieUtils'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); +const {selectOptionSetting, fillNumberSettings} = require("../../Shared/wpUtils"); +const {expect} = require("@playwright/test"); + +test.describe('_Mollie Settings tab_Payment method settings - Gift cards settings', () => { + test.beforeEach(async ({page, context, gateways}) => { + context.method = gateways.giftcard; + context.tabUrl = gatewaySettingsRoot + context.method.id; + await page.goto(context.tabUrl); + context.surchargeSetting = settingsNames.surcharge(context.method.id); + }); + + +test('[C130896] Validate Gift Card surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { + await noFeeAdded(page, context, products); +}); + + +test('[C130897] Validate fixed fee for Gift Card surcharge', async ({ page, products, context}) => { + await fixedFeeTest(page, context, products); +}); + + +test('[C130898] Validate percentage fee for Gift Card surcharge', async ({ page, products, context}) => { + await percentageFeeTest(page, context, products); +}); + + +test('[C130899] Validate fixed fee and percentage for Gift Card surcharge', async ({ page, products, context}) => { + await fixedAndPercentageFeeTest(page, context, products); +}); + + +test('[C130900] Validate surcharge for Gift Card when is selected fixed fee for payment surcharge and surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page, products, context}) => { + await fixedFeeUnderLimitTest(page, context, products); +}); + + +test('[C130901] Validate surcharge for Gift Card when is selected percentage for payment surcharge and Surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page, products, context}) => { + await percentageFeeUnderLimitTest(page, context, products); +}); + + +test('[C130902] Validate surcharge for Gift Card when is selected fixed fee and percentage for payment surcharge and Surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page, products, context}) => { + await fixedAndPercentageUnderLimit(page, context, products); +}); + + +test('[C130903] Validate Gift Card surcharge for fixed fee if surcharge limit in € is setup, gateway fee will not be added if surcharge exceeded limit', async ({ page, products, context}) => { + await fixedFeeOverLimit(page, context, products); +}); + + +test('[C130904] Validate surcharge for Gift Card when is selected percentage fee for payment surcharge and Surcharge only under this limit in € is setup, surcharge will no be added for price above limit', async ({ page, products, context}) => { + await percentageFeeOverLimit(page, context, products); +}); + + +test('[C130905] Validate surcharge for Gift Card when is selected fixed fee and percentage fee for payment surcharge and Surcharge only under this limit in € is setup, surcharge will no be added for price above limit', async ({ page, products, context}) => { + await fixedFeeAndPercentageOverLimit(page, context, products); +}); + + +}); diff --git a/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_voucher_settings.spec.js b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_voucher_settings.spec.js new file mode 100644 index 000000000..685c654e5 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_voucher_settings.spec.js @@ -0,0 +1,79 @@ +const { test } = require('../../Shared/base-test'); +const { + settingsNames, + noFeeAdded, fixedFeeTest, percentageFeeTest, fixedAndPercentageFeeTest, + fixedFeeUnderLimitTest, percentageFeeUnderLimitTest, fixedAndPercentageUnderLimit, fixedFeeOverLimit, + percentageFeeOverLimit, fixedFeeAndPercentageOverLimit +} = require('../../Shared/mollieUtils'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); + +test.describe('_Mollie Settings tab_Payment method settings - Voucher settings', () => { + test.beforeEach(async ({page, context, gateways}) => { + context.method = gateways.voucher; + context.tabUrl = gatewaySettingsRoot + context.method.id; + await page.goto(context.tabUrl); + context.surchargeSetting = settingsNames.surcharge(context.method.id); + }); + + +test.skip('[C3365] Validate Voucher payment method is not visible when there is no voucher product in the cart', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3366] Validate Voucher payment method is visible when there is a combination of products (voucher eligible and not eligible)', async ({ page}) => { + // Your code here... +}); + + +test('[C129813] Validate Voucher surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { + await noFeeAdded(page, context, products); +}); + + +test('[C129814] Validate fixed fee for Voucher surcharge', async ({ page, products, context}) => { + await fixedFeeTest(page, context, products); +}); + + +test('[C129815] Validate percentage fee for Voucher surcharge', async ({ page, products, context}) => { + await percentageFeeTest(page, context, products); +}); + + +test('[C129816] Validate fixed fee and percentage for Voucher surcharge', async ({ page, products, context}) => { + await fixedAndPercentageFeeTest(page, context, products); +}); + + +test('[C129817] Validate surcharge for Voucher when is selected fixed fee for payment surcharge and surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page, products, context}) => { + await fixedFeeUnderLimitTest(page, context, products); +}); + + +test('[C129818] Validate surcharge for Voucher when is selected percentage for payment surcharge and Surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page, products, context}) => { + await percentageFeeUnderLimitTest(page, context, products); +}); + + +test('[C129819] Validate surcharge for Voucher when is selected fixed fee and percentage for payment surcharge and Surcharge only under this limit in € is setup, surcharge will be added for total under limit', async ({ page, products, context}) => { + await fixedAndPercentageUnderLimit(page, context, products); +}); + + +test('[C129820] Validate Voucher surcharge for fixed fee if surcharge limit in € is setup, gateway fee will not be added if surcharge exceeded limit', async ({ page, products, context}) => { + await fixedFeeOverLimit(page, context, products); +}); + + +test('[C129821] Validate surcharge for Voucher when is selected percentage fee for payment surcharge and Surcharge only under this limit in € is setup, surcharge will no be added for price above limit', async ({ page, products, context}) => { + await percentageFeeOverLimit(page, context, products); +}); + + +test('[C129822] Validate surcharge for Voucher when is selected fixed fee and percentage fee for payment surcharge and Surcharge only under this limit in € is setup, surcharge will no be added for price above limit', async ({ page, products, context}) => { + await fixedFeeAndPercentageOverLimit(page, context, products); +}); + + +}); diff --git a/tests/Playwright/tests/plugin-settings/Selecting Checkout Types.md b/tests/Playwright/tests/plugin-settings/Selecting Checkout Types.md new file mode 100644 index 000000000..8d5725607 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Selecting Checkout Types.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Selecting Checkout Types +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to choose the checkout type for my store, specifically full redirection to Worldline Payment Page, +So that customers can complete their payments securely on Worldline’s platform. + +#### Scenario: Plugin settings - Selecting Checkout Types to Full Redirection +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[click, on Checkout type dropdown setting] +THEN I @[should see, on Checkout type dropdown, 'Full redirection to Worldline Payment Page'] diff --git a/tests/Playwright/tests/plugin-settings/Translate Default Payment Button Titles.md b/tests/Playwright/tests/plugin-settings/Translate Default Payment Button Titles.md new file mode 100644 index 000000000..ea8b7f08b --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Translate Default Payment Button Titles.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Translate Default Payment Button Titles +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to provide translated payment button titles in multiple languages (FR, NL, DE, ES, IT), +So that non-English speaking customers can understand the payment options clearly. + +#### Scenario: Setting Translated Button Titles + +GIVEN I @[visit, the Worldline settings page] +WHEN I @[select, on the payment button titles setting, the option languages to any of (FR, NL, DE, ES, IT)] +AND I @[save, the settings] +AND I @[visit, the checkout page] +THEN I @[should see, the payment button titles displayed in the selected language]``` diff --git a/tests/Playwright/tests/shared-stories/compatibility/3rd-party-plugin-compatibility/_transaction_scenarios_3rd_party_plugin_compatibility.spec.js b/tests/Playwright/tests/shared-stories/compatibility/3rd-party-plugin-compatibility/_transaction_scenarios_3rd_party_plugin_compatibility.spec.js new file mode 100644 index 000000000..21dcc811e --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/3rd-party-plugin-compatibility/_transaction_scenarios_3rd_party_plugin_compatibility.spec.js @@ -0,0 +1,40 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - 3rd party plugin compatibility', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3737] Validate that there is no order total missmatch while using Woo Payment Discounts fixed discount', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3738] Validate that there is no order total missmatch while using Woo Payment Discounts percentage discount', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C5539] Validate that with Amazon Pay active Bank Transfer gateway is not hidden', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C5602] Validate that SSH SFTP Updater Support does not crash Updates page', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C5604] Validate that there is no conflict with WooCommerce BACS', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420055] Validate that there is no conflict with Polylang', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/_transaction_scenarios_versions_php.spec.js b/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/_transaction_scenarios_versions_php.spec.js new file mode 100644 index 000000000..24e4cc874 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/_transaction_scenarios_versions_php.spec.js @@ -0,0 +1,39 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Versions - PHP', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C419989] Validate that Mollie can’t be activated on an environment running on PHP version below 7.2', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419990 +test.skip('Create an successful transaction on an environment running on PHP version 7.2', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419991 +test.skip('Create an successful transaction on an environment running on PHP version 7.4', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419992 +test.skip('Create an successful transaction on an environment running on PHP version 8', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419993 +test.skip('Create an successful transaction on an environment running on PHP version 8.1', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/plugin-cant-be-activated-with-php-version-lower-than.md b/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/plugin-cant-be-activated-with-php-version-lower-than.md new file mode 100644 index 000000000..bb80b4251 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/plugin-cant-be-activated-with-php-version-lower-than.md @@ -0,0 +1,28 @@ +--- +Title: plugin cant be activated with php version lower than +Feature: third party compatibility +Background: + - php-lower-than-7.4 +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want the plugin to prevent activation if the PHP version is lower than 7.4, +So that I avoid potential issues due to outdated PHP versions. + +#### Scenario: Blocking Activation on Older PHP Versions + +GIVEN @[WooCommerce store, PHP7.3] +AND I @[visit, the WordPress plugins page] +WHEN I @[click, under 'Plugin Name', the activate button] +THEN I @[should see, on the page, a message indicating the required minimum PHP version of 7.4] diff --git a/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/successful-transaction-with-php-version.md b/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/successful-transaction-with-php-version.md new file mode 100644 index 000000000..0ce2ee827 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/php-compatibility/successful-transaction-with-php-version.md @@ -0,0 +1,27 @@ +--- +Title: successful transaction with php version +Feature: third party compatibility +Background: + - php-matrix +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to ensure that transactions are processed successfully on PHP versions from 7.4 to current, +So that there are no server-side compatibility issues affecting transactions. + +#### Scenario: Processing Transactions on Supported PHP Versions + +GIVEN @[WooCommerce store is configured, PHP7.4] +AND I @[perform a transaction, with any product, with Worldline as the payment method, status authorized] +WHEN I @[visit, the plugin log page] +THEN I @[should see, in the transaction log, no server-side compatibility issues] diff --git a/tests/Playwright/tests/shared-stories/compatibility/theme-compatibility.md b/tests/Playwright/tests/shared-stories/compatibility/theme-compatibility.md new file mode 100644 index 000000000..b0d80826c --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/theme-compatibility.md @@ -0,0 +1,28 @@ +--- +Title: theme compatibility +Feature: third party compatibility +Background: + - theme compatibility +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want the plugin to be compatible with the default WordPress theme and Storefront, +So that the plugin functions correctly and maintains a consistent user experience. + +#### Scenario: Ensuring Compatibility with Default Themes + +GIVEN @[WooCommerce store is configured, default theme] +AND I @[perform a transaction, with any product, with Worldline as the payment method, status authorized] +WHEN I @[visit, the plugin log page] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully without disrupting the site’s layout or user experience] diff --git a/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/_transaction_scenarios_versions_woocommerce.spec.js b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/_transaction_scenarios_versions_woocommerce.spec.js new file mode 100644 index 000000000..24338634f --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/_transaction_scenarios_versions_woocommerce.spec.js @@ -0,0 +1,242 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Versions - WooCommerce', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C420011] Validate that Mollie can’t be activated while WooCommerce is deactivated', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420012 +test.skip('Install plugin when WooCommerce not available (warning should be shown)', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C420013] Validate that Mollie can’t be activated when WooCommerce version lower than 3.9.0 is active', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420014 +test.skip('Create an successful transaction while running on WooCommerce version 3.9.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420015 +test.skip('Create an successful transaction while running on WooCommerce version 4.0.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420016 +test.skip('Create an successful transaction while running on WooCommerce version 4.1.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420017 +test.skip('Create an successful transaction while running on WooCommerce version 4.2.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420018 +test.skip('Create an successful transaction while running on WooCommerce version 4.3.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420019 +test.skip('Create an successful transaction while running on WooCommerce version 4.4.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420020 +test.skip('Create an successful transaction while running on WooCommerce version 4.5.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420021 +test.skip('Create an successful transaction while running on WooCommerce version 4.6.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420022 +test.skip('Create an successful transaction while running on WooCommerce version 4.7.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420023 +test.skip('Create an successful transaction while running on WooCommerce version 4.8.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420024 +test.skip('Create an successful transaction while running on WooCommerce version 4.9.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420025 +test.skip('Create an successful transaction while running on WooCommerce version 5.0.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420026 +test.skip('Create an successful transaction while running on WooCommerce version 5.1.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420027 +test.skip('Create an successful transaction while running on WooCommerce version 5.2.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420028 +test.skip('Create an successful transaction while running on WooCommerce version 5.3.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420029 +test.skip('Create an successful transaction while running on WooCommerce version 5.4.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420030 +test.skip('Create an successful transaction while running on WooCommerce version 5.5.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420031 +test.skip('Create an successful transaction while running on WooCommerce version 5.6.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420032 +test.skip('Create an successful transaction while running on WooCommerce version 5.7.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420033 +test.skip('Create an successful transaction while running on WooCommerce version 5.8.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420034 +test.skip('Create an successful transaction while running on WooCommerce version 5.9.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420035 +test.skip('Create an successful transaction while running on WooCommerce version 6.0.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420036 +test.skip('Create an successful transaction while running on WooCommerce version 6.1.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420037 +test.skip('Create an successful transaction while running on WooCommerce version 6.2.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420038 +test.skip('Create an successful transaction while running on WooCommerce version 6.3.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420039 +test.skip('Create an successful transaction while running on WooCommerce version 6.4.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420040 +test.skip('Create an successful transaction while running on WooCommerce version 6.5.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420041 +test.skip('Create an successful transaction while running on WooCommerce version 6.6.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420042 +test.skip('Create an successful transaction while running on WooCommerce version 6.7.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420043 +test.skip('Create an successful transaction while running on WooCommerce version 6.8.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420044 +test.skip('Create an successful transaction while running on WooCommerce version 6.9.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420045 +test.skip('Create an successful transaction while running on WooCommerce version 7.0.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420046 +test.skip('Create an successful transaction while running on WooCommerce version 7.1.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420047 +test.skip('Create an successful transaction while running on WooCommerce version 7.2.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420048 +test.skip('Create an successful transaction while running on WooCommerce version 7.3.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420049 +test.skip('Create an successful transaction while running on WooCommerce version 7.4.0', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/install-plugin-when-woocommerce-not-available-warning.md b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/install-plugin-when-woocommerce-not-available-warning.md new file mode 100644 index 000000000..8322f6d75 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/install-plugin-when-woocommerce-not-available-warning.md @@ -0,0 +1,28 @@ +--- +Title: install plugin when woocommerce not available warning +Feature: third party compatibility +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to receive a warning if I attempt to install the plugin when WooCommerce is not available on my site, +So that I understand WooCommerce is a prerequisite for the plugin. + +#### Scenario: Displaying Warning for Missing WooCommerce + +GIVEN @[Wordpress without WooCommerce environment] +AND I @[visit, the WordPress plugins page] +WHEN I @[install, the plugin] +THEN I @[should see, on the page, a warning message indicating that WooCommerce is required] diff --git a/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-when-woocommerce-version-lower-than.md b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-when-woocommerce-version-lower-than.md new file mode 100644 index 000000000..118d52f11 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-when-woocommerce-version-lower-than.md @@ -0,0 +1,30 @@ +--- +Title: plugin cant be activated when woocommerce version lower than +Feature: third party compatibility +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want the plugin to prevent activation if the WooCommerce version is lower than the supported version, +So that I avoid running into compatibility issues that could affect my online store. + +#### Scenario: Blocking Activation on Older WooCommerce Versions + +GIVEN @[WooCommerce store, version lower than required] +AND I @[visit, the WordPress plugins page] +WHEN I @[click, under 'Plugin Name', the activate button] +THEN I @[should see, on the page, a message indicating the required minimum WooCommerce version] + +Data: minimum WooCommerce version diff --git a/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-while-woocommerce-is-deactivated.md b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-while-woocommerce-is-deactivated.md new file mode 100644 index 000000000..ffc275914 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/plugin-cant-be-activated-while-woocommerce-is-deactivated.md @@ -0,0 +1,29 @@ +--- +Title: plugin cant be activated while woocommerce is deactivated +Feature: third party compatibility +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to ensure that the plugin cannot be activated unless WooCommerce is also activated, +So that functional dependencies are maintained. + +#### Scenario: Preventing Activation Without Active WooCommerce + +GIVEN @[WooCommerce store is configured] +AND I @[deactivate, WooCommerce] +WHEN I @[visit, the WordPress plugins page] +AND I @[click, under 'Plugin Name', the activate button] +THEN I @[should see, on the page, a message indicating that WooCommerce must be activated first] diff --git a/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/successful-transaction-while-running-on-woocommerce-expected-version.md b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/successful-transaction-while-running-on-woocommerce-expected-version.md new file mode 100644 index 000000000..19b7042ec --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/woocommerce-compatibility/successful-transaction-while-running-on-woocommerce-expected-version.md @@ -0,0 +1,30 @@ +--- +Title: successful transaction while running on woocommerce expected version +Feature: third party compatibility +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to ensure that transactions are processed successfully on WooCommerce versions from 3.9 to the latest, +So that customers can complete purchases without issues. + +#### Scenario: Processing Transactions on Supported Versions + +GIVEN @[WooCommerce store is configured, version 3.9 to latest] +AND I @[perform a transaction, with any product, with Worldline as the payment method, status authorized] +WHEN I @[visit, the plugin log page] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully without compatibility issues] + +Data: WooCommerce version diff --git a/tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/_transaction_scenarios_versions_wordpress.spec.js b/tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/_transaction_scenarios_versions_wordpress.spec.js new file mode 100644 index 000000000..b4dcf7571 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/_transaction_scenarios_versions_wordpress.spec.js @@ -0,0 +1,111 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Versions - WordPress', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C419994] Validate that Mollie can’t be activated on WordPress version lower than 5.0.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419995 +test.skip('Create an successful transaction while running on WordPress version 5.0.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419996 +test.skip('Create an successful transaction while running on WordPress version 5.1.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419997 +test.skip('Create an successful transaction while running on WordPress version 5.2.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419998 +test.skip('Create an successful transaction while running on WordPress version 5.3.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C419999 +test.skip('Create an successful transaction while running on WordPress version 5.4.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420000 +test.skip('Create an successful transaction while running on WordPress version 5.5.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420001 +test.skip('Create an successful transaction while running on WordPress version 5.6.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420002 +test.skip('Create an successful transaction while running on WordPress version 5.7.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420003 +test.skip('Create an successful transaction while running on WordPress version 5.8.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420004 +test.skip('Create an successful transaction while running on WordPress version 5.9.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420005 +test.skip('Create an successful transaction while running on WordPress version 6.0.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420006 +test.skip('Create an successful transaction while running on WordPress version 6.0.1', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420007 +test.skip('Create an successful transaction while running on WordPress version 6.0.2', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420008 +test.skip('Create an successful transaction while running on WordPress version 6.0.3', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420009 +test.skip('Create an successful transaction while running on WordPress version 6.1.0', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420010 +test.skip('Create an successful transaction while running on WordPress version 6.1.1', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/plugin-cant-be-activated-on-wordpress-version-lower-than.md b/tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/plugin-cant-be-activated-on-wordpress-version-lower-than.md new file mode 100644 index 000000000..aa5f0b080 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/compatibility/wordpress-compatibility/plugin-cant-be-activated-on-wordpress-version-lower-than.md @@ -0,0 +1,29 @@ +--- +Title: plugin cant be activated on wordpress version lower than +Feature: third party compatibility +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want the plugin to prevent activation if the WordPress version is lower than 5.0, +So that compatibility issues and potential site problems are avoided. + +#### Scenario: Blocking Activation on Older WordPress Versions + +GIVEN @[WordPress, version lower than 5.0] +AND I @[visit, the WordPress plugins page] +WHEN I @[click, under 'Plugin Name', the activate button] +THEN I @[should see, on the page, a message indicating the required minimum WordPress version of 5.0] + diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Applying Coupons with Selected Payment Method.md b/tests/Playwright/tests/shared-stories/frontend-ui/Applying Coupons with Selected Payment Method.md new file mode 100644 index 000000000..008f09203 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Applying Coupons with Selected Payment Method.md @@ -0,0 +1,35 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Apply Coupons with Selected Payment Method +Background: + - default + - apply-coupons-with-selected-payment-method +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want to ensure that when I select the plugin's payment method, coupons are applied correctly, +So that I receive the intended discounts on my purchase. + +#### Scenario: Correct Application of Coupons + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, the checkout page] +AND @[Coupon, type of coupon, and enabled] +WHEN I @[visit, the checkout page] +AND I @[select, in the WooCommerce gateways,the plugin's payment method] +AND I @[apply, the coupon, type of coupon] +THEN I @[should see, in the checkout total, the discount applied] +AND I @[should see, in the thank you page, the discount applied] +AND I @[should see, in the order details, the discount applied] + + +Data: type of coupon diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Country-Specific Payment Method Availability.md b/tests/Playwright/tests/shared-stories/frontend-ui/Country-Specific Payment Method Availability.md new file mode 100644 index 000000000..b594a1e9d --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Country-Specific Payment Method Availability.md @@ -0,0 +1,37 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Country-Specific Payment Method Availability +Background: + - default + - country-specific-payment-method-availability +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want the payment method to be available only for supported countries, +So that there is no confusion or error during checkout. + +#### Scenario: Country-Specific Visibility with allowed countries + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, the checkout page] +WHEN I @[select, in the checkout form, any allowed country] +THEN I @[should see, in the checkout gateways, the plugin's payment method] + +#### Scenario: Country-Specific Visibility with disallowed countries + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, the checkout page] +WHEN I @[select, in the checkout form, any disallowed country] +THEN I @[should NOT see, in the checkout gateways, the plugin's payment method] + +data: allowed country, disallowed country +``` diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Displaying Payment Methods on Checkout Page.md b/tests/Playwright/tests/shared-stories/frontend-ui/Displaying Payment Methods on Checkout Page.md new file mode 100644 index 000000000..2f49f94ea --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Displaying Payment Methods on Checkout Page.md @@ -0,0 +1,29 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Displaying Payment Methods on Checkout Page +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +Xray Key: +Xray Key:125607 +Xray Id: +--- + +# Description + +As a buyer on the WooCommerce platform, +I want to see the available payment methods, including the specific one provided by the plugin, on the checkout page, +So that I can select my preferred payment method for the transaction. + +#### Scenario: Frontend ui - Viewing Payment Methods + +GIVEN @[Woocommerce store is ready for checkout] +WHEN I @[select, in the checkout form, any country] +THEN I @[should see, Worldline payment methods] diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Form Validation and Plugin Compatibility.md b/tests/Playwright/tests/shared-stories/frontend-ui/Form Validation and Plugin Compatibility.md new file mode 100644 index 000000000..8cdc3e327 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Form Validation and Plugin Compatibility.md @@ -0,0 +1,28 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Form Validation and Plugin Compatibility +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want the WooCommerce form validation to work seamlessly with the plugin, +So that my checkout process is smooth and error-free. + +#### Scenario: Ensuring Form Validation +@[xrayKey: + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, the checkout page] +AND I @[fill in, the checkout form, with user details] +AND I @[click, Place order button] +THEN I @[should NOT see, in the page, any errors] diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Amount.md b/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Amount.md new file mode 100644 index 000000000..aa04ef8d9 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Amount.md @@ -0,0 +1,46 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Payment Method Limitations Based on Amount +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want the payment method to be available only within its specified transaction limits, +So that I can choose an appropriate payment method for my transaction amount. + +#### Scenario: Checking Payment Method Availability with Amount under Limit + +GIVEN @[WooCommerce store is configured] +AND I @[add to cart, a product with value under the limit] +WHEN I @[visit, the checkout page] +THEN I @[should not see, in the checkout gateways, the plugin's payment method] + +#### Scenario: Checking Payment Method Availability with Amount over Limit + +GIVEN @[WooCommerce store is configured] +AND I @[add to cart, a product with value over the limit] +WHEN I @[visit, the checkout page] +THEN I @[should not see, in the checkout gateways, the plugin's payment method] + +#### Scenario: Checking Payment Method Availability with Amount within the Limit + +GIVEN @[WooCommerce store is configured] +AND I @[add to cart, a product with value within the limit] +WHEN I @[visit, the checkout page] +THEN I @[should see, in the checkout gateways, the plugin's payment method] + + +data: product value under the limit, product value over the limit, product value within the limit +``` diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Currency.md b/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Currency.md new file mode 100644 index 000000000..b683c2873 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Limitations Based on Currency.md @@ -0,0 +1,42 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Payment Method Limitations Based on Currency +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want the payment method to be available only within its specified allowed currencies, +So that I can choose an appropriate payment method for my transaction. + +#### Scenario: Checking Payment Method Availability with allowed currency + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, the WooComerce settings page] +WHEN I @[select, in the currency setting, the allowed currency] +AND I @[save, the settings] +AND I @[visit, the checkout page] +THEN I @[should see, in the checkout gateways, the payment method available] + +#### Scenario: Checking Payment Method Availability with not allowed currency + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, the WooComerce settings page] +WHEN I @[select, in the currency setting, a disallowed currency] +AND I @[save, the settings] +AND I @[visit, the checkout page] +THEN I @[should not see, in the checkout gateways, the payment method available] + +data: allowed currency, disallowed currency +``` diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Visibility for Different User Types.md b/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Visibility for Different User Types.md new file mode 100644 index 000000000..42c3da06e --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Payment Method Visibility for Different User Types.md @@ -0,0 +1,37 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Payment Method Visibility for Different User Types +Background: + - default + - different-user-types +tags: + - php + +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want the payment method to be appropriately visible for both guests and logged-in users, +So that it is accessible to all users regardless of their login status. + +#### Scenario: Payment Method Visibility for Guests +@[xrayKey: + +GIVEN I @[logged out, from the WooCommerce store] +AND @[WooCommerce store is ready for checkout] +WHEN I @[visit, the checkout page] +THEN I @[should see, in the checkout gateways, the plugin's payment method] + +#### Scenario: Payment Method Visibility for Logged-In Users +@[xrayKey: + +GIVEN I @[logged in, to the WooCommerce store] +AND @[WooCommerce store is ready for checkout] +WHEN I @[visit, the checkout page] +THEN I @[should see, in the checkout gateways, the plugin's payment method] diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Updating Shipping Charges with Selected Payment Method.md b/tests/Playwright/tests/shared-stories/frontend-ui/Updating Shipping Charges with Selected Payment Method.md new file mode 100644 index 000000000..1e8207504 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Updating Shipping Charges with Selected Payment Method.md @@ -0,0 +1,29 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Updating Shipping Charges with Selected Payment Method +Background: + - default + - updating-shipping-charges +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want the shipping charges to be updated correctly when I select the plugin's payment method, +So that I am informed of the accurate shipping costs for my purchase. + +#### Scenario: Correct Shipping Charge Updates + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[fill in, the checkout form, with country details] +WHEN I @[select, in the checkout gateways, the plugin's payment method] +THEN I @[should see, in the total amount, the shipping charges accurately updated] + diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/Updating Taxes with Selected Payment Method.md b/tests/Playwright/tests/shared-stories/frontend-ui/Updating Taxes with Selected Payment Method.md new file mode 100644 index 000000000..e41134102 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/Updating Taxes with Selected Payment Method.md @@ -0,0 +1,28 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Updating Taxes with Selected Payment Method +Background: + - default + - updating-taxes +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want the taxes to be updated correctly when I select the plugin's payment method, +So that I am charged the correct tax amount for my purchase. + +#### Scenario: Accurate Tax Calculation + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[fill in, the checkout form, with country details] +WHEN I @[select, in the checkout gateways, the plugin's payment method] +THEN I @[should see, in the total amount, the tax charges accurately updated] diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/User Notification on Plugin Errors.md b/tests/Playwright/tests/shared-stories/frontend-ui/User Notification on Plugin Errors.md new file mode 100644 index 000000000..68304becd --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/User Notification on Plugin Errors.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: User Notification on Plugin Errors +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a buyer, +I want to receive notifications if there is an issue with the plugin during checkout, +So that I am aware of any problems affecting my transaction. + +#### Scenario: Receiving Notifications on Errors + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, the checkout page] +AND I @[select, the plugin's payment method] +AND I @[trigger, an error with a specific action (e.g., entering a 'magic number' as payment amount)] +THEN I @[should see, on the page, a notification informing me of the issue] diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js b/tests/Playwright/tests/shared-stories/frontend-ui/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js new file mode 100644 index 000000000..ed4660f1d --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js @@ -0,0 +1,36 @@ +const {expect} = require('@playwright/test'); +const {test} = require('../Shared/base-test'); +const {gotoWooPaymentTab} = require("../Shared/wooUtils"); +const {getMethodNames} = require("../Shared/gateways"); + +test.describe(' - WooCommerce Payments tab', () => { + test.beforeEach(async ({page}) => { + await gotoWooPaymentTab(page); + }); + + test('[C419984] Validate that all payment methods are displayed per UI design', async ({page}) => { + const methodNames = getMethodNames(); + const locator = page.locator('a.wc-payment-gateway-method-title'); + const allMethodsPresent = await locator.evaluateAll((elements, names) => { + const displayedMethods = elements.map((element) => { + let methodName = element.textContent.trim(); + methodName = methodName.replace('Mollie - ', ''); + return methodName; + }); + const foundMethods = names.map((name) => { + return displayedMethods.includes(name); + }); + return foundMethods.every((found) => found === true); + }, methodNames); + expect(allMethodsPresent).toBe(true); + await page.context().close(); + }); + + test.skip('[C419985] Validate that all payment methods can be managed', async ({page}) => { + // This will be tested in the settings tab of every payment method + }); + + test.skip('[C3324] Validate that the order of the payment methods can be changed', async ({page}) => { + // This is a functionality of WooCommerce, not of the plugin + }); +}); diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios.spec.js b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios.spec.js new file mode 100644 index 000000000..5978cee1b --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios.spec.js @@ -0,0 +1,35 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe(' - Transaction scenarios', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3329] Validate that the ecommerce admin can change the payment methods to display based on the user location', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3358] Validate only the activated payment methods are displayed on the checkout screen', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3361] Validate only the correct payment methods are displayed based on the billing country', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3363] Validate the order is created before the payment was successful', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3364] Validate the order is created after the payment was successful', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_boundaries.spec.js b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_boundaries.spec.js new file mode 100644 index 000000000..2cf3d33d9 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_boundaries.spec.js @@ -0,0 +1,20 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Boundaries', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3359] Validate the order minimum amount restrictions for all payment methods', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3360] Validate the order maximum amount restrictions for all payment methods', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_euro.spec.js b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_euro.spec.js new file mode 100644 index 000000000..0e7775a03 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_euro.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different curencies - Euro', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420118 +test.skip('Make a successful payment in Euro while using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420119 +test.skip('Make a successful payment in Euro while using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_usd.spec.js b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_usd.spec.js new file mode 100644 index 000000000..ec8072d65 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/frontend-ui/_transaction_scenarios_different_curencies_usd.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different curencies - USD', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420120 +test.skip('Make a successful payment in USD while using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420121 +test.skip('Make a successful payment in USD while using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/API Keys Configuration.md b/tests/Playwright/tests/shared-stories/merchant-setup/API Keys Configuration.md new file mode 100644 index 000000000..b2fc35bba --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/API Keys Configuration.md @@ -0,0 +1,32 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: API Keys Configuration +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I need to enter API Key & Secret in the configuration, +So that they can be used for the connection to the Worldline platform via the API/SDK. + +#### Scenario: Merchant setup - Configuring API Keys +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN @[Insert API credentials, with test type, with default values] +THEN @[Successful connection to API] should be established + +Data:live, test, API credentials: key, secret, PSPID + diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/Account link.md b/tests/Playwright/tests/shared-stories/merchant-setup/Account link.md new file mode 100644 index 000000000..1576c24b7 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/Account link.md @@ -0,0 +1,26 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Documentation +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to be able to quickly open the Worldline account page, +So that I can get information about the Worldline account. + +#### Scenario: Redirecting to Contact Support + +GIVEN @[WooCommerce store is configured] +AND I @[visit, Merchant setup in plugin's admin] +AND I @[click, the 'View Account' option] +THEN I @[should see, the Worldline account page] diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/Auto Trim Spaces at End of Keys.md b/tests/Playwright/tests/shared-stories/merchant-setup/Auto Trim Spaces at End of Keys.md new file mode 100644 index 000000000..7ee972ad2 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/Auto Trim Spaces at End of Keys.md @@ -0,0 +1,29 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Auto Trim Spaces at End of Keys +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want automatic trimming of spaces at the end of API, webhook keys, and URLs, +So that unintentional errors during data entry are minimized. + +#### Scenario: Merchant setup - Auto Trimming Spaces +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[click, any input API credentials field] +AND I @[fill in, the input field, with a value with spaces on the end] +AND I @[click, on Save Changes Button] +THEN I @[should see, in the input field, that the spaces are trimmed] diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/Connect to Test or Prod Platform.md b/tests/Playwright/tests/shared-stories/merchant-setup/Connect to Test or Prod Platform.md new file mode 100644 index 000000000..da384788b --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/Connect to Test or Prod Platform.md @@ -0,0 +1,52 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Connect to Test or Prod Platform +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want separate credential fields for Test and Live environments, +So that I can manage my integration settings for different deployment stages. + +#### Scenario: Merchant setup - Entering Live Credentials +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[check, the "Live mode" checkbox] +THEN I @[should see, +- Create a Worldline account link +- Enable Worldline Payments checkbox +- PSPID input field +- Use the live environment checkbox +- Live API Key input field +- Live API Secret input field +- Checkout type dropdown selected as - Full redirection to Worldline Payment page +- Payment button title input field] + +#### Scenario: Merchant setup - Entering Test Credentials +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[uncheck, the "Live mode" checkbox] +THEN I @[should see, +- Create a Worldline account link +- Enable Worldline Payments checkbox +- PSPID input field +- Use the live environment checkbox +- Test API Key input field +- Test API Secret input field +- Checkout type dropdown selected as - Full redirection to Worldline Payment page +- Payment button title input field] diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/Contact Us.md b/tests/Playwright/tests/shared-stories/merchant-setup/Contact Us.md new file mode 100644 index 000000000..e6f5039a2 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/Contact Us.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Contact Us +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to be able to quickly contact Worldline for support, +So that I can get assistance with my queries or issues. + +#### Scenario: Redirecting to Contact Support +@[xrayKey: + +GIVEN @[WooCommerce store is configured] +WHEN I @[visit, Worldline settings page] +AND I @[click, the 'Contact Us' option] +THEN I @[should see, the Worldline support page] diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/Create account - Sign Up.md b/tests/Playwright/tests/shared-stories/merchant-setup/Create account - Sign Up.md new file mode 100644 index 000000000..a35ab86ad --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/Create account - Sign Up.md @@ -0,0 +1,31 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Create account - Sign Up +Background: + - default + - webhooks +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +Xray Key: +--- + +# Description + +As a merchant, +I want to be redirected to the Worldline Account Creation Page, +So that I can easily create or sign up for a Worldline account. + +#### Scenario: Merchant setup - Redirecting to Account Creation +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[click, on the "Create Account/Sign Up"] +THEN I @[should see, the page, with the Worldline Account Creation Form] diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/End-Point URL Configuration.md b/tests/Playwright/tests/shared-stories/merchant-setup/End-Point URL Configuration.md new file mode 100644 index 000000000..ad9132d61 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/End-Point URL Configuration.md @@ -0,0 +1,58 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: End-Point URL Configuration +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to view and edit the default API endpoint URL ( https://docs.direct.worldline-solutions.com/en/integration/api-developer-guide/api#environmentsandendpoints ), +So that I can change it if necessary. + +#### Scenario: Viewing the Live Endpoint URL +@[xrayKey: + +GIVEN I @[activate, the plugin] with default settings +WHEN I @[visit, Worldline settings page] +AND I @[check, the "Live mode" checkbox] +THEN I @[should see, the "Test API Endpoint" field, with value "https://payment.direct.worldline-solutions.com"] +AND I @[should not see, the "Live API Endpoint" field] + +#### Scenario: Viewing the Test Endpoint URL +@[xrayKey: + +GIVEN I @[activate, the plugin] with default settings +WHEN I @[visit, Worldline settings page] +AND I @[uncheck, the "Live mode" checkbox] +THEN I @[should see, the "Test API Endpoint" field, with value "https://payment.preprod.direct.worldline-solutions.com"] +AND I @[should not see, the "Live API Endpoint" field] + +#### Scenario: Editing the Endpoint URL +@[xrayKey: + +GIVEN I @[activate, the plugin] with default settings +WHEN I @[visit, Worldline settings page] +AND I @[fill in,into an endpoint URL field, " https://payment.example.com/v2/ "] +AND I @[click, save settings] +THEN I @[should see, the settings are saved successfully] +AND I @[should see, in the field content, "https://payment.example.com"] (no /v2/, end slashes, spaces) + +#### Scenario: Entering invalid Endpoint URL +@[xrayKey: + +GIVEN I @[activate, the plugin] with default settings +WHEN I @[visit, Worldline settings page] +AND I @[fill in,into an endpoint URL field, "qwerty"] +AND I @[click, save settings] +THEN I @[should see, error message] +AND I @[should see, in the field content, the default URL] diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/General/_mollie_settings_tab_general.spec.js b/tests/Playwright/tests/shared-stories/merchant-setup/General/_mollie_settings_tab_general.spec.js new file mode 100644 index 000000000..50ffadce2 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/General/_mollie_settings_tab_general.spec.js @@ -0,0 +1,72 @@ +const {expect} = require('@playwright/test'); +const {test} = require('../../Shared/base-test'); +const {resetSettings, insertAPIKeys} = require("../../Shared/mollieUtils"); + +test.describe('_Mollie Settings tab - General', () => { + test.beforeEach(async ({page}) => { + await page.goto('wp-admin/admin.php?page=wc-settings&tab=mollie_settings'); + }); + + +test('[C420150] Validate that Mollie General section is displayed per UI design', async ({page}) => { + await expect(await page.isVisible('text=Mollie Settings')).toBeTruthy(); + await expect(await page.isVisible('text=General')).toBeTruthy(); + await expect(await page.isVisible('text=Live API Key')).toBeTruthy(); + }); +test('[C3333] Validate that the ecommerce admin have access to Documentation/Support through the Setting page', async ({page, context}) => { + await page.click('text=Plugin Documentation'); + await expect(page.url()).toBe('https://github.com/mollie/WooCommerce/wiki'); + await page.goto('wp-admin/admin.php?page=wc-settings&tab=mollie_settings'); + await page.click('text=Contact Support'); + await expect(page.url()).toBe('https://www.mollie.com/contact/merchants'); + }); + +test('[C3511] Validate an error message is returned when the test key is not valid/empty', async ({page}) => { + await resetSettings(page); + await page.goto('wp-admin/admin.php?page=wc-settings&tab=mollie_settings'); + await expect(await page.isVisible('text=Communicating with Mollie failed')).toBeTruthy(); + }); +test('[C3510] Validate that test/live keys are valid', async ({page}) => { + await insertAPIKeys(page); + expect(await page.isVisible('text=Connected')).toBeTruthy(); + }); + + +test('[C3330] Validate that the ecommerce admin can activate debug mode', async ({page}) => { + await page.goto('wp-admin/admin.php?page=wc-settings&tab=mollie_settings'); + await expect(await page.isVisible('text=Enable test mode')).toBeTruthy(); + //expect enable test mode checkbox to be checked + await expect(await page.getByRole('group', { name: 'Enable test mode' }).locator('label')).toBeChecked(); + }); + + + +test.skip('[C3507] Validate the connection to Mollie OAuth is working as expected when consent is approved', async ({page}) => { + // Your code here... + }); + + +test.skip('[C3508] Validate no connection is created using Mollie OAuth when consent is denied', async ({page}) => { + // Your code here... + }); + + +test.skip('[C3509] Validate that the connection through hosted onboarding is working', async ({page}) => { + // Your code here... + }); + +test.skip('[C3512] Validate all payment methods are displayed and only activate the ones approved in Mollie dashboard', async ({page}) => { + // Your code here... + }); + + +test.skip('[C3513] Validate when a payment method is activated in the ecommerce platform that this one also gets activated in Mollie dashboard', async ({page}) => { + // Your code here... + }); + + +test.skip('[C3514] Validate that only the activated payment methods in Mollie dashboard are displayed in the ecommerce platform', async ({page}) => { + // Your code here... + }); + +}); diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/PSPID.md b/tests/Playwright/tests/shared-stories/merchant-setup/PSPID.md new file mode 100644 index 000000000..aadc9a079 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/PSPID.md @@ -0,0 +1,33 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: PSPID +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to input my unique gateway merchant ID (PSPID) at Worldline, +So that my transactions are correctly associated with my account. + +#### Scenario: Merchant setup - Entering PSPID +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN @[Insert API credentials, in test type, with default values] +THEN @[Successful connection to API] should be established +WHEN I @[perform a transaction, with any product, with Worldline as the payment method, status authorized] +THEN I @[should see, in the woocommerce order details, the correct PSPID] + +Params: live, test +API credentials: key, secret, PSPID diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/Test Connection with WLOP Platform.md b/tests/Playwright/tests/shared-stories/merchant-setup/Test Connection with WLOP Platform.md new file mode 100644 index 000000000..c7a581225 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/Test Connection with WLOP Platform.md @@ -0,0 +1,34 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Test Connection with WLOP Platform +Background: + - default + - webhooks +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to verify the validity of my credentials, +So that I can ensure they are correct for connecting to the WLOP platform. + +#### Scenario: Merchant setup - Testing Connection +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN @[Insert API credentials, in test type, with incorrect values] +THEN @[Failed connection to API] should be established + +Params: live, test +API credentials: key, secret, PSPID +``` diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/Tooltips for fields.md b/tests/Playwright/tests/shared-stories/merchant-setup/Tooltips for fields.md new file mode 100644 index 000000000..7827ba058 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/Tooltips for fields.md @@ -0,0 +1,26 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Tooltips for fields +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want contextual help about various fields in the configuration, +So that I understand what information is required for each field. + +#### Scenario: Viewing Tooltips + +GIVEN @[WooCommerce Store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[hover over, any configuration field] +THEN I @[should see, a tooltip providing contextual help about that field] diff --git a/tests/Playwright/tests/shared-stories/merchant-setup/documentation link.md b/tests/Playwright/tests/shared-stories/merchant-setup/documentation link.md new file mode 100644 index 000000000..809f5e7ee --- /dev/null +++ b/tests/Playwright/tests/shared-stories/merchant-setup/documentation link.md @@ -0,0 +1,26 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Documentation link +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to be able to quickly open the plugin documentation, +So that I can get information about the plugin. + +#### Scenario: Redirecting to Contact Support + +GIVEN @[WooCommerce store is configured] +WHEN I @[visit, Worldline settings page] +AND I @[click, the 'Documentation' option] +THEN I @[should see, the plugin documentation page] diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/As-a-client-I-can-review-future-progress-on-a-test-system.md b/tests/Playwright/tests/shared-stories/plugin-foundation/As-a-client-I-can-review-future-progress-on-a-test-system.md new file mode 100644 index 000000000..3fbf2384b --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/As-a-client-I-can-review-future-progress-on-a-test-system.md @@ -0,0 +1,33 @@ +--- +Title: As a client I can review future progress on a test system +Feature: plugin foundation +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a client, you have the ability to review the progress of the project at any time. +This is facilitated through access to a test system set up by the agency. +The test system is configured with default settings to ensure ease of access and consistency in reviewing project developments. +Additionally, to assist you in navigating and utilizing the test system effectively, there will likely be documentation available. +This documentation is designed to guide you through the process of accessing and understanding the test system, ensuring you can monitor the project's progress efficiently and effectively. + +#### Scenario: Accessing the Test System +GIVEN I am a client +AND the test system has been set up with default configurations +WHEN I visit the test system website ->https://worldline.products.aws.wptesting.cloud/wp-admin +AND I log in as admin using the provided admin credentials +AND I visit the plugins page +THEN I can see the Wordline plugin on the plugins page +AND I can open the documentation by clicking the Documentation link + + diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/As-a-developer-QA-PO-support-I-can-create-a-package.md b/tests/Playwright/tests/shared-stories/plugin-foundation/As-a-developer-QA-PO-support-I-can-create-a-package.md new file mode 100644 index 000000000..0ab5e2aa5 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/As-a-developer-QA-PO-support-I-can-create-a-package.md @@ -0,0 +1,29 @@ +--- +Title: As a developer/QA/PO/support, I can create a package +Feature: plugin foundation +Background: + - github-ui +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description +It would be great for a developer/QA/PO/support/… to be able to create a package for any specified branch from the GitHub UI, like in some of our projects. +Also it would be convenient if there is a way to enter the version string, which will be displayed in WP and included in the .zip name. + +# Scenario: Creating a Package for a Specific Branch +GIVEN I am a developer +AND have sufficient access rights for the plugin repo +WHEN I triggered the package creation for the branch X with entered version +THEN I can download the package +AND as an admin I can install it on a WP website +AND I can see that the package does not contain files needed only for development, temporary build files +AND I can see +AND I can see +AND I can see that the code inside is based on the branch X diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/Plugins page/_plugins_page.spec.js b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/Plugins page/_plugins_page.spec.js new file mode 100644 index 000000000..e0742d217 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/Plugins page/_plugins_page.spec.js @@ -0,0 +1,40 @@ +const {expect} = require('@playwright/test'); +const {test} = require('../Shared/base-test'); +const {deactivateWPPlugin, activateWPPlugin, gotoWPPlugins} = require("../Shared/wpUtils"); + + test.beforeEach(async ({page}) => { + await gotoWPPlugins(page); + }); + +//TestId-C3317 + test('[C3317] Validate installation of the latest plugin version', async ({page}) => { + await expect(page.getByTestId('mollie-payments-for-woocommerce')).toHaveText(/7.4.1/); //TODO: remove this and retrieve the version from the plugin + }); + +//TestId-C419986 + test('[C419986] Validate that the latest plugin version is displayed per UI design', async ({page}) => { + await expect(page.getByTestId('mollie-payments-for-woocommerce')).toHaveClass(/active/); + }); + +//TestId-C3318 + test.skip('[C3318] Validate uninstalling the latest plugin version', async ({page}) => { + // Your code here... + }); + +//TestId-C3319 + test('[C3319] Validate deactivation of the latest plugin version', async ({page}) => { + await deactivateWPPlugin(page, 'Mollie Payments for WooCommerce'); + await expect(page.getByTestId('mollie-payments-for-woocommerce')).toHaveClass(/inactive/); + //restore state + await activateWPPlugin(page, 'Mollie Payments for WooCommerce'); + }); + +//TestId-C3322 + test.skip('[C3322] Validate manual plugin update', async ({page}) => { + // Your code here... + }); + +//TestId-C3328 + test.skip('[C3328] Validate automatic plugin update', async ({page}) => { + // Your code here... + }); diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/the-latest-plugin-version-is-displayed-per-ui-design.md b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/the-latest-plugin-version-is-displayed-per-ui-design.md new file mode 100644 index 000000000..418eb133b --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/the-latest-plugin-version-is-displayed-per-ui-design.md @@ -0,0 +1,27 @@ +--- +Title: the latest plugin version is displayed per ui design +Feature: plugin activation deativation +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want the latest version of the plugin to be displayed within the plugin's UI, +So that I can easily verify I am using the most current version for compatibility and support purposes. + +## Scenario: Viewing the latest plugin version + +GIVEN I @[install, the Worldline plugin] +WHEN I @[visit, the WordPress plugins page] +THEN I @[should see, the latest version number, displayed prominently according to the UI design specifications]. diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-activation-of-the-latest-plugin-version.md b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-activation-of-the-latest-plugin-version.md new file mode 100644 index 000000000..f55c27c7d --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-activation-of-the-latest-plugin-version.md @@ -0,0 +1,31 @@ +--- +Title: validate activation of the latest plugin version +Feature: plugin activation deativation +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to install the latest version of the plugin seamlessly, +So that I can start using its functionality immediately without issues. + +#### Scenario: Plugin foundation - Successful Activation of plugin +@[xrayKey: + +GIVEN @[WooCommerce - Store is configured] +AND I @[deactivate plugin, Worldline] +AND I @[visit, the WordPress plugins page] +WHEN I @[click, activate plugin action] +THEN I @[should see, settings and deactivate actions] +AND I @[should not see, delete action] diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-automatic-plugin-update.md b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-automatic-plugin-update.md new file mode 100644 index 000000000..255fd5deb --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-automatic-plugin-update.md @@ -0,0 +1,29 @@ +--- +Title: validate automatic plugin update +Feature: plugin activation deativation +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to ensure that the plugin updates automatically to the latest version, +So that I can benefit from the latest features and security patches without manual intervention. + +#### Scenario: Confirming Automatic Update Success + +GIVEN I @[install, the Worldline plugin] +AND I @[click, on automatic update setting] +AND @[a new version is released] +WHEN I @[check, the plugin's version] +THEN I @[should see, the latest version number, displayed prominently according to the UI design specifications]. diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-deactivation-of-the-latest-plugin-version.md b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-deactivation-of-the-latest-plugin-version.md new file mode 100644 index 000000000..e46607e1d --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-deactivation-of-the-latest-plugin-version.md @@ -0,0 +1,30 @@ +--- +Title: validate deactivation of the latest plugin version +Feature: plugin activation deativation +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to deactivate the latest version of the plugin without issues, +So that I can perform maintenance or troubleshoot as needed. + +#### Scenario: Plugin foundation - Successfully Deactivating Plugin +@[xrayKey: + +GIVEN @[WooCommerce - Store is configured] +AND I @[visit, the WordPress plugins page] +WHEN I @[click, under the plugin name, deactivate plugin action button] +THEN I @[should see, under the plugin name, delete] +AND I @[should see, under the plugin name, activate] diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-installation-of-the-latest-plugin-version.md b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-installation-of-the-latest-plugin-version.md new file mode 100644 index 000000000..7926ecf2f --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-installation-of-the-latest-plugin-version.md @@ -0,0 +1,28 @@ +--- +Title: validate installation of the latest plugin version +Feature: plugin activation deativation +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to install the latest version of the plugin seamlessly, +So that I can start using its functionality immediately without issues. + +#### Scenario: Successful Installation of Latest Version + +GIVEN @[WooCommerce - Store is configured] +WHEN I @[install, the Worldline plugin] +THEN I @[should see, in the page, a message that installation was successful] +AND I @[should see, under the plugin name, activate] diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-manual-plugin-update.md b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-manual-plugin-update.md new file mode 100644 index 000000000..7e077b14f --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-manual-plugin-update.md @@ -0,0 +1,40 @@ +--- +Title: validate manual plugin update +Feature: plugin activation deativation +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to manually update the plugin to the latest version when automatic updates are not available, +So that I can control when and how updates are applied. + +#### Scenario: Plugin foundation - Completing a Manual Update +@[xrayKey: + +GIVEN @[WooCommerce - Store is configured] +AND I @[visit, the WordPress plugins page] +AND an @[update is available for the plugin] +WHEN I @[update, the plugin, manually] +THEN I @[should see, in the page, "Plugin updated successfully"] + +#### Scenario: Plugin foundation - Plugin can be installed manually +@[xrayKey: + +GIVEN @[WooCommerce - Store is configured] +AND I @[uninstall, the plugin] +AND I @[visit, /wp-admin/plugin-install.php?tab=upload] +WHEN I @[upload, the package, from my computer] +AND I @[click, Install Now button] +THEN I @[should see, in the page, "Plugin installed successfully"] diff --git a/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-uninstalling-the-latest-plugin-version.md b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-uninstalling-the-latest-plugin-version.md new file mode 100644 index 000000000..0b6930113 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/validate-uninstalling-the-latest-plugin-version.md @@ -0,0 +1,31 @@ +--- +Title: validate uninstalling the latest plugin version +Feature: plugin activation deativation +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator, +I want to uninstall the latest version of the plugin without leaving residual files or data, +So that I can keep my WordPress installation clean and optimized. + +#### Scenario: Plugin foundation - Clean Uninstallation of Plugin +@[xrayKey: + +GIVEN @[WooCommerce - Store is configured] +AND I @[deactivate, the plugin] +AND I @[visit, the WordPress plugins page] +WHEN I @[click, delete plugin action] +THEN I @[should see, in the page, "was successfully deleted"] +AND @[DB should not show data of the plugin] diff --git a/tests/Playwright/tests/shared-stories/refund/Adding Order Note for Successful Refund.md b/tests/Playwright/tests/shared-stories/refund/Adding Order Note for Successful Refund.md new file mode 100644 index 000000000..c4a994707 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/refund/Adding Order Note for Successful Refund.md @@ -0,0 +1,31 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Adding Order Note for Successful Refund +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want a note added to the order when a refund is successfully processed, +So that there is clear documentation of the refund for future reference. + +#### Scenario: Recording a Refund in Order Notes + +GIVEN @[WooCommerce store is configured] +AND I @[create, a manual order] +WHEN I @[visit, the order details page] +AND I @[click on, in the order details, the refund button] +AND I @[perform, a refund, for the order] +THEN I @[should see, in the order notes, an indication of the successful refund] + diff --git a/tests/Playwright/tests/shared-stories/refund/Connecting Refund Status Update to an Existing Order.md b/tests/Playwright/tests/shared-stories/refund/Connecting Refund Status Update to an Existing Order.md new file mode 100644 index 000000000..d70a02bb8 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/refund/Connecting Refund Status Update to an Existing Order.md @@ -0,0 +1,31 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Connecting Refund Status Update to an Existing Order +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want a refund status update to be connected automatically to the corresponding WooCommerce order, +So that the order history accurately reflects all transaction activities. + +#### Scenario: Linking Refund Status to WooCommerce Order + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[create, a manual order] +WHEN I @[visit, the WooCommerce orders page] +AND I @[click, in the order details, on the 'Refund' button] +AND I @[confirm, the refund] +THEN I @[should see, in the WooCommerce status, the refund status] +AND I @[should see, in the notifications board, the refund notice] diff --git a/tests/Playwright/tests/shared-stories/refund/Displaying Refund Status in WooCommerce Order Page.md b/tests/Playwright/tests/shared-stories/refund/Displaying Refund Status in WooCommerce Order Page.md new file mode 100644 index 000000000..7a665eb65 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/refund/Displaying Refund Status in WooCommerce Order Page.md @@ -0,0 +1,53 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Displaying Refund Status in WooCommerce Order Page +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to be able to perform full order refunds, partial amount refunds, and individual line item refunds from WooCommerce orders page, +So that I can efficiently manage different refund scenarios as per the customer's request and maintain accurate transaction records. + +#### Scenario: Refunding a Full Order + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[create, a manual order] +WHEN I @[visit, the order details page] +AND I @[click, in the order details, on the 'Refund' button] +AND I @[confirm, the full order refund] +THEN I @[should see, in the order status, the status 'Refunded'] +AND I @[should see, in the notifications board, the refund notice] + +#### Scenario: Refunding a Partial Amount of an Order + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[create, a manual order] +WHEN I @[visit, the order details page] +AND I @[click, in the order details, on the 'Refund' button] +AND I @[fill-in, the refund amount, with specific partial amount] +AND I @[confirm, the partial order refund] +THEN I @[should see, in the order status, the status 'Processing'] +AND I @[should see, in the notifications board, the refund notice] + +#### Scenario: Refunding a Specific Line Item + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[create, a manual order] +WHEN I @[visit, the order details page] +AND I @[click, in the order details, on the 'Refund' button] +AND I @[select, the specific line item to refund] +AND I @[confirm, the line item refund] +THEN I @[should see, in the order status, the status 'Processing'] +AND I @[should see, in the notifications board, the refund notice] diff --git a/tests/Playwright/tests/shared-stories/refund/Performing Refunds from the Worldline Back Office.md b/tests/Playwright/tests/shared-stories/refund/Performing Refunds from the Worldline Back Office.md new file mode 100644 index 000000000..11785733f --- /dev/null +++ b/tests/Playwright/tests/shared-stories/refund/Performing Refunds from the Worldline Back Office.md @@ -0,0 +1,48 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Performing Refunds from the Plugin Back Office +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to be able to perform full order refunds, partial amount refunds, and individual line item refunds from the Worldline's back office, +So that I can efficiently manage different refund scenarios as per the customer's request and maintain accurate transaction records. + +#### Scenario: Refunding a Full Order + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status authorized] +WHEN I @[visit, Worldline back office, viewing the captured payment] +AND I @[perform, refund, with the full order amount] +THEN I @[should see, in order details page, the full refund recorded] +AND I @[should see, the status 'Refunded'] + +#### Scenario: Refunding a Partial Amount of an Order + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status authorized] +WHEN I @[visit, Worldline back office, viewing the completed order] +AND I @[perform, refund, with the partial order amount] +THEN I @[should see, in order details page, the partial refund recorded] +AND I @[should see, the status 'Processing'] + +#### Scenario: Refunding a Specific Line Item + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status authorized] +WHEN I @[visit, Worldline back office, viewing the completed order] +AND I @[perform, refund, for a line item] +THEN I @[should see, in order details page, the line item refund recorded] +AND I @[should see, the status 'Processing'] diff --git a/tests/Playwright/tests/shared-stories/refund/Refund from the WooCommerce Order Page.md b/tests/Playwright/tests/shared-stories/refund/Refund from the WooCommerce Order Page.md new file mode 100644 index 000000000..c96788d50 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/refund/Refund from the WooCommerce Order Page.md @@ -0,0 +1,43 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Refund from the WooCommerce Order Page +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to perform refunds from the plugin backend, +So that I can manage these transactions directly within the platform. + +#### Scenario: Refunding full amount + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[capture the transaction] +AND I @[visit, the order details page] +WHEN I @[perform, a refund, with the full order amount] +THEN I @[should see, the order status, 'Refunded'] +AND I @[should see, in the order items, the refund] +AND I @[should see, the refunded payment, on the Worldline portal] + +#### Scenario: Refunding partial amount + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[capture the transaction] +AND I @[visit, the order details page] +WHEN I @[perform, a refund, with the partial order amount] +THEN I @[should see, the order status, 'Processing'] +AND I @[should see, in the order items, the refund] +AND I @[should see, the partial refund record, on the Worldline portal] diff --git a/tests/Playwright/tests/shared-stories/refund/Refunding Orders with Discounts and Promotions.md b/tests/Playwright/tests/shared-stories/refund/Refunding Orders with Discounts and Promotions.md new file mode 100644 index 000000000..135e577db --- /dev/null +++ b/tests/Playwright/tests/shared-stories/refund/Refunding Orders with Discounts and Promotions.md @@ -0,0 +1,41 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Refunding Orders with Discounts and Promotions +Background: + - default +tags: + - php + - js +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to accurately process refunds for orders that have discounts or promotions applied, +So that the refund amount correctly reflects the actual amount paid by the customer. + +#### Scenario: Refunding an Order with a Discount + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[create, a manual order, with a discount applied] +WHEN I @[perform, a transaction, with status authorized] +AND I @[visit, the WooCommerce orders page] +AND I @[click, in the order details, on the 'Refund' button] +AND I @[confirm, the refund] +THEN I @[should see, the refund amount based on the discounted price] + +#### Scenario: Refunding an Order with a 2x1 Promotion + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[create, a manual order, with a 2x1 promotion applied] +WHEN I @[perform, a transaction, with status authorized] +AND I @[visit, the WooCommerce orders page] +AND I @[click, in the order details, on the 'Refund' button] +AND I @[confirm, the refund] +THEN I @[should see, the refund adjusted for the 2x1 promotion] +AND I @[should see, the refund amount reflecting the actual amount paid for retained items] diff --git a/tests/Playwright/tests/shared-stories/refund/_transaction_scenarios_refunds.spec.js b/tests/Playwright/tests/shared-stories/refund/_transaction_scenarios_refunds.spec.js new file mode 100644 index 000000000..6ceb903d5 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/refund/_transaction_scenarios_refunds.spec.js @@ -0,0 +1,280 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Refunds', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3457] Validate refunding full amount of an order paid with Apple Pay through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3458] Validate refunding full amount of an order paid with iDEAL through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3459] Validate refunding full amount of an order paid with Credit Card through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3460] Validate refunding full amount of an order paid with Bancontact through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3461] Validate refunding full amount of an order paid with Bank Transfer through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3462] Validate refunding full amount of an order paid with Belfius through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3463] Validate refunding full amount of an order paid with EPS through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3464] Validate refunding full amount of an order paid with Gift Card through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3465] Validate refunding full amount of an order paid with Giropay through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3466] Validate refunding full amount of an order paid with KBC_CBC through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3467] Validate refunding full amount of an order paid with Klarna Pay Now through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3468] Validate refunding full amount of an order paid with Klarna Pay Later through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3469] Validate refunding full amount of an order paid with Klarna Slice It through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3470] Validate refunding full amount of an order paid with PayPal through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3471] Validate refunding full amount of an order paid with a Voucher included through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3472] Validate refunding full amount of an order paid with P24 through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3473] Validate refunding full amount of an order paid with SEPA Direct Debit through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3474] Validate refunding full amount of an order paid with SOFORT through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3475] Validate submitting a refund full amount of an order paid with Apple Pay through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3476] Validate submitting a refund full amount of an order paid with iDEAL through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3477] Validate submitting a refund full amount of an order paid with Credit Card through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3478] Validate submitting a refund full amount of an order paid with Klarna Pay Now through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3479] Validate submitting a refund full amount of an order paid with Klarna Pay Later through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3480] Validate submitting a refund full amount of an order paid with Klarna Slice It through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3481] Validate submitting a refund full amount of an order paid with PayPal through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3482] Validate submitting a refund full amount of an order paid with Bancontact through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3483] Validate submitting a refund full amount of an order paid with Bank Transfer through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3484] Validate submitting a refund full amount of an order paid with Belfius through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3485] Validate submitting a refund full amount of an order paid with EPS through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3486] Validate submitting a refund full amount of an order paid with Giropay It through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3487] Validate submitting a refund full amount of an order paid with KBC_CBC through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3488] Validate submitting a refund full amount of an order paid with P24 through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3489] Validate submitting a refund full amount of an order paid with SOFORT through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3490] Validate submitting a refund full amount of an order paid with SEPA Direct Debit through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3491] Validate submitting a refund full amount of an order paid with Voucher through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3492] Validate submitting a refund full amount of an order paid with Gift Card It through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3493] Validate being able to partially refund an order created through the Orders API in ecom platfom any payment method', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3494] Validate being able to partially refund an order created through the Payments API in ecom platfom any payment method', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3495] Validate being able to do a full refund of an order created through the Orders API in ecom platfom any payment method', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3496] Validate being able to do a full refund of an order created through the Payments API in ecom platfom any payment method', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3497] Validate doing a partial refund on an order through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3498] Validate doing a refund of more than 25 euros over the order value through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3499] Validate submitting a refund with a value over the original purchase (less than €25 over) through the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3500] Validate submitting a refund from an order line through the Mollie dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3501] Validate submitting a refund of an order that has multiple payments (gift card, plus any other payment) through the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3502] Validate submitting a refund of an order that has a discount (5% off) applied to it through the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3503] Validate submitting a refund of an order that has a voucher through the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3504] Validate submitting a refund of an order that has a promotion (buy 2 get 1 free) through the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3505] Validate submitting a refund of a recurring order through the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3506] Validate submitting a refund of the whole subscription (or bulk refund) through ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3735] Validate refunding full amount of an order paid with IN3 through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3736] Validate submitting a refund full amount of an order paid with IN3 through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C354663] Validate refunding full amount of an order paid with Billie through the ecom platfom', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C354662] Validate submitting a refund full amount of an order paid with Billie through Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/Backend Order Data Management.md b/tests/Playwright/tests/shared-stories/transaction/Backend Order Data Management.md new file mode 100644 index 000000000..06e155fed --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/Backend Order Data Management.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Backend Order Data Management +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to open an order in the backend and see the appropriate payment status, +So that I can manage orders effectively based on their payment statuses. + +#### Scenario: Viewing Payment Status in Order Management + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +WHEN I @[visit, the order details page] +THEN I @[should see, in the order details, the status processing] diff --git a/tests/Playwright/tests/shared-stories/transaction/Backend Order Transaction ID.md b/tests/Playwright/tests/shared-stories/transaction/Backend Order Transaction ID.md new file mode 100644 index 000000000..ea6634446 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/Backend Order Transaction ID.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Backend Order Transaction ID +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to open an order in the backend and see the appropriate payment ID, +So that I can match orders to Worldline payments for reconciliation purposes. + +#### Scenario: Viewing Payment ID in Order Management + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +WHEN I @[visit, the order details page] +THEN I @[should see, in the order details, the transaction ID] diff --git a/tests/Playwright/tests/shared-stories/transaction/Map Statuses.md b/tests/Playwright/tests/shared-stories/transaction/Map Statuses.md new file mode 100644 index 000000000..f20f79b0a --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/Map Statuses.md @@ -0,0 +1,25 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Map Statuses +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to map Worldline payment statuses to the specific order statuses of WooCommerce, +So that I can maintain consistent order status tracking. + +#### Scenario: Status Mapping for Payment and Order +GIVEN a payment status is received from Worldline +WHEN I view the corresponding order in the backend +THEN the order status should reflect the mapped status from Worldline. diff --git a/tests/Playwright/tests/shared-stories/transaction/Merchant Reference.md b/tests/Playwright/tests/shared-stories/transaction/Merchant Reference.md new file mode 100644 index 000000000..104f5c0d5 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/Merchant Reference.md @@ -0,0 +1,32 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Merchant Reference +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to store Worldline PAYID in order data and platform order reference in Worldline Payment Data, +So that I can match orders to Worldline payments for reconciliation purposes. + +#### Scenario: Matching Orders with Payments on WooCommerce side + +GIVEN an order is processed with Worldline +WHEN I view the order in the WooCommerce backend +THEN I see the Worldline PAYID in order notes + +#### Scenario: Matching Orders with Payments on Worldline side + +GIVEN an order is processed with Worldline +WHEN I view the transaction on the Worldline portal +THEN I see the WooCommerce order ID in the "Merchant reference" diff --git a/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Authorization-Sale Modes.md b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Authorization-Sale Modes.md new file mode 100644 index 000000000..c9248e462 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Authorization-Sale Modes.md @@ -0,0 +1,33 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Authorization-Sale Modes +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to choose between different transaction modes - Sale, Pre-Authorization and Final-Authorization +So that I can process payments according to the required transaction protocol. + +#### Scenario: Selecting Transaction Mode +@[xrayKey: + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, Worldline settings page] +AND I @[select, an authorization mode (Sale, Pre-Authorization, Final-Authorization)] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the order details page] +THEN I @[should see, the transaction processed according to the chosen mode] + +Data: Sale, Pre-Authorization, Final-Authorization diff --git a/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Authorization from WooCommerce Order Page.md b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Authorization from WooCommerce Order Page.md new file mode 100644 index 000000000..36438ce00 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Authorization from WooCommerce Order Page.md @@ -0,0 +1,45 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Cancelling Transaction +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to perform cancellations (complete or partial) of authorizations from the plugin backend, +So that I can manage these transactions directly within the platform. + +#### Scenario: Cancelling full amount + +GIVEN @[WooCommerce store is ready for checkout] +AND @[authorization mode is (Final authorization, Pre-authorization)] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the order details page] +WHEN I @[perform, a refund, with the full order amount] +THEN I @[should see, the order status, 'Refunded'] +AND I @[should see, in the order items, the refund] +AND I @[should see, the cancelled payment, on the Worldline portal] + +#### Scenario: Cancelling partial amount + +GIVEN @[WooCommerce store is ready for checkout] +AND @[authorization mode is (Final authorization, Pre-authorization)] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the order details page] +WHEN I @[perform, a refund, with the partial order amount] +THEN I @[should see, the order status, 'On hold'] +AND I @[should see, in the order items, the refund] +AND I @[should see, the partial cancellation record, on the Worldline portal] + +Data: Cancellation complete, Cancellation partial diff --git a/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Payment Action.md b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Payment Action.md new file mode 100644 index 000000000..80cad19fd --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Cancelling Payment Action.md @@ -0,0 +1,29 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Cancelling Payment Action +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want a custom order action to void an authorized payment, +So that I can manage payment voids efficiently. + +#### Scenario: Cancelling an Authorized Payment + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, Worldline settings page] +AND I @[select, in the transaction mode setting, Authorization] +WHEN I @[perform a transaction, with any product, with Worldline gateway, with status authorised] +AND I @[visit, the order details page] +THEN I @[should see, an option to void the payment] diff --git a/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Capture Payment Action.md b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Capture Payment Action.md new file mode 100644 index 000000000..434d99249 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/maintenance transactions/Capture Payment Action.md @@ -0,0 +1,52 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Capture Payment Action +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want a custom order action to capture payment for an authorized transaction, +So that I can easily manage payment captures within the order interface. + +#### Scenario: Viewing an Authorized Payment + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, Worldline settings page] +AND I @[select, in the transaction mode setting, Authorization] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +WHEN I @[visit, the order details page] +THEN I @[should see, the order status, on hold] +AND I @[should see, an option to capture the payment] + +#### Scenario: Viewing a Captured Payment + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, Worldline settings page] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[capture the transaction] +WHEN I @[visit, the order details page] +THEN I @[should not see, an option to capture the payment] + + +#### Scenario: Executing a Maintenance Transaction - Capturing + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[select, in the transaction mode setting, Authorization] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the order details page] +WHEN I @[perform, a capture] +THEN I @[should see, the transaction captured] +AND I @[should see, the order status, processing] +AND I @[should see, the capture, on the Worldline portal] diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js new file mode 100644 index 000000000..eac88e805 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js @@ -0,0 +1,64 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Coupons - Fixed discount', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420089 +test.skip('Coupons>Fixed cart discount: User can use coupon for purchasing using Order API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420090 +test.skip('Coupons>Fixed cart discount: User can use coupon for purchasing using Payment API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420091 +test.skip('Coupons>Fixed cart discount: User is able to make an order when Coupon amount = 0 using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420092 +test.skip('Coupons>Fixed cart discount: User is able to make an order when Coupon amount = 0 using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420093 +test.skip('Coupons>Fixed cart discount: User can use coupon that is higher than price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420094 +test.skip('Coupons>Fixed cart discount: User can use coupon that is higher than price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420095 +test.skip('Coupons>Fixed cart discount: User can use coupon that is equal to the price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420096 +test.skip('Coupons>Fixed cart discount: User can use coupon that is equal to the price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420097 +test.skip('Coupons>Fixed card discount: User gets warning when coupon cannot be used for some product/item', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js new file mode 100644 index 000000000..e96665fb9 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js @@ -0,0 +1,82 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Coupons - Fixed product discount', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420105 +test.skip('Coupons>Fixed product discount: User can use coupon for purchasing using Order API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420106 +test.skip('Coupons>Fixed product discount: User can use coupon for purchasing using Payment API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420107 +test.skip('Coupons>Fixed product discount: User is able to make an order when Coupon amount = 0 using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420108 +test.skip('Coupons>Fixed product discount: User is able to make an order when Coupon amount = 0 using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420109 +test.skip('Coupons>Fixed product discount: User can use coupon that is higher than price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420110 +test.skip('Coupons>Fixed product discount: User can use coupon that is higher than price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420111 +test.skip('Coupons>Fixed product discount: User can use coupon that is equal to the price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420112 +test.skip('Coupons>Fixed product discount: User can use coupon that is equal to the price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420113 +test.skip('Coupons>Fixed product discount: Validate only product with coupon attached gets discount on checkout page (multiple products added to basket) using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420114 +test.skip('Coupons>Fixed product discount: Validate only product with coupon attached gets discount on checkout page (multiple products added to basket) using payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420115 +test.skip('Coupons>Fixed product discount: Validate warning shown when product with coupon attached gets removed from basket (multiple products added into basket) using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420116 +test.skip('Coupons>Fixed product discount: Validate warning shown when product with coupon attached gets removed from basket (multiple products added into basket) using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js new file mode 100644 index 000000000..92bc9de4a --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js @@ -0,0 +1,52 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Coupons - Percentage discount', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420098 +test.skip('Coupons>Percentage discount: User can use coupon for purchasing using Order API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420099 +test.skip('Coupons>Percentage discount: User can use coupon for purchasing using Payment API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420100 +test.skip('Coupons>Percentage discount: User is able to make an order when Coupon amount = 0 using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420101 +test.skip('Coupons>Percentage discount: User is able to make an order when Coupon amount = 0 using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420102 +test.skip('Coupons>Percentage discount: User can use coupon that is 100% using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420103 +test.skip('Coupons>Percentage discount: User can use coupon that is 100% using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420104 +test.skip('Coupons>Percentage discount: User gets warning when coupon cannot be used for some product/item', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js new file mode 100644 index 000000000..13eb4d718 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Chrome (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420056 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420062 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js new file mode 100644 index 000000000..18d5a5ccf --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Edge (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420061 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420067 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js new file mode 100644 index 000000000..7a169a23e --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Firefox (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420057 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420063 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js new file mode 100644 index 000000000..4be1c8b06 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Microsoft Internet Explorer 11', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420058 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420064 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js new file mode 100644 index 000000000..eae725891 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Opera (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420060 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420066 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js new file mode 100644 index 000000000..1224fcedc --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Safari (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420059 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420065 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md new file mode 100644 index 000000000..b4f301b81 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md @@ -0,0 +1,75 @@ +--- +Feature: Link to Feature Note +Title: Transaction Integrity with Coupons, Taxes, and Shipping +Background: + - default + - taxes-coupons-shipping-matrix +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to ensure that coupons, taxes, and shipping are correctly applied and calculated in transactions using the payment method, +So that the transactions are accurate, and customers are charged correctly in any of the checkout pages that WooCommerce offers, checkout, block-checkout and pay-page + +#### Scenario: Applying Coupons Correctly in Transactions + +GIVEN @[WooCommerce store is ready for checkout] +AND @[Coupon, type of coupon, and enabled] +WHEN I @[visit, the checkout page] +AND I @[apply, the coupon, type of coupon] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully with the correct discount applied] + +#### Scenario: Warning for Inapplicable Coupons + +GIVEN @[WooCommerce store is ready for checkout] +AND @[Coupon, non valid for simple product, and enabled] +WHEN I @[visit, the checkout page] +AND I @[apply, the coupon, non valid for selected product] +AND I @[perform a transaction, with simple product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, on the page, a warning that the coupon cannot be used for some products or items] + +#### Scenario: Handling Coupons Equal to or Exceeding Purchase Amount + +GIVEN @[WooCommerce store is ready for checkout] +AND @[Coupon, exceeding amount of selected product, and enabled] +WHEN I @[visit, the checkout page] +AND I @[apply, the coupon, exceeding amount of simple product] +AND I @[perform a transaction, with simple product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, on the page, a warning that the coupon cannot be used for some products or items] + +#### Scenario: Accurate Calculation of Taxes in Transactions + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, the checkout page] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully with the correct taxes applied] + +#### Scenario: Correct Application of Shipping Charges + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, the checkout page] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully with the correct shipping charges applied] + +#### Scenario: Transaction Completion Despite On-Hold or Failed Payment + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[perform a transaction, with any product, with Worldline gateway, with status failed] +THEN I @[should see, in the WooCommerce order details, an order created to record the transaction attempt, even if the payment is on hold or has failed] + +Data: types of coupons, coupon non valid for selected product, matrix of taxes and shipping charges diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js new file mode 100644 index 000000000..d03f12a06 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js @@ -0,0 +1,30 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Shipment', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3452] Validate the creation of a full shipment in the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3454] Validate that the shipment creation trigger the Klarna invoice', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3455] Validate the creation of a full shipment in the Mollie dashboard - PARTIALLY IMPLEMENTED', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3456] Validate the creation of a partial shipment in the Mollie dashboard - - PARTIALLY IMPLEMENTED', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js new file mode 100644 index 000000000..b44d25c96 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Excluding tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420083 +test.skip('Make a successful payment with random item excluding tax using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420084 +test.skip('Make a successful payment with random item excluding tax using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js new file mode 100644 index 000000000..fe1532ae4 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Flat rate', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420077 +test.skip('Make a successful payment with random item and shipping flat rate using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420078 +test.skip('Make a successful payment with random item and shipping flat rate using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js new file mode 100644 index 000000000..58021f9af --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Flat rate and excluding tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420087 +test.skip('Make a successful payment with random item excluding tax and shipping flat rate using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420088 +test.skip('Make a successful payment with random item excluding tax and shipping flat rate using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js new file mode 100644 index 000000000..5d7bbafd6 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Flat rate and inculding tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420085 +test.skip('Make a successful payment with random item including tax and shipping flat rate using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420086 +test.skip('Make a successful payment with random item including tax and shipping flat rate using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js new file mode 100644 index 000000000..fd5bc307c --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Free shipping', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420079 +test.skip('Make a successful payment with random item and free shipping using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420080 +test.skip('Make a successful payment with random item and free shipping using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js new file mode 100644 index 000000000..1e4fabe5a --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Including tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420081 +test.skip('Make a successful payment with random item including tax using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420082 +test.skip('Make a successful payment with random item including tax using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-browser-successful-transaction.md b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-browser-successful-transaction.md new file mode 100644 index 000000000..b56eac310 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-browser-successful-transaction.md @@ -0,0 +1,27 @@ +--- +Title: cross browser successful transaction +Feature: cross browser +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want transactions to be successfully processed across all major browsers, +So that every customer can complete their purchase regardless of their browser choice. + +#### Scenario: Ensuring Cross-Browser Transaction Success + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status success] +THEN I @[should see, the transaction processed successfully without any browser-specific issues] + +Data: major browsers, Chrome, Firefox, Safari, Edge, Opera, Internet Explorer diff --git a/tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-devices-successful-transaction.md b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-devices-successful-transaction.md new file mode 100644 index 000000000..81f798d79 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/transaction/transaction integrity/cross-devices-successful-transaction.md @@ -0,0 +1,27 @@ +--- +Title: cross devices successful transaction +Feature: cross browser +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to ensure that transactions are processed successfully across a variety of devices, including desktops, tablets, and smartphones, +So that customers can complete their purchases seamlessly, regardless of the device they are using. + +#### Scenario: Ensuring Transaction Success Across Devices + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status success] +THEN I @[should see, the transaction processed successfully without any device-specific issues] + +Data: major devices, desktop, tablet, smartphone diff --git a/tests/Playwright/tests/shared-stories/translation/_transaction_scenarios_different_languages.spec.js b/tests/Playwright/tests/shared-stories/translation/_transaction_scenarios_different_languages.spec.js new file mode 100644 index 000000000..67588cb04 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/translation/_transaction_scenarios_different_languages.spec.js @@ -0,0 +1,15 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Different languages', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C5594] Validate translations', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/shared-stories/translation/validate-translations.md b/tests/Playwright/tests/shared-stories/translation/validate-translations.md new file mode 100644 index 000000000..390e66b6e --- /dev/null +++ b/tests/Playwright/tests/shared-stories/translation/validate-translations.md @@ -0,0 +1,30 @@ +--- +Title: validate translations +Feature: translations +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a WordPress administrator in a multilingual environment, +I want to ensure that the plugin's translations for French (FR), Dutch (NL), German (DE), Spanish (ES), and Italian (IT) are accurate and reflect the latest version, +So that users can interact with the plugin in their preferred language without encountering language barriers. + +#### Scenario: Ensuring Translation Accuracy for Supported Languages + +GIVEN @[WooCommerce store is configured] +AND I @[set WP language to (FR, NL, DE, ES, IT)] +WHEN I @[visit, Worldline settings page] +THEN I @[should see, all text accurately translated into the selected language without any sections defaulting to English] + +Data: supported languages, French (FR), Dutch (NL), German (DE), Spanish (ES), Italian (IT) diff --git a/tests/Playwright/tests/shared-stories/webhooks/Copy Webhooks Destination URL.md b/tests/Playwright/tests/shared-stories/webhooks/Copy Webhooks Destination URL.md new file mode 100644 index 000000000..7b95ca850 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Copy Webhooks Destination URL.md @@ -0,0 +1,29 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Copy Webhooks Destination URL +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want a button to copy the webhook URL in the Notification configuration in the pluging's setting tab in the WooCommerce admin panel, +So that I can easily paste it into the Worldline Back-office. + +#### Scenario: Copying Webhook URL +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +WHEN I @[visit, Worldline settings page] +AND I @[click, the 'Copy Webhook URL' button] +THEN I @[should see, webhook URL copied to my clipboard] diff --git a/tests/Playwright/tests/shared-stories/webhooks/Handle Captured Payments.md b/tests/Playwright/tests/shared-stories/webhooks/Handle Captured Payments.md new file mode 100644 index 000000000..198b3ff9b --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Handle Captured Payments.md @@ -0,0 +1,26 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Handle Captured Payments +Background: + - default + - webhooks +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + + +#### Scenario: Updating Status on Successful Payment +@[xrayKey: + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform a transaction with any product using Worldline as the payment method, status captured] +WHEN I @[visit, the order details page] +THEN I @[should see, in the order status, processing] diff --git a/tests/Playwright/tests/shared-stories/webhooks/Log Webhooks.md b/tests/Playwright/tests/shared-stories/webhooks/Log Webhooks.md new file mode 100644 index 000000000..4de2bf9f6 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Log Webhooks.md @@ -0,0 +1,26 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Log Webhooks +Background: + - default + - webhooks +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description +As a merchant, +I want the Webhooks Module to log all incoming webhooks, +So that I can monitor and troubleshoot payment processes. + +#### Scenario: Logging Incoming Webhooks +@[xrayKey: + +GIVEN I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +WHEN I @[visit, the plugin log page in WooCommerce] +THEN I @[should see, detailed information about the webhooks, including their payloads and any actions taken] diff --git a/tests/Playwright/tests/shared-stories/webhooks/Saving the transaction status when it changes.md b/tests/Playwright/tests/shared-stories/webhooks/Saving the transaction status when it changes.md new file mode 100644 index 000000000..5df8166e2 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Saving the transaction status when it changes.md @@ -0,0 +1,36 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Saving the transaction status when it changes +Background: + - default + - webhooks +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want the Webhooks Module to trigger relevant actions based on the payment notification, +So I need to save the transaction status whenever I receive a webhook with an update. + +#### Scenario: Saving the Transaction Status + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform a transaction with any product using Worldline as the payment method] +WHEN I @[inspect, in the database, the transaction status] +THEN I @[should see, in the database, the transaction status] + +#### Scenario: Displaying the Transaction Status + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform a transaction, with any product, using Worldline as the payment method] +WHEN I @[inspect, in the order details page, the order notes] +THEN I @[should see, in the WC order notes, the transaction status] diff --git a/tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Failed.md b/tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Failed.md new file mode 100644 index 000000000..928c5a710 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Failed.md @@ -0,0 +1,28 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Updating Transaction Status Failed +Background: + - default + - webhooks +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want the Notification Module to update the transaction status in WooCommerce, +So that it reflects the actual payment status received from the PSP. + +#### Scenario: Updating Status on Failed Payment + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[perform a transaction with any product using Worldline as the payment method, status failed] +THEN I @[visit, the order details page] +AND I @[should see, in the order status, on-hold] diff --git a/tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Success.md b/tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Success.md new file mode 100644 index 000000000..81d32da22 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Updating Transaction Status Success.md @@ -0,0 +1,38 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Updating Transaction Status Success +Background: + - default + - webhooks +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want the Webhooks Module to update the transaction status in WooCommerce, +So that it reflects the actual payment status received from the PSP. + +#### Scenario: Updating Status on Successful Payment when Manual Capture + +GIVEN @[WooCommerce store is ready for checkout] +AND @[authorization mode is (Pre-Authorization, Final-Authorization)] +AND I @[perform a transaction with any product using Worldline as the payment method, status authorized] +AND I @[capture, on the Worldline portal, the transaction] +WHEN I @[inspect, in the order details page, the order status] +THEN I @[should see, in the order status, processing] + +#### Scenario: Updating Status on Successful Payment when Sale Mode + +GIVEN @[WooCommerce store is ready for checkout] +AND @[authorization mode is Sale] +AND I @[perform a transaction with any product using Worldline as the payment method, status authorized] +WHEN I @[inspect, in the order details page, the order status] +THEN I @[should see, in the order status, processing] diff --git a/tests/Playwright/tests/shared-stories/webhooks/Verifying Payment Webhook Authenticity.md b/tests/Playwright/tests/shared-stories/webhooks/Verifying Payment Webhook Authenticity.md new file mode 100644 index 000000000..9e095f782 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Verifying Payment Webhook Authenticity.md @@ -0,0 +1,28 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Verifying Payment Webhook Authenticity +Background: + - default + - webhooks +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want the Webhook Module to verify the authenticity of incoming webhooks, +So that I can prevent fraud or tampering with the transactions. + +#### Scenario: Rejecting Not Authenticated Webhooks +@[xrayKey: + +GIVEN @[the plugin is enabled] +WHEN I @[send a HTTP request, to the webhook endpoint, with a webhook data, without valid authentication values] +THEN I @[should see, in the plugin log page, error about the webhook verification] +AND I @[should not see, that the webhook was handled like if it was authenticated successfully] diff --git a/tests/Playwright/tests/shared-stories/webhooks/Webhooks Configuration.md b/tests/Playwright/tests/shared-stories/webhooks/Webhooks Configuration.md new file mode 100644 index 000000000..92c250e75 --- /dev/null +++ b/tests/Playwright/tests/shared-stories/webhooks/Webhooks Configuration.md @@ -0,0 +1,38 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Webhooks Configuration +Background: + - default + - webhooks +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I need to configure the key and secret in the plugin, +So that the webhook URL is generated correctly for use with Worldline. + +#### Scenario: Entering Key and Secret +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +WHEN I @[insert API credentials] +AND I @[visit, the Worldline settings page] +THEN I @[should see, in the page, a webhook URL generated based on these credentials] + +#### Scenario: Verifying Webhook URL Generation +@[xrayKey: + +GIVEN @[WooCommerce Store is configured] +WHEN I @[insert API credentials] +AND I @[visit, the Worldline settings page] +THEN I @[should see, in the page, that URL follows correct format and is valid for Worldline Back-office] diff --git a/tests/Playwright/tests/surcharge/Add Surcharge as Line Item.md b/tests/Playwright/tests/surcharge/Add Surcharge as Line Item.md new file mode 100644 index 000000000..329535fb4 --- /dev/null +++ b/tests/Playwright/tests/surcharge/Add Surcharge as Line Item.md @@ -0,0 +1,30 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Add Surcharge as Line Item +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want the surcharge to be added as an additional line item to the order, +So that the surcharge is clearly itemized for the customer's reference. + +#### Scenario: Surcharge Itemization in Order + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[enable surcharge for card payments] +WHEN I @[fill in the checkout form with payment details] +AND I @[perform a transaction, with any product, using Worldline as the payment method, status authorized] +AND I @[visit, the order details] +THEN I @[should see, in the order details, the surcharge as an additional line item] diff --git a/tests/Playwright/tests/surcharge/Display Surcharge Warning on Checkout.md b/tests/Playwright/tests/surcharge/Display Surcharge Warning on Checkout.md new file mode 100644 index 000000000..9b8eebda1 --- /dev/null +++ b/tests/Playwright/tests/surcharge/Display Surcharge Warning on Checkout.md @@ -0,0 +1,31 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Display Surcharge Warning on Checkout +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a customer, +I want to see a warning about potential surcharges when checking out, +So that I am aware of any additional charges that may apply to my order. + +#### Scenario: Viewing Surcharge Warning + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[enable surcharge for card payments] +WHEN I @[fill in the checkout form with payment details] +AND I @[visit, the checkout page] +THEN I @[should see, on the page, a warning about potential additional charges] + + diff --git a/tests/Playwright/tests/surcharge/Enable Surcharging on Cards (For non-EU countries only).md b/tests/Playwright/tests/surcharge/Enable Surcharging on Cards (For non-EU countries only).md new file mode 100644 index 000000000..8766c46b1 --- /dev/null +++ b/tests/Playwright/tests/surcharge/Enable Surcharging on Cards (For non-EU countries only).md @@ -0,0 +1,30 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Enable surcharging on cards (For non-EU countries only) +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant operating in non-EU countries, +I want to set a surcharge for card payments via a True/False radio button, +So that I can apply additional charges for card transactions when necessary. + +#### Scenario: Setting Surcharging Option + +GIVEN @[WooCommerce store is configured] +AND I @[visit, Worldline settings page] +WHEN I @[select, the surcharge option for card payments] +AND I @[click on, Enable/Disable] +AND I @[perform a transaction, with any product, using Worldline as the payment method, status authorized] +THEN I @[should see, in the total amount, the surcharge reflected] diff --git a/tests/Playwright/tests/surcharge/Enable eDCC.md b/tests/Playwright/tests/surcharge/Enable eDCC.md new file mode 100644 index 000000000..e065795f1 --- /dev/null +++ b/tests/Playwright/tests/surcharge/Enable eDCC.md @@ -0,0 +1,30 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Enable eDCC +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to enable or disable eDCC (Dynamic Currency Conversion) via a radio button, +So that I can offer dynamic currency conversion options to customers. + +#### Scenario: Setting eDCC Option +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, Worldline settings page] +AND I @[click, in the payment settings, enable eDCC] +AND I @[click, save button] +AND I @[perform a transaction, with any product, with Worldline gateway] +THEN I @[should see, the transaction processed with eDCC] + diff --git a/tests/Playwright/tests/surcharge/Error Handling for Inconsistent Settings.md b/tests/Playwright/tests/surcharge/Error Handling for Inconsistent Settings.md new file mode 100644 index 000000000..999404ff6 --- /dev/null +++ b/tests/Playwright/tests/surcharge/Error Handling for Inconsistent Settings.md @@ -0,0 +1,30 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Error Handling for Inconsistent Settings +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want error handling for cases where WooCommerce settings differ from merchant configurations, +So that surcharge discrepancies can be identified and addressed. + +#### Scenario: Detecting and Handling Configuration Errors + +GIVEN @[WooCommerce store is configured] +AND I @[set in worldline settings page, differ from the merchant's configuration in Worldline backend] +WHEN I @[perform, a transaction, with any product, using Worldline as the payment method] +THEN I @[should see, in the page, an error message] +AND I @[I should not see, in the woocommerce orders page, the transaction] + diff --git a/tests/Playwright/tests/surcharge/Pass Additional Object for HPP.md b/tests/Playwright/tests/surcharge/Pass Additional Object for HPP.md new file mode 100644 index 000000000..036e17f51 --- /dev/null +++ b/tests/Playwright/tests/surcharge/Pass Additional Object for HPP.md @@ -0,0 +1,30 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Pass Additional Object for HPP +Background: + - default +tags: + - php + - js + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant using Hosted Payment Pages (HPP), +I want an additional object (onBehalfOf) to be passed for surcharge transactions, +So that the payment gateway can process the surcharge accurately. + +#### Scenario: Handling HPP Surcharge + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[visit, Worldline settings page] +WHEN I @[fill in, in the surcharge field, the value 10] +AND I @[perform a transaction, with any product, using Worldline as the payment method, status authorized] +THEN I @[should see, in the log data, the additional object (onBehalfOf) included] + diff --git a/tests/Playwright/tests/surcharge/_mollie_settings_tab_payment_method_settings_surcharge.spec.js b/tests/Playwright/tests/surcharge/_mollie_settings_tab_payment_method_settings_surcharge.spec.js new file mode 100644 index 000000000..738a7b5ba --- /dev/null +++ b/tests/Playwright/tests/surcharge/_mollie_settings_tab_payment_method_settings_surcharge.spec.js @@ -0,0 +1,373 @@ +const {test} = require('../Shared/base-test'); +const {settingsNames, checkoutTransaction} = require('../Shared/mollieUtils'); +const {addProductToCart, updateMethodSetting, selectPaymentMethodInCheckout, + captureTotalAmountCheckout, parseTotalAmount +} = require("../Shared/wooUtils"); +const {expect, webkit} = require("@playwright/test"); +const {allMethods} = require("../Shared/gateways"); + +const testData = { + 'noFeeAdded': { + 'description': (testId, methodName) => `[${testId}] Validate ${methodName} surcharge with no Fee, no fee will be added to total`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.noFee, + } + }, + 'productQuantity': 1, + 'totalExpectedAmount': 11.00, + 'methods': { + 'bancontact': 'C129502', + 'applepay': 'C420309', + 'belfius': 'C138011', + 'billie': 'C354664', + 'eps': 'C133658', + 'giropay': 'C136539', + 'ideal': 'C130856', + 'kbc': 'C133668', + 'klarnapaylater': 'C130871', + 'klarnapaynow': 'C136519', + 'klarnasliceit': 'C127227', + 'mybank': 'C420319', + 'paypal': 'C130886', + 'paysafecard': 'C420131', + 'przelewy24': 'C129803', + 'banktransfer': 'C136529', + 'sofort': 'C129201', + 'in3': 'C106908', + }, + }, + 'fixedFeeTest': { + 'description': (testId, methodName) => `[${testId}] Validate fixed fee for ${methodName} surcharge`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.fixedFee, + [settingsNames.fixedFee]: 10 + } + }, + 'productQuantity': 1, + 'totalExpectedAmount': 22.00, + 'methods': { + 'bancontact': 'C129503', + 'applepay': 'C420310', + 'belfius': 'C138012', + 'billie': 'C354665', + 'eps': 'C133659', + 'giropay': 'C136540', + 'ideal': 'C130857', + 'kbc': 'C133669', + 'klarnapaylater': 'C130873', + 'klarnapaynow': 'C136520', + 'klarnasliceit': 'C127817', + 'mybank': 'C420320', + 'paypal': 'C130887', + 'paysafecard': 'C420132', + 'przelewy24': 'C129804', + 'banktransfer': 'C136530', + 'sofort': 'C129493', + 'in3': 'C106909', + } + }, + 'percentageFeeTest': { + 'description': (testId, methodName) => `[${testId}] Validate percentage fee for ${methodName} surcharge`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.percentage, + [settingsNames.percentage]: 10 + } + }, + 'productQuantity': 1, + 'totalExpectedAmount': 34.19, + 'methods': { + 'bancontact': 'C129504', + 'applepay': 'C420311', + 'belfius': 'C138013', + 'billie': 'C354666', + 'eps': 'C133660', + 'giropay': 'C136541', + 'ideal': 'C130858', + 'kbc': 'C133670', + 'klarnapaylater': 'C130875', + 'klarnapaynow': 'C136521', + 'klarnasliceit': 'C127818', + 'mybank': 'C420321', + 'paypal': 'C130888', + 'paysafecard': 'C420133', + 'przelewy24': 'C129805', + 'banktransfer': 'C136531', + 'sofort': 'C129494', + 'in3': 'C106910', + } + }, + 'fixedAndPercentageFeeTest': { + 'description': (testId, methodName) => `[${testId}] Validate fixed fee and percentage for ${methodName} surcharge`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.fixedFeePercentage, + [settingsNames.fixedFee]: 10, + [settingsNames.percentage]: 10 + } + }, + 'productQuantity': 1, + 'totalExpectedAmount': 45.19, + 'methods': { + 'bancontact': 'C129505', + 'applepay': 'C420312', + 'belfius': 'C138014', + 'billie': 'C354667', + 'eps': 'C133661', + 'giropay': 'C136542', + 'ideal': 'C130859', + 'kbc': 'C133671', + 'klarnapaylater': 'C130876', + 'klarnapaynow': 'C136522', + 'klarnasliceit': 'C127819', + 'mybank': 'C420322', + 'paypal': 'C130889', + 'paysafecard': 'C420134', + 'przelewy24': 'C129806', + 'banktransfer': 'C136532', + 'sofort': 'C129495', + 'in3': 'C106911', + } + }, + 'fixedFeeUnderLimitTest': { + 'description': (testId, methodName) => `[${testId}] Validate surcharge for ${methodName} when is selected fixed fee for payment surcharge and surcharge only under this limit in € is setup, surcharge will be added for total under limit`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.fixedFee, + [settingsNames.fixedFee]: 10, + [settingsNames.limitFee]: 30 + } + }, + 'productQuantity': 1, + 'totalExpectedAmount': 41.80, + 'methods': { + 'bancontact': 'C129506', + 'applepay': 'C420313', + 'belfius': 'C138015', + 'billie': 'C354668', + 'eps': 'C133662', + 'giropay': 'C136543', + 'ideal': 'C130860', + 'kbc': 'C133672', + 'klarnapaylater': 'C130880', + 'klarnapaynow': 'C136523', + 'klarnasliceit': 'C1278120', + 'mybank': 'C420323', + 'paypal': 'C130890', + 'paysafecard': 'C420135', + 'przelewy24': 'C129807', + 'banktransfer': 'C136533', + 'sofort': 'C129496', + 'in3': 'C106912', + } + }, + 'percentageFeeUnderLimitTest': { + 'description': (testId, methodName) => `[${testId}] Validate surcharge for ${methodName} when is selected percentage fee for payment surcharge and surcharge only under this limit in € is setup, surcharge will be added for total under limit`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.percentage, + [settingsNames.percentage]: 10, + [settingsNames.limitFee]: 30 + } + }, + 'productQuantity': 1, + 'totalExpectedAmount': 34.19, + 'methods': { + 'bancontact': 'C129507', + 'applepay': 'C420314', + 'belfius': 'C138016', + 'billie': 'C354669', + 'eps': 'C133663', + 'giropay': 'C136544', + 'ideal': 'C130861', + 'kbc': 'C133673', + 'klarnapaylater': 'C130881', + 'klarnapaynow': 'C136524', + 'klarnasliceit': 'C1278121', + 'mybank': 'C420324', + 'paypal': 'C130891', + 'paysafecard': 'C420136', + 'przelewy24': 'C129808', + 'banktransfer': 'C136534', + 'sofort': 'C129497', + 'in3': 'C106913', + } + }, + 'fixedAndPercentageUnderLimit': { + 'description': (testId, methodName) => `[${testId}] Validate surcharge for ${methodName} when is selected fixed and percentage fee for payment surcharge and surcharge only under this limit in € is setup, surcharge will be added for total under limit`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.fixedFeePercentage, + [settingsNames.fixedFee]: 10, + [settingsNames.percentage]: 10, + [settingsNames.limitFee]: 30 + } + }, + 'productQuantity': 1, + 'totalExpectedAmount': 45.19, + 'methods': { + 'bancontact': 'C129508', + 'applepay': 'C420315', + 'belfius': 'C138017', + 'billie': 'C354670', + 'eps': 'C133664', + 'giropay': 'C136545', + 'ideal': 'C130862', + 'kbc': 'C133674', + 'klarnapaylater': 'C130882', + 'klarnapaynow': 'C136525', + 'klarnasliceit': 'C1278122', + 'mybank': 'C420325', + 'paypal': 'C130892', + 'paysafecard': 'C420137', + 'przelewy24': 'C129809', + 'banktransfer': 'C136535', + 'sofort': 'C129498', + 'in3': 'C106914', + } + }, + 'fixedFeeOverLimit': { + 'description': (testId, methodName) => `[${testId}] Validate surcharge for ${methodName} when is selected fixed fee for payment surcharge and surcharge only over this limit in € is setup, surcharge will be added for total over limit`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.fixedFee, + [settingsNames.fixedFee]: 10, + [settingsNames.limitFee]: 30 + } + }, + 'productQuantity': 3, + 'totalExpectedAmount': 70.40, + 'methods': { + 'bancontact': 'C129509', + 'applepay': 'C420316', + 'belfius': 'C138018', + 'billie': 'C354671', + 'eps': 'C133665', + 'giropay': 'C136546', + 'ideal': 'C130863', + 'kbc': 'C133675', + 'klarnapaylater': 'C130883', + 'klarnapaynow': 'C136526', + 'klarnasliceit': 'C128597', + 'mybank': 'C420326', + 'paypal': 'C130893', + 'paysafecard': 'C420138', + 'przelewy24': 'C129810', + 'banktransfer': 'C136536', + 'sofort': 'C129499', + 'in3': 'C106915', + } + }, + 'percentageFeeOverLimit': { + 'description': (testId, methodName) => `[${testId}] Validate surcharge for ${methodName} when is selected percentage fee for payment surcharge and surcharge only over this limit in € is setup, surcharge will be added for total over limit`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.percentage, + [settingsNames.percentage]: 10, + [settingsNames.limitFee]: 30 + } + }, + 'productQuantity': 3, + 'totalExpectedAmount': 70.40, + 'methods': { + 'bancontact': 'C129510', + 'applepay': 'C420317', + 'belfius': 'C138019', + 'billie': 'C354672', + 'eps': 'C133666', + 'giropay': 'C137063', + 'ideal': 'C130864', + 'kbc': 'C133676', + 'klarnapaylater': 'C130884', + 'klarnapaynow': 'C136527', + 'klarnasliceit': 'C129200', + 'mybank': 'C420327', + 'paypal': 'C130894', + 'paysafecard': 'C420139', + 'przelewy24': 'C129811', + 'banktransfer': 'C136537', + 'sofort': 'C129500', + 'in3': 'C106916', + } + }, + 'fixedFeeAndPercentageOverLimit': { + 'description': (testId, methodName) => `[${testId}] Validate surcharge for ${methodName} when is selected fixed and percentage fee for payment surcharge and surcharge only over this limit in € is setup, surcharge will be added for total over limit`, + 'payload': { + "settings": { + [settingsNames.surcharge]: settingsNames.fixedFeePercentage, + [settingsNames.fixedFee]: 10, + [settingsNames.percentage]: 10, + [settingsNames.limitFee]: 30 + } + }, + 'productQuantity': 3, + 'totalExpectedAmount': 70.40, + 'methods': { + 'bancontact': 'C129511', + 'applepay': 'C420318', + 'belfius': 'C138020', + 'billie': 'C354673', + 'eps': 'C133667', + 'giropay': 'C137322', + 'ideal': 'C130865', + 'kbc': 'C133677', + 'klarnapaylater': 'C130885', + 'klarnapaynow': 'C136528', + 'klarnasliceit': 'C106918', + 'mybank': 'C420328', + 'paypal': 'C130895', + 'paysafecard': 'C420140', + 'przelewy24': 'C129812', + 'banktransfer': 'C136538', + 'sofort': 'C129501', + 'in3': 'C106917', + } + } +} +for (const [testAction, testActionData] of Object.entries(testData)) { + let randomMethod = testActionData.methods[0]; + let beforeAllRan = false; + for (const [methodName, testId] of Object.entries(testActionData.methods)) { + test(testActionData.description(testId, methodName) , async ({page, products, baseURL}) => { + await updateMethodSetting(methodName, testActionData.payload); + if(!beforeAllRan) { + console.log(testActionData.productQuantity) + await addProductToCart(baseURL, products.surcharge.id, testActionData.productQuantity); + const keys = Object.keys(testActionData.methods); + randomMethod = keys[Math.floor(Math.random() * Object.entries(testActionData.methods).length)]; + beforeAllRan = true; + } + await page.goto('/checkout/'); + await selectPaymentMethodInCheckout(page, methodName); + let totalAmount = await captureTotalAmountCheckout(page); + totalAmount = parseTotalAmount(totalAmount); + let expectedAmount = testActionData.totalExpectedAmount; + + await expect(totalAmount).toEqual(expectedAmount); + + // if the method is the random method, check the full transaction + if (methodName === randomMethod) { + const gateway = allMethods[randomMethod] + const result = await checkoutTransaction(page, products.simple, gateway) + let received = result.totalAmount.slice(0, -1).trim(); + received = parseTotalAmount(received); + expect(received).toEqual(expectedAmount); + } + }); + } + +}; +test.skip('[C420161] Validate change of the Surcharge gateway fee label on classic checkout', async ({ page}) => { + // Your code here... +}); + +test.skip('[C420162] Validate change of the Surcharge gateway fee label on block checkout', async ({ page}) => { + // Your code here... +}); + +test.skip('[C420163] Validate change of the Surcharge gateway fee label on order pay page', async ({ page}) => { + // Your code here... +}); + diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout.spec.js new file mode 100644 index 000000000..91b299e72 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout.spec.js @@ -0,0 +1,37 @@ +const { test } = require('../../Shared/base-test'); +const {normalizedName} = require("../../Shared/gateways"); +const {checkoutTransaction} = require("../../Shared/mollieUtils"); +const {wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); +const {sharedUrl} = require("../../Shared/sharedUrl"); +const {emptyCart, addProductToCart} = require("../../Shared/wooUtils"); +const {testData} = require("./testData"); +const {expect} = require("@playwright/test"); +test('basic test', async ({ page }) => { + await page.goto('https://playwright.dev/'); + const title = page.locator('.navbar__inner .navbar__title'); + await expect(title).toHaveText('Playwright'); +}); +testData.forEach(({methodId, testId, mollieStatus, wooStatus, notice, action}) => { + test.describe(`_Transaction scenarios_Payment statuses - Block Checkout - ${methodId}`, () => { + let productQuantity = 1; + test.beforeEach(async ({page, context, gateways}) => { + context.method = gateways[methodId]; + context.methodName = normalizedName(context.method.defaultTitle); + }); + test( + `[${testId}] Validate the submission of an order with ${methodId} as payment method and payment mark as "${mollieStatus} on block checkout"`, + async ({page, products, context, baseURL} + ) => { + test.slow(); + await emptyCart(baseURL); + if(methodId === 'in3' || methodId === 'klarnasliceit'){ + productQuantity = 10; + } + await addProductToCart(baseURL, products.simple.id, productQuantity); + await page.goto('/checkout-block/'); + const result = await checkoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, 'checkout-block'); + await action(page, result, context); + await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); + }); + }); +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_apple_pay.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_apple_pay.spec.js new file mode 100644 index 000000000..c76a721c8 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_apple_pay.spec.js @@ -0,0 +1,16 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Apple Pay', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420217 +test.skip('Validate the submission of an order with Apple Pay as payment method and payment mark as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_billie.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_billie.spec.js new file mode 100644 index 000000000..3e86a4d81 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_billie.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Billie', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420302 +test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Authorized" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420303 +test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Failed" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420304 +test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Cancelled" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420305 +test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Expired" on block checkout', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_credit_card.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_credit_card.spec.js new file mode 100644 index 000000000..860d8ec5a --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_credit_card.spec.js @@ -0,0 +1,111 @@ +const { test } = require('../../Shared/base-test'); +const {noticeLines, checkExpiredAtMollie, settingsNames, checkoutTransaction} = require("../../Shared/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); +const {updateMethodSetting, addProductToCart} = require("../../Shared/wooUtils"); + +test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Credit card', () => { + const productQuantity = 1; + test.beforeAll(async ({ gateways }) => { + const payload = { + "settings": { + [settingsNames.components]: 'no', + } + } + await updateMethodSetting(gateways.creditcard.id, payload); + }); + const testData = [ + { + testId: "C420268", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + testId: "C420269", + mollieStatus: "Open", + wooStatus: "Pending payment", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + testId: "C420270", + mollieStatus: "Failed", + wooStatus: "Pending payment", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + testId: "C420272", + mollieStatus: "Canceled", + wooStatus: "Pending payment", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + testId: "C420271", + mollieStatus: "Expired", + wooStatus: "Pending payment", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + ]; + + + testData.forEach(({ testId, mollieStatus, wooStatus, notice, action }) => { + test.skip(`[${testId}] Validate the submission of an order with Credit Card (Mollie Payment Screen) as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context, baseURL, gateways }) => { + await addProductToCart(baseURL, products.simple.id, productQuantity); + await page.goto('/checkout/'); + const result = await checkoutTransaction(page, products.simple, gateways.creditcard, productQuantity, mollieStatus); + await action(page, result, context); + await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); + }); + }); + +//TestId-C420273 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420274 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Open" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420275 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Failed" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420276 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Expired" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420277 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Canceled" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420278 +test.skip('Validate the submission of an order with Credit Card (no 3D secure) as payment method using Mollie Components on block chcekout', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_gift_cards.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_gift_cards.spec.js new file mode 100644 index 000000000..ecf6f1728 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_gift_cards.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Gift cards', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420258 +test.skip('Validate the submission of an order with any payment method including a Gift Card and marked as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420259 +test.skip('Validate the submission of an order were the total value is paid with a Gift Card on block checkout', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_in3.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_in3.spec.js new file mode 100644 index 000000000..f570dd480 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_in3.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Block Checkout - in3', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420219 +test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420220 +test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Failed" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420221 +test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Cancelled" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420222 +test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Expired" on block checkout', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_voucher.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_voucher.spec.js new file mode 100644 index 000000000..77092ecac --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_voucher.spec.js @@ -0,0 +1,40 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Voucher', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420239 +test.skip('Validate the submission of an order with a ECO Voucher and marked as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420240 +test.skip('Validate the submission of an order with a MEAL Voucher and marked as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420241 +test.skip('Validate the submission of an order with a GIFT Voucher and marked as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420242 +test.skip('Validate the submission of an order with any payment method including a Voucher and marked as "Paid" on block checkout', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420243 +test.skip('Validate the submission of an order were the total value is paid with a Voucher on block checkout', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/demo.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/demo.spec.js new file mode 100644 index 000000000..a4585773f --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/demo.spec.js @@ -0,0 +1,7 @@ +const { test, expect } = require('@playwright/test'); + +test('basic test', async ({ page }) => { + await page.goto('https://playwright.dev/'); + const title = page.locator('.navbar__inner .navbar__title'); + await expect(title).toHaveText('Playwright'); +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/testData.js b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/testData.js new file mode 100644 index 000000000..01b1f71dd --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/testData.js @@ -0,0 +1,585 @@ +const {noticeLines, checkExpiredAtMollie} = require("../../Shared/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage} = require("../../Shared/testMollieInWooPage"); +export const testData = [ + { + methodId: "bancontact", + testId: "C420230", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "bancontact", + testId: "C420231", + mollieStatus: "Open", + wooStatus: "Pending", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "bancontact", + testId: "C420232", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "bancontact", + testId: "C420233", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "bancontact", + testId: "C420234", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "belfius", + testId: "C420298", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "belfius", + testId: "C420299", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "belfius", + testId: "C420300", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "belfius", + testId: "C420301", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "eps", + testId: "C420260", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "eps", + testId: "C420261", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "eps", + testId: "C420262", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "eps", + testId: "C420263", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "giropay", + testId: "C420290", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "giropay", + testId: "C420291", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "giropay", + testId: "C420292", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "giropay", + testId: "C420293", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "ideal", + testId: "C420244", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "ideal", + testId: "C420245", + mollieStatus: "Open", + wooStatus: "Pending", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "ideal", + testId: "C420246", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "ideal", + testId: "C420248", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "ideal", + testId: "C420247", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + //await checkExpiredAtMollie(page); for some reason when expired Mollie API does not show the same message with ideal but goes to retry page + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C420267", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "kbc", + testId: "C420264", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C420265", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C420266", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C420249", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnapaylater", + testId: "C420250", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C420251", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C420252", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C420279", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnapaynow", + testId: "C420280", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C420281", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C420282", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C420223", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnasliceit", + testId: "C420224", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C420225", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C420226", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "mybank", + testId: "C420286", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "mybank", + testId: "C420287", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "mybank", + testId: "C420288", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "mybank", + testId: "C420289", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "paypal", + testId: "C420253", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paypal", + testId: "C420254", + mollieStatus: "Pending", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.methodName.toLowerCase()), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paypal", + testId: "C420255", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paypal", + testId: "C420256", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paypal", + testId: "C420257", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "paysafecard", + testId: "C420306", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paysafecard", + testId: "C420307", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paysafecard", + testId: "C420308", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "przelewy24", + testId: "C420235", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "przelewy24", + testId: "C420236", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "przelewy24", + testId: "C420237", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "przelewy24", + testId: "C420238", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "bancontact", + testId: "C420284", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "sofort", + testId: "C420227", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "sofort", + testId: "C420229", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "sofort", + testId: "C420228", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, +]; diff --git a/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout.spec.js new file mode 100644 index 000000000..e2e9ffbd8 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout.spec.js @@ -0,0 +1,56 @@ +const { test } = require('../../Shared/base-test'); +const { request } = require('@playwright/test'); +const { + setOrderAPI, + insertAPIKeys, + resetSettings, + checkoutTransaction +} = require('../../Shared/mollieUtils'); +const {wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); +const {normalizedName} = require("../../Shared/gateways"); +const {emptyCart, addProductToCart} = require("../../Shared/wooUtils"); +const {testData} = require("./testData"); +testData.forEach(({methodId, testId, mollieStatus, wooStatus, notice, action}) => { + test.describe(`_Transaction scenarios_Payment statuses Checkout - ${methodId}`, () => { + let productQuantity = 1; + test.beforeEach(async ({browser, page, context, gateways}) => { + context.method = gateways[methodId]; + context.methodName = normalizedName(context.method.defaultTitle); + + }); + test( + `[${testId}] Validate the submission of an order with ${methodId} as payment method and payment mark as "${mollieStatus}"`, + async ({page,products,context,baseURL, gateways} + ) => { + test.slow(); + await emptyCart(baseURL); + if(methodId === 'in3' || methodId === 'klarnasliceit'){ + productQuantity = 10; + } + await addProductToCart(baseURL, products.simple.id, productQuantity); + await page.goto('/checkout/'); + const result = await checkoutTransaction(page, products.simple, gateways[methodId], productQuantity, mollieStatus, 'checkout'); + await action(page, result, context); + await wooOrderDetailsPage(page, result.mollieOrder, gateways[methodId], wooStatus, notice(context)); + }); + test.afterEach(async ({page, context}) => { + await context.close() + }); + + }); +}); +test.skip('[C420148] Validate that order status after cancelled payment is set to pending status', async ({ page}) => { + await page.selectOption('select[name="mollie-payments-for-woocommerce_order_status_cancelled_payments"]', 'pending'); + await page.click('text=Save changes'); +}); + +test.skip('[C420149] Validate that order status after cancelled payment is set to cancelled status', async ({ page}) => { + await page.selectOption('select[name="mollie-payments-for-woocommerce_order_status_cancelled_payments"]', 'cancelled'); + await page.click('text=Save changes'); +}); +test.skip('[C3367] Validate the creation of an order using the Orders API', async ({page}) => { + // This is duplicated all transactions tests are done using orders api +}); +test.skip('[C3368] Validate the creation of an order using the Payments API', async ({page}) => { + // This is duplicated we have already tests for this +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_apple_pay.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_apple_pay.spec.js new file mode 100644 index 000000000..d5ac159a6 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_apple_pay.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses Checkout - Apple Pay', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C3369 +test.skip('[C3369] Validate the submission of an order with Apple Pay checkout as payment method and payment mark as "Paid"', async ({ page}) => { + // Your code here... +}); + + +//TestId-C3370 +test.skip('[C3370] Validate the submission of an order with Apple Pay Direct as payment method and payment mark as "Paid"', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_credit_card.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_credit_card.spec.js new file mode 100644 index 000000000..c3cdbdbe6 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_credit_card.spec.js @@ -0,0 +1,108 @@ +const { test } = require('../../Shared/base-test'); +const {noticeLines, checkExpiredAtMollie, settingsNames, checkoutTransaction} = require("../../Shared/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); +const {updateMethodSetting, addProductToCart} = require("../../Shared/wooUtils"); + +test.describe('_Transaction scenarios_Payment statuses Checkout - Credit card', () => { + const productQuantity = 1; + test.beforeAll(async ({ gateways }) => { + const payload = { + "settings": { + [settingsNames.components]: 'no', + } + } + await updateMethodSetting(gateways.creditcard.id, payload); + }); + const testData = [ + { + testId: "C3371", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + testId: "C3372", + mollieStatus: "Open", + wooStatus: "Pending payment", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + testId: "C3373", + mollieStatus: "Failed", + wooStatus: "Pending payment", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + testId: "C3375", + mollieStatus: "Canceled", + wooStatus: "Pending payment", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + testId: "C3374", + mollieStatus: "Expired", + wooStatus: "Pending payment", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + ]; +//TODO I have a failed to fetch error now in Mollie's page + testData.forEach(({ testId, mollieStatus, wooStatus, notice, action}) => { + test.skip(`[${testId}] Validate the submission of an order with Credit Card (Mollie Payment Screen) as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context, baseURL, gateways }) => { + //mollie components disabled + await addProductToCart(baseURL, products.simple.id, productQuantity); + await page.goto('/checkout/'); + const result = await checkoutTransaction(page, products.simple, gateways.creditcard, productQuantity, mollieStatus); + await action(page, result, context); + await wooOrderDetailsPage(page, result.mollieOrder, gateways.creditcard, wooStatus, notice(context)); + }); + }); + + +//TestId-C3376 + test.skip('[C3376] Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Paid"', async ({ page }) => { + // Your code here... + }); + +//TestId-C3377 + test.skip('[C3377] Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Open"', async ({ page }) => { + // Your code here... + }); + +//TestId-C3378 + test.skip('[C3378] Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Failed"', async ({ page }) => { + // Your code here... + }); + +//TestId-C3379 + test.skip('[C3379] Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Expired"', async ({ page }) => { + // Your code here... + }); + +//TestId-C3380 + test.skip('[C3380] Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Canceled"', async ({ page }) => { + // Your code here... + }); + +//TestId-C3381 + test.skip('[C3381] Validate the submission of an order with Credit Card (no 3D secure) as payment method using Mollie Components', async ({ page }) => { + // Your code here... + }); + + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_gift_cards.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_gift_cards.spec.js new file mode 100644 index 000000000..f999742aa --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_gift_cards.spec.js @@ -0,0 +1,21 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses Checkout - Gift cards', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +// TestId-C3438 + test.skip('[C3438] Validate the submission of an order with any payment method including a Gift Card and marked as "Paid"', async ({ page }) => { + // Your code here... + }); + +// TestId-C3439 + test.skip('[C3439] Validate the submission of an order where the total value is paid with a Gift Card', async ({ page }) => { + // Your code here... + }); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_voucher.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_voucher.spec.js new file mode 100644 index 000000000..2a3e33c03 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_voucher.spec.js @@ -0,0 +1,36 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses Checkout - Voucher', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +// TestId-C3435 + test.skip('[C3435] Validate the submission of an order with a ECO Voucher and marked as "Paid"', async ({ page }) => { + // Your code here... + }); + +// TestId-C3436 + test.skip('[C3436] Validate the submission of an order with a MEAL Voucher and marked as "Paid"', async ({ page }) => { + // Your code here... + }); + +// TestId-C3437 + test.skip('[C3437] Validate the submission of an order with a GIFT Voucher and marked as "Paid"', async ({ page }) => { + // Your code here... + }); + +// TestId-C3440 + test.skip('[C3440] Validate the submission of an order with any payment method including a Voucher and marked as "Paid"', async ({ page }) => { + // Your code here... + }); + +// TestId-C3441 + test.skip('[C3441] Validate the submission of an order where the total value is paid with a Voucher', async ({ page }) => { + // Your code here... + }); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Checkout/testData.js b/tests/Playwright/tests/transaction/Payment statuses - Checkout/testData.js new file mode 100644 index 000000000..23741fcc5 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Checkout/testData.js @@ -0,0 +1,685 @@ +const {noticeLines, checkExpiredAtMollie} = require("../../Shared/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage} = require("../../Shared/testMollieInWooPage"); +export const testData = [ + { + methodId: "bancontact", + testId: "C3387", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "bancontact", + testId: "C3388", + mollieStatus: "Open", + wooStatus: "Pending", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "bancontact", + testId: "C3389", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "bancontact", + testId: "C3390", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "bancontact", + testId: "C3391", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: 'belfius', + testId: "C3428", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: 'belfius', + testId: "C3429", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: 'belfius', + testId: "C3430", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: 'belfius', + testId: "C3431", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "billie", + testId: "C354674", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "billie", + testId: "C354675", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "billie", + testId: "C354676", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "billie", + testId: "C354677", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "eps", + testId: "C3412", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "eps", + testId: "C3413", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "eps", + testId: "C3414", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "eps", + testId: "C3415", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "giropay", + testId: "C3420", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "giropay", + testId: "C3421", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "giropay", + testId: "C3422", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "giropay", + testId: "C3423", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "in3", + testId: "C3731", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "in3", + testId: "C3732", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "in3", + testId: "C3733", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "in3", + testId: "C3734", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "ideal", + testId: "C3382", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "ideal", + testId: "C3383", + mollieStatus: "Open", + wooStatus: "Pending", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "ideal", + testId: "C3384", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "ideal", + testId: "C3386", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "ideal", + testId: "C3385", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + //await checkExpiredAtMollie(page); for some reason when expired Mollie API does not show the same message with ideal but goes to retry page + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C3419", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "kbc", + testId: "C3416", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C3417", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C3418", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C3401", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnapaylater", + testId: "C3402", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C3403", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C3404", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C3397", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnapaynow", + testId: "C3398", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C3399", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C3400", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C3408", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnasliceit", + testId: "C3409", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C3410", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C3411", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "mybank", + testId: "C420294", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "mybank", + testId: "C420295", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "mybank", + testId: "C420296", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "mybank", + testId: "C420297", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "paypal", + testId: "C3392", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paypal", + testId: "C3393", + mollieStatus: "Pending", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.methodName.toLowerCase()), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paypal", + testId: "C3394", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paypal", + testId: "C3395", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paypal", + testId: "C3396", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "paysafecard", + testId: "C420141", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paysafecard", + testId: "C420142", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paysafecard", + testId: "C420143", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "przelewy24", + testId: "C3424", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "przelewy24", + testId: "C3425", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "przelewy24", + testId: "C3426", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "przelewy24", + testId: "C3427", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "banktransfer", + testId: "C3433", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "banktransfer", + testId: "C3432", + mollieStatus: "Open", + wooStatus: "ON-HOLD", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "banktransfer", + testId: "C3434", + mollieStatus: "Expired", + wooStatus: "ON-HOLD", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "sofort", + testId: "C3405", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "sofort", + testId: "C3407", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "sofort", + testId: "C3406", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, +]; diff --git a/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page.spec.js new file mode 100644 index 000000000..9827da92c --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page.spec.js @@ -0,0 +1,58 @@ +const { test } = require('../../Shared/base-test'); +const {normalizedName} = require("../../Shared/gateways"); +const { + createManualOrder, + selectPaymentMethodInCheckout, + captureTotalAmountPayPage, + placeOrderPayPage +} = require("../../Shared/wooUtils"); +const {processMollieCheckout, resetSettings, insertAPIKeys, setOrderAPI} = require("../../Shared/mollieUtils"); +const {wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); +const {testData} = require("./testData"); + +testData.forEach(({methodId, testId, mollieStatus, wooStatus, notice, action}) => { + test.describe(`_Transaction scenarios_Payment statuses - Pay for order page - ${methodId}`, () => { + test.beforeEach(async ({page,products, context, gateways}) => { + context.method = gateways[methodId]; + context.methodName = normalizedName(context.method.defaultTitle); + }); + test(`[${testId}] Validate the submission of an order with ${methodId} as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context + }) => { + test.slow() + let country = 'DE' + let postcode = '10115' + let quantity = 1 + if (methodId === 'in3'){ + country = 'NL' + postcode = '1012 JS' + quantity = 10 + } + if (methodId === 'klarnasliceit'){ + quantity = 10 + } + const orderData = await createManualOrder(page, products.simple.id, quantity, country, postcode) + await page.goto(orderData.url); + + await selectPaymentMethodInCheckout(page, context.methodName); + if (methodId === 'billie') { + await page.locator('input[id="billing_company"]').first().fill('My company name'); + } + const canFillBirthDate = await page.locator('input[name="billing_birthdate"]').first().isVisible(); + if (canFillBirthDate) { + await page.locator('input[name="billing_birthdate"]').first().fill('1990-01-01'); + } + const canFillPhone = await page.locator('input[name="billing_phone_in3"]').first().isVisible(); + if (canFillPhone) { + await page.locator('input[name="billing_phone_in3"]').first().fill('+341234566788'); + } + const totalAmount = await captureTotalAmountPayPage(page); + await placeOrderPayPage(page); + await page.waitForTimeout(5000) + const mollieOrder = await processMollieCheckout(page, mollieStatus); + const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; + await page.goto(`/checkout/order-received/${orderData.orderId}?key=${orderData.orderKey}&order_id=${orderData.orderId}&filter_flag=onMollieReturn`) + await action(page, result, context); + await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); + }); + }); +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_apple_pay.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_apple_pay.spec.js new file mode 100644 index 000000000..8c0379656 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_apple_pay.spec.js @@ -0,0 +1,16 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Apple Pay', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420333 +test.skip('Validate the submission of an order with Apple Pay as payment method and payment mark as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_credit_card.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_credit_card.spec.js new file mode 100644 index 000000000..f293a1ce7 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_credit_card.spec.js @@ -0,0 +1,76 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Credit card', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420383 +test.skip('Validate the submission of an order with Credit Card (Mollie Payment Screen) as payment method and payment mark as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420384 +test.skip('Validate the submission of an order with Credit Card (Mollie Payment Screen) as payment method and payment mark as "Open" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420385 +test.skip('Validate the submission of an order with Credit Card (Mollie Payment Screen) as payment method and payment mark as "Failed" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420386 +test.skip('Validate the submission of an order with Credit Card (Mollie Payment Screen) as payment method and payment mark as "Expired" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420387 +test.skip('Validate the submission of an order with Credit Card (Mollie Payment Screen) as payment method and payment mark as "Cancelled" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420388 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420389 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Open" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420390 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Failed" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420391 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Expired" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420392 +test.skip('Validate the submission of an order with Credit Card as payment method using Mollie Components and payment mark as "Canceled" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420393 +test.skip('Validate the submission of an order with Credit Card (no 3D secure) as payment method using Mollie Components on pay for order page', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_gift_cards.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_gift_cards.spec.js new file mode 100644 index 000000000..f376fb5a2 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_gift_cards.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Gift cards', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420373 +test.skip('Validate the submission of an order with any payment method including a Gift Card and marked as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420374 +test.skip('Validate the submission of an order were the total value is paid with a Gift Card on pay for order page', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_voucher.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_voucher.spec.js new file mode 100644 index 000000000..6982b3d5d --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_voucher.spec.js @@ -0,0 +1,40 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Voucher', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420354 +test.skip('Validate the submission of an order with a ECO Voucher and marked as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420355 +test.skip('Validate the submission of an order with a MEAL Voucher and marked as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420356 +test.skip('Validate the submission of an order with a GIFT Voucher and marked as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420357 +test.skip('Validate the submission of an order with any payment method including a Voucher and marked as "Paid" on pay for order page', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420358 +test.skip('Validate the submission of an order were the total value is paid with a Voucher on pay for order page', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_checkout.spec.js b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_checkout.spec.js new file mode 100644 index 000000000..3f321baf8 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_checkout.spec.js @@ -0,0 +1,17 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Payment statuses Checkout', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + +test.skip('[C3442] Validate selecting a new payment method after the first payment failed', async ({ page}) => { + // Your code here... +}); + +test.skip('[C3344] Validate that the ecommerce admin can map a response from Mollie to a status in the ecommerce', async ({ page}) => { + // Your code here... +}); + +}); diff --git a/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/testData.js b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/testData.js new file mode 100644 index 000000000..637754b61 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Pay for order page/testData.js @@ -0,0 +1,684 @@ +const {noticeLines} = require("../../Shared/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage} = require("../../Shared/testMollieInWooPage"); +export const testData = [ + { + methodId: "belfius", + testId: "C420409", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "belfius", + testId: "C420410", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "belfius", + testId: "C420411", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "belfius", + testId: "C420412", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "bancontact", + testId: "C420345", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "bancontact", + testId: "C420346", + mollieStatus: "Open", + wooStatus: "Pending", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "bancontact", + testId: "C420347", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "bancontact", + testId: "C420348", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "bancontact", + testId: "C420349", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: 'eps', + testId: "C420375", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: 'eps', + testId: "C420376", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: 'eps', + testId: "C420377", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: 'eps', + testId: "C420378", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "giropay", + testId: "C420405", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "giropay", + testId: "C420406", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "giropay", + testId: "C420407", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "giropay", + testId: "C420408", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "ideal", + testId: "C420359", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "ideal", + testId: "C420360", + mollieStatus: "Open", + wooStatus: "Pending", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "ideal", + testId: "C420361", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "ideal", + testId: "C420363", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "ideal", + testId: "C420362", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C420379", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "kbc", + testId: "C420380", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C420381", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "kbc", + testId: "C420382", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C420364", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnapaylater", + testId: "C420365", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C420366", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaylater", + testId: "C420367", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C420394", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnapaynow", + testId: "C420395", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C420396", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnapaynow", + testId: "C420397", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C420338", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "klarnasliceit", + testId: "C420339", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C420340", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "klarnasliceit", + testId: "C420341", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "mybank", + testId: "C420401", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "mybank", + testId: "C420402", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "mybank", + testId: "C420403", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "mybank", + testId: "C420404", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paypal", + testId: "C420368", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paypal", + testId: "C420369", + mollieStatus: "Pending", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paypal", + testId: "C420370", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paypal", + testId: "C420371", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paypal", + testId: "C420372", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paysafecard", + testId: "C420417", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "paysafecard", + testId: "C420418", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "paysafecard", + testId: "C420419", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "przelewy24", + testId: "C420350", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "przelewy24", + testId: "C420351", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "przelewy24", + testId: "C420352", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "przelewy24", + testId: "C420353", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "banktransfer", + testId: "C420399", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "banktransfer", + testId: "C420398", + mollieStatus: "Open", + wooStatus: "on-hold", + notice: context => noticeLines.open(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "banktransfer", + testId: "C420400", + mollieStatus: "Expired", + wooStatus: "on-hold", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "sofort", + testId: "C420342", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "sofort", + testId: "C420344", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "sofort", + testId: "C420343", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "billie", + testId: "C420413", + mollieStatus: "Authorized", + wooStatus: "Processing", + notice: context => noticeLines.authorized(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "billie", + testId: "C420414", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "billie", + testId: "C420415", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "billie", + testId: "C420416", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "in3", + testId: "C420334", + mollieStatus: "Paid", + wooStatus: "Processing", + notice: context => noticeLines.paid(context.methodName), + action: async (page, result, context) => { + await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); + } + }, + { + methodId: "in3", + testId: "C420335", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "in3", + testId: "C420336", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "in3", + testId: "C420337", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, +]; diff --git a/tests/Playwright/tests/transaction/Send WooCommerce order billing and shipping address data to Worldline.md b/tests/Playwright/tests/transaction/Send WooCommerce order billing and shipping address data to Worldline.md new file mode 100644 index 000000000..8e8ff46f7 --- /dev/null +++ b/tests/Playwright/tests/transaction/Send WooCommerce order billing and shipping address data to Worldline.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Send WooCommerce order billing and shipping address data to Worldline +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to send detailed customer billing and shipping data to the Worldline Checkout Page, +So that all necessary transaction details are accurately conveyed allowing to manage the order on the Worldline side and support payment methods requiring such details. + +#### Scenario: Transmitting Order Data to Worldline + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[fill in, in the checkout form, the customer details] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status authorized] +THEN I @[should see, the customer details, in the Worldline Back Office] diff --git a/tests/Playwright/tests/transaction/Send WooCommerce order discount to Mollie.md b/tests/Playwright/tests/transaction/Send WooCommerce order discount to Mollie.md new file mode 100644 index 000000000..e08edf4f8 --- /dev/null +++ b/tests/Playwright/tests/transaction/Send WooCommerce order discount to Mollie.md @@ -0,0 +1,27 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Send WooCommerce order discount to Mollie +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to send the discount data to the Mollie Checkout Page, +So that all necessary transaction details are accurately conveyed. + +#### Scenario: Transmitting Discount to Mollie + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[apply, the coupon] +WHEN @[perform, a transaction, with any product, using Mollie as the payment method] +THEN I @[should see, the correct discount, in the Mollie Checkout] diff --git a/tests/Playwright/tests/transaction/Send WooCommerce order line items data to Worldline.md b/tests/Playwright/tests/transaction/Send WooCommerce order line items data to Worldline.md new file mode 100644 index 000000000..61ad92717 --- /dev/null +++ b/tests/Playwright/tests/transaction/Send WooCommerce order line items data to Worldline.md @@ -0,0 +1,28 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Send WooCommerce order line items data to Worldline +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to send detailed line items data to the Worldline Checkout Page, +So that all necessary transaction details are accurately conveyed. + +#### Scenario: Transmitting Order Data to Worldline + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[fill in, in the checkout form, the customer details] +AND I @[click, on worldline gateway] +AND I @[click, place order button] +THEN I @[should see, the order line items in the Worldline Checkout] diff --git a/tests/Playwright/tests/transaction/Send WooCommerce order shipping cost to Worldline.md b/tests/Playwright/tests/transaction/Send WooCommerce order shipping cost to Worldline.md new file mode 100644 index 000000000..7491e9fca --- /dev/null +++ b/tests/Playwright/tests/transaction/Send WooCommerce order shipping cost to Worldline.md @@ -0,0 +1,26 @@ +--- +Feature: "[[features-to-requirements-mapping]]" +Title: Send WooCommerce order shipping cost to Worldline +Background: + - default +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to the shipping cost to the Worldline Checkout Page, +So that all necessary transaction details are accurately conveyed. + +#### Scenario: Transmitting Shipping Cost to Worldline + +GIVEN @[WooCommerce store is ready for checkout] +WHEN @[perform, a transaction, with physical product, using Worldline as the payment method] +THEN I @[should see, the correct shipping cost, in the Worldline Checkout] diff --git a/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_american_express.spec.js b/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_american_express.spec.js new file mode 100644 index 000000000..cef455b96 --- /dev/null +++ b/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_american_express.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different cards - American Express', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420129 +test.skip('Make a successful payment with American Express card using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420130 +test.skip('Make a successful payment with American Express card using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420216 +test.skip('Make a successful payment with American Express card using Order API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420215 +test.skip('Make a successful payment with American Express card using Payment API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_mastercard.spec.js b/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_mastercard.spec.js new file mode 100644 index 000000000..550d7a4d9 --- /dev/null +++ b/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_mastercard.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different cards - Mastercard', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420127 +test.skip('Make a successful payment with Mastercard card using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420128 +test.skip('Make a successful payment with Mastercard card using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420213 +test.skip('Make a successful payment with Mastercard card using Order API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420214 +test.skip('Make a successful payment with Mastercard card using Payment API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_visa.spec.js b/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_visa.spec.js new file mode 100644 index 000000000..700f29dbd --- /dev/null +++ b/tests/Playwright/tests/transaction/_transaction_scenarios_different_cards_visa.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different cards - VISA', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420125 +test.skip('Make a successful payment with VISA card using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420126 +test.skip('Make a successful payment with VISA card using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420211 +test.skip('Make a successful payment with VISA card using Order API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420212 +test.skip('Make a successful payment with VISA card using Payment API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/subscriptions/_transaction_scenarios_recurrent_payment.spec.js b/tests/Playwright/tests/transaction/subscriptions/_transaction_scenarios_recurrent_payment.spec.js new file mode 100644 index 000000000..962647c2c --- /dev/null +++ b/tests/Playwright/tests/transaction/subscriptions/_transaction_scenarios_recurrent_payment.spec.js @@ -0,0 +1,60 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Recurrent Payment', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3348] Validate that only the correct payment methods (that supports a first mandate) are displayed for recurring products', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3349] Validate a recurring payment order is placed successfully', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3350] Validate subsequent orders are created automatically based on the sequence of the product', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3351] Validate that a recurrent payment can be cancelled as a logged in customer', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3352] Validate that a recurrent payment can be cancelled through the admin panel', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3353] Validate that when a subsequent order failed with payment twice the subscription gets cancelled', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3354] Validate the price for a subscription stays the same even if there is a product price change', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3355] Validate that you can retry a failed payment in a subscription', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3356] Validate that a customer is created and linked to the recent order in Mollie Dashboard', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3357] Validate multiple recurrent subscriptions in one customer', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js b/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js new file mode 100644 index 000000000..eac88e805 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_discount.spec.js @@ -0,0 +1,64 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Coupons - Fixed discount', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420089 +test.skip('Coupons>Fixed cart discount: User can use coupon for purchasing using Order API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420090 +test.skip('Coupons>Fixed cart discount: User can use coupon for purchasing using Payment API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420091 +test.skip('Coupons>Fixed cart discount: User is able to make an order when Coupon amount = 0 using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420092 +test.skip('Coupons>Fixed cart discount: User is able to make an order when Coupon amount = 0 using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420093 +test.skip('Coupons>Fixed cart discount: User can use coupon that is higher than price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420094 +test.skip('Coupons>Fixed cart discount: User can use coupon that is higher than price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420095 +test.skip('Coupons>Fixed cart discount: User can use coupon that is equal to the price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420096 +test.skip('Coupons>Fixed cart discount: User can use coupon that is equal to the price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420097 +test.skip('Coupons>Fixed card discount: User gets warning when coupon cannot be used for some product/item', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js b/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js new file mode 100644 index 000000000..e96665fb9 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_fixed_product_discount.spec.js @@ -0,0 +1,82 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Coupons - Fixed product discount', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420105 +test.skip('Coupons>Fixed product discount: User can use coupon for purchasing using Order API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420106 +test.skip('Coupons>Fixed product discount: User can use coupon for purchasing using Payment API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420107 +test.skip('Coupons>Fixed product discount: User is able to make an order when Coupon amount = 0 using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420108 +test.skip('Coupons>Fixed product discount: User is able to make an order when Coupon amount = 0 using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420109 +test.skip('Coupons>Fixed product discount: User can use coupon that is higher than price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420110 +test.skip('Coupons>Fixed product discount: User can use coupon that is higher than price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420111 +test.skip('Coupons>Fixed product discount: User can use coupon that is equal to the price he is paying using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420112 +test.skip('Coupons>Fixed product discount: User can use coupon that is equal to the price he is paying using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420113 +test.skip('Coupons>Fixed product discount: Validate only product with coupon attached gets discount on checkout page (multiple products added to basket) using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420114 +test.skip('Coupons>Fixed product discount: Validate only product with coupon attached gets discount on checkout page (multiple products added to basket) using payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420115 +test.skip('Coupons>Fixed product discount: Validate warning shown when product with coupon attached gets removed from basket (multiple products added into basket) using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420116 +test.skip('Coupons>Fixed product discount: Validate warning shown when product with coupon attached gets removed from basket (multiple products added into basket) using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js b/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js new file mode 100644 index 000000000..92bc9de4a --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Coupons/_transaction_scenarios_coupons_percentage_discount.spec.js @@ -0,0 +1,52 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Coupons - Percentage discount', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420098 +test.skip('Coupons>Percentage discount: User can use coupon for purchasing using Order API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420099 +test.skip('Coupons>Percentage discount: User can use coupon for purchasing using Payment API- validate order details', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420100 +test.skip('Coupons>Percentage discount: User is able to make an order when Coupon amount = 0 using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420101 +test.skip('Coupons>Percentage discount: User is able to make an order when Coupon amount = 0 using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420102 +test.skip('Coupons>Percentage discount: User can use coupon that is 100% using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420103 +test.skip('Coupons>Percentage discount: User can use coupon that is 100% using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420104 +test.skip('Coupons>Percentage discount: User gets warning when coupon cannot be used for some product/item', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js new file mode 100644 index 000000000..13eb4d718 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_chrome_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Chrome (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420056 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420062 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js new file mode 100644 index 000000000..18d5a5ccf --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_edge_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Edge (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420061 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420067 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js new file mode 100644 index 000000000..7a169a23e --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_firefox_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Firefox (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420057 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420063 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js new file mode 100644 index 000000000..4be1c8b06 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_microsoft_internet_explorer_11.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Microsoft Internet Explorer 11', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420058 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420064 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js new file mode 100644 index 000000000..eae725891 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_opera_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Opera (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420060 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420066 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js new file mode 100644 index 000000000..1224fcedc --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Cross-browser/_transaction_scenarios_cross-browser_safari_(latest).spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Cross-browser - Safari (latest)', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420059 +test.skip('Create an successful transaction using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420065 +test.skip('Create an successful transaction using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md b/tests/Playwright/tests/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md new file mode 100644 index 000000000..b4f301b81 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/Transaction Integrity with Coupons, Taxes, and Shipping.md @@ -0,0 +1,75 @@ +--- +Feature: Link to Feature Note +Title: Transaction Integrity with Coupons, Taxes, and Shipping +Background: + - default + - taxes-coupons-shipping-matrix +tags: + - php + - critical +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to ensure that coupons, taxes, and shipping are correctly applied and calculated in transactions using the payment method, +So that the transactions are accurate, and customers are charged correctly in any of the checkout pages that WooCommerce offers, checkout, block-checkout and pay-page + +#### Scenario: Applying Coupons Correctly in Transactions + +GIVEN @[WooCommerce store is ready for checkout] +AND @[Coupon, type of coupon, and enabled] +WHEN I @[visit, the checkout page] +AND I @[apply, the coupon, type of coupon] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully with the correct discount applied] + +#### Scenario: Warning for Inapplicable Coupons + +GIVEN @[WooCommerce store is ready for checkout] +AND @[Coupon, non valid for simple product, and enabled] +WHEN I @[visit, the checkout page] +AND I @[apply, the coupon, non valid for selected product] +AND I @[perform a transaction, with simple product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, on the page, a warning that the coupon cannot be used for some products or items] + +#### Scenario: Handling Coupons Equal to or Exceeding Purchase Amount + +GIVEN @[WooCommerce store is ready for checkout] +AND @[Coupon, exceeding amount of selected product, and enabled] +WHEN I @[visit, the checkout page] +AND I @[apply, the coupon, exceeding amount of simple product] +AND I @[perform a transaction, with simple product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, on the page, a warning that the coupon cannot be used for some products or items] + +#### Scenario: Accurate Calculation of Taxes in Transactions + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, the checkout page] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully with the correct taxes applied] + +#### Scenario: Correct Application of Shipping Charges + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[visit, the checkout page] +AND I @[perform a transaction, with any product, with Worldline gateway, with status authorized] +AND I @[visit, the WooCommerce order details] +THEN I @[should see, in the WooCommerce order details, the transaction processed successfully with the correct shipping charges applied] + +#### Scenario: Transaction Completion Despite On-Hold or Failed Payment + +GIVEN @[WooCommerce store is ready for checkout] +WHEN I @[perform a transaction, with any product, with Worldline gateway, with status failed] +THEN I @[should see, in the WooCommerce order details, an order created to record the transaction attempt, even if the payment is on hold or has failed] + +Data: types of coupons, coupon non valid for selected product, matrix of taxes and shipping charges diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_american_express.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_american_express.spec.js new file mode 100644 index 000000000..cef455b96 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_american_express.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different cards - American Express', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420129 +test.skip('Make a successful payment with American Express card using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420130 +test.skip('Make a successful payment with American Express card using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420216 +test.skip('Make a successful payment with American Express card using Order API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420215 +test.skip('Make a successful payment with American Express card using Payment API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_mastercard.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_mastercard.spec.js new file mode 100644 index 000000000..550d7a4d9 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_mastercard.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different cards - Mastercard', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420127 +test.skip('Make a successful payment with Mastercard card using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420128 +test.skip('Make a successful payment with Mastercard card using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420213 +test.skip('Make a successful payment with Mastercard card using Order API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420214 +test.skip('Make a successful payment with Mastercard card using Payment API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_visa.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_visa.spec.js new file mode 100644 index 000000000..700f29dbd --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_different_cards_visa.spec.js @@ -0,0 +1,34 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Different cards - VISA', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420125 +test.skip('Make a successful payment with VISA card using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420126 +test.skip('Make a successful payment with VISA card using Payment API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420211 +test.skip('Make a successful payment with VISA card using Order API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420212 +test.skip('Make a successful payment with VISA card using Payment API and Mollie Components', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js new file mode 100644 index 000000000..d03f12a06 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipment.spec.js @@ -0,0 +1,30 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios - Shipment', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +test.skip('[C3452] Validate the creation of a full shipment in the ecom platform', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3454] Validate that the shipment creation trigger the Klarna invoice', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3455] Validate the creation of a full shipment in the Mollie dashboard - PARTIALLY IMPLEMENTED', async ({ page}) => { + // Your code here... +}); + + +test.skip('[C3456] Validate the creation of a partial shipment in the Mollie dashboard - - PARTIALLY IMPLEMENTED', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js new file mode 100644 index 000000000..b44d25c96 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_excluding_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Excluding tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420083 +test.skip('Make a successful payment with random item excluding tax using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420084 +test.skip('Make a successful payment with random item excluding tax using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js new file mode 100644 index 000000000..fe1532ae4 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Flat rate', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420077 +test.skip('Make a successful payment with random item and shipping flat rate using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420078 +test.skip('Make a successful payment with random item and shipping flat rate using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js new file mode 100644 index 000000000..58021f9af --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_excluding_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Flat rate and excluding tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420087 +test.skip('Make a successful payment with random item excluding tax and shipping flat rate using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420088 +test.skip('Make a successful payment with random item excluding tax and shipping flat rate using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js new file mode 100644 index 000000000..5d7bbafd6 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_flat_rate_and_inculding_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Flat rate and inculding tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420085 +test.skip('Make a successful payment with random item including tax and shipping flat rate using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420086 +test.skip('Make a successful payment with random item including tax and shipping flat rate using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js new file mode 100644 index 000000000..fd5bc307c --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_free_shipping.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Free shipping', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420079 +test.skip('Make a successful payment with random item and free shipping using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420080 +test.skip('Make a successful payment with random item and free shipping using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js new file mode 100644 index 000000000..1e4fabe5a --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/_transaction_scenarios_shipping_and_tax_including_tax.spec.js @@ -0,0 +1,22 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../Shared/base-test'); + +test.describe('_Transaction scenarios_Shipping and tax - Including tax', () => { + test.beforeEach(async ({ page }) => { + //code before each + }); + + +//TestId-C420081 +test.skip('Make a successful payment with random item including tax using Order API', async ({ page}) => { + // Your code here... +}); + + +//TestId-C420082 +test.skip('Make a successful payment with random item including tax using Payment API', async ({ page}) => { + // Your code here... +}); + + +}); diff --git a/tests/Playwright/tests/transaction/transaction integrity/cross-browser-successful-transaction.md b/tests/Playwright/tests/transaction/transaction integrity/cross-browser-successful-transaction.md new file mode 100644 index 000000000..b56eac310 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/cross-browser-successful-transaction.md @@ -0,0 +1,27 @@ +--- +Title: cross browser successful transaction +Feature: cross browser +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want transactions to be successfully processed across all major browsers, +So that every customer can complete their purchase regardless of their browser choice. + +#### Scenario: Ensuring Cross-Browser Transaction Success + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status success] +THEN I @[should see, the transaction processed successfully without any browser-specific issues] + +Data: major browsers, Chrome, Firefox, Safari, Edge, Opera, Internet Explorer diff --git a/tests/Playwright/tests/transaction/transaction integrity/cross-devices-successful-transaction.md b/tests/Playwright/tests/transaction/transaction integrity/cross-devices-successful-transaction.md new file mode 100644 index 000000000..81f798d79 --- /dev/null +++ b/tests/Playwright/tests/transaction/transaction integrity/cross-devices-successful-transaction.md @@ -0,0 +1,27 @@ +--- +Title: cross devices successful transaction +Feature: cross browser +Background: + - default +tags: + - php +Runn on: +Design Notes: Link to Design Notes Note +Images: Link to Images Folder +Parent Jira Id: +Jira Id: +--- + +# Description + +As a merchant, +I want to ensure that transactions are processed successfully across a variety of devices, including desktops, tablets, and smartphones, +So that customers can complete their purchases seamlessly, regardless of the device they are using. + +#### Scenario: Ensuring Transaction Success Across Devices + +GIVEN @[WooCommerce store is ready for checkout] +AND I @[perform, a transaction, with any product, using Worldline as the payment method, status success] +THEN I @[should see, the transaction processed successfully without any device-specific issues] + +Data: major devices, desktop, tablet, smartphone