diff --git a/tests/UI/campaigns/functional/BO/10_payment/01_paymentMethods/01_configureModuleLink.ts b/tests/UI/campaigns/functional/BO/10_payment/01_paymentMethods/01_configureModuleLink.ts index 7aecc0e253708..60e178c5fcfda 100644 --- a/tests/UI/campaigns/functional/BO/10_payment/01_paymentMethods/01_configureModuleLink.ts +++ b/tests/UI/campaigns/functional/BO/10_payment/01_paymentMethods/01_configureModuleLink.ts @@ -7,12 +7,12 @@ import {resetModule} from '@commonTests/BO/modules/moduleManager'; // Import pages // Import BO pages -import boPaymentMethodsPage from '@pages/BO/payment/paymentMethods'; import psCheckPayment from '@pages/BO/modules/psCheckPayment'; import psWirePayment from '@pages/BO/modules/psWirePayment'; import { boDashboardPage, + boPaymentMethodsPage, dataModules, dataPaymentMethods, utilsPlaywright, diff --git a/tests/UI/package-lock.json b/tests/UI/package-lock.json index 969d582bae029..550d6f278f09d 100644 --- a/tests/UI/package-lock.json +++ b/tests/UI/package-lock.json @@ -431,7 +431,7 @@ }, "node_modules/@prestashop-core/ui-testing": { "version": "0.0.12", - "resolved": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#0797367bdf246945932fa3be349b7a99c0171ed1", + "resolved": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#1f50fc63a075b54250cee62f3cd9b1fa91e7d0e8", "license": "MIT", "dependencies": { "@faker-js/faker": "^8.3.1", @@ -8434,7 +8434,7 @@ } }, "@prestashop-core/ui-testing": { - "version": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#0797367bdf246945932fa3be349b7a99c0171ed1", + "version": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#1f50fc63a075b54250cee62f3cd9b1fa91e7d0e8", "from": "@prestashop-core/ui-testing@https://github.com/PrestaShop/ui-testing-library#main", "requires": { "@faker-js/faker": "^8.3.1", diff --git a/tests/UI/pages/BO/payment/paymentMethods/index.ts b/tests/UI/pages/BO/payment/paymentMethods/index.ts deleted file mode 100644 index b55d3d1613734..0000000000000 --- a/tests/UI/pages/BO/payment/paymentMethods/index.ts +++ /dev/null @@ -1,71 +0,0 @@ -import BOBasePage from '@pages/BO/BObasePage'; -import { - type FakerModule, -} from '@prestashop-core/ui-testing'; - -import type {Page} from 'playwright'; - -/** - * BO Payment preferences page, contains texts, selectors and functions to use on the page. - * @class - * @extends BOBasePage - */ -class PaymentMethodsPage extends BOBasePage { - public readonly pageTitle: string; - - private readonly tablePayments: string; - - private readonly tablePaymentsRow: string; - - private readonly tablePaymentsRowName: (name: string) => string; - - private readonly tablePaymentsBtnConfigure: (name: string) => string; - - /** - * @constructs - * Setting up texts and selectors to use - */ - constructor() { - super(); - - this.pageTitle = `Payment methods • ${global.INSTALL.SHOP_NAME}`; - this.tablePayments = '.card-body .module-item-list'; - this.tablePaymentsRow = `${this.tablePayments} div.row`; - this.tablePaymentsRowName = (name: string) => `${this.tablePaymentsRow}[data-name="${name}"]`; - this.tablePaymentsBtnConfigure = (name: string) => `${this.tablePaymentsRowName(name)} div:nth-child(3) a.btn`; - } - - /* - Methods - */ - /** - * Returns the number of active payments - * @param page {Page} Browser tab - * @returns {Promise} - */ - async getCountActivePayments(page: Page): Promise { - return page.locator(this.tablePaymentsRow).count(); - } - - /** - * Returns if the active payment has a "Configure" button - * @param page {Page} Browser tab - * @param module {FakerModule} Module - * @returns {Promise} - */ - async hasConfigureButton(page: Page, module: FakerModule): Promise { - return (await page.locator(this.tablePaymentsBtnConfigure(module.tag)).count()) === 1; - } - - /** - * Click on the "Configure" button - * @param page {Page} Browser tab - * @param module {FakerModule} Module - * @returns {Promise} - */ - async clickConfigureButton(page: Page, module: FakerModule): Promise { - await page.locator(this.tablePaymentsBtnConfigure(module.tag)).click(); - } -} - -export default new PaymentMethodsPage();