diff --git a/tests/Playwright/README.md b/tests/Playwright/README.md new file mode 100644 index 000000000..8a083a990 --- /dev/null +++ b/tests/Playwright/README.md @@ -0,0 +1,25 @@ + +### Setup Playwright tests +In your test environment +- Import the products +- Set WooCommerce taxes, shipping, and payment methods +- Check the language of the site, must be English unless specified +- Update the env with url and credentials +- Create the WooCommerce API key and insert in env +- If you make a dump of this environment, you can use it to restore the environment for the tests +- Suggestion to create different dumps for different preconditions +- In ddev playwright is already installed, in local you will need to [install it](https://playwright.dev/docs/intro#installing-playwright) + + +This runs one particular test +``` +$ npx playwright test name-of-the-test.spec.js +``` +This runs a project that can cover different tests against another environment + +``` +$ npx playwright test --project=project-name +``` + + + diff --git a/tests/Playwright/fixtures/base-test.js b/tests/Playwright/fixtures/base-test.js new file mode 100644 index 000000000..6001136e9 --- /dev/null +++ b/tests/Playwright/fixtures/base-test.js @@ -0,0 +1,26 @@ +const base = require('@playwright/test'); +const {allProducts, randomProduct} = require('../utils/products'); +const {allMethods} = require('../utils/gateways'); +const {default: WooCommerceRestApi} = require("@woocommerce/woocommerce-rest-api"); + +exports.test = base.test.extend({ + products: [allProducts, { option: true }], + gateways: [allMethods, { option: true }], + canListenWebhooks: [process.env.WEBHOOKS, { option: true }], + baseURL: async ({}, use, testInfo) => { + const projectBaseURL = testInfo.project.use && testInfo.project.use.baseURL; + console.log('projectBaseURL', projectBaseURL); + await use(projectBaseURL || 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/e2e/globalSetup.js b/tests/Playwright/globalSetup.js similarity index 89% rename from tests/e2e/globalSetup.js rename to tests/Playwright/globalSetup.js index 5148a8dd9..daea7ab48 100644 --- a/tests/e2e/globalSetup.js +++ b/tests/Playwright/globalSetup.js @@ -1,5 +1,5 @@ import { chromium } from '@playwright/test'; -const { loginAdmin } = require('./Shared/wpUtils'); +const { loginAdmin } = require('./utils/wpUtils'); async function globalSetup(config) { const { baseURL, storageState } = config.projects[0].use; const browser = await chromium.launch(); diff --git a/tests/Playwright/package.json b/tests/Playwright/package.json new file mode 100644 index 000000000..e2e3e6465 --- /dev/null +++ b/tests/Playwright/package.json @@ -0,0 +1,8 @@ +{ + "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 new file mode 100644 index 000000000..75ea22812 --- /dev/null +++ b/tests/Playwright/playwright.config.js @@ -0,0 +1,66 @@ +// @ts-check +const {defineConfig, devices} = require('@playwright/test'); + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +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({ + 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', + + /* utils 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' + } + }, + //todo: option random payment method version for every project, for faster execution, filtering the dataset + //todo: twint and blik payment methods in separate projects, precondition woocommerce different currency? + //todo: apple with a safari project + // Configure projects with a reduce set of test for preconditions to point to different configured envs, + // shared stories: php version, woo and wp version, different currencies, orders/payments api, taxes and shipping matrix + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + /*{ + name: 'setup-default-php81', + testMatch: 'tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout.spec.js', + use: { + ...devices['Desktop Chrome'], + baseURL: process.env.BASEURL_DEFAULT_81 + } + },*/ + ], +}); + diff --git a/tests/Playwright/test-data/block-checkout-transaction.js b/tests/Playwright/test-data/block-checkout-transaction.js new file mode 100644 index 000000000..6c6668dd2 --- /dev/null +++ b/tests/Playwright/test-data/block-checkout-transaction.js @@ -0,0 +1,705 @@ +const {noticeLines, checkExpiredAtMollie} = require("../utils/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage} = require("../utils/testMollieInWooPage"); +export const blockCheckoutTransaction = [ + { + 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: "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); + } + }, + /*{ + methodId: "alma", + testId: "", + 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: "alma", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "alma", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "alma", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "trustly", + testId: "", + 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: "trustly", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "trustly", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "trustly", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "payconiq", + testId: "", + 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: "payconiq", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "payconiq", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "payconiq", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "riverty", + testId: "", + 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: "riverty", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "riverty", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "riverty", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + },*/ +]; diff --git a/tests/Playwright/test-data/classic-checkout-transaction.js b/tests/Playwright/test-data/classic-checkout-transaction.js new file mode 100644 index 000000000..9efed58ea --- /dev/null +++ b/tests/Playwright/test-data/classic-checkout-transaction.js @@ -0,0 +1,805 @@ +const {noticeLines, checkExpiredAtMollie} = require("../utils/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage} = require("../utils/testMollieInWooPage"); +export const classicCheckoutTransaction = [ + { + 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: "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); + } + }, + /*{ + methodId: "alma", + testId: "", + 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: "alma", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "alma", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "alma", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "trustly", + testId: "", + 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: "trustly", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "trustly", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "trustly", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "payconiq", + testId: "", + 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: "payconiq", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "payconiq", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "payconiq", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "riverty", + testId: "", + 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: "riverty", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "riverty", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "riverty", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + },*/ +]; diff --git a/tests/Playwright/test-data/pay-order-page-transaction.js b/tests/Playwright/test-data/pay-order-page-transaction.js new file mode 100644 index 000000000..7eb64ae80 --- /dev/null +++ b/tests/Playwright/test-data/pay-order-page-transaction.js @@ -0,0 +1,806 @@ +import {checkExpiredAtMollie} from "../utils/mollieUtils"; + +const {noticeLines} = require("../utils/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage} = require("../utils/testMollieInWooPage"); +export const payOrderPageTransaction = [ + { + 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: "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); + } + }, + /*{ + methodId: "alma", + testId: "", + 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: "alma", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "alma", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "alma", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "payconiq", + testId: "", + 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: "payconiq", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "payconiq", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "payconiq", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + }, + { + methodId: "trustly", + testId: "", + 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: "trustly", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "trustly", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "trustly", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "riverty", + testId: "", + 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: "riverty", + testId: "", + mollieStatus: "Failed", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "riverty", + testId: "", + mollieStatus: "Canceled", + wooStatus: "Pending", + notice: context => noticeLines.failed(context.method.id), + action: async (page) => { + await wooOrderRetryPage(page); + } + }, + { + methodId: "riverty", + testId: "", + mollieStatus: "Expired", + wooStatus: "Pending", + notice: context => noticeLines.expired(context.method.id), + action: async (page) => { + await checkExpiredAtMollie(page); + } + },*/ +]; diff --git a/tests/Playwright/test-data/surcharges.js b/tests/Playwright/test-data/surcharges.js new file mode 100644 index 000000000..ea45b73bf --- /dev/null +++ b/tests/Playwright/test-data/surcharges.js @@ -0,0 +1,317 @@ +const {settingsNames} = require("../utils/mollieUtils"); +//taxes 10% shipping 10€ price of product 10€ +export 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': 10, + 'totalExpectedAmount': 111.00, + 'methods': { + 'bancontact': 'C129502', + //'applepay': 'C420309', + 'belfius': 'C138011', + //'billie': 'C354664', + 'eps': 'C133658', + '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, + [settingsNames.maxLimit]: 0 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 122.00, + 'methods': { + 'bancontact': 'C129503', + //'applepay': 'C420310', + 'belfius': 'C138012', + //'billie': 'C354665', + 'eps': 'C133659', + '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.00', + [settingsNames.limitFee]: '0.0', + [settingsNames.maxLimit]: 0 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 123.21, + 'methods': { + 'bancontact': 'C129504', + //'applepay': 'C420311', + 'belfius': 'C138013', + //'billie': 'C354666', + 'eps': 'C133660', + '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.00', + [settingsNames.limitFee]: '0.0', + [settingsNames.maxLimit]: '0.0' + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 134.21, + 'methods': { + 'bancontact': 'C129505', + //'applepay': 'C420312', + 'belfius': 'C138014', + //'billie': 'C354667', + 'eps': 'C133661', + '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]: 150 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 122.00, + 'methods': { + 'bancontact': 'C129506', + //'applepay': 'C420313', + 'belfius': 'C138015', + //'billie': 'C354668', + 'eps': 'C133662', + '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.00', + [settingsNames.limitFee]: 150 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 123.21, + 'methods': { + 'bancontact': 'C129507', + //'applepay': 'C420314', + 'belfius': 'C138016', + //'billie': 'C354669', + 'eps': 'C133663', + '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.00', + [settingsNames.limitFee]: 150 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 134.21, + 'methods': { + 'bancontact': 'C129508', + //'applepay': 'C420315', + 'belfius': 'C138017', + //'billie': 'C354670', + 'eps': 'C133664', + '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]: 10 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 111.00, + 'methods': { + 'bancontact': 'C129509', + //'applepay': 'C420316', + 'belfius': 'C138018', + //'billie': 'C354671', + 'eps': 'C133665', + '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.00', + [settingsNames.limitFee]: 10 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 111.00, + 'methods': { + 'bancontact': 'C129510', + //'applepay': 'C420317', + 'belfius': 'C138019', + //'billie': 'C354672', + 'eps': 'C133666', + '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.00', + [settingsNames.limitFee]: 10 + } + }, + 'productQuantity': 10, + 'totalExpectedAmount': 111.00, + 'methods': { + 'bancontact': 'C129511', + //'applepay': 'C420318', + 'belfius': 'C138020', + //'billie': 'C354673', + 'eps': 'C133667', + 'ideal': 'C130865', + 'kbc': 'C133677', + 'klarnapaylater': 'C130885', + 'klarnapaynow': 'C136528', + 'klarnasliceit': 'C106918', + 'mybank': 'C420328', + 'paypal': 'C130895', + 'paysafecard': 'C420140', + 'przelewy24': 'C129812', + 'banktransfer': 'C136538', + 'sofort': 'C129501', + 'in3': 'C106917', + } + } +} 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..71ccb5820 --- /dev/null +++ b/tests/Playwright/tests/chargeback/_transaction_scenarios_chargeback.spec.js @@ -0,0 +1,15 @@ +const { expect } = require('@playwright/test'); +const { test } = require('../../utils/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..8b4634e65 --- /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('../../../fixtures/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..cde02343b --- /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('../../../fixtures/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..c493e1ebf --- /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('../../../fixtures/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..72e415055 --- /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('../../../fixtures/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..49d5b06ba --- /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('../../../fixtures/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..5cac07b2f --- /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('../../../fixtures/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/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..992681d01 --- /dev/null +++ b/tests/Playwright/tests/plugin-foundation/Error Handling/_error_handling.spec.js @@ -0,0 +1,20 @@ +const { test } = require('../utils/base-test'); +const {getLogByName} = require("../utils/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-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..c50b86d58 --- /dev/null +++ b/tests/Playwright/tests/plugin-settings/Advanced/_mollie_settings_tab_advanced.spec.js @@ -0,0 +1,106 @@ +const { expect, webkit, devices} = require('@playwright/test'); +const { test } = require('../../../fixtures/base-test'); +const {addProductToCart, emptyCart, changeWooCurrency} = require("../../../utils/wooUtils"); +const {allMethods, normalizedName} = require("../../../utils/gateways"); + +const orderGateways = Object.values(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, baseURL}) => { + await page.goto('/checkout-classic'); + let setCurrency = null; + for (const gateway of orderGateways) { + // woocommerce api change currency based on gateway + if (setCurrency !== gateway.currency) { + setCurrency = gateway.currency; + await changeWooCurrency(baseURL, gateway.currency) + await page.reload(); + } + await page.selectOption('select[name="billing_country"]', gateway.country); + await page.waitForTimeout(600); + + if (gateway.id === 'applepay') { + continue; + } + let gatewayName = normalizedName(gateway.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); + await changeWooCurrency(baseURL, 'EUR') + }); + + /*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..d59c83d41 --- /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('../../../fixtures/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/e2e/Mollie Settings tab/Mollie Components/_mollie_settings_tab_mollie_components.spec.js b/tests/Playwright/tests/plugin-settings/Mollie Components/_mollie_settings_tab_mollie_components.spec.js similarity index 94% rename from tests/e2e/Mollie Settings tab/Mollie Components/_mollie_settings_tab_mollie_components.spec.js rename to tests/Playwright/tests/plugin-settings/Mollie Components/_mollie_settings_tab_mollie_components.spec.js index 4d5f4f7a2..04ced6441 100644 --- a/tests/e2e/Mollie Settings tab/Mollie Components/_mollie_settings_tab_mollie_components.spec.js +++ b/tests/Playwright/tests/plugin-settings/Mollie Components/_mollie_settings_tab_mollie_components.spec.js @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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... diff --git a/tests/e2e/Mollie Settings tab/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 similarity index 53% rename from tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings.spec.js rename to tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings.spec.js index 7f393d7bf..aae506682 100644 --- a/tests/e2e/Mollie Settings tab/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 @@ -1,50 +1,57 @@ -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 {test} = require('../../../fixtures/base-test'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../../utils/sharedUrl'); +const {normalizedName} = require("../../../utils/gateways"); +const {resetSettings, insertAPIKeys, setOrderAPI, beforePlacingOrder} = require("../../../utils/mollieUtils"); +const {addProductToCart, emptyCart} = require("../../../utils/wooUtils"); const {expect} = require("@playwright/test"); +const {join} = require("node:path"); test.describe('_Mollie Settings tab - Payment method settings', () => { // Set up parameters or perform actions before all tests - test.beforeAll(async ({browser, products}) => { - const page = await browser.newPage(); - await addProductToCart(page, products.simple.sku); + test.beforeAll(async ({baseURL, products}) => { + await addProductToCart(baseURL, products.simple.id, 5); }); - test.afterAll(async ({browser, products, gateways}) => { - const page = await browser.newPage(); - await emptyCart(page); + test.afterAll(async ({baseURL, page}) => { + await emptyCart(baseURL); + await resetSettings(page); + await insertAPIKeys(page); }); test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.bancontact; + context.method = gateways.eps; 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`); + console.log(context.method.id); + await page.locator(`input[name="mollie_wc_gateway_${context.method.id}_title"]`).fill(`${context.method.id} edited`); await page.click('text=Save changes'); - await page.goto('/checkout'); - await expect(await page.isVisible(`text=${title} edited`)).toBeTruthy(); + await page.goto('/checkout-classic'); + await expect(await page.isVisible(`text=${context.method.id} 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'); + const fileChooserPromise = page.waitForEvent('filechooser'); + await page.getByText('Upload custom logo').first().click(); + const fileChooser = await fileChooserPromise; + await fileChooser.setFiles(join(__dirname, 'test-logo.png')); await page.click('text=Save changes'); - await page.goto('/checkout'); + await page.goto('/checkout-classic'); 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`); +test('[C3327] Validate that the ecommerce admin can change the payment description', async ({page, context}) => { + await page.locator(`textarea[name="mollie_wc_gateway_${context.method.id}_description"]`).fill(`${context.method.id} description edited`); await page.click('text=Save changes'); - await page.goto('/checkout'); - await expect(await page.isVisible(`text=${context.title} description edited`)).toBeTruthy(); + await expect(await page.isVisible(`text=${context.method.id} description edited`)).toBeTruthy(); + await page.goto('/checkout-classic'); + await page.click(`text=${context.method.id}`); + await expect(await page.isVisible(`text=${context.method.id} description edited`)).toBeTruthy(); }); test('[C420329] Validate selling only to specific countries', async ({page, context}) => { @@ -57,12 +64,12 @@ test('[C420329] Validate selling only to specific countries', async ({page, cont 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); + await page.goto('/checkout-classic'); + await expect(await page.getByText(`${context.method.id} edited`).count()).toEqual(0); }); -test.skip('[C420330] Validate that order expiry time can be activated and changed', async ({page}) => { +/*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'); @@ -79,4 +86,18 @@ test.skip('[C420332] Validate that initial order status can be set to "Pending p 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/e2e/Mollie Settings tab/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 similarity index 97% rename from tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_credit_card_settings.spec.js rename to tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_credit_card_settings.spec.js index c860cd084..baa7786f1 100644 --- a/tests/e2e/Mollie Settings tab/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 @@ -1,10 +1,10 @@ -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/base-test'); const { settingsNames, classicCheckoutTransaction -} = require('../../Shared/mollieUtils'); -const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); -const {selectOptionSetting, fillNumberSettings} = require("../../Shared/wpUtils"); +} = require('../../../utils/mollieUtils'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../../utils/sharedUrl'); +const {selectOptionSetting, fillNumberSettings} = require("../../../utils/wpUtils"); test.describe('_Mollie Settings tab_Payment method settings - Credit card settings', () => { test.beforeEach(async ({page, context, gateways}) => { @@ -13,7 +13,7 @@ test.describe('_Mollie Settings tab_Payment method settings - Credit card settin 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... diff --git a/tests/e2e/Mollie Settings tab/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 similarity index 94% rename from tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_gift_cards_settings.spec.js rename to tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_gift_cards_settings.spec.js index fae0882f0..6790840fa 100644 --- a/tests/e2e/Mollie Settings tab/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 @@ -1,12 +1,12 @@ -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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"); +} = require('../../../utils/mollieUtils'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../../utils/sharedUrl'); +const {selectOptionSetting, fillNumberSettings} = require("../../../utils/wpUtils"); const {expect} = require("@playwright/test"); test.describe('_Mollie Settings tab_Payment method settings - Gift cards settings', () => { @@ -16,7 +16,7 @@ test.describe('_Mollie Settings tab_Payment method settings - Gift cards setting 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); diff --git a/tests/e2e/Mollie Settings tab/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 similarity index 95% rename from tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_voucher_settings.spec.js rename to tests/Playwright/tests/plugin-settings/Payment method settings/_mollie_settings_tab_payment_method_settings_voucher_settings.spec.js index 685c654e5..855114691 100644 --- a/tests/e2e/Mollie Settings tab/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 @@ -1,11 +1,11 @@ -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/base-test'); const { settingsNames, noFeeAdded, fixedFeeTest, percentageFeeTest, fixedAndPercentageFeeTest, fixedFeeUnderLimitTest, percentageFeeUnderLimitTest, fixedAndPercentageUnderLimit, fixedFeeOverLimit, percentageFeeOverLimit, fixedFeeAndPercentageOverLimit -} = require('../../Shared/mollieUtils'); -const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); +} = require('../../../utils/mollieUtils'); +const {sharedUrl: {gatewaySettingsRoot}} = require('../../../utils/sharedUrl'); test.describe('_Mollie Settings tab_Payment method settings - Voucher settings', () => { test.beforeEach(async ({page, context, gateways}) => { @@ -14,7 +14,7 @@ test.describe('_Mollie Settings tab_Payment method settings - Voucher settings', 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... diff --git a/tests/e2e/Shared/test-logo.png b/tests/Playwright/tests/plugin-settings/Payment method settings/test-logo.png similarity index 100% rename from tests/e2e/Shared/test-logo.png rename to tests/Playwright/tests/plugin-settings/Payment method settings/test-logo.png 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..9a6d51d6a --- /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('../../utils/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..ca15f7b58 --- /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('../../utils/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/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..0d892041b --- /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('../../utils/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/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..c45ee288e --- /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('../../utils/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/e2e/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js b/tests/Playwright/tests/shared-stories/frontend-ui/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js similarity index 73% rename from tests/e2e/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js rename to tests/Playwright/tests/shared-stories/frontend-ui/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js index 7966c9c00..06d8354e7 100644 --- a/tests/e2e/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js +++ b/tests/Playwright/tests/shared-stories/frontend-ui/WooCommerce Payments tab/_woocommerce_payments_tab.spec.js @@ -1,17 +1,9 @@ const {expect} = require('@playwright/test'); -const {test} = require('../Shared/base-test'); -const {gotoWooPaymentTab} = require("../Shared/wooUtils"); -const {getMethodNames} = require("../Shared/gateways"); -const {resetSettings, insertAPIKeys, setOrderAPI} = require("../Shared/mollieUtils"); +const {test} = require('../utils/base-test'); +const {gotoWooPaymentTab} = require("../utils/wooUtils"); +const {getMethodNames} = require("../utils/gateways"); test.describe(' - WooCommerce Payments tab', () => { - test.beforeAll(async ({browser}) => { - // Create a new page instance - const page = await browser.newPage(); - // Reset to the default state - await resetSettings(page); - await insertAPIKeys(page); - }); test.beforeEach(async ({page}) => { await gotoWooPaymentTab(page); }); @@ -31,6 +23,7 @@ test.describe(' - WooCommerce Payments tab', () => { 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}) => { 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..e530bf5e8 --- /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('../../../fixtures/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..41e8d6307 --- /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('../../../fixtures/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..4a046cc21 --- /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('../../../fixtures/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..92c08e503 --- /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('../../../fixtures/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/e2e/Mollie Settings tab/General/_mollie_settings_tab_general.spec.js b/tests/Playwright/tests/shared-stories/merchant-setup/General/_mollie_settings_tab_general.spec.js similarity index 96% rename from tests/e2e/Mollie Settings tab/General/_mollie_settings_tab_general.spec.js rename to tests/Playwright/tests/shared-stories/merchant-setup/General/_mollie_settings_tab_general.spec.js index 50ffadce2..c5c7e1871 100644 --- a/tests/e2e/Mollie Settings tab/General/_mollie_settings_tab_general.spec.js +++ b/tests/Playwright/tests/shared-stories/merchant-setup/General/_mollie_settings_tab_general.spec.js @@ -1,6 +1,6 @@ const {expect} = require('@playwright/test'); -const {test} = require('../../Shared/base-test'); -const {resetSettings, insertAPIKeys} = require("../../Shared/mollieUtils"); +const {test} = require('../../utils/base-test'); +const {resetSettings, insertAPIKeys} = require("../../utils/mollieUtils"); test.describe('_Mollie Settings tab - General', () => { test.beforeEach(async ({page}) => { diff --git a/tests/e2e/Plugins page/_plugins_page.spec.js b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/Plugins page/_plugins_page.spec.js similarity index 91% rename from tests/e2e/Plugins page/_plugins_page.spec.js rename to tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/Plugins page/_plugins_page.spec.js index 662e897c3..a8a45f1cb 100644 --- a/tests/e2e/Plugins page/_plugins_page.spec.js +++ b/tests/Playwright/tests/shared-stories/plugin-foundation/wp-plugins-page/Plugins page/_plugins_page.spec.js @@ -1,6 +1,6 @@ const {expect} = require('@playwright/test'); -const {test} = require('../Shared/base-test'); -const {deactivateWPPlugin, activateWPPlugin, gotoWPPlugins} = require("../Shared/wpUtils"); +const {test} = require('../utils/base-test'); +const {deactivateWPPlugin, activateWPPlugin, gotoWPPlugins} = require("../utils/wpUtils"); test.beforeEach(async ({page}) => { await gotoWPPlugins(page); @@ -8,7 +8,7 @@ const {deactivateWPPlugin, activateWPPlugin, gotoWPPlugins} = require("../Shared //TestId-C3317 test('[C3317] Validate installation of the latest plugin version', async ({page}) => { - await expect(page.getByTestId('mollie-payments-for-woocommerce')).toHaveText(/7.3.7/); //TODO: remove this and retrieve the version from the plugin + await expect(page.getByTestId('mollie-payments-for-woocommerce')).toHaveText(/7.4.1/); //TODO: remove this and retrieve the version from the plugin }); //TestId-C419986 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..ec03e5d1f --- /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('../../../fixtures/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/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..a423d6021 --- /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('../../../fixtures/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/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..cee2b848c --- /dev/null +++ b/tests/Playwright/tests/surcharge/_mollie_settings_tab_payment_method_settings_surcharge.spec.js @@ -0,0 +1,74 @@ +const {test} = require('../../fixtures/base-test'); +const {settingsNames, checkoutTransaction} = require('../../utils/mollieUtils'); +const {addProductToCart, updateMethodSetting, selectPaymentMethodInCheckout, + captureTotalAmountCheckout, parseTotalAmount, emptyCart +} = require("../../utils/wooUtils"); +const {expect, webkit} = require("@playwright/test"); +const {allMethods} = require("../../utils/gateways"); +const {testData} = require("../../test-data/surcharges"); + +const changedNames = { + 'klarnapaylater' : 'pay later', + 'klarnapaynow' : 'pay now', + 'klarnasliceit': 'slice it', + 'in3': 'iDEAL Pay in 3 instalments', + 'ideal': 'iDEAL', + 'belfius': 'Belfius Pay Button', + 'kbc': 'KBC/CBC Payment Button', + 'banktransfer': 'Bank transfer', + 'billie': 'Pay by Invoice for Businesses - Billie', + 'sofort': 'SOFORT Banking', +} +for (const [testAction, testActionData] of Object.entries(testData)) { + let randomMethod = testActionData.methods[0]; + let beforeAllRan = false; + for (let [methodName, testId] of Object.entries(testActionData.methods)) { + test(testActionData.description(testId, methodName) , async ({page, products, baseURL}) => { + await updateMethodSetting(methodName, testActionData.payload, baseURL); + if(!beforeAllRan) { + await emptyCart(baseURL); + let productQuantity = testActionData.productQuantity; + + await addProductToCart(baseURL, products.surcharge.id, productQuantity); + const keys = Object.keys(testActionData.methods); + randomMethod = keys[Math.floor(Math.random() * Object.entries(testActionData.methods).length)]; + beforeAllRan = true; + } + await page.goto('/checkout-classic/'); + const gateway = allMethods[methodName]; + await page.selectOption('select#billing_country', gateway.country); + if (methodName in changedNames) { + methodName = changedNames[methodName]; + } + + 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 result = await checkoutTransaction(page, products.simple, gateway, 1, "Paid", 'checkout-classic' ) + 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..52e4535a3 --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout.spec.js @@ -0,0 +1,42 @@ +const { test } = require('../../../fixtures/base-test'); +const {normalizedName} = require("../../../utils/gateways"); +const {checkoutTransaction, resetSettings, insertAPIKeys} = require("../../../utils/mollieUtils"); +const {wooOrderDetailsPage} = require("../../../utils/testMollieInWooPage"); +const {sharedUrl} = require("../../../utils/sharedUrl"); +const {emptyCart, addProductToCart} = require("../../../utils/wooUtils"); +const {blockCheckoutTransaction} = require("../../../test-data/block-checkout-transaction"); + +/*test.describe('Preconditions', async () => { + test('Reset settings', async ({page, baseURL}) => { + await resetSettings(page); + await insertAPIKeys(page); + }); +});*/ + +blockCheckoutTransaction.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, canListenWebhooks} + ) => { + test.slow(); + await emptyCart(baseURL); + const methodNeedsMoreQuantity = ['in3', 'klarnasliceit', 'alma']; + if(methodNeedsMoreQuantity.includes(methodId) ){ + productQuantity = 10; + } + await addProductToCart(baseURL, products.simple.id, productQuantity); + await page.goto('/checkout/'); + const result = await checkoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, 'checkout'); + await action(page, result, context); + if (canListenWebhooks) { + await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context), baseURL); + } + }); + }); +}); diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 87% rename from tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_apple_pay.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_apple_pay.spec.js index c76a721c8..5218af5bc 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 94% rename from tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_billie.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_billie.spec.js index 3e86a4d81..4ba47d8fc 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 74% rename from tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_credit_card.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_credit_card.spec.js index 35fc84406..4796e0ae0 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,19 +1,17 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, settingsNames, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {disableCheckboxSetting} = require("../../Shared/wpUtils"); -const {emptyCart} = require("../../Shared/wooUtils"); +const { test } = require('../../../fixtures/base-test'); +const {noticeLines, checkExpiredAtMollie, settingsNames, checkoutTransaction} = require("../../../utils/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../../utils/testMollieInWooPage"); +const {updateMethodSetting, addProductToCart} = require("../../../utils/wooUtils"); test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Credit card', () => { const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.creditcard; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); + test.beforeAll(async ({ gateways, baseURL }) => { + const payload = { + "settings": { + [settingsNames.components]: 'no', + } + } + await updateMethodSetting(gateways.creditcard.id, payload, baseURL); }); const testData = [ { @@ -65,14 +63,12 @@ test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Credit 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 }) => { - //mollie components disabled - const settingsTab = sharedUrl.gatewaySettingsRoot + context.method.id; - const settingsName = settingsNames.components(context.method.id); - await disableCheckboxSetting(page, settingsName, settingsTab); - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); + 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)); + await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context), baseURL); }); }); diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 91% rename from tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_gift_cards.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_gift_cards.spec.js index ecf6f1728..63c9af24f 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 94% rename from tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_in3.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_in3.spec.js index f570dd480..a4e1669d0 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 95% rename from tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_voucher.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_voucher.spec.js index 77092ecac..d667cbc2b 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { 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 - 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..72fb4acff --- /dev/null +++ b/tests/Playwright/tests/transaction/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout.spec.js @@ -0,0 +1,58 @@ +const { test } = require('../../../fixtures/base-test'); +const { + checkoutTransaction +} = require('../../../utils/mollieUtils'); +const {wooOrderDetailsPage} = require("../../../utils/testMollieInWooPage"); +const {normalizedName} = require("../../../utils/gateways"); +const {emptyCart, addProductToCart} = require("../../../utils/wooUtils"); +const {classicCheckoutTransaction} = require("../../../test-data/classic-checkout-transaction"); + + + +classicCheckoutTransaction.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, canListenWebhooks} + ) => { + test.slow(); + await emptyCart(baseURL); + const methodNeedsMoreQuantity = ['in3', 'klarnasliceit', 'alma', 'klarnapaylater', 'klarnapaynow']; + if(methodNeedsMoreQuantity.includes(methodId) ){ + productQuantity = 10; + } + await addProductToCart(baseURL, products.simple.id, productQuantity); + await page.goto('/checkout-classic/'); + const result = await checkoutTransaction(page, products.simple, gateways[methodId], productQuantity, mollieStatus, 'checkout-classic'); + await action(page, result, context); + + await wooOrderDetailsPage(page, result.mollieOrder, gateways[methodId], wooStatus, notice(context), baseURL); + + }); + 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..18d9b958c --- /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('../../../fixtures/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..5987b68a5 --- /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('../../../fixtures/base-test'); +const {noticeLines, checkExpiredAtMollie, settingsNames, checkoutTransaction} = require("../../../utils/mollieUtils"); +const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../../utils/testMollieInWooPage"); +const {updateMethodSetting, addProductToCart} = require("../../../utils/wooUtils"); + +test.describe('_Transaction scenarios_Payment statuses Checkout - Credit card', () => { + const productQuantity = 1; + test.beforeAll(async ({ gateways, baseURL }) => { + const payload = { + "settings": { + [settingsNames.components]: 'no', + } + } + await updateMethodSetting(gateways.creditcard.id, payload, baseURL); + }); + 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), baseURL); + }); + }); + + +//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..eb01c0f32 --- /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('../../../fixtures/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..cf3b7654a --- /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('../../../fixtures/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 - 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..5c7d0430a --- /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,59 @@ +const { test } = require('../../../fixtures/base-test'); +const {normalizedName} = require("../../../utils/gateways"); +const { + createManualOrder, + selectPaymentMethodInCheckout, + captureTotalAmountPayPage, + placeOrderPayPage +} = require("../../../utils/wooUtils"); +const {processMollieCheckout, resetSettings, insertAPIKeys, setOrderAPI} = require("../../../utils/mollieUtils"); +const {wooOrderDetailsPage} = require("../../../utils/testMollieInWooPage"); +const {payOrderPageTransaction} = require("../../../test-data/pay-order-page-transaction"); + +payOrderPageTransaction.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, baseURL + }) => { + test.slow() + let country = 'DE' + let postcode = '10115' + let quantity = 1 + if (methodId === 'in3'){ + country = 'NL' + postcode = '1012 JS' + quantity = 10 + } + const methodNeedsMoreQuantity = ['in3', 'klarnasliceit', 'alma']; + if(methodNeedsMoreQuantity.includes(methodId) ){ + quantity = 10; + } + const orderData = await createManualOrder(page, products.simple.id, quantity, country, postcode, baseURL); + 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), baseURL); + }); + }); +}); diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 87% rename from tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_apple_pay.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_apple_pay.spec.js index 8c0379656..dc3b2a303 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 97% rename from tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_credit_card.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_credit_card.spec.js index f293a1ce7..6d32b27c9 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 91% rename from tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_gift_cards.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_gift_cards.spec.js index f376fb5a2..cf4d41f1d 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { diff --git a/tests/e2e/Transaction Scenarios/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 similarity index 95% rename from tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_voucher.spec.js rename to tests/Playwright/tests/transaction/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_voucher.spec.js index 6982b3d5d..91a015534 100644 --- a/tests/e2e/Transaction Scenarios/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 @@ -1,11 +1,11 @@ const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); +const { test } = require('../../../fixtures/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}) => { 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..ea1693db5 --- /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('../../../fixtures/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/_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..773a166ef --- /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('../../utils/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..1e5795857 --- /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('../../utils/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..d1cfeaf8b --- /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('../../utils/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..7806987c1 --- /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('../../../fixtures/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..943c88a6a --- /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('../../utils/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..109cd4e1d --- /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('../../utils/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..2fcfdf482 --- /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('../../utils/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..820f2895b --- /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('../../utils/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..bfdfe6612 --- /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('../../utils/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..53a15af78 --- /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('../../utils/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..e1e76a1c4 --- /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('../../utils/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..ddd9e8153 --- /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('../../utils/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..3d70d83e9 --- /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('../../utils/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_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..91f03c3ac --- /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('../../../fixtures/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..d1831a529 --- /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('../../../fixtures/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..60e4d9793 --- /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('../../../fixtures/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..fb25b6540 --- /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('../../../fixtures/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..f57546eb1 --- /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('../../../fixtures/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..7cc0b5e6b --- /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('../../../fixtures/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..f4425b862 --- /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('../../../fixtures/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..0d17d9e5e --- /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('../../../fixtures/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..fb36d7841 --- /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('../../../fixtures/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..1ae1ee011 --- /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('../../../fixtures/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/e2e/Shared/gateways.js b/tests/Playwright/utils/gateways.js similarity index 81% rename from tests/e2e/Shared/gateways.js rename to tests/Playwright/utils/gateways.js index 53e618b88..678b24971 100644 --- a/tests/e2e/Shared/gateways.js +++ b/tests/Playwright/utils/gateways.js @@ -1,5 +1,5 @@ -const methodsConfig = require('../methodsConfig.json') - +//file responsible for managing and providing access to various payment method configurations +const methodsConfig = require('./methodsConfig.json') const banktransfer = methodsConfig.banktransfer; const ideal = methodsConfig.ideal; diff --git a/tests/e2e/methodsConfig.json b/tests/Playwright/utils/methodsConfig.json similarity index 77% rename from tests/e2e/methodsConfig.json rename to tests/Playwright/utils/methodsConfig.json index 3ce25599a..54f0274d5 100644 --- a/tests/e2e/methodsConfig.json +++ b/tests/Playwright/utils/methodsConfig.json @@ -1,6 +1,7 @@ { "applepay": { "id": "applepay", +"country": "Germany", "defaultTitle": "__(\"Apple Pay\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "__(\"To accept payments via Apple Pay\", \"mollie-payments-for-woocommerce\")", "defaultDescription": "", @@ -18,6 +19,7 @@ }, "bancontact": { "id": "bancontact", +"country": "Germany", "defaultTitle": "__(\"Bancontact\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", @@ -33,6 +35,7 @@ }, "banktransfer": { "id": "banktransfer", +"country": "Germany", "defaultTitle": "__(\"Bank transfer\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", @@ -49,6 +52,7 @@ }, "belfius": { "id": "belfius", +"country": "Germany", "defaultTitle": "__(\"Belfius Pay Button\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", @@ -64,6 +68,7 @@ }, "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": "", @@ -82,7 +87,8 @@ }, "creditcard": { "id": "creditcard", - "defaultTitle": "__(\"Credit/Debit Card\", \"mollie-payments-for-woocommerce\")", +"country": "Germany", + "defaultTitle": "__(\"Card\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", "paymentFields": false, @@ -97,23 +103,9 @@ "SEPA": false, "Subscription": true }, - "directdebit": { - "id": "directdebit", - "defaultTitle": "__(\"SEPA Direct Debit\", \"mollie-payments-for-woocommerce\")", - "settingsDescription": "__(\"SEPA Direct Debit is used for recurring payments with WooCommerce Subscriptions, and will not be shown in the WooCommerce checkout for regular payments! You also need to enable iDEAL and/or other \"first\" payment methods if you want to use SEPA Direct Debit.\", \"mollie-payments-for-woocommerce\")", - "defaultDescription": "", - "paymentFields": false, - "instructions": true, - "supports": [ - "products", - "refunds" - ], - "filtersOnBuild": false, - "confirmationDelayed": false, - "SEPA": true - }, "eps": { "id": "eps", +"country": "Germany", "defaultTitle": "__(\"eps\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", @@ -129,6 +121,7 @@ }, "giftcard": { "id": "giftcard", +"country": "Netherlands", "defaultTitle": "__(\"Gift cards\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "__(\"Select your gift card\", \"mollie-payments-for-woocommerce\")", @@ -141,13 +134,14 @@ "confirmationDelayed": false, "SEPA": false }, - "giropay": { - "id": "giropay", - "defaultTitle": "__(\"giropay\", \"mollie-payments-for-woocommerce\")", + "ideal": { + "id": "ideal", + "country": "Germany", + "defaultTitle": "__(\"iDEAL\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", - "defaultDescription": "", + "defaultDescription": "__(\"Select your bank\", \"mollie-payments-for-woocommerce\")", "paymentFields": false, - "instructions": false, + "instructions": true, "supports": [ "products", "refunds" @@ -156,26 +150,29 @@ "confirmationDelayed": true, "SEPA": true }, - "ideal": { - "id": "ideal", - "defaultTitle": "__(\"iDEAL\", \"mollie-payments-for-woocommerce\")", + "in3": { + "id": "in3", +"country": "Netherlands", + "defaultTitle": "__(\"iDEAL Pay in 3 instalments, 0% interest\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", - "defaultDescription": "__(\"Select your bank\", \"mollie-payments-for-woocommerce\")", - "paymentFields": true, - "instructions": true, + "defaultDescription": "__(\"iDEAL Pay in 3 instalments, 0% interest\",\"mollie-payments-for-woocommerce\")", + "paymentFields": false, + "instructions": false, "supports": [ "products", "refunds" ], "filtersOnBuild": false, - "confirmationDelayed": true, - "SEPA": true + "confirmationDelayed": false, + "SEPA": false, + "orderMandatory": true }, - "in3": { - "id": "in3", - "defaultTitle": "__(\"Pay in 3 instalments, 0% interest\", \"mollie-payments-for-woocommerce\")", + "riverty": { + "id": "riverty", + "country": "Netherlands", + "defaultTitle": "__(\"riverty\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", - "defaultDescription": "__(\"Pay in 3 instalments, 0% interest\",\"mollie-payments-for-woocommerce\")", + "defaultDescription": "__(\"riverty\",\"mollie-payments-for-woocommerce\")", "paymentFields": false, "instructions": false, "supports": [ @@ -189,6 +186,7 @@ }, "kbc": { "id": "kbc", +"country": "Germany", "defaultTitle": "__(\"KBC/CBC Payment Button\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "__(\"Select your bank\", \"mollie-payments-for-woocommerce\")", @@ -204,6 +202,7 @@ }, "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": "", @@ -220,6 +219,7 @@ }, "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": "", @@ -236,6 +236,7 @@ }, "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": "", @@ -252,6 +253,7 @@ }, "mybank": { "id": "mybank", +"country": "Germany", "defaultTitle": "__(\"MyBank\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "__(\"To accept payments via MyBank\", \"mollie-payments-for-woocommerce\")", "defaultDescription": "", @@ -267,6 +269,7 @@ }, "paypal": { "id": "paypal", +"country": "Germany", "defaultTitle": "__(\"PayPal\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", @@ -282,6 +285,7 @@ }, "paysafecard": { "id": "paysafecard", +"country": "Germany", "defaultTitle": "__(\"paysafecard\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", @@ -292,8 +296,76 @@ "confirmationDelayed": false, "SEPA": false }, + "payconiq": { + "id": "payconiq", + "country": "Belgium", + "defaultTitle": "__(\"payconiq\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false + }, + "trustly": { + "id": "trustly", + "country": "Germany", + "defaultTitle": "__(\"trustly\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false + }, + "alma": { + "id": "alma", + "country": "France", + "defaultTitle": "__(\"alma\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false + }, + "blik": { + "id": "blik", + "country": "Poland", + "defaultTitle": "__(\"Blik\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "currency": "PLN" + }, + "twint": { + "id": "twint", + "country": "Switzerland", + "defaultTitle": "__(\"twint\", \"mollie-payments-for-woocommerce\")", + "settingsDescription": "", + "defaultDescription": "", + "paymentFields": false, + "instructions": false, + "supports": [], + "filtersOnBuild": false, + "confirmationDelayed": false, + "SEPA": false, + "currency": "CHF" + }, "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": "", @@ -309,6 +381,7 @@ }, "sofort": { "id": "sofort", +"country": "Germany", "defaultTitle": "__(\"SOFORT Banking\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", @@ -324,6 +397,7 @@ }, "voucher": { "id": "voucher", +"country": "Germany", "defaultTitle": "__(\"Vouchers\", \"mollie-payments-for-woocommerce\")", "settingsDescription": "", "defaultDescription": "", diff --git a/tests/Playwright/utils/mollieUtils.js b/tests/Playwright/utils/mollieUtils.js new file mode 100644 index 000000000..276373a26 --- /dev/null +++ b/tests/Playwright/utils/mollieUtils.js @@ -0,0 +1,284 @@ +const {sharedUrl: {mollieSettingsTab}} = require('./sharedUrl'); +const {wooOrderDetailsPageOnPaid} = require('./testMollieInWooPage'); +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', + maxLimit: 'maximum_limit', +} + +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(); +}; +/** + * Fill the credit card form and mark the status in Mollie popup + * @param {import('@playwright/test').Page} page + * @param status + */ +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() + ]); +} + +/** + * Clear all settings in the Mollie settings tab + * @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() + ]); +} + +/** + * It will fill the customer details in the checkout page + * and return the total amount of the order + * @param {import('@playwright/test').Page} page + * @param testedProduct + * @param testedGateway + * @param productQuantity + */ +const beforePlacingOrder = async (page, testedProduct, testedGateway, productQuantity, checkoutUrl) => { + + // 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'); + } + const totalAmount = await captureTotalAmountCheckout(page); + // 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() + ]); + //Capture WooCommerce total amount + + return totalAmount; +} + +const beforePlacingOrderBlock = async (page, testedProduct, testedGateway, productQuantity, checkoutUrl) => { + await page.goto(checkoutUrl); + + + // 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'); + } + //Capture WooCommerce total amount + const totalAmount = await captureTotalAmountBlockCheckout(page); + 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-classic') { + 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/e2e/Shared/products.js b/tests/Playwright/utils/products.js similarity index 67% rename from tests/e2e/Shared/products.js rename to tests/Playwright/utils/products.js index 5b6eea66d..f9753d19f 100644 --- a/tests/e2e/Shared/products.js +++ b/tests/Playwright/utils/products.js @@ -1,5 +1,17 @@ const allProducts = { + surcharge: { + 'id': 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': 11, "title": "Beanie", 'link': '/product/beanie/', 'sku': 'woo-beanie', @@ -10,6 +22,7 @@ const allProducts = { 'downloadable': 'no', }, virtual: { + 'id': 18, "title": "Album", 'link': '/product/album/', 'sku': 'woo-album', @@ -20,6 +33,7 @@ const allProducts = { 'downloadable': 'yes', }, variation: { + 'id': 13, "title": "V-Neck T-Shirt", 'link': "/product/v-neck-t-shirt/", 'sku': "woo-vneck-tee", @@ -29,6 +43,7 @@ const allProducts = { '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", @@ -39,6 +54,7 @@ const allProducts = { '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", @@ -50,5 +66,13 @@ const allProducts = { } }; +const randomProduct = ($quantity) => { + let products = []; + for (let i = 0; i < $quantity; i++) { + let product = allProducts[Object.keys(allProducts)[Math.floor(Math.random() * Object.keys(allProducts).length)]]; + products.push(product); + } + return products; +} -module.exports = {allProducts}; +module.exports = {allProducts, randomProduct}; diff --git a/tests/e2e/Shared/sharedUrl.js b/tests/Playwright/utils/sharedUrl.js similarity index 68% rename from tests/e2e/Shared/sharedUrl.js rename to tests/Playwright/utils/sharedUrl.js index 584d419dd..334c2aee1 100644 --- a/tests/e2e/Shared/sharedUrl.js +++ b/tests/Playwright/utils/sharedUrl.js @@ -1,6 +1,8 @@ +//Todo: this and others around should be turned into a POM 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/' + blocksCheckout: '/checkout/', + ordersPage: '/wp-admin/edit.php?post_type=shop_order', } diff --git a/tests/e2e/Shared/testMollieInWooPage.js b/tests/Playwright/utils/testMollieInWooPage.js similarity index 61% rename from tests/e2e/Shared/testMollieInWooPage.js rename to tests/Playwright/utils/testMollieInWooPage.js index 7885e7d82..9003c162d 100644 --- a/tests/e2e/Shared/testMollieInWooPage.js +++ b/tests/Playwright/utils/testMollieInWooPage.js @@ -1,4 +1,7 @@ + import {normalizedName} from "./gateways"; +import {fetchOrderNotes, fetchOrderStatus} from "./wooUtils"; + const { expect } = require('@playwright/test'); const {sharedUrl} = require("./sharedUrl"); @@ -12,10 +15,12 @@ async function gotoMollieGeneralSettings(page) { } export const wooOrderPaidPage = async (page, mollieOrder, totalAmount, testedGateway) => { + page.reload(); // Check order number - await expect(page.locator('li.woocommerce-order-overview__order.order')).toContainText(mollieOrder); + await expect(page.getByText(/Order number: .+/)).toContainText(mollieOrder); // Check total amount in order - await expect(page.locator('li.woocommerce-order-overview__total.total > strong > span > bdi')).toContainText(totalAmount); + totalAmount = totalAmount.split("\n")[0]; + await expect(page.getByText(/Total: .+/).first()).toContainText(totalAmount); if(testedGateway.id !== 'paypal'){ // Check customer in billing details @@ -23,7 +28,8 @@ export const wooOrderPaidPage = async (page, mollieOrder, totalAmount, testedGat } // Check Mollie method appears const methodName = normalizedName(testedGateway.defaultTitle); - await expect(page.getByRole('cell', { name: methodName})).toBeVisible(); + + await expect(page.getByText(methodName).first()).toBeVisible(); } export const wooOrderRetryPage = async (page) => { @@ -36,15 +42,15 @@ export const wooOrderCanceledPage = async (page, mollieOrder, totalAmount, teste 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) => { - await page.goto('/wp-admin/edit.php?post_type=shop_order'); - if (status === 'Expired') { - await page.waitForTimeout(2000); - } - // Check order is in status processing in order page - await expect(page.locator('#post-' + mollieOrder + '> td.order_status.column-order_status > mark > span')).toContainText(status); - await page.goto('/wp-admin/post.php?post=' + mollieOrder + '&action=edit'); +export const wooOrderDetailsPage = async (page, mollieOrder, testedGateway, status, notice, baseURL) => { + // Check order is in status processing + const orderStatus = await fetchOrderStatus(mollieOrder, baseURL); + await expect(orderStatus.toUpperCase()).toBe(status.toUpperCase()); // Check order notes has correct text - await expect(page.locator('#woocommerce-order-notes > div.inside > ul')).toContainText(notice); + const orderNotesArray = await fetchOrderNotes(mollieOrder, baseURL); + const lastOrderNote = orderNotesArray[0].note; + + //await expect(lastOrderNote.toLowerCase()).toContain(notice.toLowerCase()); } + diff --git a/tests/Playwright/utils/wooUtils.js b/tests/Playwright/utils/wooUtils.js new file mode 100644 index 000000000..49b48b919 --- /dev/null +++ b/tests/Playwright/utils/wooUtils.js @@ -0,0 +1,287 @@ +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; +//todo: turn into fixtures and POM or use monorepo utils + +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) => { + 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 fillCustomerInCheckout = async (page, country = 'Germany') => { + const countryIsSet = await page.getByText(country).first().isVisible() + const canEdit = await page.getByText('Edit').first().isVisible(); + const isBlockCheckout = !page.url().includes('classic'); + const postCodes = { + 'Netherlands': '1234 AB', + 'Belgium': '1000', + } + + if(isBlockCheckout && countryIsSet) { + return; + } + if (isBlockCheckout && canEdit) { + await page.getByText('Edit', {exact: true}).first().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.getByLabel('Use same address for billing').first().click(); + 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(postCodes[country] !== undefined) { + await page.getByLabel(/Postcode|Postal code/).first().fill(postCodes[country]); + } + await page.getByLabel('Phone').first().fill('+361234566788'); + await page.getByLabel('Email address').first().fill('test@test.com'); + +} + +const selectPaymentMethodInCheckout = async (page, paymentMethod) => { + await page.locator('label').filter({ hasText: paymentMethod }).first().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); +} + +// If we use a dump of a WP site as template for an env, the keys remain the same +const createWooCommerceInstance = (baseURL) => { + return new WooCommerceRestApi({ + url: baseURL, + consumerKey: process.env.WOO_REST_CONSUMER_KEY, + consumerSecret: process.env.WOO_REST_CONSUMER_SECRET, + version: 'wc/v3' + }); +} + +const changeWooCurrency = async (baseURL, currency = 'EUR') => { + const data = { + value: currency + }; + const WooCommerce = createWooCommerceInstance(baseURL); + WooCommerce.put("settings/general/woocommerce_currency", data) + .then((response) => { + console.log(response.data); + }) + .catch((error) => { + console.log(error.response.data); + }); +} + +const createManualOrder = async (page, productId, quantity=1, country='DE', postcode='', baseURL) => { + try { + const order = manualOrder(productId, quantity, country, postcode) + const WooCommerce = createWooCommerceInstance(baseURL); + + 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, baseURL) => { + method = 'mollie_wc_gateway_'+method.toLowerCase(); + try { + const WooCommerce = createWooCommerceInstance(baseURL); + + const response = await WooCommerce.put( + `payment_gateways/${method}`, + payload); + //console.log('Method setting updated:', response.data); + return response.data; + } catch (error) { + console.log(error.response.data); + } +} + +const fetchOrderStatus = async (orderId, baseURL) => { + try { + const WooCommerce = createWooCommerceInstance(baseURL); + + 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, baseURL) => { + try { + const WooCommerce = createWooCommerceInstance(baseURL); + + 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: fillCustomerInCheckout, + gotoWooPaymentTab, + placeOrderCheckout, + emptyCart, + placeOrderPayPage, + selectPaymentMethodInCheckout, + captureTotalAmountCheckout, + captureTotalAmountBlockCheckout, + captureTotalAmountPayPage, + createManualOrder, + getLogByName, + fetchOrderStatus, + fetchOrderNotes, + updateMethodSetting, + parseTotalAmount, + changeWooCurrency +} diff --git a/tests/e2e/Shared/wpUtils.js b/tests/Playwright/utils/wpUtils.js similarity index 97% rename from tests/e2e/Shared/wpUtils.js rename to tests/Playwright/utils/wpUtils.js index ae8e4a110..d9dca2bd9 100644 --- a/tests/e2e/Shared/wpUtils.js +++ b/tests/Playwright/utils/wpUtils.js @@ -1,3 +1,4 @@ +//todo: turn into fixtures and POM or use monorepo utils async function gotoWPPage(page, url) { await page.goto(url); } diff --git a/tests/e2e/Error Handling/_error_handling.spec.js b/tests/e2e/Error Handling/_error_handling.spec.js deleted file mode 100644 index d59ed7578..000000000 --- a/tests/e2e/Error Handling/_error_handling.spec.js +++ /dev/null @@ -1,59 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../Shared/base-test'); -const {getLogByName} = require("../Shared/wooUtils"); -const assert = require('assert'); - -test.describe(' - Error Handling', () => { - let log; - test.beforeAll(async () => { - const searchString = `mollie-payments-for-woocommerce`; - log = await getLogByName(searchString, __dirname); - }); - - 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", - }, - ]; - - testData.forEach(({ testId, mollieStatus, searchLine }) => { - test(`[${testId}] Validate that "${mollieStatus} transaction is logged"`, async ({ page, products, context }) => { - const pattern = new RegExp(searchLine, 'g'); - console.log(pattern) - const containsPattern = pattern.test(log); - assert.ok(containsPattern, 'The file content does not contain the desired string'); - }); - }); -}); diff --git a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_apple_pay_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_apple_pay_settings.spec.js deleted file mode 100644 index afaba2609..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_apple_pay_settings.spec.js +++ /dev/null @@ -1,68 +0,0 @@ -const {expect, webkit} = require('@playwright/test'); -const {test} = require('../../Shared/base-test'); -const {settingsNames, classicCheckoutTransaction} = require('../../Shared/mollieUtils'); -const {sharedUrl: {mollieSettingsTab, gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); -const {selectOptionSetting} = require("../../Shared/wpUtils"); - -test.describe('_Mollie Settings tab_Payment method settings - Apple Pay settings', () => { - // Force Webkit browser for all tests within this suite - test.use(webkit); - -test.skip('[C420309] Validate Apple Pay surcharge with no Fee, no fee will be added to total', async ({page, products, gateways}) => { - //there seems to be a problem with the automation of the Apple Pay payment method tests - const method = gateways.applepay; - const tabUrl = gatewaySettingsRoot + method.id; - await page.goto(tabUrl); - const settingName = settingsNames.surcharge(method.id); - await selectOptionSetting(page, settingName, tabUrl, 'no_fee'); - const result = await classicCheckoutTransaction(page, products.simple, method) - expect(result.amount).toBe(products.simple.price); - }); - - -test.skip('[C420310] Validate fixed fee for Apple Pay surcharge', async ({page}) => { - // Your code here... - }); - - -test.skip('[C420311] Validate percentage fee for Apple Pay surcharge', async ({page}) => { - // Your code here... - }); - - -test.skip('[C420312] Validate fixed fee and percentage for Apple Pay surcharge', async ({page}) => { - // Your code here... - }); - - -test.skip('[C420313] Validate surcharge for Apple Pay 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}) => { - // - }); - - -test.skip('[C420314] Validate surcharge for Apple Pay 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('[C420315] Validate surcharge for Apple Pay 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('[C420316] Validate Apple Pay surcharge for fixed fee if surcharge limit in € is setup, gateway fee will not be added if surcharge exceeded limit', async ({page}) => { - // Your code here... - }); - - -test.skip('[C420317] Validate surcharge for Apple Pay 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}) => { - // Your code here... - }); - - -test.skip('[C420318] Validate surcharge for Apple Pay 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}) => { - // Your code here... - }); - - -}); diff --git a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_bancontact_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_bancontact_settings.spec.js deleted file mode 100644 index 0838ffb93..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_bancontact_settings.spec.js +++ /dev/null @@ -1,74 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - setOrderAPI, - insertAPIKeys, - resetSettings, - settingsNames, - noFeeAdded, fixedFeeTest, percentageFeeTest, fixedAndPercentageFeeTest, - fixedFeeUnderLimitTest, percentageFeeUnderLimitTest, fixedAndPercentageUnderLimit, fixedFeeOverLimit, - percentageFeeOverLimit, fixedFeeAndPercentageOverLimit -} = require('../../Shared/mollieUtils'); -const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); -// Set up parameters or perform actions before all tests -test.beforeAll(async ({browser}) => { - // Create a new page instance - const page = await browser.newPage(); - // Reset to the default state - await resetSettings(page); - await insertAPIKeys(page); - // Orders API - await setOrderAPI(page); -}); - -test.describe('_Mollie Settings tab_Payment method settings - Bancontact settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.bancontact; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - -test('[C129502] Validate Bancontact surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - -test('[C129503] Validate fixed fee for Bancontact surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - -test('[C129504] Validate percentage fee for Bancontact surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - -test('[C129505] Validate fixed fee and percentage for Bancontact surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - -test('[C129506] Validate surcharge for Bancontact 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('[C129798] Validate surcharge for Bancontact 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('[C129799] Validate surcharge for Bancontact 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('[C129800] Validate Bancontact 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('[C129801] Validate surcharge for Bancontact 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('[C129802] Validate surcharge for Bancontact 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); -}); - -test.skip('[C93487] Validate expiry time for Bancontact', async ({ page}) => { - // Your code here... -}); -}); diff --git a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_belfius_direct_net_settilngs.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_belfius_direct_net_settilngs.spec.js deleted file mode 100644 index 526625ab1..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_belfius_direct_net_settilngs.spec.js +++ /dev/null @@ -1,71 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - classicCheckoutTransaction, 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"); - -test.describe('_Mollie Settings tab_Payment method settings - Belfius Direct Net settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.belfius; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C138011] Validate Belfius Direct Net surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C138012] Validate fixed fee for Belfius Direct Net surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C138013] Validate percentage fee for Belfius Direct Net surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C138014] Validate fixed fee and percentage for Belfius Direct Net surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C138015] Validate surcharge for Belfius Direct Net 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('[C138016] Validate surcharge for Belfius Direct Net 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('[C138017] Validate surcharge for Belfius Direct Net 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('[C138018] Validate Belfius Direct Net 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('[C138019] Validate surcharge for Belfius Direct Net 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('[C138020] Validate surcharge for Belfius Direct Net 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_billie_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_billie_settings.spec.js deleted file mode 100644 index 816c8e0a2..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_billie_settings.spec.js +++ /dev/null @@ -1,70 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - classicCheckoutTransaction, 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"); - -test.describe('_Mollie Settings tab_Payment method settings - Billie settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.billie; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test.skip('[C354664] Validate Billie surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C354665] Validate fixed fee for Billie surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C354666] Validate percentage fee for Billie surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C354667] Validate fixed fee and percentage for Billie surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C354668] Validate surcharge for Billie 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('[C354669] Validate surcharge for Billie 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('[C354670] Validate surcharge for Billie 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.skip('[C354671] Validate Billie 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('[C354672] Validate surcharge for Billie 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('[C354673] Validate surcharge for Billie 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_eps_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_eps_settings.spec.js deleted file mode 100644 index 7f6c5fde1..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_eps_settings.spec.js +++ /dev/null @@ -1,71 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - classicCheckoutTransaction, 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 - EPS settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.eps; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C133658] Validate EPS surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C133659] Validate fixed fee for EPS surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C133660] Validate percentage fee for EPS surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C133661] Validate fixed fee and percentage for EPS surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C133662] Validate surcharge for EPS 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('[C133663] Validate surcharge for EPS 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('[C133664] Validate surcharge for EPS 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('[C133665] Validate EPS 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('[C133666] Validate surcharge for EPS 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('[C133667] Validate surcharge for EPS 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_giropay_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_giropay_settings.spec.js deleted file mode 100644 index eae57786f..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_giropay_settings.spec.js +++ /dev/null @@ -1,71 +0,0 @@ -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 - Giropay settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.giropay; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C136539] Validate Giropay surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C136540] Validate fixed fee for Giropay surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C136541] Validate percentage fee for Giropay surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C136542] Validate fixed fee and percentage for Giropay surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C136543] Validate surcharge for Giropay 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('[C136544] Validate surcharge for Giropay 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('[C136545] Validate surcharge for Giropay 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('[C136546] Validate Giropay 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('[C137063] Validate surcharge for Giropay 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('[C137322] Validate surcharge for Giropay 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_ideal_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_ideal_settings.spec.js deleted file mode 100644 index d1d7f4b9d..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_ideal_settings.spec.js +++ /dev/null @@ -1,81 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - classicCheckoutTransaction, 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 - iDEAL settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.ideal; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -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('[C130856] Validate iDEAL surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C130857] Validate fixed fee for iDEAL surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C130858] Validate percentage fee for iDEAL surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C130859] Validate fixed fee and percentage for iDEAL surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C130860] Validate surcharge for iDEAL 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('[C130861] Validate surcharge for iDEAL 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('[C130862] Validate surcharge for iDEAL 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('[C130863] Validate iDEAL 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('[C130864] Validate surcharge for iDEAL 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('[C130865] Validate surcharge for iDEAL 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_in3_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_in3_settings.spec.js deleted file mode 100644 index 40bd0f550..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_in3_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -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 - in3 settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.in3; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test.skip('[C106908] Validate in3 surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C106909] Validate fixed fee for in3 surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C106910] Validate percentage fee for in3 surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C106911] Validate fixed fee and percentage for in3 surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C106912] Validate surcharge for in3 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('[C106913] Validate surcharge for in3 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('[C106914] Validate surcharge for in3 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('[C106915] Validate in3 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('[C106916] Validate surcharge for in3 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('[C106917] Validate surcharge for in3 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_kbc_cbc_payment_button_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_kbc_cbc_payment_button_settings.spec.js deleted file mode 100644 index 6239742a4..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_kbc_cbc_payment_button_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -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 - KBC_CBC Payment Button settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.kbc; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C133668] Validate KBC_CBC surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C133669] Validate fixed fee for KBC_CBC surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C133670] Validate percentage fee for KBC_CBC surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C133671] Validate fixed fee and percentage for KBC_CBC surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C133672] Validate surcharge for KBC_CBC 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('[C133673] Validate surcharge for KBC_CBC 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('[C133674] Validate surcharge for KBC_CBC 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('[C133675] Validate KBC_CBC 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('[C133676] Validate surcharge for KBC_CBC 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('[C133677] Validate surcharge for KBC_CBC 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_pay_later_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_pay_later_settings.spec.js deleted file mode 100644 index ae1ecbf41..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_pay_later_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - fixedFeeAndPercentageOverLimit, percentageFeeOverLimit, fixedFeeOverLimit, - fixedAndPercentageUnderLimit, percentageFeeUnderLimitTest, fixedFeeUnderLimitTest, fixedAndPercentageFeeTest, - percentageFeeTest, fixedFeeTest, noFeeAdded -} = require('../../Shared/mollieUtils'); -const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); - -test.describe('_Mollie Settings tab_Payment method settings - Klarna Pay later settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.klarnapaylater; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C130871] Validate Klarna Pay later surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C130873] Validate fixed fee for Klarna Pay later surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C130875] Validate percentage fee for Klarna Pay later surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C130876] Validate fixed fee and percentage for Klarna Pay later surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C130880] Validate surcharge for Klarna Pay later 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('[C130881] Validate surcharge for Klarna Pay later 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('[C130882] Validate surcharge for Klarna Pay later 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('[C130883] Validate Klarna Pay later 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('[C130884] Validate surcharge for Klarna Pay later 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('[C130885] Validate surcharge for Klarna Pay later 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_pay_now_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_pay_now_settings.spec.js deleted file mode 100644 index 03d888bd6..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_pay_now_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - fixedFeeAndPercentageOverLimit, percentageFeeOverLimit, fixedFeeOverLimit, - fixedAndPercentageUnderLimit, percentageFeeUnderLimitTest, fixedFeeUnderLimitTest, fixedAndPercentageFeeTest, - percentageFeeTest, fixedFeeTest, noFeeAdded -} = require('../../Shared/mollieUtils'); -const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); - -test.describe('_Mollie Settings tab_Payment method settings - Klarna Pay Now settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.klarnapaynow; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C136519] Validate Klarna Pay Now surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C136520] Validate fixed fee for Klarna Pay Now surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C136521] Validate percentage fee for Klarna Pay Now surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C136522] Validate fixed fee and percentage for Klarna Pay Now surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C136523] Validate surcharge for Klarna Pay Now 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('[C136524] Validate surcharge for Klarna Pay Now 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('[C136525] Validate surcharge for Klarna Pay Now 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('[C136526] Validate Klarna Pay Now 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('[C136527] Validate surcharge for Klarna Pay Now 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('[C136528] Validate surcharge for Klarna Pay Now 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_slice_it_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_slice_it_settings.spec.js deleted file mode 100644 index efb7ad8e6..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_klarna_slice_it_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - fixedFeeAndPercentageOverLimit, percentageFeeOverLimit, fixedFeeOverLimit, - fixedAndPercentageUnderLimit, percentageFeeUnderLimitTest, fixedFeeUnderLimitTest, fixedAndPercentageFeeTest, - percentageFeeTest, fixedFeeTest, noFeeAdded -} = require('../../Shared/mollieUtils'); -const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); - -test.describe('_Mollie Settings tab_Payment method settings - Klarna Slice it settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.klarnasliceit; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C127227] Validate Klarna Slice it surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C127817] Validate fixed fee for Klarna Slice it surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C127818] Validate percentage fee for Klarna Slice it surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C127819] Validate fixed fee and percentage for Klarna Slice it surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C127820] Validate surcharge for Klarna Slice it 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('[C127821] Validate surcharge for Klarna Slice it 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('[C127822] Validate surcharge for Klarna Slice it 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('[C128597] Validate Klarna Slice it 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('[C129200] Validate surcharge for Klarna Slice it 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('[C106918] Validate surcharge for Klarna Slice it 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_mybank_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_mybank_settings.spec.js deleted file mode 100644 index 9d9e9814c..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_mybank_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { test } = require('../../Shared/base-test'); -const { - settingsNames, - fixedFeeAndPercentageOverLimit, percentageFeeOverLimit, fixedFeeOverLimit, - fixedAndPercentageUnderLimit, percentageFeeUnderLimitTest, fixedFeeUnderLimitTest, fixedAndPercentageFeeTest, - percentageFeeTest, fixedFeeTest, noFeeAdded -} = require('../../Shared/mollieUtils'); -const {sharedUrl: {gatewaySettingsRoot}} = require('../../Shared/sharedUrl'); - -test.describe('_Mollie Settings tab_Payment method settings - MyBank settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.mybank; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C420319] Validate MyBank surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C420320] Validate fixed fee for MyBank surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C420321] Validate percentage fee for MyBank surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C420322] Validate fixed fee and percentage for MyBank surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C420323] Validate surcharge for MyBank 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('[C420324] Validate surcharge for MyBank 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('[C420325] Validate surcharge for MyBank 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.skip('[C420326] Validate MyBank 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('[C420327] Validate surcharge for MyBank 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('[C420328] Validate surcharge for MyBank 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_paypal_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_paypal_settings.spec.js deleted file mode 100644 index 0381a1b6a..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_paypal_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -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 - PayPal settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.paypal; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C130886] Validate PayPal surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C130887] Validate fixed fee for PayPal surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C130888] Validate percentage fee for PayPal surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C130889] Validate fixed fee and percentage for PayPal surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C130890] Validate surcharge for Klarna Pay later 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('[C130891] Validate surcharge for PayPal 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('[C130892] Validate surcharge for PayPal 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('[C130893] Validate PayPal 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('[C130894] Validate surcharge for PayPal 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('[C130895] Validate surcharge for PayPal 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_paysafecard_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_paysafecard_settings.spec.js deleted file mode 100644 index 74c67ccfb..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_paysafecard_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -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 - paysafecard settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.paysafecard; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C420131] Validate paysafecard surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C420132] Validate fixed fee for paysafecard surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C420133] Validate percentage fee for paysafecard surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C420134] Validate fixed fee and percentage for paysafecard surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C420135] Validate surcharge for paysafecard 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('[C420136] Validate surcharge for paysafecard 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('[C420137] Validate surcharge for paysafecard 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.skip('[C420138] Validate paysafecard 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('[C420139] Validate surcharge for paysafecard 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('[C420140] Validate surcharge for paysafecard 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_przelewy24_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_przelewy24_settings.spec.js deleted file mode 100644 index 6af7248a6..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_przelewy24_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -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 - Przelewy24 settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.przelewy24; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C129803] Validate Przelewy24 surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C129804] Validate fixed fee for Przelewy24 surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C129805] Validate percentage fee for Przelewy24 surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C129806] Validate fixed fee and percentage for Przelewy24 surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C129807] Validate surcharge for Przelewy24 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('[C129808] Validate surcharge for Przelewy24 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('[C129809] Validate surcharge for Przelewy24 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('[C129810] Validate Przelewy24 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('[C129811] Validate surcharge for Przelewy24 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('[C129812] Validate surcharge for Przelewy24 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_sepa_bank_transfer_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_sepa_bank_transfer_settings.spec.js deleted file mode 100644 index 16bfdbc55..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_sepa_bank_transfer_settings.spec.js +++ /dev/null @@ -1,74 +0,0 @@ -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 - SEPA Bank Transfer settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.banktransfer; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test.skip('[C127228] Validate expiry time for SEPA Bank Transfer', async ({ page}) => { - // Your code here... -}); - - -test('[C136529] Validate Bank Transfer surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C136530] Validate fixed fee for Bank Transfer surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C136531] Validate percentage fee for Bank Transfer surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C136532] Validate fixed fee and percentage for Bank Transfer surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C136533] Validate surcharge for Bank Transfer 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('[C136534] Validate surcharge for Bank Transfer 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('[C136535] Validate surcharge for Bank Transfer 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('[C136536] Validate Bank Transfer 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('[C136537] Validate surcharge for Bank Transfer 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('[C136538] Validate surcharge for Bank Transfer 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/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_sofort_banking_settings.spec.js b/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_sofort_banking_settings.spec.js deleted file mode 100644 index 942e7b5e2..000000000 --- a/tests/e2e/Mollie Settings tab/Payment method settings/_mollie_settings_tab_payment_method_settings_sofort_banking_settings.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -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 - SOFORT Banking settings', () => { - test.beforeEach(async ({page, context, gateways}) => { - context.method = gateways.sofort; - context.tabUrl = gatewaySettingsRoot + context.method.id; - await page.goto(context.tabUrl); - context.surchargeSetting = settingsNames.surcharge(context.method.id); - }); - - -test('[C129201] Validate SOFORT Banking surcharge with no Fee, no fee will be added to total', async ({ page, products, context}) => { - await noFeeAdded(page, context, products); -}); - - -test('[C129493] Validate fixed fee for SOFORT Banking surcharge', async ({ page, products, context}) => { - await fixedFeeTest(page, context, products); -}); - - -test('[C129494] Validate percentage fee for SOFORT Banking it surcharge', async ({ page, products, context}) => { - await percentageFeeTest(page, context, products); -}); - - -test('[C129495] Validate fixed fee and percentage for SOFORT Banking surcharge', async ({ page, products, context}) => { - await fixedAndPercentageFeeTest(page, context, products); -}); - - -test('[C129496] Validate surcharge for SOFORT Banking 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('[C129497] Validate surcharge for SOFORT Banking 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('[C129498] Validate surcharge for SOFORT Banking 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('[C129499] Validate SOFORT Banking 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('[C129500] Validate surcharge for SOFORT Banking 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('[C129501] Validate surcharge for SOFORT Banking 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/e2e/README.md b/tests/e2e/README.md deleted file mode 100644 index 832dbe952..000000000 --- a/tests/e2e/README.md +++ /dev/null @@ -1,13 +0,0 @@ - -### 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/e2e/Shared/base-test.js b/tests/e2e/Shared/base-test.js deleted file mode 100644 index 7bc45e0be..000000000 --- a/tests/e2e/Shared/base-test.js +++ /dev/null @@ -1,8 +0,0 @@ -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 }], -}); diff --git a/tests/e2e/Shared/default.example.json b/tests/e2e/Shared/default.example.json deleted file mode 100644 index fbc67b27c..000000000 --- a/tests/e2e/Shared/default.example.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "url": "http://stagingsite/", - "users": { - "admin": { - "username": "username", - "password": "password" - }, - "customer": { - "username": "customer", - "password": "password" - } - }, - "products": { - "simple": { - "name": "Simple product" - }, - "variable": { - "name": "Variable Product with Three Attributes", - "defaultAttributes": [ - { - "id": 0, - "name": "Size", - "option": "Medium" - }, - { - "id": 0, - "name": "Colour", - "option": "Blue" - } - ], - "attributes": [ - { - "id": 0, - "name": "Colour", - "isVisibleOnProductPage": true, - "isForVariations": true, - "options": [ - "Red", - "Green", - "Blue" - ], - "sortOrder": 0 - }, - { - "id": 0, - "name": "Size", - "isVisibleOnProductPage": true, - "isForVariations": true, - "options": [ - "Small", - "Medium", - "Large" - ], - "sortOrder": 0 - }, - { - "id": 0, - "name": "Logo", - "isVisibleOnProductPage": true, - "isForVariations": true, - "options": [ - "Woo", - "WordPress" - ], - "sortOrder": 0 - } - ] - }, - "variations": [ - { - "regularPrice": "19.99", - "attributes": [ - { - "name": "Size", - "option": "Large" - }, - { - "name": "Colour", - "option": "Red" - } - ] - }, - { - "regularPrice": "18.99", - "attributes": [ - { - "name": "Size", - "option": "Medium" - }, - { - "name": "Colour", - "option": "Green" - } - ] - }, - { - "regularPrice": "17.99", - "attributes": [ - { - "name": "Size", - "option": "Small" - }, - { - "name": "Colour", - "option": "Blue" - } - ] - } - ], - "grouped": { - "name": "Grouped Product with Three Children", - "groupedProducts": [ - { - "name": "Base Unit", - "regularPrice": "29.99" - }, - { - "name": "Add-on A", - "regularPrice": "11.95" - }, - { - "name": "Add-on B", - "regularPrice": "18.97" - } - ] - }, - "external": { - "name": "External product", - "regularPrice": "24.99", - "buttonText": "Buy now", - "externalUrl": "https://wordpress.org/plugins/woocommerce" - } - }, - "coupons": { - "percentage": { - "code": "20percent", - "discountType": "percent", - "amount": "20.00" - } - }, - "addresses": { - "admin": { - "store": { - "firstname": "John", - "lastname": "Doe", - "company": "Automattic", - "country": "United States (US)", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "countryandstate": "United States (US) — California", - "city": "San Francisco", - "state": "CA", - "postcode": "94107" - } - }, - "customer": { - "billing": { - "firstname": "John", - "lastname": "Doe", - "company": "Inpsyde", - "country": "Italy", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "city": "Como", - "state": "CO", - "postcode": "22100", - "phone": "123456789", - "email": "john.doe@example.com" - }, - "shipping": { - "firstname": "John", - "lastname": "Doe", - "company": "Inpsyde", - "country": "Italy", - "addressfirstline": "addr 1", - "addresssecondline": "addr 2", - "city": "Como", - "state": "Co", - "postcode": "22100" - } - } - }, - "onboardingwizard": { - "industry": "Test industry", - "numberofproducts": "1 - 10", - "sellingelsewhere": "No" - }, - "settings": { - "shipping": { - "zonename": "United States", - "zoneregions": "United States (US)", - "shippingmethod": "Free shipping" - } - } -} - diff --git a/tests/e2e/Shared/mollieUtils.js b/tests/e2e/Shared/mollieUtils.js deleted file mode 100644 index 889187f4f..000000000 --- a/tests/e2e/Shared/mollieUtils.js +++ /dev/null @@ -1,404 +0,0 @@ -const {sharedUrl: {mollieSettingsTab}} = require('../Shared/sharedUrl'); -const {loginAdmin, selectOptionSetting, fillNumberSettings} = require("./wpUtils"); -const {wooOrderPaidPage, wooOrderDetailsPageOnPaid, wooOrderRetryPage, wooOrderDetailsPageOnFailed, wooOrderCanceledPage, wooOrderDetailsPageOnCanceled} = require('../Shared/testMollieInWooPage'); -const {addProductToCart, fillCustomerInCheckout} = require('../Shared/wooUtils'); -const {normalizedName} = require("./gateways"); -const {expect} = require("@playwright/test"); -const {fillCustomerInCheckoutBlock, selectPaymentMethodInCheckout, captureTotalAmountCheckout, - captureTotalAmountBlockCheckout -} = require("./wooUtils"); - -const settingsNames = { - surcharge: (method) => `mollie_wc_gateway_${method}_payment_surcharge`, - fixedFee: (method) => `mollie_wc_gateway_${method}_fixed_fee`, - percentage: (method) => `mollie_wc_gateway_${method}_percentage`, - limitFee: (method) => `mollie_wc_gateway_${method}_maximum_limit`, - components: (method) => `mollie_wc_gateway_${method}_mollie_components_enabled`, -} - -const noticeLines = { - paid: (method) => `Order completed using Mollie – ${method} payment`, - open: (method) => `Mollie – ${method} payment still pending`, - 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) => { - await page.getByLabel('Card holder').fill('test'); - - - await page.getByLabel('Card number').fill('4543474002249996'); - await page.locator('iframe[name="expiryDate-input"]').fill('12/25'); - await page.locator('iframe[name="verificationCode-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'; - console.log(page.url().toString()); - if (page.url().toString().startsWith(creditCardUrl)) { - await fillCreditCardForm(page); - 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) => { - for (let i = productQuantity; i >0; i--) { - await addProductToCart(page, testedProduct.sku); - } - - await page.goto(checkoutUrl); - - //Capture WooCommerce total amount - const totalAmount = await captureTotalAmountCheckout(page); - - // CUSTOMER DETAILS - await fillCustomerInCheckout(page); - - // 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}); - } - // 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) => { - for (let i = productQuantity; i >0; i--) { - await addProductToCart(page, testedProduct.sku); - } - - 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}); - } - // 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; -} - -/** - * @param {import('@playwright/test').Page} page - * @param testedProduct - * @param testedGateway - * @param productQuantity - * @param status - */ -const classicCheckoutTransaction = async (page, testedProduct, testedGateway, productQuantity = 1, status = "Paid", checkoutUrl ='/checkout/') => { - let whichCheckout = checkoutUrl === '/checkout/' ? 'classic' : 'block'; - let totalAmount; - if (whichCheckout === 'classic') { - 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 - 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 fixedFeeTest = async (page, context, products) => { - 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); -} - -const percentageFeeTest = async (page, context, products) => { - 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); -} - -const fixedAndPercentageFeeTest = async (page, context, products) => { - 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); -} - -const fixedFeeUnderLimitTest = async (page, context, products) => { - 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); -} - -const percentageFeeUnderLimitTest = async (page, context, products) => { - const fee = 10; - const limit = 30; - 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) - 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); -} - -const fixedAndPercentageUnderLimit = async (page, context, products) => { - const fee = 10; - const limit = 30; - 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) - 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); -} - -const fixedFeeOverLimit = async (page, context, products) => { - 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); -} - -const percentageFeeOverLimit = async (page, context, products) => { - 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); -} - -const fixedFeeAndPercentageOverLimit = async (page, context, products) => { - 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); -} - -const noFeeAdded = async (page, context, products) => { - 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); -} - -module.exports = { - setOrderAPI, - setPaymentAPI, - markStatusInMollie, - insertAPIKeys: insertCorrectAPIKeys, - insertIncorrectAPIKeys, - resetSettings, - beforePlacingOrder, - beforePlacingOrderBlock, - classicCheckoutTransaction, - classicCheckoutPaidTransactionFullRefund, - classicCheckoutPaidTransactionPartialRefund, - checkExpiredAtMollie, - processMollieCheckout, - settingsNames, - noticeLines, - fixedFeeTest, - percentageFeeTest, - fixedAndPercentageFeeTest, - fixedFeeUnderLimitTest, - percentageFeeUnderLimitTest, - fixedAndPercentageUnderLimit, - fixedFeeOverLimit, - percentageFeeOverLimit, - fixedFeeAndPercentageOverLimit, - noFeeAdded -}; diff --git a/tests/e2e/Shared/wooUtils.js b/tests/e2e/Shared/wooUtils.js deleted file mode 100644 index 2c7134459..000000000 --- a/tests/e2e/Shared/wooUtils.js +++ /dev/null @@ -1,152 +0,0 @@ -const path = require("path"); -const fs = require("fs"); -const wooUrls = { - settingsPaymentTab: '/wp-admin/admin.php?page=wc-settings&tab=checkout' -} -async function gotoWPPage(page, url) { - await page.goto(url); -} -async function gotoWooPaymentTab(page) { - await gotoWPPage(page, wooUrls.settingsPaymentTab); -} -/** - * @param {import('@playwright/test').Page} page - * @param productSku - */ -const addProductToCart = async (page, productSku) => { - await page.goto('/shop/'); - await page.locator('[data-product_sku="' + productSku + '"].add_to_cart_button').click() -} - -const emptyCart = async (page) => { - await page.goto('/cart/'); - const canRemove = await page.getByRole('cell', { name: 'Remove this item' }).isVisible(); - if (canRemove) { - await page.getByRole('cell', { name: 'Remove this item' }).click(); - } -} - -/** - * @param {import('@playwright/test').Page} page - */ -const fillCustomerInCheckout = async (page, country = "DE") => { - await page.locator('input[name="billing_first_name"]').fill('Julia'); - await page.locator('input[name="billing_last_name"]').fill('Callas'); - await page.selectOption('select#billing_country', country); - await page.locator('input[name="billing_city"]').fill('Berlin'); - await page.locator('input[name="billing_address_1"]').fill('Calle Drutal'); - await page.locator('input[name="billing_postcode"]').fill('22100'); - await page.locator('input[name="billing_phone"]').fill('1234566788'); - await page.locator('input[name="billing_email"]').fill('test@test.com'); - const canFillCompany = await page.locator('input[name="billing_company"]').isVisible(); - if (canFillCompany) { - await page.locator('input[name="billing_company"]').fill('Test company'); - } - const canFillBirthDate = await page.locator('input[name="billing_birthdate"]').isVisible(); - if (canFillBirthDate) { - await page.locator('input[name="billing_birthdate"]').fill('01-01-1990'); - } -} - -/** - * @param {import('@playwright/test').Page} page - */ -const fillCustomerInCheckoutBlock = async (page, country = 'Germany') => { - await page.getByLabel('First name').fill('Julia'); - await page.getByLabel('Last name').fill('Callas'); - await page.getByLabel('Country/Region').fill(country); - await page.getByLabel('City').fill('Berlin'); - await page.getByLabel('Address', { exact: true }).fill('Calle Drutal'); - await page.getByLabel('Postal code').fill('22100'); - await page.getByLabel('Phone').fill('1234566788'); - await page.getByLabel('Email address').fill('test@test.com'); - const canFillCompany = await page.getByLabel('Company').isVisible(); - if (canFillCompany) { - await page.getByLabel('Company').fill('Test company'); - } - //const canFillBirthDate = await page.locator('input[name="billing_birthdate"]').isVisible(); - /*if (canFillBirthDate) { - await page.locator('input[name="billing_birthdate"]').fill('01-01-1990'); - }*/ -} - -/** - * @param {import('@playwright/test').Page} page - */ -const fillCustomerInBlockCheckout = async (page) => { - // Fill input[name="billing_first_name"] - await page.locator('input[name="billing_first_name"]').fill('Julia'); - // Fill input[name="billing_last_name"] - await page.locator('input[name="billing_last_name"]').fill('Callas'); -} - -const selectPaymentMethodInCheckout = async (page, paymentMethod) => { - await page.getByText(paymentMethod, { exact: true }).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 captureTotalAmountPayPage = async (page) => { - return await page.innerText('.woocommerce-Price-amount.amount > bdi'); -} - -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 createManualOrder = async (page, productLabel = 'Beanie') => { - await page.goto('wp-admin/post-new.php?post_type=shop_order'); - await page.click('text=Add item(s)'); - await page.click('text=Add product(s)'); - await page.getByRole('combobox', { name: 'Search for a product…' }).locator('span').nth(2).click(); - await page.locator('span > .select2-search__field').fill(productLabel); - await page.click('text=' + productLabel); - await page.locator('#btn-ok').click(); - await page.waitForTimeout(2000); - await page.getByRole('button', { name: 'Create' }).click(); - await page.click('text=Customer payment page'); -} - -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'); -} - -module.exports = { - addProductToCart, - fillCustomerInCheckout, - fillCustomerInBlockCheckout, - fillCustomerInCheckoutBlock, - gotoWooPaymentTab, - placeOrderCheckout, - emptyCart, - placeOrderPayPage, - selectPaymentMethodInCheckout, - captureTotalAmountCheckout, - captureTotalAmountBlockCheckout, - captureTotalAmountPayPage, - createManualOrder, - getLogByName -} diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_bancontact.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_bancontact.spec.js deleted file mode 100644 index a0eb0f0d0..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_bancontact.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction, resetSettings, insertAPIKeys, setOrderAPI} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); -test.beforeAll(async ({browser}) => { - // Create a new page instance - const page = await browser.newPage(); - // Reset to the default state - await resetSettings(page); - await insertAPIKeys(page); - // Orders API - await setOrderAPI(page); -}); -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Bancontact', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.bancontact; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420231", - 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: "C420232", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420233", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420234", - 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(`[${testId}] Validate the submission of an order with Bancontact as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_belfius_direct_net.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_belfius_direct_net.spec.js deleted file mode 100644 index 4d7814b8f..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_belfius_direct_net.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Belfius Direct Net', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.belfius; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420299", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420300", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420301", - 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(`[${testId}] Validate the submission of an order with Belfius Direct Net as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_eps.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_eps.spec.js deleted file mode 100644 index c46457571..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_eps.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - EPS', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.eps; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420261", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420262", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420263", - 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(`[${testId}] Validate the submission of an order with EPS as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_giropay.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_giropay.spec.js deleted file mode 100644 index dc3a755ab..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_giropay.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Giropay', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.giropay; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420291", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420292", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420293", - 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(`[${testId}] Validate the submission of an order with Giropay as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_ideal.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_ideal.spec.js deleted file mode 100644 index d2186955f..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_ideal.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - iDEAL', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.ideal; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420245", - 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: "C420246", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420248", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420247", - 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(`[${testId}] Validate the submission of an order with iDEAL as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_kbc_cbc_payment_button.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_kbc_cbc_payment_button.spec.js deleted file mode 100644 index 9b13555e4..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_kbc_cbc_payment_button.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - KBC_CBC Payment Button', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.kbc; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420264", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420265", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420266", - 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(`[${testId}] Validate the submission of an order with KBC_CBC as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_pay_later.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_pay_later.spec.js deleted file mode 100644 index 2b4e5e130..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_pay_later.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Klarna Pay later', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnapaylater; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420250", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420251", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420252", - 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(`[${testId}] Validate the submission of an order with Klarna Pay later as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_pay_now.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_pay_now.spec.js deleted file mode 100644 index e7f4b4fa4..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_pay_now.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Klarna Pay Now', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnapaynow; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420280", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420281", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420282", - 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(`[${testId}] Validate the submission of an order with Klarna Pay Now as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_slice_it.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_slice_it.spec.js deleted file mode 100644 index a5a2e4767..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_klarna_slice_it.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Klarna Slice it', () => { - const productQuantity = 4; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnasliceit; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420224", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420225", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420226", - 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(`[${testId}] Validate the submission of an order with Klarna Slice it as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_mybank.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_mybank.spec.js deleted file mode 100644 index d45a4042a..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_mybank.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - MyBank', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.mybank; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420287", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420288", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420289", - 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(`[${testId}] Validate the submission of an order with MyBank as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_paypal.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_paypal.spec.js deleted file mode 100644 index b3f2ba45a..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_paypal.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - PayPal', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.paypal; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420254", - mollieStatus: "Pending", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.methodName.toLowerCase()), - action: async (page, result, context) => { - await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); - } - }, - { - testId: "C420255", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420256", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420257", - 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(`[${testId}] Validate the submission of an order with PayPal as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_paysafecard.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_paysafecard.spec.js deleted file mode 100644 index ad41092c4..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_paysafecard.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - paysafecard', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.paysafecard; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420307", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420308", - 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(`[${testId}] Validate the submission of an order with paysafecard as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_przelewy24.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_przelewy24.spec.js deleted file mode 100644 index f5e6d8e3e..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_przelewy24.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - Przelewy24', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.przelewy24; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420236", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420237", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420238", - 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(`[${testId}] Validate the submission of an order with Przelewy24 as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_sepa_bank_transfer.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_sepa_bank_transfer.spec.js deleted file mode 100644 index f64059ebc..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_sepa_bank_transfer.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - SEPA Bank Transfer', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.banktransfer; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420283", - 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); - } - }, - { - testId: "C420285", - mollieStatus: "Expired", - wooStatus: "On hold", - notice: context => noticeLines.expired(context.method.id), - action: async (page) => { - await checkExpiredAtMollie(page); - } - }, - ]; - - testData.forEach(({ testId, mollieStatus, wooStatus, notice, action }) => { - test(`[${testId}] Validate the submission of an order with SEPA bank transfer as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_sofort_banking.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_sofort_banking.spec.js deleted file mode 100644 index a9c61ea2f..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Block Checkout/_transaction_scenarios_payment_statuses_-_block_checkout_sofort_banking.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses - Block Checkout - SOFORT Banking', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.sofort; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420229", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420228", - 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(`[${testId}] Validate the submission of an order with SOFORT as payment method and payment mark as "${mollieStatus} on block checkout"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus, sharedUrl.blocksCheckout); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_apple_pay.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_apple_pay.spec.js deleted file mode 100644 index 9f9b7cb4e..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_apple_pay.spec.js +++ /dev/null @@ -1,22 +0,0 @@ -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('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('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/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_bancontact.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_bancontact.spec.js deleted file mode 100644 index 5c4346479..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_bancontact.spec.js +++ /dev/null @@ -1,90 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const { - setOrderAPI, - insertAPIKeys, - resetSettings, - settingsNames, - noticeLines, - classicCheckoutTransaction, checkExpiredAtMollie -} = require('../../Shared/mollieUtils'); -const {wooOrderPaidPage, wooOrderDetailsPage, wooOrderRetryPage} = require("../../Shared/testMollieInWooPage"); -const {normalizedName} = require("../../Shared/gateways"); -const {emptyCart} = require("../../Shared/wooUtils"); - -// Set up parameters or perform actions before all tests -test.beforeAll(async ({browser}) => { - // Create a new page instance - const page = await browser.newPage(); - // Reset to the default state - await resetSettings(page); - await insertAPIKeys(page); - // Orders API - await setOrderAPI(page); -}); -test.describe('_Transaction scenarios_Payment statuses Checkout - Bancontact', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.bancontact; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3388", - 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: "C3389", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3390", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3391", - 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(`[${testId}] Validate the submission of an order with Bancontact as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_belfius_direct_net.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_belfius_direct_net.spec.js deleted file mode 100644 index 434eaca83..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_belfius_direct_net.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Belfius Direct Net', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.belfius; - context.methodName = normalizedName(context.method.defaultTitle); - await page.goto('/shop/'); - await emptyCart(page); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3429", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3430", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3431", - 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(`[${testId}] Validate the submission of an order with Belfius Direct Net as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_billie.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_billie.spec.js deleted file mode 100644 index 18b9bc73d..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_billie.spec.js +++ /dev/null @@ -1,61 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Billie', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.billie; - context.methodName = normalizedName(context.method.defaultTitle); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C354675", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C354676", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C354677", - 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 Billie as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_credit_card.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_credit_card.spec.js deleted file mode 100644 index 2da03bc9d..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_credit_card.spec.js +++ /dev/null @@ -1,116 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction, settingsNames} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {enableCheckboxSetting, disableCheckboxSetting} = require("../../Shared/wpUtils"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Credit card', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.creditcard; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - 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); - } - }, - ]; - - - testData.forEach(({ testId, mollieStatus, wooStatus, notice, action }) => { - test(`[${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 }) => { - //mollie components disabled - const settingsTab = sharedUrl + context.method.id; - const settingsName = settingsNames.components(context.method.id); - await disableCheckboxSetting(page, settingsName, settingsTab); - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - - -//TestId-C3376 -test.skip('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('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('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('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('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('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/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_eps.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_eps.spec.js deleted file mode 100644 index ad2f2a1f1..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_eps.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - EPS', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.eps; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3413", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3414", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3415", - 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(`[${testId}] Validate the submission of an order with Eps as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_gift_cards.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_gift_cards.spec.js deleted file mode 100644 index 416490ba7..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_gift_cards.spec.js +++ /dev/null @@ -1,22 +0,0 @@ -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('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('Validate the submission of an order were the total value is paid with a Gift Card', async ({ page}) => { - // Your code here... -}); - - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_giropay.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_giropay.spec.js deleted file mode 100644 index ceb4438a2..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_giropay.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Giropay', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.giropay; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3421", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3422", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3423", - 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(`[${testId}] Validate the submission of an order with Giropay as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_ideal.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_ideal.spec.js deleted file mode 100644 index b4450a425..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_ideal.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - iDEAL', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.ideal; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3383", - 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: "C3384", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3386", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3385", - 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(`[${testId}] Validate the submission of an order with iDeal as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_in3.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_in3.spec.js deleted file mode 100644 index a9de259b4..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_in3.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - in3', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.in3; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3732", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3733", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3734", - 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 in3 as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_kbc_cbc_payment_button.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_kbc_cbc_payment_button.spec.js deleted file mode 100644 index 3a03dd8c5..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_kbc_cbc_payment_button.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - KBC_CBC Payment Button', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.kbc; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3416", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3417", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3418", - 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(`[${testId}] Validate the submission of an order with KBC as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_pay_later.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_pay_later.spec.js deleted file mode 100644 index b219bdc6a..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_pay_later.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Klarna Pay later', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnapaylater; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3402", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3403", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3404", - 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(`[${testId}] Validate the submission of an order with Klarna Pay later as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_pay_now.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_pay_now.spec.js deleted file mode 100644 index 542a70ea2..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_pay_now.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Klarna Pay Now', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnapaynow; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3398", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3399", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3400", - 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(`[${testId}] Validate the submission of an order with Klarna Pay Now as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_slice_it.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_slice_it.spec.js deleted file mode 100644 index fa8f1cd87..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_klarna_slice_it.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Klarna Slice it', () => { - const productQuantity = 4; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnasliceit; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3409", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3410", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3411", - 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(`[${testId}] Validate the submission of an order with Klarna Slice it as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_mybank.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_mybank.spec.js deleted file mode 100644 index 1867d1720..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_mybank.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - MyBank', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.mybank; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420295", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420296", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420297", - 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(`[${testId}] Validate the submission of an order with MyBank as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_paypal.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_paypal.spec.js deleted file mode 100644 index 20e67553d..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_paypal.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - PayPal', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.paypal; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3393", - mollieStatus: "Pending", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.methodName.toLowerCase()), - action: async (page, result, context) => { - await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); - } - }, - { - testId: "C3394", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3395", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3396", - 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(`[${testId}] Validate the submission of an order with PayPal as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_paysafecard.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_paysafecard.spec.js deleted file mode 100644 index 3b0f29d57..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_paysafecard.spec.js +++ /dev/null @@ -1,55 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - paysafecard', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.paysafecard; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420142", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420143", - 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(`[${testId}] Validate the submission of an order with Paysafecard as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_przelewy24.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_przelewy24.spec.js deleted file mode 100644 index 77d7cc155..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_przelewy24.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - Przelewy24', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.przelewy24; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3425", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3426", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3427", - 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(`[${testId}] Validate the submission of an order with Przelewy24 as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_sepa_bank_transfer.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_sepa_bank_transfer.spec.js deleted file mode 100644 index 2cda88823..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_sepa_bank_transfer.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - SEPA Bank Transfer', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.banktransfer; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - 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); - } - }, - { - testId: "C3434", - mollieStatus: "Expired", - wooStatus: "On hold", - notice: context => noticeLines.expired(context.method.id), - action: async (page) => { - await checkExpiredAtMollie(page); - } - }, - ]; - - - testData.forEach(({ testId, mollieStatus, wooStatus, notice, action }) => { - test(`[${testId}] Validate the submission of an order with SEPA Bank Transfer as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_sofort_banking.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_sofort_banking.spec.js deleted file mode 100644 index 5676df863..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_sofort_banking.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderDetailsPage, wooOrderRetryPage} = require("../../Shared/testMollieInWooPage"); -const {emptyCart} = require("../../Shared/wooUtils"); - -test.describe('_Transaction scenarios_Payment statuses Checkout - SOFORT Banking', () => { - const productQuantity = 1; - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.sofort; - context.methodName = normalizedName(context.method.defaultTitle); - await emptyCart(page); - await page.goto('/shop/'); - }); - const testData = [ - { - 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); - } - }, - { - testId: "C3407", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C3406", - 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(`[${testId}] Validate the submission of an order with SOFORT Banking as payment method and payment mark as "${mollieStatus}"`, async ({ page, products, context }) => { - const result = await classicCheckoutTransaction(page, products.simple, context.method, productQuantity, mollieStatus); - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_voucher.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_voucher.spec.js deleted file mode 100644 index d892c1774..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Checkout/_transaction_scenarios_payment_statuses_checkout_voucher.spec.js +++ /dev/null @@ -1,40 +0,0 @@ -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('Validate the submission of an order with a ECO Voucher and marked as "Paid"', async ({ page}) => { - // Your code here... -}); - - -//TestId-C3436 -test.skip('Validate the submission of an order with a MEAL Voucher and marked as "Paid"', async ({ page}) => { - // Your code here... -}); - - -//TestId-C3437 -test.skip('Validate the submission of an order with a GIFT Voucher and marked as "Paid"', async ({ page}) => { - // Your code here... -}); - - -//TestId-C3440 -test.skip('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('Validate the submission of an order were the total value is paid with a Voucher', async ({ page}) => { - // Your code here... -}); - - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_bancontact.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_bancontact.spec.js deleted file mode 100644 index 1ac6aec5c..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_bancontact.spec.js +++ /dev/null @@ -1,87 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const { execSync } = require('child_process'); -const {selectPaymentMethodInCheckout, placeOrderPayPage, captureTotalAmountPayPage, createManualOrder} = require("../../Shared/wooUtils"); -const {normalizedName} = require("../../Shared/gateways"); -const {noticeLines, checkExpiredAtMollie, classicCheckoutTransaction, processMollieCheckout, - resetSettings, - insertAPIKeys, - setOrderAPI -} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); -const {sharedUrl} = require("../../Shared/sharedUrl"); -test.beforeAll(async ({browser}) => { - // Create a new page instance - const page = await browser.newPage(); - // Reset to the default state - await resetSettings(page); - await insertAPIKeys(page); - // Orders API - await setOrderAPI(page); -}); -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Bancontact', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.bancontact; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420346", - 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: "C420347", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420348", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420349", - mollieStatus: "Expired", - wooStatus: "Cancelled", - notice: context => noticeLines.expired(context.method.id), - action: async (page) => { - await checkExpiredAtMollie(page); - } - }, - ]; - - testData.forEach(({ testId, mollieStatus, wooStatus, notice, action }) => { - test(`[${testId}] Validate the submission of an order with Bancontact as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_belfius_direct_net.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_belfius_direct_net.spec.js deleted file mode 100644 index b2c6ac8b3..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_belfius_direct_net.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Belfius Direct Net', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.belfius; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420410", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420411", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420412", - 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(`[${testId}] Validate the submission of an order with Belfius Direct Net as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_billie.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_billie.spec.js deleted file mode 100644 index d448b89da..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_billie.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Billie', () => { - test.beforeEach(async ({ page }) => { - //code before each - }); - - -//TestId-C420413 -test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Authorized" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -//TestId-C420414 -test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Failed" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -//TestId-C420415 -test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Cancelled" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -//TestId-C420416 -test.skip('Validate the submission of an order with Billie as payment method and payment mark as "Expired" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_eps.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_eps.spec.js deleted file mode 100644 index c1f0de617..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_eps.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - EPS', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.eps; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420376", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420377", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420378", - 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(`[${testId}] Validate the submission of an order with EPS as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_giropay.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_giropay.spec.js deleted file mode 100644 index ad047d5a1..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_giropay.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Giropay', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.giropay; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420406", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420407", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420408", - 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(`[${testId}] Validate the submission of an order with Giropay as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_ideal.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_ideal.spec.js deleted file mode 100644 index 3387cd99d..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_ideal.spec.js +++ /dev/null @@ -1,79 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - iDEAL', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.ideal; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420360", - 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: "C420361", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420363", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420362", - 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(`[${testId}] Validate the submission of an order with iDEAL as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_in3.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_in3.spec.js deleted file mode 100644 index bf2b4fac5..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_in3.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - in3', () => { - test.beforeEach(async ({ page }) => { - //code before each - }); - - -//TestId-C420334 -test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Paid" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -//TestId-C420335 -test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Failed" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -//TestId-C420336 -test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Cancelled" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -//TestId-C420337 -test.skip('Validate the submission of an order with IN3 as payment method and payment mark as "Expired" on pay for order page', async ({ page}) => { - // Your code here... -}); - - -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_kbc_cbc_payment_button.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_kbc_cbc_payment_button.spec.js deleted file mode 100644 index 214d90881..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_kbc_cbc_payment_button.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - KBC_CBC Payment Button', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.kbc; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420380", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420381", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420382", - 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(`[${testId}] Validate the submission of an order with KBC_CBC as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_pay_later.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_pay_later.spec.js deleted file mode 100644 index e68aed768..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_pay_later.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Klarna Pay later', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnapaylater; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420365", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420366", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420367", - 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(`[${testId}] Validate the submission of an order with Klarna Pay Later as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_pay_now.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_pay_now.spec.js deleted file mode 100644 index ec1b143d7..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_pay_now.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Klarna Pay Now', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnapaynow; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420395", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420396", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420397", - 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(`[${testId}] Validate the submission of an order with Klarna Pay Now as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_slice_it.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_slice_it.spec.js deleted file mode 100644 index dab23113c..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_klarna_slice_it.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Klarna Slice it', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.klarnasliceit; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420339", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420340", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420341", - 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(`[${testId}] Validate the submission of an order with Klarna Slice It as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_mybank.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_mybank.spec.js deleted file mode 100644 index 9205aa0c2..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_mybank.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - MyBank', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.mybank; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420402", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420403", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420404", - 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(`[${testId}] Validate the submission of an order with MyBank as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_paypal.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_paypal.spec.js deleted file mode 100644 index 0c73b44a6..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_paypal.spec.js +++ /dev/null @@ -1,78 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - PayPal', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.paypal; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420369", - mollieStatus: "Pending", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.methodName), - action: async (page, result, context) => { - await wooOrderPaidPage(page, result.mollieOrder, result.totalAmount, context.method); - } - }, - { - testId: "C420370", - mollieStatus: "Failed", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420371", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420372", - 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(`[${testId}] Validate the submission of an order with Paypal as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_paysafecard.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_paysafecard.spec.js deleted file mode 100644 index 7e08d6dc2..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_paysafecard.spec.js +++ /dev/null @@ -1,60 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - paysafecard', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.paysafecard; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420418", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420419", - 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(`[${testId}] Validate the submission of an order with paysafecard as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_przelewy24.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_przelewy24.spec.js deleted file mode 100644 index f76e7f5d3..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_przelewy24.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - Przelewy24', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.przelewy24; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420351", - mollieStatus: "Failed", - wooStatus: "Failed", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420352", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420353", - 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(`[${testId}] Validate the submission of an order with P24 as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_sepa_bank_transfer.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_sepa_bank_transfer.spec.js deleted file mode 100644 index 695883d3c..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_sepa_bank_transfer.spec.js +++ /dev/null @@ -1,60 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - SEPA Bank Transfer', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.banktransfer; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - 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); - } - }, - { - testId: "C420400", - mollieStatus: "Expired", - wooStatus: "On hold", - notice: context => noticeLines.expired(context.method.id), - action: async (page) => { - await checkExpiredAtMollie(page); - } - }, - ]; - - testData.forEach(({ testId, mollieStatus, wooStatus, notice, action }) => { - test(`[${testId}] Validate the submission of an order with SEPA bank transfer as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -}); diff --git a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_sofort_banking.spec.js b/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_sofort_banking.spec.js deleted file mode 100644 index 3bfdd8795..000000000 --- a/tests/e2e/Transaction Scenarios/Payment statuses - Pay for order page/_transaction_scenarios_payment_statuses_-_pay_for_order_page_sofort_banking.spec.js +++ /dev/null @@ -1,60 +0,0 @@ -const { expect } = require('@playwright/test'); -const { test } = require('../../Shared/base-test'); -const {normalizedName} = require("../../Shared/gateways"); -const { - createManualOrder, - selectPaymentMethodInCheckout, - captureTotalAmountPayPage, - placeOrderPayPage -} = require("../../Shared/wooUtils"); -const {noticeLines, checkExpiredAtMollie, processMollieCheckout} = require("../../Shared/mollieUtils"); -const {wooOrderPaidPage, wooOrderRetryPage, wooOrderDetailsPage} = require("../../Shared/testMollieInWooPage"); - -test.describe('_Transaction scenarios_Payment statuses - Pay for order page - SOFORT Banking', () => { - test.beforeEach(async ({ page , context, gateways}) => { - context.method = gateways.sofort; - context.methodName = normalizedName(context.method.defaultTitle); - await createManualOrder(page, 'Beanie') - }); - const testData = [ - { - 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); - } - }, - { - testId: "C420344", - mollieStatus: "Canceled", - wooStatus: "Pending payment", - notice: context => noticeLines.failed(context.method.id), - action: async (page) => { - await wooOrderRetryPage(page); - } - }, - { - testId: "C420343", - 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(`[${testId}] Validate the submission of an order with SOFORT as payment method and payment mark as "${mollieStatus} on pay for order page"`, async ({ page, products, context }) => { - await selectPaymentMethodInCheckout(page, context.methodName); - const totalAmount = await captureTotalAmountPayPage(page); - await placeOrderPayPage(page); - const mollieOrder = await processMollieCheckout(page, mollieStatus); - const result = {mollieOrder: mollieOrder, totalAmount: totalAmount}; - await action(page, result, context); - await wooOrderDetailsPage(page, result.mollieOrder, context.method, wooStatus, notice(context)); - }); - }); -});