From ef5e9f7516227fa5cabb491034840b5a74191d74 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 19:29:13 +0200 Subject: [PATCH 01/16] tmp --- .../order-management-suite-1.cy.ts | 48 +++++++++---------- .../return-management-suite-1.cy.ts | 8 ++-- .../marketplace-agent-assist-suite-1.cy.ts | 18 +++---- .../marketplace-agent-assist-suite-2.cy.ts | 10 ++-- .../e2e/yves/checkout/checkout-suite-1.cy.ts | 6 +-- .../e2e/yves/comments/comments-suite-1.cy.ts | 6 +-- cypress/support/commands.js | 2 +- cypress/support/pages/abstract-page.ts | 12 ++--- .../pages/backoffice/index/index-page.ts | 9 +--- .../backoffice/index/index-repository.ts | 2 +- .../pages/backoffice/login/login-page.ts | 10 ++-- .../backoffice/login/login-repository.ts | 2 +- .../create/merchant-user-create-page.ts | 10 ++-- .../create/merchant-user-create-repository.ts | 2 +- .../merchant/create/merchant-create-page.ts | 12 ++--- .../create/merchant-create-repository.ts | 2 +- .../merchant/list/merchant-list-page.ts | 10 ++-- .../merchant/list/merchant-list-repository.ts | 2 +- .../merchant/update/merchant-update-page.ts | 10 ++-- .../update/merchant-update-repository.ts | 2 +- .../create/sales-return-gui-create-page.ts | 4 +- .../sales-return-gui-create-repository.ts | 2 +- .../sales/detail/sales-detail-page.ts | 4 +- .../sales/detail/sales-detail-repository.ts | 2 +- .../sales/index/sales-index-page.ts | 10 ++-- .../sales/index/sales-index-repository.ts | 2 +- .../user/create/user-create-page.ts | 4 +- .../user/create/user-create-repository.ts | 2 +- .../user/delete/user-delete-page.ts | 4 +- .../user/delete/user-delete-repository.ts | 2 +- .../backoffice/user/index/user-index-page.ts | 4 +- .../user/index/user-index-repository.ts | 2 +- .../user/update/user-update-page.ts | 4 +- .../user/update/user-update-repository.ts | 2 +- .../agent-dashboard/agent-dashboard-page.ts | 4 +- .../agent-dashboard-repository.ts | 2 +- .../pages/mp/agent-login/agent-login-page.ts | 4 +- .../mp/agent-login/agent-login-repository.ts | 2 +- .../pages/mp/dashboard/dashboard-page.ts | 4 +- .../mp/dashboard/dashboard-repository.ts | 2 +- cypress/support/pages/mp/login/login-page.ts | 4 +- .../pages/mp/login/login-repository.ts | 2 +- .../support/pages/mp/offers/offers-page.ts | 4 +- .../pages/mp/offers/offers-repository.ts | 2 +- .../pages/mp/products/products-page.ts | 4 +- .../pages/mp/products/products-repository.ts | 2 +- .../support/pages/mp/profile/profile-page.ts | 4 +- .../pages/mp/profile/profile-repository.ts | 2 +- .../pages/mp/sales/sales-orders-page.ts | 4 +- .../pages/mp/sales/sales-orders-repository.ts | 2 +- .../yves/agent-login/agent-login-page.ts | 5 +- cypress/support/pages/yves/cart/cart-page.ts | 13 ++--- .../checkout/address/checkout-address-page.ts | 5 +- .../customer/checkout-customer-page.ts | 5 +- .../checkout/payment/checkout-payment-page.ts | 5 +- .../shipment/checkout-shipment-page.ts | 5 +- .../checkout/summary/checkout-summary-page.ts | 5 +- .../yves/comment/cart/comment-cart-page.ts | 7 ++- .../support/pages/yves/login/login-page.ts | 5 +- .../pages/yves/multi-cart/multi-cart-page.ts | 5 +- .../backoffice/user-login-scenario.ts | 2 +- .../impersonate-as-merchant-user-scenario.ts | 10 ++-- .../mp/merchant-agent-login-user-scenario.ts | 2 +- .../mp/merchant-user-login-scenario.ts | 2 +- .../scenarios/yves/agent-login-scenario.ts | 2 +- .../scenarios/yves/checkout-mp-scenario.ts | 2 +- .../scenarios/yves/checkout-scenario.ts | 2 +- .../scenarios/yves/customer-login-scenario.ts | 2 +- cypress/support/utils/index.ts | 1 + cypress/support/utils/inversify/index.ts | 3 ++ tsconfig.json | 8 +++- 71 files changed, 175 insertions(+), 200 deletions(-) create mode 100644 cypress/support/utils/index.ts create mode 100644 cypress/support/utils/inversify/index.ts diff --git a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts index 1bf401ee..4375145d 100644 --- a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts @@ -1,19 +1,19 @@ -import { CartPage } from '../../../support/pages/yves'; -import { CheckoutScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; -import { container } from '../../../support/utils/inversify/inversify.config'; +import { SalesIndexPage } from '@pages/backoffice'; +import { CartPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { container } from '@utils'; import { OrderManagementStaticFixtures, OrderManagementSuite1DynamicFixtures, } from '../../../support/types/backoffice/order-managment/fixture-types'; -import { UserLoginScenario } from '../../../support/scenarios/backoffice'; -import { SalesIndexPage } from '../../../support/pages/backoffice'; describe('order management suite 1', { tags: ['@order-management'] }, (): void => { - const cartPage: CartPage = container.get(CartPage); - const salesIndexPage: SalesIndexPage = container.get(SalesIndexPage); - const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - const checkoutScenario: CheckoutScenario = container.get(CheckoutScenario); - const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); + const cartPage = container.get(CartPage); + const salesIndexPage = container.get(SalesIndexPage); + const loginCustomerScenario = container.get(CustomerLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + const userLoginScenario = container.get(UserLoginScenario); let staticFixtures: OrderManagementStaticFixtures; let dynamicFixtures: OrderManagementSuite1DynamicFixtures; @@ -25,25 +25,25 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = it('should be able to create an order by existing customer', (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); - cy.contains('Your order has been placed successfully!'); + // checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); + // cy.contains('Your order has been placed successfully!'); - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - salesIndexPage.viewLastPlacedOrder(); + // userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + // salesIndexPage.viewLastPlacedOrder(); - cy.get('body').contains(dynamicFixtures.product.name); + // cy.get('body').contains(dynamicFixtures.product.name); }); - it('should be able to create an order by guest', (): void => { - cartPage.visit(); - cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); + // it('should be able to create an order by guest', (): void => { + // cartPage.visit(); + // cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); - checkoutScenario.execute(true); - cy.contains('Your order has been placed successfully!'); + // checkoutScenario.execute(true); + // cy.contains('Your order has been placed successfully!'); - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - salesIndexPage.viewLastPlacedOrder(); + // userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + // salesIndexPage.viewLastPlacedOrder(); - cy.get('body').contains(dynamicFixtures.product.name); - }); + // cy.get('body').contains(dynamicFixtures.product.name); + // }); }); diff --git a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts index f4d1a76a..b8cd7f5a 100644 --- a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts @@ -1,7 +1,7 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '../../../support/pages/backoffice'; -import { CheckoutScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; -import { UserLoginScenario } from '../../../support/scenarios/backoffice'; +import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { container } from '@utils'; import { ReturnManagementStaticFixtures, ReturnManagementSuite1DynamicFixtures, diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts index cf2a2af7..827dcf4f 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts @@ -1,18 +1,18 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { IndexPage, UserIndexPage, UserUpdatePage } from '../../../support/pages/backoffice'; -import { UserLoginScenario } from '../../../support/scenarios/backoffice'; -import { AgentLoginPage, LoginPage } from '../../../support/pages/yves'; -import { - MarketplaceAgentAssistStaticFixtures, - MarketplaceAgentAssistSuite1DynamicFixtures, -} from '../../../support/types/mp/marketplace-agent-assist/fixture-types'; +import { IndexPage, UserIndexPage, UserUpdatePage } from '@pages/backoffice'; +import { AgentLoginPage, LoginPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { container } from '@utils'; import { AgentDashboardPage, DashboardPage, - LoginPage as MpLoginPage, AgentLoginPage as MpAgentLoginPage, + LoginPage as MpLoginPage, } from '../../../support/pages/mp'; import { ImpersonateAsMerchantUserScenario, MerchantAgentLoginUserScenario } from '../../../support/scenarios/mp'; +import { + MarketplaceAgentAssistStaticFixtures, + MarketplaceAgentAssistSuite1DynamicFixtures, +} from '../../../support/types/mp/marketplace-agent-assist/fixture-types'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts index 8a06a6c1..459fb401 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts @@ -1,10 +1,10 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CartPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CheckoutMpScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { container } from '@utils'; import { OffersPage, ProductsPage, ProfilePage, SalesOrdersPage } from '../../../support/pages/mp'; -import { SalesDetailPage, SalesIndexPage } from '../../../support/pages/backoffice'; -import { UserLoginScenario } from '../../../support/scenarios/backoffice'; import { ImpersonateAsMerchantUserScenario } from '../../../support/scenarios/mp'; -import { CheckoutMpScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; -import { CartPage } from '../../../support/pages/yves'; import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite2DynamicFixtures, diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts index 1e0f18ee..d78a26a6 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -1,10 +1,10 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { CartPage } from '../../../support/pages/yves'; +import { CartPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { container } from '@utils'; import { CheckoutStaticFixtures, CheckoutSuite1DynamicFixtures, } from '../../../support/types/yves/checkout/fixture-types'; -import { CheckoutScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { const cartPage: CartPage = container.get(CartPage); diff --git a/cypress/e2e/yves/comments/comments-suite-1.cy.ts b/cypress/e2e/yves/comments/comments-suite-1.cy.ts index a7cfe71e..67653952 100644 --- a/cypress/e2e/yves/comments/comments-suite-1.cy.ts +++ b/cypress/e2e/yves/comments/comments-suite-1.cy.ts @@ -1,6 +1,6 @@ -import { CommentCartPage, MultiCartPage } from '../../../support/pages/yves'; -import { CustomerLoginScenario } from '../../../support/scenarios/yves'; -import { container } from '../../../support/utils/inversify/inversify.config'; +import { CommentCartPage, MultiCartPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { container } from '@utils'; import { CommentsSuite1DynamicFixtures, CommentsSuite1StaticFixtures, diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 6d46d888..1582817a 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -80,7 +80,7 @@ Cypress.Commands.add('resetMerchantPortalCookies', () => { Cypress.Commands.add('reloadUntilFound', (url, findSelector, getSelector = 'body', retries = 3, retryWait = 1000) => { if (retries === 0) { - throw `exhausted retries looking for ${selector} on ${url}`; + throw `exhausted retries looking for ${getSelector} on ${url}`; } cy.visit(url); diff --git a/cypress/support/pages/abstract-page.ts b/cypress/support/pages/abstract-page.ts index 244e8fba..d53e0b68 100644 --- a/cypress/support/pages/abstract-page.ts +++ b/cypress/support/pages/abstract-page.ts @@ -1,15 +1,11 @@ -import 'reflect-metadata'; -import { Faker, faker } from '@faker-js/faker'; +import { faker } from '@faker-js/faker'; import { injectable } from 'inversify'; +import 'reflect-metadata'; @injectable() export class AbstractPage { - protected PAGE_URL: string = ''; - protected faker: Faker; - - constructor() { - this.faker = faker; - } + protected PAGE_URL = ''; + protected faker = faker; public assertPageLocation = (): void => { cy.url({ timeout: 4000 }).should('include', this.PAGE_URL); diff --git a/cypress/support/pages/backoffice/index/index-page.ts b/cypress/support/pages/backoffice/index/index-page.ts index 116b2542..51bca858 100644 --- a/cypress/support/pages/backoffice/index/index-page.ts +++ b/cypress/support/pages/backoffice/index/index-page.ts @@ -1,15 +1,10 @@ -import { inject, injectable } from 'inversify'; +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; import 'reflect-metadata'; -import { IndexRepository } from './index-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { BackofficePage } from '../backoffice-page'; @injectable() @autoWired export class IndexPage extends BackofficePage { protected PAGE_URL: string = '/'; - - constructor(@inject(IndexRepository) private repository: IndexRepository) { - super(); - } } diff --git a/cypress/support/pages/backoffice/index/index-repository.ts b/cypress/support/pages/backoffice/index/index-repository.ts index 64c55a7b..764c886f 100644 --- a/cypress/support/pages/backoffice/index/index-repository.ts +++ b/cypress/support/pages/backoffice/index/index-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/login/login-page.ts b/cypress/support/pages/backoffice/login/login-page.ts index 107ae588..033ac2f0 100644 --- a/cypress/support/pages/backoffice/login/login-page.ts +++ b/cypress/support/pages/backoffice/login/login-page.ts @@ -1,17 +1,15 @@ -import { LoginRepository } from './login-repository'; +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { BackofficePage } from '../backoffice-page'; +import { LoginRepository } from './login-repository'; @injectable() @autoWired export class LoginPage extends BackofficePage { - protected PAGE_URL: string = '/security-gui/login'; + @inject(LoginRepository) private repository: LoginRepository; - constructor(@inject(LoginRepository) private repository: LoginRepository) { - super(); - } + protected PAGE_URL: string = '/security-gui/login'; public login = (username: string, password: string): void => { this.repository.getEmailInput().clear().type(username); diff --git a/cypress/support/pages/backoffice/login/login-repository.ts b/cypress/support/pages/backoffice/login/login-repository.ts index c46feee0..fae597bc 100644 --- a/cypress/support/pages/backoffice/login/login-repository.ts +++ b/cypress/support/pages/backoffice/login/login-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts index 00bb4de1..711c9c42 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts @@ -1,17 +1,15 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MerchantUserCreateRepository } from './merchant-user-create-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { MerchantUserCreateRepository } from './merchant-user-create-repository'; @injectable() @autoWired export class MerchantUserCreatePage extends BackofficePage { - protected PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; + @inject(MerchantUserCreateRepository) private repository: MerchantUserCreateRepository; - constructor(@inject(MerchantUserCreateRepository) private repository: MerchantUserCreateRepository) { - super(); - } + protected PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; public createMerchantUser = () => { const uniquePrefix: string = this.faker.number.int({ min: 1000, max: 9999 }).toString(); diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts index ae216de4..01b34b4a 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts index 159f5c0b..a1833ef1 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts @@ -1,20 +1,18 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MerchantCreateRepository } from './merchant-create-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { MerchantCreateRepository } from './merchant-create-repository'; @injectable() @autoWired export class MerchantCreatePage extends BackofficePage { - protected PAGE_URL: string = '/merchant-gui/create-merchant'; + @inject(MerchantCreateRepository) private repository: MerchantCreateRepository; - constructor(@inject(MerchantCreateRepository) private repository: MerchantCreateRepository) { - super(); - } + protected PAGE_URL = '/merchant-gui/create-merchant'; public createMerchant = () => { - const identifier: string = this.faker.string.uuid(); + const identifier = this.faker.string.uuid(); const merchant = { name: 'Name: ' + identifier, diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts index 74d3d464..be79965c 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts index 5f7a322a..cc495182 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts @@ -1,17 +1,15 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MerchantListRepository } from './merchant-list-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { MerchantListRepository } from './merchant-list-repository'; @injectable() @autoWired export class MerchantListPage extends BackofficePage { - protected PAGE_URL: string = '/merchant-gui/list-merchant'; + @inject(MerchantListRepository) private repository: MerchantListRepository; - constructor(@inject(MerchantListRepository) private repository: MerchantListRepository) { - super(); - } + protected PAGE_URL: string = '/merchant-gui/list-merchant'; public editMerchant = (query: string): void => { this.findMerchant(query).find(this.repository.getEditButtonSelector()).click(); diff --git a/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts index 73712ca3..7417a3f8 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts index fb26990f..58c819c0 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -1,17 +1,15 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MerchantUpdateRepository } from './merchant-update-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { MerchantUpdateRepository } from './merchant-update-repository'; @injectable() @autoWired export class MerchantUpdatePage extends BackofficePage { - protected PAGE_URL: string = '/merchant-gui/edit-merchant'; + @inject(MerchantUpdateRepository) private repository: MerchantUpdateRepository; - constructor(@inject(MerchantUpdateRepository) private repository: MerchantUpdateRepository) { - super(); - } + protected PAGE_URL: string = '/merchant-gui/edit-merchant'; public findUser = (email: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); diff --git a/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts index 2319ebea..eddd4b44 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts index 66fc1aec..06b1b4c1 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { SalesReturnGuiCreateRepository } from './sales-return-gui-create-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { SalesReturnGuiCreateRepository } from './sales-return-gui-create-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts index e8ec874a..a0e06027 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts index 244a7b39..3b8182b2 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -1,9 +1,9 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { SalesDetailRepository } from './sales-detail-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { CliHelper } from '../../../../helpers/cli-helper'; import { BackofficePage } from '../../backoffice-page'; +import { SalesDetailRepository } from './sales-detail-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts index 30fe1ae1..f30b925b 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts index 6444565e..f832d62b 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts @@ -1,17 +1,15 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { SalesIndexRepository } from './sales-index-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { SalesIndexRepository } from './sales-index-repository'; @injectable() @autoWired export class SalesIndexPage extends BackofficePage { - protected PAGE_URL: string = '/sales'; + @inject(SalesIndexRepository) private repository: SalesIndexRepository; - constructor(@inject(SalesIndexRepository) private repository: SalesIndexRepository) { - super(); - } + protected PAGE_URL: string = '/sales'; public viewLastPlacedOrder = (): void => { cy.visitBackoffice(this.PAGE_URL); diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts index e30b4f4d..e587d5b6 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/create/user-create-page.ts b/cypress/support/pages/backoffice/user/create/user-create-page.ts index a2acdcec..d4db9e57 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { UserCreateRepository } from './user-create-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { UserCreateRepository } from './user-create-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/create/user-create-repository.ts b/cypress/support/pages/backoffice/user/create/user-create-repository.ts index 70f9332f..398841d7 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-repository.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts index c79e5b12..1cac0c6a 100644 --- a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { UserDeleteRepository } from './user-delete-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { UserDeleteRepository } from './user-delete-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts b/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts index 808a5f06..c1af9b8b 100644 --- a/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/index/user-index-page.ts b/cypress/support/pages/backoffice/user/index/user-index-page.ts index 1ab0e093..f8662587 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-page.ts @@ -1,8 +1,8 @@ -import { UserIndexRepository } from './user-index-repository'; +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { UserIndexRepository } from './user-index-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/index/user-index-repository.ts b/cypress/support/pages/backoffice/user/index/user-index-repository.ts index 6dee5d86..3e14550c 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-repository.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/update/user-update-page.ts b/cypress/support/pages/backoffice/user/update/user-update-page.ts index 967c850c..cfbe7495 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-page.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-page.ts @@ -1,8 +1,8 @@ -import { UserUpdateRepository } from './user-update-repository'; +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; +import { UserUpdateRepository } from './user-update-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/update/user-update-repository.ts b/cypress/support/pages/backoffice/user/update/user-update-repository.ts index 97a77854..a2e15423 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-repository.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts index f9f8c2ae..71b18cd4 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { AgentDashboardRepository } from './agent-dashboard-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { AgentDashboardRepository } from './agent-dashboard-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts index 4b43e69c..809b9ae1 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/agent-login/agent-login-page.ts b/cypress/support/pages/mp/agent-login/agent-login-page.ts index 6f55d046..133aa5a9 100644 --- a/cypress/support/pages/mp/agent-login/agent-login-page.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { AgentLoginRepository } from './agent-login-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { AgentLoginRepository } from './agent-login-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/agent-login/agent-login-repository.ts b/cypress/support/pages/mp/agent-login/agent-login-repository.ts index e6596888..6e51a6fa 100644 --- a/cypress/support/pages/mp/agent-login/agent-login-repository.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/dashboard/dashboard-page.ts b/cypress/support/pages/mp/dashboard/dashboard-page.ts index 3b7073e9..22d12471 100644 --- a/cypress/support/pages/mp/dashboard/dashboard-page.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { DashboardRepository } from './dashboard-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { DashboardRepository } from './dashboard-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/dashboard/dashboard-repository.ts b/cypress/support/pages/mp/dashboard/dashboard-repository.ts index 508da501..ba9465d8 100644 --- a/cypress/support/pages/mp/dashboard/dashboard-repository.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/login/login-page.ts b/cypress/support/pages/mp/login/login-page.ts index b5ae5341..217c8deb 100644 --- a/cypress/support/pages/mp/login/login-page.ts +++ b/cypress/support/pages/mp/login/login-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { LoginRepository } from './login-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { LoginRepository } from './login-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/login/login-repository.ts b/cypress/support/pages/mp/login/login-repository.ts index 66e8fb3d..073c81eb 100644 --- a/cypress/support/pages/mp/login/login-repository.ts +++ b/cypress/support/pages/mp/login/login-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/offers/offers-page.ts b/cypress/support/pages/mp/offers/offers-page.ts index 4330c2ee..c98f4263 100644 --- a/cypress/support/pages/mp/offers/offers-page.ts +++ b/cypress/support/pages/mp/offers/offers-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { OffersRepository } from './offers-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { OffersRepository } from './offers-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/offers/offers-repository.ts b/cypress/support/pages/mp/offers/offers-repository.ts index 3e9e4259..65b2e52d 100644 --- a/cypress/support/pages/mp/offers/offers-repository.ts +++ b/cypress/support/pages/mp/offers/offers-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/products/products-page.ts b/cypress/support/pages/mp/products/products-page.ts index 32060228..3997df76 100644 --- a/cypress/support/pages/mp/products/products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { ProductsRepository } from './products-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { ProductsRepository } from './products-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/products/products-repository.ts b/cypress/support/pages/mp/products/products-repository.ts index b68dd419..9e315849 100644 --- a/cypress/support/pages/mp/products/products-repository.ts +++ b/cypress/support/pages/mp/products/products-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/profile/profile-page.ts b/cypress/support/pages/mp/profile/profile-page.ts index 310c6dc1..7a245681 100644 --- a/cypress/support/pages/mp/profile/profile-page.ts +++ b/cypress/support/pages/mp/profile/profile-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { ProfileRepository } from './profile-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { ProfileRepository } from './profile-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/profile/profile-repository.ts b/cypress/support/pages/mp/profile/profile-repository.ts index 50880b6c..677ad882 100644 --- a/cypress/support/pages/mp/profile/profile-repository.ts +++ b/cypress/support/pages/mp/profile/profile-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/sales/sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts index d27900f0..f4605f87 100644 --- a/cypress/support/pages/mp/sales/sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -1,8 +1,8 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { SalesOrdersRepository } from './sales-orders-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; +import { SalesOrdersRepository } from './sales-orders-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/sales/sales-orders-repository.ts b/cypress/support/pages/mp/sales/sales-orders-repository.ts index 58f2e662..1a208eff 100644 --- a/cypress/support/pages/mp/sales/sales-orders-repository.ts +++ b/cypress/support/pages/mp/sales/sales-orders-repository.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/agent-login/agent-login-page.ts b/cypress/support/pages/yves/agent-login/agent-login-page.ts index deff202c..13f4de2e 100644 --- a/cypress/support/pages/yves/agent-login/agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../utils/inversify/types'; import 'reflect-metadata'; -import { AgentLoginRepository } from './agent-login-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { YvesPage } from '../yves-page'; +import { AgentLoginRepository } from './agent-login-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index cc7df5a3..23925513 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -1,18 +1,15 @@ -import 'reflect-metadata'; +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../utils/inversify/types'; -import { CartRepository } from './cart-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; +import 'reflect-metadata'; import { YvesPage } from '../yves-page'; +import { CartRepository } from './cart-repository'; @injectable() @autoWired export class CartPage extends YvesPage { - protected PAGE_URL: string = '/cart'; + @inject(TYPES.CartRepository) private repository: CartRepository; - constructor(@inject(TYPES.CartRepository) private repository: CartRepository) { - super(); - } + protected PAGE_URL: string = '/cart'; public quickAddToCart = (sku: string, quantity?: number): void => { this.repository.getQuickAddToCartSkuField().clear().type(sku); diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts index 9acbd647..180db432 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { CheckoutAddressRepository } from './checkout-address-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { YvesPage } from '../../yves-page'; +import { CheckoutAddressRepository } from './checkout-address-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts index c15638f9..cbaf0ab6 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { TYPES } from '../../../../utils/inversify/types'; -import { CheckoutCustomerRepository } from './checkout-customer-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { YvesPage } from '../../yves-page'; +import { CheckoutCustomerRepository } from './checkout-customer-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts index 17eebe72..c7b2670c 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { CheckoutPaymentRepository } from './checkout-payment-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { YvesPage } from '../../yves-page'; +import { CheckoutPaymentRepository } from './checkout-payment-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts index 98337d8c..d5d53e76 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { CheckoutShipmentRepository } from './checkout-shipment-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { YvesPage } from '../../yves-page'; +import { CheckoutShipmentRepository } from './checkout-shipment-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts index 16c2c768..9a731061 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { CheckoutSummaryRepository } from './checkout-summary-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; import { YvesPage } from '../../yves-page'; +import { CheckoutSummaryRepository } from './checkout-summary-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts index 6d291dfc..87dab595 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -1,9 +1,8 @@ -import 'reflect-metadata'; +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../../utils/inversify/types'; -import { CommentCartRepository } from './comment-cart-repository'; -import { autoWired } from '../../../../utils/inversify/auto-wired'; +import 'reflect-metadata'; import { YvesPage } from '../../yves-page'; +import { CommentCartRepository } from './comment-cart-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/login/login-page.ts b/cypress/support/pages/yves/login/login-page.ts index 247908dc..17dcf1a3 100644 --- a/cypress/support/pages/yves/login/login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../utils/inversify/types'; import 'reflect-metadata'; -import { LoginRepository } from './login-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { YvesPage } from '../yves-page'; +import { LoginRepository } from './login-repository'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts index 6b1c2ada..46e9e0fb 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -1,9 +1,8 @@ +import { TYPES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { TYPES } from '../../../utils/inversify/types'; import 'reflect-metadata'; -import { MultiCartRepository } from './multi-cart-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; import { YvesPage } from '../yves-page'; +import { MultiCartRepository } from './multi-cart-repository'; @injectable() @autoWired diff --git a/cypress/support/scenarios/backoffice/user-login-scenario.ts b/cypress/support/scenarios/backoffice/user-login-scenario.ts index e8f3f8d1..eac21624 100644 --- a/cypress/support/scenarios/backoffice/user-login-scenario.ts +++ b/cypress/support/scenarios/backoffice/user-login-scenario.ts @@ -1,5 +1,5 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { autoWired } from '../../utils/inversify/auto-wired'; import { LoginPage } from '../../pages/backoffice'; @injectable() diff --git a/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts b/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts index 2fcc9ac7..81534e98 100644 --- a/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts +++ b/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts @@ -1,14 +1,12 @@ +import { AgentDashboardPage, AgentLoginPage } from '@pages/mp'; +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { autoWired } from '../../utils/inversify/auto-wired'; -import { AgentDashboardPage, AgentLoginPage } from '../../pages/mp'; @injectable() @autoWired export class ImpersonateAsMerchantUserScenario { - constructor( - @inject(AgentLoginPage) private agentLoginPage: AgentLoginPage, - @inject(AgentDashboardPage) private mpAgentDashboardPage: AgentDashboardPage - ) {} + @inject(AgentLoginPage) private agentLoginPage: AgentLoginPage; + @inject(AgentDashboardPage) private mpAgentDashboardPage: AgentDashboardPage; public execute = (username: string, password: string, merchantUsername: string): void => { this.agentLoginPage.visit(); diff --git a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts index 09e8d8c3..85c662b6 100644 --- a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts @@ -1,5 +1,5 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { autoWired } from '../../utils/inversify/auto-wired'; import { AgentLoginPage } from '../../pages/mp'; @injectable() diff --git a/cypress/support/scenarios/mp/merchant-user-login-scenario.ts b/cypress/support/scenarios/mp/merchant-user-login-scenario.ts index cafa2257..8d396d8f 100644 --- a/cypress/support/scenarios/mp/merchant-user-login-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-user-login-scenario.ts @@ -1,5 +1,5 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { autoWired } from '../../utils/inversify/auto-wired'; import { LoginPage } from '../../pages/mp'; @injectable() diff --git a/cypress/support/scenarios/yves/agent-login-scenario.ts b/cypress/support/scenarios/yves/agent-login-scenario.ts index 747bcf66..ad618f1d 100644 --- a/cypress/support/scenarios/yves/agent-login-scenario.ts +++ b/cypress/support/scenarios/yves/agent-login-scenario.ts @@ -1,5 +1,5 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { autoWired } from '../../utils/inversify/auto-wired'; import { AgentLoginPage } from '../../pages/yves'; @injectable() diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index 3f01b64c..c19cfc88 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../utils/inversify/auto-wired'; import { CliHelper } from '../../helpers/cli-helper'; import { CartPage, diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 305a9485..0f710af6 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { autoWired } from '../../utils/inversify/auto-wired'; import { CliHelper } from '../../helpers/cli-helper'; import { CartPage, diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index b24e39ae..36715779 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -1,6 +1,6 @@ +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import { LoginPage } from '../../pages/yves'; -import { autoWired } from '../../utils/inversify/auto-wired'; @injectable() @autoWired diff --git a/cypress/support/utils/index.ts b/cypress/support/utils/index.ts new file mode 100644 index 00000000..2d0ff09e --- /dev/null +++ b/cypress/support/utils/index.ts @@ -0,0 +1 @@ +export * from './inversify'; diff --git a/cypress/support/utils/inversify/index.ts b/cypress/support/utils/inversify/index.ts new file mode 100644 index 00000000..7dc416b0 --- /dev/null +++ b/cypress/support/utils/inversify/index.ts @@ -0,0 +1,3 @@ +export * from './auto-wired'; +export * from './inversify.config'; +export * from './types'; diff --git a/tsconfig.json b/tsconfig.json index 0d9b7d5a..af71afdd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,13 @@ "moduleResolution": "node", "experimentalDecorators": true, "emitDecoratorMetadata": true, - "baseUrl": "./" + "strictPropertyInitialization": false, + "baseUrl": "./", + "paths": { + "@pages/*": ["cypress/support/pages/*/index.ts"], + "@utils": ["cypress/support/utils/index.ts"], + "@scenarios/*": ["cypress/support/scenarios/*/index.ts"] + } }, "include": ["cypress/**/*.ts", "cypress.config.ts", "cypress/support/commands.js", "cypress/support/e2e.js"] } From d394849f35a86d7ba0d4fce2a027ddd19bdcdbd3 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 19:36:25 +0200 Subject: [PATCH 02/16] tml --- cypress/support/helpers/cli-helper.ts | 2 +- cypress/support/pages/abstract-page.ts | 2 +- .../pages/backoffice/backoffice-page.ts | 4 ++-- .../pages/backoffice/login/login-page.ts | 2 +- .../create/merchant-user-create-page.ts | 2 +- .../merchant/create/merchant-create-page.ts | 2 +- .../merchant/list/merchant-list-page.ts | 12 +++++------ .../merchant/update/merchant-update-page.ts | 4 ++-- .../create/sales-return-gui-create-page.ts | 8 +++----- .../sales/detail/sales-detail-page.ts | 4 ++-- .../sales/index/sales-index-page.ts | 2 +- .../user/create/user-create-page.ts | 11 ++++------ .../user/delete/user-delete-page.ts | 8 +++----- .../backoffice/user/index/user-index-page.ts | 20 +++++++++---------- .../user/update/user-update-page.ts | 16 +++++++-------- .../agent-dashboard/agent-dashboard-page.ts | 12 +++++------ .../pages/mp/agent-login/agent-login-page.ts | 10 ++++------ .../pages/mp/dashboard/dashboard-page.ts | 8 +++----- cypress/support/pages/mp/login/login-page.ts | 10 ++++------ cypress/support/pages/mp/mp-page.ts | 4 ++-- .../support/pages/mp/offers/offers-page.ts | 10 ++++------ .../pages/mp/products/products-page.ts | 10 ++++------ .../support/pages/mp/profile/profile-page.ts | 8 +++----- .../pages/mp/sales/sales-orders-page.ts | 10 ++++------ .../yves/agent-login/agent-login-page.ts | 10 ++++------ cypress/support/pages/yves/cart/cart-page.ts | 10 +++++----- .../checkout/address/checkout-address-page.ts | 12 +++++------ .../customer/checkout-customer-page.ts | 8 +++----- .../checkout/payment/checkout-payment-page.ts | 10 ++++------ .../shipment/checkout-shipment-page.ts | 8 +++----- .../checkout/summary/checkout-summary-page.ts | 8 +++----- .../yves/comment/cart/comment-cart-page.ts | 18 ++++++++--------- .../support/pages/yves/login/login-page.ts | 10 ++++------ .../pages/yves/multi-cart/multi-cart-page.ts | 10 ++++------ cypress/support/pages/yves/yves-page.ts | 4 ++-- .../backoffice/user-login-scenario.ts | 4 ++-- .../impersonate-as-merchant-user-scenario.ts | 2 +- .../mp/merchant-agent-login-user-scenario.ts | 4 ++-- .../mp/merchant-user-login-scenario.ts | 4 ++-- .../scenarios/yves/agent-login-scenario.ts | 4 ++-- .../scenarios/yves/checkout-mp-scenario.ts | 2 +- .../scenarios/yves/checkout-scenario.ts | 2 +- .../scenarios/yves/customer-login-scenario.ts | 4 ++-- 43 files changed, 135 insertions(+), 180 deletions(-) diff --git a/cypress/support/helpers/cli-helper.ts b/cypress/support/helpers/cli-helper.ts index e75e5bc1..54aaf946 100644 --- a/cypress/support/helpers/cli-helper.ts +++ b/cypress/support/helpers/cli-helper.ts @@ -4,7 +4,7 @@ import { autoWired } from '../utils/inversify/auto-wired'; @injectable() @autoWired export class CliHelper { - public run = (commands: string[]): void => { + run = (commands: string[]): void => { const operations = commands.map((command) => { return { type: 'cli-command', diff --git a/cypress/support/pages/abstract-page.ts b/cypress/support/pages/abstract-page.ts index d53e0b68..ed5a1973 100644 --- a/cypress/support/pages/abstract-page.ts +++ b/cypress/support/pages/abstract-page.ts @@ -7,7 +7,7 @@ export class AbstractPage { protected PAGE_URL = ''; protected faker = faker; - public assertPageLocation = (): void => { + assertPageLocation = (): void => { cy.url({ timeout: 4000 }).should('include', this.PAGE_URL); }; } diff --git a/cypress/support/pages/backoffice/backoffice-page.ts b/cypress/support/pages/backoffice/backoffice-page.ts index bff88c36..eef270fc 100644 --- a/cypress/support/pages/backoffice/backoffice-page.ts +++ b/cypress/support/pages/backoffice/backoffice-page.ts @@ -1,11 +1,11 @@ -import 'reflect-metadata'; import { injectable } from 'inversify'; +import 'reflect-metadata'; import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; @injectable() export class BackofficePage extends AbstractPage { - public visit = (options?: Partial): void => { + visit = (options?: Partial): void => { cy.visitBackoffice(this.PAGE_URL, options); }; } diff --git a/cypress/support/pages/backoffice/login/login-page.ts b/cypress/support/pages/backoffice/login/login-page.ts index 033ac2f0..3ead8127 100644 --- a/cypress/support/pages/backoffice/login/login-page.ts +++ b/cypress/support/pages/backoffice/login/login-page.ts @@ -11,7 +11,7 @@ export class LoginPage extends BackofficePage { protected PAGE_URL: string = '/security-gui/login'; - public login = (username: string, password: string): void => { + login = (username: string, password: string): void => { this.repository.getEmailInput().clear().type(username); this.repository.getPasswordInput().clear().type(password); diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts index 711c9c42..6da5d376 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts @@ -11,7 +11,7 @@ export class MerchantUserCreatePage extends BackofficePage { protected PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; - public createMerchantUser = () => { + createMerchantUser = () => { const uniquePrefix: string = this.faker.number.int({ min: 1000, max: 9999 }).toString(); const merchantUser = { diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts index a1833ef1..8e59e3b0 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts @@ -11,7 +11,7 @@ export class MerchantCreatePage extends BackofficePage { protected PAGE_URL = '/merchant-gui/create-merchant'; - public createMerchant = () => { + createMerchant = () => { const identifier = this.faker.string.uuid(); const merchant = { diff --git a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts index cc495182..bc796f44 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts @@ -11,11 +11,11 @@ export class MerchantListPage extends BackofficePage { protected PAGE_URL: string = '/merchant-gui/list-merchant'; - public editMerchant = (query: string): void => { + editMerchant = (query: string): void => { this.findMerchant(query).find(this.repository.getEditButtonSelector()).click(); }; - public activateMerchant = (query: string): void => { + activateMerchant = (query: string): void => { this.findMerchant(query).then((merchantRow) => { const button = merchantRow.find(this.repository.getActivateButtonSelector()); @@ -25,7 +25,7 @@ export class MerchantListPage extends BackofficePage { }); }; - public deactivateMerchant = (query: string): void => { + deactivateMerchant = (query: string): void => { this.findMerchant(query).then((merchantRow) => { const button = merchantRow.find(this.repository.getDeactivateButtonSelector()); @@ -35,7 +35,7 @@ export class MerchantListPage extends BackofficePage { }); }; - public approveAccessMerchant = (query: string): void => { + approveAccessMerchant = (query: string): void => { this.findMerchant(query).then((merchantRow) => { const button = merchantRow.find(this.repository.getApproveAccessButtonSelector()); @@ -45,7 +45,7 @@ export class MerchantListPage extends BackofficePage { }); }; - public denyAccessMerchant = (query: string): void => { + denyAccessMerchant = (query: string): void => { this.findMerchant(query).then((merchantRow) => { const button = merchantRow.find(this.repository.getDenyAccessButtonSelector()); @@ -55,7 +55,7 @@ export class MerchantListPage extends BackofficePage { }); }; - public findMerchant = (query: string): Cypress.Chainable => { + findMerchant = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(query); diff --git a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts index 58c819c0..ee0ef5af 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -11,7 +11,7 @@ export class MerchantUpdatePage extends BackofficePage { protected PAGE_URL: string = '/merchant-gui/edit-merchant'; - public findUser = (email: string): Cypress.Chainable => { + findUser = (email: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(email); @@ -23,7 +23,7 @@ export class MerchantUpdatePage extends BackofficePage { return this.repository.getFirstTableRow(); }; - public createNewUser = (): void => { + createNewUser = (): void => { this.repository.getUsersTab().click(); this.repository.getAddMerchantUserButton().click(); }; diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts index 06b1b4c1..89ca265d 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts @@ -7,13 +7,11 @@ import { SalesReturnGuiCreateRepository } from './sales-return-gui-create-reposi @injectable() @autoWired export class SalesReturnGuiCreatePage extends BackofficePage { - protected PAGE_URL: string = '/sales-return-gui/create'; + @inject(SalesReturnGuiCreateRepository) private repository: SalesReturnGuiCreateRepository; - constructor(@inject(SalesReturnGuiCreateRepository) private repository: SalesReturnGuiCreateRepository) { - super(); - } + protected PAGE_URL: string = '/sales-return-gui/create'; - public createReturnForAllOrderItems = (): void => { + createReturnForAllOrderItems = (): void => { this.repository.getAllItemsCheckbox().check(); this.repository.getCreateReturnButton().click(); }; diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts index 3b8182b2..2cb8ef06 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -17,7 +17,7 @@ export class SalesDetailPage extends BackofficePage { super(); } - public triggerOms = (state: string, shouldTriggerOmsInCli: boolean = false): void => { + triggerOms = (state: string, shouldTriggerOmsInCli: boolean = false): void => { if (shouldTriggerOmsInCli) { this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); } @@ -35,7 +35,7 @@ export class SalesDetailPage extends BackofficePage { }); }; - public createReturn = (): void => { + createReturn = (): void => { this.repository.getReturnButton().click(); }; } diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts index f832d62b..a091389f 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts @@ -11,7 +11,7 @@ export class SalesIndexPage extends BackofficePage { protected PAGE_URL: string = '/sales'; - public viewLastPlacedOrder = (): void => { + viewLastPlacedOrder = (): void => { cy.visitBackoffice(this.PAGE_URL); this.repository.getViewButtons().first().click(); }; diff --git a/cypress/support/pages/backoffice/user/create/user-create-page.ts b/cypress/support/pages/backoffice/user/create/user-create-page.ts index d4db9e57..fbe92db8 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-page.ts @@ -7,16 +7,13 @@ import { UserCreateRepository } from './user-create-repository'; @injectable() @autoWired export class UserCreatePage extends BackofficePage { - protected PAGE_URL: string = '/user/edit/create'; + @inject(UserCreateRepository) private repository: UserCreateRepository; + protected PAGE_URL: string = '/user/edit/create'; private DEFAULT_PASSWORD: string = 'Change123@_'; private EN_LOCALE_VALUE: string = '66'; - constructor(@inject(UserCreateRepository) private repository: UserCreateRepository) { - super(); - } - - public createRootUser = () => { + createRootUser = () => { const user = { username: this.faker.internet.email(), password: this.DEFAULT_PASSWORD, @@ -31,7 +28,7 @@ export class UserCreatePage extends BackofficePage { return user; }; - public createAgentMerchantUser = () => { + createAgentMerchantUser = () => { const user = { username: this.faker.internet.email(), password: this.DEFAULT_PASSWORD, diff --git a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts index 1cac0c6a..f843cf57 100644 --- a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts @@ -7,13 +7,11 @@ import { UserDeleteRepository } from './user-delete-repository'; @injectable() @autoWired export class UserDeletePage extends BackofficePage { - protected PAGE_URL: string = '/user/edit/confirm-delete'; + @inject(UserDeleteRepository) private repository: UserDeleteRepository; - constructor(@inject(UserDeleteRepository) private repository: UserDeleteRepository) { - super(); - } + protected PAGE_URL: string = '/user/edit/confirm-delete'; - public confirmDelete = (): void => { + confirmDelete = (): void => { this.repository.getDeleteButton().click(); }; } diff --git a/cypress/support/pages/backoffice/user/index/user-index-page.ts b/cypress/support/pages/backoffice/user/index/user-index-page.ts index f8662587..3bb81328 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-page.ts @@ -7,21 +7,19 @@ import { UserIndexRepository } from './user-index-repository'; @injectable() @autoWired export class UserIndexPage extends BackofficePage { - protected PAGE_URL: string = '/user'; + @inject(UserIndexRepository) private repository: UserIndexRepository; - constructor(@inject(UserIndexRepository) private repository: UserIndexRepository) { - super(); - } + protected PAGE_URL: string = '/user'; - public createNewUser = (): void => { + createNewUser = (): void => { this.repository.getAddNewUserButton().click(); }; - public editUser = (query: string): void => { + editUser = (query: string): void => { this.findUser(query).find(this.repository.getEditButtonSelector()).click(); }; - public deactivateUser = (query: string): void => { + deactivateUser = (query: string): void => { this.findUser(query).then((merchantRow) => { const button = merchantRow.find(this.repository.getDeactivateButtonSelector()); @@ -31,7 +29,7 @@ export class UserIndexPage extends BackofficePage { }); }; - public deleteUser = (query: string): void => { + deleteUser = (query: string): void => { this.findUser(query).then((merchantRow) => { const button = merchantRow.find(this.repository.getDeleteButtonSelector()); @@ -41,7 +39,7 @@ export class UserIndexPage extends BackofficePage { }); }; - public activateUser = (query: string): void => { + activateUser = (query: string): void => { this.findUser(query).then((merchantRow) => { const button = merchantRow.find(this.repository.getActivateButtonSelector()); @@ -51,7 +49,7 @@ export class UserIndexPage extends BackofficePage { }); }; - public findUser = (query: string): Cypress.Chainable => { + findUser = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(query); @@ -63,7 +61,7 @@ export class UserIndexPage extends BackofficePage { return this.repository.getFirstTableRow(); }; - public getUserTableHeader = (): Cypress.Chainable => { + getUserTableHeader = (): Cypress.Chainable => { return this.repository.getTableHeader(); }; } diff --git a/cypress/support/pages/backoffice/user/update/user-update-page.ts b/cypress/support/pages/backoffice/user/update/user-update-page.ts index cfbe7495..44a73f84 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-page.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-page.ts @@ -7,27 +7,25 @@ import { UserUpdateRepository } from './user-update-repository'; @injectable() @autoWired export class UserUpdatePage extends BackofficePage { - protected PAGE_URL: string = '/user/edit/update'; - public DEFAULT_PASSWORD: string = 'Change123@_'; + @inject(UserUpdateRepository) private repository: UserUpdateRepository; - constructor(@inject(UserUpdateRepository) private repository: UserUpdateRepository) { - super(); - } + protected PAGE_URL: string = '/user/edit/update'; + DEFAULT_PASSWORD: string = 'Change123@_'; - public checkMerchantAgentCheckbox = (): void => { + checkMerchantAgentCheckbox = (): void => { this.getAgentMerchantCheckbox().check(); this.repository.getUpdateUserButton().click(); }; - public getAgentMerchantCheckbox = (): Cypress.Chainable => { + getAgentMerchantCheckbox = (): Cypress.Chainable => { return this.repository.getAgentMerchantCheckbox(); }; - public getAgentCustomerCheckbox = (): Cypress.Chainable => { + getAgentCustomerCheckbox = (): Cypress.Chainable => { return this.repository.getAgentCustomerCheckbox(); }; - public setDefaultPassword = (): void => { + setDefaultPassword = (): void => { this.repository.getPasswordInput().clear().type(this.DEFAULT_PASSWORD); this.repository.getRepeatPasswordInput().clear().type(this.DEFAULT_PASSWORD); this.repository.getUpdateUserButton().click(); diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts index 71b18cd4..167f7971 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -7,17 +7,15 @@ import { AgentDashboardRepository } from './agent-dashboard-repository'; @injectable() @autoWired export class AgentDashboardPage extends MpPage { - protected PAGE_URL: string = '/agent-dashboard-merchant-portal-gui/merchant-users'; + @inject(AgentDashboardRepository) private repository: AgentDashboardRepository; - constructor(@inject(AgentDashboardRepository) private repository: AgentDashboardRepository) { - super(); - } + protected PAGE_URL: string = '/agent-dashboard-merchant-portal-gui/merchant-users'; - public getDashboardSidebarSelector = (): Cypress.Chainable => { + getDashboardSidebarSelector = (): Cypress.Chainable => { return this.repository.getDashboardSidebarSelector(); }; - public assistMerchantUser = (query: string): void => { + assistMerchantUser = (query: string): void => { this.findMerchantUser(query).then((merchantUserRow) => { const button = merchantUserRow.find(this.repository.getAssistUserButtonSelector()); @@ -28,7 +26,7 @@ export class AgentDashboardPage extends MpPage { }); }; - public findMerchantUser = (query: string, counter: number = 1): Cypress.Chainable => { + findMerchantUser = (query: string, counter: number = 1): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(query); diff --git a/cypress/support/pages/mp/agent-login/agent-login-page.ts b/cypress/support/pages/mp/agent-login/agent-login-page.ts index 133aa5a9..c53631f8 100644 --- a/cypress/support/pages/mp/agent-login/agent-login-page.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-page.ts @@ -7,20 +7,18 @@ import { AgentLoginRepository } from './agent-login-repository'; @injectable() @autoWired export class AgentLoginPage extends MpPage { - protected PAGE_URL: string = '/agent-security-merchant-portal-gui/login'; + @inject(AgentLoginRepository) private repository: AgentLoginRepository; - constructor(@inject(AgentLoginRepository) private repository: AgentLoginRepository) { - super(); - } + protected PAGE_URL: string = '/agent-security-merchant-portal-gui/login'; - public login = (username: string, password: string): void => { + login = (username: string, password: string): void => { this.repository.getEmailInput().clear().type(username); this.repository.getPasswordInput().clear().type(password); this.repository.getSubmitButton().click(); }; - public getFailedAuthenticationText = (): string => { + getFailedAuthenticationText = (): string => { return this.repository.getFailedAuthenticationText(); }; } diff --git a/cypress/support/pages/mp/dashboard/dashboard-page.ts b/cypress/support/pages/mp/dashboard/dashboard-page.ts index 22d12471..39abca0f 100644 --- a/cypress/support/pages/mp/dashboard/dashboard-page.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-page.ts @@ -7,13 +7,11 @@ import { DashboardRepository } from './dashboard-repository'; @injectable() @autoWired export class DashboardPage extends MpPage { - protected PAGE_URL: string = '/dashboard-merchant-portal-gui/dashboard'; + @inject(DashboardRepository) private repository: DashboardRepository; - constructor(@inject(DashboardRepository) private repository: DashboardRepository) { - super(); - } + protected PAGE_URL: string = '/dashboard-merchant-portal-gui/dashboard'; - public logout = (): void => { + logout = (): void => { this.repository.getUserProfileMenu().click(); this.repository.getLogoutButton().click(); }; diff --git a/cypress/support/pages/mp/login/login-page.ts b/cypress/support/pages/mp/login/login-page.ts index 217c8deb..225c0f10 100644 --- a/cypress/support/pages/mp/login/login-page.ts +++ b/cypress/support/pages/mp/login/login-page.ts @@ -7,13 +7,11 @@ import { LoginRepository } from './login-repository'; @injectable() @autoWired export class LoginPage extends MpPage { - protected PAGE_URL: string = '/security-merchant-portal-gui/login'; + @inject(LoginRepository) private repository: LoginRepository; - constructor(@inject(LoginRepository) private repository: LoginRepository) { - super(); - } + protected PAGE_URL: string = '/security-merchant-portal-gui/login'; - public login = (username: string, password: string): void => { + login = (username: string, password: string): void => { cy.visitMerchantPortal(this.PAGE_URL); this.repository.getEmailInput().clear().type(username); this.repository.getPasswordInput().clear().type(password); @@ -21,7 +19,7 @@ export class LoginPage extends MpPage { this.repository.getSubmitButton().click(); }; - public getFailedAuthenticationText = (): string => { + getFailedAuthenticationText = (): string => { return this.repository.getFailedAuthenticationText(); }; } diff --git a/cypress/support/pages/mp/mp-page.ts b/cypress/support/pages/mp/mp-page.ts index 5a9d1440..114285d6 100644 --- a/cypress/support/pages/mp/mp-page.ts +++ b/cypress/support/pages/mp/mp-page.ts @@ -1,11 +1,11 @@ -import 'reflect-metadata'; import { injectable } from 'inversify'; +import 'reflect-metadata'; import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; @injectable() export class MpPage extends AbstractPage { - public visit = (options?: Partial): void => { + visit = (options?: Partial): void => { cy.visitMerchantPortal(this.PAGE_URL, options); }; } diff --git a/cypress/support/pages/mp/offers/offers-page.ts b/cypress/support/pages/mp/offers/offers-page.ts index c98f4263..3c18c032 100644 --- a/cypress/support/pages/mp/offers/offers-page.ts +++ b/cypress/support/pages/mp/offers/offers-page.ts @@ -7,13 +7,11 @@ import { OffersRepository } from './offers-repository'; @injectable() @autoWired export class OffersPage extends MpPage { - protected PAGE_URL: string = '/product-offer-merchant-portal-gui/product-offers'; + @inject(OffersRepository) private repository: OffersRepository; - constructor(@inject(OffersRepository) private repository: OffersRepository) { - super(); - } + protected PAGE_URL: string = '/product-offer-merchant-portal-gui/product-offers'; - public findOffer = (query: string): Cypress.Chainable => { + findOffer = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(query); @@ -25,7 +23,7 @@ export class OffersPage extends MpPage { return this.repository.getFirstTableRow(); }; - public getDrawer = (): Cypress.Chainable => { + getDrawer = (): Cypress.Chainable => { return this.repository.getDrawer(); }; } diff --git a/cypress/support/pages/mp/products/products-page.ts b/cypress/support/pages/mp/products/products-page.ts index 3997df76..3bdbd5dc 100644 --- a/cypress/support/pages/mp/products/products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -7,13 +7,11 @@ import { ProductsRepository } from './products-repository'; @injectable() @autoWired export class ProductsPage extends MpPage { - protected PAGE_URL: string = '/product-merchant-portal-gui/products'; + @inject(ProductsRepository) private repository: ProductsRepository; - constructor(@inject(ProductsRepository) private repository: ProductsRepository) { - super(); - } + protected PAGE_URL: string = '/product-merchant-portal-gui/products'; - public findProduct = (query: string): Cypress.Chainable => { + findProduct = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(query); @@ -25,7 +23,7 @@ export class ProductsPage extends MpPage { return this.repository.getFirstTableRow(); }; - public getDrawer = (): Cypress.Chainable => { + getDrawer = (): Cypress.Chainable => { const drawer = this.repository.getDrawer(); // Wait for the drawer to be visible diff --git a/cypress/support/pages/mp/profile/profile-page.ts b/cypress/support/pages/mp/profile/profile-page.ts index 7a245681..90cdc219 100644 --- a/cypress/support/pages/mp/profile/profile-page.ts +++ b/cypress/support/pages/mp/profile/profile-page.ts @@ -7,13 +7,11 @@ import { ProfileRepository } from './profile-repository'; @injectable() @autoWired export class ProfilePage extends MpPage { - protected PAGE_URL: string = '/merchant-profile-merchant-portal-gui/profile'; + @inject(ProfileRepository) private repository: ProfileRepository; - constructor(@inject(ProfileRepository) private repository: ProfileRepository) { - super(); - } + protected PAGE_URL: string = '/merchant-profile-merchant-portal-gui/profile'; - public updateMerchantPhoneNumber = (phone?: string) => { + updateMerchantPhoneNumber = (phone?: string) => { this.repository .getPhoneNumberInput() .clear() diff --git a/cypress/support/pages/mp/sales/sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts index f4605f87..a30e5fa4 100644 --- a/cypress/support/pages/mp/sales/sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -7,13 +7,11 @@ import { SalesOrdersRepository } from './sales-orders-repository'; @injectable() @autoWired export class SalesOrdersPage extends MpPage { - protected PAGE_URL: string = '/sales-merchant-portal-gui/orders'; + @inject(SalesOrdersRepository) private repository: SalesOrdersRepository; - constructor(@inject(SalesOrdersRepository) private repository: SalesOrdersRepository) { - super(); - } + protected PAGE_URL: string = '/sales-merchant-portal-gui/orders'; - public findOrder = (query: string): Cypress.Chainable => { + findOrder = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(query); @@ -25,7 +23,7 @@ export class SalesOrdersPage extends MpPage { return this.repository.getFirstTableRow(); }; - public cancelOrder = (query: string): void => { + cancelOrder = (query: string): void => { this.findOrder(query).click(); this.repository.getDrawer().find('button:contains("Cancel")').click(); }; diff --git a/cypress/support/pages/yves/agent-login/agent-login-page.ts b/cypress/support/pages/yves/agent-login/agent-login-page.ts index 13f4de2e..6b566cbc 100644 --- a/cypress/support/pages/yves/agent-login/agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -7,20 +7,18 @@ import { AgentLoginRepository } from './agent-login-repository'; @injectable() @autoWired export class AgentLoginPage extends YvesPage { - protected PAGE_URL: string = '/agent/login'; + @inject(TYPES.AgentLoginRepository) private repository: AgentLoginRepository; - constructor(@inject(TYPES.AgentLoginRepository) private repository: AgentLoginRepository) { - super(); - } + protected PAGE_URL: string = '/agent/login'; - public login = (username: string, password: string): void => { + login = (username: string, password: string): void => { this.repository.getLoginEmailInput().clear().type(username); this.repository.getLoginPasswordInput().clear().type(password); this.repository.getLoginForm().submit(); }; - public getFailedAuthenticationText = (): string => { + getFailedAuthenticationText = (): string => { return this.repository.getFailedAuthenticationText(); }; } diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index 23925513..b3481a73 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -11,7 +11,7 @@ export class CartPage extends YvesPage { protected PAGE_URL: string = '/cart'; - public quickAddToCart = (sku: string, quantity?: number): void => { + quickAddToCart = (sku: string, quantity?: number): void => { this.repository.getQuickAddToCartSkuField().clear().type(sku); this.repository.getQuickAddToCartProductListField().click(); @@ -24,11 +24,11 @@ export class CartPage extends YvesPage { cy.contains('Items added successfully').should('exist'); }; - public startCheckout = (): void => { + startCheckout = (): void => { this.repository.getCheckoutButton().click(); }; - public removeProduct = (sku: string): void => { + removeProduct = (sku: string): void => { const form = this.repository.findCartItemRemovalForm(sku); if (!form) { @@ -38,7 +38,7 @@ export class CartPage extends YvesPage { form.submit(); }; - public changeQuantity = (sku: string, newQuantity: number): void => { + changeQuantity = (sku: string, newQuantity: number): void => { const form = this.repository.findCartItemChangeQuantityForm(sku); const input = this.repository.getCartItemChangeQuantityField(sku); @@ -50,7 +50,7 @@ export class CartPage extends YvesPage { form.submit(); }; - public clearCart = (): void => { + clearCart = (): void => { const form = this.repository.findClearCartForm(); if (form) { diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts index 180db432..f2a5274c 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -7,13 +7,11 @@ import { CheckoutAddressRepository } from './checkout-address-repository'; @injectable() @autoWired export class CheckoutAddressPage extends YvesPage { - protected PAGE_URL: string = '/checkout/address'; + @inject(TYPES.CheckoutAddressRepository) private repository: CheckoutAddressRepository; - constructor(@inject(TYPES.CheckoutAddressRepository) private repository: CheckoutAddressRepository) { - super(); - } + protected PAGE_URL: string = '/checkout/address'; - public fillShippingAddress = (idCustomerAddress?: number): void => { + fillShippingAddress = (idCustomerAddress?: number): void => { if (idCustomerAddress) { this.repository.getSelectShippingAddressField().select(idCustomerAddress.toString()); this.repository.getShippingAddressBillingSameAsShippingCheckbox().check({ force: true }); @@ -42,7 +40,7 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getNextButton().click(); }; - public fillMultiShippingAddress = (idCustomerAddress?: number): void => { + fillMultiShippingAddress = (idCustomerAddress?: number): void => { this.repository.getMultiShipmentTriggerButton().click(); this.repository @@ -103,7 +101,7 @@ export class CheckoutAddressPage extends YvesPage { this.fillBillingAddress(); }; - public fillBillingAddress = (): void => { + fillBillingAddress = (): void => { const checkoutAddress = this.createDummyCheckoutAddress(); this.repository.getSelectBillingAddressField().select('0'); diff --git a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts index cbaf0ab6..6ee11613 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -7,13 +7,11 @@ import { CheckoutCustomerRepository } from './checkout-customer-repository'; @injectable() @autoWired export class CheckoutCustomerPage extends YvesPage { - protected PAGE_URL: string = '/checkout/customer'; + @inject(TYPES.CheckoutCustomerRepository) private repository: CheckoutCustomerRepository; - constructor(@inject(TYPES.CheckoutCustomerRepository) private repository: CheckoutCustomerRepository) { - super(); - } + protected PAGE_URL: string = '/checkout/customer'; - public checkoutAsGuest = (): string => { + checkoutAsGuest = (): string => { const guest = { firstName: this.faker.person.firstName(), lastName: this.faker.person.lastName(), diff --git a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts index c7b2670c..c18c2e82 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -7,20 +7,18 @@ import { CheckoutPaymentRepository } from './checkout-payment-repository'; @injectable() @autoWired export class CheckoutPaymentPage extends YvesPage { - protected PAGE_URL: string = '/checkout/payment'; + @inject(TYPES.CheckoutPaymentRepository) private repository: CheckoutPaymentRepository; - constructor(@inject(TYPES.CheckoutPaymentRepository) private repository: CheckoutPaymentRepository) { - super(); - } + protected PAGE_URL: string = '/checkout/payment'; - public setDummyPaymentMethod = (): void => { + setDummyPaymentMethod = (): void => { this.repository.getDummyPaymentInvoiceRadio().click({ force: true }); this.repository.getDummyPaymentInvoiceDateField().clear().type('12.12.1999'); this.repository.getGoToSummaryButton().click(); }; - public setDummyMarketplacePaymentMethod = (): void => { + setDummyMarketplacePaymentMethod = (): void => { this.repository.getDummyMarketplacePaymentInvoiceRadio().click({ force: true }); this.repository.getDummyMarketplacePaymentInvoiceDateField().clear().type('12.12.1999'); diff --git a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts index d5d53e76..765086c5 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -7,13 +7,11 @@ import { CheckoutShipmentRepository } from './checkout-shipment-repository'; @injectable() @autoWired export class CheckoutShipmentPage extends YvesPage { - protected PAGE_URL: string = '/checkout/shipment'; + @inject(TYPES.CheckoutShipmentRepository) private repository: CheckoutShipmentRepository; - constructor(@inject(TYPES.CheckoutShipmentRepository) private repository: CheckoutShipmentRepository) { - super(); - } + protected PAGE_URL: string = '/checkout/shipment'; - public setStandardShippingMethod = (): void => { + setStandardShippingMethod = (): void => { this.repository.getMultiShipmentGroups().each(($shipmentItem, index) => { this.repository.getStandardShipmentRadio($shipmentItem, index).click({ force: true }); }); diff --git a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts index 9a731061..33e0e814 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -7,13 +7,11 @@ import { CheckoutSummaryRepository } from './checkout-summary-repository'; @injectable() @autoWired export class CheckoutSummaryPage extends YvesPage { - protected PAGE_URL: string = '/checkout/summary'; + @inject(TYPES.CheckoutSummaryRepository) private repository: CheckoutSummaryRepository; - constructor(@inject(TYPES.CheckoutSummaryRepository) private repository: CheckoutSummaryRepository) { - super(); - } + protected PAGE_URL: string = '/checkout/summary'; - public placeOrder = (): void => { + placeOrder = (): void => { this.repository.getaAcceptTermsAndConditionsCheckbox().check({ force: true }); this.repository.getSummaryForm().submit(); }; diff --git a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts index 87dab595..a75e336d 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -7,32 +7,30 @@ import { CommentCartRepository } from './comment-cart-repository'; @injectable() @autoWired export class CommentCartPage extends YvesPage { - protected PAGE_URL: string = '/cart'; + @inject(TYPES.CommentCartRepository) private repository: CommentCartRepository; - constructor(@inject(TYPES.CommentCartRepository) private repository: CommentCartRepository) { - super(); - } + protected PAGE_URL: string = '/cart'; - public addComment = (commentMessage: string): void => { + addComment = (commentMessage: string): void => { this.repository.getAddCommentForm().last().find('textarea').clear().type(commentMessage); this.repository.getAddCommentForm().last().find(this.repository.getAddCommentButtonSelector()).click(); }; - public updateFirstComment = (commentMessage: string): void => { + updateFirstComment = (commentMessage: string): void => { const textarea = this.repository.getFirstCommentTextarea(); textarea.clear().type(commentMessage); this.getCommentThreadListSection().first().find(this.repository.getUpdateCommentButtonSelector()).click(); }; - public updateCommentByCommentText = (initialCommentMessage: string, newCommentMessage: string): void => { + updateCommentByCommentText = (initialCommentMessage: string, newCommentMessage: string): void => { const textarea = this.repository.getCommentTextareaByCommentText(initialCommentMessage); textarea.clear().type(newCommentMessage); textarea.parent().find(this.repository.getUpdateCommentButtonSelector()).click(); }; - public removeCommentByCommentText = (commentMessage: string): void => { + removeCommentByCommentText = (commentMessage: string): void => { this.repository .getCommentTextareaByCommentText(commentMessage) .parent() @@ -40,11 +38,11 @@ export class CommentCartPage extends YvesPage { .click(); }; - public removeFirstComment = (): void => { + removeFirstComment = (): void => { this.getCommentThreadListSection().find(this.repository.getRemoveCommentButtonSelector()).click(); }; - public getCommentThreadListSection = (): Cypress.Chainable => { + getCommentThreadListSection = (): Cypress.Chainable => { return this.repository.getCommentThreadListSection(); }; } diff --git a/cypress/support/pages/yves/login/login-page.ts b/cypress/support/pages/yves/login/login-page.ts index 17dcf1a3..6ee8f587 100644 --- a/cypress/support/pages/yves/login/login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -7,20 +7,18 @@ import { LoginRepository } from './login-repository'; @injectable() @autoWired export class LoginPage extends YvesPage { - protected PAGE_URL: string = '/login'; + @inject(TYPES.LoginRepository) private repository: LoginRepository; - constructor(@inject(TYPES.LoginRepository) private repository: LoginRepository) { - super(); - } + protected PAGE_URL: string = '/login'; - public login = (email: string, password: string): void => { + login = (email: string, password: string): void => { this.repository.getLoginEmailInput().clear().type(email); this.repository.getLoginPasswordInput().clear().type(password); this.repository.getLoginForm().submit(); }; - public getFailedAuthenticationText = (): string => { + getFailedAuthenticationText = (): string => { return this.repository.getFailedAuthenticationText(); }; } diff --git a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts index 46e9e0fb..84e04b3e 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -7,13 +7,11 @@ import { MultiCartRepository } from './multi-cart-repository'; @injectable() @autoWired export class MultiCartPage extends YvesPage { - protected PAGE_URL: string = '/multi-cart'; + @inject(TYPES.MultiCartRepository) private repository: MultiCartRepository; - constructor(@inject(TYPES.MultiCartRepository) private repository: MultiCartRepository) { - super(); - } + protected PAGE_URL: string = '/multi-cart'; - public createCart = (name?: string): void => { + createCart = (name?: string): void => { cy.visit(`${this.PAGE_URL}/create`); const cartName = name ?? `Cart #${this.faker.string.uuid()}`; @@ -23,7 +21,7 @@ export class MultiCartPage extends YvesPage { cy.contains(`Cart '${cartName}' was created successfully`).should('exist'); }; - public selectCart = (name: string): void => { + selectCart = (name: string): void => { this.repository.getQuoteTable().contains(name).click(); }; } diff --git a/cypress/support/pages/yves/yves-page.ts b/cypress/support/pages/yves/yves-page.ts index 52e00d1b..a1e57bbe 100644 --- a/cypress/support/pages/yves/yves-page.ts +++ b/cypress/support/pages/yves/yves-page.ts @@ -1,11 +1,11 @@ -import 'reflect-metadata'; import { injectable } from 'inversify'; +import 'reflect-metadata'; import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; @injectable() export class YvesPage extends AbstractPage { - public visit = (options?: Partial): void => { + visit = (options?: Partial): void => { cy.visit(this.PAGE_URL, options); }; } diff --git a/cypress/support/scenarios/backoffice/user-login-scenario.ts b/cypress/support/scenarios/backoffice/user-login-scenario.ts index eac21624..064da121 100644 --- a/cypress/support/scenarios/backoffice/user-login-scenario.ts +++ b/cypress/support/scenarios/backoffice/user-login-scenario.ts @@ -5,9 +5,9 @@ import { LoginPage } from '../../pages/backoffice'; @injectable() @autoWired export class UserLoginScenario { - constructor(@inject(LoginPage) private loginPage: LoginPage) {} + @inject(LoginPage) private loginPage: LoginPage; - public execute = (username: string, password: string): void => { + execute = (username: string, password: string): void => { cy.session([username, password], () => { this.loginPage.visit(); this.loginPage.login(username, password); diff --git a/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts b/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts index 81534e98..6b482568 100644 --- a/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts +++ b/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts @@ -8,7 +8,7 @@ export class ImpersonateAsMerchantUserScenario { @inject(AgentLoginPage) private agentLoginPage: AgentLoginPage; @inject(AgentDashboardPage) private mpAgentDashboardPage: AgentDashboardPage; - public execute = (username: string, password: string, merchantUsername: string): void => { + execute = (username: string, password: string, merchantUsername: string): void => { this.agentLoginPage.visit(); this.agentLoginPage.login(username, password); diff --git a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts index 85c662b6..a0cab39d 100644 --- a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts @@ -5,9 +5,9 @@ import { AgentLoginPage } from '../../pages/mp'; @injectable() @autoWired export class MerchantAgentLoginUserScenario { - constructor(@inject(AgentLoginPage) private agentLoginPage: AgentLoginPage) {} + @inject(AgentLoginPage) private agentLoginPage: AgentLoginPage; - public execute = (username: string, password: string): void => { + execute = (username: string, password: string): void => { cy.session([username, password], () => { this.agentLoginPage.visit(); this.agentLoginPage.login(username, password); diff --git a/cypress/support/scenarios/mp/merchant-user-login-scenario.ts b/cypress/support/scenarios/mp/merchant-user-login-scenario.ts index 8d396d8f..ec144169 100644 --- a/cypress/support/scenarios/mp/merchant-user-login-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-user-login-scenario.ts @@ -5,9 +5,9 @@ import { LoginPage } from '../../pages/mp'; @injectable() @autoWired export class MerchantUserLoginScenario { - constructor(@inject(LoginPage) private loginPage: LoginPage) {} + @inject(LoginPage) private loginPage: LoginPage; - public execute = (username: string, password: string): void => { + execute = (username: string, password: string): void => { cy.session([username, password], () => { this.loginPage.visit(); this.loginPage.login(username, password); diff --git a/cypress/support/scenarios/yves/agent-login-scenario.ts b/cypress/support/scenarios/yves/agent-login-scenario.ts index ad618f1d..ace0e3af 100644 --- a/cypress/support/scenarios/yves/agent-login-scenario.ts +++ b/cypress/support/scenarios/yves/agent-login-scenario.ts @@ -5,9 +5,9 @@ import { AgentLoginPage } from '../../pages/yves'; @injectable() @autoWired export class AgentLoginScenario { - constructor(@inject(AgentLoginPage) private loginPage: AgentLoginPage) {} + @inject(AgentLoginPage) private loginPage: AgentLoginPage; - public execute = (username: string, password: string): void => { + execute = (username: string, password: string): void => { cy.session([username, password], () => { this.loginPage.visit(); this.loginPage.login(username, password); diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index c19cfc88..867b57c2 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -24,7 +24,7 @@ export class CheckoutMpScenario { @inject(CliHelper) private cliHelper: CliHelper ) {} - public execute = (isGuest: boolean = false, isMultiShipment: boolean = false): void => { + execute = (isGuest: boolean = false, isMultiShipment: boolean = false): void => { this.cartPage.visit(); this.cartPage.startCheckout(); diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 0f710af6..c582b1c9 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -24,7 +24,7 @@ export class CheckoutScenario { @inject(CliHelper) private cliHelper: CliHelper ) {} - public execute = (isGuest: boolean = false, isMultiShipment: boolean = false, idCustomerAddress?: number): void => { + execute = (isGuest: boolean = false, isMultiShipment: boolean = false, idCustomerAddress?: number): void => { this.cartPage.visit(); this.cartPage.startCheckout(); diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index 36715779..b0f69619 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -5,9 +5,9 @@ import { LoginPage } from '../../pages/yves'; @injectable() @autoWired export class CustomerLoginScenario { - constructor(@inject(LoginPage) private loginPage: LoginPage) {} + @inject(LoginPage) private loginPage: LoginPage; - public execute = (email: string, password: string): void => { + execute = (email: string, password: string): void => { cy.session([email, password], () => { this.loginPage.visit(); this.loginPage.login(email, password); From cd225d42f46521f78433e27b2214fb3e406bf24b Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 19:41:15 +0200 Subject: [PATCH 03/16] tmp --- .../pages/backoffice/index/index-page.ts | 2 +- .../pages/backoffice/login/login-page.ts | 2 +- .../create/merchant-user-create-page.ts | 2 +- .../merchant/list/merchant-list-page.ts | 2 +- .../merchant/update/merchant-update-page.ts | 2 +- .../create/sales-return-gui-create-page.ts | 2 +- .../sales/detail/sales-detail-page.ts | 5 ++--- .../sales/index/sales-index-page.ts | 2 +- .../user/create/user-create-page.ts | 6 +++--- .../user/delete/user-delete-page.ts | 2 +- .../backoffice/user/index/user-index-page.ts | 2 +- .../user/update/user-update-page.ts | 4 ++-- .../agent-dashboard/agent-dashboard-page.ts | 2 +- .../pages/mp/agent-login/agent-login-page.ts | 2 +- .../pages/mp/dashboard/dashboard-page.ts | 2 +- cypress/support/pages/mp/login/login-page.ts | 2 +- .../support/pages/mp/offers/offers-page.ts | 2 +- .../pages/mp/products/products-page.ts | 2 +- .../support/pages/mp/profile/profile-page.ts | 2 +- .../pages/mp/sales/sales-orders-page.ts | 2 +- .../yves/agent-login/agent-login-page.ts | 2 +- cypress/support/pages/yves/cart/cart-page.ts | 2 +- .../checkout/address/checkout-address-page.ts | 2 +- .../customer/checkout-customer-page.ts | 2 +- .../checkout/payment/checkout-payment-page.ts | 2 +- .../shipment/checkout-shipment-page.ts | 2 +- .../checkout/summary/checkout-summary-page.ts | 2 +- .../yves/comment/cart/comment-cart-page.ts | 2 +- .../support/pages/yves/login/login-page.ts | 2 +- .../pages/yves/multi-cart/multi-cart-page.ts | 2 +- .../scenarios/yves/checkout-mp-scenario.ts | 19 ++++++++----------- .../scenarios/yves/checkout-scenario.ts | 19 ++++++++----------- .../support/{helpers => utils}/cli-helper.ts | 2 +- cypress/support/utils/index.ts | 1 + 34 files changed, 52 insertions(+), 58 deletions(-) rename cypress/support/{helpers => utils}/cli-helper.ts (91%) diff --git a/cypress/support/pages/backoffice/index/index-page.ts b/cypress/support/pages/backoffice/index/index-page.ts index 51bca858..dc842149 100644 --- a/cypress/support/pages/backoffice/index/index-page.ts +++ b/cypress/support/pages/backoffice/index/index-page.ts @@ -6,5 +6,5 @@ import { BackofficePage } from '../backoffice-page'; @injectable() @autoWired export class IndexPage extends BackofficePage { - protected PAGE_URL: string = '/'; + protected PAGE_URL = '/'; } diff --git a/cypress/support/pages/backoffice/login/login-page.ts b/cypress/support/pages/backoffice/login/login-page.ts index 3ead8127..24747c68 100644 --- a/cypress/support/pages/backoffice/login/login-page.ts +++ b/cypress/support/pages/backoffice/login/login-page.ts @@ -9,7 +9,7 @@ import { LoginRepository } from './login-repository'; export class LoginPage extends BackofficePage { @inject(LoginRepository) private repository: LoginRepository; - protected PAGE_URL: string = '/security-gui/login'; + protected PAGE_URL = '/security-gui/login'; login = (username: string, password: string): void => { this.repository.getEmailInput().clear().type(username); diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts index 6da5d376..f3ab90a8 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts @@ -9,7 +9,7 @@ import { MerchantUserCreateRepository } from './merchant-user-create-repository' export class MerchantUserCreatePage extends BackofficePage { @inject(MerchantUserCreateRepository) private repository: MerchantUserCreateRepository; - protected PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; + protected PAGE_URL = '/merchant-user-gui/edit-merchant-user'; createMerchantUser = () => { const uniquePrefix: string = this.faker.number.int({ min: 1000, max: 9999 }).toString(); diff --git a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts index bc796f44..9a8cd1ad 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts @@ -9,7 +9,7 @@ import { MerchantListRepository } from './merchant-list-repository'; export class MerchantListPage extends BackofficePage { @inject(MerchantListRepository) private repository: MerchantListRepository; - protected PAGE_URL: string = '/merchant-gui/list-merchant'; + protected PAGE_URL = '/merchant-gui/list-merchant'; editMerchant = (query: string): void => { this.findMerchant(query).find(this.repository.getEditButtonSelector()).click(); diff --git a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts index ee0ef5af..a2be9de2 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -9,7 +9,7 @@ import { MerchantUpdateRepository } from './merchant-update-repository'; export class MerchantUpdatePage extends BackofficePage { @inject(MerchantUpdateRepository) private repository: MerchantUpdateRepository; - protected PAGE_URL: string = '/merchant-gui/edit-merchant'; + protected PAGE_URL = '/merchant-gui/edit-merchant'; findUser = (email: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts index 89ca265d..887411be 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts @@ -9,7 +9,7 @@ import { SalesReturnGuiCreateRepository } from './sales-return-gui-create-reposi export class SalesReturnGuiCreatePage extends BackofficePage { @inject(SalesReturnGuiCreateRepository) private repository: SalesReturnGuiCreateRepository; - protected PAGE_URL: string = '/sales-return-gui/create'; + protected PAGE_URL = '/sales-return-gui/create'; createReturnForAllOrderItems = (): void => { this.repository.getAllItemsCheckbox().check(); diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts index 2cb8ef06..3f487c69 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -1,14 +1,13 @@ -import { autoWired } from '@utils'; +import { autoWired, CliHelper } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { CliHelper } from '../../../../helpers/cli-helper'; import { BackofficePage } from '../../backoffice-page'; import { SalesDetailRepository } from './sales-detail-repository'; @injectable() @autoWired export class SalesDetailPage extends BackofficePage { - protected PAGE_URL: string = '/sales/detail'; + protected PAGE_URL = '/sales/detail'; constructor( @inject(SalesDetailRepository) private repository: SalesDetailRepository, diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts index a091389f..772a68a6 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts @@ -9,7 +9,7 @@ import { SalesIndexRepository } from './sales-index-repository'; export class SalesIndexPage extends BackofficePage { @inject(SalesIndexRepository) private repository: SalesIndexRepository; - protected PAGE_URL: string = '/sales'; + protected PAGE_URL = '/sales'; viewLastPlacedOrder = (): void => { cy.visitBackoffice(this.PAGE_URL); diff --git a/cypress/support/pages/backoffice/user/create/user-create-page.ts b/cypress/support/pages/backoffice/user/create/user-create-page.ts index fbe92db8..e9577bf6 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-page.ts @@ -9,9 +9,9 @@ import { UserCreateRepository } from './user-create-repository'; export class UserCreatePage extends BackofficePage { @inject(UserCreateRepository) private repository: UserCreateRepository; - protected PAGE_URL: string = '/user/edit/create'; - private DEFAULT_PASSWORD: string = 'Change123@_'; - private EN_LOCALE_VALUE: string = '66'; + protected PAGE_URL = '/user/edit/create'; + private DEFAULT_PASSWORD = 'Change123@_'; + private EN_LOCALE_VALUE = '66'; createRootUser = () => { const user = { diff --git a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts index f843cf57..1bbada85 100644 --- a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts @@ -9,7 +9,7 @@ import { UserDeleteRepository } from './user-delete-repository'; export class UserDeletePage extends BackofficePage { @inject(UserDeleteRepository) private repository: UserDeleteRepository; - protected PAGE_URL: string = '/user/edit/confirm-delete'; + protected PAGE_URL = '/user/edit/confirm-delete'; confirmDelete = (): void => { this.repository.getDeleteButton().click(); diff --git a/cypress/support/pages/backoffice/user/index/user-index-page.ts b/cypress/support/pages/backoffice/user/index/user-index-page.ts index 3bb81328..7cb2a067 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-page.ts @@ -9,7 +9,7 @@ import { UserIndexRepository } from './user-index-repository'; export class UserIndexPage extends BackofficePage { @inject(UserIndexRepository) private repository: UserIndexRepository; - protected PAGE_URL: string = '/user'; + protected PAGE_URL = '/user'; createNewUser = (): void => { this.repository.getAddNewUserButton().click(); diff --git a/cypress/support/pages/backoffice/user/update/user-update-page.ts b/cypress/support/pages/backoffice/user/update/user-update-page.ts index 44a73f84..9945a023 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-page.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-page.ts @@ -9,8 +9,8 @@ import { UserUpdateRepository } from './user-update-repository'; export class UserUpdatePage extends BackofficePage { @inject(UserUpdateRepository) private repository: UserUpdateRepository; - protected PAGE_URL: string = '/user/edit/update'; - DEFAULT_PASSWORD: string = 'Change123@_'; + protected PAGE_URL = '/user/edit/update'; + protected DEFAULT_PASSWORD = 'Change123@_'; checkMerchantAgentCheckbox = (): void => { this.getAgentMerchantCheckbox().check(); diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts index 167f7971..ab867aa1 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -9,7 +9,7 @@ import { AgentDashboardRepository } from './agent-dashboard-repository'; export class AgentDashboardPage extends MpPage { @inject(AgentDashboardRepository) private repository: AgentDashboardRepository; - protected PAGE_URL: string = '/agent-dashboard-merchant-portal-gui/merchant-users'; + protected PAGE_URL = '/agent-dashboard-merchant-portal-gui/merchant-users'; getDashboardSidebarSelector = (): Cypress.Chainable => { return this.repository.getDashboardSidebarSelector(); diff --git a/cypress/support/pages/mp/agent-login/agent-login-page.ts b/cypress/support/pages/mp/agent-login/agent-login-page.ts index c53631f8..24a46f19 100644 --- a/cypress/support/pages/mp/agent-login/agent-login-page.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-page.ts @@ -9,7 +9,7 @@ import { AgentLoginRepository } from './agent-login-repository'; export class AgentLoginPage extends MpPage { @inject(AgentLoginRepository) private repository: AgentLoginRepository; - protected PAGE_URL: string = '/agent-security-merchant-portal-gui/login'; + protected PAGE_URL = '/agent-security-merchant-portal-gui/login'; login = (username: string, password: string): void => { this.repository.getEmailInput().clear().type(username); diff --git a/cypress/support/pages/mp/dashboard/dashboard-page.ts b/cypress/support/pages/mp/dashboard/dashboard-page.ts index 39abca0f..2ae32206 100644 --- a/cypress/support/pages/mp/dashboard/dashboard-page.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-page.ts @@ -9,7 +9,7 @@ import { DashboardRepository } from './dashboard-repository'; export class DashboardPage extends MpPage { @inject(DashboardRepository) private repository: DashboardRepository; - protected PAGE_URL: string = '/dashboard-merchant-portal-gui/dashboard'; + protected PAGE_URL = '/dashboard-merchant-portal-gui/dashboard'; logout = (): void => { this.repository.getUserProfileMenu().click(); diff --git a/cypress/support/pages/mp/login/login-page.ts b/cypress/support/pages/mp/login/login-page.ts index 225c0f10..80f60b02 100644 --- a/cypress/support/pages/mp/login/login-page.ts +++ b/cypress/support/pages/mp/login/login-page.ts @@ -9,7 +9,7 @@ import { LoginRepository } from './login-repository'; export class LoginPage extends MpPage { @inject(LoginRepository) private repository: LoginRepository; - protected PAGE_URL: string = '/security-merchant-portal-gui/login'; + protected PAGE_URL = '/security-merchant-portal-gui/login'; login = (username: string, password: string): void => { cy.visitMerchantPortal(this.PAGE_URL); diff --git a/cypress/support/pages/mp/offers/offers-page.ts b/cypress/support/pages/mp/offers/offers-page.ts index 3c18c032..eb3860de 100644 --- a/cypress/support/pages/mp/offers/offers-page.ts +++ b/cypress/support/pages/mp/offers/offers-page.ts @@ -9,7 +9,7 @@ import { OffersRepository } from './offers-repository'; export class OffersPage extends MpPage { @inject(OffersRepository) private repository: OffersRepository; - protected PAGE_URL: string = '/product-offer-merchant-portal-gui/product-offers'; + protected PAGE_URL = '/product-offer-merchant-portal-gui/product-offers'; findOffer = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); diff --git a/cypress/support/pages/mp/products/products-page.ts b/cypress/support/pages/mp/products/products-page.ts index 3bdbd5dc..1fcae151 100644 --- a/cypress/support/pages/mp/products/products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -9,7 +9,7 @@ import { ProductsRepository } from './products-repository'; export class ProductsPage extends MpPage { @inject(ProductsRepository) private repository: ProductsRepository; - protected PAGE_URL: string = '/product-merchant-portal-gui/products'; + protected PAGE_URL = '/product-merchant-portal-gui/products'; findProduct = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); diff --git a/cypress/support/pages/mp/profile/profile-page.ts b/cypress/support/pages/mp/profile/profile-page.ts index 90cdc219..6fc7db1d 100644 --- a/cypress/support/pages/mp/profile/profile-page.ts +++ b/cypress/support/pages/mp/profile/profile-page.ts @@ -9,7 +9,7 @@ import { ProfileRepository } from './profile-repository'; export class ProfilePage extends MpPage { @inject(ProfileRepository) private repository: ProfileRepository; - protected PAGE_URL: string = '/merchant-profile-merchant-portal-gui/profile'; + protected PAGE_URL = '/merchant-profile-merchant-portal-gui/profile'; updateMerchantPhoneNumber = (phone?: string) => { this.repository diff --git a/cypress/support/pages/mp/sales/sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts index a30e5fa4..621a289c 100644 --- a/cypress/support/pages/mp/sales/sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -9,7 +9,7 @@ import { SalesOrdersRepository } from './sales-orders-repository'; export class SalesOrdersPage extends MpPage { @inject(SalesOrdersRepository) private repository: SalesOrdersRepository; - protected PAGE_URL: string = '/sales-merchant-portal-gui/orders'; + protected PAGE_URL = '/sales-merchant-portal-gui/orders'; findOrder = (query: string): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); diff --git a/cypress/support/pages/yves/agent-login/agent-login-page.ts b/cypress/support/pages/yves/agent-login/agent-login-page.ts index 6b566cbc..bee7fad3 100644 --- a/cypress/support/pages/yves/agent-login/agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -9,7 +9,7 @@ import { AgentLoginRepository } from './agent-login-repository'; export class AgentLoginPage extends YvesPage { @inject(TYPES.AgentLoginRepository) private repository: AgentLoginRepository; - protected PAGE_URL: string = '/agent/login'; + protected PAGE_URL = '/agent/login'; login = (username: string, password: string): void => { this.repository.getLoginEmailInput().clear().type(username); diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index b3481a73..c5b19e33 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -9,7 +9,7 @@ import { CartRepository } from './cart-repository'; export class CartPage extends YvesPage { @inject(TYPES.CartRepository) private repository: CartRepository; - protected PAGE_URL: string = '/cart'; + protected PAGE_URL = '/cart'; quickAddToCart = (sku: string, quantity?: number): void => { this.repository.getQuickAddToCartSkuField().clear().type(sku); diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts index f2a5274c..12093126 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -9,7 +9,7 @@ import { CheckoutAddressRepository } from './checkout-address-repository'; export class CheckoutAddressPage extends YvesPage { @inject(TYPES.CheckoutAddressRepository) private repository: CheckoutAddressRepository; - protected PAGE_URL: string = '/checkout/address'; + protected PAGE_URL = '/checkout/address'; fillShippingAddress = (idCustomerAddress?: number): void => { if (idCustomerAddress) { diff --git a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts index 6ee11613..4f99eedc 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -9,7 +9,7 @@ import { CheckoutCustomerRepository } from './checkout-customer-repository'; export class CheckoutCustomerPage extends YvesPage { @inject(TYPES.CheckoutCustomerRepository) private repository: CheckoutCustomerRepository; - protected PAGE_URL: string = '/checkout/customer'; + protected PAGE_URL = '/checkout/customer'; checkoutAsGuest = (): string => { const guest = { diff --git a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts index c18c2e82..c7652beb 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -9,7 +9,7 @@ import { CheckoutPaymentRepository } from './checkout-payment-repository'; export class CheckoutPaymentPage extends YvesPage { @inject(TYPES.CheckoutPaymentRepository) private repository: CheckoutPaymentRepository; - protected PAGE_URL: string = '/checkout/payment'; + protected PAGE_URL = '/checkout/payment'; setDummyPaymentMethod = (): void => { this.repository.getDummyPaymentInvoiceRadio().click({ force: true }); diff --git a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts index 765086c5..3f24dbbe 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -9,7 +9,7 @@ import { CheckoutShipmentRepository } from './checkout-shipment-repository'; export class CheckoutShipmentPage extends YvesPage { @inject(TYPES.CheckoutShipmentRepository) private repository: CheckoutShipmentRepository; - protected PAGE_URL: string = '/checkout/shipment'; + protected PAGE_URL = '/checkout/shipment'; setStandardShippingMethod = (): void => { this.repository.getMultiShipmentGroups().each(($shipmentItem, index) => { diff --git a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts index 33e0e814..bd46991c 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -9,7 +9,7 @@ import { CheckoutSummaryRepository } from './checkout-summary-repository'; export class CheckoutSummaryPage extends YvesPage { @inject(TYPES.CheckoutSummaryRepository) private repository: CheckoutSummaryRepository; - protected PAGE_URL: string = '/checkout/summary'; + protected PAGE_URL = '/checkout/summary'; placeOrder = (): void => { this.repository.getaAcceptTermsAndConditionsCheckbox().check({ force: true }); diff --git a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts index a75e336d..38f2729b 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -9,7 +9,7 @@ import { CommentCartRepository } from './comment-cart-repository'; export class CommentCartPage extends YvesPage { @inject(TYPES.CommentCartRepository) private repository: CommentCartRepository; - protected PAGE_URL: string = '/cart'; + protected PAGE_URL = '/cart'; addComment = (commentMessage: string): void => { this.repository.getAddCommentForm().last().find('textarea').clear().type(commentMessage); diff --git a/cypress/support/pages/yves/login/login-page.ts b/cypress/support/pages/yves/login/login-page.ts index 6ee8f587..ad9f6087 100644 --- a/cypress/support/pages/yves/login/login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -9,7 +9,7 @@ import { LoginRepository } from './login-repository'; export class LoginPage extends YvesPage { @inject(TYPES.LoginRepository) private repository: LoginRepository; - protected PAGE_URL: string = '/login'; + protected PAGE_URL = '/login'; login = (email: string, password: string): void => { this.repository.getLoginEmailInput().clear().type(email); diff --git a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts index 84e04b3e..02f71db9 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -9,7 +9,7 @@ import { MultiCartRepository } from './multi-cart-repository'; export class MultiCartPage extends YvesPage { @inject(TYPES.MultiCartRepository) private repository: MultiCartRepository; - protected PAGE_URL: string = '/multi-cart'; + protected PAGE_URL = '/multi-cart'; createCart = (name?: string): void => { cy.visit(`${this.PAGE_URL}/create`); diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index 867b57c2..76dc9244 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -1,7 +1,6 @@ -import { autoWired } from '@utils'; +import { autoWired, CliHelper } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { CliHelper } from '../../helpers/cli-helper'; import { CartPage, CheckoutAddressPage, @@ -14,15 +13,13 @@ import { @injectable() @autoWired export class CheckoutMpScenario { - constructor( - @inject(CartPage) private cartPage: CartPage, - @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage, - @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage, - @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage, - @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage, - @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage, - @inject(CliHelper) private cliHelper: CliHelper - ) {} + @inject(CartPage) private cartPage: CartPage; + @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage; + @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage; + @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage; + @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage; + @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage; + @inject(CliHelper) private cliHelper: CliHelper; execute = (isGuest: boolean = false, isMultiShipment: boolean = false): void => { this.cartPage.visit(); diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index c582b1c9..7fe7810a 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -1,7 +1,6 @@ -import { autoWired } from '@utils'; +import { autoWired, CliHelper } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { CliHelper } from '../../helpers/cli-helper'; import { CartPage, CheckoutAddressPage, @@ -14,15 +13,13 @@ import { @injectable() @autoWired export class CheckoutScenario { - constructor( - @inject(CartPage) private cartPage: CartPage, - @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage, - @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage, - @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage, - @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage, - @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage, - @inject(CliHelper) private cliHelper: CliHelper - ) {} + @inject(CartPage) private cartPage: CartPage; + @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage; + @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage; + @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage; + @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage; + @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage; + @inject(CliHelper) private cliHelper: CliHelper; execute = (isGuest: boolean = false, isMultiShipment: boolean = false, idCustomerAddress?: number): void => { this.cartPage.visit(); diff --git a/cypress/support/helpers/cli-helper.ts b/cypress/support/utils/cli-helper.ts similarity index 91% rename from cypress/support/helpers/cli-helper.ts rename to cypress/support/utils/cli-helper.ts index 54aaf946..15edd904 100644 --- a/cypress/support/helpers/cli-helper.ts +++ b/cypress/support/utils/cli-helper.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import { autoWired } from '../utils/inversify/auto-wired'; +import { autoWired } from './inversify'; @injectable() @autoWired diff --git a/cypress/support/utils/index.ts b/cypress/support/utils/index.ts index 2d0ff09e..8d54c9bb 100644 --- a/cypress/support/utils/index.ts +++ b/cypress/support/utils/index.ts @@ -1 +1,2 @@ +export * from './cli-helper'; export * from './inversify'; From 3d7289f4f160049fd4e09e2479d367652fdf9f84 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 19:45:27 +0200 Subject: [PATCH 04/16] tmp --- .../yves/agent-login/agent-login-page.ts | 4 +- cypress/support/pages/yves/cart/cart-page.ts | 4 +- .../checkout/address/checkout-address-page.ts | 4 +- .../customer/checkout-customer-page.ts | 4 +- .../checkout/payment/checkout-payment-page.ts | 4 +- .../shipment/checkout-shipment-page.ts | 4 +- .../checkout/summary/checkout-summary-page.ts | 4 +- .../yves/comment/cart/comment-cart-page.ts | 4 +- .../support/pages/yves/login/login-page.ts | 4 +- .../pages/yves/multi-cart/multi-cart-page.ts | 4 +- .../mp/merchant-agent-login-user-scenario.ts | 2 +- .../mp/merchant-user-login-scenario.ts | 2 +- .../scenarios/yves/agent-login-scenario.ts | 2 +- .../scenarios/yves/checkout-mp-scenario.ts | 8 +-- .../scenarios/yves/checkout-scenario.ts | 8 +-- .../scenarios/yves/customer-login-scenario.ts | 2 +- cypress/support/utils/inversify/auto-wired.ts | 4 +- .../utils/inversify/inversify.config.ts | 56 +++++++++---------- cypress/support/utils/inversify/types.ts | 26 ++++----- 19 files changed, 73 insertions(+), 77 deletions(-) diff --git a/cypress/support/pages/yves/agent-login/agent-login-page.ts b/cypress/support/pages/yves/agent-login/agent-login-page.ts index bee7fad3..3eaed2c0 100644 --- a/cypress/support/pages/yves/agent-login/agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../yves-page'; @@ -7,7 +7,7 @@ import { AgentLoginRepository } from './agent-login-repository'; @injectable() @autoWired export class AgentLoginPage extends YvesPage { - @inject(TYPES.AgentLoginRepository) private repository: AgentLoginRepository; + @inject(REPOSITORIES.AgentLoginRepository) private repository: AgentLoginRepository; protected PAGE_URL = '/agent/login'; diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index c5b19e33..2ca6728a 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../yves-page'; @@ -7,7 +7,7 @@ import { CartRepository } from './cart-repository'; @injectable() @autoWired export class CartPage extends YvesPage { - @inject(TYPES.CartRepository) private repository: CartRepository; + @inject(REPOSITORIES.CartRepository) private repository: CartRepository; protected PAGE_URL = '/cart'; diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts index 12093126..a01af1ba 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../../yves-page'; @@ -7,7 +7,7 @@ import { CheckoutAddressRepository } from './checkout-address-repository'; @injectable() @autoWired export class CheckoutAddressPage extends YvesPage { - @inject(TYPES.CheckoutAddressRepository) private repository: CheckoutAddressRepository; + @inject(REPOSITORIES.CheckoutAddressRepository) private repository: CheckoutAddressRepository; protected PAGE_URL = '/checkout/address'; diff --git a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts index 4f99eedc..0bc83261 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../../yves-page'; @@ -7,7 +7,7 @@ import { CheckoutCustomerRepository } from './checkout-customer-repository'; @injectable() @autoWired export class CheckoutCustomerPage extends YvesPage { - @inject(TYPES.CheckoutCustomerRepository) private repository: CheckoutCustomerRepository; + @inject(REPOSITORIES.CheckoutCustomerRepository) private repository: CheckoutCustomerRepository; protected PAGE_URL = '/checkout/customer'; diff --git a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts index c7652beb..6093c09f 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../../yves-page'; @@ -7,7 +7,7 @@ import { CheckoutPaymentRepository } from './checkout-payment-repository'; @injectable() @autoWired export class CheckoutPaymentPage extends YvesPage { - @inject(TYPES.CheckoutPaymentRepository) private repository: CheckoutPaymentRepository; + @inject(REPOSITORIES.CheckoutPaymentRepository) private repository: CheckoutPaymentRepository; protected PAGE_URL = '/checkout/payment'; diff --git a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts index 3f24dbbe..fa394e33 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../../yves-page'; @@ -7,7 +7,7 @@ import { CheckoutShipmentRepository } from './checkout-shipment-repository'; @injectable() @autoWired export class CheckoutShipmentPage extends YvesPage { - @inject(TYPES.CheckoutShipmentRepository) private repository: CheckoutShipmentRepository; + @inject(REPOSITORIES.CheckoutShipmentRepository) private repository: CheckoutShipmentRepository; protected PAGE_URL = '/checkout/shipment'; diff --git a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts index bd46991c..78c6774d 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../../yves-page'; @@ -7,7 +7,7 @@ import { CheckoutSummaryRepository } from './checkout-summary-repository'; @injectable() @autoWired export class CheckoutSummaryPage extends YvesPage { - @inject(TYPES.CheckoutSummaryRepository) private repository: CheckoutSummaryRepository; + @inject(REPOSITORIES.CheckoutSummaryRepository) private repository: CheckoutSummaryRepository; protected PAGE_URL = '/checkout/summary'; diff --git a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts index 38f2729b..2ac009a8 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../../yves-page'; @@ -7,7 +7,7 @@ import { CommentCartRepository } from './comment-cart-repository'; @injectable() @autoWired export class CommentCartPage extends YvesPage { - @inject(TYPES.CommentCartRepository) private repository: CommentCartRepository; + @inject(REPOSITORIES.CommentCartRepository) private repository: CommentCartRepository; protected PAGE_URL = '/cart'; diff --git a/cypress/support/pages/yves/login/login-page.ts b/cypress/support/pages/yves/login/login-page.ts index ad9f6087..db77e5ea 100644 --- a/cypress/support/pages/yves/login/login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../yves-page'; @@ -7,7 +7,7 @@ import { LoginRepository } from './login-repository'; @injectable() @autoWired export class LoginPage extends YvesPage { - @inject(TYPES.LoginRepository) private repository: LoginRepository; + @inject(REPOSITORIES.LoginRepository) private repository: LoginRepository; protected PAGE_URL = '/login'; diff --git a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts index 02f71db9..d45c237f 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -1,4 +1,4 @@ -import { TYPES, autoWired } from '@utils'; +import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { YvesPage } from '../yves-page'; @@ -7,7 +7,7 @@ import { MultiCartRepository } from './multi-cart-repository'; @injectable() @autoWired export class MultiCartPage extends YvesPage { - @inject(TYPES.MultiCartRepository) private repository: MultiCartRepository; + @inject(REPOSITORIES.MultiCartRepository) private repository: MultiCartRepository; protected PAGE_URL = '/multi-cart'; diff --git a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts index a0cab39d..ca4b7a55 100644 --- a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts @@ -1,6 +1,6 @@ +import { AgentLoginPage } from '@pages/mp'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { AgentLoginPage } from '../../pages/mp'; @injectable() @autoWired diff --git a/cypress/support/scenarios/mp/merchant-user-login-scenario.ts b/cypress/support/scenarios/mp/merchant-user-login-scenario.ts index ec144169..58602dea 100644 --- a/cypress/support/scenarios/mp/merchant-user-login-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-user-login-scenario.ts @@ -1,6 +1,6 @@ +import { LoginPage } from '@pages/mp'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { LoginPage } from '../../pages/mp'; @injectable() @autoWired diff --git a/cypress/support/scenarios/yves/agent-login-scenario.ts b/cypress/support/scenarios/yves/agent-login-scenario.ts index ace0e3af..1e5bdc62 100644 --- a/cypress/support/scenarios/yves/agent-login-scenario.ts +++ b/cypress/support/scenarios/yves/agent-login-scenario.ts @@ -1,6 +1,6 @@ +import { AgentLoginPage } from '@pages/yves'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { AgentLoginPage } from '../../pages/yves'; @injectable() @autoWired diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index 76dc9244..e58e29ae 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -1,6 +1,3 @@ -import { autoWired, CliHelper } from '@utils'; -import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; import { CartPage, CheckoutAddressPage, @@ -8,7 +5,10 @@ import { CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, -} from '../../pages/yves'; +} from '@pages/yves'; +import { autoWired, CliHelper } from '@utils'; +import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 7fe7810a..9f684f96 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -1,6 +1,3 @@ -import { autoWired, CliHelper } from '@utils'; -import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; import { CartPage, CheckoutAddressPage, @@ -8,7 +5,10 @@ import { CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, -} from '../../pages/yves'; +} from '@pages/yves'; +import { autoWired, CliHelper } from '@utils'; +import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index b0f69619..a2d36042 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -1,6 +1,6 @@ +import { LoginPage } from '@pages/yves'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { LoginPage } from '../../pages/yves'; @injectable() @autoWired diff --git a/cypress/support/utils/inversify/auto-wired.ts b/cypress/support/utils/inversify/auto-wired.ts index bd464baf..eb9495d3 100644 --- a/cypress/support/utils/inversify/auto-wired.ts +++ b/cypress/support/utils/inversify/auto-wired.ts @@ -1,7 +1,7 @@ +import { interfaces } from 'inversify'; import { container } from './inversify.config'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function autoWired(...services: any[]): void { +export function autoWired(...services: interfaces.ServiceIdentifier[]): void { services.forEach((service) => { container.bind(service).toSelf(); }); diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index 08dd493d..eb6a484c 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -1,44 +1,42 @@ +import { Container, interfaces } from 'inversify'; import 'reflect-metadata'; -import { Container } from 'inversify'; -import { TYPES } from './types'; +import { REPOSITORIES } from './types'; -import { B2bMultiCartRepository } from '../../pages/yves/multi-cart/repositories/b2b-multi-cart-repository'; -import { B2bCommentCartRepository } from '../../pages/yves/comment/cart/repositories/b2b-comment-cart-repository'; -import { SuiteMultiCartRepository } from '../../pages/yves/multi-cart/repositories/suite-multi-cart-repository'; -import { SuiteCommentCartRepository } from '../../pages/yves/comment/cart/repositories/suite-comment-cart-repository'; import { SuiteAgentLoginRepository } from '../../pages/yves/agent-login/repositories/suite-agent-login-repository'; -import { SuiteLoginRepository } from '../../pages/yves/login/repositories/suite-login-repository'; -import { B2bLoginRepository } from '../../pages/yves/login/repositories/b2b-login-repository'; +import { B2bCartRepository } from '../../pages/yves/cart/repositories/b2b-cart-repository'; import { SuiteCartRepository } from '../../pages/yves/cart/repositories/suite-cart-repository'; -import { SuiteCheckoutCustomerRepository } from '../../pages/yves/checkout/customer/repositories/suite-checkout-customer-repository'; import { SuiteCheckoutAddressRepository } from '../../pages/yves/checkout/address/repositories/suite-checkout-address-repository'; -import { SuiteCheckoutShipmentRepository } from '../../pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository'; +import { SuiteCheckoutCustomerRepository } from '../../pages/yves/checkout/customer/repositories/suite-checkout-customer-repository'; import { SuiteCheckoutPaymentRepository } from '../../pages/yves/checkout/payment/repositories/suite-checkout-payment-repository'; +import { SuiteCheckoutShipmentRepository } from '../../pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository'; import { SuiteCheckoutSummaryRepository } from '../../pages/yves/checkout/summary/repositories/suite-checkout-summary-repository'; -import { B2bCartRepository } from '../../pages/yves/cart/repositories/b2b-cart-repository'; +import { B2bCommentCartRepository } from '../../pages/yves/comment/cart/repositories/b2b-comment-cart-repository'; +import { SuiteCommentCartRepository } from '../../pages/yves/comment/cart/repositories/suite-comment-cart-repository'; +import { B2bLoginRepository } from '../../pages/yves/login/repositories/b2b-login-repository'; +import { SuiteLoginRepository } from '../../pages/yves/login/repositories/suite-login-repository'; +import { B2bMultiCartRepository } from '../../pages/yves/multi-cart/repositories/b2b-multi-cart-repository'; +import { SuiteMultiCartRepository } from '../../pages/yves/multi-cart/repositories/suite-multi-cart-repository'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -type ClassConstructor = new (...args: any[]) => any; -type BindingsMap = { [key: string]: ClassConstructor }; +type BindingsMap = { [K in REPOSITORIES]?: interfaces.Newable }; const suiteMappings: BindingsMap = { - [TYPES.LoginRepository]: SuiteLoginRepository, - [TYPES.CartRepository]: SuiteCartRepository, - [TYPES.MultiCartRepository]: SuiteMultiCartRepository, - [TYPES.CommentCartRepository]: SuiteCommentCartRepository, - [TYPES.CheckoutCustomerRepository]: SuiteCheckoutCustomerRepository, - [TYPES.CheckoutAddressRepository]: SuiteCheckoutAddressRepository, - [TYPES.CheckoutShipmentRepository]: SuiteCheckoutShipmentRepository, - [TYPES.CheckoutPaymentRepository]: SuiteCheckoutPaymentRepository, - [TYPES.CheckoutSummaryRepository]: SuiteCheckoutSummaryRepository, - [TYPES.AgentLoginRepository]: SuiteAgentLoginRepository, + [REPOSITORIES.LoginRepository]: SuiteLoginRepository, + [REPOSITORIES.CartRepository]: SuiteCartRepository, + [REPOSITORIES.MultiCartRepository]: SuiteMultiCartRepository, + [REPOSITORIES.CommentCartRepository]: SuiteCommentCartRepository, + [REPOSITORIES.CheckoutCustomerRepository]: SuiteCheckoutCustomerRepository, + [REPOSITORIES.CheckoutAddressRepository]: SuiteCheckoutAddressRepository, + [REPOSITORIES.CheckoutShipmentRepository]: SuiteCheckoutShipmentRepository, + [REPOSITORIES.CheckoutPaymentRepository]: SuiteCheckoutPaymentRepository, + [REPOSITORIES.CheckoutSummaryRepository]: SuiteCheckoutSummaryRepository, + [REPOSITORIES.AgentLoginRepository]: SuiteAgentLoginRepository, }; const b2bMappings: BindingsMap = { - [TYPES.LoginRepository]: B2bLoginRepository, - [TYPES.CartRepository]: B2bCartRepository, - [TYPES.MultiCartRepository]: B2bMultiCartRepository, - [TYPES.CommentCartRepository]: B2bCommentCartRepository, + [REPOSITORIES.LoginRepository]: B2bLoginRepository, + [REPOSITORIES.CartRepository]: B2bCartRepository, + [REPOSITORIES.MultiCartRepository]: B2bMultiCartRepository, + [REPOSITORIES.CommentCartRepository]: B2bCommentCartRepository, }; const container = new Container(); @@ -53,7 +51,7 @@ if (repositoryId === 'b2b') { function applyRepositoryBindings(bindings: BindingsMap) { for (const [type, implementation] of Object.entries(bindings)) { - container.bind(type).to(implementation as ClassConstructor); + container.bind(type).to(implementation); } } diff --git a/cypress/support/utils/inversify/types.ts b/cypress/support/utils/inversify/types.ts index 463702b3..69cfb2be 100644 --- a/cypress/support/utils/inversify/types.ts +++ b/cypress/support/utils/inversify/types.ts @@ -1,14 +1,12 @@ -const TYPES = { - LoginRepository: 'LoginRepository', - CartRepository: 'CartRepository', - CommentCartRepository: 'CommentCartRepository', - MultiCartRepository: 'MultiCartRepository', - CheckoutAddressRepository: 'CheckoutAddressRepository', - CheckoutCustomerRepository: 'CheckoutCustomerRepository', - CheckoutShipmentRepository: 'CheckoutShipmentRepository', - CheckoutPaymentRepository: 'CheckoutPaymentRepository', - CheckoutSummaryRepository: 'CheckoutSummaryRepository', - AgentLoginRepository: 'AgentLoginRepository', -}; - -export { TYPES }; +export const enum REPOSITORIES { + LoginRepository = 'LoginRepository', + CartRepository = 'CartRepository', + CommentCartRepository = 'CommentCartRepository', + MultiCartRepository = 'MultiCartRepository', + CheckoutAddressRepository = 'CheckoutAddressRepository', + CheckoutCustomerRepository = 'CheckoutCustomerRepository', + CheckoutShipmentRepository = 'CheckoutShipmentRepository', + CheckoutPaymentRepository = 'CheckoutPaymentRepository', + CheckoutSummaryRepository = 'CheckoutSummaryRepository', + AgentLoginRepository = 'AgentLoginRepository', +} From 3141810db51eaee1064b3bd51eaee51bff9f10ae Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 20:04:23 +0200 Subject: [PATCH 05/16] fix types --- .../order-management-suite-1.cy.ts | 33 +++++++++---------- .../return-management-suite-1.cy.ts | 5 +-- .../marketplace-agent-assist-suite-1.cy.ts | 15 ++++----- .../marketplace-agent-assist-suite-2.cy.ts | 9 ++--- .../e2e/yves/checkout/checkout-suite-1.cy.ts | 5 +-- .../e2e/yves/comments/comments-suite-1.cy.ts | 5 +-- .../backoffice/user-login-scenario.ts | 2 +- cypress/support/types/backoffice/index.ts | 2 ++ .../fixture-types.ts | 0 .../backoffice/order-management/index.ts | 1 + .../transfer/transfer-types.ts | 0 .../fixture-types.ts | 0 .../backoffice/return-management/index.ts | 1 + .../transfer/transfer-types.ts | 0 cypress/support/types/mp/index.ts | 1 + .../mp/marketplace-agent-assist/index.ts | 1 + cypress/support/types/yves/checkout/index.ts | 1 + cypress/support/types/yves/comments/index.ts | 1 + cypress/support/types/yves/index.ts | 2 ++ tsconfig.json | 3 +- 20 files changed, 40 insertions(+), 47 deletions(-) create mode 100644 cypress/support/types/backoffice/index.ts rename cypress/support/types/backoffice/{order-managment => order-management}/fixture-types.ts (100%) create mode 100644 cypress/support/types/backoffice/order-management/index.ts rename cypress/support/types/backoffice/{order-managment => order-management}/transfer/transfer-types.ts (100%) rename cypress/support/types/backoffice/{return-managment => return-management}/fixture-types.ts (100%) create mode 100644 cypress/support/types/backoffice/return-management/index.ts rename cypress/support/types/backoffice/{return-managment => return-management}/transfer/transfer-types.ts (100%) create mode 100644 cypress/support/types/mp/index.ts create mode 100644 cypress/support/types/mp/marketplace-agent-assist/index.ts create mode 100644 cypress/support/types/yves/checkout/index.ts create mode 100644 cypress/support/types/yves/comments/index.ts create mode 100644 cypress/support/types/yves/index.ts diff --git a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts index 4375145d..c43bf42b 100644 --- a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts @@ -1,12 +1,9 @@ +import { OrderManagementStaticFixtures, OrderManagementSuite1DynamicFixtures } from '@intefaces/backoffice'; import { SalesIndexPage } from '@pages/backoffice'; import { CartPage } from '@pages/yves'; import { UserLoginScenario } from '@scenarios/backoffice'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -import { - OrderManagementStaticFixtures, - OrderManagementSuite1DynamicFixtures, -} from '../../../support/types/backoffice/order-managment/fixture-types'; describe('order management suite 1', { tags: ['@order-management'] }, (): void => { const cartPage = container.get(CartPage); @@ -25,25 +22,25 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = it('should be able to create an order by existing customer', (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - // checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); - // cy.contains('Your order has been placed successfully!'); + checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); + cy.contains('Your order has been placed successfully!'); - // userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - // salesIndexPage.viewLastPlacedOrder(); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + salesIndexPage.viewLastPlacedOrder(); - // cy.get('body').contains(dynamicFixtures.product.name); + cy.get('body').contains(dynamicFixtures.product.name); }); - // it('should be able to create an order by guest', (): void => { - // cartPage.visit(); - // cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); + it('should be able to create an order by guest', (): void => { + cartPage.visit(); + cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); - // checkoutScenario.execute(true); - // cy.contains('Your order has been placed successfully!'); + checkoutScenario.execute(true); + cy.contains('Your order has been placed successfully!'); - // userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - // salesIndexPage.viewLastPlacedOrder(); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + salesIndexPage.viewLastPlacedOrder(); - // cy.get('body').contains(dynamicFixtures.product.name); - // }); + cy.get('body').contains(dynamicFixtures.product.name); + }); }); diff --git a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts index b8cd7f5a..49a4dc8e 100644 --- a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts @@ -1,11 +1,8 @@ +import { ReturnManagementStaticFixtures, ReturnManagementSuite1DynamicFixtures } from '@intefaces/backoffice'; import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '@pages/backoffice'; import { UserLoginScenario } from '@scenarios/backoffice'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -import { - ReturnManagementStaticFixtures, - ReturnManagementSuite1DynamicFixtures, -} from '../../../support/types/backoffice/return-managment/fixture-types'; describe('return management suite 1', { tags: ['@return-management'] }, (): void => { const salesIndexPage: SalesIndexPage = container.get(SalesIndexPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts index 827dcf4f..b9ad26c6 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts @@ -1,18 +1,15 @@ +import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite1DynamicFixtures } from '@intefaces/mp'; import { IndexPage, UserIndexPage, UserUpdatePage } from '@pages/backoffice'; -import { AgentLoginPage, LoginPage } from '@pages/yves'; -import { UserLoginScenario } from '@scenarios/backoffice'; -import { container } from '@utils'; import { AgentDashboardPage, DashboardPage, AgentLoginPage as MpAgentLoginPage, LoginPage as MpLoginPage, -} from '../../../support/pages/mp'; -import { ImpersonateAsMerchantUserScenario, MerchantAgentLoginUserScenario } from '../../../support/scenarios/mp'; -import { - MarketplaceAgentAssistStaticFixtures, - MarketplaceAgentAssistSuite1DynamicFixtures, -} from '../../../support/types/mp/marketplace-agent-assist/fixture-types'; +} from '@pages/mp'; +import { AgentLoginPage, LoginPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { ImpersonateAsMerchantUserScenario, MerchantAgentLoginUserScenario } from '@scenarios/mp'; +import { container } from '@utils'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts index 459fb401..444389d9 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts @@ -1,14 +1,11 @@ +import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite2DynamicFixtures } from '@intefaces/mp'; import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { OffersPage, ProductsPage, ProfilePage, SalesOrdersPage } from '@pages/mp'; import { CartPage } from '@pages/yves'; import { UserLoginScenario } from '@scenarios/backoffice'; +import { ImpersonateAsMerchantUserScenario } from '@scenarios/mp'; import { CheckoutMpScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -import { OffersPage, ProductsPage, ProfilePage, SalesOrdersPage } from '../../../support/pages/mp'; -import { ImpersonateAsMerchantUserScenario } from '../../../support/scenarios/mp'; -import { - MarketplaceAgentAssistStaticFixtures, - MarketplaceAgentAssistSuite2DynamicFixtures, -} from '../../../support/types/mp/marketplace-agent-assist/fixture-types'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts index d78a26a6..868b0152 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -1,10 +1,7 @@ +import { CheckoutStaticFixtures, CheckoutSuite1DynamicFixtures } from '@intefaces/yves'; import { CartPage } from '@pages/yves'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -import { - CheckoutStaticFixtures, - CheckoutSuite1DynamicFixtures, -} from '../../../support/types/yves/checkout/fixture-types'; describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { const cartPage: CartPage = container.get(CartPage); diff --git a/cypress/e2e/yves/comments/comments-suite-1.cy.ts b/cypress/e2e/yves/comments/comments-suite-1.cy.ts index 67653952..1707014a 100644 --- a/cypress/e2e/yves/comments/comments-suite-1.cy.ts +++ b/cypress/e2e/yves/comments/comments-suite-1.cy.ts @@ -1,10 +1,7 @@ +import { CommentsSuite1DynamicFixtures, CommentsSuite1StaticFixtures } from '@intefaces/yves'; import { CommentCartPage, MultiCartPage } from '@pages/yves'; import { CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -import { - CommentsSuite1DynamicFixtures, - CommentsSuite1StaticFixtures, -} from '../../../support/types/yves/comments/fixture-types'; describe('comments suite 1', { tags: ['@comments'] }, (): void => { const multiCartPage: MultiCartPage = container.get(MultiCartPage); diff --git a/cypress/support/scenarios/backoffice/user-login-scenario.ts b/cypress/support/scenarios/backoffice/user-login-scenario.ts index 064da121..b261c60e 100644 --- a/cypress/support/scenarios/backoffice/user-login-scenario.ts +++ b/cypress/support/scenarios/backoffice/user-login-scenario.ts @@ -1,6 +1,6 @@ +import { LoginPage } from '@pages/backoffice'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { LoginPage } from '../../pages/backoffice'; @injectable() @autoWired diff --git a/cypress/support/types/backoffice/index.ts b/cypress/support/types/backoffice/index.ts new file mode 100644 index 00000000..b8464999 --- /dev/null +++ b/cypress/support/types/backoffice/index.ts @@ -0,0 +1,2 @@ +export * from './order-management'; +export * from './return-management'; diff --git a/cypress/support/types/backoffice/order-managment/fixture-types.ts b/cypress/support/types/backoffice/order-management/fixture-types.ts similarity index 100% rename from cypress/support/types/backoffice/order-managment/fixture-types.ts rename to cypress/support/types/backoffice/order-management/fixture-types.ts diff --git a/cypress/support/types/backoffice/order-management/index.ts b/cypress/support/types/backoffice/order-management/index.ts new file mode 100644 index 00000000..fbb9e013 --- /dev/null +++ b/cypress/support/types/backoffice/order-management/index.ts @@ -0,0 +1 @@ +export * from './fixture-types'; diff --git a/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts b/cypress/support/types/backoffice/order-management/transfer/transfer-types.ts similarity index 100% rename from cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts rename to cypress/support/types/backoffice/order-management/transfer/transfer-types.ts diff --git a/cypress/support/types/backoffice/return-managment/fixture-types.ts b/cypress/support/types/backoffice/return-management/fixture-types.ts similarity index 100% rename from cypress/support/types/backoffice/return-managment/fixture-types.ts rename to cypress/support/types/backoffice/return-management/fixture-types.ts diff --git a/cypress/support/types/backoffice/return-management/index.ts b/cypress/support/types/backoffice/return-management/index.ts new file mode 100644 index 00000000..fbb9e013 --- /dev/null +++ b/cypress/support/types/backoffice/return-management/index.ts @@ -0,0 +1 @@ +export * from './fixture-types'; diff --git a/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts b/cypress/support/types/backoffice/return-management/transfer/transfer-types.ts similarity index 100% rename from cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts rename to cypress/support/types/backoffice/return-management/transfer/transfer-types.ts diff --git a/cypress/support/types/mp/index.ts b/cypress/support/types/mp/index.ts new file mode 100644 index 00000000..d7ece27b --- /dev/null +++ b/cypress/support/types/mp/index.ts @@ -0,0 +1 @@ +export * from './marketplace-agent-assist'; diff --git a/cypress/support/types/mp/marketplace-agent-assist/index.ts b/cypress/support/types/mp/marketplace-agent-assist/index.ts new file mode 100644 index 00000000..fbb9e013 --- /dev/null +++ b/cypress/support/types/mp/marketplace-agent-assist/index.ts @@ -0,0 +1 @@ +export * from './fixture-types'; diff --git a/cypress/support/types/yves/checkout/index.ts b/cypress/support/types/yves/checkout/index.ts new file mode 100644 index 00000000..fbb9e013 --- /dev/null +++ b/cypress/support/types/yves/checkout/index.ts @@ -0,0 +1 @@ +export * from './fixture-types'; diff --git a/cypress/support/types/yves/comments/index.ts b/cypress/support/types/yves/comments/index.ts new file mode 100644 index 00000000..fbb9e013 --- /dev/null +++ b/cypress/support/types/yves/comments/index.ts @@ -0,0 +1 @@ +export * from './fixture-types'; diff --git a/cypress/support/types/yves/index.ts b/cypress/support/types/yves/index.ts new file mode 100644 index 00000000..6f046e28 --- /dev/null +++ b/cypress/support/types/yves/index.ts @@ -0,0 +1,2 @@ +export * from './checkout'; +export * from './comments'; diff --git a/tsconfig.json b/tsconfig.json index af71afdd..5724c4c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "@pages/*": ["cypress/support/pages/*/index.ts"], "@utils": ["cypress/support/utils/index.ts"], - "@scenarios/*": ["cypress/support/scenarios/*/index.ts"] + "@scenarios/*": ["cypress/support/scenarios/*/index.ts"], + "@intefaces/*": ["cypress/support/types/*/index.ts"] } }, "include": ["cypress/**/*.ts", "cypress.config.ts", "cypress/support/commands.js", "cypress/support/e2e.js"] From d4ed17e5e8e32c115e812706c6c5772efb8c9452 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 20:53:21 +0200 Subject: [PATCH 06/16] js to ts --- cypress.config.ts | 4 ++-- cypress/support/{commands.js => commands.ts} | 17 +++++++++++------ cypress/support/{e2e.js => e2e.ts} | 14 +++++++++----- cypress/support/index.d.ts | 16 ++++++---------- tsconfig.json | 2 +- 5 files changed, 29 insertions(+), 24 deletions(-) rename cypress/support/{commands.js => commands.ts} (82%) rename cypress/support/{e2e.js => e2e.ts} (82%) diff --git a/cypress.config.ts b/cypress.config.ts index 32347cbc..36de38c6 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,6 +1,6 @@ import { defineConfig } from 'cypress'; import dotenv from 'dotenv'; -import * as fs from 'fs'; +import { existsSync } from 'fs'; dotenv.config(); @@ -30,7 +30,7 @@ export default defineConfig({ setupNodeEvents(on) { on('task', { isFileExists(filename: string): boolean { - return fs.existsSync(filename); + return existsSync(filename); }, }); }, diff --git a/cypress/support/commands.js b/cypress/support/commands.ts similarity index 82% rename from cypress/support/commands.js rename to cypress/support/commands.ts index 1582817a..96e2eb3a 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.ts @@ -8,7 +8,8 @@ // https://on.cypress.io/custom-commands // *********************************************** -Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe) => { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +Cypress.Commands.add('iframe', { prevSubject: 'element' } as any, ($iframe) => { return new Cypress.Promise((resolve) => { $iframe.on('load', () => { resolve($iframe.contents().find('body')); @@ -47,10 +48,13 @@ Cypress.Commands.add('loadDynamicFixturesByPayload', (dynamicFixturesFilePath) = }) .then((response) => { if (Array.isArray(response.body.data)) { - return response.body.data.reduce((acc, item) => { - acc[item.attributes.key] = item.attributes.data; - return acc; - }, {}); + return response.body.data.reduce( + (acc: Record, item: Record) => { + acc[item.attributes.key] = item.attributes.data; + return acc; + }, + {} + ); } else { return { [response.body.data.attributes.key]: response.body.data.attributes.data, @@ -85,7 +89,8 @@ Cypress.Commands.add('reloadUntilFound', (url, findSelector, getSelector = 'body cy.visit(url); cy.get(getSelector).then((body) => { - let msg = `url:${url} getSelector:${getSelector} findSelector:${findSelector} retries:${retries} retryWait:${retryWait}`; + const msg = `url:${url} getSelector:${getSelector} findSelector:${findSelector} retries:${retries} retryWait:${retryWait}`; + if (body.find(findSelector).length === 1) { console.log(`found ${msg}`); } else { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.ts similarity index 82% rename from cypress/support/e2e.js rename to cypress/support/e2e.ts index 4cc4839f..9353599b 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.ts @@ -13,12 +13,16 @@ // https://on.cypress.io/configuration // *********************************************************** +import { dirname, parse, relative } from 'path'; import './commands'; -import * as path from 'path'; + +// @see error 2306 https://github.com/microsoft/TypeScript/blob/3fcd1b51a1e6b16d007b368229af03455c7d5794/src/compiler/diagnosticMessages.json#L1635 +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import registerCypressGrep from '@cypress/grep'; registerCypressGrep(); -before(function () { +before(() => { loadFixture(); }); @@ -55,10 +59,10 @@ const getFixtureFilePath = () => { const fullFilePath = Cypress.spec.relative; const basePath = 'cypress/e2e/'; - const relativePath = path.relative(basePath, fullFilePath); + const relativePath = relative(basePath, fullFilePath); - const directoryPart = path.dirname(relativePath); - const filePartWithExtension = path.parse(relativePath).name; + const directoryPart = dirname(relativePath); + const filePartWithExtension = parse(relativePath).name; const filePartWithoutExtension = filePartWithExtension.replace('.cy', ''); return { diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index a570c38a..49f9f3df 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -5,7 +5,9 @@ declare namespace Cypress { /** * @example cy.iframe() */ - iframe(): Chainable; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + iframe($iframe: any): any; /** * @example cy.resetYvesCookies() @@ -30,22 +32,16 @@ declare namespace Cypress { /** * @example cy.visitBackoffice('/security-gui/login') */ - visitBackoffice(url: string, options?: Partial): Chainable; + visitBackoffice(url: string, options?: Partial): Chainable; /** * @example cy.visitMerchantPortal('/security-merchant-portal-gui/login') */ - visitMerchantPortal(url: string, options?: Partial): Chainable; + visitMerchantPortal(url: string, options?: Partial): Chainable; /** * @example cy.reloadUntilFound('/transactions', 'td:contains($4.44)') */ - reloadUntilFound( - url: string, - findSelector: string, - getSelector: string | null, - retries: number | null, - retryWait: number | null - ): void; + reloadUntilFound(url: string, findSelector: string, getSelector: string, retries: number, retryWait: number): void; } } diff --git a/tsconfig.json b/tsconfig.json index 5724c4c2..2967d019 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,5 +19,5 @@ "@intefaces/*": ["cypress/support/types/*/index.ts"] } }, - "include": ["cypress/**/*.ts", "cypress.config.ts", "cypress/support/commands.js", "cypress/support/e2e.js"] + "include": ["cypress/**/*.ts", "cypress.config.ts"] } From 13cc1635163d2389ba15d43390693365b77c73b3 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 21:00:03 +0200 Subject: [PATCH 07/16] fix --- cypress/support/commands.ts | 3 +-- cypress/support/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 96e2eb3a..97421b08 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -8,8 +8,7 @@ // https://on.cypress.io/custom-commands // *********************************************** -// eslint-disable-next-line @typescript-eslint/no-explicit-any -Cypress.Commands.add('iframe', { prevSubject: 'element' } as any, ($iframe) => { +Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe) => { return new Cypress.Promise((resolve) => { $iframe.on('load', () => { resolve($iframe.contents().find('body')); diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index 49f9f3df..dce11821 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -7,7 +7,7 @@ declare namespace Cypress { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe($iframe: any): any; + iframe($iframe: JQueryWithSelector): any; /** * @example cy.resetYvesCookies() From 81ae27caebfc08a307a97f7c50a9d98a0987e14e Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 21:02:11 +0200 Subject: [PATCH 08/16] types --- .../return-management-suite-1.cy.ts | 12 +++++----- .../marketplace-agent-assist-suite-1.cy.ts | 24 +++++++++---------- .../marketplace-agent-assist-suite-2.cy.ts | 23 +++++++++--------- .../e2e/yves/checkout/checkout-suite-1.cy.ts | 6 ++--- .../e2e/yves/comments/comments-suite-1.cy.ts | 6 ++--- 5 files changed, 35 insertions(+), 36 deletions(-) diff --git a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts index 49a4dc8e..959ef549 100644 --- a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts @@ -5,12 +5,12 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; describe('return management suite 1', { tags: ['@return-management'] }, (): void => { - const salesIndexPage: SalesIndexPage = container.get(SalesIndexPage); - const salesDetailPage: SalesDetailPage = container.get(SalesDetailPage); - const salesReturnGuiCreatePage: SalesReturnGuiCreatePage = container.get(SalesReturnGuiCreatePage); - const customerLoginScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); - const checkoutScenario: CheckoutScenario = container.get(CheckoutScenario); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const salesReturnGuiCreatePage = container.get(SalesReturnGuiCreatePage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); let dynamicFixtures: ReturnManagementSuite1DynamicFixtures; let staticFixtures: ReturnManagementStaticFixtures; diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts index b9ad26c6..18d5e8e8 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts @@ -15,18 +15,18 @@ import { container } from '@utils'; * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist'] }, (): void => { - const yvesLoginPage: LoginPage = container.get(LoginPage); - const yvesAgentLoginPage: AgentLoginPage = container.get(AgentLoginPage); - const backofficeIndexPage: IndexPage = container.get(IndexPage); - const backofficeUserIndexPage: UserIndexPage = container.get(UserIndexPage); - const backofficeUserUpdatePage: UserUpdatePage = container.get(UserUpdatePage); - const mpLoginPage: MpLoginPage = container.get(MpLoginPage); - const mpAgentLoginPage: MpAgentLoginPage = container.get(MpAgentLoginPage); - const mpDashboardPage: DashboardPage = container.get(DashboardPage); - const mpAgentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); - const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); - const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); - const merchantAgentLoginUserScenario: MerchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); + const yvesLoginPage = container.get(LoginPage); + const yvesAgentLoginPage = container.get(AgentLoginPage); + const backofficeIndexPage = container.get(IndexPage); + const backofficeUserIndexPage = container.get(UserIndexPage); + const backofficeUserUpdatePage = container.get(UserUpdatePage); + const mpLoginPage = container.get(MpLoginPage); + const mpAgentLoginPage = container.get(MpAgentLoginPage); + const mpDashboardPage = container.get(DashboardPage); + const mpAgentDashboardPage = container.get(AgentDashboardPage); + const userLoginScenario = container.get(UserLoginScenario); + const impersonateScenario = container.get(ImpersonateAsMerchantUserScenario); + const merchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); let dynamicFixtures: MarketplaceAgentAssistSuite1DynamicFixtures; let staticFixtures: MarketplaceAgentAssistStaticFixtures; diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts index 444389d9..e3247a26 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts @@ -11,18 +11,17 @@ import { container } from '@utils'; * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ describe('marketplace agent assist suite 2', { tags: ['@marketplace-agent-assist'] }, (): void => { - const cartPage: CartPage = container.get(CartPage); - const salesIndexPage: SalesIndexPage = container.get(SalesIndexPage); - const salesDetailPage: SalesDetailPage = container.get(SalesDetailPage); - const salesOrdersPage: SalesOrdersPage = container.get(SalesOrdersPage); - const profilePage: ProfilePage = container.get(ProfilePage); - const productsPage: ProductsPage = container.get(ProductsPage); - const offersPage: OffersPage = container.get(OffersPage); - - const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); - const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); - const customerLoginScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - const checkoutMpScenario: CheckoutMpScenario = container.get(CheckoutMpScenario); + const cartPage = container.get(CartPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const salesOrdersPage = container.get(SalesOrdersPage); + const profilePage = container.get(ProfilePage); + const productsPage = container.get(ProductsPage); + const offersPage = container.get(OffersPage); + const userLoginScenario = container.get(UserLoginScenario); + const impersonateScenario = container.get(ImpersonateAsMerchantUserScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + const checkoutMpScenario = container.get(CheckoutMpScenario); let dynamicFixtures: MarketplaceAgentAssistSuite2DynamicFixtures; let staticFixtures: MarketplaceAgentAssistStaticFixtures; diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts index 868b0152..85489754 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -4,9 +4,9 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { - const cartPage: CartPage = container.get(CartPage); - const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - const checkoutScenario: CheckoutScenario = container.get(CheckoutScenario); + const cartPage = container.get(CartPage); + const loginCustomerScenario = container.get(CustomerLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); let staticFixtures: CheckoutStaticFixtures; let dynamicFixtures: CheckoutSuite1DynamicFixtures; diff --git a/cypress/e2e/yves/comments/comments-suite-1.cy.ts b/cypress/e2e/yves/comments/comments-suite-1.cy.ts index 1707014a..6e4c9c94 100644 --- a/cypress/e2e/yves/comments/comments-suite-1.cy.ts +++ b/cypress/e2e/yves/comments/comments-suite-1.cy.ts @@ -4,9 +4,9 @@ import { CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; describe('comments suite 1', { tags: ['@comments'] }, (): void => { - const multiCartPage: MultiCartPage = container.get(MultiCartPage); - const commentCartPage: CommentCartPage = container.get(CommentCartPage); - const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); + const multiCartPage = container.get(MultiCartPage); + const commentCartPage = container.get(CommentCartPage); + const loginCustomerScenario = container.get(CustomerLoginScenario); let dynamicFixtures: CommentsSuite1DynamicFixtures; let staticFixtures: CommentsSuite1StaticFixtures; From e149db2f6b2f0e239b8ac0694dd9cbb5605efccb Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 21:18:03 +0200 Subject: [PATCH 09/16] tmp --- .../order-management-suite-1.cy.ts | 8 +++-- .../return-management-suite-1.cy.ts | 12 +++++-- .../marketplace-agent-assist-suite-2.cy.ts | 2 +- .../e2e/yves/checkout/checkout-suite-1.cy.ts | 31 +++++++++++++++---- .../scenarios/yves/checkout-mp-scenario.ts | 11 +++++-- .../scenarios/yves/checkout-scenario.ts | 12 +++++-- 6 files changed, 61 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts index c43bf42b..7bde0711 100644 --- a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts @@ -22,7 +22,11 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = it('should be able to create an order by existing customer', (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); + checkoutScenario.execute({ + isGuest: false, + isMultiShipment: false, + idCustomerAddress: dynamicFixtures.address.id_customer_address, + }); cy.contains('Your order has been placed successfully!'); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); @@ -35,7 +39,7 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = cartPage.visit(); cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); - checkoutScenario.execute(true); + checkoutScenario.execute({ isGuest: true }); cy.contains('Your order has been placed successfully!'); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); diff --git a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts index 959ef549..aa3c4f5d 100644 --- a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts @@ -24,7 +24,11 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void }); it('should be able to create return from (from shipped order state)', (): void => { - checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); + checkoutScenario.execute({ + isGuest: false, + isMultiShipment: false, + idCustomerAddress: dynamicFixtures.address.id_customer_address, + }); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); salesIndexPage.visit(); @@ -41,7 +45,11 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void }); it('should be able to create return from (from delivery order state)', (): void => { - checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); + checkoutScenario.execute({ + isGuest: false, + isMultiShipment: false, + idCustomerAddress: dynamicFixtures.address.id_customer_address, + }); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); salesIndexPage.visit(); diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts index e3247a26..7d7d8b07 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts @@ -35,7 +35,7 @@ describe('marketplace agent assist suite 2', { tags: ['@marketplace-agent-assist cartPage.visit(); cartPage.quickAddToCart(dynamicFixtures.productConcreteForOffer.sku); - checkoutMpScenario.execute(); + checkoutMpScenario.execute({ isGuest: false }); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts index 85489754..14813b8f 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -20,7 +20,9 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { cartPage.quickAddToCart(dynamicFixtures.product1.sku, 1); cartPage.quickAddToCart(dynamicFixtures.product2.sku, 1); - checkoutScenario.execute(true); + checkoutScenario.execute({ + isGuest: true, + }); cy.contains('Your order has been placed successfully!'); }); @@ -30,7 +32,10 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { cartPage.quickAddToCart(dynamicFixtures.product1.sku, 1); cartPage.quickAddToCart(dynamicFixtures.product2.sku, 1); - checkoutScenario.execute(true, true); + checkoutScenario.execute({ + isGuest: true, + isMultiShipment: true, + }); cy.contains('Your order has been placed successfully!'); }); @@ -38,7 +43,11 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { it('customer should checkout to single shipment (with customer shipping address)', (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); + checkoutScenario.execute({ + isGuest: false, + isMultiShipment: false, + idCustomerAddress: dynamicFixtures.address.id_customer_address, + }); cy.contains('Your order has been placed successfully!'); }); @@ -46,7 +55,10 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { it('customer should checkout to single shipment (with new shipping address)', (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(false, false); + checkoutScenario.execute({ + isGuest: false, + isMultiShipment: false, + }); cy.contains('Your order has been placed successfully!'); }); @@ -57,7 +69,11 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(false, true, dynamicFixtures.address.id_customer_address); + checkoutScenario.execute({ + isGuest: false, + isMultiShipment: true, + idCustomerAddress: dynamicFixtures.address.id_customer_address, + }); cy.contains('Your order has been placed successfully!'); } @@ -69,7 +85,10 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(false, true); + checkoutScenario.execute({ + isGuest: false, + isMultiShipment: true, + }); cy.contains('Your order has been placed successfully!'); } diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index e58e29ae..c736e528 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -6,10 +6,15 @@ import { CheckoutShipmentPage, CheckoutSummaryPage, } from '@pages/yves'; -import { autoWired, CliHelper } from '@utils'; +import { CliHelper, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; +interface CheckoutMpExecuteParams { + isGuest: boolean; + isMultiShipment?: boolean; +} + @injectable() @autoWired export class CheckoutMpScenario { @@ -21,7 +26,9 @@ export class CheckoutMpScenario { @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage; @inject(CliHelper) private cliHelper: CliHelper; - execute = (isGuest: boolean = false, isMultiShipment: boolean = false): void => { + execute = (params: CheckoutMpExecuteParams): void => { + const { isGuest, isMultiShipment } = params; + this.cartPage.visit(); this.cartPage.startCheckout(); diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 9f684f96..c17adaa8 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -6,10 +6,16 @@ import { CheckoutShipmentPage, CheckoutSummaryPage, } from '@pages/yves'; -import { autoWired, CliHelper } from '@utils'; +import { CliHelper, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; +interface CheckoutExecuteParams { + isGuest: boolean; + isMultiShipment?: boolean; + idCustomerAddress?: number; +} + @injectable() @autoWired export class CheckoutScenario { @@ -21,7 +27,9 @@ export class CheckoutScenario { @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage; @inject(CliHelper) private cliHelper: CliHelper; - execute = (isGuest: boolean = false, isMultiShipment: boolean = false, idCustomerAddress?: number): void => { + execute = (params: CheckoutExecuteParams): void => { + const { isGuest, isMultiShipment, idCustomerAddress } = params; + this.cartPage.visit(); this.cartPage.startCheckout(); From cd838a910179862506404081d3c5c44dd5749afd Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 21:20:21 +0200 Subject: [PATCH 10/16] metadata --- cypress/support/pages/abstract-page.ts | 1 - cypress/support/pages/backoffice/backoffice-page.ts | 2 +- cypress/support/pages/backoffice/index/index-page.ts | 2 +- cypress/support/pages/backoffice/index/index-repository.ts | 1 - cypress/support/pages/backoffice/login/login-page.ts | 2 +- cypress/support/pages/backoffice/login/login-repository.ts | 1 - .../merchant-user/create/merchant-user-create-page.ts | 2 +- .../merchant-user/create/merchant-user-create-repository.ts | 1 - .../pages/backoffice/merchant/create/merchant-create-page.ts | 2 +- .../backoffice/merchant/create/merchant-create-repository.ts | 1 - .../pages/backoffice/merchant/list/merchant-list-page.ts | 2 +- .../pages/backoffice/merchant/list/merchant-list-repository.ts | 1 - .../pages/backoffice/merchant/update/merchant-update-page.ts | 2 +- .../backoffice/merchant/update/merchant-update-repository.ts | 1 - .../sales-return-gui/create/sales-return-gui-create-page.ts | 2 +- .../create/sales-return-gui-create-repository.ts | 1 - .../support/pages/backoffice/sales/detail/sales-detail-page.ts | 2 +- .../pages/backoffice/sales/detail/sales-detail-repository.ts | 1 - .../support/pages/backoffice/sales/index/sales-index-page.ts | 2 +- .../pages/backoffice/sales/index/sales-index-repository.ts | 1 - .../support/pages/backoffice/user/create/user-create-page.ts | 2 +- .../pages/backoffice/user/create/user-create-repository.ts | 1 - .../support/pages/backoffice/user/delete/user-delete-page.ts | 2 +- .../pages/backoffice/user/delete/user-delete-repository.ts | 1 - cypress/support/pages/backoffice/user/index/user-index-page.ts | 2 +- .../pages/backoffice/user/index/user-index-repository.ts | 1 - .../support/pages/backoffice/user/update/user-update-page.ts | 2 +- .../pages/backoffice/user/update/user-update-repository.ts | 1 - .../support/pages/mp/agent-dashboard/agent-dashboard-page.ts | 2 +- .../pages/mp/agent-dashboard/agent-dashboard-repository.ts | 1 - cypress/support/pages/mp/agent-login/agent-login-page.ts | 2 +- cypress/support/pages/mp/agent-login/agent-login-repository.ts | 1 - cypress/support/pages/mp/dashboard/dashboard-page.ts | 2 +- cypress/support/pages/mp/dashboard/dashboard-repository.ts | 1 - cypress/support/pages/mp/login/login-page.ts | 2 +- cypress/support/pages/mp/login/login-repository.ts | 1 - cypress/support/pages/mp/mp-page.ts | 2 +- cypress/support/pages/mp/offers/offers-page.ts | 2 +- cypress/support/pages/mp/offers/offers-repository.ts | 1 - cypress/support/pages/mp/products/products-page.ts | 2 +- cypress/support/pages/mp/products/products-repository.ts | 1 - cypress/support/pages/mp/profile/profile-page.ts | 2 +- cypress/support/pages/mp/profile/profile-repository.ts | 1 - cypress/support/pages/mp/sales/sales-orders-page.ts | 2 +- cypress/support/pages/mp/sales/sales-orders-repository.ts | 1 - cypress/support/pages/yves/agent-login/agent-login-page.ts | 2 +- .../agent-login/repositories/suite-agent-login-repository.ts | 2 +- cypress/support/pages/yves/cart/cart-page.ts | 2 +- .../pages/yves/cart/repositories/b2b-cart-repository.ts | 1 - .../pages/yves/cart/repositories/suite-cart-repository.ts | 1 - .../pages/yves/checkout/address/checkout-address-page.ts | 2 +- .../address/repositories/suite-checkout-address-repository.ts | 2 +- .../pages/yves/checkout/customer/checkout-customer-page.ts | 2 +- .../repositories/suite-checkout-customer-repository.ts | 2 +- .../pages/yves/checkout/payment/checkout-payment-page.ts | 2 +- .../payment/repositories/suite-checkout-payment-repository.ts | 2 +- .../pages/yves/checkout/shipment/checkout-shipment-page.ts | 2 +- .../repositories/suite-checkout-shipment-repository.ts | 2 +- .../pages/yves/checkout/summary/checkout-summary-page.ts | 2 +- .../summary/repositories/suite-checkout-summary-repository.ts | 2 +- cypress/support/pages/yves/comment/cart/comment-cart-page.ts | 2 +- .../comment/cart/repositories/b2b-comment-cart-repository.ts | 1 - .../comment/cart/repositories/suite-comment-cart-repository.ts | 1 - cypress/support/pages/yves/login/login-page.ts | 2 +- .../pages/yves/login/repositories/b2b-login-repository.ts | 2 +- .../pages/yves/login/repositories/suite-login-repository.ts | 2 +- cypress/support/pages/yves/multi-cart/multi-cart-page.ts | 2 +- .../yves/multi-cart/repositories/b2b-multi-cart-repository.ts | 2 +- .../multi-cart/repositories/suite-multi-cart-repository.ts | 2 +- cypress/support/pages/yves/yves-page.ts | 2 +- cypress/support/scenarios/yves/checkout-mp-scenario.ts | 1 - cypress/support/scenarios/yves/checkout-scenario.ts | 1 - cypress/support/utils/inversify/inversify.config.ts | 3 ++- 73 files changed, 46 insertions(+), 73 deletions(-) diff --git a/cypress/support/pages/abstract-page.ts b/cypress/support/pages/abstract-page.ts index ed5a1973..21054aa8 100644 --- a/cypress/support/pages/abstract-page.ts +++ b/cypress/support/pages/abstract-page.ts @@ -1,6 +1,5 @@ import { faker } from '@faker-js/faker'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() export class AbstractPage { diff --git a/cypress/support/pages/backoffice/backoffice-page.ts b/cypress/support/pages/backoffice/backoffice-page.ts index eef270fc..06597c4e 100644 --- a/cypress/support/pages/backoffice/backoffice-page.ts +++ b/cypress/support/pages/backoffice/backoffice-page.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; diff --git a/cypress/support/pages/backoffice/index/index-page.ts b/cypress/support/pages/backoffice/index/index-page.ts index dc842149..8d2e6ae6 100644 --- a/cypress/support/pages/backoffice/index/index-page.ts +++ b/cypress/support/pages/backoffice/index/index-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../backoffice-page'; @injectable() diff --git a/cypress/support/pages/backoffice/index/index-repository.ts b/cypress/support/pages/backoffice/index/index-repository.ts index 764c886f..7a00b230 100644 --- a/cypress/support/pages/backoffice/index/index-repository.ts +++ b/cypress/support/pages/backoffice/index/index-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/login/login-page.ts b/cypress/support/pages/backoffice/login/login-page.ts index 24747c68..00f5703b 100644 --- a/cypress/support/pages/backoffice/login/login-page.ts +++ b/cypress/support/pages/backoffice/login/login-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../backoffice-page'; import { LoginRepository } from './login-repository'; diff --git a/cypress/support/pages/backoffice/login/login-repository.ts b/cypress/support/pages/backoffice/login/login-repository.ts index fae597bc..78b2644d 100644 --- a/cypress/support/pages/backoffice/login/login-repository.ts +++ b/cypress/support/pages/backoffice/login/login-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts index f3ab90a8..8afb2363 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { MerchantUserCreateRepository } from './merchant-user-create-repository'; diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts index 01b34b4a..07fb0fbc 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts index 8e59e3b0..9eb90b7e 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { MerchantCreateRepository } from './merchant-create-repository'; diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts index be79965c..60719200 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts index 9a8cd1ad..59944e67 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { MerchantListRepository } from './merchant-list-repository'; diff --git a/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts index 7417a3f8..03ee36ca 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts index a2be9de2..12eb663b 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { MerchantUpdateRepository } from './merchant-update-repository'; diff --git a/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts index eddd4b44..a3bf9917 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts index 887411be..eb0f5138 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { SalesReturnGuiCreateRepository } from './sales-return-gui-create-repository'; diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts index a0e06027..e9f723f3 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts index 3f487c69..934b4af0 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -1,6 +1,6 @@ import { autoWired, CliHelper } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { SalesDetailRepository } from './sales-detail-repository'; diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts index f30b925b..524e7528 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts index 772a68a6..e9a6888a 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { SalesIndexRepository } from './sales-index-repository'; diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts index e587d5b6..921f5cc3 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/create/user-create-page.ts b/cypress/support/pages/backoffice/user/create/user-create-page.ts index e9577bf6..b5c4b222 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { UserCreateRepository } from './user-create-repository'; diff --git a/cypress/support/pages/backoffice/user/create/user-create-repository.ts b/cypress/support/pages/backoffice/user/create/user-create-repository.ts index 398841d7..226e3a77 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-repository.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts index 1bbada85..4f910b98 100644 --- a/cypress/support/pages/backoffice/user/delete/user-delete-page.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { UserDeleteRepository } from './user-delete-repository'; diff --git a/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts b/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts index c1af9b8b..d077fe24 100644 --- a/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/index/user-index-page.ts b/cypress/support/pages/backoffice/user/index/user-index-page.ts index 7cb2a067..421cddf9 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { UserIndexRepository } from './user-index-repository'; diff --git a/cypress/support/pages/backoffice/user/index/user-index-repository.ts b/cypress/support/pages/backoffice/user/index/user-index-repository.ts index 3e14550c..07d7bf33 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-repository.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/backoffice/user/update/user-update-page.ts b/cypress/support/pages/backoffice/user/update/user-update-page.ts index 9945a023..ef95bfb3 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-page.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { BackofficePage } from '../../backoffice-page'; import { UserUpdateRepository } from './user-update-repository'; diff --git a/cypress/support/pages/backoffice/user/update/user-update-repository.ts b/cypress/support/pages/backoffice/user/update/user-update-repository.ts index a2e15423..f1f0de3a 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-repository.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts index ab867aa1..aab35e5f 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { AgentDashboardRepository } from './agent-dashboard-repository'; diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts index 809b9ae1..9b74ef83 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/agent-login/agent-login-page.ts b/cypress/support/pages/mp/agent-login/agent-login-page.ts index 24a46f19..11edd82d 100644 --- a/cypress/support/pages/mp/agent-login/agent-login-page.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { AgentLoginRepository } from './agent-login-repository'; diff --git a/cypress/support/pages/mp/agent-login/agent-login-repository.ts b/cypress/support/pages/mp/agent-login/agent-login-repository.ts index 6e51a6fa..d5aeb113 100644 --- a/cypress/support/pages/mp/agent-login/agent-login-repository.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/dashboard/dashboard-page.ts b/cypress/support/pages/mp/dashboard/dashboard-page.ts index 2ae32206..bb158461 100644 --- a/cypress/support/pages/mp/dashboard/dashboard-page.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { DashboardRepository } from './dashboard-repository'; diff --git a/cypress/support/pages/mp/dashboard/dashboard-repository.ts b/cypress/support/pages/mp/dashboard/dashboard-repository.ts index ba9465d8..37f54c7e 100644 --- a/cypress/support/pages/mp/dashboard/dashboard-repository.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/login/login-page.ts b/cypress/support/pages/mp/login/login-page.ts index 80f60b02..b9790104 100644 --- a/cypress/support/pages/mp/login/login-page.ts +++ b/cypress/support/pages/mp/login/login-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { LoginRepository } from './login-repository'; diff --git a/cypress/support/pages/mp/login/login-repository.ts b/cypress/support/pages/mp/login/login-repository.ts index 073c81eb..492900fa 100644 --- a/cypress/support/pages/mp/login/login-repository.ts +++ b/cypress/support/pages/mp/login/login-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/mp-page.ts b/cypress/support/pages/mp/mp-page.ts index 114285d6..424c0eff 100644 --- a/cypress/support/pages/mp/mp-page.ts +++ b/cypress/support/pages/mp/mp-page.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; diff --git a/cypress/support/pages/mp/offers/offers-page.ts b/cypress/support/pages/mp/offers/offers-page.ts index eb3860de..775805f8 100644 --- a/cypress/support/pages/mp/offers/offers-page.ts +++ b/cypress/support/pages/mp/offers/offers-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { OffersRepository } from './offers-repository'; diff --git a/cypress/support/pages/mp/offers/offers-repository.ts b/cypress/support/pages/mp/offers/offers-repository.ts index 65b2e52d..9d183a46 100644 --- a/cypress/support/pages/mp/offers/offers-repository.ts +++ b/cypress/support/pages/mp/offers/offers-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/products/products-page.ts b/cypress/support/pages/mp/products/products-page.ts index 1fcae151..77e90578 100644 --- a/cypress/support/pages/mp/products/products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { ProductsRepository } from './products-repository'; diff --git a/cypress/support/pages/mp/products/products-repository.ts b/cypress/support/pages/mp/products/products-repository.ts index 9e315849..7a96f5d8 100644 --- a/cypress/support/pages/mp/products/products-repository.ts +++ b/cypress/support/pages/mp/products/products-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/profile/profile-page.ts b/cypress/support/pages/mp/profile/profile-page.ts index 6fc7db1d..ca665e8f 100644 --- a/cypress/support/pages/mp/profile/profile-page.ts +++ b/cypress/support/pages/mp/profile/profile-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { ProfileRepository } from './profile-repository'; diff --git a/cypress/support/pages/mp/profile/profile-repository.ts b/cypress/support/pages/mp/profile/profile-repository.ts index 677ad882..76736c11 100644 --- a/cypress/support/pages/mp/profile/profile-repository.ts +++ b/cypress/support/pages/mp/profile/profile-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/mp/sales/sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts index 621a289c..65000cbf 100644 --- a/cypress/support/pages/mp/sales/sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { MpPage } from '../mp-page'; import { SalesOrdersRepository } from './sales-orders-repository'; diff --git a/cypress/support/pages/mp/sales/sales-orders-repository.ts b/cypress/support/pages/mp/sales/sales-orders-repository.ts index 1a208eff..a1b7d66d 100644 --- a/cypress/support/pages/mp/sales/sales-orders-repository.ts +++ b/cypress/support/pages/mp/sales/sales-orders-repository.ts @@ -1,6 +1,5 @@ import { autoWired } from '@utils'; import { injectable } from 'inversify'; -import 'reflect-metadata'; @injectable() @autoWired diff --git a/cypress/support/pages/yves/agent-login/agent-login-page.ts b/cypress/support/pages/yves/agent-login/agent-login-page.ts index 3eaed2c0..b80e5869 100644 --- a/cypress/support/pages/yves/agent-login/agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../yves-page'; import { AgentLoginRepository } from './agent-login-repository'; diff --git a/cypress/support/pages/yves/agent-login/repositories/suite-agent-login-repository.ts b/cypress/support/pages/yves/agent-login/repositories/suite-agent-login-repository.ts index 8df1b6d7..3a6394d1 100644 --- a/cypress/support/pages/yves/agent-login/repositories/suite-agent-login-repository.ts +++ b/cypress/support/pages/yves/agent-login/repositories/suite-agent-login-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { AgentLoginRepository } from '../agent-login-repository'; @injectable() diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index 2ca6728a..1bb656df 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../yves-page'; import { CartRepository } from './cart-repository'; diff --git a/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts index 8001b668..9f765bac 100644 --- a/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts @@ -1,4 +1,3 @@ -import 'reflect-metadata'; import { injectable } from 'inversify'; import { CartRepository } from '../cart-repository'; diff --git a/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts index 2e6fe25f..55717130 100644 --- a/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts @@ -1,4 +1,3 @@ -import 'reflect-metadata'; import { injectable } from 'inversify'; import { CartRepository } from '../cart-repository'; diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts index a01af1ba..eca62405 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../../yves-page'; import { CheckoutAddressRepository } from './checkout-address-repository'; diff --git a/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts index 50b1f2c4..47a59e5c 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() diff --git a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts index 0bc83261..5e846a06 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../../yves-page'; import { CheckoutCustomerRepository } from './checkout-customer-repository'; diff --git a/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts index 42862b94..c7d0ea86 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { CheckoutCustomerRepository } from '../checkout-customer-repository'; @injectable() diff --git a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts index 6093c09f..2a6f4dc4 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../../yves-page'; import { CheckoutPaymentRepository } from './checkout-payment-repository'; diff --git a/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts index 2c461e25..08b20cf1 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { CheckoutPaymentRepository } from '../checkout-payment-repository'; @injectable() diff --git a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts index fa394e33..90114167 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../../yves-page'; import { CheckoutShipmentRepository } from './checkout-shipment-repository'; diff --git a/cypress/support/pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository.ts index a3d3444e..6c0cdef0 100644 --- a/cypress/support/pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { CheckoutShipmentRepository } from '../checkout-shipment-repository'; @injectable() diff --git a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts index 78c6774d..3ba76175 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../../yves-page'; import { CheckoutSummaryRepository } from './checkout-summary-repository'; diff --git a/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts index 5d139481..795490ea 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() diff --git a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts index 2ac009a8..ad887382 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../../yves-page'; import { CommentCartRepository } from './comment-cart-repository'; diff --git a/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts index 1bb4e80f..fd354cee 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts @@ -1,4 +1,3 @@ -import 'reflect-metadata'; import { injectable } from 'inversify'; import { CommentCartRepository } from '../comment-cart-repository'; diff --git a/cypress/support/pages/yves/comment/cart/repositories/suite-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/suite-comment-cart-repository.ts index 7862c8e0..e48c2eca 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/suite-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/suite-comment-cart-repository.ts @@ -1,4 +1,3 @@ -import 'reflect-metadata'; import { injectable } from 'inversify'; import { CommentCartRepository } from '../comment-cart-repository'; diff --git a/cypress/support/pages/yves/login/login-page.ts b/cypress/support/pages/yves/login/login-page.ts index db77e5ea..85db593f 100644 --- a/cypress/support/pages/yves/login/login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../yves-page'; import { LoginRepository } from './login-repository'; diff --git a/cypress/support/pages/yves/login/repositories/b2b-login-repository.ts b/cypress/support/pages/yves/login/repositories/b2b-login-repository.ts index 3e1837c4..ba730ee2 100644 --- a/cypress/support/pages/yves/login/repositories/b2b-login-repository.ts +++ b/cypress/support/pages/yves/login/repositories/b2b-login-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { LoginRepository } from '../login-repository'; @injectable() diff --git a/cypress/support/pages/yves/login/repositories/suite-login-repository.ts b/cypress/support/pages/yves/login/repositories/suite-login-repository.ts index 2ec28051..aacc3081 100644 --- a/cypress/support/pages/yves/login/repositories/suite-login-repository.ts +++ b/cypress/support/pages/yves/login/repositories/suite-login-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { LoginRepository } from '../login-repository'; @injectable() diff --git a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts index d45c237f..4ea74f3c 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -1,6 +1,6 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; + import { YvesPage } from '../yves-page'; import { MultiCartRepository } from './multi-cart-repository'; diff --git a/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts index 0df3b252..48d6c616 100644 --- a/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { MultiCartRepository } from '../multi-cart-repository'; @injectable() diff --git a/cypress/support/pages/yves/multi-cart/repositories/suite-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/repositories/suite-multi-cart-repository.ts index d471865e..af3753c3 100644 --- a/cypress/support/pages/yves/multi-cart/repositories/suite-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/repositories/suite-multi-cart-repository.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { MultiCartRepository } from '../multi-cart-repository'; @injectable() diff --git a/cypress/support/pages/yves/yves-page.ts b/cypress/support/pages/yves/yves-page.ts index a1e57bbe..c3371a93 100644 --- a/cypress/support/pages/yves/yves-page.ts +++ b/cypress/support/pages/yves/yves-page.ts @@ -1,5 +1,5 @@ import { injectable } from 'inversify'; -import 'reflect-metadata'; + import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index c736e528..26e93b49 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -8,7 +8,6 @@ import { } from '@pages/yves'; import { CliHelper, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; interface CheckoutMpExecuteParams { isGuest: boolean; diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index c17adaa8..a6e661e6 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -8,7 +8,6 @@ import { } from '@pages/yves'; import { CliHelper, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; interface CheckoutExecuteParams { isGuest: boolean; diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index eb6a484c..9d75c312 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -1,5 +1,6 @@ -import { Container, interfaces } from 'inversify'; import 'reflect-metadata'; + +import { Container, interfaces } from 'inversify'; import { REPOSITORIES } from './types'; import { SuiteAgentLoginRepository } from '../../pages/yves/agent-login/repositories/suite-agent-login-repository'; From 9e0374d8351975957fac7712cee3ea3960240cab Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Thu, 7 Mar 2024 01:58:15 +0200 Subject: [PATCH 11/16] typo --- .../order-management/order-management-suite-1.cy.ts | 2 +- .../return-management/return-management-suite-1.cy.ts | 2 +- .../marketplace-agent-assist-suite-1.cy.ts | 2 +- .../marketplace-agent-assist-suite-2.cy.ts | 2 +- cypress/e2e/yves/checkout/checkout-suite-1.cy.ts | 2 +- cypress/e2e/yves/comments/comments-suite-1.cy.ts | 2 +- cypress/support/types/shared/merchant.ts | 9 +++++++++ tsconfig.json | 2 +- 8 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 cypress/support/types/shared/merchant.ts diff --git a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts index 7bde0711..e3533afe 100644 --- a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts @@ -1,4 +1,4 @@ -import { OrderManagementStaticFixtures, OrderManagementSuite1DynamicFixtures } from '@intefaces/backoffice'; +import { OrderManagementStaticFixtures, OrderManagementSuite1DynamicFixtures } from '@interfaces/backoffice'; import { SalesIndexPage } from '@pages/backoffice'; import { CartPage } from '@pages/yves'; import { UserLoginScenario } from '@scenarios/backoffice'; diff --git a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts index aa3c4f5d..7fe3f8a9 100644 --- a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts @@ -1,4 +1,4 @@ -import { ReturnManagementStaticFixtures, ReturnManagementSuite1DynamicFixtures } from '@intefaces/backoffice'; +import { ReturnManagementStaticFixtures, ReturnManagementSuite1DynamicFixtures } from '@interfaces/backoffice'; import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '@pages/backoffice'; import { UserLoginScenario } from '@scenarios/backoffice'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts index 18d5e8e8..75766901 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts @@ -1,4 +1,4 @@ -import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite1DynamicFixtures } from '@intefaces/mp'; +import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite1DynamicFixtures } from '@interfaces/mp'; import { IndexPage, UserIndexPage, UserUpdatePage } from '@pages/backoffice'; import { AgentDashboardPage, diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts index 7d7d8b07..e4368084 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts @@ -1,4 +1,4 @@ -import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite2DynamicFixtures } from '@intefaces/mp'; +import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite2DynamicFixtures } from '@interfaces/mp'; import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; import { OffersPage, ProductsPage, ProfilePage, SalesOrdersPage } from '@pages/mp'; import { CartPage } from '@pages/yves'; diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts index 14813b8f..f59c88b4 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -1,4 +1,4 @@ -import { CheckoutStaticFixtures, CheckoutSuite1DynamicFixtures } from '@intefaces/yves'; +import { CheckoutStaticFixtures, CheckoutSuite1DynamicFixtures } from '@interfaces/yves'; import { CartPage } from '@pages/yves'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; diff --git a/cypress/e2e/yves/comments/comments-suite-1.cy.ts b/cypress/e2e/yves/comments/comments-suite-1.cy.ts index 6e4c9c94..6f5758d0 100644 --- a/cypress/e2e/yves/comments/comments-suite-1.cy.ts +++ b/cypress/e2e/yves/comments/comments-suite-1.cy.ts @@ -1,4 +1,4 @@ -import { CommentsSuite1DynamicFixtures, CommentsSuite1StaticFixtures } from '@intefaces/yves'; +import { CommentsSuite1DynamicFixtures, CommentsSuite1StaticFixtures } from '@interfaces/yves'; import { CommentCartPage, MultiCartPage } from '@pages/yves'; import { CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; diff --git a/cypress/support/types/shared/merchant.ts b/cypress/support/types/shared/merchant.ts new file mode 100644 index 00000000..de3abdcd --- /dev/null +++ b/cypress/support/types/shared/merchant.ts @@ -0,0 +1,9 @@ +import { User } from './user'; + +export interface Merchant { + name: string; +} + +export interface MerchantUser extends User { + first_name: string; +} diff --git a/tsconfig.json b/tsconfig.json index 2967d019..f4f4db0a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "@pages/*": ["cypress/support/pages/*/index.ts"], "@utils": ["cypress/support/utils/index.ts"], "@scenarios/*": ["cypress/support/scenarios/*/index.ts"], - "@intefaces/*": ["cypress/support/types/*/index.ts"] + "@interfaces/*": ["cypress/support/types/*/index.ts"] } }, "include": ["cypress/**/*.ts", "cypress.config.ts"] From f10d4f2847e50887cc72ac06a3ceb2e2a2e69ea3 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Thu, 7 Mar 2024 01:58:53 +0200 Subject: [PATCH 12/16] leftover --- cypress/support/types/shared/merchant.ts | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 cypress/support/types/shared/merchant.ts diff --git a/cypress/support/types/shared/merchant.ts b/cypress/support/types/shared/merchant.ts deleted file mode 100644 index de3abdcd..00000000 --- a/cypress/support/types/shared/merchant.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { User } from './user'; - -export interface Merchant { - name: string; -} - -export interface MerchantUser extends User { - first_name: string; -} From 39c92f140687f56b57acf1065713813bce367e36 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Thu, 7 Mar 2024 11:59:24 +0200 Subject: [PATCH 13/16] types --- cypress/support/index.d.ts | 4 +--- .../fixture-types.ts => order-management.ts} | 2 +- .../backoffice/order-management/index.ts | 1 - .../transfer/transfer-types.ts | 16 -------------- .../fixture-types.ts => return-management.ts} | 2 +- .../backoffice/return-management/index.ts | 1 - .../transfer/transfer-types.ts | 19 ---------------- .../types/backoffice/shared/address.ts | 3 +++ .../types/backoffice/shared/customer.ts | 3 +++ .../support/types/backoffice/shared/index.ts | 5 +++++ .../types/backoffice/shared/product.ts | 4 ++++ .../support/types/backoffice/shared/quote.ts | 3 +++ .../support/types/backoffice/shared/user.ts | 3 +++ ...e-types.ts => marketplace-agent-assist.ts} | 2 +- .../mp/marketplace-agent-assist/index.ts | 1 - .../transfer/transfer-types.ts | 22 ------------------- cypress/support/types/mp/shared/customer.ts | 3 +++ cypress/support/types/mp/shared/index.ts | 5 +++++ cypress/support/types/mp/shared/merchant.ts | 3 +++ cypress/support/types/mp/shared/product.ts | 8 +++++++ cypress/support/types/mp/shared/quote.ts | 3 +++ cypress/support/types/mp/shared/user.ts | 5 +++++ .../fixture-types.ts => checkout.ts} | 2 +- cypress/support/types/yves/checkout/index.ts | 1 - .../yves/checkout/transfer/transfer-types.ts | 15 ------------- .../fixture-types.ts => comments.ts} | 2 +- cypress/support/types/yves/comments/index.ts | 1 - cypress/support/types/yves/shared/address.ts | 3 +++ cypress/support/types/yves/shared/customer.ts | 3 +++ cypress/support/types/yves/shared/index.ts | 4 ++++ cypress/support/types/yves/shared/product.ts | 5 +++++ .../transfer-types.ts => shared/quote.ts} | 10 --------- tsconfig.json | 3 ++- 33 files changed, 71 insertions(+), 96 deletions(-) rename cypress/support/types/backoffice/{order-management/fixture-types.ts => order-management.ts} (73%) delete mode 100644 cypress/support/types/backoffice/order-management/index.ts delete mode 100644 cypress/support/types/backoffice/order-management/transfer/transfer-types.ts rename cypress/support/types/backoffice/{return-management/fixture-types.ts => return-management.ts} (74%) delete mode 100644 cypress/support/types/backoffice/return-management/index.ts delete mode 100644 cypress/support/types/backoffice/return-management/transfer/transfer-types.ts create mode 100644 cypress/support/types/backoffice/shared/address.ts create mode 100644 cypress/support/types/backoffice/shared/customer.ts create mode 100644 cypress/support/types/backoffice/shared/index.ts create mode 100644 cypress/support/types/backoffice/shared/product.ts create mode 100644 cypress/support/types/backoffice/shared/quote.ts create mode 100644 cypress/support/types/backoffice/shared/user.ts rename cypress/support/types/mp/{marketplace-agent-assist/fixture-types.ts => marketplace-agent-assist.ts} (95%) delete mode 100644 cypress/support/types/mp/marketplace-agent-assist/index.ts delete mode 100644 cypress/support/types/mp/marketplace-agent-assist/transfer/transfer-types.ts create mode 100644 cypress/support/types/mp/shared/customer.ts create mode 100644 cypress/support/types/mp/shared/index.ts create mode 100644 cypress/support/types/mp/shared/merchant.ts create mode 100644 cypress/support/types/mp/shared/product.ts create mode 100644 cypress/support/types/mp/shared/quote.ts create mode 100644 cypress/support/types/mp/shared/user.ts rename cypress/support/types/yves/{checkout/fixture-types.ts => checkout.ts} (77%) delete mode 100644 cypress/support/types/yves/checkout/index.ts delete mode 100644 cypress/support/types/yves/checkout/transfer/transfer-types.ts rename cypress/support/types/yves/{comments/fixture-types.ts => comments.ts} (81%) delete mode 100644 cypress/support/types/yves/comments/index.ts create mode 100644 cypress/support/types/yves/shared/address.ts create mode 100644 cypress/support/types/yves/shared/customer.ts create mode 100644 cypress/support/types/yves/shared/index.ts create mode 100644 cypress/support/types/yves/shared/product.ts rename cypress/support/types/yves/{comments/transfer/transfer-types.ts => shared/quote.ts} (50%) diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index dce11821..d2e213e9 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -5,9 +5,7 @@ declare namespace Cypress { /** * @example cy.iframe() */ - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - iframe($iframe: JQueryWithSelector): any; + iframe($iframe: JQueryWithSelector): unknown; /** * @example cy.resetYvesCookies() diff --git a/cypress/support/types/backoffice/order-management/fixture-types.ts b/cypress/support/types/backoffice/order-management.ts similarity index 73% rename from cypress/support/types/backoffice/order-management/fixture-types.ts rename to cypress/support/types/backoffice/order-management.ts index f9085bfd..d2928442 100644 --- a/cypress/support/types/backoffice/order-management/fixture-types.ts +++ b/cypress/support/types/backoffice/order-management.ts @@ -1,4 +1,4 @@ -import { Address, Customer, Product, User } from './transfer/transfer-types'; +import { Address, Customer, Product, User } from './shared'; export interface OrderManagementSuite1DynamicFixtures { customer: Customer; diff --git a/cypress/support/types/backoffice/order-management/index.ts b/cypress/support/types/backoffice/order-management/index.ts deleted file mode 100644 index fbb9e013..00000000 --- a/cypress/support/types/backoffice/order-management/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './fixture-types'; diff --git a/cypress/support/types/backoffice/order-management/transfer/transfer-types.ts b/cypress/support/types/backoffice/order-management/transfer/transfer-types.ts deleted file mode 100644 index efc8e3d4..00000000 --- a/cypress/support/types/backoffice/order-management/transfer/transfer-types.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface Customer { - email: string; -} - -export interface Address { - id_customer_address: number; -} - -export interface Product { - sku: string; - name: string; -} - -export interface User { - username: string; -} diff --git a/cypress/support/types/backoffice/return-management/fixture-types.ts b/cypress/support/types/backoffice/return-management.ts similarity index 74% rename from cypress/support/types/backoffice/return-management/fixture-types.ts rename to cypress/support/types/backoffice/return-management.ts index ac136175..51ecd48d 100644 --- a/cypress/support/types/backoffice/return-management/fixture-types.ts +++ b/cypress/support/types/backoffice/return-management.ts @@ -1,4 +1,4 @@ -import { Address, Customer, Product, Quote, User } from './transfer/transfer-types'; +import { Address, Customer, Product, Quote, User } from './shared'; export interface ReturnManagementSuite1DynamicFixtures { rootUser: User; diff --git a/cypress/support/types/backoffice/return-management/index.ts b/cypress/support/types/backoffice/return-management/index.ts deleted file mode 100644 index fbb9e013..00000000 --- a/cypress/support/types/backoffice/return-management/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './fixture-types'; diff --git a/cypress/support/types/backoffice/return-management/transfer/transfer-types.ts b/cypress/support/types/backoffice/return-management/transfer/transfer-types.ts deleted file mode 100644 index 9f3db3e2..00000000 --- a/cypress/support/types/backoffice/return-management/transfer/transfer-types.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface Customer { - email: string; -} - -export interface Address { - id_customer_address: number; -} - -export interface Product { - sku: string; -} - -export interface User { - username: string; -} - -export interface Quote { - name: string; -} diff --git a/cypress/support/types/backoffice/shared/address.ts b/cypress/support/types/backoffice/shared/address.ts new file mode 100644 index 00000000..f5334d04 --- /dev/null +++ b/cypress/support/types/backoffice/shared/address.ts @@ -0,0 +1,3 @@ +export interface Address { + id_customer_address: number; +} diff --git a/cypress/support/types/backoffice/shared/customer.ts b/cypress/support/types/backoffice/shared/customer.ts new file mode 100644 index 00000000..9e663dd4 --- /dev/null +++ b/cypress/support/types/backoffice/shared/customer.ts @@ -0,0 +1,3 @@ +export interface Customer { + email: string; +} diff --git a/cypress/support/types/backoffice/shared/index.ts b/cypress/support/types/backoffice/shared/index.ts new file mode 100644 index 00000000..351cf336 --- /dev/null +++ b/cypress/support/types/backoffice/shared/index.ts @@ -0,0 +1,5 @@ +export * from './address'; +export * from './customer'; +export * from './product'; +export * from './quote'; +export * from './user'; diff --git a/cypress/support/types/backoffice/shared/product.ts b/cypress/support/types/backoffice/shared/product.ts new file mode 100644 index 00000000..4faafb6e --- /dev/null +++ b/cypress/support/types/backoffice/shared/product.ts @@ -0,0 +1,4 @@ +export interface Product { + sku: string; + name: string; +} diff --git a/cypress/support/types/backoffice/shared/quote.ts b/cypress/support/types/backoffice/shared/quote.ts new file mode 100644 index 00000000..1aad98ca --- /dev/null +++ b/cypress/support/types/backoffice/shared/quote.ts @@ -0,0 +1,3 @@ +export interface Quote { + name: string; +} diff --git a/cypress/support/types/backoffice/shared/user.ts b/cypress/support/types/backoffice/shared/user.ts new file mode 100644 index 00000000..302d9059 --- /dev/null +++ b/cypress/support/types/backoffice/shared/user.ts @@ -0,0 +1,3 @@ +export interface User { + username: string; +} diff --git a/cypress/support/types/mp/marketplace-agent-assist/fixture-types.ts b/cypress/support/types/mp/marketplace-agent-assist.ts similarity index 95% rename from cypress/support/types/mp/marketplace-agent-assist/fixture-types.ts rename to cypress/support/types/mp/marketplace-agent-assist.ts index ec795181..a71e1f71 100644 --- a/cypress/support/types/mp/marketplace-agent-assist/fixture-types.ts +++ b/cypress/support/types/mp/marketplace-agent-assist.ts @@ -1,4 +1,4 @@ -import { Customer, Merchant, ProductConcrete, ProductOffer, User } from './transfer/transfer-types'; +import { Customer, Merchant, ProductConcrete, ProductOffer, User } from './shared'; export interface MarketplaceAgentAssistSuite1DynamicFixtures { rootUser: User; diff --git a/cypress/support/types/mp/marketplace-agent-assist/index.ts b/cypress/support/types/mp/marketplace-agent-assist/index.ts deleted file mode 100644 index fbb9e013..00000000 --- a/cypress/support/types/mp/marketplace-agent-assist/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './fixture-types'; diff --git a/cypress/support/types/mp/marketplace-agent-assist/transfer/transfer-types.ts b/cypress/support/types/mp/marketplace-agent-assist/transfer/transfer-types.ts deleted file mode 100644 index c263a57d..00000000 --- a/cypress/support/types/mp/marketplace-agent-assist/transfer/transfer-types.ts +++ /dev/null @@ -1,22 +0,0 @@ -export interface User { - username: string; - first_name: string; - last_name: string; -} - -export interface Merchant { - name: string; -} - -export interface Customer { - email: string; -} - -export interface ProductConcrete { - sku: string; - abstract_sku: string; -} - -export interface ProductOffer { - product_offer_reference: string; -} diff --git a/cypress/support/types/mp/shared/customer.ts b/cypress/support/types/mp/shared/customer.ts new file mode 100644 index 00000000..9e663dd4 --- /dev/null +++ b/cypress/support/types/mp/shared/customer.ts @@ -0,0 +1,3 @@ +export interface Customer { + email: string; +} diff --git a/cypress/support/types/mp/shared/index.ts b/cypress/support/types/mp/shared/index.ts new file mode 100644 index 00000000..dcc5ebb6 --- /dev/null +++ b/cypress/support/types/mp/shared/index.ts @@ -0,0 +1,5 @@ +export * from './customer'; +export * from './merchant'; +export * from './product'; +export * from './quote'; +export * from './user'; diff --git a/cypress/support/types/mp/shared/merchant.ts b/cypress/support/types/mp/shared/merchant.ts new file mode 100644 index 00000000..8533267d --- /dev/null +++ b/cypress/support/types/mp/shared/merchant.ts @@ -0,0 +1,3 @@ +export interface Merchant { + name: string; +} diff --git a/cypress/support/types/mp/shared/product.ts b/cypress/support/types/mp/shared/product.ts new file mode 100644 index 00000000..6b02a20f --- /dev/null +++ b/cypress/support/types/mp/shared/product.ts @@ -0,0 +1,8 @@ +export interface ProductConcrete { + sku: string; + abstract_sku: string; +} + +export interface ProductOffer { + product_offer_reference: string; +} diff --git a/cypress/support/types/mp/shared/quote.ts b/cypress/support/types/mp/shared/quote.ts new file mode 100644 index 00000000..1aad98ca --- /dev/null +++ b/cypress/support/types/mp/shared/quote.ts @@ -0,0 +1,3 @@ +export interface Quote { + name: string; +} diff --git a/cypress/support/types/mp/shared/user.ts b/cypress/support/types/mp/shared/user.ts new file mode 100644 index 00000000..63f2a4e3 --- /dev/null +++ b/cypress/support/types/mp/shared/user.ts @@ -0,0 +1,5 @@ +export interface User { + username: string; + first_name: string; + last_name: string; +} diff --git a/cypress/support/types/yves/checkout/fixture-types.ts b/cypress/support/types/yves/checkout.ts similarity index 77% rename from cypress/support/types/yves/checkout/fixture-types.ts rename to cypress/support/types/yves/checkout.ts index 07b533ab..da2eb42a 100644 --- a/cypress/support/types/yves/checkout/fixture-types.ts +++ b/cypress/support/types/yves/checkout.ts @@ -1,4 +1,4 @@ -import { Address, Customer, Product, Quote } from './transfer/transfer-types'; +import { Address, Customer, Product, Quote } from './shared'; export interface CheckoutSuite1DynamicFixtures { customer: Customer; diff --git a/cypress/support/types/yves/checkout/index.ts b/cypress/support/types/yves/checkout/index.ts deleted file mode 100644 index fbb9e013..00000000 --- a/cypress/support/types/yves/checkout/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './fixture-types'; diff --git a/cypress/support/types/yves/checkout/transfer/transfer-types.ts b/cypress/support/types/yves/checkout/transfer/transfer-types.ts deleted file mode 100644 index 929f7b8e..00000000 --- a/cypress/support/types/yves/checkout/transfer/transfer-types.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface Customer { - email: string; -} - -export interface Product { - sku: string; -} - -export interface Quote { - name: string; -} - -export interface Address { - id_customer_address: number; -} diff --git a/cypress/support/types/yves/comments/fixture-types.ts b/cypress/support/types/yves/comments.ts similarity index 81% rename from cypress/support/types/yves/comments/fixture-types.ts rename to cypress/support/types/yves/comments.ts index 097fe0e6..c7156113 100644 --- a/cypress/support/types/yves/comments/fixture-types.ts +++ b/cypress/support/types/yves/comments.ts @@ -1,4 +1,4 @@ -import { Customer, Product, Quote } from './transfer/transfer-types'; +import { Customer, Product, Quote } from './shared'; export interface CommentsSuite1DynamicFixtures { customer: Customer; diff --git a/cypress/support/types/yves/comments/index.ts b/cypress/support/types/yves/comments/index.ts deleted file mode 100644 index fbb9e013..00000000 --- a/cypress/support/types/yves/comments/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './fixture-types'; diff --git a/cypress/support/types/yves/shared/address.ts b/cypress/support/types/yves/shared/address.ts new file mode 100644 index 00000000..f5334d04 --- /dev/null +++ b/cypress/support/types/yves/shared/address.ts @@ -0,0 +1,3 @@ +export interface Address { + id_customer_address: number; +} diff --git a/cypress/support/types/yves/shared/customer.ts b/cypress/support/types/yves/shared/customer.ts new file mode 100644 index 00000000..9e663dd4 --- /dev/null +++ b/cypress/support/types/yves/shared/customer.ts @@ -0,0 +1,3 @@ +export interface Customer { + email: string; +} diff --git a/cypress/support/types/yves/shared/index.ts b/cypress/support/types/yves/shared/index.ts new file mode 100644 index 00000000..d1eab8c2 --- /dev/null +++ b/cypress/support/types/yves/shared/index.ts @@ -0,0 +1,4 @@ +export * from './address'; +export * from './customer'; +export * from './product'; +export * from './quote'; diff --git a/cypress/support/types/yves/shared/product.ts b/cypress/support/types/yves/shared/product.ts new file mode 100644 index 00000000..47e94acf --- /dev/null +++ b/cypress/support/types/yves/shared/product.ts @@ -0,0 +1,5 @@ +export interface Product { + id_product_concrete: number; + sku: string; + abstract_sku: string; +} diff --git a/cypress/support/types/yves/comments/transfer/transfer-types.ts b/cypress/support/types/yves/shared/quote.ts similarity index 50% rename from cypress/support/types/yves/comments/transfer/transfer-types.ts rename to cypress/support/types/yves/shared/quote.ts index 6bd9543c..f6790776 100644 --- a/cypress/support/types/yves/comments/transfer/transfer-types.ts +++ b/cypress/support/types/yves/shared/quote.ts @@ -1,9 +1,3 @@ -export interface Product { - id_product_concrete: number; - sku: string; - abstract_sku: string; -} - export interface Quote { id_quote: number; name: string; @@ -12,7 +6,3 @@ export interface Quote { totals: string; price_mode: string; } - -export interface Customer { - email: string; -} diff --git a/tsconfig.json b/tsconfig.json index f4f4db0a..a0b1d736 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,8 @@ "@pages/*": ["cypress/support/pages/*/index.ts"], "@utils": ["cypress/support/utils/index.ts"], "@scenarios/*": ["cypress/support/scenarios/*/index.ts"], - "@interfaces/*": ["cypress/support/types/*/index.ts"] + "@interfaces/*": ["cypress/support/types/*/index.ts"], + "@interfaces/shared": ["!cypress/support/types/shared/index.ts"] } }, "include": ["cypress/**/*.ts", "cypress.config.ts"] From a52e44f201166a4ea8541316e1f96f5a74a0dec9 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Thu, 7 Mar 2024 12:22:58 +0200 Subject: [PATCH 14/16] fixtures naming --- .eslintrc | 3 +++ .../comments-suite-1.json => dynamic-comments-suite-1.json} | 0 .../comments-suite-1.json => static-comments-suite-1.json} | 0 ...t-suite-1.json => dynamic-order-management-suite-1.json} | 0 ...nt-suite-1.json => static-order-management-suite-1.json} | 0 ...-suite-1.json => dynamic-return-management-suite-1.json} | 0 ...t-suite-1.json => static-return-management-suite-1.json} | 0 ...1.json => dynamic-marketplace-agent-assist-suite-1.json} | 0 ...2.json => dynamic-marketplace-agent-assist-suite-2.json} | 0 ...-1.json => static-marketplace-agent-assist-suite-1.json} | 0 ...-2.json => static-marketplace-agent-assist-suite-2.json} | 0 .../checkout-suite-1.json => dynamic-checkout-suite-1.json} | 0 .../checkout-suite-1.json => static-checkout-suite-1.json} | 0 .../comments-suite-1.json => dynamic-comments-suite-1.json} | 0 .../comments-suite-1.json => static-comments-suite-1.json} | 0 cypress/support/e2e.ts | 6 ++++-- cypress/support/index.d.ts | 2 +- .../pages/backoffice/sales/detail/sales-detail-page.ts | 2 +- .../pages/mp/agent-dashboard/agent-dashboard-page.ts | 2 +- cypress/support/scenarios/yves/checkout-mp-scenario.ts | 2 +- cypress/support/scenarios/yves/checkout-scenario.ts | 2 +- cypress/support/types/yves/comments.ts | 4 ++++ 22 files changed, 16 insertions(+), 7 deletions(-) rename cypress/fixtures/b2b/yves/comments/{dynamic/comments-suite-1.json => dynamic-comments-suite-1.json} (100%) rename cypress/fixtures/b2b/yves/comments/{static/comments-suite-1.json => static-comments-suite-1.json} (100%) rename cypress/fixtures/suite/backoffice/order-management/{dynamic/order-management-suite-1.json => dynamic-order-management-suite-1.json} (100%) rename cypress/fixtures/suite/backoffice/order-management/{static/order-management-suite-1.json => static-order-management-suite-1.json} (100%) rename cypress/fixtures/suite/backoffice/return-management/{dynamic/return-management-suite-1.json => dynamic-return-management-suite-1.json} (100%) rename cypress/fixtures/suite/backoffice/return-management/{static/return-management-suite-1.json => static-return-management-suite-1.json} (100%) rename cypress/fixtures/suite/mp/marketplace-agent-assist/{dynamic/marketplace-agent-assist-suite-1.json => dynamic-marketplace-agent-assist-suite-1.json} (100%) rename cypress/fixtures/suite/mp/marketplace-agent-assist/{dynamic/marketplace-agent-assist-suite-2.json => dynamic-marketplace-agent-assist-suite-2.json} (100%) rename cypress/fixtures/suite/mp/marketplace-agent-assist/{static/marketplace-agent-assist-suite-1.json => static-marketplace-agent-assist-suite-1.json} (100%) rename cypress/fixtures/suite/mp/marketplace-agent-assist/{static/marketplace-agent-assist-suite-2.json => static-marketplace-agent-assist-suite-2.json} (100%) rename cypress/fixtures/suite/yves/checkout/{dynamic/checkout-suite-1.json => dynamic-checkout-suite-1.json} (100%) rename cypress/fixtures/suite/yves/checkout/{static/checkout-suite-1.json => static-checkout-suite-1.json} (100%) rename cypress/fixtures/suite/yves/comments/{dynamic/comments-suite-1.json => dynamic-comments-suite-1.json} (100%) rename cypress/fixtures/suite/yves/comments/{static/comments-suite-1.json => static-comments-suite-1.json} (100%) diff --git a/.eslintrc b/.eslintrc index 6b6d43e3..cec36454 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,5 +12,8 @@ "ecmaVersion": 2018, "sourceType": "module", "project": "./tsconfig.json" + }, + "rules": { + "@typescript-eslint/no-inferrable-types": "error" } } diff --git a/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/b2b/yves/comments/dynamic-comments-suite-1.json similarity index 100% rename from cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json rename to cypress/fixtures/b2b/yves/comments/dynamic-comments-suite-1.json diff --git a/cypress/fixtures/b2b/yves/comments/static/comments-suite-1.json b/cypress/fixtures/b2b/yves/comments/static-comments-suite-1.json similarity index 100% rename from cypress/fixtures/b2b/yves/comments/static/comments-suite-1.json rename to cypress/fixtures/b2b/yves/comments/static-comments-suite-1.json diff --git a/cypress/fixtures/suite/backoffice/order-management/dynamic/order-management-suite-1.json b/cypress/fixtures/suite/backoffice/order-management/dynamic-order-management-suite-1.json similarity index 100% rename from cypress/fixtures/suite/backoffice/order-management/dynamic/order-management-suite-1.json rename to cypress/fixtures/suite/backoffice/order-management/dynamic-order-management-suite-1.json diff --git a/cypress/fixtures/suite/backoffice/order-management/static/order-management-suite-1.json b/cypress/fixtures/suite/backoffice/order-management/static-order-management-suite-1.json similarity index 100% rename from cypress/fixtures/suite/backoffice/order-management/static/order-management-suite-1.json rename to cypress/fixtures/suite/backoffice/order-management/static-order-management-suite-1.json diff --git a/cypress/fixtures/suite/backoffice/return-management/dynamic/return-management-suite-1.json b/cypress/fixtures/suite/backoffice/return-management/dynamic-return-management-suite-1.json similarity index 100% rename from cypress/fixtures/suite/backoffice/return-management/dynamic/return-management-suite-1.json rename to cypress/fixtures/suite/backoffice/return-management/dynamic-return-management-suite-1.json diff --git a/cypress/fixtures/suite/backoffice/return-management/static/return-management-suite-1.json b/cypress/fixtures/suite/backoffice/return-management/static-return-management-suite-1.json similarity index 100% rename from cypress/fixtures/suite/backoffice/return-management/static/return-management-suite-1.json rename to cypress/fixtures/suite/backoffice/return-management/static-return-management-suite-1.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/marketplace-agent-assist-suite-1.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-marketplace-agent-assist-suite-1.json similarity index 100% rename from cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/marketplace-agent-assist-suite-1.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-marketplace-agent-assist-suite-1.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/marketplace-agent-assist-suite-2.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-marketplace-agent-assist-suite-2.json similarity index 100% rename from cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/marketplace-agent-assist-suite-2.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-marketplace-agent-assist-suite-2.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/marketplace-agent-assist-suite-1.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-marketplace-agent-assist-suite-1.json similarity index 100% rename from cypress/fixtures/suite/mp/marketplace-agent-assist/static/marketplace-agent-assist-suite-1.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/static-marketplace-agent-assist-suite-1.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/marketplace-agent-assist-suite-2.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-marketplace-agent-assist-suite-2.json similarity index 100% rename from cypress/fixtures/suite/mp/marketplace-agent-assist/static/marketplace-agent-assist-suite-2.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/static-marketplace-agent-assist-suite-2.json diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json b/cypress/fixtures/suite/yves/checkout/dynamic-checkout-suite-1.json similarity index 100% rename from cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json rename to cypress/fixtures/suite/yves/checkout/dynamic-checkout-suite-1.json diff --git a/cypress/fixtures/suite/yves/checkout/static/checkout-suite-1.json b/cypress/fixtures/suite/yves/checkout/static-checkout-suite-1.json similarity index 100% rename from cypress/fixtures/suite/yves/checkout/static/checkout-suite-1.json rename to cypress/fixtures/suite/yves/checkout/static-checkout-suite-1.json diff --git a/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/suite/yves/comments/dynamic-comments-suite-1.json similarity index 100% rename from cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json rename to cypress/fixtures/suite/yves/comments/dynamic-comments-suite-1.json diff --git a/cypress/fixtures/suite/yves/comments/static/comments-suite-1.json b/cypress/fixtures/suite/yves/comments/static-comments-suite-1.json similarity index 100% rename from cypress/fixtures/suite/yves/comments/static/comments-suite-1.json rename to cypress/fixtures/suite/yves/comments/static-comments-suite-1.json diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 9353599b..27f4aa65 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -29,8 +29,8 @@ before(() => { const loadFixture = () => { const repositoryId = Cypress.env('repositoryId'); const fixtureFilePath = getFixtureFilePath(); - const dynamicFixturesDefaultFilePath = `${repositoryId}/${fixtureFilePath.directoryPart}/dynamic/${fixtureFilePath.filePart}`; - const staticFixturesDefaultFilePath = `${repositoryId}/${fixtureFilePath.directoryPart}/static/${fixtureFilePath.filePart}`; + const dynamicFixturesDefaultFilePath = `${repositoryId}/${fixtureFilePath.directoryPart}/dynamic-${fixtureFilePath.filePart}`; + const staticFixturesDefaultFilePath = `${repositoryId}/${fixtureFilePath.directoryPart}/static-${fixtureFilePath.filePart}`; cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${staticFixturesDefaultFilePath}.json`).then( (isFileExists) => { @@ -46,6 +46,8 @@ const loadFixture = () => { cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${dynamicFixturesDefaultFilePath}.json`).then( (isFileExists) => { + console.log(isFileExists, dynamicFixturesDefaultFilePath, 'dynamicFixturesDefaultFilePath'); + if (isFileExists) { cy.loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath).then((dynamicFixturesData) => { Cypress.env('dynamicFixtures', dynamicFixturesData); diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index d2e213e9..dfa7217a 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -13,7 +13,7 @@ declare namespace Cypress { resetYvesCookies(): void; /** - * @example cy.loadDynamicFixturesByPayload('suite/yves/checkout/dynamic/checkout-by-guest-customer') + * @example cy.loadDynamicFixturesByPayload('suite/yves/checkout/dynamic-checkout-by-guest-customer') */ loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath: string): Chainable; diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts index 934b4af0..b3f4de11 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -16,7 +16,7 @@ export class SalesDetailPage extends BackofficePage { super(); } - triggerOms = (state: string, shouldTriggerOmsInCli: boolean = false): void => { + triggerOms = (state: string, shouldTriggerOmsInCli = false): void => { if (shouldTriggerOmsInCli) { this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); } diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts index aab35e5f..0fadcfa1 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -26,7 +26,7 @@ export class AgentDashboardPage extends MpPage { }); }; - findMerchantUser = (query: string, counter: number = 1): Cypress.Chainable => { + findMerchantUser = (query: string, counter = 1): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(query); diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index 26e93b49..3a22951f 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -43,7 +43,7 @@ export class CheckoutMpScenario { this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; - private fillShippingAddress = (isMultiShipment: boolean = false): void => { + private fillShippingAddress = (isMultiShipment = false): void => { if (isMultiShipment) { this.checkoutAddressPage.fillMultiShippingAddress(); diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index a6e661e6..4e032f37 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -44,7 +44,7 @@ export class CheckoutScenario { this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; - private fillShippingAddress = (isMultiShipment: boolean = false, idCustomerAddress?: number): void => { + private fillShippingAddress = (isMultiShipment = false, idCustomerAddress?: number): void => { if (isMultiShipment) { this.checkoutAddressPage.fillMultiShippingAddress(idCustomerAddress); diff --git a/cypress/support/types/yves/comments.ts b/cypress/support/types/yves/comments.ts index c7156113..619fa1b6 100644 --- a/cypress/support/types/yves/comments.ts +++ b/cypress/support/types/yves/comments.ts @@ -1,5 +1,9 @@ import { Customer, Product, Quote } from './shared'; +const test: string = 4; + +console.log(test, 'test'); + export interface CommentsSuite1DynamicFixtures { customer: Customer; product: Product; From a2bb3359a486b533440c7a0bcfe7e9b73f3a9f60 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Thu, 7 Mar 2024 13:16:29 +0200 Subject: [PATCH 15/16] fix params --- .eslintrc | 3 +- .github/workflows/code-quality.yml | 3 + .../order-management-suite-1.cy.ts | 12 ++- .../return-management-suite-1.cy.ts | 15 ++- .../marketplace-agent-assist-suite-1.cy.ts | 100 ++++++++++++++---- .../marketplace-agent-assist-suite-2.cy.ts | 7 +- .../e2e/yves/checkout/checkout-suite-1.cy.ts | 20 +++- .../e2e/yves/comments/comments-suite-1.cy.ts | 5 +- cypress/support/e2e.ts | 6 +- .../create/merchant-user-create-page.ts | 9 +- .../merchant/create/merchant-create-page.ts | 10 +- .../user/create/user-create-page.ts | 10 +- .../support/pages/mp/profile/profile-page.ts | 2 +- .../checkout/address/checkout-address-page.ts | 14 ++- .../backoffice/user-login-scenario.ts | 9 +- .../mp/merchant-agent-login-user-scenario.ts | 9 +- .../scenarios/yves/customer-login-scenario.ts | 9 +- cypress/support/types/yves/comments.ts | 4 - .../utils/inversify/inversify.config.ts | 2 +- package.json | 13 +-- tsconfig.json | 3 +- 21 files changed, 201 insertions(+), 64 deletions(-) diff --git a/.eslintrc b/.eslintrc index cec36454..92d64585 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,6 +14,7 @@ "project": "./tsconfig.json" }, "rules": { - "@typescript-eslint/no-inferrable-types": "error" + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/explicit-function-return-type": "error" } } diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 4cc897d4..cd3670cf 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -23,5 +23,8 @@ jobs: - name: Check Prettier Formatting run: npm run prettier:check + - name: Run Typescript Check + run: npm run typecheck + - name: Run ESLint on TS Files run: npm run lint diff --git a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts index e3533afe..520793d2 100644 --- a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts @@ -20,7 +20,7 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = }); it('should be able to create an order by existing customer', (): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + loginCustomerScenario.execute({ email: dynamicFixtures.customer.email, password: staticFixtures.defaultPassword }); checkoutScenario.execute({ isGuest: false, @@ -29,7 +29,10 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = }); cy.contains('Your order has been placed successfully!'); - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); salesIndexPage.viewLastPlacedOrder(); cy.get('body').contains(dynamicFixtures.product.name); @@ -42,7 +45,10 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = checkoutScenario.execute({ isGuest: true }); cy.contains('Your order has been placed successfully!'); - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); salesIndexPage.viewLastPlacedOrder(); cy.get('body').contains(dynamicFixtures.product.name); diff --git a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts index 7fe3f8a9..d308443e 100644 --- a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts @@ -20,7 +20,10 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void }); beforeEach((): void => { - customerLoginScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); }); it('should be able to create return from (from shipped order state)', (): void => { @@ -29,7 +32,10 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void isMultiShipment: false, idCustomerAddress: dynamicFixtures.address.id_customer_address, }); - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); salesIndexPage.visit(); salesIndexPage.viewLastPlacedOrder(); @@ -50,7 +56,10 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void isMultiShipment: false, idCustomerAddress: dynamicFixtures.address.id_customer_address, }); - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); salesIndexPage.visit(); salesIndexPage.viewLastPlacedOrder(); diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts index 75766901..c1943d93 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts @@ -36,14 +36,20 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent (customer) should be able to login to backoffice', (): void => { - userLoginScenario.execute(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.customerAgentUser.username, + password: staticFixtures.defaultPassword, + }); backofficeIndexPage.visit(); backofficeIndexPage.assertPageLocation(); }); it('agent (merchant user) should be able to login to backoffice', (): void => { - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + merchantAgentLoginUserScenario.execute({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); backofficeIndexPage.visit(); backofficeIndexPage.assertPageLocation(); @@ -90,7 +96,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent should be able to see "Merchant Users" table', (): void => { - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + merchantAgentLoginUserScenario.execute({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentDashboardPage.visit(); mpAgentDashboardPage.assertPageLocation(); @@ -105,14 +114,20 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent should be able to see active merchant user in a table', (): void => { - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + merchantAgentLoginUserScenario.execute({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentDashboardPage.visit(); mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); }); it('agent should be able to filter by merchant user properties', (): void => { - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + merchantAgentLoginUserScenario.execute({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentDashboardPage.visit(); mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name, 3).should('exist'); @@ -146,7 +161,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentLoginPage.visit(); mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); @@ -163,7 +181,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentLoginPage.visit(); mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); @@ -180,7 +201,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentLoginPage.visit(); mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); @@ -197,7 +221,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentLoginPage.visit(); mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); @@ -268,7 +295,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('agent (merchant user) should be able to login to MP agent dashboard', (): void => { - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + merchantAgentLoginUserScenario.execute({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); mpAgentDashboardPage.visit(); mpAgentDashboardPage.assertPageLocation(); @@ -352,7 +382,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); @@ -365,7 +398,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); @@ -378,7 +414,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to see existing user with merchant agent permission', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); @@ -386,21 +425,30 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to see "Agent Customer" column in user table', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.getUserTableHeader().contains('Agent Customer'); }); it('backoffice user should be able to see "Agent Merchant" column in user table', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.getUserTableHeader().contains('Agent Merchant'); }); it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage @@ -410,7 +458,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage @@ -420,7 +471,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); @@ -428,7 +482,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to create new user with merchant agent permission', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); @@ -436,7 +493,10 @@ describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist }); it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); backofficeUserIndexPage.visit(); backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts index e4368084..ed9a8c3f 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts @@ -31,13 +31,16 @@ describe('marketplace agent assist suite 2', { tags: ['@marketplace-agent-assist }); it('agent should be able to change order status during impersonation', (): void => { - customerLoginScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + customerLoginScenario.execute({ email: dynamicFixtures.customer.email, password: staticFixtures.defaultPassword }); cartPage.visit(); cartPage.quickAddToCart(dynamicFixtures.productConcreteForOffer.sku); checkoutMpScenario.execute({ isGuest: false }); - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); salesIndexPage.viewLastPlacedOrder(); salesDetailPage.triggerOms('Pay'); diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts index f59c88b4..668a5b7d 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -41,7 +41,10 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { }); it('customer should checkout to single shipment (with customer shipping address)', (): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); checkoutScenario.execute({ isGuest: false, @@ -53,7 +56,10 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { }); it('customer should checkout to single shipment (with new shipping address)', (): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); checkoutScenario.execute({ isGuest: false, @@ -67,7 +73,10 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { 'customer should checkout to multi shipment address (with customer shipping address)', { tags: ['@smoke'] }, (): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); checkoutScenario.execute({ isGuest: false, @@ -83,7 +92,10 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { 'customer should checkout to multi shipment address (with new shipping address)', { tags: ['@smoke'] }, (): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); checkoutScenario.execute({ isGuest: false, diff --git a/cypress/e2e/yves/comments/comments-suite-1.cy.ts b/cypress/e2e/yves/comments/comments-suite-1.cy.ts index 6f5758d0..afa6db28 100644 --- a/cypress/e2e/yves/comments/comments-suite-1.cy.ts +++ b/cypress/e2e/yves/comments/comments-suite-1.cy.ts @@ -16,7 +16,10 @@ describe('comments suite 1', { tags: ['@comments'] }, (): void => { }); beforeEach((): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); }); it('customer should be able to add comments to cart with items', (): void => { diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 27f4aa65..a1631040 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -26,7 +26,7 @@ before(() => { loadFixture(); }); -const loadFixture = () => { +const loadFixture = (): void => { const repositoryId = Cypress.env('repositoryId'); const fixtureFilePath = getFixtureFilePath(); const dynamicFixturesDefaultFilePath = `${repositoryId}/${fixtureFilePath.directoryPart}/dynamic-${fixtureFilePath.filePart}`; @@ -46,8 +46,6 @@ const loadFixture = () => { cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${dynamicFixturesDefaultFilePath}.json`).then( (isFileExists) => { - console.log(isFileExists, dynamicFixturesDefaultFilePath, 'dynamicFixturesDefaultFilePath'); - if (isFileExists) { cy.loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath).then((dynamicFixturesData) => { Cypress.env('dynamicFixtures', dynamicFixturesData); @@ -57,7 +55,7 @@ const loadFixture = () => { ); }; -const getFixtureFilePath = () => { +const getFixtureFilePath = (): Record => { const fullFilePath = Cypress.spec.relative; const basePath = 'cypress/e2e/'; diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts index 8afb2363..aaa58050 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts @@ -1,9 +1,14 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; - import { BackofficePage } from '../../backoffice-page'; import { MerchantUserCreateRepository } from './merchant-user-create-repository'; +interface User { + username: string; + firstName: string; + lastName: string; +} + @injectable() @autoWired export class MerchantUserCreatePage extends BackofficePage { @@ -11,7 +16,7 @@ export class MerchantUserCreatePage extends BackofficePage { protected PAGE_URL = '/merchant-user-gui/edit-merchant-user'; - createMerchantUser = () => { + createMerchantUser = (): User => { const uniquePrefix: string = this.faker.number.int({ min: 1000, max: 9999 }).toString(); const merchantUser = { diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts index 9eb90b7e..57c75187 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts @@ -1,9 +1,15 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; - import { BackofficePage } from '../../backoffice-page'; import { MerchantCreateRepository } from './merchant-create-repository'; +interface Merchant { + name: string; + reference: string; + email: string; + url: string; +} + @injectable() @autoWired export class MerchantCreatePage extends BackofficePage { @@ -11,7 +17,7 @@ export class MerchantCreatePage extends BackofficePage { protected PAGE_URL = '/merchant-gui/create-merchant'; - createMerchant = () => { + createMerchant = (): Merchant => { const identifier = this.faker.string.uuid(); const merchant = { diff --git a/cypress/support/pages/backoffice/user/create/user-create-page.ts b/cypress/support/pages/backoffice/user/create/user-create-page.ts index b5c4b222..b53c8384 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-page.ts @@ -1,9 +1,13 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; - import { BackofficePage } from '../../backoffice-page'; import { UserCreateRepository } from './user-create-repository'; +interface User { + username: string; + password: string; +} + @injectable() @autoWired export class UserCreatePage extends BackofficePage { @@ -13,7 +17,7 @@ export class UserCreatePage extends BackofficePage { private DEFAULT_PASSWORD = 'Change123@_'; private EN_LOCALE_VALUE = '66'; - createRootUser = () => { + createRootUser = (): User => { const user = { username: this.faker.internet.email(), password: this.DEFAULT_PASSWORD, @@ -28,7 +32,7 @@ export class UserCreatePage extends BackofficePage { return user; }; - createAgentMerchantUser = () => { + createAgentMerchantUser = (): User => { const user = { username: this.faker.internet.email(), password: this.DEFAULT_PASSWORD, diff --git a/cypress/support/pages/mp/profile/profile-page.ts b/cypress/support/pages/mp/profile/profile-page.ts index ca665e8f..e905fe29 100644 --- a/cypress/support/pages/mp/profile/profile-page.ts +++ b/cypress/support/pages/mp/profile/profile-page.ts @@ -11,7 +11,7 @@ export class ProfilePage extends MpPage { protected PAGE_URL = '/merchant-profile-merchant-portal-gui/profile'; - updateMerchantPhoneNumber = (phone?: string) => { + updateMerchantPhoneNumber = (phone?: string): void => { this.repository .getPhoneNumberInput() .clear() diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts index eca62405..3c65e846 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -1,9 +1,19 @@ import { REPOSITORIES, autoWired } from '@utils'; import { inject, injectable } from 'inversify'; - import { YvesPage } from '../../yves-page'; import { CheckoutAddressRepository } from './checkout-address-repository'; +interface Address { + firstName: string; + lastName: string; + address1: string; + address2: string; + zipCode: string; + city: string; + company: string; + phone: string; +} + @injectable() @autoWired export class CheckoutAddressPage extends YvesPage { @@ -120,7 +130,7 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getNextButton().click(); }; - private createDummyCheckoutAddress = () => { + private createDummyCheckoutAddress = (): Omit => { const prefix = '[e2e] '; return { diff --git a/cypress/support/scenarios/backoffice/user-login-scenario.ts b/cypress/support/scenarios/backoffice/user-login-scenario.ts index b261c60e..c85bf869 100644 --- a/cypress/support/scenarios/backoffice/user-login-scenario.ts +++ b/cypress/support/scenarios/backoffice/user-login-scenario.ts @@ -2,12 +2,19 @@ import { LoginPage } from '@pages/backoffice'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; +interface UserLoginExecuteParams { + username: string; + password: string; +} + @injectable() @autoWired export class UserLoginScenario { @inject(LoginPage) private loginPage: LoginPage; - execute = (username: string, password: string): void => { + execute = (params: UserLoginExecuteParams): void => { + const { username, password } = params; + cy.session([username, password], () => { this.loginPage.visit(); this.loginPage.login(username, password); diff --git a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts index ca4b7a55..f132428f 100644 --- a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts @@ -2,12 +2,19 @@ import { AgentLoginPage } from '@pages/mp'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; +interface MerchantAgentLoginExecuteParams { + username: string; + password: string; +} + @injectable() @autoWired export class MerchantAgentLoginUserScenario { @inject(AgentLoginPage) private agentLoginPage: AgentLoginPage; - execute = (username: string, password: string): void => { + execute = (params: MerchantAgentLoginExecuteParams): void => { + const { username, password } = params; + cy.session([username, password], () => { this.agentLoginPage.visit(); this.agentLoginPage.login(username, password); diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index a2d36042..454159ea 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -2,12 +2,19 @@ import { LoginPage } from '@pages/yves'; import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; +interface CustomerLoginExecuteParams { + email: string; + password: string; +} + @injectable() @autoWired export class CustomerLoginScenario { @inject(LoginPage) private loginPage: LoginPage; - execute = (email: string, password: string): void => { + execute = (params: CustomerLoginExecuteParams): void => { + const { email, password } = params; + cy.session([email, password], () => { this.loginPage.visit(); this.loginPage.login(email, password); diff --git a/cypress/support/types/yves/comments.ts b/cypress/support/types/yves/comments.ts index 619fa1b6..c7156113 100644 --- a/cypress/support/types/yves/comments.ts +++ b/cypress/support/types/yves/comments.ts @@ -1,9 +1,5 @@ import { Customer, Product, Quote } from './shared'; -const test: string = 4; - -console.log(test, 'test'); - export interface CommentsSuite1DynamicFixtures { customer: Customer; product: Product; diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index 9d75c312..d3ea0ddf 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -50,7 +50,7 @@ if (repositoryId === 'b2b') { applyRepositoryBindings(b2bMappings); } -function applyRepositoryBindings(bindings: BindingsMap) { +function applyRepositoryBindings(bindings: BindingsMap): void { for (const [type, implementation] of Object.entries(bindings)) { container.bind(type).to(implementation); } diff --git a/package.json b/package.json index 12cd3d20..70691268 100644 --- a/package.json +++ b/package.json @@ -10,15 +10,16 @@ }, "license": "MIT", "scripts": { + "typecheck": "tsc --noEmit", "lint": "eslint . --ext .ts", - "prettier:check": "npx prettier . --check", - "prettier:write": "npx prettier . --write", + "prettier:check": "prettier . --check", + "prettier:write": "prettier . --write", "cy:open": "cypress open", "cy:run": "cypress run --headless --browser electron", - "cy:yves": "npx cypress run --spec cypress/e2e/yves/* --headless --browser electron", - "cy:backoffice": "npx cypress run --spec cypress/e2e/backoffice/* --headless --browser electron", - "cy:mp": "npx cypress run --spec cypress/e2e/mp/* --headless --browser electron", - "cy:feature:comments": "npx cypress run --env grepTags=@comments --headless --browser electron" + "cy:yves": "cypress run --spec cypress/e2e/yves/* --headless --browser electron", + "cy:backoffice": "cypress run --spec cypress/e2e/backoffice/* --headless --browser electron", + "cy:mp": "cypress run --spec cypress/e2e/mp/* --headless --browser electron", + "cy:feature:comments": "cypress run --env grepTags=@comments --headless --browser electron" }, "engines": { "node": ">=18.0.0", diff --git a/tsconfig.json b/tsconfig.json index a0b1d736..f4f4db0a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,8 +16,7 @@ "@pages/*": ["cypress/support/pages/*/index.ts"], "@utils": ["cypress/support/utils/index.ts"], "@scenarios/*": ["cypress/support/scenarios/*/index.ts"], - "@interfaces/*": ["cypress/support/types/*/index.ts"], - "@interfaces/shared": ["!cypress/support/types/shared/index.ts"] + "@interfaces/*": ["cypress/support/types/*/index.ts"] } }, "include": ["cypress/**/*.ts", "cypress.config.ts"] From 1904214afd309c6aeceff7fa76f5aeebf7336345 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Thu, 7 Mar 2024 15:05:29 +0300 Subject: [PATCH 16/16] Fixed typo. --- .../address/repositories/suite-checkout-address-repository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts index 47a59e5c..03f1e92e 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts @@ -29,7 +29,7 @@ export class SuiteCheckoutAddressRepository implements CheckoutAddressRepository getMultiShipmentAddressItemElement = (): Cypress.Chainable => cy.get('[data-qa="component address-item-form-field-list"]'); getMultiShipmentAddressItemDeliveryRadio = ($addressItem: JQuery, index: number): Cypress.Chainable => - cy.wrap($addressItem).get(`#addressesForm_multiShippingAddresses_${index}_shipmentType_key_1`); + cy.wrap($addressItem).get(`#addressesForm_multiShippingAddresses_${index}_shipmentType_key_0`); getMultiShipmentAddressItemAddressField = ($addressItem: JQuery, index: number): Cypress.Chainable => cy.wrap($addressItem).get(`#addressesForm_multiShippingAddresses_${index}_shippingAddress_id_customer_address`); getMultiShipmentAddressItemAddressFirstNameField = (