From 7fec5b7a1327c2fbe7ff57aed91d32e45b8ad590 Mon Sep 17 00:00:00 2001 From: pivovarov Date: Mon, 19 Feb 2024 15:12:10 +0300 Subject: [PATCH 01/53] start dynamic fixtures --- .env.example | 1 + cypress.config.ts | 13 +++ .../return/order-return-by-user.cy.ts | 63 +++++++++++++++ cypress/e2e/comment/cart-comment.cy.ts | 81 ------------------- .../backoffice-merchant-agent.cy.ts | 0 .../merchant-portal-agent-login.cy.ts | 0 .../order/create-order-by-customer.cy.ts | 41 ---------- .../order/create-order-by-guest.cy.ts | 22 ----- .../return/create-return-by-user.cy.ts | 78 ------------------ .../cart/comment/empty-cart-comment.cy.ts | 45 +++++++++++ .../cart/comment/not-empty-cart-comment.cy.ts | 45 +++++++++++ .../checkout/checkout-by-guest-customer.cy.ts | 1 + .../checkout-by-logged-in-customer.cy.ts | 1 + .../order/create-order-by-customer.cy.ts | 28 +++++++ .../order/create-order-by-guest.cy.ts | 23 ++++++ cypress/fixtures/b2b/cart-comment.json | 11 --- .../b2b/dynamic/empty-cart-comment.json | 52 ++++++++++++ .../b2b/dynamic/not-empty-cart-comment.json | 58 +++++++++++++ .../b2b/static/empty-cart-comment.json | 12 +++ .../b2b/static/not-empty-cart-comment.json | 12 +++ cypress/fixtures/suite/cart-comment.json | 11 --- .../suite/create-order-by-customer.json | 7 -- .../fixtures/suite/create-order-by-guest.json | 3 - .../dynamic/create-order-by-customer.json | 79 ++++++++++++++++++ .../suite/dynamic/create-order-by-guest.json | 51 ++++++++++++ .../suite/dynamic/empty-cart-comment.json | 52 ++++++++++++ .../suite/dynamic/not-empty-cart-comment.json | 58 +++++++++++++ .../suite/dynamic/order-return-by-user.json | 3 + .../backoffice-merchant-agent.json | 0 .../checkout-by-guest-customer.json | 0 .../checkout-by-logged-in-customer.json | 0 .../static/create-order-by-customer.json | 5 ++ .../suite/static/empty-cart-comment.json | 12 +++ .../merchant-portal-agent-login.json | 0 .../suite/static/not-empty-cart-comment.json | 12 +++ .../order-return-by-user.json} | 1 - cypress/support/commands.js | 28 +++++++ cypress/support/e2e.js | 21 ++++- cypress/support/index.d.ts | 5 ++ cypress/support/pages/abstract-page.ts | 1 + .../backoffice/login/backoffice-login-page.ts | 12 +-- .../yves/agent-login/yves-agent-login-page.ts | 1 + .../suite-yves-cart-repository.ts | 2 +- .../address/yves-checkout-address-page.ts | 1 + .../customer/yves-checkout-customer-page.ts | 12 +-- .../b2b-yves-comment-cart-repository.ts | 4 + .../suite-yves-comment-cart-repository.ts | 3 + .../comment/cart/yves-comment-cart-page.ts | 19 ++++- .../cart/yves-comment-cart-repository.ts | 2 + cypress/support/pages/yves/index.ts | 10 +++ .../pages/yves/login/yves-login-page.ts | 43 ++-------- .../scenarios/yves/create-cart-scenario.ts | 13 --- cypress/support/scenarios/yves/index.ts | 5 ++ .../yves/place-customer-order-scenario.ts | 1 + .../yves/register-customer-scenario.ts | 21 ----- .../yves/yves-login-customer-scenario.ts | 4 +- cypress/support/types/address.ts | 10 +++ .../return/dynamic-fixture-types.ts | 3 + .../order-management/return/index.ts | 2 + .../return/static-fixture-types.ts | 9 +++ cypress/support/types/country.ts | 3 + cypress/support/types/index.ts | 5 ++ cypress/support/types/stock.ts | 4 + cypress/support/types/t.ts | 39 +++++++++ .../types/yves/cart/comment/common/product.ts | 5 ++ .../types/yves/cart/comment/common/quote.ts | 7 ++ .../cart/comment/dynamic-fixture-types.ts | 13 +++ .../support/types/yves/cart/comment/index.ts | 2 + .../yves/cart/comment/static-fixture-types.ts | 11 +++ .../order-managment/order/common/product.ts | 3 + .../order-managment/order/common/quote.ts | 7 ++ .../order/dynamic-fixture-types.ts | 14 ++++ .../types/yves/order-managment/order/index.ts | 2 + .../order/static-fixture-types.ts | 7 ++ .../support/utils/typescript/fixture-types.ts | 41 ---------- cypress/support/utils/typescript/types.ts | 41 ---------- package-lock.json | 11 +-- 77 files changed, 899 insertions(+), 429 deletions(-) create mode 100644 cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts delete mode 100644 cypress/e2e/comment/cart-comment.cy.ts rename cypress/e2e/{ => mp}/merchant-agent-assist/backoffice-merchant-agent.cy.ts (100%) rename cypress/e2e/{ => mp}/merchant-agent-assist/merchant-portal-agent-login.cy.ts (100%) delete mode 100644 cypress/e2e/order-management/order/create-order-by-customer.cy.ts delete mode 100644 cypress/e2e/order-management/order/create-order-by-guest.cy.ts delete mode 100644 cypress/e2e/order-management/return/create-return-by-user.cy.ts create mode 100644 cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts create mode 100644 cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts rename cypress/e2e/{ => yves}/checkout/checkout-by-guest-customer.cy.ts (98%) rename cypress/e2e/{ => yves}/checkout/checkout-by-logged-in-customer.cy.ts (98%) create mode 100644 cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts create mode 100644 cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts delete mode 100644 cypress/fixtures/b2b/cart-comment.json create mode 100644 cypress/fixtures/b2b/dynamic/empty-cart-comment.json create mode 100644 cypress/fixtures/b2b/dynamic/not-empty-cart-comment.json create mode 100644 cypress/fixtures/b2b/static/empty-cart-comment.json create mode 100644 cypress/fixtures/b2b/static/not-empty-cart-comment.json delete mode 100644 cypress/fixtures/suite/cart-comment.json delete mode 100644 cypress/fixtures/suite/create-order-by-customer.json delete mode 100644 cypress/fixtures/suite/create-order-by-guest.json create mode 100644 cypress/fixtures/suite/dynamic/create-order-by-customer.json create mode 100644 cypress/fixtures/suite/dynamic/create-order-by-guest.json create mode 100644 cypress/fixtures/suite/dynamic/empty-cart-comment.json create mode 100644 cypress/fixtures/suite/dynamic/not-empty-cart-comment.json create mode 100644 cypress/fixtures/suite/dynamic/order-return-by-user.json rename cypress/fixtures/suite/{ => static}/backoffice-merchant-agent.json (100%) rename cypress/fixtures/suite/{ => static}/checkout-by-guest-customer.json (100%) rename cypress/fixtures/suite/{ => static}/checkout-by-logged-in-customer.json (100%) create mode 100644 cypress/fixtures/suite/static/create-order-by-customer.json create mode 100644 cypress/fixtures/suite/static/empty-cart-comment.json rename cypress/fixtures/suite/{ => static}/merchant-portal-agent-login.json (100%) create mode 100644 cypress/fixtures/suite/static/not-empty-cart-comment.json rename cypress/fixtures/suite/{create-return-by-user.json => static/order-return-by-user.json} (66%) create mode 100644 cypress/support/pages/yves/index.ts delete mode 100644 cypress/support/scenarios/yves/create-cart-scenario.ts create mode 100644 cypress/support/scenarios/yves/index.ts delete mode 100644 cypress/support/scenarios/yves/register-customer-scenario.ts create mode 100644 cypress/support/types/address.ts create mode 100644 cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts create mode 100644 cypress/support/types/backoffice/order-management/return/index.ts create mode 100644 cypress/support/types/backoffice/order-management/return/static-fixture-types.ts create mode 100644 cypress/support/types/country.ts create mode 100644 cypress/support/types/index.ts create mode 100644 cypress/support/types/stock.ts create mode 100644 cypress/support/types/t.ts create mode 100644 cypress/support/types/yves/cart/comment/common/product.ts create mode 100644 cypress/support/types/yves/cart/comment/common/quote.ts create mode 100644 cypress/support/types/yves/cart/comment/dynamic-fixture-types.ts create mode 100644 cypress/support/types/yves/cart/comment/index.ts create mode 100644 cypress/support/types/yves/cart/comment/static-fixture-types.ts create mode 100644 cypress/support/types/yves/order-managment/order/common/product.ts create mode 100644 cypress/support/types/yves/order-managment/order/common/quote.ts create mode 100644 cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts create mode 100644 cypress/support/types/yves/order-managment/order/index.ts create mode 100644 cypress/support/types/yves/order-managment/order/static-fixture-types.ts delete mode 100644 cypress/support/utils/typescript/fixture-types.ts delete mode 100644 cypress/support/utils/typescript/types.ts diff --git a/.env.example b/.env.example index 4aaec810..4dbbc386 100644 --- a/.env.example +++ b/.env.example @@ -2,6 +2,7 @@ ENV_REPOSITORY_ID=suite ENV_BACKOFFICE_URL=http://backoffice.de.spryker.local ENV_MERCHANT_PORTAL_URL=http://mp.de.spryker.local ENV_MAIL_CATCHER_URL=http://mail.spryker.local +OPERATION_RUNNER_URL=http://glue-backend.de.spryker.local/test-operation-runner E2E_BASE_URL=http://yves.de.spryker.local VIEWPORT_WIDGTH=1920 diff --git a/cypress.config.ts b/cypress.config.ts index e5975e38..2b270de1 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,5 +1,6 @@ import { defineConfig } from 'cypress'; import dotenv from 'dotenv'; +import * as fs from 'fs'; dotenv.config(); export default defineConfig({ @@ -8,6 +9,7 @@ export default defineConfig({ backofficeUrl: process.env.ENV_BACKOFFICE_URL, merchantPortalUrl: process.env.ENV_MERCHANT_PORTAL_URL, mailCatcherUrl: process.env.ENV_MAIL_CATCHER_URL, + operationRunnerUrl: process.env.OPERATION_RUNNER_URL, cli: { // TODO: move to .env store: 'DE', @@ -17,6 +19,17 @@ export default defineConfig({ }, e2e: { baseUrl: process.env.E2E_BASE_URL, + defaultCommandTimeout: 8000, + setupNodeEvents(on, config) { + on('task', { + isFileExists(filename): boolean { + if (fs.existsSync(filename)) { + return true; + } + return false; + }, + }); + }, }, viewportWidth: parseInt(process.env.VIEWPORT_WIDGTH ?? '1000', 10), viewportHeight: parseInt(process.env.VIEWPORT_HEIGHT ?? '660', 10), diff --git a/cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts b/cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts new file mode 100644 index 00000000..d5e43f28 --- /dev/null +++ b/cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts @@ -0,0 +1,63 @@ +import {container} from '../../../../support/utils/inversify/inversify.config'; +import {BackofficeLoginPage} from "../../../../support/pages/backoffice/login/backoffice-login-page"; +import {BackofficeSalesIndexPage} from "../../../../support/pages/backoffice/sales/index/backoffice-sales-index-page"; +import {BackofficeSalesDetailPage} from "../../../../support/pages/backoffice/sales/detail/backoffice-sales-detail-page"; +import {BackofficeSalesReturnGuiCreatePage} from "../../../../support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page"; +import {OrderReturnByUserDynamicFixtures, OrderReturnByUserStaticFixtures} from "../../../../support/types/backoffice/order-management/return"; + + +// ??? NOT SURE THAT WE SHOULD TEST THIS CASE THROUGH THE UI + +describe('create order return by user', (): void => { + let dynamicFixtures: OrderReturnByUserDynamicFixtures; + let staticFixtures: OrderReturnByUserStaticFixtures; + + let loginPage: BackofficeLoginPage; + let salesIndexPage: BackofficeSalesIndexPage; + let salesDetailPage: BackofficeSalesDetailPage; + let salesReturnGuiCreatePage: BackofficeSalesReturnGuiCreatePage; + + before((): void => { + cy.resetBackofficeCookies(); + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + loginPage = container.get(BackofficeLoginPage); + salesIndexPage = container.get(BackofficeSalesIndexPage); + salesDetailPage = container.get(BackofficeSalesDetailPage); + salesReturnGuiCreatePage = container.get(BackofficeSalesReturnGuiCreatePage); + }); + + beforeEach((): void => { + // have customer and BO user and order fixtures + //trigger OMS console oms:check-condition + //trigger OMS console oms:check-timeout + loginPage.login(staticFixtures.user.username, staticFixtures.user.password); + }); + + it('should be able to create return from Backoffice (from shipped order state) [@regression]', (): void => { + salesIndexPage.viewLastPlacedOrder(); + salesDetailPage.triggerOms('Pay'); + salesDetailPage.triggerOms('Skip timeout'); + salesDetailPage.triggerOms('skip picking'); + salesDetailPage.triggerOms('Ship'); + + salesDetailPage.createReturn(); + salesReturnGuiCreatePage.createReturnForAllOrderItems(); + + cy.contains('Return was successfully created.'); + }); + + it('should be able to create return from Backoffice (from delivery order state)', (): void => { + salesIndexPage.viewLastPlacedOrder(); + salesDetailPage.triggerOms('Pay'); + salesDetailPage.triggerOms('Skip timeout'); + salesDetailPage.triggerOms('skip picking'); + salesDetailPage.triggerOms('Ship'); + salesDetailPage.triggerOms('Stock update'); + + salesDetailPage.createReturn(); + salesReturnGuiCreatePage.createReturnForAllOrderItems(); + + cy.contains('Return was successfully created.'); + }); +}); diff --git a/cypress/e2e/comment/cart-comment.cy.ts b/cypress/e2e/comment/cart-comment.cy.ts deleted file mode 100644 index 9e631bbb..00000000 --- a/cypress/e2e/comment/cart-comment.cy.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { YvesCartPage } from '../../support/pages/yves/cart/yves-cart-page'; -import { YvesCommentCartPage } from '../../support/pages/yves/comment/cart/yves-comment-cart-page'; -import { YvesLoginCustomerScenario } from '../../support/scenarios/yves/yves-login-customer-scenario'; -import { CreateCartScenario } from '../../support/scenarios/yves/create-cart-scenario'; - -describe('cart comment', (): void => { - let fixtures: CartCommentFixtures; - - let cartPage: YvesCartPage; - let commentCartPage: YvesCommentCartPage; - let loginCustomerScenario: YvesLoginCustomerScenario; - let createCartScenario: CreateCartScenario; - - before((): void => { - fixtures = Cypress.env('fixtures'); - - cartPage = container.get(YvesCartPage); - commentCartPage = container.get(YvesCommentCartPage); - loginCustomerScenario = container.get(YvesLoginCustomerScenario); - createCartScenario = container.get(CreateCartScenario); - }); - - beforeEach((): void => { - cy.resetYvesCookies(); - - loginCustomerScenario.execute(fixtures.customer); - createCartScenario.execute(); - }); - - it('customer should be able to add comments to empty cart [@comment]', (): void => { - fixtures.comments.forEach((commentMessage) => { - commentCartPage.addComment(commentMessage); - - commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); - }); - }); - - it('customer should be able to add comments to cart [@comment]', (): void => { - cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSku); - - fixtures.comments.forEach((commentMessage) => { - commentCartPage.addComment(commentMessage); - commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); - }); - }); - - it('customer should be able to modify comment in empty cart [@comment]', (): void => { - commentCartPage.addComment(fixtures.comments[0]); - commentCartPage.updateFirstComment(fixtures.comments[1]); - - commentCartPage.getCommentThreadListSection().contains(fixtures.comments[1]).should('exist'); - }); - - it('customer should be able to modify comment in cart [@comment]', (): void => { - cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSku); - - commentCartPage.addComment(fixtures.comments[0]); - commentCartPage.updateFirstComment(fixtures.comments[1]); - - commentCartPage.getCommentThreadListSection().contains(fixtures.comments[1]).should('exist'); - }); - - it('customer should be able to remove comment in empty cart [@comment]', (): void => { - commentCartPage.addComment(fixtures.comments[0]); - - commentCartPage.removeFirstComment(); - commentCartPage.getCommentThreadListSection().should('not.exist'); - }); - - it('customer should be able to remove comment in cart [@comment]', (): void => { - cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSku); - commentCartPage.addComment(fixtures.comments[0]); - - commentCartPage.removeFirstComment(); - commentCartPage.getCommentThreadListSection().should('not.exist'); - }); -}); diff --git a/cypress/e2e/merchant-agent-assist/backoffice-merchant-agent.cy.ts b/cypress/e2e/mp/merchant-agent-assist/backoffice-merchant-agent.cy.ts similarity index 100% rename from cypress/e2e/merchant-agent-assist/backoffice-merchant-agent.cy.ts rename to cypress/e2e/mp/merchant-agent-assist/backoffice-merchant-agent.cy.ts diff --git a/cypress/e2e/merchant-agent-assist/merchant-portal-agent-login.cy.ts b/cypress/e2e/mp/merchant-agent-assist/merchant-portal-agent-login.cy.ts similarity index 100% rename from cypress/e2e/merchant-agent-assist/merchant-portal-agent-login.cy.ts rename to cypress/e2e/mp/merchant-agent-assist/merchant-portal-agent-login.cy.ts diff --git a/cypress/e2e/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/order-management/order/create-order-by-customer.cy.ts deleted file mode 100644 index 7ca0b3fe..00000000 --- a/cypress/e2e/order-management/order/create-order-by-customer.cy.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { YvesLoginCustomerScenario } from '../../../support/scenarios/yves/yves-login-customer-scenario'; -import { RegisterCustomerScenario } from '../../../support/scenarios/yves/register-customer-scenario'; -import { PlaceCustomerOrderScenario } from '../../../support/scenarios/yves/place-customer-order-scenario'; - -describe('create order by customer', (): void => { - let fixtures: CreateOrderByCustomerFixtures; - - let loginCustomerScenario: YvesLoginCustomerScenario; - let registerCustomerScenario: RegisterCustomerScenario; - let placeCustomerOrderScenario: PlaceCustomerOrderScenario; - - before((): void => { - fixtures = Cypress.env('fixtures'); - - loginCustomerScenario = container.get(YvesLoginCustomerScenario); - registerCustomerScenario = container.get(RegisterCustomerScenario); - placeCustomerOrderScenario = container.get(PlaceCustomerOrderScenario); - }); - - beforeEach((): void => { - cy.resetYvesCookies(); - }); - - it('should be able to create an order by new registered customer', (): void => { - const customer: Customer = registerCustomerScenario.execute(); - loginCustomerScenario.execute(customer); - - placeCustomerOrderScenario.execute(fixtures.concreteProductSkus); - - cy.contains('Your order has been placed successfully!'); - }); - - it('should be able to create an order by existing customer [@order, @regression]', (): void => { - loginCustomerScenario.execute(fixtures.customer); - - placeCustomerOrderScenario.execute(fixtures.concreteProductSkus); - - cy.contains('Your order has been placed successfully!'); - }); -}); diff --git a/cypress/e2e/order-management/order/create-order-by-guest.cy.ts b/cypress/e2e/order-management/order/create-order-by-guest.cy.ts deleted file mode 100644 index 17e07a40..00000000 --- a/cypress/e2e/order-management/order/create-order-by-guest.cy.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { PlaceGuestOrderScenario } from '../../../support/scenarios/yves/place-guest-order-scenario'; - -describe('create order by guest', (): void => { - let fixtures: CreateOrderByGuestFixtures; - let placeGuestOrderScenario: PlaceGuestOrderScenario; - - beforeEach((): void => { - cy.resetYvesCookies(); - }); - - before((): void => { - fixtures = Cypress.env('fixtures'); - placeGuestOrderScenario = container.get(PlaceGuestOrderScenario); - }); - - it('should be able to create an order by guest [@regression]', (): void => { - placeGuestOrderScenario.execute(fixtures.concreteProductSkus); - - cy.contains('Your order has been placed successfully!'); - }); -}); diff --git a/cypress/e2e/order-management/return/create-return-by-user.cy.ts b/cypress/e2e/order-management/return/create-return-by-user.cy.ts deleted file mode 100644 index 06ffb96c..00000000 --- a/cypress/e2e/order-management/return/create-return-by-user.cy.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { CliHelper } from '../../../support/helpers/cli-helper'; -import { container } from '../../../support/utils/inversify/inversify.config'; -import { BackofficeLoginPage } from '../../../support/pages/backoffice/login/backoffice-login-page'; -import { BackofficeSalesIndexPage } from '../../../support/pages/backoffice/sales/index/backoffice-sales-index-page'; -import { BackofficeSalesDetailPage } from '../../../support/pages/backoffice/sales/detail/backoffice-sales-detail-page'; -import { BackofficeSalesReturnGuiCreatePage } from '../../../support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page'; -import { RegisterCustomerScenario } from '../../../support/scenarios/yves/register-customer-scenario'; -import { PlaceCustomerOrderScenario } from '../../../support/scenarios/yves/place-customer-order-scenario'; -import { YvesLoginCustomerScenario } from '../../../support/scenarios/yves/yves-login-customer-scenario'; - -describe('create return by user', (): void => { - let fixtures: CreateReturnByUserFixtures; - - let loginPage: BackofficeLoginPage; - let salesIndexPage: BackofficeSalesIndexPage; - let salesDetailPage: BackofficeSalesDetailPage; - let salesReturnGuiCreatePage: BackofficeSalesReturnGuiCreatePage; - let registerCustomerScenario: RegisterCustomerScenario; - let loginCustomerScenario: YvesLoginCustomerScenario; - let placeCustomerOrderScenario: PlaceCustomerOrderScenario; - let cliHelper: CliHelper; - - before((): void => { - fixtures = Cypress.env('fixtures'); - - loginPage = container.get(BackofficeLoginPage); - salesIndexPage = container.get(BackofficeSalesIndexPage); - salesDetailPage = container.get(BackofficeSalesDetailPage); - salesReturnGuiCreatePage = container.get(BackofficeSalesReturnGuiCreatePage); - registerCustomerScenario = container.get(RegisterCustomerScenario); - loginCustomerScenario = container.get(YvesLoginCustomerScenario); - placeCustomerOrderScenario = container.get(PlaceCustomerOrderScenario); - cliHelper = container.get(CliHelper); - }); - - beforeEach((): void => { - cy.resetYvesCookies(); - cy.resetBackofficeCookies(); - - const customer = registerCustomerScenario.execute(); - loginCustomerScenario.execute(customer); - placeCustomerOrderScenario.execute(fixtures.concreteProductSkus); - - cliHelper.run('console oms:check-condition'); - cliHelper.run('console oms:check-timeout'); - }); - - it('should be able to create return from Backoffice (from shipped order state) [@regression]', (): void => { - loginPage.login(fixtures.user); - - salesIndexPage.viewLastPlacedOrder(); - salesDetailPage.triggerOms('Pay'); - salesDetailPage.triggerOms('Skip timeout'); - salesDetailPage.triggerOms('skip picking'); - salesDetailPage.triggerOms('Ship'); - - salesDetailPage.createReturn(); - salesReturnGuiCreatePage.createReturnForAllOrderItems(); - - cy.contains('Return was successfully created.'); - }); - - it('should be able to create return from Backoffice (from delivery order state)', (): void => { - loginPage.login(fixtures.user); - - salesIndexPage.viewLastPlacedOrder(); - salesDetailPage.triggerOms('Pay'); - salesDetailPage.triggerOms('Skip timeout'); - salesDetailPage.triggerOms('skip picking'); - salesDetailPage.triggerOms('Ship'); - salesDetailPage.triggerOms('Stock update'); - - salesDetailPage.createReturn(); - salesReturnGuiCreatePage.createReturnForAllOrderItems(); - - cy.contains('Return was successfully created.'); - }); -}); diff --git a/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts b/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts new file mode 100644 index 00000000..b4397ff1 --- /dev/null +++ b/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts @@ -0,0 +1,45 @@ +import { container } from '../../../../support/utils/inversify/inversify.config'; +import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; +import {YvesCommentCartPage} from "../../../../support/pages/yves"; +import {YvesLoginCustomerScenario} from "../../../../support/scenarios/yves"; + +describe('cart comment', (): void => { + let dynamicFixtures: CartCommentDynamicFixtures; + let staticFixtures: CartCommentStaticFixtures; + let commentCartPage: YvesCommentCartPage; + let loginCustomerScenario: YvesLoginCustomerScenario; + + before((): void => { + cy.resetYvesCookies(); + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + commentCartPage = container.get(YvesCommentCartPage); + loginCustomerScenario = container.get(YvesLoginCustomerScenario); + }); + + beforeEach((): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); + commentCartPage.visit(); + }); + + it('customer should be able to add comments to empty cart [@comment]', (): void => { + staticFixtures.commentsToAdd.forEach((commentMessage) => { + commentCartPage.addComment(commentMessage); + + commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); + }); + }); + + it('customer should be able to modify comment in empty cart [@comment]', (): void => { + commentCartPage.addComment(staticFixtures.commentToModify); + commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); + }); + + it('customer should be able to remove comment in empty cart [@comment]', (): void => { + commentCartPage.addComment(staticFixtures.commentsToRemove); + commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist'); + }); +}); diff --git a/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts b/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts new file mode 100644 index 00000000..900df13a --- /dev/null +++ b/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts @@ -0,0 +1,45 @@ +import { container } from '../../../../support/utils/inversify/inversify.config'; +import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; +import {YvesCommentCartPage} from "../../../../support/pages/yves"; +import {YvesLoginCustomerScenario} from "../../../../support/scenarios/yves"; + +describe('cart comment', (): void => { + let dynamicFixtures: CartCommentDynamicFixtures; + let staticFixtures: CartCommentStaticFixtures; + let commentCartPage: YvesCommentCartPage; + let loginCustomerScenario: YvesLoginCustomerScenario; + + before((): void => { + cy.resetYvesCookies(); + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + commentCartPage = container.get(YvesCommentCartPage); + loginCustomerScenario = container.get(YvesLoginCustomerScenario); + }); + + beforeEach((): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); + commentCartPage.visit(); + }); + + it('customer should be able to add comments to cart [@comment]', (): void => { + staticFixtures.commentsToAdd.forEach((commentMessage) => { + commentCartPage.addComment(commentMessage); + + commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); + }); + }); + + it('customer should be able to modify comment in cart [@comment]', (): void => { + commentCartPage.addComment(staticFixtures.commentToModify); + commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); + }); + + it('customer should be able to remove comment in cart [@comment]', (): void => { + commentCartPage.addComment(staticFixtures.commentsToRemove); + commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist'); + }); +}); diff --git a/cypress/e2e/checkout/checkout-by-guest-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts similarity index 98% rename from cypress/e2e/checkout/checkout-by-guest-customer.cy.ts rename to cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts index 20152b08..91dcbb27 100644 --- a/cypress/e2e/checkout/checkout-by-guest-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts @@ -5,6 +5,7 @@ import { YvesCheckoutAddressPage } from '../../support/pages/yves/checkout/addre import { YvesCheckoutShipmentPage } from '../../support/pages/yves/checkout/shipment/yves-checkout-shipment-page'; import { YvesCheckoutPaymentPage } from '../../support/pages/yves/checkout/payment/yves-checkout-payment-page'; import { YvesCheckoutSummaryPage } from '../../support/pages/yves/checkout/summary/yves-checkout-summary-page'; +import {CheckoutByGuestCustomerFixtures} from "../../support/types"; describe('checkout by guest customer', (): void => { let fixtures: CheckoutByGuestCustomerFixtures; diff --git a/cypress/e2e/checkout/checkout-by-logged-in-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts similarity index 98% rename from cypress/e2e/checkout/checkout-by-logged-in-customer.cy.ts rename to cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts index ddcd8a5b..79bbbc6b 100644 --- a/cypress/e2e/checkout/checkout-by-logged-in-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts @@ -5,6 +5,7 @@ import { YvesCheckoutShipmentPage } from '../../support/pages/yves/checkout/ship import { YvesCheckoutPaymentPage } from '../../support/pages/yves/checkout/payment/yves-checkout-payment-page'; import { YvesCheckoutSummaryPage } from '../../support/pages/yves/checkout/summary/yves-checkout-summary-page'; import { YvesLoginCustomerScenario } from '../../support/scenarios/yves/yves-login-customer-scenario'; +import {CheckoutByLoggedInCustomerFixtures} from "../../support/types"; describe('checkout by logged in customer', (): void => { let fixtures: CheckoutByLoggedInCustomerFixtures; diff --git a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts new file mode 100644 index 00000000..e6414ecb --- /dev/null +++ b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts @@ -0,0 +1,28 @@ +import { container } from '../../../../support/utils/inversify/inversify.config'; +import {CreateOrderByCustomerDynamicFixtures, CreateOrderByCustomerStaticFixtures} from "../../../../support/types/yves/order-managment/order"; +import {PlaceCustomerOrderScenario, YvesLoginCustomerScenario} from "../../../../support/scenarios/yves"; + +describe('create order by customer', (): void => { + let staticFixtures: CreateOrderByCustomerStaticFixtures; + let dynamicFixtures: CreateOrderByCustomerDynamicFixtures; + let loginCustomerScenario: YvesLoginCustomerScenario; + let placeCustomerOrderScenario: PlaceCustomerOrderScenario; + + before((): void => { + cy.resetYvesCookies(); + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + loginCustomerScenario = container.get(YvesLoginCustomerScenario); + placeCustomerOrderScenario = container.get(PlaceCustomerOrderScenario); + loginCustomerScenario = container.get(YvesLoginCustomerScenario); + }); + + beforeEach((): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); + }); + + it('should be able to create an order by existing customer [@order, @regression]', (): void => { + placeCustomerOrderScenario.execute([dynamicFixtures.product.sku]); + + cy.contains('Your order has been placed successfully!'); + }); +}); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts new file mode 100644 index 00000000..519d0fa8 --- /dev/null +++ b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts @@ -0,0 +1,23 @@ +import { container } from '../../../../support/utils/inversify/inversify.config'; +import {CreateOrderByGuestDynamicFixtures} from "../../../../support/types/yves/order-managment/order"; +import {PlaceGuestOrderScenario} from "../../../../support/scenarios/yves"; + +describe('create order by guest', (): void => { + let dynamicFixtures: CreateOrderByGuestDynamicFixtures; + let placeGuestOrderScenario: PlaceGuestOrderScenario; + + beforeEach((): void => { + cy.resetYvesCookies(); + }); + + before((): void => { + dynamicFixtures = Cypress.env('dynamicFixtures'); + placeGuestOrderScenario = container.get(PlaceGuestOrderScenario); + }); + + it('should be able to create an order by guest [@regression]', (): void => { + placeGuestOrderScenario.execute([dynamicFixtures.product.sku]); + + cy.contains('Your order has been placed successfully!'); + }); +}); diff --git a/cypress/fixtures/b2b/cart-comment.json b/cypress/fixtures/b2b/cart-comment.json deleted file mode 100644 index 34d644c4..00000000 --- a/cypress/fixtures/b2b/cart-comment.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "concreteProductSku": "101171", - "comments": [ - "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", - "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." - ], - "customer": { - "email": "sonia@spryker.com", - "password": "change123" - } -} diff --git a/cypress/fixtures/b2b/dynamic/empty-cart-comment.json b/cypress/fixtures/b2b/dynamic/empty-cart-comment.json new file mode 100644 index 00000000..d89959b6 --- /dev/null +++ b/cypress/fixtures/b2b/dynamic/empty-cart-comment.json @@ -0,0 +1,52 @@ +{ + "data": { + "type": "test-helper-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/dynamic/not-empty-cart-comment.json b/cypress/fixtures/b2b/dynamic/not-empty-cart-comment.json new file mode 100644 index 00000000..d0f5d69c --- /dev/null +++ b/cypress/fixtures/b2b/dynamic/not-empty-cart-comment.json @@ -0,0 +1,58 @@ +{ + "data": { + "type": "test-helper-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/static/empty-cart-comment.json b/cypress/fixtures/b2b/static/empty-cart-comment.json new file mode 100644 index 00000000..f367949b --- /dev/null +++ b/cypress/fixtures/b2b/static/empty-cart-comment.json @@ -0,0 +1,12 @@ +{ + "commentsToAdd": [ + "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", + "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." + ], + "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", + "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "customer": { + "password": "change123" + } +} diff --git a/cypress/fixtures/b2b/static/not-empty-cart-comment.json b/cypress/fixtures/b2b/static/not-empty-cart-comment.json new file mode 100644 index 00000000..f367949b --- /dev/null +++ b/cypress/fixtures/b2b/static/not-empty-cart-comment.json @@ -0,0 +1,12 @@ +{ + "commentsToAdd": [ + "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", + "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." + ], + "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", + "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "customer": { + "password": "change123" + } +} diff --git a/cypress/fixtures/suite/cart-comment.json b/cypress/fixtures/suite/cart-comment.json deleted file mode 100644 index 71f608d6..00000000 --- a/cypress/fixtures/suite/cart-comment.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "concreteProductSku": "159_29885260", - "comments": [ - "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", - "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." - ], - "customer": { - "email": "maria.williams@spryker.com", - "password": "change123" - } -} diff --git a/cypress/fixtures/suite/create-order-by-customer.json b/cypress/fixtures/suite/create-order-by-customer.json deleted file mode 100644 index 420eee1d..00000000 --- a/cypress/fixtures/suite/create-order-by-customer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "concreteProductSkus": ["156_32018944", "159_29885260"], - "customer": { - "email": "maria.williams@spryker.com", - "password": "change123" - } -} diff --git a/cypress/fixtures/suite/create-order-by-guest.json b/cypress/fixtures/suite/create-order-by-guest.json deleted file mode 100644 index 573a2447..00000000 --- a/cypress/fixtures/suite/create-order-by-guest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "concreteProductSkus": ["156_32018944", "159_29885260"] -} diff --git a/cypress/fixtures/suite/dynamic/create-order-by-customer.json b/cypress/fixtures/suite/dynamic/create-order-by-customer.json new file mode 100644 index 00000000..bc1c02e8 --- /dev/null +++ b/cypress/fixtures/suite/dynamic/create-order-by-customer.json @@ -0,0 +1,79 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": [ + "#customer" + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 50000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/dynamic/create-order-by-guest.json b/cypress/fixtures/suite/dynamic/create-order-by-guest.json new file mode 100644 index 00000000..b0858186 --- /dev/null +++ b/cypress/fixtures/suite/dynamic/create-order-by-guest.json @@ -0,0 +1,51 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 50000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/dynamic/empty-cart-comment.json b/cypress/fixtures/suite/dynamic/empty-cart-comment.json new file mode 100644 index 00000000..60103304 --- /dev/null +++ b/cypress/fixtures/suite/dynamic/empty-cart-comment.json @@ -0,0 +1,52 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/dynamic/not-empty-cart-comment.json b/cypress/fixtures/suite/dynamic/not-empty-cart-comment.json new file mode 100644 index 00000000..557eeb71 --- /dev/null +++ b/cypress/fixtures/suite/dynamic/not-empty-cart-comment.json @@ -0,0 +1,58 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/dynamic/order-return-by-user.json b/cypress/fixtures/suite/dynamic/order-return-by-user.json new file mode 100644 index 00000000..4f6a8105 --- /dev/null +++ b/cypress/fixtures/suite/dynamic/order-return-by-user.json @@ -0,0 +1,3 @@ +{ + "concreteProductSkus": ["159_29885260"], +} diff --git a/cypress/fixtures/suite/backoffice-merchant-agent.json b/cypress/fixtures/suite/static/backoffice-merchant-agent.json similarity index 100% rename from cypress/fixtures/suite/backoffice-merchant-agent.json rename to cypress/fixtures/suite/static/backoffice-merchant-agent.json diff --git a/cypress/fixtures/suite/checkout-by-guest-customer.json b/cypress/fixtures/suite/static/checkout-by-guest-customer.json similarity index 100% rename from cypress/fixtures/suite/checkout-by-guest-customer.json rename to cypress/fixtures/suite/static/checkout-by-guest-customer.json diff --git a/cypress/fixtures/suite/checkout-by-logged-in-customer.json b/cypress/fixtures/suite/static/checkout-by-logged-in-customer.json similarity index 100% rename from cypress/fixtures/suite/checkout-by-logged-in-customer.json rename to cypress/fixtures/suite/static/checkout-by-logged-in-customer.json diff --git a/cypress/fixtures/suite/static/create-order-by-customer.json b/cypress/fixtures/suite/static/create-order-by-customer.json new file mode 100644 index 00000000..46ebaa8b --- /dev/null +++ b/cypress/fixtures/suite/static/create-order-by-customer.json @@ -0,0 +1,5 @@ +{ + "customer": { + "password": "change123" + } +} diff --git a/cypress/fixtures/suite/static/empty-cart-comment.json b/cypress/fixtures/suite/static/empty-cart-comment.json new file mode 100644 index 00000000..f367949b --- /dev/null +++ b/cypress/fixtures/suite/static/empty-cart-comment.json @@ -0,0 +1,12 @@ +{ + "commentsToAdd": [ + "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", + "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." + ], + "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", + "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "customer": { + "password": "change123" + } +} diff --git a/cypress/fixtures/suite/merchant-portal-agent-login.json b/cypress/fixtures/suite/static/merchant-portal-agent-login.json similarity index 100% rename from cypress/fixtures/suite/merchant-portal-agent-login.json rename to cypress/fixtures/suite/static/merchant-portal-agent-login.json diff --git a/cypress/fixtures/suite/static/not-empty-cart-comment.json b/cypress/fixtures/suite/static/not-empty-cart-comment.json new file mode 100644 index 00000000..f367949b --- /dev/null +++ b/cypress/fixtures/suite/static/not-empty-cart-comment.json @@ -0,0 +1,12 @@ +{ + "commentsToAdd": [ + "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", + "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." + ], + "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", + "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "customer": { + "password": "change123" + } +} diff --git a/cypress/fixtures/suite/create-return-by-user.json b/cypress/fixtures/suite/static/order-return-by-user.json similarity index 66% rename from cypress/fixtures/suite/create-return-by-user.json rename to cypress/fixtures/suite/static/order-return-by-user.json index 09224130..6664475a 100644 --- a/cypress/fixtures/suite/create-return-by-user.json +++ b/cypress/fixtures/suite/static/order-return-by-user.json @@ -1,5 +1,4 @@ { - "concreteProductSkus": ["159_29885260"], "user": { "username": "admin@spryker.com", "password": "change123" diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c9acc0a6..3b49324f 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -33,6 +33,34 @@ Cypress.Commands.add('resetYvesCookies', () => { }); }); +Cypress.Commands.add('loadDynamicFixturesByPayload', (dynamicFixturesFilePath) => { + cy.fixture(dynamicFixturesFilePath).then((operationRequestPayload) => { + return cy + .request({ + method: 'POST', + url: Cypress.env().operationRunnerUrl, + headers: { + 'Content-Type': 'application/vnd.api+json', + }, + body: operationRequestPayload, + }) + .then((response) => { + if (Array.isArray(response.body.data)) { + // If the response data is an array, map over it and create an object with dynamic keys + return response.body.data.reduce((acc, item) => { + acc[item.type] = item.attributes; + return acc; + }, {}); + } else { + // If the response data is a single item, create an object with a dynamic key + return { + [response.body.data.type]: response.body.data.attributes.properties, + }; + } + }); + }); +}); + Cypress.Commands.add('resetBackofficeCookies', () => { cy.clearCookies(); cy.visitBackoffice('/security-gui/login', { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 4a236782..ca0c6e0d 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -27,14 +27,27 @@ beforeEach(function () { const loadFixture = () => { const repositoryId = Cypress.env('repositoryId'); const testFileName = getTestFileName(); + const dynamicFixturesDefaultFilePath = `${repositoryId}/dynamic/${testFileName}`; + const staticFixturesDefaultFilePath = `${repositoryId}/static/${testFileName}`; - cy.fixture(`${repositoryId}/${testFileName}`).then((fixtureData) => { - if (fixtureData) { - Cypress.env('fixtures', fixtureData); + cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${staticFixturesDefaultFilePath}.json`).then((isFileExists) => { + if (isFileExists) { + cy.fixture(staticFixturesDefaultFilePath).then((staticFixtures) => { + if (staticFixtures) { + Cypress.env('staticFixtures', staticFixtures); + } + }); } }); -}; + cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${dynamicFixturesDefaultFilePath}.json`).then((isFileExists) => { + if (isFileExists) { + cy.loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath).then((dynamicFixturesData) => { + Cypress.env('dynamicFixtures', dynamicFixturesData); + }); + } + }); +}; const getTestFileName = () => { const filePath = Cypress.spec.relative; let fileName = path.basename(filePath, path.extname(filePath)); diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index 844429c0..cdaeed7c 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -12,6 +12,11 @@ declare namespace Cypress { */ resetYvesCookies(): void; + /** + * @example cy.runFixtureHelpers() + */ + loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath: string): Chainable; + /** * @example cy.resetBackofficeCookies() */ diff --git a/cypress/support/pages/abstract-page.ts b/cypress/support/pages/abstract-page.ts index 235f55f5..92f3981e 100644 --- a/cypress/support/pages/abstract-page.ts +++ b/cypress/support/pages/abstract-page.ts @@ -4,6 +4,7 @@ import { injectable } from 'inversify'; @injectable() export class AbstractPage { + // make protected to allow access from child classes only and use visit only public PAGE_URL: string = ''; protected faker: Faker; diff --git a/cypress/support/pages/backoffice/login/backoffice-login-page.ts b/cypress/support/pages/backoffice/login/backoffice-login-page.ts index ecc2c243..b55ed905 100644 --- a/cypress/support/pages/backoffice/login/backoffice-login-page.ts +++ b/cypress/support/pages/backoffice/login/backoffice-login-page.ts @@ -13,11 +13,13 @@ export class BackofficeLoginPage extends AbstractPage { super(); } - public login = (user: User): void => { - cy.visitBackoffice(this.PAGE_URL); - this.repository.getEmailInput().clear().type(user.username); - this.repository.getPasswordInput().clear().type(user.password); + public login = (username: string, password: string): void => { + cy.session([username, password], () => { + cy.visitBackoffice(this.PAGE_URL); + this.repository.getEmailInput().clear().type(username); + this.repository.getPasswordInput().clear().type(password); - this.repository.getSubmitButton().click(); + this.repository.getSubmitButton().click(); + }); }; } diff --git a/cypress/support/pages/yves/agent-login/yves-agent-login-page.ts b/cypress/support/pages/yves/agent-login/yves-agent-login-page.ts index a9344e4f..da98b162 100644 --- a/cypress/support/pages/yves/agent-login/yves-agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/yves-agent-login-page.ts @@ -4,6 +4,7 @@ import { TYPES } from '../../../utils/inversify/types'; import 'reflect-metadata'; import { autoProvide } from '../../../utils/inversify/auto-provide'; import { YvesAgentLoginRepository } from './yves-agent-login-repository'; +import {User} from "../../../types/user"; @injectable() @autoProvide diff --git a/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts index c6983d4c..b56899c0 100644 --- a/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts @@ -39,6 +39,6 @@ export class SuiteYvesCartRepository implements YvesCartRepository { }; getCheckoutButton = (): Cypress.Chainable => { - return cy.get('[data-qa="cart-go-to-checkout"]'); + return cy.get('[data-qa="cart-go-to-checkout"]',{ timeout: 50000 }); }; } diff --git a/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts index 2d50e535..64e4e787 100644 --- a/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts @@ -4,6 +4,7 @@ import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; import { autoProvide } from '../../../../utils/inversify/auto-provide'; import { YvesCheckoutAddressRepository } from './yves-checkout-address-repository'; +import {CheckoutAddress} from "../../../../types/common/address"; @injectable() @autoProvide diff --git a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts index 291c5719..11a36294 100644 --- a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts @@ -4,6 +4,8 @@ import 'reflect-metadata'; import { TYPES } from '../../../../utils/inversify/types'; import { autoProvide } from '../../../../utils/inversify/auto-provide'; import { YvesCheckoutCustomerRepository } from './yves-checkout-customer-repository'; +import {Customer} from "../../../../types"; + @injectable() @autoProvide @@ -14,11 +16,11 @@ export class YvesCheckoutCustomerPage extends AbstractPage { super(); } - public checkoutAsGuest = (customerGuestForm?: CustomerGuestForm): void => { - const customerGuest: CustomerGuest = { - firstName: customerGuestForm?.firstName ?? this.faker.person.firstName(), - lastName: customerGuestForm?.lastName ?? this.faker.person.lastName(), - email: customerGuestForm?.email ?? this.faker.internet.email(), + public checkoutAsGuest = (): void => { + const customerGuest: Customer = { + firstName: this.faker.person.firstName(), + lastName: this.faker.person.lastName(), + email: this.faker.internet.email(), }; this.repository.getGuestRadioButton().click(); diff --git a/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts index 3d9dbb59..0e56a227 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts @@ -29,4 +29,8 @@ export class B2bYvesCommentCartRepository implements YvesCommentCartRepository { getUpdateCommentButtonSelector(): string { return 'button:contains("Update")'; } + + getCommentTextareaByCommentText(commentText: string): Cypress.Chainable { + return this.getCommentThreadListSection().first().contains(commentText); + } } diff --git a/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts index cd16fb5d..1f275879 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts @@ -23,6 +23,9 @@ export class SuiteYvesCommentCartRepository implements YvesCommentCartRepository getFirstCommentTextarea(): Cypress.Chainable { return this.getCommentThreadListSection().first().find('textarea'); } + getCommentTextareaByCommentText(commentText: string): Cypress.Chainable { + return this.getCommentThreadListSection().first().contains(commentText); + } getUpdateCommentButtonSelector(): string { return 'button:contains("Update")'; diff --git a/cypress/support/pages/yves/comment/cart/yves-comment-cart-page.ts b/cypress/support/pages/yves/comment/cart/yves-comment-cart-page.ts index 19d050e6..762dbda2 100644 --- a/cypress/support/pages/yves/comment/cart/yves-comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/yves-comment-cart-page.ts @@ -14,6 +14,10 @@ export class YvesCommentCartPage extends AbstractPage { super(); } + public visit = (): void => { + cy.visit(this.PAGE_URL); + } + public addComment = (commentMessage: string): void => { this.repository.getAddCommentForm().last().find('textarea').clear().type(commentMessage); this.repository.getAddCommentForm().last().find(this.repository.getAddCommentButtonSelector()).click(); @@ -25,9 +29,22 @@ export class YvesCommentCartPage extends AbstractPage { this.getCommentThreadListSection().first().find(this.repository.getUpdateCommentButtonSelector()).click(); }; + public 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 => { + this.repository + .getCommentTextareaByCommentText(commentMessage) + .parent() + .find(this.repository.getRemoveCommentButtonSelector()) + .click(); + }; public removeFirstComment = (): void => { - this.getCommentThreadListSection().first().find(this.repository.getRemoveCommentButtonSelector()).click(); + this.getCommentThreadListSection().find(this.repository.getRemoveCommentButtonSelector()).click(); }; public getCommentThreadListSection = (): Cypress.Chainable => { diff --git a/cypress/support/pages/yves/comment/cart/yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/yves-comment-cart-repository.ts index 1cf56a89..9816bac1 100644 --- a/cypress/support/pages/yves/comment/cart/yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/yves-comment-cart-repository.ts @@ -9,5 +9,7 @@ export interface YvesCommentCartRepository { getFirstCommentTextarea(): Cypress.Chainable; + getCommentTextareaByCommentText(commentText: string): Cypress.Chainable; + getUpdateCommentButtonSelector(): string; } diff --git a/cypress/support/pages/yves/index.ts b/cypress/support/pages/yves/index.ts new file mode 100644 index 00000000..3d885475 --- /dev/null +++ b/cypress/support/pages/yves/index.ts @@ -0,0 +1,10 @@ +export * from './cart/yves-cart-page'; +export * from './agent-login/yves-agent-login-page'; +export * from './checkout/address/yves-checkout-address-page'; +export * from './checkout/customer/yves-checkout-customer-page'; +export * from './checkout/payment/yves-checkout-payment-page'; +export * from './checkout/shipment/yves-checkout-shipment-page'; +export * from './checkout/summary/yves-checkout-summary-page'; +export * from './comment/cart/yves-comment-cart-page'; +export * from './login/yves-login-page'; +export * from './multi-cart/yves-multi-cart-page'; diff --git a/cypress/support/pages/yves/login/yves-login-page.ts b/cypress/support/pages/yves/login/yves-login-page.ts index 6604fd03..03de02d4 100644 --- a/cypress/support/pages/yves/login/yves-login-page.ts +++ b/cypress/support/pages/yves/login/yves-login-page.ts @@ -17,41 +17,14 @@ export class YvesLoginPage extends AbstractPage { super(); } - public login = (customer: Customer): void => { - cy.visit(this.PAGE_URL); - this.repository.getLoginEmailInput().clear().type(customer.email); - this.repository.getLoginPasswordInput().clear().type(customer.password); - - this.repository.getLoginForm().submit(); - }; - - public register = (customerRegistration?: CustomerRegistration): Customer => { - if (!customerRegistration) { - customerRegistration = { - email: this.faker.internet.email(), - password: this.faker.internet.password({ length: 20, prefix: this.DEFAULT_PASSWORD_PREFIX }), - salutation: this.DEFAULT_SALUTATION, - firstName: this.faker.person.firstName(), - lastName: this.faker.person.lastName(), - }; - } - - cy.visit(this.PAGE_URL); - this.repository.getRegisterSalutationSelect().select(customerRegistration.salutation); - this.repository.getRegisterFirstNameInput().clear().type(customerRegistration.firstName); - this.repository.getRegisterLastNameInput().clear().type(customerRegistration.lastName); - - this.repository.getRegisterEmailInput().clear().type(customerRegistration.email); - this.repository.getRegisterPasswordInput().clear().type(customerRegistration.password); - this.repository.getRegisterConfirmPasswordInput().clear().type(customerRegistration.password); - this.repository.getRegisterAcceptTermsCheckbox().check({ force: true }); - - this.repository.getRegisterForm().submit(); - - return { - email: customerRegistration.email, - password: customerRegistration.password, - }; + public login = (email: string, password: string): void => { + cy.session([email, password], () => { + cy.visit(this.PAGE_URL); + this.repository.getLoginEmailInput().clear().type(email); + this.repository.getLoginPasswordInput().clear().type(password); + + this.repository.getLoginForm().submit(); + }); }; public getFailedAuthenticationText = (): string => { diff --git a/cypress/support/scenarios/yves/create-cart-scenario.ts b/cypress/support/scenarios/yves/create-cart-scenario.ts deleted file mode 100644 index 3cb1488a..00000000 --- a/cypress/support/scenarios/yves/create-cart-scenario.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { inject, injectable } from 'inversify'; -import { autoProvide } from '../../utils/inversify/auto-provide'; -import { YvesMultiCartPage } from '../../pages/yves/multi-cart/yves-multi-cart-page'; - -@injectable() -@autoProvide -export class CreateCartScenario { - constructor(@inject(YvesMultiCartPage) private multiCartPage: YvesMultiCartPage) {} - - public execute = (): void => { - this.multiCartPage.createCart(); - }; -} diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts new file mode 100644 index 00000000..6d03c807 --- /dev/null +++ b/cypress/support/scenarios/yves/index.ts @@ -0,0 +1,5 @@ +export * from './place-customer-order-scenario'; +export * from './place-guest-order-scenario'; +export * from './register-customer-scenario'; +export * from './yves-login-customer-scenario'; + diff --git a/cypress/support/scenarios/yves/place-customer-order-scenario.ts b/cypress/support/scenarios/yves/place-customer-order-scenario.ts index 4b9dc739..83042fd8 100644 --- a/cypress/support/scenarios/yves/place-customer-order-scenario.ts +++ b/cypress/support/scenarios/yves/place-customer-order-scenario.ts @@ -10,6 +10,7 @@ import { YvesCheckoutSummaryPage } from '../../pages/yves/checkout/summary/yves- @injectable() @autoProvide export class PlaceCustomerOrderScenario { + // should be moved to the order folder (helper MUST be used instead of scenario) constructor( @inject(YvesCartPage) private cartPage: YvesCartPage, @inject(YvesCheckoutAddressPage) private checkoutAddressPage: YvesCheckoutAddressPage, diff --git a/cypress/support/scenarios/yves/register-customer-scenario.ts b/cypress/support/scenarios/yves/register-customer-scenario.ts deleted file mode 100644 index 59ef2e5a..00000000 --- a/cypress/support/scenarios/yves/register-customer-scenario.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; -import { autoProvide } from '../../utils/inversify/auto-provide'; -import { YvesLoginPage } from '../../pages/yves/login/yves-login-page'; -import { MailCatcherHelper } from '../../helpers/mail-catcher-helper'; - -@injectable() -@autoProvide -export class RegisterCustomerScenario { - constructor( - @inject(YvesLoginPage) private loginPage: YvesLoginPage, - @inject(MailCatcherHelper) private mailCatcherHelper: MailCatcherHelper - ) {} - - public execute = (): Customer => { - const customer: Customer = this.loginPage.register(); - this.mailCatcherHelper.verifyCustomerEmail(customer.email); - - return customer; - }; -} diff --git a/cypress/support/scenarios/yves/yves-login-customer-scenario.ts b/cypress/support/scenarios/yves/yves-login-customer-scenario.ts index 0f58741a..0788de15 100644 --- a/cypress/support/scenarios/yves/yves-login-customer-scenario.ts +++ b/cypress/support/scenarios/yves/yves-login-customer-scenario.ts @@ -7,7 +7,7 @@ import { YvesLoginPage } from '../../pages/yves/login/yves-login-page'; export class YvesLoginCustomerScenario { constructor(@inject(YvesLoginPage) private loginPage: YvesLoginPage) {} - public execute = (customer: Customer): void => { - this.loginPage.login(customer); + public execute = (email: string, password: string): void => { + this.loginPage.login(email, password); }; } diff --git a/cypress/support/types/address.ts b/cypress/support/types/address.ts new file mode 100644 index 00000000..f249898c --- /dev/null +++ b/cypress/support/types/address.ts @@ -0,0 +1,10 @@ +export interface CheckoutAddress { + firstName: string; + lastName: string; + address1: string; + address2: string; + zipCode: string; + city: string; + company: string; + phone: string; +} diff --git a/cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts b/cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts new file mode 100644 index 00000000..3b53bf7f --- /dev/null +++ b/cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts @@ -0,0 +1,3 @@ + +export interface OrderReturnByUserDynamicFixtures { +} diff --git a/cypress/support/types/backoffice/order-management/return/index.ts b/cypress/support/types/backoffice/order-management/return/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/backoffice/order-management/return/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/backoffice/order-management/return/static-fixture-types.ts b/cypress/support/types/backoffice/order-management/return/static-fixture-types.ts new file mode 100644 index 00000000..ea93eb3a --- /dev/null +++ b/cypress/support/types/backoffice/order-management/return/static-fixture-types.ts @@ -0,0 +1,9 @@ +export interface OrderReturnByUserStaticFixtures { + user: User; +} + +interface User { + username: string; + password: string; +} + diff --git a/cypress/support/types/country.ts b/cypress/support/types/country.ts new file mode 100644 index 00000000..07af76b7 --- /dev/null +++ b/cypress/support/types/country.ts @@ -0,0 +1,3 @@ +export interface Country { + id_country: number; +} diff --git a/cypress/support/types/index.ts b/cypress/support/types/index.ts new file mode 100644 index 00000000..dd0bd4af --- /dev/null +++ b/cypress/support/types/index.ts @@ -0,0 +1,5 @@ +export * from './country'; +export * from './customer'; +export * from './product'; +export * from './quote'; +export * from './stock'; diff --git a/cypress/support/types/stock.ts b/cypress/support/types/stock.ts new file mode 100644 index 00000000..747789d6 --- /dev/null +++ b/cypress/support/types/stock.ts @@ -0,0 +1,4 @@ +export interface Stock { + id_stock: number; + name: string; +} diff --git a/cypress/support/types/t.ts b/cypress/support/types/t.ts new file mode 100644 index 00000000..cd22b3cc --- /dev/null +++ b/cypress/support/types/t.ts @@ -0,0 +1,39 @@ +import {User} from "./user"; + +interface Customer { + password: string; +} + +export interface CheckoutByGuestCustomerFixtures { + concreteProductSkus: string[]; +} + +export interface CheckoutByLoggedInCustomerFixtures { + concreteProductSkus: string[]; + customer: Customer; +} + +export interface BackofficeMerchantAgentFixtures { + user: User; + customerAgentUser: User; + merchantAgentUser: User; +} + +export interface MerchantPortalAgentLoginFixtures { + customerAgentUser: User; + merchantAgentUser: User; + merchantUser: User; +} + +export interface CreateOrderByCustomerFixtures { + concreteProductSkus: string[]; + customer: Customer; +} + +export interface CreateOrderByGuestFixtures { + concreteProductSkus: string[]; +} + +export interface CreateReturnByUserFixtures { + user: User; +} diff --git a/cypress/support/types/yves/cart/comment/common/product.ts b/cypress/support/types/yves/cart/comment/common/product.ts new file mode 100644 index 00000000..47e94acf --- /dev/null +++ b/cypress/support/types/yves/cart/comment/common/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/cart/comment/common/quote.ts b/cypress/support/types/yves/cart/comment/common/quote.ts new file mode 100644 index 00000000..430c92e4 --- /dev/null +++ b/cypress/support/types/yves/cart/comment/common/quote.ts @@ -0,0 +1,7 @@ +export interface Quote { + id_quote: number; + customer_reference: string; + uuid: string; + totals: string; + price_mode: string; +} diff --git a/cypress/support/types/yves/cart/comment/dynamic-fixture-types.ts b/cypress/support/types/yves/cart/comment/dynamic-fixture-types.ts new file mode 100644 index 00000000..f169e7e1 --- /dev/null +++ b/cypress/support/types/yves/cart/comment/dynamic-fixture-types.ts @@ -0,0 +1,13 @@ +import {Quote} from "./common/quote"; +import {Product} from "./common/product"; + + +export interface CartCommentDynamicFixtures { + quote: Quote; + customer: Customer; + product: Product; +} + +interface Customer { + email: string; +} diff --git a/cypress/support/types/yves/cart/comment/index.ts b/cypress/support/types/yves/cart/comment/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/yves/cart/comment/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/yves/cart/comment/static-fixture-types.ts b/cypress/support/types/yves/cart/comment/static-fixture-types.ts new file mode 100644 index 00000000..465e22ef --- /dev/null +++ b/cypress/support/types/yves/cart/comment/static-fixture-types.ts @@ -0,0 +1,11 @@ +export interface CartCommentStaticFixtures { + commentsToAdd: string[]; + commentToModify: string; + modifiedComment: string; + commentsToRemove: string; + customer: Customer; +} + +interface Customer { + password: string; +} diff --git a/cypress/support/types/yves/order-managment/order/common/product.ts b/cypress/support/types/yves/order-managment/order/common/product.ts new file mode 100644 index 00000000..666aaada --- /dev/null +++ b/cypress/support/types/yves/order-managment/order/common/product.ts @@ -0,0 +1,3 @@ +export interface Product { + sku: string; +} diff --git a/cypress/support/types/yves/order-managment/order/common/quote.ts b/cypress/support/types/yves/order-managment/order/common/quote.ts new file mode 100644 index 00000000..430c92e4 --- /dev/null +++ b/cypress/support/types/yves/order-managment/order/common/quote.ts @@ -0,0 +1,7 @@ +export interface Quote { + id_quote: number; + customer_reference: string; + uuid: string; + totals: string; + price_mode: string; +} diff --git a/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts b/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts new file mode 100644 index 00000000..8d1a0cfa --- /dev/null +++ b/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts @@ -0,0 +1,14 @@ +import {Product} from "./common/product"; + +export interface CreateOrderByCustomerDynamicFixtures { + customer: Customer; + product: Product; +} + +export interface CreateOrderByGuestDynamicFixtures { + product: Product; +} + +interface Customer { + email: string; +} diff --git a/cypress/support/types/yves/order-managment/order/index.ts b/cypress/support/types/yves/order-managment/order/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/yves/order-managment/order/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/yves/order-managment/order/static-fixture-types.ts b/cypress/support/types/yves/order-managment/order/static-fixture-types.ts new file mode 100644 index 00000000..60aa5df3 --- /dev/null +++ b/cypress/support/types/yves/order-managment/order/static-fixture-types.ts @@ -0,0 +1,7 @@ +export interface CreateOrderByCustomerStaticFixtures { + customer: Customer; +} + +interface Customer { + password: string; +} diff --git a/cypress/support/utils/typescript/fixture-types.ts b/cypress/support/utils/typescript/fixture-types.ts deleted file mode 100644 index 9b2b277e..00000000 --- a/cypress/support/utils/typescript/fixture-types.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -type CheckoutByGuestCustomerFixtures = { - concreteProductSkus: string[]; -}; - -type CheckoutByLoggedInCustomerFixtures = { - concreteProductSkus: string[]; - customer: Customer; -}; - -type CartCommentFixtures = { - concreteProductSku: string; - comments: string[]; - customer: Customer; -}; - -type BackofficeMerchantAgentFixtures = { - user: User; - customerAgentUser: User; - merchantAgentUser: User; -}; - -type MerchantPortalAgentLoginFixtures = { - customerAgentUser: User; - merchantAgentUser: User; - merchantUser: User; -}; - -type CreateOrderByCustomerFixtures = { - concreteProductSkus: string[]; - customer: Customer; -}; - -type CreateOrderByGuestFixtures = { - concreteProductSkus: string[]; -}; - -type CreateReturnByUserFixtures = { - concreteProductSkus: string[]; - user: User; -}; diff --git a/cypress/support/utils/typescript/types.ts b/cypress/support/utils/typescript/types.ts deleted file mode 100644 index 609995c0..00000000 --- a/cypress/support/utils/typescript/types.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -type Customer = { - email: string; - password: string; -}; - -type User = { - username: string; - password: string; -}; - -type CheckoutAddress = { - firstName: string; - lastName: string; - address1: string; - address2: string; - zipCode: string; - city: string; - company: string; - phone: string; -}; - -type CustomerGuestForm = { - firstName?: string; - lastName?: string; - email?: string; -}; - -type CustomerGuest = { - firstName: string; - lastName: string; - email: string; -}; - -type CustomerRegistration = { - email: string; - password: string; - salutation: string; - firstName: string; - lastName: string; -}; diff --git a/package-lock.json b/package-lock.json index 31aab2cc..4fc49dc8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -253,6 +253,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.3.tgz", "integrity": "sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg==", "dev": true, + "optional": true, "dependencies": { "undici-types": "~5.26.4" } @@ -1001,15 +1002,14 @@ } }, "node_modules/cypress": { - "version": "13.6.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.2.tgz", - "integrity": "sha512-TW3bGdPU4BrfvMQYv1z3oMqj71YI4AlgJgnrycicmPZAXtvywVFZW9DAToshO65D97rCWfG/kqMFsYB6Kp91gQ==", + "version": "13.6.4", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.4.tgz", + "integrity": "sha512-pYJjCfDYB+hoOoZuhysbbYhEmNW7DEDsqn+ToCLwuVowxUXppIWRr7qk4TVRIU471ksfzyZcH+mkoF0CQUKnpw==", "dev": true, "hasInstallScript": true, "dependencies": { "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -3189,7 +3189,8 @@ "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "dev": true, + "optional": true }, "node_modules/universalify": { "version": "2.0.1", From 00e10d8da4b4c631a102c30218069edbe330c62d Mon Sep 17 00:00:00 2001 From: pivovarov Date: Tue, 20 Feb 2024 15:58:51 +0300 Subject: [PATCH 02/53] fix yves tests --- .../agent}/backoffice-merchant-agent.cy.ts | 0 .../return/order-return-by-user.cy.ts | 63 ---------- .../checkout/checkout-by-guest-customer.cy.ts | 34 +++--- .../checkout-by-logged-in-customer.cy.ts | 51 ++++---- .../order/create-order-by-guest.cy.ts | 8 +- cypress/fixtures/b2b/backoffice/.gitkeep | 0 cypress/fixtures/b2b/mp/.gitkeep | 0 .../comment}/dynamic/empty-cart-comment.json | 0 .../dynamic/not-empty-cart-comment.json | 0 .../comment}/static/empty-cart-comment.json | 0 .../static/not-empty-cart-comment.json | 0 .../static/backoffice-merchant-agent.json | 0 .../return}/static/order-return-by-user.json | 0 .../suite/dynamic/order-return-by-user.json | 3 - .../static/merchant-portal-agent-login.json | 0 .../static/checkout-by-guest-customer.json | 3 - .../checkout-by-logged-in-customer.json | 7 -- .../comment}/dynamic/empty-cart-comment.json | 2 +- .../dynamic/not-empty-cart-comment.json | 2 +- .../comment}/static/empty-cart-comment.json | 0 .../static/not-empty-cart-comment.json | 0 .../dynamic/checkout-by-guest-customer.json | 84 +++++++++++++ .../checkout-by-logged-in-customer.json | 112 ++++++++++++++++++ .../checkout-by-logged-in-customer.json} | 0 .../dynamic/create-order-by-customer.json | 0 .../order}/dynamic/create-order-by-guest.json | 0 .../static/create-order-by-customer.json | 5 + cypress/support/e2e.js | 24 ++-- .../support/pages/yves/cart/yves-cart-page.ts | 4 + .../address/yves-checkout-address-page.ts | 3 +- .../customer/yves-checkout-customer-page.ts | 3 +- .../backoffice/create-root-user-scenario.ts | 1 + cypress/support/scenarios/backoffice/index.ts | 3 + cypress/support/scenarios/mp/.gitkeep | 0 cypress/support/scenarios/yves/index.ts | 1 - .../return/dynamic-fixture-types.ts | 3 - .../return/static-fixture-types.ts | 9 -- cypress/support/types/country.ts | 3 - cypress/support/types/index.ts | 5 - .../types/refactor_this_file_and_drop_it.ts | 19 +++ cypress/support/types/stock.ts | 4 - cypress/support/types/t.ts | 39 ------ .../types/yves/checkout/common/customer.ts | 5 + .../types/yves/checkout/common/product.ts | 3 + .../common/\321\201heckout-address.ts" | 0 .../yves/checkout/dynamic-fixture-types.ts | 16 +++ .../return => yves/checkout}/index.ts | 2 + .../yves/checkout/static-fixture-types.ts | 9 ++ .../order-managment/order/common/quote.ts | 7 -- 49 files changed, 332 insertions(+), 205 deletions(-) rename cypress/e2e/{mp/merchant-agent-assist => backoffice/order-management/agent}/backoffice-merchant-agent.cy.ts (100%) delete mode 100644 cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts create mode 100644 cypress/fixtures/b2b/backoffice/.gitkeep create mode 100644 cypress/fixtures/b2b/mp/.gitkeep rename cypress/fixtures/{suite => b2b/yves/cart/comment}/dynamic/empty-cart-comment.json (100%) rename cypress/fixtures/{suite => b2b/yves/cart/comment}/dynamic/not-empty-cart-comment.json (100%) rename cypress/fixtures/b2b/{ => yves/cart/comment}/static/empty-cart-comment.json (100%) rename cypress/fixtures/b2b/{ => yves/cart/comment}/static/not-empty-cart-comment.json (100%) rename cypress/fixtures/suite/{ => backoffice/order-management/agent}/static/backoffice-merchant-agent.json (100%) rename cypress/fixtures/suite/{ => backoffice/order-management/return}/static/order-return-by-user.json (100%) delete mode 100644 cypress/fixtures/suite/dynamic/order-return-by-user.json rename cypress/fixtures/suite/{ => mp/merchant-agent-assist}/static/merchant-portal-agent-login.json (100%) delete mode 100644 cypress/fixtures/suite/static/checkout-by-guest-customer.json delete mode 100644 cypress/fixtures/suite/static/checkout-by-logged-in-customer.json rename cypress/fixtures/{b2b => suite/yves/cart/comment}/dynamic/empty-cart-comment.json (96%) rename cypress/fixtures/{b2b => suite/yves/cart/comment}/dynamic/not-empty-cart-comment.json (97%) rename cypress/fixtures/suite/{ => yves/cart/comment}/static/empty-cart-comment.json (100%) rename cypress/fixtures/suite/{ => yves/cart/comment}/static/not-empty-cart-comment.json (100%) create mode 100644 cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json create mode 100644 cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json rename cypress/fixtures/suite/{static/create-order-by-customer.json => yves/checkout/static/checkout-by-logged-in-customer.json} (100%) rename cypress/fixtures/suite/{ => yves/order-management/order}/dynamic/create-order-by-customer.json (100%) rename cypress/fixtures/suite/{ => yves/order-management/order}/dynamic/create-order-by-guest.json (100%) create mode 100644 cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json create mode 100644 cypress/support/scenarios/backoffice/index.ts create mode 100644 cypress/support/scenarios/mp/.gitkeep delete mode 100644 cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/backoffice/order-management/return/static-fixture-types.ts delete mode 100644 cypress/support/types/country.ts delete mode 100644 cypress/support/types/index.ts create mode 100644 cypress/support/types/refactor_this_file_and_drop_it.ts delete mode 100644 cypress/support/types/stock.ts delete mode 100644 cypress/support/types/t.ts create mode 100644 cypress/support/types/yves/checkout/common/customer.ts create mode 100644 cypress/support/types/yves/checkout/common/product.ts rename cypress/support/types/address.ts => "cypress/support/types/yves/checkout/common/\321\201heckout-address.ts" (100%) create mode 100644 cypress/support/types/yves/checkout/dynamic-fixture-types.ts rename cypress/support/types/{backoffice/order-management/return => yves/checkout}/index.ts (50%) create mode 100644 cypress/support/types/yves/checkout/static-fixture-types.ts delete mode 100644 cypress/support/types/yves/order-managment/order/common/quote.ts diff --git a/cypress/e2e/mp/merchant-agent-assist/backoffice-merchant-agent.cy.ts b/cypress/e2e/backoffice/order-management/agent/backoffice-merchant-agent.cy.ts similarity index 100% rename from cypress/e2e/mp/merchant-agent-assist/backoffice-merchant-agent.cy.ts rename to cypress/e2e/backoffice/order-management/agent/backoffice-merchant-agent.cy.ts diff --git a/cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts b/cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts deleted file mode 100644 index d5e43f28..00000000 --- a/cypress/e2e/backoffice/order-management/return/order-return-by-user.cy.ts +++ /dev/null @@ -1,63 +0,0 @@ -import {container} from '../../../../support/utils/inversify/inversify.config'; -import {BackofficeLoginPage} from "../../../../support/pages/backoffice/login/backoffice-login-page"; -import {BackofficeSalesIndexPage} from "../../../../support/pages/backoffice/sales/index/backoffice-sales-index-page"; -import {BackofficeSalesDetailPage} from "../../../../support/pages/backoffice/sales/detail/backoffice-sales-detail-page"; -import {BackofficeSalesReturnGuiCreatePage} from "../../../../support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page"; -import {OrderReturnByUserDynamicFixtures, OrderReturnByUserStaticFixtures} from "../../../../support/types/backoffice/order-management/return"; - - -// ??? NOT SURE THAT WE SHOULD TEST THIS CASE THROUGH THE UI - -describe('create order return by user', (): void => { - let dynamicFixtures: OrderReturnByUserDynamicFixtures; - let staticFixtures: OrderReturnByUserStaticFixtures; - - let loginPage: BackofficeLoginPage; - let salesIndexPage: BackofficeSalesIndexPage; - let salesDetailPage: BackofficeSalesDetailPage; - let salesReturnGuiCreatePage: BackofficeSalesReturnGuiCreatePage; - - before((): void => { - cy.resetBackofficeCookies(); - ({ staticFixtures, dynamicFixtures } = Cypress.env()); - - loginPage = container.get(BackofficeLoginPage); - salesIndexPage = container.get(BackofficeSalesIndexPage); - salesDetailPage = container.get(BackofficeSalesDetailPage); - salesReturnGuiCreatePage = container.get(BackofficeSalesReturnGuiCreatePage); - }); - - beforeEach((): void => { - // have customer and BO user and order fixtures - //trigger OMS console oms:check-condition - //trigger OMS console oms:check-timeout - loginPage.login(staticFixtures.user.username, staticFixtures.user.password); - }); - - it('should be able to create return from Backoffice (from shipped order state) [@regression]', (): void => { - salesIndexPage.viewLastPlacedOrder(); - salesDetailPage.triggerOms('Pay'); - salesDetailPage.triggerOms('Skip timeout'); - salesDetailPage.triggerOms('skip picking'); - salesDetailPage.triggerOms('Ship'); - - salesDetailPage.createReturn(); - salesReturnGuiCreatePage.createReturnForAllOrderItems(); - - cy.contains('Return was successfully created.'); - }); - - it('should be able to create return from Backoffice (from delivery order state)', (): void => { - salesIndexPage.viewLastPlacedOrder(); - salesDetailPage.triggerOms('Pay'); - salesDetailPage.triggerOms('Skip timeout'); - salesDetailPage.triggerOms('skip picking'); - salesDetailPage.triggerOms('Ship'); - salesDetailPage.triggerOms('Stock update'); - - salesDetailPage.createReturn(); - salesReturnGuiCreatePage.createReturnForAllOrderItems(); - - cy.contains('Return was successfully created.'); - }); -}); diff --git a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts index 91dcbb27..0d2ac0b6 100644 --- a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts @@ -1,15 +1,15 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { YvesCartPage } from '../../support/pages/yves/cart/yves-cart-page'; -import { YvesCheckoutCustomerPage } from '../../support/pages/yves/checkout/customer/yves-checkout-customer-page'; -import { YvesCheckoutAddressPage } from '../../support/pages/yves/checkout/address/yves-checkout-address-page'; -import { YvesCheckoutShipmentPage } from '../../support/pages/yves/checkout/shipment/yves-checkout-shipment-page'; -import { YvesCheckoutPaymentPage } from '../../support/pages/yves/checkout/payment/yves-checkout-payment-page'; -import { YvesCheckoutSummaryPage } from '../../support/pages/yves/checkout/summary/yves-checkout-summary-page'; -import {CheckoutByGuestCustomerFixtures} from "../../support/types"; +import { container } from '../../../support/utils/inversify/inversify.config'; +import {CheckoutByGuestCustomerDynamicFixtures} from "../../../support/types/yves/checkout"; +import { + YvesCartPage, + YvesCheckoutAddressPage, + YvesCheckoutCustomerPage, YvesCheckoutPaymentPage, + YvesCheckoutShipmentPage, YvesCheckoutSummaryPage +} from "../../../support/pages/yves"; -describe('checkout by guest customer', (): void => { - let fixtures: CheckoutByGuestCustomerFixtures; +describe('checkout by guest customer', (): void => { + let dynamicFixtures: CheckoutByGuestCustomerDynamicFixtures; let cartPage: YvesCartPage; let checkoutCustomerPage: YvesCheckoutCustomerPage; let checkoutAddressPage: YvesCheckoutAddressPage; @@ -18,7 +18,7 @@ describe('checkout by guest customer', (): void => { let checkoutSummaryPage: YvesCheckoutSummaryPage; before((): void => { - fixtures = Cypress.env('fixtures'); + dynamicFixtures = Cypress.env('dynamicFixtures'); cartPage = container.get(YvesCartPage); checkoutCustomerPage = container.get(YvesCheckoutCustomerPage); @@ -34,7 +34,7 @@ describe('checkout by guest customer', (): void => { it('should checkout with one concrete product', (): void => { cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSkus[0]); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku); cartPage.startCheckout(); checkoutCustomerPage.checkoutAsGuest(); @@ -49,8 +49,8 @@ describe('checkout by guest customer', (): void => { it('should checkout with two concrete products to single shipment [@regression]', (): void => { cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSkus[0], 2); - cartPage.quickAddToCart(fixtures.concreteProductSkus[1], 2); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); + cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); cartPage.startCheckout(); checkoutCustomerPage.checkoutAsGuest(); @@ -65,8 +65,8 @@ describe('checkout by guest customer', (): void => { it('should checkout to multi shipment address [@regression]', (): void => { cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSkus[0], 2); - cartPage.quickAddToCart(fixtures.concreteProductSkus[1], 2); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); + cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); cartPage.startCheckout(); checkoutCustomerPage.checkoutAsGuest(); @@ -81,7 +81,7 @@ describe('checkout by guest customer', (): void => { it('should checkout with strict checkout step redirects', (): void => { cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSkus[0]); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku); cartPage.assertPageLocation(); cartPage.startCheckout(); diff --git a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts index 79bbbc6b..e951e605 100644 --- a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts @@ -1,14 +1,21 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { YvesCartPage } from '../../support/pages/yves/cart/yves-cart-page'; -import { YvesCheckoutAddressPage } from '../../support/pages/yves/checkout/address/yves-checkout-address-page'; -import { YvesCheckoutShipmentPage } from '../../support/pages/yves/checkout/shipment/yves-checkout-shipment-page'; -import { YvesCheckoutPaymentPage } from '../../support/pages/yves/checkout/payment/yves-checkout-payment-page'; -import { YvesCheckoutSummaryPage } from '../../support/pages/yves/checkout/summary/yves-checkout-summary-page'; -import { YvesLoginCustomerScenario } from '../../support/scenarios/yves/yves-login-customer-scenario'; -import {CheckoutByLoggedInCustomerFixtures} from "../../support/types"; +import {container} from '../../../support/utils/inversify/inversify.config'; +import { + CheckoutByLoggedInCustomerDynamicFixtures, + CheckoutByLoggedInCustomerStaticFixtures +} from "../../../support/types/yves/checkout"; +import { + YvesCartPage, + YvesCheckoutAddressPage, + YvesCheckoutPaymentPage, + YvesCheckoutShipmentPage, + YvesCheckoutSummaryPage +} from "../../../support/pages/yves"; +import {YvesLoginCustomerScenario} from "../../../support/scenarios/yves"; + describe('checkout by logged in customer', (): void => { - let fixtures: CheckoutByLoggedInCustomerFixtures; + let staticFixtures: CheckoutByLoggedInCustomerStaticFixtures; + let dynamicFixtures: CheckoutByLoggedInCustomerDynamicFixtures; let cartPage: YvesCartPage; let checkoutAddressPage: YvesCheckoutAddressPage; @@ -18,7 +25,8 @@ describe('checkout by logged in customer', (): void => { let loginCustomerScenario: YvesLoginCustomerScenario; before((): void => { - fixtures = Cypress.env('fixtures'); + cy.resetYvesCookies(); + ({ staticFixtures, dynamicFixtures } = Cypress.env()); cartPage = container.get(YvesCartPage); checkoutAddressPage = container.get(YvesCheckoutAddressPage); @@ -29,13 +37,12 @@ describe('checkout by logged in customer', (): void => { }); beforeEach((): void => { - cy.resetYvesCookies(); - loginCustomerScenario.execute(fixtures.customer); + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); + cartPage.visit(); }); it('should checkout with one concrete product', (): void => { - cy.visit(cartPage.PAGE_URL); - cartPage.quickAddToCart(fixtures.concreteProductSkus[0]); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku); cartPage.startCheckout(); checkoutAddressPage.fillShippingAddress(); @@ -47,10 +54,8 @@ describe('checkout by logged in customer', (): void => { }); it('should checkout with two concrete products to single shipment', (): void => { - cy.visit(cartPage.PAGE_URL); - - cartPage.quickAddToCart(fixtures.concreteProductSkus[0], 2); - cartPage.quickAddToCart(fixtures.concreteProductSkus[1], 2); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); + cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); cartPage.startCheckout(); checkoutAddressPage.fillShippingAddress(); @@ -62,10 +67,8 @@ describe('checkout by logged in customer', (): void => { }); it('should checkout to multi shipment address', (): void => { - cy.visit(cartPage.PAGE_URL); - - cartPage.quickAddToCart(fixtures.concreteProductSkus[0], 2); - cartPage.quickAddToCart(fixtures.concreteProductSkus[1], 2); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); + cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); cartPage.startCheckout(); checkoutAddressPage.fillMultiShippingAddress(); @@ -77,9 +80,7 @@ describe('checkout by logged in customer', (): void => { }); it('should checkout with strict checkout step redirects', (): void => { - cy.visit(cartPage.PAGE_URL); - - cartPage.quickAddToCart(fixtures.concreteProductSkus[0]); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku); cartPage.assertPageLocation(); cartPage.startCheckout(); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts index 519d0fa8..7d2f52a0 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts @@ -6,15 +6,15 @@ describe('create order by guest', (): void => { let dynamicFixtures: CreateOrderByGuestDynamicFixtures; let placeGuestOrderScenario: PlaceGuestOrderScenario; - beforeEach((): void => { - cy.resetYvesCookies(); - }); - before((): void => { dynamicFixtures = Cypress.env('dynamicFixtures'); placeGuestOrderScenario = container.get(PlaceGuestOrderScenario); }); + beforeEach((): void => { + cy.resetYvesCookies(); + }); + it('should be able to create an order by guest [@regression]', (): void => { placeGuestOrderScenario.execute([dynamicFixtures.product.sku]); diff --git a/cypress/fixtures/b2b/backoffice/.gitkeep b/cypress/fixtures/b2b/backoffice/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cypress/fixtures/b2b/mp/.gitkeep b/cypress/fixtures/b2b/mp/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cypress/fixtures/suite/dynamic/empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/dynamic/empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/dynamic/empty-cart-comment.json rename to cypress/fixtures/b2b/yves/cart/comment/dynamic/empty-cart-comment.json diff --git a/cypress/fixtures/suite/dynamic/not-empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/dynamic/not-empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/dynamic/not-empty-cart-comment.json rename to cypress/fixtures/b2b/yves/cart/comment/dynamic/not-empty-cart-comment.json diff --git a/cypress/fixtures/b2b/static/empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/static/empty-cart-comment.json similarity index 100% rename from cypress/fixtures/b2b/static/empty-cart-comment.json rename to cypress/fixtures/b2b/yves/cart/comment/static/empty-cart-comment.json diff --git a/cypress/fixtures/b2b/static/not-empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/static/not-empty-cart-comment.json similarity index 100% rename from cypress/fixtures/b2b/static/not-empty-cart-comment.json rename to cypress/fixtures/b2b/yves/cart/comment/static/not-empty-cart-comment.json diff --git a/cypress/fixtures/suite/static/backoffice-merchant-agent.json b/cypress/fixtures/suite/backoffice/order-management/agent/static/backoffice-merchant-agent.json similarity index 100% rename from cypress/fixtures/suite/static/backoffice-merchant-agent.json rename to cypress/fixtures/suite/backoffice/order-management/agent/static/backoffice-merchant-agent.json diff --git a/cypress/fixtures/suite/static/order-return-by-user.json b/cypress/fixtures/suite/backoffice/order-management/return/static/order-return-by-user.json similarity index 100% rename from cypress/fixtures/suite/static/order-return-by-user.json rename to cypress/fixtures/suite/backoffice/order-management/return/static/order-return-by-user.json diff --git a/cypress/fixtures/suite/dynamic/order-return-by-user.json b/cypress/fixtures/suite/dynamic/order-return-by-user.json deleted file mode 100644 index 4f6a8105..00000000 --- a/cypress/fixtures/suite/dynamic/order-return-by-user.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "concreteProductSkus": ["159_29885260"], -} diff --git a/cypress/fixtures/suite/static/merchant-portal-agent-login.json b/cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-portal-agent-login.json similarity index 100% rename from cypress/fixtures/suite/static/merchant-portal-agent-login.json rename to cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-portal-agent-login.json diff --git a/cypress/fixtures/suite/static/checkout-by-guest-customer.json b/cypress/fixtures/suite/static/checkout-by-guest-customer.json deleted file mode 100644 index 8192abc9..00000000 --- a/cypress/fixtures/suite/static/checkout-by-guest-customer.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "concreteProductSkus": ["159_29885260", "169_25880805"] -} diff --git a/cypress/fixtures/suite/static/checkout-by-logged-in-customer.json b/cypress/fixtures/suite/static/checkout-by-logged-in-customer.json deleted file mode 100644 index 2c28f51a..00000000 --- a/cypress/fixtures/suite/static/checkout-by-logged-in-customer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "concreteProductSkus": ["159_29885260", "169_25880805"], - "customer": { - "email": "spencor.hopkin@spryker.com", - "password": "change123" - } -} diff --git a/cypress/fixtures/b2b/dynamic/empty-cart-comment.json b/cypress/fixtures/suite/yves/cart/comment/dynamic/empty-cart-comment.json similarity index 96% rename from cypress/fixtures/b2b/dynamic/empty-cart-comment.json rename to cypress/fixtures/suite/yves/cart/comment/dynamic/empty-cart-comment.json index d89959b6..60103304 100644 --- a/cypress/fixtures/b2b/dynamic/empty-cart-comment.json +++ b/cypress/fixtures/suite/yves/cart/comment/dynamic/empty-cart-comment.json @@ -1,6 +1,6 @@ { "data": { - "type": "test-helper-runner", + "type": "test-operation-runner", "attributes": { "synchronize": true, "operations": [ diff --git a/cypress/fixtures/b2b/dynamic/not-empty-cart-comment.json b/cypress/fixtures/suite/yves/cart/comment/dynamic/not-empty-cart-comment.json similarity index 97% rename from cypress/fixtures/b2b/dynamic/not-empty-cart-comment.json rename to cypress/fixtures/suite/yves/cart/comment/dynamic/not-empty-cart-comment.json index d0f5d69c..557eeb71 100644 --- a/cypress/fixtures/b2b/dynamic/not-empty-cart-comment.json +++ b/cypress/fixtures/suite/yves/cart/comment/dynamic/not-empty-cart-comment.json @@ -1,6 +1,6 @@ { "data": { - "type": "test-helper-runner", + "type": "test-operation-runner", "attributes": { "synchronize": true, "operations": [ diff --git a/cypress/fixtures/suite/static/empty-cart-comment.json b/cypress/fixtures/suite/yves/cart/comment/static/empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/static/empty-cart-comment.json rename to cypress/fixtures/suite/yves/cart/comment/static/empty-cart-comment.json diff --git a/cypress/fixtures/suite/static/not-empty-cart-comment.json b/cypress/fixtures/suite/yves/cart/comment/static/not-empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/static/not-empty-cart-comment.json rename to cypress/fixtures/suite/yves/cart/comment/static/not-empty-cart-comment.json diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json new file mode 100644 index 00000000..70b0cf34 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json @@ -0,0 +1,84 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productOne", + "arguments": [] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productTwo", + "arguments": [] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productOneWithPrice", + "arguments": [ + { + "skuProductAbstract": "#productOne.abstract_sku", + "skuProduct": "#productOne.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productTwoWithPrice", + "arguments": [ + { + "skuProductAbstract": "#productTwo.abstract_sku", + "skuProduct": "#productTwo.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productOneWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#productOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productTwoWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#productTwo.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json new file mode 100644 index 00000000..3e69a708 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json @@ -0,0 +1,112 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": [ + "#customer" + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productOne", + "arguments": [] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productTwo", + "arguments": [] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productOneWithPrice", + "arguments": [ + { + "skuProductAbstract": "#productOne.abstract_sku", + "skuProduct": "#productOne.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productTwoWithPrice", + "arguments": [ + { + "skuProductAbstract": "#productTwo.abstract_sku", + "skuProduct": "#productTwo.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productOneWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#productOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productTwoWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#productTwo.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/static/create-order-by-customer.json b/cypress/fixtures/suite/yves/checkout/static/checkout-by-logged-in-customer.json similarity index 100% rename from cypress/fixtures/suite/static/create-order-by-customer.json rename to cypress/fixtures/suite/yves/checkout/static/checkout-by-logged-in-customer.json diff --git a/cypress/fixtures/suite/dynamic/create-order-by-customer.json b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json similarity index 100% rename from cypress/fixtures/suite/dynamic/create-order-by-customer.json rename to cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json diff --git a/cypress/fixtures/suite/dynamic/create-order-by-guest.json b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json similarity index 100% rename from cypress/fixtures/suite/dynamic/create-order-by-guest.json rename to cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json diff --git a/cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json b/cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json new file mode 100644 index 00000000..46ebaa8b --- /dev/null +++ b/cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json @@ -0,0 +1,5 @@ +{ + "customer": { + "password": "change123" + } +} diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index ca0c6e0d..522223dd 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -26,9 +26,9 @@ beforeEach(function () { const loadFixture = () => { const repositoryId = Cypress.env('repositoryId'); - const testFileName = getTestFileName(); - const dynamicFixturesDefaultFilePath = `${repositoryId}/dynamic/${testFileName}`; - const staticFixturesDefaultFilePath = `${repositoryId}/static/${testFileName}`; + const fixtureFilePath = getFixtureFilePath(); + 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) => { if (isFileExists) { @@ -48,13 +48,21 @@ const loadFixture = () => { } }); }; -const getTestFileName = () => { - const filePath = Cypress.spec.relative; - let fileName = path.basename(filePath, path.extname(filePath)); - fileName = fileName.replace('.cy', ''); +const getFixtureFilePath = () => { + const fullFilePath = Cypress.spec.relative; + const basePath = 'cypress/e2e/'; - return fileName; + const relativePath = path.relative(basePath, fullFilePath); + + const directoryPart = path.dirname(relativePath); + const filePartWithExtension = path.parse(relativePath).name; + const filePartWithoutExtension = filePartWithExtension.replace('.cy', ''); + + return { + directoryPart: directoryPart, + filePart: filePartWithoutExtension + }; }; const skipTestIfNotInGroup = () => { diff --git a/cypress/support/pages/yves/cart/yves-cart-page.ts b/cypress/support/pages/yves/cart/yves-cart-page.ts index 03684f55..8d65d5cb 100644 --- a/cypress/support/pages/yves/cart/yves-cart-page.ts +++ b/cypress/support/pages/yves/cart/yves-cart-page.ts @@ -39,6 +39,10 @@ export class YvesCartPage extends AbstractPage { form.submit(); }; + public visit = (): void => { + cy.visit(this.PAGE_URL); + } + public changeQuantity = (sku: string, newQuantity: number): void => { const form = this.repository.findCartItemChangeQuantityForm(sku); const input = this.repository.getCartItemChangeQuantityField(sku); diff --git a/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts index 64e4e787..9d1c0389 100644 --- a/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts @@ -4,7 +4,8 @@ import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; import { autoProvide } from '../../../../utils/inversify/auto-provide'; import { YvesCheckoutAddressRepository } from './yves-checkout-address-repository'; -import {CheckoutAddress} from "../../../../types/common/address"; +import {CheckoutAddress} from "../../../../types/yves/checkout"; + @injectable() @autoProvide diff --git a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts index 11a36294..655e4e99 100644 --- a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts @@ -4,7 +4,8 @@ import 'reflect-metadata'; import { TYPES } from '../../../../utils/inversify/types'; import { autoProvide } from '../../../../utils/inversify/auto-provide'; import { YvesCheckoutCustomerRepository } from './yves-checkout-customer-repository'; -import {Customer} from "../../../../types"; +import {Customer} from "../../../../types/yves/checkout"; + @injectable() diff --git a/cypress/support/scenarios/backoffice/create-root-user-scenario.ts b/cypress/support/scenarios/backoffice/create-root-user-scenario.ts index 43a8c4d9..eaa885f3 100644 --- a/cypress/support/scenarios/backoffice/create-root-user-scenario.ts +++ b/cypress/support/scenarios/backoffice/create-root-user-scenario.ts @@ -2,6 +2,7 @@ import { inject, injectable } from 'inversify'; import { autoProvide } from '../../utils/inversify/auto-provide'; import { BackofficeUserCreatePage } from '../../pages/backoffice/user/create/backoffice-user-create-page'; import { BackofficeUserIndexPage } from '../../pages/backoffice/user/index/backoffice-user-index-page'; +import {User} from "../../types/refactor_this_file_and_drop_it"; @injectable() @autoProvide diff --git a/cypress/support/scenarios/backoffice/index.ts b/cypress/support/scenarios/backoffice/index.ts new file mode 100644 index 00000000..060fcaf5 --- /dev/null +++ b/cypress/support/scenarios/backoffice/index.ts @@ -0,0 +1,3 @@ +export * from './backoffice-login-user-scenario'; +export * from './create-root-user-scenario'; + diff --git a/cypress/support/scenarios/mp/.gitkeep b/cypress/support/scenarios/mp/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index 6d03c807..22266423 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -1,5 +1,4 @@ export * from './place-customer-order-scenario'; export * from './place-guest-order-scenario'; -export * from './register-customer-scenario'; export * from './yves-login-customer-scenario'; diff --git a/cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts b/cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts deleted file mode 100644 index 3b53bf7f..00000000 --- a/cypress/support/types/backoffice/order-management/return/dynamic-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ - -export interface OrderReturnByUserDynamicFixtures { -} diff --git a/cypress/support/types/backoffice/order-management/return/static-fixture-types.ts b/cypress/support/types/backoffice/order-management/return/static-fixture-types.ts deleted file mode 100644 index ea93eb3a..00000000 --- a/cypress/support/types/backoffice/order-management/return/static-fixture-types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface OrderReturnByUserStaticFixtures { - user: User; -} - -interface User { - username: string; - password: string; -} - diff --git a/cypress/support/types/country.ts b/cypress/support/types/country.ts deleted file mode 100644 index 07af76b7..00000000 --- a/cypress/support/types/country.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Country { - id_country: number; -} diff --git a/cypress/support/types/index.ts b/cypress/support/types/index.ts deleted file mode 100644 index dd0bd4af..00000000 --- a/cypress/support/types/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './country'; -export * from './customer'; -export * from './product'; -export * from './quote'; -export * from './stock'; diff --git a/cypress/support/types/refactor_this_file_and_drop_it.ts b/cypress/support/types/refactor_this_file_and_drop_it.ts new file mode 100644 index 00000000..acb6314f --- /dev/null +++ b/cypress/support/types/refactor_this_file_and_drop_it.ts @@ -0,0 +1,19 @@ + +export interface BackofficeMerchantAgentFixtures { + user: User; + customerAgentUser: User; + merchantAgentUser: User; +} + +export interface MerchantPortalAgentLoginFixtures { + customerAgentUser: User; + merchantAgentUser: User; + merchantUser: User; +} + + + +export interface User { + username: string; + password: string; +} diff --git a/cypress/support/types/stock.ts b/cypress/support/types/stock.ts deleted file mode 100644 index 747789d6..00000000 --- a/cypress/support/types/stock.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface Stock { - id_stock: number; - name: string; -} diff --git a/cypress/support/types/t.ts b/cypress/support/types/t.ts deleted file mode 100644 index cd22b3cc..00000000 --- a/cypress/support/types/t.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {User} from "./user"; - -interface Customer { - password: string; -} - -export interface CheckoutByGuestCustomerFixtures { - concreteProductSkus: string[]; -} - -export interface CheckoutByLoggedInCustomerFixtures { - concreteProductSkus: string[]; - customer: Customer; -} - -export interface BackofficeMerchantAgentFixtures { - user: User; - customerAgentUser: User; - merchantAgentUser: User; -} - -export interface MerchantPortalAgentLoginFixtures { - customerAgentUser: User; - merchantAgentUser: User; - merchantUser: User; -} - -export interface CreateOrderByCustomerFixtures { - concreteProductSkus: string[]; - customer: Customer; -} - -export interface CreateOrderByGuestFixtures { - concreteProductSkus: string[]; -} - -export interface CreateReturnByUserFixtures { - user: User; -} diff --git a/cypress/support/types/yves/checkout/common/customer.ts b/cypress/support/types/yves/checkout/common/customer.ts new file mode 100644 index 00000000..4087c36c --- /dev/null +++ b/cypress/support/types/yves/checkout/common/customer.ts @@ -0,0 +1,5 @@ +export interface Customer { + firstName: string; + lastName: string; + email: string; +} diff --git a/cypress/support/types/yves/checkout/common/product.ts b/cypress/support/types/yves/checkout/common/product.ts new file mode 100644 index 00000000..666aaada --- /dev/null +++ b/cypress/support/types/yves/checkout/common/product.ts @@ -0,0 +1,3 @@ +export interface Product { + sku: string; +} diff --git a/cypress/support/types/address.ts "b/cypress/support/types/yves/checkout/common/\321\201heckout-address.ts" similarity index 100% rename from cypress/support/types/address.ts rename to "cypress/support/types/yves/checkout/common/\321\201heckout-address.ts" diff --git a/cypress/support/types/yves/checkout/dynamic-fixture-types.ts b/cypress/support/types/yves/checkout/dynamic-fixture-types.ts new file mode 100644 index 00000000..bb8adb01 --- /dev/null +++ b/cypress/support/types/yves/checkout/dynamic-fixture-types.ts @@ -0,0 +1,16 @@ +import {Product} from "./common/product"; + +export interface CheckoutByLoggedInCustomerDynamicFixtures { + customer: Customer; + productOne: Product; + productTwo: Product; +} + +export interface CheckoutByGuestCustomerDynamicFixtures { + productOne: Product; + productTwo: Product; +} + +interface Customer { + email: string; +} diff --git a/cypress/support/types/backoffice/order-management/return/index.ts b/cypress/support/types/yves/checkout/index.ts similarity index 50% rename from cypress/support/types/backoffice/order-management/return/index.ts rename to cypress/support/types/yves/checkout/index.ts index cfc6ac0c..2a6e23ad 100644 --- a/cypress/support/types/backoffice/order-management/return/index.ts +++ b/cypress/support/types/yves/checkout/index.ts @@ -1,2 +1,4 @@ export * from './dynamic-fixture-types'; export * from './static-fixture-types'; +export * from './common/customer'; +export * from './common/сheckout-address'; diff --git a/cypress/support/types/yves/checkout/static-fixture-types.ts b/cypress/support/types/yves/checkout/static-fixture-types.ts new file mode 100644 index 00000000..bca37869 --- /dev/null +++ b/cypress/support/types/yves/checkout/static-fixture-types.ts @@ -0,0 +1,9 @@ +import {CheckoutByLoggedInCustomerDynamicFixtures} from "./dynamic-fixture-types"; + +export interface CheckoutByLoggedInCustomerStaticFixtures { + customer: Customer; +} + +interface Customer { + password: string; +} diff --git a/cypress/support/types/yves/order-managment/order/common/quote.ts b/cypress/support/types/yves/order-managment/order/common/quote.ts deleted file mode 100644 index 430c92e4..00000000 --- a/cypress/support/types/yves/order-managment/order/common/quote.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface Quote { - id_quote: number; - customer_reference: string; - uuid: string; - totals: string; - price_mode: string; -} From 37c41f0c4fddfc867d5b6b8c36e2cf69d8408e29 Mon Sep 17 00:00:00 2001 From: pivovarov Date: Wed, 21 Feb 2024 17:23:04 +0300 Subject: [PATCH 03/53] fix scenario naming --- cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts | 6 +++--- cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts | 6 +++--- .../e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts | 6 +++--- .../order-management/order/create-order-by-customer.cy.ts | 6 +++--- cypress/support/scenarios/yves/index.ts | 5 ++--- ...customer-scenario.ts => yves-customer-login-scenario.ts} | 4 ++-- 6 files changed, 16 insertions(+), 17 deletions(-) rename cypress/support/scenarios/yves/{yves-login-customer-scenario.ts => yves-customer-login-scenario.ts} (74%) diff --git a/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts b/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts index b4397ff1..ce54ce5a 100644 --- a/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts @@ -1,19 +1,19 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; import {YvesCommentCartPage} from "../../../../support/pages/yves"; -import {YvesLoginCustomerScenario} from "../../../../support/scenarios/yves"; +import {YvesCustomerLoginScenario} from "../../../../support/scenarios/yves"; describe('cart comment', (): void => { let dynamicFixtures: CartCommentDynamicFixtures; let staticFixtures: CartCommentStaticFixtures; let commentCartPage: YvesCommentCartPage; - let loginCustomerScenario: YvesLoginCustomerScenario; + let loginCustomerScenario: YvesCustomerLoginScenario; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); commentCartPage = container.get(YvesCommentCartPage); - loginCustomerScenario = container.get(YvesLoginCustomerScenario); + loginCustomerScenario = container.get(YvesCustomerLoginScenario); }); beforeEach((): void => { diff --git a/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts b/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts index 900df13a..31d3cb1f 100644 --- a/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts @@ -1,19 +1,19 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; import {YvesCommentCartPage} from "../../../../support/pages/yves"; -import {YvesLoginCustomerScenario} from "../../../../support/scenarios/yves"; +import {YvesCustomerLoginScenario} from "../../../../support/scenarios/yves"; describe('cart comment', (): void => { let dynamicFixtures: CartCommentDynamicFixtures; let staticFixtures: CartCommentStaticFixtures; let commentCartPage: YvesCommentCartPage; - let loginCustomerScenario: YvesLoginCustomerScenario; + let loginCustomerScenario: YvesCustomerLoginScenario; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); commentCartPage = container.get(YvesCommentCartPage); - loginCustomerScenario = container.get(YvesLoginCustomerScenario); + loginCustomerScenario = container.get(YvesCustomerLoginScenario); }); beforeEach((): void => { diff --git a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts index e951e605..bf8794bb 100644 --- a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts @@ -10,7 +10,7 @@ import { YvesCheckoutShipmentPage, YvesCheckoutSummaryPage } from "../../../support/pages/yves"; -import {YvesLoginCustomerScenario} from "../../../support/scenarios/yves"; +import {YvesCustomerLoginScenario} from "../../../support/scenarios/yves"; describe('checkout by logged in customer', (): void => { @@ -22,7 +22,7 @@ describe('checkout by logged in customer', (): void => { let checkoutShipmentPage: YvesCheckoutShipmentPage; let checkoutPaymentPage: YvesCheckoutPaymentPage; let checkoutSummaryPage: YvesCheckoutSummaryPage; - let loginCustomerScenario: YvesLoginCustomerScenario; + let loginCustomerScenario: YvesCustomerLoginScenario; before((): void => { cy.resetYvesCookies(); @@ -33,7 +33,7 @@ describe('checkout by logged in customer', (): void => { checkoutShipmentPage = container.get(YvesCheckoutShipmentPage); checkoutPaymentPage = container.get(YvesCheckoutPaymentPage); checkoutSummaryPage = container.get(YvesCheckoutSummaryPage); - loginCustomerScenario = container.get(YvesLoginCustomerScenario); + loginCustomerScenario = container.get(YvesCustomerLoginScenario); }); beforeEach((): void => { diff --git a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts index e367348d..08295de5 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts @@ -1,6 +1,6 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; import {CreateOrderByCustomerDynamicFixtures, CreateOrderByCustomerStaticFixtures} from "../../../../support/types/yves/order-managment/order"; -import {YvesLoginCustomerScenario} from "../../../../support/scenarios/yves"; +import {YvesCustomerLoginScenario} from "../../../../support/scenarios/yves"; import { YvesCartPage, YvesCheckoutAddressPage, YvesCheckoutPaymentPage, YvesCheckoutShipmentPage, YvesCheckoutSummaryPage, } from "../../../../support/pages/yves"; @@ -8,7 +8,7 @@ import { describe('create order by customer', (): void => { let staticFixtures: CreateOrderByCustomerStaticFixtures; let dynamicFixtures: CreateOrderByCustomerDynamicFixtures; - let loginCustomerScenario: YvesLoginCustomerScenario; + let loginCustomerScenario: YvesCustomerLoginScenario; let cartPage: YvesCartPage; let checkoutAddressPage: YvesCheckoutAddressPage; let checkoutShipmentPage: YvesCheckoutShipmentPage; @@ -18,7 +18,7 @@ describe('create order by customer', (): void => { before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - loginCustomerScenario = container.get(YvesLoginCustomerScenario); + loginCustomerScenario = container.get(YvesCustomerLoginScenario); cartPage = container.get(YvesCartPage); checkoutAddressPage = container.get(YvesCheckoutAddressPage); checkoutShipmentPage = container.get(YvesCheckoutShipmentPage); diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index 22266423..fe7c5936 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -1,4 +1,3 @@ -export * from './place-customer-order-scenario'; -export * from './place-guest-order-scenario'; -export * from './yves-login-customer-scenario'; +export * from './yves-customer-login-scenario'; +export * from './yves-agent-login-scenario'; diff --git a/cypress/support/scenarios/yves/yves-login-customer-scenario.ts b/cypress/support/scenarios/yves/yves-customer-login-scenario.ts similarity index 74% rename from cypress/support/scenarios/yves/yves-login-customer-scenario.ts rename to cypress/support/scenarios/yves/yves-customer-login-scenario.ts index 681ce820..e502f897 100644 --- a/cypress/support/scenarios/yves/yves-login-customer-scenario.ts +++ b/cypress/support/scenarios/yves/yves-customer-login-scenario.ts @@ -1,10 +1,10 @@ import { inject, injectable } from 'inversify'; -import { YvesLoginPage } from '../../pages/yves/login/yves-login-page'; +import { YvesLoginPage } from '../../pages/yves'; import { autoWired } from '../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesLoginCustomerScenario { +export class YvesCustomerLoginScenario { constructor(@inject(YvesLoginPage) private loginPage: YvesLoginPage) {} public execute = (email: string, password: string): void => { From 56122375e0b77dbe23f348458e0b391855f9dffd Mon Sep 17 00:00:00 2001 From: pivovarov Date: Thu, 22 Feb 2024 14:43:31 +0300 Subject: [PATCH 04/53] fix page naming --- .../cart/comment/empty-cart-comment.cy.ts | 12 +-- .../cart/comment/not-empty-cart-comment.cy.ts | 12 +-- .../checkout/checkout-by-guest-customer.cy.ts | 83 +++++++------------ .../checkout-by-logged-in-customer.cy.ts | 70 +++++++--------- .../order/create-order-by-customer.cy.ts | 30 +++---- .../order/create-order-by-guest.cy.ts | 37 ++++----- ...gent-login-page.ts => agent-login-page.ts} | 6 +- ...epository.ts => agent-login-repository.ts} | 2 +- .../suite-yves-agent-login-repository.ts | 4 +- .../cart/{yves-cart-page.ts => cart-page.ts} | 6 +- ...-cart-repository.ts => cart-repository.ts} | 2 +- .../repositories/b2b-yves-cart-repository.ts | 4 +- .../suite-yves-cart-repository.ts | 4 +- ...dress-page.ts => checkout-address-page.ts} | 6 +- ...tory.ts => checkout-address-repository.ts} | 2 +- .../suite-yves-checkout-address-repository.ts | 4 +- ...omer-page.ts => checkout-customer-page.ts} | 16 ++-- ...ory.ts => checkout-customer-repository.ts} | 2 +- ...suite-yves-checkout-customer-repository.ts | 4 +- ...yment-page.ts => checkout-payment-page.ts} | 6 +- ...tory.ts => checkout-payment-repository.ts} | 2 +- .../suite-yves-checkout-payment-repository.ts | 4 +- ...ment-page.ts => checkout-shipment-page.ts} | 6 +- ...ory.ts => checkout-shipment-repository.ts} | 2 +- ...suite-yves-checkout-shipment-repository.ts | 4 +- ...mmary-page.ts => checkout-summary-page.ts} | 6 +- ...tory.ts => checkout-summary-repository.ts} | 2 +- .../suite-yves-checkout-summary-repository.ts | 4 +- ...ment-cart-page.ts => comment-cart-page.ts} | 6 +- ...pository.ts => comment-cart-repository.ts} | 2 +- .../b2b-yves-comment-cart-repository.ts | 4 +- .../suite-yves-comment-cart-repository.ts | 4 +- cypress/support/pages/yves/index.ts | 20 ++--- .../{yves-login-page.ts => login-page.ts} | 6 +- ...ogin-repository.ts => login-repository.ts} | 2 +- .../repositories/b2b-yves-login-repository.ts | 4 +- .../suite-yves-login-repository.ts | 4 +- ...-multi-cart-page.ts => multi-cart-page.ts} | 6 +- ...repository.ts => multi-cart-repository.ts} | 2 +- .../b2b-yves-multi-cart-repository.ts | 4 +- .../suite-yves-multi-cart-repository.ts | 4 +- ...in-scenario.ts => agent-login-scenario.ts} | 6 +- ...scenario.ts => customer-login-scenario.ts} | 6 +- cypress/support/scenarios/yves/index.ts | 4 +- .../yves/place-guest-mp-order-scenario.ts | 25 +++--- .../types/mp/merchant-agent-assist/index.ts | 1 + .../static-fixture-types.ts | 7 ++ .../types/refactor_this_file_and_drop_it.ts | 5 ++ .../yves/checkout/static-fixture-types.ts | 2 - 49 files changed, 224 insertions(+), 242 deletions(-) rename cypress/support/pages/yves/agent-login/{yves-agent-login-page.ts => agent-login-page.ts} (82%) rename cypress/support/pages/yves/agent-login/{yves-agent-login-repository.ts => agent-login-repository.ts} (79%) rename cypress/support/pages/yves/cart/{yves-cart-page.ts => cart-page.ts} (92%) rename cypress/support/pages/yves/cart/{yves-cart-repository.ts => cart-repository.ts} (91%) rename cypress/support/pages/yves/checkout/address/{yves-checkout-address-page.ts => checkout-address-page.ts} (96%) rename cypress/support/pages/yves/checkout/address/{yves-checkout-address-repository.ts => checkout-address-repository.ts} (97%) rename cypress/support/pages/yves/checkout/customer/{yves-checkout-customer-page.ts => checkout-customer-page.ts} (60%) rename cypress/support/pages/yves/checkout/customer/{yves-checkout-customer-repository.ts => checkout-customer-repository.ts} (84%) rename cypress/support/pages/yves/checkout/payment/{yves-checkout-payment-page.ts => checkout-payment-page.ts} (83%) rename cypress/support/pages/yves/checkout/payment/{yves-checkout-payment-repository.ts => checkout-payment-repository.ts} (85%) rename cypress/support/pages/yves/checkout/shipment/{yves-checkout-shipment-page.ts => checkout-shipment-page.ts} (80%) rename cypress/support/pages/yves/checkout/shipment/{yves-checkout-shipment-repository.ts => checkout-shipment-repository.ts} (79%) rename cypress/support/pages/yves/checkout/summary/{yves-checkout-summary-page.ts => checkout-summary-page.ts} (75%) rename cypress/support/pages/yves/checkout/summary/{yves-checkout-summary-repository.ts => checkout-summary-repository.ts} (67%) rename cypress/support/pages/yves/comment/cart/{yves-comment-cart-page.ts => comment-cart-page.ts} (91%) rename cypress/support/pages/yves/comment/cart/{yves-comment-cart-repository.ts => comment-cart-repository.ts} (88%) rename cypress/support/pages/yves/login/{yves-login-page.ts => login-page.ts} (87%) rename cypress/support/pages/yves/login/{yves-login-repository.ts => login-repository.ts} (93%) rename cypress/support/pages/yves/multi-cart/{yves-multi-cart-page.ts => multi-cart-page.ts} (82%) rename cypress/support/pages/yves/multi-cart/{yves-multi-cart-repository.ts => multi-cart-repository.ts} (67%) rename cypress/support/scenarios/yves/{yves-agent-login-scenario.ts => agent-login-scenario.ts} (55%) rename cypress/support/scenarios/yves/{yves-customer-login-scenario.ts => customer-login-scenario.ts} (60%) create mode 100644 cypress/support/types/mp/merchant-agent-assist/index.ts create mode 100644 cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts diff --git a/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts b/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts index ce54ce5a..d2fa9148 100644 --- a/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts @@ -1,19 +1,19 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; -import {YvesCommentCartPage} from "../../../../support/pages/yves"; -import {YvesCustomerLoginScenario} from "../../../../support/scenarios/yves"; +import {CommentCartPage} from "../../../../support/pages/yves"; +import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; describe('cart comment', (): void => { let dynamicFixtures: CartCommentDynamicFixtures; let staticFixtures: CartCommentStaticFixtures; - let commentCartPage: YvesCommentCartPage; - let loginCustomerScenario: YvesCustomerLoginScenario; + let commentCartPage: CommentCartPage; + let loginCustomerScenario: CustomerLoginScenario; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - commentCartPage = container.get(YvesCommentCartPage); - loginCustomerScenario = container.get(YvesCustomerLoginScenario); + commentCartPage = container.get(CommentCartPage); + loginCustomerScenario = container.get(CustomerLoginScenario); }); beforeEach((): void => { diff --git a/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts b/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts index 31d3cb1f..aea9a817 100644 --- a/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts @@ -1,19 +1,19 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; -import {YvesCommentCartPage} from "../../../../support/pages/yves"; -import {YvesCustomerLoginScenario} from "../../../../support/scenarios/yves"; +import {CommentCartPage} from "../../../../support/pages/yves"; +import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; describe('cart comment', (): void => { let dynamicFixtures: CartCommentDynamicFixtures; let staticFixtures: CartCommentStaticFixtures; - let commentCartPage: YvesCommentCartPage; - let loginCustomerScenario: YvesCustomerLoginScenario; + let commentCartPage: CommentCartPage; + let loginCustomerScenario: CustomerLoginScenario; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - commentCartPage = container.get(YvesCommentCartPage); - loginCustomerScenario = container.get(YvesCustomerLoginScenario); + commentCartPage = container.get(CommentCartPage); + loginCustomerScenario = container.get(CustomerLoginScenario); }); beforeEach((): void => { diff --git a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts index 0d2ac0b6..fe839641 100644 --- a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts @@ -1,88 +1,60 @@ import { container } from '../../../support/utils/inversify/inversify.config'; import {CheckoutByGuestCustomerDynamicFixtures} from "../../../support/types/yves/checkout"; import { - YvesCartPage, - YvesCheckoutAddressPage, - YvesCheckoutCustomerPage, YvesCheckoutPaymentPage, - YvesCheckoutShipmentPage, YvesCheckoutSummaryPage + CartPage, + CheckoutAddressPage, + CheckoutCustomerPage, CheckoutPaymentPage, + CheckoutShipmentPage, CheckoutSummaryPage } from "../../../support/pages/yves"; +let cartPage: CartPage; +let checkoutCustomerPage: CheckoutCustomerPage; +let checkoutAddressPage: CheckoutAddressPage; +let checkoutShipmentPage: CheckoutShipmentPage; +let checkoutPaymentPage: CheckoutPaymentPage; +let checkoutSummaryPage: CheckoutSummaryPage; +let dynamicFixtures: CheckoutByGuestCustomerDynamicFixtures; describe('checkout by guest customer', (): void => { - let dynamicFixtures: CheckoutByGuestCustomerDynamicFixtures; - let cartPage: YvesCartPage; - let checkoutCustomerPage: YvesCheckoutCustomerPage; - let checkoutAddressPage: YvesCheckoutAddressPage; - let checkoutShipmentPage: YvesCheckoutShipmentPage; - let checkoutPaymentPage: YvesCheckoutPaymentPage; - let checkoutSummaryPage: YvesCheckoutSummaryPage; - before((): void => { + cy.resetYvesCookies(); dynamicFixtures = Cypress.env('dynamicFixtures'); - cartPage = container.get(YvesCartPage); - checkoutCustomerPage = container.get(YvesCheckoutCustomerPage); - checkoutAddressPage = container.get(YvesCheckoutAddressPage); - checkoutShipmentPage = container.get(YvesCheckoutShipmentPage); - checkoutPaymentPage = container.get(YvesCheckoutPaymentPage); - checkoutSummaryPage = container.get(YvesCheckoutSummaryPage); + cartPage = container.get(CartPage); + checkoutCustomerPage = container.get(CheckoutCustomerPage); + checkoutAddressPage = container.get(CheckoutAddressPage); + checkoutShipmentPage = container.get(CheckoutShipmentPage); + checkoutPaymentPage = container.get(CheckoutPaymentPage); + checkoutSummaryPage = container.get(CheckoutSummaryPage); }); beforeEach((): void => { - cy.resetYvesCookies(); + cartPage.visit(); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); }); it('should checkout with one concrete product', (): void => { - cy.visit(cartPage.PAGE_URL); cartPage.quickAddToCart(dynamicFixtures.productOne.sku); - - cartPage.startCheckout(); - checkoutCustomerPage.checkoutAsGuest(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); + completeGuestCheckoutProcess(); cy.contains('Your order has been placed successfully!'); }); it('should checkout with two concrete products to single shipment [@regression]', (): void => { - cy.visit(cartPage.PAGE_URL); - - cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); - - cartPage.startCheckout(); - checkoutCustomerPage.checkoutAsGuest(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); + completeGuestCheckoutProcess(); cy.contains('Your order has been placed successfully!'); }); it('should checkout to multi shipment address [@regression]', (): void => { - cy.visit(cartPage.PAGE_URL); - - cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); - - cartPage.startCheckout(); - checkoutCustomerPage.checkoutAsGuest(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); + completeGuestCheckoutProcess(); cy.contains('Your order has been placed successfully!'); }); it('should checkout with strict checkout step redirects', (): void => { - cy.visit(cartPage.PAGE_URL); - - cartPage.quickAddToCart(dynamicFixtures.productOne.sku); - cartPage.assertPageLocation(); cartPage.startCheckout(); @@ -104,3 +76,12 @@ describe('checkout by guest customer', (): void => { cy.url().should('include', '/checkout/success'); }); }); + +const completeGuestCheckoutProcess = () => { + cartPage.startCheckout(); + checkoutCustomerPage.checkoutAsGuest(); + checkoutAddressPage.fillShippingAddress(); + checkoutShipmentPage.setStandardShippingMethod(); + checkoutPaymentPage.setDummyPaymentMethod(); + checkoutSummaryPage.placeOrder(); +} diff --git a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts index bf8794bb..bad76b5c 100644 --- a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts @@ -4,70 +4,56 @@ import { CheckoutByLoggedInCustomerStaticFixtures } from "../../../support/types/yves/checkout"; import { - YvesCartPage, - YvesCheckoutAddressPage, - YvesCheckoutPaymentPage, - YvesCheckoutShipmentPage, - YvesCheckoutSummaryPage + CartPage, + CheckoutAddressPage, + CheckoutPaymentPage, + CheckoutShipmentPage, + CheckoutSummaryPage } from "../../../support/pages/yves"; -import {YvesCustomerLoginScenario} from "../../../support/scenarios/yves"; +import {CustomerLoginScenario} from "../../../support/scenarios/yves"; +let staticFixtures: CheckoutByLoggedInCustomerStaticFixtures; +let dynamicFixtures: CheckoutByLoggedInCustomerDynamicFixtures; +let cartPage: CartPage; +let checkoutAddressPage: CheckoutAddressPage; +let checkoutShipmentPage: CheckoutShipmentPage; +let checkoutPaymentPage: CheckoutPaymentPage; +let checkoutSummaryPage: CheckoutSummaryPage; +let loginCustomerScenario: CustomerLoginScenario; describe('checkout by logged in customer', (): void => { - let staticFixtures: CheckoutByLoggedInCustomerStaticFixtures; - let dynamicFixtures: CheckoutByLoggedInCustomerDynamicFixtures; - - let cartPage: YvesCartPage; - let checkoutAddressPage: YvesCheckoutAddressPage; - let checkoutShipmentPage: YvesCheckoutShipmentPage; - let checkoutPaymentPage: YvesCheckoutPaymentPage; - let checkoutSummaryPage: YvesCheckoutSummaryPage; - let loginCustomerScenario: YvesCustomerLoginScenario; - before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - cartPage = container.get(YvesCartPage); - checkoutAddressPage = container.get(YvesCheckoutAddressPage); - checkoutShipmentPage = container.get(YvesCheckoutShipmentPage); - checkoutPaymentPage = container.get(YvesCheckoutPaymentPage); - checkoutSummaryPage = container.get(YvesCheckoutSummaryPage); - loginCustomerScenario = container.get(YvesCustomerLoginScenario); + cartPage = container.get(CartPage); + checkoutAddressPage = container.get(CheckoutAddressPage); + checkoutShipmentPage = container.get(CheckoutShipmentPage); + checkoutPaymentPage = container.get(CheckoutPaymentPage); + checkoutSummaryPage = container.get(CheckoutSummaryPage); + loginCustomerScenario = container.get(CustomerLoginScenario); }); beforeEach((): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); cartPage.visit(); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku); }); it('should checkout with one concrete product', (): void => { - cartPage.quickAddToCart(dynamicFixtures.productOne.sku); - - cartPage.startCheckout(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); + completeCustomerCheckoutProcessWithSingleShipment(); cy.contains('Your order has been placed successfully!'); }); it('should checkout with two concrete products to single shipment', (): void => { - cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); - - cartPage.startCheckout(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); + completeCustomerCheckoutProcessWithSingleShipment(); cy.contains('Your order has been placed successfully!'); }); it('should checkout to multi shipment address', (): void => { - cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); cartPage.startCheckout(); @@ -80,8 +66,6 @@ describe('checkout by logged in customer', (): void => { }); it('should checkout with strict checkout step redirects', (): void => { - cartPage.quickAddToCart(dynamicFixtures.productOne.sku); - cartPage.assertPageLocation(); cartPage.startCheckout(); @@ -100,3 +84,11 @@ describe('checkout by logged in customer', (): void => { cy.url().should('include', '/checkout/success'); }); }); + +const completeCustomerCheckoutProcessWithSingleShipment = () => { + cartPage.startCheckout(); + checkoutAddressPage.fillShippingAddress(); + checkoutShipmentPage.setStandardShippingMethod(); + checkoutPaymentPage.setDummyPaymentMethod(); + checkoutSummaryPage.placeOrder(); +} diff --git a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts index 08295de5..71267bfe 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts @@ -1,37 +1,37 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; import {CreateOrderByCustomerDynamicFixtures, CreateOrderByCustomerStaticFixtures} from "../../../../support/types/yves/order-managment/order"; -import {YvesCustomerLoginScenario} from "../../../../support/scenarios/yves"; +import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; import { - YvesCartPage, YvesCheckoutAddressPage, YvesCheckoutPaymentPage, YvesCheckoutShipmentPage, YvesCheckoutSummaryPage, + CartPage, CheckoutAddressPage, CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, } from "../../../../support/pages/yves"; describe('create order by customer', (): void => { let staticFixtures: CreateOrderByCustomerStaticFixtures; let dynamicFixtures: CreateOrderByCustomerDynamicFixtures; - let loginCustomerScenario: YvesCustomerLoginScenario; - let cartPage: YvesCartPage; - let checkoutAddressPage: YvesCheckoutAddressPage; - let checkoutShipmentPage: YvesCheckoutShipmentPage; - let checkoutPaymentPage: YvesCheckoutPaymentPage; - let checkoutSummaryPage: YvesCheckoutSummaryPage; + let loginCustomerScenario: CustomerLoginScenario; + let cartPage: CartPage; + let checkoutAddressPage: CheckoutAddressPage; + let checkoutShipmentPage: CheckoutShipmentPage; + let checkoutPaymentPage: CheckoutPaymentPage; + let checkoutSummaryPage: CheckoutSummaryPage; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - loginCustomerScenario = container.get(YvesCustomerLoginScenario); - cartPage = container.get(YvesCartPage); - checkoutAddressPage = container.get(YvesCheckoutAddressPage); - checkoutShipmentPage = container.get(YvesCheckoutShipmentPage); - checkoutPaymentPage = container.get(YvesCheckoutPaymentPage); - checkoutSummaryPage = container.get(YvesCheckoutSummaryPage); + loginCustomerScenario = container.get(CustomerLoginScenario); + cartPage = container.get(CartPage); + checkoutAddressPage = container.get(CheckoutAddressPage); + checkoutShipmentPage = container.get(CheckoutShipmentPage); + checkoutPaymentPage = container.get(CheckoutPaymentPage); + checkoutSummaryPage = container.get(CheckoutSummaryPage); }); beforeEach((): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); + cartPage.visit(); }); it('should be able to create an order by existing customer [@order, @regression]', (): void => { - cartPage.visit(); cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); cartPage.startCheckout(); checkoutAddressPage.fillShippingAddress(); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts index 800c9f94..81d87d4b 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts @@ -1,33 +1,30 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; import {CreateOrderByGuestDynamicFixtures} from "../../../../support/types/yves/order-managment/order"; import { - YvesCartPage, - YvesCheckoutAddressPage, YvesCheckoutCustomerPage, - YvesCheckoutPaymentPage, - YvesCheckoutShipmentPage, YvesCheckoutSummaryPage + CartPage, + CheckoutAddressPage, CheckoutCustomerPage, + CheckoutPaymentPage, + CheckoutShipmentPage, CheckoutSummaryPage } from "../../../../support/pages/yves"; describe('create order by guest', (): void => { let dynamicFixtures: CreateOrderByGuestDynamicFixtures; - let cartPage: YvesCartPage; - let checkoutCustomerPage: YvesCheckoutCustomerPage; - let checkoutAddressPage: YvesCheckoutAddressPage; - let checkoutShipmentPage: YvesCheckoutShipmentPage; - let checkoutPaymentPage: YvesCheckoutPaymentPage; - let checkoutSummaryPage: YvesCheckoutSummaryPage; + let cartPage: CartPage; + let checkoutCustomerPage: CheckoutCustomerPage; + let checkoutAddressPage: CheckoutAddressPage; + let checkoutShipmentPage: CheckoutShipmentPage; + let checkoutPaymentPage: CheckoutPaymentPage; + let checkoutSummaryPage: CheckoutSummaryPage; before((): void => { - dynamicFixtures = Cypress.env('dynamicFixtures'); - cartPage = container.get(YvesCartPage); - checkoutCustomerPage = container.get(YvesCheckoutCustomerPage); - checkoutAddressPage = container.get(YvesCheckoutAddressPage); - checkoutShipmentPage = container.get(YvesCheckoutShipmentPage); - checkoutPaymentPage = container.get(YvesCheckoutPaymentPage); - checkoutSummaryPage = container.get(YvesCheckoutSummaryPage); - }); - - beforeEach((): void => { cy.resetYvesCookies(); + dynamicFixtures = Cypress.env('dynamicFixtures'); + cartPage = container.get(CartPage); + checkoutCustomerPage = container.get(CheckoutCustomerPage); + checkoutAddressPage = container.get(CheckoutAddressPage); + checkoutShipmentPage = container.get(CheckoutShipmentPage); + checkoutPaymentPage = container.get(CheckoutPaymentPage); + checkoutSummaryPage = container.get(CheckoutSummaryPage); }); it('should be able to create an order by guest [@regression]', (): void => { diff --git a/cypress/support/pages/yves/agent-login/yves-agent-login-page.ts b/cypress/support/pages/yves/agent-login/agent-login-page.ts similarity index 82% rename from cypress/support/pages/yves/agent-login/yves-agent-login-page.ts rename to cypress/support/pages/yves/agent-login/agent-login-page.ts index cc422484..c20c5147 100644 --- a/cypress/support/pages/yves/agent-login/yves-agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -2,16 +2,16 @@ import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../utils/inversify/types'; import 'reflect-metadata'; -import { YvesAgentLoginRepository } from './yves-agent-login-repository'; +import { AgentLoginRepository } from './agent-login-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import {User} from "../../../types/user"; @injectable() @autoWired -export class YvesAgentLoginPage extends AbstractPage { +export class AgentLoginPage extends AbstractPage { public PAGE_URL: string = '/agent/login'; - constructor(@inject(TYPES.YvesAgentLoginRepository) private repository: YvesAgentLoginRepository) { + constructor(@inject(TYPES.YvesAgentLoginRepository) private repository: AgentLoginRepository) { super(); } diff --git a/cypress/support/pages/yves/agent-login/yves-agent-login-repository.ts b/cypress/support/pages/yves/agent-login/agent-login-repository.ts similarity index 79% rename from cypress/support/pages/yves/agent-login/yves-agent-login-repository.ts rename to cypress/support/pages/yves/agent-login/agent-login-repository.ts index ede05792..07b88c4d 100644 --- a/cypress/support/pages/yves/agent-login/yves-agent-login-repository.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-repository.ts @@ -1,4 +1,4 @@ -export interface YvesAgentLoginRepository { +export interface AgentLoginRepository { getLoginEmailInput(): Cypress.Chainable; getLoginPasswordInput(): Cypress.Chainable; getLoginForm(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/agent-login/repositories/suite-yves-agent-login-repository.ts b/cypress/support/pages/yves/agent-login/repositories/suite-yves-agent-login-repository.ts index 9de59e6a..4a615d0a 100644 --- a/cypress/support/pages/yves/agent-login/repositories/suite-yves-agent-login-repository.ts +++ b/cypress/support/pages/yves/agent-login/repositories/suite-yves-agent-login-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesAgentLoginRepository } from '../yves-agent-login-repository'; +import { AgentLoginRepository } from '../agent-login-repository'; @injectable() -export class SuiteYvesAgentLoginRepository implements YvesAgentLoginRepository { +export class SuiteYvesAgentLoginRepository implements AgentLoginRepository { getLoginEmailInput = (): Cypress.Chainable => cy.get('#loginForm_email'); getLoginPasswordInput = (): Cypress.Chainable => cy.get('#loginForm_password'); getLoginForm = (): Cypress.Chainable => cy.get('form[name=loginForm]'); diff --git a/cypress/support/pages/yves/cart/yves-cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts similarity index 92% rename from cypress/support/pages/yves/cart/yves-cart-page.ts rename to cypress/support/pages/yves/cart/cart-page.ts index 35ae323a..76545b2f 100644 --- a/cypress/support/pages/yves/cart/yves-cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -2,15 +2,15 @@ import 'reflect-metadata'; import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../utils/inversify/types'; -import { YvesCartRepository } from './yves-cart-repository'; +import { CartRepository } from './cart-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesCartPage extends AbstractPage { +export class CartPage extends AbstractPage { public PAGE_URL: string = '/cart'; - constructor(@inject(TYPES.YvesCartRepository) private repository: YvesCartRepository) { + constructor(@inject(TYPES.YvesCartRepository) private repository: CartRepository) { super(); } diff --git a/cypress/support/pages/yves/cart/yves-cart-repository.ts b/cypress/support/pages/yves/cart/cart-repository.ts similarity index 91% rename from cypress/support/pages/yves/cart/yves-cart-repository.ts rename to cypress/support/pages/yves/cart/cart-repository.ts index ca5684df..fc7e8f18 100644 --- a/cypress/support/pages/yves/cart/yves-cart-repository.ts +++ b/cypress/support/pages/yves/cart/cart-repository.ts @@ -1,4 +1,4 @@ -export interface YvesCartRepository { +export interface CartRepository { getQuickAddToCartSkuField(): Cypress.Chainable; getQuickAddToCartQuantityField(): Cypress.Chainable; getQuickAddToCartSubmitButton(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/cart/repositories/b2b-yves-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/b2b-yves-cart-repository.ts index 0b21d027..6e98415d 100644 --- a/cypress/support/pages/yves/cart/repositories/b2b-yves-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2b-yves-cart-repository.ts @@ -1,9 +1,9 @@ import 'reflect-metadata'; import { injectable } from 'inversify'; -import { YvesCartRepository } from '../yves-cart-repository'; +import { CartRepository } from '../cart-repository'; @injectable() -export class B2bYvesCartRepository implements YvesCartRepository { +export class B2bYvesCartRepository implements CartRepository { getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[name="sku"]'); getQuickAddToCartQuantityField = (): Cypress.Chainable> => cy.get('#quantity'); getQuickAddToCartSubmitButton = (): Cypress.Chainable> => diff --git a/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts index 9bfa43a1..19ff10a9 100644 --- a/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts @@ -1,9 +1,9 @@ import 'reflect-metadata'; import { injectable } from 'inversify'; -import { YvesCartRepository } from '../yves-cart-repository'; +import { CartRepository } from '../cart-repository'; @injectable() -export class SuiteYvesCartRepository implements YvesCartRepository { +export class SuiteYvesCartRepository implements CartRepository { getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[name="sku"]'); getQuickAddToCartQuantityField = (): Cypress.Chainable> => cy.get('#quantity'); getQuickAddToCartSubmitButton = (): Cypress.Chainable> => diff --git a/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts similarity index 96% rename from cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts rename to cypress/support/pages/yves/checkout/address/checkout-address-page.ts index d8ae5a49..6e41cd9e 100644 --- a/cypress/support/pages/yves/checkout/address/yves-checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -2,17 +2,17 @@ import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { YvesCheckoutAddressRepository } from './yves-checkout-address-repository'; +import { CheckoutAddressRepository } from './checkout-address-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import {CheckoutAddress} from "../../../../types/yves/checkout"; @injectable() @autoWired -export class YvesCheckoutAddressPage extends AbstractPage { +export class CheckoutAddressPage extends AbstractPage { public PAGE_URL: string = '/checkout/address'; - constructor(@inject(TYPES.YvesCheckoutAddressRepository) private repository: YvesCheckoutAddressRepository) { + constructor(@inject(TYPES.YvesCheckoutAddressRepository) private repository: CheckoutAddressRepository) { super(); } diff --git a/cypress/support/pages/yves/checkout/address/yves-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts similarity index 97% rename from cypress/support/pages/yves/checkout/address/yves-checkout-address-repository.ts rename to cypress/support/pages/yves/checkout/address/checkout-address-repository.ts index b158ab2b..fe4a5835 100644 --- a/cypress/support/pages/yves/checkout/address/yves-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts @@ -1,4 +1,4 @@ -export interface YvesCheckoutAddressRepository { +export interface CheckoutAddressRepository { getSelectShippingAddressField(): Cypress.Chainable; getShippingAddressFirstNameField(): Cypress.Chainable; getShippingAddressLastNameField(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository.ts index 0ffb7431..d794dbbd 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesCheckoutAddressRepository } from '../yves-checkout-address-repository'; +import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() -export class SuiteYvesCheckoutAddressRepository implements YvesCheckoutAddressRepository { +export class SuiteYvesCheckoutAddressRepository implements CheckoutAddressRepository { getSelectShippingAddressField = (): Cypress.Chainable => cy.get('.select__select.js-address__form-select-shippingAddress'); getShippingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_first_name'); diff --git a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts similarity index 60% rename from cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts rename to cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts index 32ca05b7..63106ecb 100644 --- a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -2,26 +2,26 @@ import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { TYPES } from '../../../../utils/inversify/types'; -import { YvesCheckoutCustomerRepository } from './yves-checkout-customer-repository'; +import { CheckoutCustomerRepository } from './checkout-customer-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; -import {Customer} from "../../../../types/yves/checkout"; +import {Guest} from "../../../../types/refactor_this_file_and_drop_it"; @injectable() @autoWired -export class YvesCheckoutCustomerPage extends AbstractPage { +export class CheckoutCustomerPage extends AbstractPage { public PAGE_URL: string = '/checkout/customer'; - constructor(@inject(TYPES.YvesCheckoutCustomerRepository) private repository: YvesCheckoutCustomerRepository) { + constructor(@inject(TYPES.YvesCheckoutCustomerRepository) private repository: CheckoutCustomerRepository) { super(); } - public checkoutAsGuest = (customerGuestForm?: CustomerGuestForm): Guest => { + public checkoutAsGuest = (): Guest => { const guest: Guest = { - firstName: customerGuestForm?.firstName ?? this.faker.person.firstName(), - lastName: customerGuestForm?.lastName ?? this.faker.person.lastName(), - email: customerGuestForm?.email ?? this.faker.internet.email(), + firstName: this.faker.person.firstName(), + lastName: this.faker.person.lastName(), + email: this.faker.internet.email(), }; this.repository.getGuestRadioButton().click(); diff --git a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-repository.ts similarity index 84% rename from cypress/support/pages/yves/checkout/customer/yves-checkout-customer-repository.ts rename to cypress/support/pages/yves/checkout/customer/checkout-customer-repository.ts index fd8ae226..ea791ed4 100644 --- a/cypress/support/pages/yves/checkout/customer/yves-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-repository.ts @@ -1,4 +1,4 @@ -export interface YvesCheckoutCustomerRepository { +export interface CheckoutCustomerRepository { getGuestRadioButton(): Cypress.Chainable; getGuestFirstNameField(): Cypress.Chainable; getGuestLastNameField(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository.ts index 4fb41a3d..c2c7eb0d 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesCheckoutCustomerRepository } from '../yves-checkout-customer-repository'; +import { CheckoutCustomerRepository } from '../checkout-customer-repository'; @injectable() -export class SuiteYvesCheckoutCustomerRepository implements YvesCheckoutCustomerRepository { +export class SuiteYvesCheckoutCustomerRepository implements CheckoutCustomerRepository { getGuestRadioButton = (): Cypress.Chainable => cy.get('[data-qa="component toggler-radio checkoutProceedAs guest"]'); getGuestFirstNameField = (): Cypress.Chainable => cy.get('#guestForm_customer_first_name'); getGuestLastNameField = (): Cypress.Chainable => cy.get('#guestForm_customer_last_name'); diff --git a/cypress/support/pages/yves/checkout/payment/yves-checkout-payment-page.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts similarity index 83% rename from cypress/support/pages/yves/checkout/payment/yves-checkout-payment-page.ts rename to cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts index 68769691..900aca50 100644 --- a/cypress/support/pages/yves/checkout/payment/yves-checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -2,15 +2,15 @@ import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { YvesCheckoutPaymentRepository } from './yves-checkout-payment-repository'; +import { CheckoutPaymentRepository } from './checkout-payment-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesCheckoutPaymentPage extends AbstractPage { +export class CheckoutPaymentPage extends AbstractPage { public PAGE_URL: string = '/checkout/payment'; - constructor(@inject(TYPES.YvesCheckoutPaymentRepository) private repository: YvesCheckoutPaymentRepository) { + constructor(@inject(TYPES.YvesCheckoutPaymentRepository) private repository: CheckoutPaymentRepository) { super(); } diff --git a/cypress/support/pages/yves/checkout/payment/yves-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-repository.ts similarity index 85% rename from cypress/support/pages/yves/checkout/payment/yves-checkout-payment-repository.ts rename to cypress/support/pages/yves/checkout/payment/checkout-payment-repository.ts index 250bab1c..e87f6dee 100644 --- a/cypress/support/pages/yves/checkout/payment/yves-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-repository.ts @@ -1,4 +1,4 @@ -export interface YvesCheckoutPaymentRepository { +export interface CheckoutPaymentRepository { getDummyPaymentInvoiceRadio(): Cypress.Chainable; getDummyPaymentInvoiceDateField(): Cypress.Chainable; getGoToSummaryButton(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository.ts index 0b9ac50e..7e6df951 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesCheckoutPaymentRepository } from '../yves-checkout-payment-repository'; +import { CheckoutPaymentRepository } from '../checkout-payment-repository'; @injectable() -export class SuiteYvesCheckoutPaymentRepository implements YvesCheckoutPaymentRepository { +export class SuiteYvesCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice'); getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); getGoToSummaryButton = (): Cypress.Chainable => cy.contains('button', 'Go to Summary'); diff --git a/cypress/support/pages/yves/checkout/shipment/yves-checkout-shipment-page.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts similarity index 80% rename from cypress/support/pages/yves/checkout/shipment/yves-checkout-shipment-page.ts rename to cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts index 68b2429e..30dc91bf 100644 --- a/cypress/support/pages/yves/checkout/shipment/yves-checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -2,15 +2,15 @@ import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { YvesCheckoutShipmentRepository } from './yves-checkout-shipment-repository'; +import { CheckoutShipmentRepository } from './checkout-shipment-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesCheckoutShipmentPage extends AbstractPage { +export class CheckoutShipmentPage extends AbstractPage { public PAGE_URL: string = '/checkout/shipment'; - constructor(@inject(TYPES.YvesCheckoutShipmentRepository) private repository: YvesCheckoutShipmentRepository) { + constructor(@inject(TYPES.YvesCheckoutShipmentRepository) private repository: CheckoutShipmentRepository) { super(); } diff --git a/cypress/support/pages/yves/checkout/shipment/yves-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts similarity index 79% rename from cypress/support/pages/yves/checkout/shipment/yves-checkout-shipment-repository.ts rename to cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts index 1f1a76c8..874c9496 100644 --- a/cypress/support/pages/yves/checkout/shipment/yves-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts @@ -1,4 +1,4 @@ -export interface YvesCheckoutShipmentRepository { +export interface CheckoutShipmentRepository { getMultiShipmentItemElement(): Cypress.Chainable; getStandardShipmentRadio($shipmentItem: JQuery, index: number): Cypress.Chainable; getNextButton(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository.ts index 88036ae2..60352c7e 100644 --- a/cypress/support/pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesCheckoutShipmentRepository } from '../yves-checkout-shipment-repository'; +import { CheckoutShipmentRepository } from '../checkout-shipment-repository'; @injectable() -export class SuiteYvesCheckoutShipmentRepository implements YvesCheckoutShipmentRepository { +export class SuiteYvesCheckoutShipmentRepository implements CheckoutShipmentRepository { getMultiShipmentItemElement = (): Cypress.Chainable => cy.get('.form__fields.grid.grid--bottom'); getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0`); diff --git a/cypress/support/pages/yves/checkout/summary/yves-checkout-summary-page.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts similarity index 75% rename from cypress/support/pages/yves/checkout/summary/yves-checkout-summary-page.ts rename to cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts index 854b4c5a..7b00ea26 100644 --- a/cypress/support/pages/yves/checkout/summary/yves-checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -2,15 +2,15 @@ import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; -import { YvesCheckoutSummaryRepository } from './yves-checkout-summary-repository'; +import { CheckoutSummaryRepository } from './checkout-summary-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesCheckoutSummaryPage extends AbstractPage { +export class CheckoutSummaryPage extends AbstractPage { public PAGE_URL: string = '/checkout/summary'; - constructor(@inject(TYPES.YvesCheckoutSummaryRepository) private repository: YvesCheckoutSummaryRepository) { + constructor(@inject(TYPES.YvesCheckoutSummaryRepository) private repository: CheckoutSummaryRepository) { super(); } diff --git a/cypress/support/pages/yves/checkout/summary/yves-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-repository.ts similarity index 67% rename from cypress/support/pages/yves/checkout/summary/yves-checkout-summary-repository.ts rename to cypress/support/pages/yves/checkout/summary/checkout-summary-repository.ts index e3d9d140..9f3c8fba 100644 --- a/cypress/support/pages/yves/checkout/summary/yves-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-repository.ts @@ -1,4 +1,4 @@ -export interface YvesCheckoutSummaryRepository { +export interface CheckoutSummaryRepository { getaAcceptTermsAndConditionsCheckbox(): Cypress.Chainable; getSummaryForm(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository.ts index c7434c1b..6f00b9b6 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesCheckoutSummaryRepository } from '../yves-checkout-summary-repository'; +import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() -export class SuiteYvesCheckoutSummaryRepository implements YvesCheckoutSummaryRepository { +export class SuiteYvesCheckoutSummaryRepository implements CheckoutSummaryRepository { getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[name="acceptTermsAndConditions"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); } diff --git a/cypress/support/pages/yves/comment/cart/yves-comment-cart-page.ts b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts similarity index 91% rename from cypress/support/pages/yves/comment/cart/yves-comment-cart-page.ts rename to cypress/support/pages/yves/comment/cart/comment-cart-page.ts index 96af34c6..de437c66 100644 --- a/cypress/support/pages/yves/comment/cart/yves-comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -2,15 +2,15 @@ import 'reflect-metadata'; import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../../utils/inversify/types'; -import { YvesCommentCartRepository } from './yves-comment-cart-repository'; +import { CommentCartRepository } from './comment-cart-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesCommentCartPage extends AbstractPage { +export class CommentCartPage extends AbstractPage { public PAGE_URL: string = '/cart'; - constructor(@inject(TYPES.YvesCommentCartRepository) private repository: YvesCommentCartRepository) { + constructor(@inject(TYPES.YvesCommentCartRepository) private repository: CommentCartRepository) { super(); } diff --git a/cypress/support/pages/yves/comment/cart/yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/comment-cart-repository.ts similarity index 88% rename from cypress/support/pages/yves/comment/cart/yves-comment-cart-repository.ts rename to cypress/support/pages/yves/comment/cart/comment-cart-repository.ts index 7f97cd06..dfaa5139 100644 --- a/cypress/support/pages/yves/comment/cart/yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-repository.ts @@ -1,4 +1,4 @@ -export interface YvesCommentCartRepository { +export interface CommentCartRepository { getAddCommentForm(): Cypress.Chainable; getCommentThreadListSection(): Cypress.Chainable; getAddCommentButtonSelector(): string; diff --git a/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts index d3388042..eb4592ba 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts @@ -1,9 +1,9 @@ import 'reflect-metadata'; import { injectable } from 'inversify'; -import { YvesCommentCartRepository } from '../yves-comment-cart-repository'; +import { CommentCartRepository } from '../comment-cart-repository'; @injectable() -export class B2bYvesCommentCartRepository implements YvesCommentCartRepository { +export class B2bYvesCommentCartRepository implements CommentCartRepository { getAddCommentForm = (): Cypress.Chainable => cy.get('[data-qa="component add-comment-form"]'); getCommentThreadListSection = (): Cypress.Chainable => cy.get('[data-qa="component comment-thread-list"]'); getAddCommentButtonSelector = (): string => '[data-qa="component icon"]'; diff --git a/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts index 6dc72777..d29795c9 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts @@ -1,9 +1,9 @@ import 'reflect-metadata'; import { injectable } from 'inversify'; -import { YvesCommentCartRepository } from '../yves-comment-cart-repository'; +import { CommentCartRepository } from '../comment-cart-repository'; @injectable() -export class SuiteYvesCommentCartRepository implements YvesCommentCartRepository { +export class SuiteYvesCommentCartRepository implements CommentCartRepository { getAddCommentForm = (): Cypress.Chainable => cy.get('[data-qa="component comment-form"]'); getCommentThreadListSection = (): Cypress.Chainable => cy.get('[data-qa="component comment-thread-list"]'); getAddCommentButtonSelector = (): string => 'button:contains("Add")'; diff --git a/cypress/support/pages/yves/index.ts b/cypress/support/pages/yves/index.ts index 3d885475..654d06f9 100644 --- a/cypress/support/pages/yves/index.ts +++ b/cypress/support/pages/yves/index.ts @@ -1,10 +1,10 @@ -export * from './cart/yves-cart-page'; -export * from './agent-login/yves-agent-login-page'; -export * from './checkout/address/yves-checkout-address-page'; -export * from './checkout/customer/yves-checkout-customer-page'; -export * from './checkout/payment/yves-checkout-payment-page'; -export * from './checkout/shipment/yves-checkout-shipment-page'; -export * from './checkout/summary/yves-checkout-summary-page'; -export * from './comment/cart/yves-comment-cart-page'; -export * from './login/yves-login-page'; -export * from './multi-cart/yves-multi-cart-page'; +export * from './cart/cart-page'; +export * from './agent-login/agent-login-page'; +export * from './checkout/address/checkout-address-page'; +export * from './checkout/customer/checkout-customer-page'; +export * from './checkout/payment/checkout-payment-page'; +export * from './checkout/shipment/checkout-shipment-page'; +export * from './checkout/summary/checkout-summary-page'; +export * from './comment/cart/comment-cart-page'; +export * from './login/login-page'; +export * from './multi-cart/multi-cart-page'; diff --git a/cypress/support/pages/yves/login/yves-login-page.ts b/cypress/support/pages/yves/login/login-page.ts similarity index 87% rename from cypress/support/pages/yves/login/yves-login-page.ts rename to cypress/support/pages/yves/login/login-page.ts index 7efc9b95..e31098eb 100644 --- a/cypress/support/pages/yves/login/yves-login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -2,18 +2,18 @@ import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../utils/inversify/types'; import 'reflect-metadata'; -import { YvesLoginRepository } from './yves-login-repository'; +import { LoginRepository } from './login-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesLoginPage extends AbstractPage { +export class LoginPage extends AbstractPage { public PAGE_URL: string = '/login'; private DEFAULT_SALUTATION: string = 'Mr'; private DEFAULT_PASSWORD_PREFIX: string = 'Change123@_'; - constructor(@inject(TYPES.YvesLoginRepository) private repository: YvesLoginRepository) { + constructor(@inject(TYPES.YvesLoginRepository) private repository: LoginRepository) { super(); } diff --git a/cypress/support/pages/yves/login/yves-login-repository.ts b/cypress/support/pages/yves/login/login-repository.ts similarity index 93% rename from cypress/support/pages/yves/login/yves-login-repository.ts rename to cypress/support/pages/yves/login/login-repository.ts index e83bc6c0..487291c5 100644 --- a/cypress/support/pages/yves/login/yves-login-repository.ts +++ b/cypress/support/pages/yves/login/login-repository.ts @@ -1,4 +1,4 @@ -export interface YvesLoginRepository { +export interface LoginRepository { getLoginEmailInput(): Cypress.Chainable; getLoginPasswordInput(): Cypress.Chainable; getLoginForm(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/login/repositories/b2b-yves-login-repository.ts b/cypress/support/pages/yves/login/repositories/b2b-yves-login-repository.ts index 3cf7a972..4be1bb27 100644 --- a/cypress/support/pages/yves/login/repositories/b2b-yves-login-repository.ts +++ b/cypress/support/pages/yves/login/repositories/b2b-yves-login-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesLoginRepository } from '../yves-login-repository'; +import { LoginRepository } from '../login-repository'; @injectable() -export class B2bYvesLoginRepository implements YvesLoginRepository { +export class B2bYvesLoginRepository implements LoginRepository { getLoginEmailInput = (): Cypress.Chainable => cy.get('#loginForm_email'); getLoginPasswordInput = (): Cypress.Chainable => cy.get('#loginForm_password'); getLoginForm = (): Cypress.Chainable => cy.get('form[name=loginForm]'); diff --git a/cypress/support/pages/yves/login/repositories/suite-yves-login-repository.ts b/cypress/support/pages/yves/login/repositories/suite-yves-login-repository.ts index 28eb2352..2fff6705 100644 --- a/cypress/support/pages/yves/login/repositories/suite-yves-login-repository.ts +++ b/cypress/support/pages/yves/login/repositories/suite-yves-login-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesLoginRepository } from '../yves-login-repository'; +import { LoginRepository } from '../login-repository'; @injectable() -export class SuiteYvesLoginRepository implements YvesLoginRepository { +export class SuiteYvesLoginRepository implements LoginRepository { getLoginEmailInput = (): Cypress.Chainable => cy.get('#loginForm_email'); getLoginPasswordInput = (): Cypress.Chainable => cy.get('#loginForm_password'); getLoginForm = (): Cypress.Chainable => cy.get('form[name=loginForm]'); diff --git a/cypress/support/pages/yves/multi-cart/yves-multi-cart-page.ts b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts similarity index 82% rename from cypress/support/pages/yves/multi-cart/yves-multi-cart-page.ts rename to cypress/support/pages/yves/multi-cart/multi-cart-page.ts index 95a0b4f5..84537f13 100644 --- a/cypress/support/pages/yves/multi-cart/yves-multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -2,15 +2,15 @@ import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../utils/inversify/types'; import 'reflect-metadata'; -import { YvesMultiCartRepository } from './yves-multi-cart-repository'; +import { MultiCartRepository } from './multi-cart-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesMultiCartPage extends AbstractPage { +export class MultiCartPage extends AbstractPage { public PAGE_URL: string = '/multi-cart'; - constructor(@inject(TYPES.YvesMultiCartRepository) private repository: YvesMultiCartRepository) { + constructor(@inject(TYPES.YvesMultiCartRepository) private repository: MultiCartRepository) { super(); } diff --git a/cypress/support/pages/yves/multi-cart/yves-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/multi-cart-repository.ts similarity index 67% rename from cypress/support/pages/yves/multi-cart/yves-multi-cart-repository.ts rename to cypress/support/pages/yves/multi-cart/multi-cart-repository.ts index 9c7a7a87..d135be08 100644 --- a/cypress/support/pages/yves/multi-cart/yves-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-repository.ts @@ -1,4 +1,4 @@ -export interface YvesMultiCartRepository { +export interface MultiCartRepository { getCreateCartNameInput(): Cypress.Chainable; getCreateCartForm(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository.ts index 18ee3e04..e686c7ca 100644 --- a/cypress/support/pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesMultiCartRepository } from '../yves-multi-cart-repository'; +import { MultiCartRepository } from '../multi-cart-repository'; @injectable() -export class B2bYvesMultiCartRepository implements YvesMultiCartRepository { +export class B2bYvesMultiCartRepository implements MultiCartRepository { getCreateCartNameInput = (): Cypress.Chainable => cy.get('#quoteForm_name'); getCreateCartForm = (): Cypress.Chainable => cy.get('form[name=quoteForm]'); } diff --git a/cypress/support/pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository.ts index 2afcd9ef..194b36bb 100644 --- a/cypress/support/pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository.ts @@ -1,9 +1,9 @@ import { injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesMultiCartRepository } from '../yves-multi-cart-repository'; +import { MultiCartRepository } from '../multi-cart-repository'; @injectable() -export class SuiteYvesMultiCartRepository implements YvesMultiCartRepository { +export class SuiteYvesMultiCartRepository implements MultiCartRepository { getCreateCartNameInput = (): Cypress.Chainable => cy.get('#quoteForm_name'); getCreateCartForm = (): Cypress.Chainable => cy.get('form[name=quoteForm]'); } diff --git a/cypress/support/scenarios/yves/yves-agent-login-scenario.ts b/cypress/support/scenarios/yves/agent-login-scenario.ts similarity index 55% rename from cypress/support/scenarios/yves/yves-agent-login-scenario.ts rename to cypress/support/scenarios/yves/agent-login-scenario.ts index a5fd413b..a1d5189d 100644 --- a/cypress/support/scenarios/yves/yves-agent-login-scenario.ts +++ b/cypress/support/scenarios/yves/agent-login-scenario.ts @@ -1,11 +1,11 @@ import { inject, injectable } from 'inversify'; import { autoWired } from '../../utils/inversify/auto-wired'; -import { YvesAgentLoginPage } from '../../pages/yves/agent-login/yves-agent-login-page'; +import { AgentLoginPage } from '../../pages/yves/agent-login/agent-login-page'; @injectable() @autoWired -export class YvesAgentLoginScenario { - constructor(@inject(YvesAgentLoginPage) private loginPage: YvesAgentLoginPage) {} +export class AgentLoginScenario { + constructor(@inject(AgentLoginPage) private loginPage: AgentLoginPage) {} public execute = (user: User): void => { cy.visit(this.loginPage.PAGE_URL); diff --git a/cypress/support/scenarios/yves/yves-customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts similarity index 60% rename from cypress/support/scenarios/yves/yves-customer-login-scenario.ts rename to cypress/support/scenarios/yves/customer-login-scenario.ts index e502f897..9afec337 100644 --- a/cypress/support/scenarios/yves/yves-customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -1,11 +1,11 @@ import { inject, injectable } from 'inversify'; -import { YvesLoginPage } from '../../pages/yves'; +import { LoginPage } from '../../pages/yves'; import { autoWired } from '../../utils/inversify/auto-wired'; @injectable() @autoWired -export class YvesCustomerLoginScenario { - constructor(@inject(YvesLoginPage) private loginPage: YvesLoginPage) {} +export class CustomerLoginScenario { + constructor(@inject(LoginPage) private loginPage: LoginPage) {} public execute = (email: string, password: string): void => { this.loginPage.login(email, password); diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index fe7c5936..58a7d744 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -1,3 +1,3 @@ -export * from './yves-customer-login-scenario'; -export * from './yves-agent-login-scenario'; +export * from './customer-login-scenario'; +export * from './agent-login-scenario'; diff --git a/cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts b/cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts index 1a85bb34..452ace0c 100644 --- a/cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts +++ b/cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts @@ -1,24 +1,25 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { YvesCartPage } from '../../pages/yves/cart/yves-cart-page'; -import { YvesCheckoutCustomerPage } from '../../pages/yves/checkout/customer/yves-checkout-customer-page'; -import { YvesCheckoutAddressPage } from '../../pages/yves/checkout/address/yves-checkout-address-page'; -import { YvesCheckoutShipmentPage } from '../../pages/yves/checkout/shipment/yves-checkout-shipment-page'; -import { YvesCheckoutPaymentPage } from '../../pages/yves/checkout/payment/yves-checkout-payment-page'; -import { YvesCheckoutSummaryPage } from '../../pages/yves/checkout/summary/yves-checkout-summary-page'; +import { CartPage } from '../../pages/yves/cart/cart-page'; +import { CheckoutCustomerPage } from '../../pages/yves/checkout/customer/checkout-customer-page'; +import { CheckoutAddressPage } from '../../pages/yves/checkout/address/checkout-address-page'; +import { CheckoutShipmentPage } from '../../pages/yves/checkout/shipment/checkout-shipment-page'; +import { CheckoutPaymentPage } from '../../pages/yves/checkout/payment/checkout-payment-page'; +import { CheckoutSummaryPage } from '../../pages/yves/checkout/summary/checkout-summary-page'; import { autoWired } from '../../utils/inversify/auto-wired'; import { CliHelper } from '../../helpers/cli-helper'; +import {Guest} from "../../types/refactor_this_file_and_drop_it"; @injectable() @autoWired export class PlaceGuestMpOrderScenario { constructor( - @inject(YvesCartPage) private cartPage: YvesCartPage, - @inject(YvesCheckoutCustomerPage) private checkoutCustomerPage: YvesCheckoutCustomerPage, - @inject(YvesCheckoutAddressPage) private checkoutAddressPage: YvesCheckoutAddressPage, - @inject(YvesCheckoutShipmentPage) private checkoutShipmentPage: YvesCheckoutShipmentPage, - @inject(YvesCheckoutPaymentPage) private checkoutPaymentPage: YvesCheckoutPaymentPage, - @inject(YvesCheckoutSummaryPage) private checkoutSummaryPage: YvesCheckoutSummaryPage, + @inject(CartPage) private cartPage: CartPage, + @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage, + @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage, + @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage, + @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage, + @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage, @inject(CliHelper) private cliHelper: CliHelper ) {} diff --git a/cypress/support/types/mp/merchant-agent-assist/index.ts b/cypress/support/types/mp/merchant-agent-assist/index.ts new file mode 100644 index 00000000..1ea44b9b --- /dev/null +++ b/cypress/support/types/mp/merchant-agent-assist/index.ts @@ -0,0 +1 @@ +export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts b/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts new file mode 100644 index 00000000..56d052a8 --- /dev/null +++ b/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts @@ -0,0 +1,7 @@ +export interface CheckoutByLoggedInCustomerStaticFixtures { + customer: Customer; +} + +interface Customer { + password: string; +} diff --git a/cypress/support/types/refactor_this_file_and_drop_it.ts b/cypress/support/types/refactor_this_file_and_drop_it.ts index 51ec36c8..d645f965 100644 --- a/cypress/support/types/refactor_this_file_and_drop_it.ts +++ b/cypress/support/types/refactor_this_file_and_drop_it.ts @@ -40,3 +40,8 @@ export interface User { username: string; password: string; } +export interface Guest { + firstName: string; + lastName: string; + email: string; +} diff --git a/cypress/support/types/yves/checkout/static-fixture-types.ts b/cypress/support/types/yves/checkout/static-fixture-types.ts index bca37869..56d052a8 100644 --- a/cypress/support/types/yves/checkout/static-fixture-types.ts +++ b/cypress/support/types/yves/checkout/static-fixture-types.ts @@ -1,5 +1,3 @@ -import {CheckoutByLoggedInCustomerDynamicFixtures} from "./dynamic-fixture-types"; - export interface CheckoutByLoggedInCustomerStaticFixtures { customer: Customer; } From f4032017387cf135c6f171b35d06ba4cc4e804d0 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Thu, 22 Feb 2024 17:13:00 +0100 Subject: [PATCH 05/53] CC-32479: added composer and docker files. --- Dockerfile | 14 ++++++++++++++ composer.json | 7 +++++++ docker-compose.yml | 22 ++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100644 composer.json create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..19876fe2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Use the Cypress base image which comes preinstalled with all dependencies +FROM cypress/included:latest + +# Set the working directory +WORKDIR /app + +# Copy package.json and package-lock.json (if available) +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of your app's source code from your host to your image filesystem. +COPY . . diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..2570a111 --- /dev/null +++ b/composer.json @@ -0,0 +1,7 @@ +{ + "name": "spryker/cypress-tests", + "description": "This repository is dedicated to housing an extensive collection of UI end-to-end tests, meticulously crafted using Cypress for Spryker applications. These tests are designed to thoroughly evaluate the user interface, ensuring that all interactions and visual elements function as intended in real-world scenarios. By leveraging Cypress's advanced browser automation capabilities, this suite provides an efficient and effective means of validating the user experience, confirming the seamless operation and aesthetic integrity of Spryker's front-end components. Our commitment to rigorous UI testing helps maintain the high standard of quality and reliability that Spryker users expect.", + "type": "library", + "license": "MIT", + "require": {} +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..31d92991 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' +services: + cypress: + extra_hosts: + - "yves.de.spryker.local:192.168.107.31" + - "mail.spryker.local:192.168.107.31" + - "backoffice.de.spryker.local:192.168.107.31" + - "glue-backend.de.spryker.local:192.168.107.31" + - "mp.de.spryker.local:192.168.107.31" + build: . + volumes: + - .:/app + - /app/node_modules + environment: + - ENV_REPOSITORY_ID=suite + - ENV_BACKOFFICE_URL=http://backoffice.de.spryker.local + - ENV_MERCHANT_PORTAL_URL=http://mp.de.spryker.local + - ENV_MAIL_CATCHER_URL=http://mail.spryker.local + - OPERATION_RUNNER_URL=http://glue-backend.de.spryker.local/test-operation-runner + - E2E_BASE_URL=http://yves.de.spryker.local + - VIEWPORT_WIDGTH=1920 + - VIEWPORT_HEIGHT=1080 From 83bb66e0d7ec0e1b898224609f8308edd2a00545 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Thu, 22 Feb 2024 19:20:48 +0100 Subject: [PATCH 06/53] CC-32479: added composer and docker files. --- Dockerfile | 14 -------------- docker-compose.yml | 22 ---------------------- 2 files changed, 36 deletions(-) delete mode 100644 Dockerfile delete mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 19876fe2..00000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -# Use the Cypress base image which comes preinstalled with all dependencies -FROM cypress/included:latest - -# Set the working directory -WORKDIR /app - -# Copy package.json and package-lock.json (if available) -COPY package*.json ./ - -# Install dependencies -RUN npm install - -# Copy the rest of your app's source code from your host to your image filesystem. -COPY . . diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 31d92991..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' -services: - cypress: - extra_hosts: - - "yves.de.spryker.local:192.168.107.31" - - "mail.spryker.local:192.168.107.31" - - "backoffice.de.spryker.local:192.168.107.31" - - "glue-backend.de.spryker.local:192.168.107.31" - - "mp.de.spryker.local:192.168.107.31" - build: . - volumes: - - .:/app - - /app/node_modules - environment: - - ENV_REPOSITORY_ID=suite - - ENV_BACKOFFICE_URL=http://backoffice.de.spryker.local - - ENV_MERCHANT_PORTAL_URL=http://mp.de.spryker.local - - ENV_MAIL_CATCHER_URL=http://mail.spryker.local - - OPERATION_RUNNER_URL=http://glue-backend.de.spryker.local/test-operation-runner - - E2E_BASE_URL=http://yves.de.spryker.local - - VIEWPORT_WIDGTH=1920 - - VIEWPORT_HEIGHT=1080 From 8d4ce8450dc143b874ebaf4cdc41b8cf1da98ba5 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Thu, 22 Feb 2024 21:30:56 +0100 Subject: [PATCH 07/53] CC-32479: Removed the cypress from dependencies. --- package-lock.json | 235 +++++++++++++++++++++++++++++++++++++--------- package.json | 1 - 2 files changed, 192 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index a89e0f41..115ddbb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "@types/dotenv": "^8.2.0", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", - "cypress": "^13.6.3", "eslint": "^8.55.0", "inversify": "^6.0.2", "prettier": "3.1.0", @@ -570,6 +569,7 @@ "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, "optional": true, + "peer": true, "engines": { "node": ">=0.1.90" } @@ -593,6 +593,7 @@ "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, + "peer": true, "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -622,6 +623,7 @@ "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", "dev": true, + "peer": true, "dependencies": { "debug": "^3.1.0", "lodash.once": "^4.1.1" @@ -632,6 +634,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -851,6 +854,7 @@ "integrity": "sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg==", "dev": true, "optional": true, + "peer": true, "dependencies": { "undici-types": "~5.26.4" } @@ -865,13 +869,15 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/sizzle": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/yauzl": { "version": "2.10.3", @@ -879,6 +885,7 @@ "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "dev": true, "optional": true, + "peer": true, "dependencies": { "@types/node": "*" } @@ -1113,6 +1120,7 @@ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, + "peer": true, "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -1142,6 +1150,7 @@ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -1151,6 +1160,7 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "peer": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -1203,7 +1213,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/argparse": { "version": "2.0.1", @@ -1225,6 +1236,7 @@ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, + "peer": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -1234,6 +1246,7 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, + "peer": true, "engines": { "node": ">=0.8" } @@ -1243,6 +1256,7 @@ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -1251,19 +1265,22 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "dev": true, + "peer": true }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, + "peer": true, "engines": { "node": ">= 4.0.0" } @@ -1273,6 +1290,7 @@ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true, + "peer": true, "engines": { "node": "*" } @@ -1281,7 +1299,8 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/balanced-match": { "version": "1.0.2", @@ -1307,13 +1326,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, + "peer": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -1322,13 +1343,15 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -1404,6 +1427,7 @@ "url": "https://feross.org/support" } ], + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -1414,6 +1438,7 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, + "peer": true, "engines": { "node": "*" } @@ -1423,6 +1448,7 @@ "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -1432,6 +1458,7 @@ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dev": true, + "peer": true, "dependencies": { "function-bind": "^1.1.2", "get-intrinsic": "^1.2.1", @@ -1475,7 +1502,8 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/chalk": { "version": "4.1.2", @@ -1510,6 +1538,7 @@ "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", "dev": true, + "peer": true, "engines": { "node": ">= 0.8.0" } @@ -1525,6 +1554,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "peer": true, "engines": { "node": ">=8" } @@ -1534,6 +1564,7 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -1543,6 +1574,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, + "peer": true, "dependencies": { "restore-cursor": "^3.1.0" }, @@ -1555,6 +1587,7 @@ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, + "peer": true, "dependencies": { "string-width": "^4.2.0" }, @@ -1570,6 +1603,7 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, + "peer": true, "dependencies": { "slice-ansi": "^3.0.0", "string-width": "^4.2.0" @@ -1603,13 +1637,15 @@ "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true + "dev": true, + "peer": true }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "peer": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -1622,6 +1658,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, + "peer": true, "engines": { "node": ">= 6" } @@ -1631,6 +1668,7 @@ "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", "dev": true, + "peer": true, "engines": { "node": ">=4.0.0" } @@ -1652,7 +1690,8 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/cross-spawn": { "version": "7.0.3", @@ -1674,6 +1713,7 @@ "integrity": "sha512-d/pZvgwjAyZsoyJ3FOsJT5lDsqnxQ/clMqnNc++rkHjbkkiF2h9s0JsZSyyH4QXhVFW3zPFg82jD25roFLOdZA==", "dev": true, "hasInstallScript": true, + "peer": true, "dependencies": { "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", @@ -1730,6 +1770,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, + "peer": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -1741,7 +1782,8 @@ "version": "1.11.10", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/debug": { "version": "4.3.4", @@ -1771,6 +1813,7 @@ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", "dev": true, + "peer": true, "dependencies": { "get-intrinsic": "^1.2.1", "gopd": "^1.0.1", @@ -1785,6 +1828,7 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, + "peer": true, "engines": { "node": ">=0.4.0" } @@ -1830,6 +1874,7 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, + "peer": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -1846,13 +1891,15 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "peer": true }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, + "peer": true, "dependencies": { "once": "^1.4.0" } @@ -1862,6 +1909,7 @@ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, + "peer": true, "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -1885,6 +1933,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "peer": true, "engines": { "node": ">=0.8.0" } @@ -2047,13 +2096,15 @@ "version": "6.4.7", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/execa": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, + "peer": true, "dependencies": { "cross-spawn": "^7.0.0", "get-stream": "^5.0.0", @@ -2077,6 +2128,7 @@ "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", "dev": true, + "peer": true, "dependencies": { "pify": "^2.2.0" }, @@ -2088,13 +2140,15 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, + "peer": true, "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -2117,7 +2171,8 @@ "dev": true, "engines": [ "node >=0.6.0" - ] + ], + "peer": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -2179,6 +2234,7 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, + "peer": true, "dependencies": { "pend": "~1.2.0" } @@ -2188,6 +2244,7 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, + "peer": true, "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -2282,6 +2339,7 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, + "peer": true, "engines": { "node": "*" } @@ -2291,6 +2349,7 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, + "peer": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -2305,6 +2364,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "peer": true, "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -2326,6 +2386,7 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2345,6 +2406,7 @@ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dev": true, + "peer": true, "dependencies": { "function-bind": "^1.1.2", "has-proto": "^1.0.1", @@ -2360,6 +2422,7 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, + "peer": true, "dependencies": { "pump": "^3.0.0" }, @@ -2375,6 +2438,7 @@ "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", "dev": true, + "peer": true, "dependencies": { "async": "^3.2.0" } @@ -2384,6 +2448,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, + "peer": true, "dependencies": { "assert-plus": "^1.0.0" } @@ -2425,6 +2490,7 @@ "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, + "peer": true, "dependencies": { "ini": "2.0.0" }, @@ -2487,6 +2553,7 @@ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, + "peer": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -2498,7 +2565,8 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/graphemer": { "version": "1.4.0", @@ -2520,6 +2588,7 @@ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", "dev": true, + "peer": true, "dependencies": { "get-intrinsic": "^1.2.2" }, @@ -2532,6 +2601,7 @@ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", "dev": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -2544,6 +2614,7 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -2556,6 +2627,7 @@ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", "dev": true, + "peer": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -2568,6 +2640,7 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", "dev": true, + "peer": true, "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^2.0.2", @@ -2582,6 +2655,7 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true, + "peer": true, "engines": { "node": ">=8.12.0" } @@ -2604,7 +2678,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/ignore": { "version": "5.3.0", @@ -2645,6 +2720,7 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -2670,6 +2746,7 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, + "peer": true, "engines": { "node": ">=10" } @@ -2685,6 +2762,7 @@ "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, + "peer": true, "dependencies": { "ci-info": "^3.2.0" }, @@ -2706,6 +2784,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -2727,6 +2806,7 @@ "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, + "peer": true, "dependencies": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -2761,6 +2841,7 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, + "peer": true, "engines": { "node": ">=8" }, @@ -2772,13 +2853,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "peer": true, "engines": { "node": ">=10" }, @@ -2796,7 +2879,8 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/js-tokens": { "version": "4.0.0", @@ -2821,7 +2905,8 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/jsesc": { "version": "2.5.2", @@ -2846,7 +2931,8 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", @@ -2864,7 +2950,8 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/json5": { "version": "2.2.3", @@ -2884,6 +2971,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, + "peer": true, "dependencies": { "universalify": "^2.0.0" }, @@ -2899,6 +2987,7 @@ "engines": [ "node >=0.6.0" ], + "peer": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -2920,6 +3009,7 @@ "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", "dev": true, + "peer": true, "engines": { "node": "> 0.8" } @@ -2942,6 +3032,7 @@ "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", "dev": true, + "peer": true, "dependencies": { "cli-truncate": "^2.1.0", "colorette": "^2.0.16", @@ -2983,7 +3074,8 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -2995,13 +3087,15 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, + "peer": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -3018,6 +3112,7 @@ "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", "dev": true, + "peer": true, "dependencies": { "ansi-escapes": "^4.3.0", "cli-cursor": "^3.1.0", @@ -3036,6 +3131,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -3053,6 +3149,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -3078,7 +3175,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "dev": true, + "peer": true }, "node_modules/merge2": { "version": "1.4.1", @@ -3107,6 +3205,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "peer": true, "engines": { "node": ">= 0.6" } @@ -3116,6 +3215,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "peer": true, "dependencies": { "mime-db": "1.52.0" }, @@ -3128,6 +3228,7 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -3149,6 +3250,7 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3177,6 +3279,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, + "peer": true, "dependencies": { "path-key": "^3.0.0" }, @@ -3189,6 +3292,7 @@ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3207,6 +3311,7 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, + "peer": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -3238,7 +3343,8 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/p-limit": { "version": "3.1.0", @@ -3275,6 +3381,7 @@ "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, + "peer": true, "dependencies": { "aggregate-error": "^3.0.0" }, @@ -3337,13 +3444,15 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true + "dev": true, + "peer": true }, "node_modules/picocolors": { "version": "1.0.0", @@ -3369,6 +3478,7 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -3402,6 +3512,7 @@ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, + "peer": true, "engines": { "node": ">=6" }, @@ -3414,6 +3525,7 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "dev": true, + "peer": true, "engines": { "node": ">= 0.6.0" } @@ -3422,19 +3534,22 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true + "dev": true, + "peer": true }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "dev": true, + "peer": true }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, + "peer": true, "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -3454,6 +3569,7 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", "dev": true, + "peer": true, "dependencies": { "side-channel": "^1.0.4" }, @@ -3468,7 +3584,8 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -3501,6 +3618,7 @@ "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", "dev": true, + "peer": true, "dependencies": { "throttleit": "^1.0.0" } @@ -3509,7 +3627,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/resolve-from": { "version": "4.0.0", @@ -3525,6 +3644,7 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, + "peer": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -3547,7 +3667,8 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/rimraf": { "version": "3.0.2", @@ -3592,6 +3713,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -3614,13 +3736,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/semver": { "version": "7.5.4", @@ -3642,6 +3766,7 @@ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", "dev": true, + "peer": true, "dependencies": { "define-data-property": "^1.1.1", "get-intrinsic": "^1.2.1", @@ -3678,6 +3803,7 @@ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, + "peer": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -3691,7 +3817,8 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/simple-bin-help": { "version": "1.8.0", @@ -3716,6 +3843,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -3730,6 +3858,7 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, + "peer": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -3755,6 +3884,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3781,6 +3911,7 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -3802,6 +3933,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -3823,6 +3955,7 @@ "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/sindresorhus" } @@ -3831,13 +3964,15 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, + "peer": true, "dependencies": { "rimraf": "^3.0.0" }, @@ -3872,6 +4007,7 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, + "peer": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -3887,6 +4023,7 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, + "peer": true, "engines": { "node": ">= 4.0.0" } @@ -3907,13 +4044,15 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "dev": true, + "peer": true }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, + "peer": true, "dependencies": { "safe-buffer": "^5.0.1" }, @@ -3925,7 +4064,8 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/type-check": { "version": "0.4.0", @@ -3944,6 +4084,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, + "peer": true, "engines": { "node": ">=10" }, @@ -3969,13 +4110,15 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true, - "optional": true + "optional": true, + "peer": true }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "peer": true, "engines": { "node": ">= 10.0.0" } @@ -3985,6 +4128,7 @@ "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -4034,6 +4178,7 @@ "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "dev": true, + "peer": true, "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -4044,6 +4189,7 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, + "peer": true, "bin": { "uuid": "dist/bin/uuid" } @@ -4056,6 +4202,7 @@ "engines": [ "node >=0.6.0" ], + "peer": true, "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -4082,6 +4229,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4111,6 +4259,7 @@ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, + "peer": true, "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" diff --git a/package.json b/package.json index 784d41a8..839128e7 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "@types/dotenv": "^8.2.0", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", - "cypress": "^13.6.3", "eslint": "^8.55.0", "inversify": "^6.0.2", "prettier": "3.1.0", From 7a888667046443db0cbe2ff559f0f120af68e9ef Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Thu, 22 Feb 2024 22:14:59 +0100 Subject: [PATCH 08/53] CC-32479: Added the cypress. --- package-lock.json | 827 +++++++++++++++++++++++----------------------- package.json | 1 + 2 files changed, 415 insertions(+), 413 deletions(-) diff --git a/package-lock.json b/package-lock.json index 115ddbb4..c1c6888b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@types/dotenv": "^8.2.0", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", + "cypress": "^13.6.3", "eslint": "^8.55.0", "inversify": "^6.0.2", "prettier": "3.1.0", @@ -107,6 +108,16 @@ "dev": true, "peer": true }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@babel/code-frame/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -214,16 +225,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "peer": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -234,13 +235,6 @@ "semver": "bin/semver.js" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "peer": true - }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", @@ -451,6 +445,16 @@ "dev": true, "peer": true }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -569,7 +573,6 @@ "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, "optional": true, - "peer": true, "engines": { "node": ">=0.1.90" } @@ -593,7 +596,6 @@ "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, - "peer": true, "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -623,7 +625,6 @@ "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", "dev": true, - "peer": true, "dependencies": { "debug": "^3.1.0", "lodash.once": "^4.1.1" @@ -634,7 +635,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, - "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -686,19 +686,41 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/js": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", - "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@faker-js/faker": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.3.1.tgz", - "integrity": "sha512-FdgpFxY6V6rLZE9mmIBb9hM0xpfvQOSNOLnzolzKwsE1DH+gC7lEKV1p1IbR0lAYyvYd5a4u3qWJzowUkw1bIw==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.1.tgz", + "integrity": "sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==", "dev": true, "funding": [ { @@ -712,19 +734,41 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -739,9 +783,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@jridgewell/gen-mapping": { @@ -760,9 +804,9 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "peer": true, "engines": { @@ -849,35 +893,32 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.3.tgz", - "integrity": "sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg==", + "version": "20.11.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", + "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", "dev": true, "optional": true, - "peer": true, "dependencies": { "undici-types": "~5.26.4" } }, "node_modules/@types/semver": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", - "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.7.tgz", + "integrity": "sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg==", "dev": true }, "node_modules/@types/sinonjs__fake-timers": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@types/sizzle": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@types/yauzl": { "version": "2.10.3", @@ -885,22 +926,21 @@ "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "dev": true, "optional": true, - "peer": true, "dependencies": { "@types/node": "*" } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.1.tgz", - "integrity": "sha512-5bQDGkXaxD46bPvQt08BUz9YSaO4S0fB1LB5JHQuXTfkGPI3+UUeS387C/e9jRie5GqT8u5kFTrMvAjtX4O5kA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.13.1", - "@typescript-eslint/type-utils": "6.13.1", - "@typescript-eslint/utils": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -926,15 +966,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.1.tgz", - "integrity": "sha512-fs2XOhWCzRhqMmQf0eicLa/CWSaYss2feXsy7xBD/pLyWke/jCIVc2s1ikEAtSW7ina1HNhv7kONoEfVNEcdDQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.13.1", - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/typescript-estree": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4" }, "engines": { @@ -954,13 +994,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.1.tgz", - "integrity": "sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1" + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -971,13 +1011,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.13.1.tgz", - "integrity": "sha512-A2qPlgpxx2v//3meMqQyB1qqTg1h1dJvzca7TugM3Yc2USDY+fsRBiojAEo92HO7f5hW5mjAUF6qobOPzlBCBQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.13.1", - "@typescript-eslint/utils": "6.13.1", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -998,9 +1038,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.1.tgz", - "integrity": "sha512-gjeEskSmiEKKFIbnhDXUyiqVma1gRCQNbVZ1C8q7Zjcxh3WZMbzWVfGE9rHfWd1msQtPS0BVD9Jz9jded44eKg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1011,16 +1051,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.1.tgz", - "integrity": "sha512-sBLQsvOC0Q7LGcUHO5qpG1HxRgePbT6wwqOiGLpR8uOJvPJbfs0mW3jPA3ujsDvfiVwVlWUDESNXv44KtINkUQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", + "minimatch": "9.0.3", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, @@ -1038,17 +1079,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz", - "integrity": "sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.13.1", - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", "semver": "^7.5.4" }, "engines": { @@ -1063,12 +1104,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz", - "integrity": "sha512-NDhQUy2tg6XGNBGDRm1XybOHSia8mcXmlbKWoQP+nm1BIIMxa55shyJfZkHpEBN62KNPLrocSM2PdPcaLgDKMQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1086,9 +1127,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1120,7 +1161,6 @@ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, - "peer": true, "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -1150,7 +1190,6 @@ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -1160,7 +1199,6 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, - "peer": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -1171,6 +1209,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1213,8 +1263,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "peer": true + ] }, "node_modules/argparse": { "version": "2.0.1", @@ -1236,7 +1285,6 @@ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, - "peer": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -1246,7 +1294,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, - "peer": true, "engines": { "node": ">=0.8" } @@ -1256,7 +1303,6 @@ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -1265,22 +1311,19 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, - "peer": true, "engines": { "node": ">= 4.0.0" } @@ -1290,7 +1333,6 @@ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true, - "peer": true, "engines": { "node": "*" } @@ -1299,8 +1341,7 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/balanced-match": { "version": "1.0.2", @@ -1326,15 +1367,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "peer": true + ] }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, - "peer": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -1343,24 +1382,21 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -1376,9 +1412,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, "funding": [ { @@ -1396,8 +1432,8 @@ ], "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -1427,7 +1463,6 @@ "url": "https://feross.org/support" } ], - "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -1438,7 +1473,6 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, - "peer": true, "engines": { "node": "*" } @@ -1448,21 +1482,24 @@ "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", "dev": true, - "peer": true, "engines": { "node": ">=6" } }, "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, - "peer": true, "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1478,9 +1515,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001581", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz", - "integrity": "sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==", + "version": "1.0.30001589", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz", + "integrity": "sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg==", "dev": true, "funding": [ { @@ -1502,8 +1539,7 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/chalk": { "version": "4.1.2", @@ -1538,7 +1574,6 @@ "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", "dev": true, - "peer": true, "engines": { "node": ">= 0.8.0" } @@ -1554,7 +1589,6 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], - "peer": true, "engines": { "node": ">=8" } @@ -1564,7 +1598,6 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -1574,7 +1607,6 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, - "peer": true, "dependencies": { "restore-cursor": "^3.1.0" }, @@ -1587,7 +1619,6 @@ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, - "peer": true, "dependencies": { "string-width": "^4.2.0" }, @@ -1603,7 +1634,6 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, - "peer": true, "dependencies": { "slice-ansi": "^3.0.0", "string-width": "^4.2.0" @@ -1637,15 +1667,13 @@ "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true, - "peer": true + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "peer": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -1658,7 +1686,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, - "peer": true, "engines": { "node": ">= 6" } @@ -1668,7 +1695,6 @@ "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", "dev": true, - "peer": true, "engines": { "node": ">=4.0.0" } @@ -1690,8 +1716,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/cross-spawn": { "version": "7.0.3", @@ -1708,12 +1733,11 @@ } }, "node_modules/cypress": { - "version": "13.6.3", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.3.tgz", - "integrity": "sha512-d/pZvgwjAyZsoyJ3FOsJT5lDsqnxQ/clMqnNc++rkHjbkkiF2h9s0JsZSyyH4QXhVFW3zPFg82jD25roFLOdZA==", + "version": "13.6.5", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.5.tgz", + "integrity": "sha512-2NxSDcO2zHw5kTcosc6dzv2zppEqiXrFFhZw5cx/EWrSNZABTzpr/EyvYzGgrWm46o5173JUfuJfDQcaiZZPVQ==", "dev": true, "hasInstallScript": true, - "peer": true, "dependencies": { "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", @@ -1722,7 +1746,7 @@ "arch": "^2.2.0", "blob-util": "^2.0.2", "bluebird": "^3.7.2", - "buffer": "^5.6.0", + "buffer": "^5.7.1", "cachedir": "^2.3.0", "chalk": "^4.1.0", "check-more-types": "^2.24.0", @@ -1740,7 +1764,7 @@ "figures": "^3.2.0", "fs-extra": "^9.1.0", "getos": "^3.2.1", - "is-ci": "^3.0.0", + "is-ci": "^3.0.1", "is-installed-globally": "~0.4.0", "lazy-ass": "^1.6.0", "listr2": "^3.8.3", @@ -1770,7 +1794,6 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, - "peer": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -1782,8 +1805,7 @@ "version": "1.11.10", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/debug": { "version": "4.3.4", @@ -1809,18 +1831,20 @@ "dev": true }, "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, - "peer": true, "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/delayed-stream": { @@ -1828,7 +1852,6 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "peer": true, "engines": { "node": ">=0.4.0" } @@ -1858,15 +1881,15 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "dev": true, "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/ecc-jsbn": { @@ -1874,16 +1897,15 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, - "peer": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" } }, "node_modules/electron-to-chromium": { - "version": "1.4.649", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.649.tgz", - "integrity": "sha512-dq/owIaALxZGqWm5RXpKQ4baX6aDC19e2Z16c8SXYN+I71PyEKjbVqQUgm7kcuk8CRqljTKXbolo0XXDjxnh2w==", + "version": "1.4.680", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.680.tgz", + "integrity": "sha512-4nToZ5jlPO14W82NkF32wyjhYqQByVaDmLy4J2/tYcAbJfgO2TKJC780Az1V13gzq4l73CJ0yuyalpXvxXXD9A==", "dev": true, "peer": true }, @@ -1891,15 +1913,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "peer": true + "dev": true }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, - "peer": true, "dependencies": { "once": "^1.4.0" } @@ -1909,7 +1929,6 @@ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, - "peer": true, "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -1918,10 +1937,31 @@ "node": ">=8.6" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "peer": true, "engines": { @@ -1929,25 +1969,27 @@ } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "peer": true, "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", - "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.55.0", + "@eslint/js": "8.56.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -2021,16 +2063,26 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "*" } }, "node_modules/espree": { @@ -2096,15 +2148,13 @@ "version": "6.4.7", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/execa": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, - "peer": true, "dependencies": { "cross-spawn": "^7.0.0", "get-stream": "^5.0.0", @@ -2128,7 +2178,6 @@ "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", "dev": true, - "peer": true, "dependencies": { "pify": "^2.2.0" }, @@ -2140,15 +2189,13 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true, - "peer": true + "dev": true }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, - "peer": true, "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -2171,8 +2218,7 @@ "dev": true, "engines": [ "node >=0.6.0" - ], - "peer": true + ] }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -2221,9 +2267,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -2234,7 +2280,6 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, - "peer": true, "dependencies": { "pend": "~1.2.0" } @@ -2244,7 +2289,6 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, - "peer": true, "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -2255,6 +2299,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2329,9 +2382,9 @@ } }, "node_modules/flatted": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", - "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, "node_modules/forever-agent": { @@ -2339,7 +2392,6 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, - "peer": true, "engines": { "node": "*" } @@ -2349,7 +2401,6 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, - "peer": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -2364,7 +2415,6 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, - "peer": true, "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -2386,7 +2436,6 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2402,17 +2451,20 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, - "peer": true, "dependencies": { + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2422,7 +2474,6 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, - "peer": true, "dependencies": { "pump": "^3.0.0" }, @@ -2438,7 +2489,6 @@ "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", "dev": true, - "peer": true, "dependencies": { "async": "^3.2.0" } @@ -2448,7 +2498,6 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, - "peer": true, "dependencies": { "assert-plus": "^1.0.0" } @@ -2485,12 +2534,33 @@ "node": ">=10.13.0" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/global-dirs": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, - "peer": true, "dependencies": { "ini": "2.0.0" }, @@ -2502,9 +2572,9 @@ } }, "node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2516,18 +2586,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globals/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -2553,7 +2611,6 @@ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, - "peer": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -2565,8 +2622,7 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/graphemer": { "version": "1.4.0", @@ -2584,24 +2640,22 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, - "peer": true, "dependencies": { - "get-intrinsic": "^1.2.2" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -2614,7 +2668,6 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -2623,11 +2676,10 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", "dev": true, - "peer": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -2640,7 +2692,6 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", "dev": true, - "peer": true, "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^2.0.2", @@ -2655,7 +2706,6 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true, - "peer": true, "engines": { "node": ">=8.12.0" } @@ -2678,13 +2728,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "peer": true + ] }, "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -2720,7 +2769,6 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -2746,7 +2794,6 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, - "peer": true, "engines": { "node": ">=10" } @@ -2762,7 +2809,6 @@ "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, - "peer": true, "dependencies": { "ci-info": "^3.2.0" }, @@ -2784,7 +2830,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -2806,7 +2851,6 @@ "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, - "peer": true, "dependencies": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -2841,7 +2885,6 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "peer": true, "engines": { "node": ">=8" }, @@ -2853,15 +2896,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -2879,8 +2920,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true, - "peer": true + "dev": true }, "node_modules/js-tokens": { "version": "4.0.0", @@ -2905,8 +2945,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/jsesc": { "version": "2.5.2", @@ -2931,8 +2970,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", @@ -2950,8 +2988,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/json5": { "version": "2.2.3", @@ -2971,7 +3008,6 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, - "peer": true, "dependencies": { "universalify": "^2.0.0" }, @@ -2987,7 +3023,6 @@ "engines": [ "node >=0.6.0" ], - "peer": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -3009,7 +3044,6 @@ "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", "dev": true, - "peer": true, "engines": { "node": "> 0.8" } @@ -3032,7 +3066,6 @@ "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", "dev": true, - "peer": true, "dependencies": { "cli-truncate": "^2.1.0", "colorette": "^2.0.16", @@ -3074,8 +3107,7 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -3087,15 +3119,13 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, - "peer": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -3112,7 +3142,6 @@ "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", "dev": true, - "peer": true, "dependencies": { "ansi-escapes": "^4.3.0", "cli-cursor": "^3.1.0", @@ -3131,7 +3160,6 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -3149,7 +3177,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -3160,23 +3187,20 @@ } }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, + "peer": true, "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" + "yallist": "^3.0.2" } }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, - "peer": true + "dev": true }, "node_modules/merge2": { "version": "1.4.1", @@ -3205,7 +3229,6 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, - "peer": true, "engines": { "node": ">= 0.6" } @@ -3215,7 +3238,6 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, - "peer": true, "dependencies": { "mime-db": "1.52.0" }, @@ -3228,21 +3250,23 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "peer": true, "engines": { "node": ">=6" } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -3250,7 +3274,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3279,7 +3302,6 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "peer": true, "dependencies": { "path-key": "^3.0.0" }, @@ -3292,7 +3314,6 @@ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3311,7 +3332,6 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "peer": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -3343,8 +3363,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/p-limit": { "version": "3.1.0", @@ -3381,7 +3400,6 @@ "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, - "peer": true, "dependencies": { "aggregate-error": "^3.0.0" }, @@ -3444,15 +3462,13 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true, - "peer": true + "dev": true }, "node_modules/picocolors": { "version": "1.0.0", @@ -3478,7 +3494,6 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3512,7 +3527,6 @@ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, - "peer": true, "engines": { "node": ">=6" }, @@ -3525,7 +3539,6 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "dev": true, - "peer": true, "engines": { "node": ">= 0.6.0" } @@ -3534,22 +3547,19 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true, - "peer": true + "dev": true }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true, - "peer": true + "dev": true }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, - "peer": true, "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -3569,7 +3579,6 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", "dev": true, - "peer": true, "dependencies": { "side-channel": "^1.0.4" }, @@ -3584,8 +3593,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -3608,9 +3616,9 @@ ] }, "node_modules/reflect-metadata": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.0.tgz", - "integrity": "sha512-vUN0wuk3MuhSVMfU/ImnPQAK8QZcXJ339DtVsP3jDscxCe6dT+PsOe3J1BYS9Ec2Fd4oC6ry6bCBebzTya0IYw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.1.tgz", + "integrity": "sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==", "dev": true }, "node_modules/request-progress": { @@ -3618,7 +3626,6 @@ "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", "dev": true, - "peer": true, "dependencies": { "throttleit": "^1.0.0" } @@ -3627,8 +3634,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/resolve-from": { "version": "4.0.0", @@ -3644,7 +3650,6 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, - "peer": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -3664,11 +3669,10 @@ } }, "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true, - "peer": true + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "dev": true }, "node_modules/rimraf": { "version": "3.0.2", @@ -3713,7 +3717,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -3736,20 +3739,18 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "peer": true + ] }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3761,17 +3762,36 @@ "node": ">=10" } }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", "dev": true, - "peer": true, "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -3799,15 +3819,18 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", + "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", "dev": true, - "peer": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3817,8 +3840,7 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/simple-bin-help": { "version": "1.8.0", @@ -3843,7 +3865,6 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -3858,7 +3879,6 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, - "peer": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -3884,7 +3904,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3911,7 +3930,6 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -3933,7 +3951,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -3955,7 +3972,6 @@ "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/sindresorhus" } @@ -3964,15 +3980,13 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, - "peer": true, "dependencies": { "rimraf": "^3.0.0" }, @@ -4007,7 +4021,6 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, - "peer": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -4023,18 +4036,17 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, - "peer": true, "engines": { "node": ">= 4.0.0" } }, "node_modules/ts-api-utils": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", - "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", + "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" @@ -4044,15 +4056,13 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, - "peer": true, "dependencies": { "safe-buffer": "^5.0.1" }, @@ -4064,8 +4074,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/type-check": { "version": "0.4.0", @@ -4080,11 +4089,10 @@ } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -4110,15 +4118,13 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "peer": true, "engines": { "node": ">= 10.0.0" } @@ -4128,7 +4134,6 @@ "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -4178,7 +4183,6 @@ "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "dev": true, - "peer": true, "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -4189,7 +4193,6 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, - "peer": true, "bin": { "uuid": "dist/bin/uuid" } @@ -4202,7 +4205,6 @@ "engines": [ "node >=0.6.0" ], - "peer": true, "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -4229,7 +4231,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4249,17 +4250,17 @@ "dev": true }, "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "peer": true }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, - "peer": true, "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" diff --git a/package.json b/package.json index 839128e7..bc09a93d 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "npm": ">=10.0.0" }, "devDependencies": { + "cypress": "^13.6.3", "@cypress/grep": "^4.0.1", "@faker-js/faker": "^8.3.1", "@types/dotenv": "^8.2.0", From d8fb532795af3b16e87ab2854940bd2219d7be59 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 26 Feb 2024 20:10:51 +0300 Subject: [PATCH 09/53] Refactoring --- .env.example | 2 +- cypress.config.ts | 16 +-- .../agent-permission-in-backoffice.cy.ts | 0 .../customer-agent-login-page.cy.ts | 75 +++++++++++++ .../merchant-user-agent-dashboard.cy.ts | 0 .../merchant-user-agent-login-page.cy.ts | 0 .../merchant-user-header-bar.cy.ts | 0 .../merchant-user-impersonation.cy.ts | 0 .../customer-agent-login-page.cy.ts | 101 ------------------ .../checkout/checkout-by-guest-customer.cy.ts | 48 ++++----- .../checkout-by-logged-in-customer.cy.ts | 46 ++++---- .../cart}/empty-cart-comment.cy.ts | 21 ++-- .../cart}/not-empty-cart-comment.cy.ts | 21 ++-- .../order/create-order-by-customer.cy.ts | 23 ++-- .../order/create-order-by-guest.cy.ts | 23 ++-- .../agent-permission-in-backoffice.json | 0 .../dynamic/merchant-portal-agent-login.json | 84 +++++++++++++++ .../merchant-user-agent-dashboard.json | 0 .../merchant-user-agent-login-page.json | 0 .../dynamic}/merchant-user-header-bar.json | 0 .../dynamic}/merchant-user-impersonation.json | 0 .../static/customer-agent-login-page.json | 18 ++++ .../static/merchant-portal-agent-login.json | 0 .../static/merchant-user-agent-dashboard.json | 10 ++ .../merchant-user-agent-login-page.json | 14 +++ .../static/merchant-user-header-bar.json | 12 +++ .../static/merchant-user-impersonation.json | 14 +++ .../static/customer-agent-login-page.json | 0 .../cart}/dynamic/empty-cart-comment.json | 0 .../cart}/dynamic/not-empty-cart-comment.json | 0 .../cart}/static/empty-cart-comment.json | 0 .../cart}/static/not-empty-cart-comment.json | 0 cypress/support/commands.js | 3 +- .../support/helpers/mail-catcher-helper.ts | 29 ----- cypress/support/index.d.ts | 2 +- cypress/support/pages/abstract-page.ts | 7 +- .../pages/backoffice/backoffice-page.ts | 10 ++ .../backoffice/index/backoffice-index-page.ts | 15 --- .../pages/backoffice/index/index-page.ts | 15 +++ ...ndex-repository.ts => index-repository.ts} | 2 +- .../backoffice/login/backoffice-login-page.ts | 25 ----- .../pages/backoffice/login/login-page.ts | 22 ++++ ...ogin-repository.ts => login-repository.ts} | 4 +- .../backoffice-merchant-user-create-page.ts | 6 +- .../create/backoffice-merchant-create-page.ts | 6 +- .../list/backoffice-merchant-list-page.ts | 6 +- .../update/backoffice-merchant-update-page.ts | 6 +- ...backoffice-sales-return-gui-create-page.ts | 6 +- .../detail/backoffice-sales-detail-page.ts | 6 +- .../index/backoffice-sales-index-page.ts | 6 +- .../create/backoffice-user-create-page.ts | 6 +- .../delete/backoffice-user-delete-page.ts | 6 +- .../user/index/backoffice-user-index-page.ts | 6 +- .../update/backoffice-user-update-page.ts | 6 +- .../mp-agent-dashboard-page.ts | 6 +- .../mp/agent-login/mp-agent-login-page.ts | 12 +-- .../pages/mp/dashboard/mp-dashboard-page.ts | 6 +- .../support/pages/mp/login/mp-login-page.ts | 12 +-- cypress/support/pages/mp/mp-page.ts | 10 ++ .../support/pages/mp/offers/mp-offers-page.ts | 6 +- .../pages/mp/products/mp-products-page.ts | 6 +- .../pages/mp/profile/mp-profile-page.ts | 6 +- .../pages/mp/sales/mp-sales-orders-page.ts | 6 +- .../yves/agent-login/agent-login-page.ts | 13 ++- ...ory.ts => suite-agent-login-repository.ts} | 2 +- cypress/support/pages/yves/cart/cart-page.ts | 10 +- ...t-repository.ts => b2b-cart-repository.ts} | 2 +- ...repository.ts => suite-cart-repository.ts} | 2 +- .../checkout/address/checkout-address-page.ts | 7 +- ...s => suite-checkout-address-repository.ts} | 2 +- .../customer/checkout-customer-page.ts | 8 +- ... => suite-checkout-customer-repository.ts} | 2 +- .../checkout/payment/checkout-payment-page.ts | 6 +- ...s => suite-checkout-payment-repository.ts} | 2 +- .../shipment/checkout-shipment-page.ts | 6 +- ... => suite-checkout-shipment-repository.ts} | 2 +- .../checkout/summary/checkout-summary-page.ts | 6 +- ...s => suite-checkout-summary-repository.ts} | 2 +- .../yves/comment/cart/comment-cart-page.ts | 12 +-- .../comment/cart/comment-cart-repository.ts | 2 - ...tory.ts => b2b-comment-cart-repository.ts} | 2 +- ...ry.ts => suite-comment-cart-repository.ts} | 2 +- .../support/pages/yves/login/login-page.ts | 18 ++-- ...-repository.ts => b2b-login-repository.ts} | 2 +- ...epository.ts => suite-login-repository.ts} | 2 +- .../pages/yves/multi-cart/multi-cart-page.ts | 6 +- ...sitory.ts => b2b-multi-cart-repository.ts} | 2 +- ...tory.ts => suite-multi-cart-repository.ts} | 2 +- cypress/support/pages/yves/yves-page.ts | 10 ++ .../backoffice-login-user-scenario.ts | 14 --- cypress/support/scenarios/backoffice/index.ts | 2 +- .../backoffice/user-login-scenario.ts | 16 +++ cypress/support/scenarios/mp/.gitkeep | 0 .../scenarios/yves/agent-login-scenario.ts | 10 +- .../scenarios/yves/customer-login-scenario.ts | 5 +- .../yves/place-guest-mp-order-scenario.ts | 45 -------- .../static-fixture-types.ts | 10 +- .../cart}/common/product.ts | 0 .../comment => comments/cart}/common/quote.ts | 0 .../cart}/dynamic-fixture-types.ts | 3 +- .../{cart/comment => comments/cart}/index.ts | 0 .../cart}/static-fixture-types.ts | 2 +- .../utils/inversify/inversify.config.ts | 56 +++++----- package-lock.json | 12 +-- package.json | 21 ++-- readme.md | 37 ++----- 106 files changed, 592 insertions(+), 571 deletions(-) rename cypress/e2e/backoffice/order-management/{merchant-agent-assist => marketplace-agent-assist}/agent-permission-in-backoffice.cy.ts (100%) create mode 100644 cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts rename cypress/e2e/mp/{merchant-agent-assist => marketplace-agent-assist}/merchant-user-agent-dashboard.cy.ts (100%) rename cypress/e2e/mp/{merchant-agent-assist => marketplace-agent-assist}/merchant-user-agent-login-page.cy.ts (100%) rename cypress/e2e/mp/{merchant-agent-assist => marketplace-agent-assist}/merchant-user-header-bar.cy.ts (100%) rename cypress/e2e/mp/{merchant-agent-assist => marketplace-agent-assist}/merchant-user-impersonation.cy.ts (100%) delete mode 100644 cypress/e2e/mp/merchant-agent-assist/customer-agent-login-page.cy.ts rename cypress/e2e/yves/{cart/comment => comments/cart}/empty-cart-comment.cy.ts (63%) rename cypress/e2e/yves/{cart/comment => comments/cart}/not-empty-cart-comment.cy.ts (64%) rename cypress/fixtures/suite/backoffice/order-management/{merchant-agent-assist => marketplace-agent-assist}/static/agent-permission-in-backoffice.json (100%) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json rename cypress/fixtures/suite/mp/{merchant-agent-assist/static => marketplace-agent-assist/dynamic}/merchant-user-agent-dashboard.json (100%) rename cypress/fixtures/suite/mp/{merchant-agent-assist/static => marketplace-agent-assist/dynamic}/merchant-user-agent-login-page.json (100%) rename cypress/fixtures/suite/mp/{merchant-agent-assist/static => marketplace-agent-assist/dynamic}/merchant-user-header-bar.json (100%) rename cypress/fixtures/suite/mp/{merchant-agent-assist/static => marketplace-agent-assist/dynamic}/merchant-user-impersonation.json (100%) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json rename cypress/fixtures/suite/mp/{merchant-agent-assist => marketplace-agent-assist}/static/merchant-portal-agent-login.json (100%) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json delete mode 100644 cypress/fixtures/suite/mp/merchant-agent-assist/static/customer-agent-login-page.json rename cypress/fixtures/suite/yves/{cart/comment => comments/cart}/dynamic/empty-cart-comment.json (100%) rename cypress/fixtures/suite/yves/{cart/comment => comments/cart}/dynamic/not-empty-cart-comment.json (100%) rename cypress/fixtures/suite/yves/{cart/comment => comments/cart}/static/empty-cart-comment.json (100%) rename cypress/fixtures/suite/yves/{cart/comment => comments/cart}/static/not-empty-cart-comment.json (100%) delete mode 100644 cypress/support/helpers/mail-catcher-helper.ts create mode 100644 cypress/support/pages/backoffice/backoffice-page.ts delete mode 100644 cypress/support/pages/backoffice/index/backoffice-index-page.ts create mode 100644 cypress/support/pages/backoffice/index/index-page.ts rename cypress/support/pages/backoffice/index/{backoffice-index-repository.ts => index-repository.ts} (79%) delete mode 100644 cypress/support/pages/backoffice/login/backoffice-login-page.ts create mode 100644 cypress/support/pages/backoffice/login/login-page.ts rename cypress/support/pages/backoffice/login/{backoffice-login-repository.ts => login-repository.ts} (69%) create mode 100644 cypress/support/pages/mp/mp-page.ts rename cypress/support/pages/yves/agent-login/repositories/{suite-yves-agent-login-repository.ts => suite-agent-login-repository.ts} (85%) rename cypress/support/pages/yves/cart/repositories/{b2b-yves-cart-repository.ts => b2b-cart-repository.ts} (95%) rename cypress/support/pages/yves/cart/repositories/{suite-yves-cart-repository.ts => suite-cart-repository.ts} (95%) rename cypress/support/pages/yves/checkout/address/repositories/{suite-yves-checkout-address-repository.ts => suite-checkout-address-repository.ts} (98%) rename cypress/support/pages/yves/checkout/customer/repositories/{suite-yves-checkout-customer-repository.ts => suite-checkout-customer-repository.ts} (89%) rename cypress/support/pages/yves/checkout/payment/repositories/{suite-yves-checkout-payment-repository.ts => suite-checkout-payment-repository.ts} (89%) rename cypress/support/pages/yves/checkout/shipment/repositories/{suite-yves-checkout-shipment-repository.ts => suite-checkout-shipment-repository.ts} (86%) rename cypress/support/pages/yves/checkout/summary/repositories/{suite-yves-checkout-summary-repository.ts => suite-checkout-summary-repository.ts} (80%) rename cypress/support/pages/yves/comment/cart/repositories/{b2b-yves-comment-cart-repository.ts => b2b-comment-cart-repository.ts} (92%) rename cypress/support/pages/yves/comment/cart/repositories/{suite-yves-comment-cart-repository.ts => suite-comment-cart-repository.ts} (91%) rename cypress/support/pages/yves/login/repositories/{b2b-yves-login-repository.ts => b2b-login-repository.ts} (94%) rename cypress/support/pages/yves/login/repositories/{suite-yves-login-repository.ts => suite-login-repository.ts} (94%) rename cypress/support/pages/yves/multi-cart/repositories/{b2b-yves-multi-cart-repository.ts => b2b-multi-cart-repository.ts} (80%) rename cypress/support/pages/yves/multi-cart/repositories/{suite-yves-multi-cart-repository.ts => suite-multi-cart-repository.ts} (80%) create mode 100644 cypress/support/pages/yves/yves-page.ts delete mode 100644 cypress/support/scenarios/backoffice/backoffice-login-user-scenario.ts create mode 100644 cypress/support/scenarios/backoffice/user-login-scenario.ts delete mode 100644 cypress/support/scenarios/mp/.gitkeep delete mode 100644 cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts rename cypress/support/types/yves/{cart/comment => comments/cart}/common/product.ts (100%) rename cypress/support/types/yves/{cart/comment => comments/cart}/common/quote.ts (100%) rename cypress/support/types/yves/{cart/comment => comments/cart}/dynamic-fixture-types.ts (79%) rename cypress/support/types/yves/{cart/comment => comments/cart}/index.ts (100%) rename cypress/support/types/yves/{cart/comment => comments/cart}/static-fixture-types.ts (79%) diff --git a/.env.example b/.env.example index 4dbbc386..a4de757b 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,8 @@ ENV_REPOSITORY_ID=suite ENV_BACKOFFICE_URL=http://backoffice.de.spryker.local ENV_MERCHANT_PORTAL_URL=http://mp.de.spryker.local +ENV_GLUE_BACKEND_URL=http://glue-backend.de.spryker.local ENV_MAIL_CATCHER_URL=http://mail.spryker.local -OPERATION_RUNNER_URL=http://glue-backend.de.spryker.local/test-operation-runner E2E_BASE_URL=http://yves.de.spryker.local VIEWPORT_WIDGTH=1920 diff --git a/cypress.config.ts b/cypress.config.ts index 3e239008..a4fd87ce 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -8,25 +8,15 @@ export default defineConfig({ repositoryId: process.env.ENV_REPOSITORY_ID, backofficeUrl: process.env.ENV_BACKOFFICE_URL, merchantPortalUrl: process.env.ENV_MERCHANT_PORTAL_URL, + glueBackendUrl: process.env.ENV_GLUE_BACKEND_URL, mailCatcherUrl: process.env.ENV_MAIL_CATCHER_URL, - operationRunnerUrl: process.env.OPERATION_RUNNER_URL, - cli: { - // TODO: TEMPORARILY SOLUTION: rework + move to .env - store: 'DE', - containerPath: '../suite-nonsplit', - containerName: 'spryker_cli_1', - }, }, e2e: { baseUrl: process.env.E2E_BASE_URL, - defaultCommandTimeout: 8000, - setupNodeEvents(on, config) { + setupNodeEvents(on) { on('task', { isFileExists(filename): boolean { - if (fs.existsSync(filename)) { - return true; - } - return false; + return fs.existsSync(filename); }, }); }, diff --git a/cypress/e2e/backoffice/order-management/merchant-agent-assist/agent-permission-in-backoffice.cy.ts b/cypress/e2e/backoffice/order-management/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts similarity index 100% rename from cypress/e2e/backoffice/order-management/merchant-agent-assist/agent-permission-in-backoffice.cy.ts rename to cypress/e2e/backoffice/order-management/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts diff --git a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts new file mode 100644 index 00000000..3e66449b --- /dev/null +++ b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts @@ -0,0 +1,75 @@ +import { container } from '../../../support/utils/inversify/inversify.config'; +import { IndexPage } from '../../../support/pages/backoffice/index/index-page'; +import { UserLoginScenario } from '../../../support/scenarios/backoffice'; +import { AgentLoginPage, LoginPage } from '../../../support/pages/yves'; +import { CustomerAgentLoginPageStaticFixtures } from '../../../support/types/mp/merchant-agent-assist'; + +/** + * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} + */ +describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): void => { + const indexPage: IndexPage = container.get(IndexPage); + const loginPage: LoginPage = container.get(LoginPage); + const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); + const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: CustomerAgentLoginPageStaticFixtures; + + before((): void => { + staticFixtures = Cypress.env('staticFixtures'); + }); + + it('agent (customer) should be able to login to backoffice', (): void => { + userLoginScenario.execute(staticFixtures.customerAgentUser.username, staticFixtures.customerAgentUser.password); + + indexPage.visit(); + indexPage.assertPageLocation(); + }); + + it('agent (merchant user) should be able to login to backoffice', (): void => { + userLoginScenario.execute(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + + indexPage.visit(); + indexPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { + agentLoginPage.visit(); + agentLoginPage.login(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + + cy.contains(agentLoginPage.getFailedAuthenticationText()); + agentLoginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to storefront agent dashboard', (): void => { + agentLoginPage.visit(); + agentLoginPage.login(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + + cy.contains(agentLoginPage.getFailedAuthenticationText()); + agentLoginPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to storefront', (): void => { + loginPage.visit(); + loginPage.login(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + + cy.contains(loginPage.getFailedAuthenticationText()); + loginPage.assertPageLocation(); + }); + + it('agent (customer) should not be able to login to storefront', (): void => { + loginPage.visit(); + loginPage.login(staticFixtures.customerAgentUser.username, staticFixtures.customerAgentUser.password); + + cy.contains(loginPage.getFailedAuthenticationText()); + loginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to storefront', (): void => { + loginPage.visit(); + loginPage.login(staticFixtures.merchantUser.username, staticFixtures.merchantUser.password); + + cy.contains(loginPage.getFailedAuthenticationText()); + loginPage.assertPageLocation(); + }); +}); diff --git a/cypress/e2e/mp/merchant-agent-assist/merchant-user-agent-dashboard.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts similarity index 100% rename from cypress/e2e/mp/merchant-agent-assist/merchant-user-agent-dashboard.cy.ts rename to cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts diff --git a/cypress/e2e/mp/merchant-agent-assist/merchant-user-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts similarity index 100% rename from cypress/e2e/mp/merchant-agent-assist/merchant-user-agent-login-page.cy.ts rename to cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts diff --git a/cypress/e2e/mp/merchant-agent-assist/merchant-user-header-bar.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts similarity index 100% rename from cypress/e2e/mp/merchant-agent-assist/merchant-user-header-bar.cy.ts rename to cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts diff --git a/cypress/e2e/mp/merchant-agent-assist/merchant-user-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts similarity index 100% rename from cypress/e2e/mp/merchant-agent-assist/merchant-user-impersonation.cy.ts rename to cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts diff --git a/cypress/e2e/mp/merchant-agent-assist/customer-agent-login-page.cy.ts b/cypress/e2e/mp/merchant-agent-assist/customer-agent-login-page.cy.ts deleted file mode 100644 index fd901a6e..00000000 --- a/cypress/e2e/mp/merchant-agent-assist/customer-agent-login-page.cy.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { BackofficeIndexPage } from '../../support/pages/backoffice/index/backoffice-index-page'; -import { YvesAgentLoginPage } from '../../support/pages/yves/agent-login/yves-agent-login-page'; -import { YvesLoginPage } from '../../support/pages/yves/login/yves-login-page'; -import { BackofficeLoginUserScenario } from '../../support/scenarios/backoffice/backoffice-login-user-scenario'; -import { YvesLoginCustomerScenario } from '../../support/scenarios/yves/yves-login-customer-scenario'; -import { YvesAgentLoginScenario } from '../../support/scenarios/yves/yves-agent-login-scenario'; - -/** - * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} - */ -describe('customer agent login page', (): void => { - const indexPage: BackofficeIndexPage = container.get(BackofficeIndexPage); - const loginPage: YvesLoginPage = container.get(YvesLoginPage); - const agentLoginPage: YvesAgentLoginPage = container.get(YvesAgentLoginPage); - - const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario); - const loginCustomerScenario: YvesLoginCustomerScenario = container.get(YvesLoginCustomerScenario); - const agentLoginScenario: YvesAgentLoginScenario = container.get(YvesAgentLoginScenario); - - let fixtures: CustomerAgentLoginPageFixtures; - - before((): void => { - fixtures = Cypress.env('fixtures'); - }); - - it('agent (customer) should be able to login to backoffice', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.customerAgentUser); - - indexPage.assertPageLocation(); - }); - - it('agent (merchant user) should be able to login to backoffice', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.merchantAgentUser); - - indexPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { - cy.resetYvesCookies(); - agentLoginScenario.execute(fixtures.merchantAgentUser); - - cy.contains(agentLoginPage.getFailedAuthenticationText()); - agentLoginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to storefront agent dashboard', (): void => { - cy.resetYvesCookies(); - agentLoginScenario.execute(fixtures.merchantUser); - - cy.contains(agentLoginPage.getFailedAuthenticationText()); - agentLoginPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to storefront', (): void => { - cy.resetYvesCookies(); - cy.visit(loginPage.PAGE_URL); - - const customer: Customer = { - email: fixtures.merchantAgentUser.username, - password: fixtures.merchantAgentUser.password, - }; - - loginCustomerScenario.execute(customer); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); - - it('agent (customer) should not be able to login to storefront', (): void => { - cy.resetYvesCookies(); - cy.visit(loginPage.PAGE_URL); - - const customer: Customer = { - email: fixtures.customerAgentUser.username, - password: fixtures.customerAgentUser.password, - }; - - loginCustomerScenario.execute(customer); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to storefront', (): void => { - cy.resetYvesCookies(); - cy.visit(loginPage.PAGE_URL); - - const customer: Customer = { - email: fixtures.merchantUser.username, - password: fixtures.merchantUser.password, - }; - - loginCustomerScenario.execute(customer); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); -}); diff --git a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts index fe839641..d2b997c6 100644 --- a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts @@ -7,25 +7,19 @@ import { CheckoutShipmentPage, CheckoutSummaryPage } from "../../../support/pages/yves"; -let cartPage: CartPage; -let checkoutCustomerPage: CheckoutCustomerPage; -let checkoutAddressPage: CheckoutAddressPage; -let checkoutShipmentPage: CheckoutShipmentPage; -let checkoutPaymentPage: CheckoutPaymentPage; -let checkoutSummaryPage: CheckoutSummaryPage; -let dynamicFixtures: CheckoutByGuestCustomerDynamicFixtures; - -describe('checkout by guest customer', (): void => { +describe('checkout by guest customer', {tags: ['@checkout']}, (): void => { + const cartPage: CartPage = container.get(CartPage); + const checkoutCustomerPage: CheckoutCustomerPage = container.get(CheckoutCustomerPage); + const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); + const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); + const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); + const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); + + let dynamicFixtures: CheckoutByGuestCustomerDynamicFixtures; + before((): void => { cy.resetYvesCookies(); dynamicFixtures = Cypress.env('dynamicFixtures'); - - cartPage = container.get(CartPage); - checkoutCustomerPage = container.get(CheckoutCustomerPage); - checkoutAddressPage = container.get(CheckoutAddressPage); - checkoutShipmentPage = container.get(CheckoutShipmentPage); - checkoutPaymentPage = container.get(CheckoutPaymentPage); - checkoutSummaryPage = container.get(CheckoutSummaryPage); }); beforeEach((): void => { @@ -40,14 +34,14 @@ describe('checkout by guest customer', (): void => { cy.contains('Your order has been placed successfully!'); }); - it('should checkout with two concrete products to single shipment [@regression]', (): void => { + it('should checkout with two concrete products to single shipment', (): void => { cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); completeGuestCheckoutProcess(); cy.contains('Your order has been placed successfully!'); }); - it('should checkout to multi shipment address [@regression]', (): void => { + it('should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); completeGuestCheckoutProcess(); @@ -75,13 +69,13 @@ describe('checkout by guest customer', (): void => { cy.url().should('include', '/checkout/success'); }); -}); -const completeGuestCheckoutProcess = () => { - cartPage.startCheckout(); - checkoutCustomerPage.checkoutAsGuest(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); -} + const completeGuestCheckoutProcess = () => { + cartPage.startCheckout(); + checkoutCustomerPage.checkoutAsGuest(); + checkoutAddressPage.fillShippingAddress(); + checkoutShipmentPage.setStandardShippingMethod(); + checkoutPaymentPage.setDummyPaymentMethod(); + checkoutSummaryPage.placeOrder(); + } +}); diff --git a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts index bad76b5c..0bf64e58 100644 --- a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts @@ -12,26 +12,20 @@ import { } from "../../../support/pages/yves"; import {CustomerLoginScenario} from "../../../support/scenarios/yves"; -let staticFixtures: CheckoutByLoggedInCustomerStaticFixtures; -let dynamicFixtures: CheckoutByLoggedInCustomerDynamicFixtures; -let cartPage: CartPage; -let checkoutAddressPage: CheckoutAddressPage; -let checkoutShipmentPage: CheckoutShipmentPage; -let checkoutPaymentPage: CheckoutPaymentPage; -let checkoutSummaryPage: CheckoutSummaryPage; -let loginCustomerScenario: CustomerLoginScenario; - -describe('checkout by logged in customer', (): void => { +describe('checkout by logged in customer', {tags: ['@checkout']}, (): void => { + const cartPage: CartPage = container.get(CartPage); + const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); + const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); + const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); + const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); + const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: CheckoutByLoggedInCustomerStaticFixtures; + let dynamicFixtures: CheckoutByLoggedInCustomerDynamicFixtures; + before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - - cartPage = container.get(CartPage); - checkoutAddressPage = container.get(CheckoutAddressPage); - checkoutShipmentPage = container.get(CheckoutShipmentPage); - checkoutPaymentPage = container.get(CheckoutPaymentPage); - checkoutSummaryPage = container.get(CheckoutSummaryPage); - loginCustomerScenario = container.get(CustomerLoginScenario); }); beforeEach((): void => { @@ -53,7 +47,7 @@ describe('checkout by logged in customer', (): void => { cy.contains('Your order has been placed successfully!'); }); - it('should checkout to multi shipment address', (): void => { + it('should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); cartPage.startCheckout(); @@ -83,12 +77,12 @@ describe('checkout by logged in customer', (): void => { cy.url().should('include', '/checkout/success'); }); -}); -const completeCustomerCheckoutProcessWithSingleShipment = () => { - cartPage.startCheckout(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); -} + const completeCustomerCheckoutProcessWithSingleShipment = () => { + cartPage.startCheckout(); + checkoutAddressPage.fillShippingAddress(); + checkoutShipmentPage.setStandardShippingMethod(); + checkoutPaymentPage.setDummyPaymentMethod(); + checkoutSummaryPage.placeOrder(); + } +}); diff --git a/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts similarity index 63% rename from cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts rename to cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts index d2fa9148..584c5770 100644 --- a/cypress/e2e/yves/cart/comment/empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts @@ -1,19 +1,18 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; +import {DynamicFixtures, StaticFixtures} from "../../../../support/types/yves/comments/cart"; import {CommentCartPage} from "../../../../support/pages/yves"; import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; -describe('cart comment', (): void => { - let dynamicFixtures: CartCommentDynamicFixtures; - let staticFixtures: CartCommentStaticFixtures; - let commentCartPage: CommentCartPage; - let loginCustomerScenario: CustomerLoginScenario; +describe('empty cart comment',{tags: ['@comments']} , (): void => { + const commentCartPage: CommentCartPage = container.get(CommentCartPage); + const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); + + let dynamicFixtures: DynamicFixtures; + let staticFixtures: StaticFixtures; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - commentCartPage = container.get(CommentCartPage); - loginCustomerScenario = container.get(CustomerLoginScenario); }); beforeEach((): void => { @@ -21,7 +20,7 @@ describe('cart comment', (): void => { commentCartPage.visit(); }); - it('customer should be able to add comments to empty cart [@comment]', (): void => { + it('customer should be able to add comments to empty cart', (): void => { staticFixtures.commentsToAdd.forEach((commentMessage) => { commentCartPage.addComment(commentMessage); @@ -29,14 +28,14 @@ describe('cart comment', (): void => { }); }); - it('customer should be able to modify comment in empty cart [@comment]', (): void => { + it('customer should be able to modify comment in empty cart', (): void => { commentCartPage.addComment(staticFixtures.commentToModify); commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); }); - it('customer should be able to remove comment in empty cart [@comment]', (): void => { + it('customer should be able to remove comment in empty cart', (): void => { commentCartPage.addComment(staticFixtures.commentsToRemove); commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); diff --git a/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts similarity index 64% rename from cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts rename to cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts index aea9a817..e990e2b3 100644 --- a/cypress/e2e/yves/cart/comment/not-empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts @@ -1,19 +1,18 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {CartCommentDynamicFixtures, CartCommentStaticFixtures} from "../../../../support/types/yves/cart/comment"; +import {DynamicFixtures, StaticFixtures} from "../../../../support/types/yves/comments/cart"; import {CommentCartPage} from "../../../../support/pages/yves"; import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; -describe('cart comment', (): void => { - let dynamicFixtures: CartCommentDynamicFixtures; - let staticFixtures: CartCommentStaticFixtures; - let commentCartPage: CommentCartPage; - let loginCustomerScenario: CustomerLoginScenario; +describe('not empty cart comment',{tags: ['@comments']}, (): void => { + const commentCartPage: CommentCartPage = container.get(CommentCartPage); + const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); + + let dynamicFixtures: DynamicFixtures; + let staticFixtures: StaticFixtures; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - commentCartPage = container.get(CommentCartPage); - loginCustomerScenario = container.get(CustomerLoginScenario); }); beforeEach((): void => { @@ -21,7 +20,7 @@ describe('cart comment', (): void => { commentCartPage.visit(); }); - it('customer should be able to add comments to cart [@comment]', (): void => { + it('customer should be able to add comments to cart', (): void => { staticFixtures.commentsToAdd.forEach((commentMessage) => { commentCartPage.addComment(commentMessage); @@ -29,14 +28,14 @@ describe('cart comment', (): void => { }); }); - it('customer should be able to modify comment in cart [@comment]', (): void => { + it('customer should be able to modify comment in cart', (): void => { commentCartPage.addComment(staticFixtures.commentToModify); commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); }); - it('customer should be able to remove comment in cart [@comment]', (): void => { + it('customer should be able to remove comment in cart', (): void => { commentCartPage.addComment(staticFixtures.commentsToRemove); commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts index 71267bfe..738fc5eb 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts @@ -5,25 +5,20 @@ import { CartPage, CheckoutAddressPage, CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, } from "../../../../support/pages/yves"; -describe('create order by customer', (): void => { +describe('create order by customer',{tags: ['@order-management']}, (): void => { + const cartPage: CartPage = container.get(CartPage); + const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); + const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); + const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); + const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); + const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); + let staticFixtures: CreateOrderByCustomerStaticFixtures; let dynamicFixtures: CreateOrderByCustomerDynamicFixtures; - let loginCustomerScenario: CustomerLoginScenario; - let cartPage: CartPage; - let checkoutAddressPage: CheckoutAddressPage; - let checkoutShipmentPage: CheckoutShipmentPage; - let checkoutPaymentPage: CheckoutPaymentPage; - let checkoutSummaryPage: CheckoutSummaryPage; before((): void => { cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); - loginCustomerScenario = container.get(CustomerLoginScenario); - cartPage = container.get(CartPage); - checkoutAddressPage = container.get(CheckoutAddressPage); - checkoutShipmentPage = container.get(CheckoutShipmentPage); - checkoutPaymentPage = container.get(CheckoutPaymentPage); - checkoutSummaryPage = container.get(CheckoutSummaryPage); }); beforeEach((): void => { @@ -31,7 +26,7 @@ describe('create order by customer', (): void => { cartPage.visit(); }); - it('should be able to create an order by existing customer [@order, @regression]', (): void => { + it('should be able to create an order by existing customer', (): void => { cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); cartPage.startCheckout(); checkoutAddressPage.fillShippingAddress(); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts index 81d87d4b..c2ed4e6a 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts @@ -7,27 +7,22 @@ import { CheckoutShipmentPage, CheckoutSummaryPage } from "../../../../support/pages/yves"; -describe('create order by guest', (): void => { +describe('create order by guest',{tags: ['@order-management']}, (): void => { + const cartPage: CartPage = container.get(CartPage); + const checkoutCustomerPage: CheckoutCustomerPage = container.get(CheckoutCustomerPage); + const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); + const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); + const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); + const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); + let dynamicFixtures: CreateOrderByGuestDynamicFixtures; - let cartPage: CartPage; - let checkoutCustomerPage: CheckoutCustomerPage; - let checkoutAddressPage: CheckoutAddressPage; - let checkoutShipmentPage: CheckoutShipmentPage; - let checkoutPaymentPage: CheckoutPaymentPage; - let checkoutSummaryPage: CheckoutSummaryPage; before((): void => { cy.resetYvesCookies(); dynamicFixtures = Cypress.env('dynamicFixtures'); - cartPage = container.get(CartPage); - checkoutCustomerPage = container.get(CheckoutCustomerPage); - checkoutAddressPage = container.get(CheckoutAddressPage); - checkoutShipmentPage = container.get(CheckoutShipmentPage); - checkoutPaymentPage = container.get(CheckoutPaymentPage); - checkoutSummaryPage = container.get(CheckoutSummaryPage); }); - it('should be able to create an order by guest [@regression]', (): void => { + it('should be able to create an order by guest', (): void => { cartPage.visit(); cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); cartPage.startCheckout(); diff --git a/cypress/fixtures/suite/backoffice/order-management/merchant-agent-assist/static/agent-permission-in-backoffice.json b/cypress/fixtures/suite/backoffice/order-management/marketplace-agent-assist/static/agent-permission-in-backoffice.json similarity index 100% rename from cypress/fixtures/suite/backoffice/order-management/merchant-agent-assist/static/agent-permission-in-backoffice.json rename to cypress/fixtures/suite/backoffice/order-management/marketplace-agent-assist/static/agent-permission-in-backoffice.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json new file mode 100644 index 00000000..70b0cf34 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json @@ -0,0 +1,84 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productOne", + "arguments": [] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productTwo", + "arguments": [] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productOneWithPrice", + "arguments": [ + { + "skuProductAbstract": "#productOne.abstract_sku", + "skuProduct": "#productOne.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productTwoWithPrice", + "arguments": [ + { + "skuProductAbstract": "#productTwo.abstract_sku", + "skuProduct": "#productTwo.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productOneWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#productOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productTwoWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#productTwo.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-agent-dashboard.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json similarity index 100% rename from cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-agent-dashboard.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json diff --git a/cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json similarity index 100% rename from cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-agent-login-page.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json diff --git a/cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-header-bar.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json similarity index 100% rename from cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-header-bar.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json diff --git a/cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-impersonation.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json similarity index 100% rename from cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-user-impersonation.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json new file mode 100644 index 00000000..2490f7ba --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json @@ -0,0 +1,18 @@ +{ + "rootUser": { + "username": "admin@spryker.com", + "password": "change123" + }, + "merchantAgentUser": { + "username": "agent-merchant@spryker.com", + "password": "change123" + }, + "customerAgentUser": { + "username": "agent123@spryker.com", + "password": "change123" + }, + "merchantUser": { + "username": "harald@spryker.com", + "password": "change123" + } +} diff --git a/cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-portal-agent-login.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-portal-agent-login.json similarity index 100% rename from cypress/fixtures/suite/mp/merchant-agent-assist/static/merchant-portal-agent-login.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-portal-agent-login.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json new file mode 100644 index 00000000..e8e69945 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json @@ -0,0 +1,10 @@ +{ + "merchantAgentUser": { + "username": "agent-merchant@spryker.com", + "password": "change123" + }, + "backofficeUser": { + "username": "admin@spryker.com", + "password": "change123" + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json new file mode 100644 index 00000000..5cbc2e51 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json @@ -0,0 +1,14 @@ +{ + "customerAgentUser": { + "username": "agent123@spryker.com", + "password": "change123" + }, + "merchantAgentUser": { + "username": "agent-merchant@spryker.com", + "password": "change123" + }, + "merchantUser": { + "username": "harald@spryker.com", + "password": "change123" + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json new file mode 100644 index 00000000..acb7cb49 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json @@ -0,0 +1,12 @@ +{ + "merchantAgentUser": { + "username": "agent-merchant@spryker.com", + "password": "change123" + }, + "impersonatedMerchantName": "Spryker", + "impersonatedMerchantUser": { + "username": "harald@spryker.com", + "firstName": "Harald", + "lastName": "Schmidt" + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json new file mode 100644 index 00000000..f1e73aa9 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json @@ -0,0 +1,14 @@ +{ + "backofficeUser": { + "username": "admin@spryker.com", + "password": "change123" + }, + "merchantAgentUser": { + "username": "agent-merchant@spryker.com", + "password": "change123" + }, + "merchantUsername": "harald@spryker.com", + "productConcreteSkus": ["005_30663301"], + "productAbstractSku": "090", + "offerReference": "offer423" +} diff --git a/cypress/fixtures/suite/mp/merchant-agent-assist/static/customer-agent-login-page.json b/cypress/fixtures/suite/mp/merchant-agent-assist/static/customer-agent-login-page.json deleted file mode 100644 index e69de29b..00000000 diff --git a/cypress/fixtures/suite/yves/cart/comment/dynamic/empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/yves/cart/comment/dynamic/empty-cart-comment.json rename to cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json diff --git a/cypress/fixtures/suite/yves/cart/comment/dynamic/not-empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/yves/cart/comment/dynamic/not-empty-cart-comment.json rename to cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json diff --git a/cypress/fixtures/suite/yves/cart/comment/static/empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/cart/static/empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/yves/cart/comment/static/empty-cart-comment.json rename to cypress/fixtures/suite/yves/comments/cart/static/empty-cart-comment.json diff --git a/cypress/fixtures/suite/yves/cart/comment/static/not-empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/cart/static/not-empty-cart-comment.json similarity index 100% rename from cypress/fixtures/suite/yves/cart/comment/static/not-empty-cart-comment.json rename to cypress/fixtures/suite/yves/comments/cart/static/not-empty-cart-comment.json diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 23300ed1..0713beb4 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -38,11 +38,12 @@ Cypress.Commands.add('loadDynamicFixturesByPayload', (dynamicFixturesFilePath) = return cy .request({ method: 'POST', - url: Cypress.env().operationRunnerUrl, + url: Cypress.env().glueBackendUrl + '/test-operation-runner', headers: { 'Content-Type': 'application/vnd.api+json', }, body: operationRequestPayload, + timeout: 20000, }) .then((response) => { if (Array.isArray(response.body.data)) { diff --git a/cypress/support/helpers/mail-catcher-helper.ts b/cypress/support/helpers/mail-catcher-helper.ts deleted file mode 100644 index 7a09f510..00000000 --- a/cypress/support/helpers/mail-catcher-helper.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { injectable } from 'inversify'; -import { autoWired } from '../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class MailCatcherHelper { - private readonly url: string; - - constructor() { - this.url = Cypress.env().mailCatcherUrl; - } - - public verifyCustomerEmail = (email: string): void => { - cy.request({ - url: this.url, - failOnStatusCode: false, - }).then((response) => { - if (response.status !== 200) { - return; - } - }); - - cy.visit(this.url); - cy.get('#search').type(email + '{enter}'); - cy.contains('span', 'Thank you for signing up with Spryker Shop!').click(); - cy.get('.active > a').click(); - cy.get('#preview-html').iframe().contains('Validate your email address').invoke('removeAttr', 'target').click(); - }; -} diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index 3a439abc..a570c38a 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -13,7 +13,7 @@ declare namespace Cypress { resetYvesCookies(): void; /** - * @example cy.runFixtureHelpers() + * @example cy.loadDynamicFixturesByPayload('suite/yves/checkout/dynamic/checkout-by-guest-customer') */ loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath: string): Chainable; diff --git a/cypress/support/pages/abstract-page.ts b/cypress/support/pages/abstract-page.ts index 6d097960..244e8fba 100644 --- a/cypress/support/pages/abstract-page.ts +++ b/cypress/support/pages/abstract-page.ts @@ -4,15 +4,14 @@ import { injectable } from 'inversify'; @injectable() export class AbstractPage { - // make protected to allow access from child classes only and use visit only - public PAGE_URL: string = ''; + protected PAGE_URL: string = ''; protected faker: Faker; constructor() { this.faker = faker; } - assertPageLocation = (): void => { - cy.url({ timeout: 10000 }).should('include', this.PAGE_URL); + public 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 new file mode 100644 index 00000000..97f5ae41 --- /dev/null +++ b/cypress/support/pages/backoffice/backoffice-page.ts @@ -0,0 +1,10 @@ +import 'reflect-metadata'; +import { injectable } from 'inversify'; +import { AbstractPage } from '../abstract-page'; + +@injectable() +export class BackofficePage extends AbstractPage { + public visit = (): void => { + cy.visitBackoffice(this.PAGE_URL); + } +} diff --git a/cypress/support/pages/backoffice/index/backoffice-index-page.ts b/cypress/support/pages/backoffice/index/backoffice-index-page.ts deleted file mode 100644 index 239308ed..00000000 --- a/cypress/support/pages/backoffice/index/backoffice-index-page.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AbstractPage } from '../../abstract-page'; -import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; -import { BackofficeIndexRepository } from './backoffice-index-repository'; -import { autoWired } from '../../../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class BackofficeIndexPage extends AbstractPage { - public PAGE_URL: string = '/'; - - constructor(@inject(BackofficeIndexRepository) private repository: BackofficeIndexRepository) { - super(); - } -} diff --git a/cypress/support/pages/backoffice/index/index-page.ts b/cypress/support/pages/backoffice/index/index-page.ts new file mode 100644 index 00000000..116b2542 --- /dev/null +++ b/cypress/support/pages/backoffice/index/index-page.ts @@ -0,0 +1,15 @@ +import { inject, 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/backoffice-index-repository.ts b/cypress/support/pages/backoffice/index/index-repository.ts similarity index 79% rename from cypress/support/pages/backoffice/index/backoffice-index-repository.ts rename to cypress/support/pages/backoffice/index/index-repository.ts index e6b5f675..64c55a7b 100644 --- a/cypress/support/pages/backoffice/index/backoffice-index-repository.ts +++ b/cypress/support/pages/backoffice/index/index-repository.ts @@ -4,4 +4,4 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeIndexRepository {} +export class IndexRepository {} diff --git a/cypress/support/pages/backoffice/login/backoffice-login-page.ts b/cypress/support/pages/backoffice/login/backoffice-login-page.ts deleted file mode 100644 index 112f41ca..00000000 --- a/cypress/support/pages/backoffice/login/backoffice-login-page.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AbstractPage } from '../../abstract-page'; -import { BackofficeLoginRepository } from './backoffice-login-repository'; -import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; -import { autoWired } from '../../../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class BackofficeLoginPage extends AbstractPage { - public PAGE_URL: string = '/security-gui/login'; - - constructor(@inject(BackofficeLoginRepository) private repository: BackofficeLoginRepository) { - super(); - } - - public login = (username: string, password: string): void => { - cy.session([username, password], () => { - cy.visitBackoffice(this.PAGE_URL); - this.repository.getEmailInput().clear().type(username); - this.repository.getPasswordInput().clear().type(password); - - this.repository.getSubmitButton().click(); - }); - }; -} diff --git a/cypress/support/pages/backoffice/login/login-page.ts b/cypress/support/pages/backoffice/login/login-page.ts new file mode 100644 index 00000000..107ae588 --- /dev/null +++ b/cypress/support/pages/backoffice/login/login-page.ts @@ -0,0 +1,22 @@ +import { LoginRepository } from './login-repository'; +import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; +import { autoWired } from '../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../backoffice-page'; + +@injectable() +@autoWired +export class LoginPage extends BackofficePage { + protected PAGE_URL: string = '/security-gui/login'; + + constructor(@inject(LoginRepository) private repository: LoginRepository) { + super(); + } + + public login = (username: string, password: string): void => { + this.repository.getEmailInput().clear().type(username); + this.repository.getPasswordInput().clear().type(password); + + this.repository.getSubmitButton().click(); + }; +} diff --git a/cypress/support/pages/backoffice/login/backoffice-login-repository.ts b/cypress/support/pages/backoffice/login/login-repository.ts similarity index 69% rename from cypress/support/pages/backoffice/login/backoffice-login-repository.ts rename to cypress/support/pages/backoffice/login/login-repository.ts index 83e4d4dd..c46feee0 100644 --- a/cypress/support/pages/backoffice/login/backoffice-login-repository.ts +++ b/cypress/support/pages/backoffice/login/login-repository.ts @@ -4,8 +4,8 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeLoginRepository { +export class LoginRepository { getEmailInput = (): Cypress.Chainable => cy.get('#auth_username'); getPasswordInput = (): Cypress.Chainable => cy.get('#auth_password'); - getSubmitButton = (): Cypress.Chainable => cy.get('.btn'); + getSubmitButton = (): Cypress.Chainable => cy.get('form[name=auth]:visible').find('[type="submit"]'); } diff --git a/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page.ts index 25b3168a..08165c4b 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeMerchantUserCreateRepository } from './backoffice-merchant-user-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantUserCreatePage extends AbstractPage { - public PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; +export class BackofficeMerchantUserCreatePage extends BackofficePage { + protected PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; constructor( @inject(BackofficeMerchantUserCreateRepository) private repository: BackofficeMerchantUserCreateRepository diff --git a/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-page.ts b/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-page.ts index c65518a3..6ff45bc0 100644 --- a/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeMerchantCreateRepository } from './backoffice-merchant-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantCreatePage extends AbstractPage { - public PAGE_URL: string = '/merchant-gui/create-merchant'; +export class BackofficeMerchantCreatePage extends BackofficePage { + protected PAGE_URL: string = '/merchant-gui/create-merchant'; constructor(@inject(BackofficeMerchantCreateRepository) private repository: BackofficeMerchantCreateRepository) { super(); diff --git a/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-page.ts b/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-page.ts index a8f07ce4..9e4383c1 100644 --- a/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeMerchantListRepository } from './backoffice-merchant-list-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantListPage extends AbstractPage { - public PAGE_URL: string = '/merchant-gui/list-merchant'; +export class BackofficeMerchantListPage extends BackofficePage { + protected PAGE_URL: string = '/merchant-gui/list-merchant'; constructor(@inject(BackofficeMerchantListRepository) private repository: BackofficeMerchantListRepository) { super(); diff --git a/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-page.ts b/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-page.ts index 9d085476..14f7f5bf 100644 --- a/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeMerchantUpdateRepository } from './backoffice-merchant-update-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantUpdatePage extends AbstractPage { - public PAGE_URL: string = '/merchant-gui/edit-merchant'; +export class BackofficeMerchantUpdatePage extends BackofficePage { + protected PAGE_URL: string = '/merchant-gui/edit-merchant'; constructor(@inject(BackofficeMerchantUpdateRepository) private repository: BackofficeMerchantUpdateRepository) { super(); diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page.ts b/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page.ts index 36aa909b..ba1aa935 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeSalesReturnGuiCreateRepository } from './backoffice-sales-return-gui-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeSalesReturnGuiCreatePage extends AbstractPage { - public PAGE_URL: string = '/sales-return-gui/create'; +export class BackofficeSalesReturnGuiCreatePage extends BackofficePage { + protected PAGE_URL: string = '/sales-return-gui/create'; constructor( @inject(BackofficeSalesReturnGuiCreateRepository) private repository: BackofficeSalesReturnGuiCreateRepository diff --git a/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-page.ts index 262a4164..1030379c 100644 --- a/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-page.ts @@ -1,14 +1,14 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeSalesDetailRepository } from './backoffice-sales-detail-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { CliHelper } from '../../../../helpers/cli-helper'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeSalesDetailPage extends AbstractPage { - public PAGE_URL: string = '/sales/detail'; +export class BackofficeSalesDetailPage extends BackofficePage { + protected PAGE_URL: string = '/sales/detail'; constructor( @inject(BackofficeSalesDetailRepository) private repository: BackofficeSalesDetailRepository, diff --git a/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-page.ts b/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-page.ts index 44a95d11..eef9e569 100644 --- a/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-page.ts +++ b/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeSalesIndexRepository } from './backoffice-sales-index-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeSalesIndexPage extends AbstractPage { - public PAGE_URL: string = '/sales'; +export class BackofficeSalesIndexPage extends BackofficePage { + protected PAGE_URL: string = '/sales'; constructor(@inject(BackofficeSalesIndexRepository) private repository: BackofficeSalesIndexRepository) { super(); diff --git a/cypress/support/pages/backoffice/user/create/backoffice-user-create-page.ts b/cypress/support/pages/backoffice/user/create/backoffice-user-create-page.ts index 32753864..80b2a6f2 100644 --- a/cypress/support/pages/backoffice/user/create/backoffice-user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/backoffice-user-create-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeUserCreateRepository } from './backoffice-user-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserCreatePage extends AbstractPage { - public PAGE_URL: string = '/user/edit/create'; +export class BackofficeUserCreatePage extends BackofficePage { + protected PAGE_URL: string = '/user/edit/create'; private DEFAULT_PASSWORD: string = 'Change123@_'; private EN_LOCALE_VALUE: string = '66'; diff --git a/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-page.ts b/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-page.ts index 8107efca..5ced9bb9 100644 --- a/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-page.ts +++ b/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { BackofficeUserDeleteRepository } from './backoffice-user-delete-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserDeletePage extends AbstractPage { - public PAGE_URL: string = '/user/edit/confirm-delete'; +export class BackofficeUserDeletePage extends BackofficePage { + protected PAGE_URL: string = '/user/edit/confirm-delete'; constructor(@inject(BackofficeUserDeleteRepository) private repository: BackofficeUserDeleteRepository) { super(); diff --git a/cypress/support/pages/backoffice/user/index/backoffice-user-index-page.ts b/cypress/support/pages/backoffice/user/index/backoffice-user-index-page.ts index 3589466b..a35b1106 100644 --- a/cypress/support/pages/backoffice/user/index/backoffice-user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/backoffice-user-index-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../../abstract-page'; import { BackofficeUserIndexRepository } from './backoffice-user-index-repository'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserIndexPage extends AbstractPage { - public PAGE_URL: string = '/user'; +export class BackofficeUserIndexPage extends BackofficePage { + protected PAGE_URL: string = '/user'; constructor(@inject(BackofficeUserIndexRepository) private repository: BackofficeUserIndexRepository) { super(); diff --git a/cypress/support/pages/backoffice/user/update/backoffice-user-update-page.ts b/cypress/support/pages/backoffice/user/update/backoffice-user-update-page.ts index 738c3e65..db4f0063 100644 --- a/cypress/support/pages/backoffice/user/update/backoffice-user-update-page.ts +++ b/cypress/support/pages/backoffice/user/update/backoffice-user-update-page.ts @@ -1,13 +1,13 @@ import { BackofficeUserUpdateRepository } from './backoffice-user-update-repository'; -import { AbstractPage } from '../../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { autoWired } from '../../../../utils/inversify/auto-wired'; +import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserUpdatePage extends AbstractPage { - public PAGE_URL: string = '/user/edit/update'; +export class BackofficeUserUpdatePage extends BackofficePage { + protected PAGE_URL: string = '/user/edit/update'; public DEFAULT_PASSWORD: string = 'Change123@_'; constructor(@inject(BackofficeUserUpdateRepository) private repository: BackofficeUserUpdateRepository) { diff --git a/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-page.ts index dd6736ca..951986ad 100644 --- a/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpAgentDashboardRepository } from './mp-agent-dashboard-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpAgentDashboardPage extends AbstractPage { - public PAGE_URL: string = '/agent-dashboard-merchant-portal-gui/merchant-users'; +export class MpAgentDashboardPage extends MpPage { + protected PAGE_URL: string = '/agent-dashboard-merchant-portal-gui/merchant-users'; constructor(@inject(MpAgentDashboardRepository) private repository: MpAgentDashboardRepository) { super(); diff --git a/cypress/support/pages/mp/agent-login/mp-agent-login-page.ts b/cypress/support/pages/mp/agent-login/mp-agent-login-page.ts index 364e041c..ab03a179 100644 --- a/cypress/support/pages/mp/agent-login/mp-agent-login-page.ts +++ b/cypress/support/pages/mp/agent-login/mp-agent-login-page.ts @@ -1,22 +1,22 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpAgentLoginRepository } from './mp-agent-login-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpAgentLoginPage extends AbstractPage { - public PAGE_URL: string = '/agent-security-merchant-portal-gui/login'; +export class MpAgentLoginPage extends MpPage { + protected PAGE_URL: string = '/agent-security-merchant-portal-gui/login'; constructor(@inject(MpAgentLoginRepository) private repository: MpAgentLoginRepository) { super(); } - public login = (user: User): void => { + public login = (username: string, password: string): void => { cy.visitMerchantPortal(this.PAGE_URL); - this.repository.getEmailInput().clear().type(user.username); - this.repository.getPasswordInput().clear().type(user.password); + this.repository.getEmailInput().clear().type(username); + this.repository.getPasswordInput().clear().type(password); this.repository.getSubmitButton().click(); }; diff --git a/cypress/support/pages/mp/dashboard/mp-dashboard-page.ts b/cypress/support/pages/mp/dashboard/mp-dashboard-page.ts index 79779481..f9da1567 100644 --- a/cypress/support/pages/mp/dashboard/mp-dashboard-page.ts +++ b/cypress/support/pages/mp/dashboard/mp-dashboard-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpDashboardRepository } from './mp-dashboard-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpDashboardPage extends AbstractPage { - public PAGE_URL: string = '/dashboard-merchant-portal-gui/dashboard'; +export class MpDashboardPage extends MpPage { + protected PAGE_URL: string = '/dashboard-merchant-portal-gui/dashboard'; constructor(@inject(MpDashboardRepository) private repository: MpDashboardRepository) { super(); diff --git a/cypress/support/pages/mp/login/mp-login-page.ts b/cypress/support/pages/mp/login/mp-login-page.ts index af08b96f..3115efdb 100644 --- a/cypress/support/pages/mp/login/mp-login-page.ts +++ b/cypress/support/pages/mp/login/mp-login-page.ts @@ -1,22 +1,22 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpLoginRepository } from './mp-login-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpLoginPage extends AbstractPage { - public PAGE_URL: string = '/security-merchant-portal-gui/login'; +export class MpLoginPage extends MpPage { + protected PAGE_URL: string = '/security-merchant-portal-gui/login'; constructor(@inject(MpLoginRepository) private repository: MpLoginRepository) { super(); } - public login = (user: User): void => { + public login = (username: string, password: string): void => { cy.visitMerchantPortal(this.PAGE_URL); - this.repository.getEmailInput().clear().type(user.username); - this.repository.getPasswordInput().clear().type(user.password); + this.repository.getEmailInput().clear().type(username); + this.repository.getPasswordInput().clear().type(password); this.repository.getSubmitButton().click(); }; diff --git a/cypress/support/pages/mp/mp-page.ts b/cypress/support/pages/mp/mp-page.ts new file mode 100644 index 00000000..17a0ba9f --- /dev/null +++ b/cypress/support/pages/mp/mp-page.ts @@ -0,0 +1,10 @@ +import 'reflect-metadata'; +import { injectable } from 'inversify'; +import { AbstractPage } from '../abstract-page'; + +@injectable() +export class MpPage extends AbstractPage { + public visit = (): void => { + cy.visitMerchantPortal(this.PAGE_URL); + } +} diff --git a/cypress/support/pages/mp/offers/mp-offers-page.ts b/cypress/support/pages/mp/offers/mp-offers-page.ts index 444d444d..c828fb14 100644 --- a/cypress/support/pages/mp/offers/mp-offers-page.ts +++ b/cypress/support/pages/mp/offers/mp-offers-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpOffersRepository } from './mp-offers-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpOffersPage extends AbstractPage { - public PAGE_URL: string = '/product-offer-merchant-portal-gui/product-offers'; +export class MpOffersPage extends MpPage { + protected PAGE_URL: string = '/product-offer-merchant-portal-gui/product-offers'; constructor(@inject(MpOffersRepository) private repository: MpOffersRepository) { super(); diff --git a/cypress/support/pages/mp/products/mp-products-page.ts b/cypress/support/pages/mp/products/mp-products-page.ts index 79befccb..d36099e3 100644 --- a/cypress/support/pages/mp/products/mp-products-page.ts +++ b/cypress/support/pages/mp/products/mp-products-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpProductsRepository } from './mp-products-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpProductsPage extends AbstractPage { - public PAGE_URL: string = '/product-merchant-portal-gui/products'; +export class MpProductsPage extends MpPage { + protected PAGE_URL: string = '/product-merchant-portal-gui/products'; constructor(@inject(MpProductsRepository) private repository: MpProductsRepository) { super(); diff --git a/cypress/support/pages/mp/profile/mp-profile-page.ts b/cypress/support/pages/mp/profile/mp-profile-page.ts index 7037fbe5..ecafa59d 100644 --- a/cypress/support/pages/mp/profile/mp-profile-page.ts +++ b/cypress/support/pages/mp/profile/mp-profile-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpProfileRepository } from './mp-profile-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpProfilePage extends AbstractPage { - public PAGE_URL: string = '/merchant-profile-merchant-portal-gui/profile'; +export class MpProfilePage extends MpPage { + protected PAGE_URL: string = '/merchant-profile-merchant-portal-gui/profile'; constructor(@inject(MpProfileRepository) private repository: MpProfileRepository) { super(); diff --git a/cypress/support/pages/mp/sales/mp-sales-orders-page.ts b/cypress/support/pages/mp/sales/mp-sales-orders-page.ts index bcb2e6bf..d82d4c27 100644 --- a/cypress/support/pages/mp/sales/mp-sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/mp-sales-orders-page.ts @@ -1,13 +1,13 @@ -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { MpSalesOrdersRepository } from './mp-sales-orders-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpSalesOrdersPage extends AbstractPage { - public PAGE_URL: string = '/sales-merchant-portal-gui/orders'; +export class MpSalesOrdersPage extends MpPage { + protected PAGE_URL: string = '/sales-merchant-portal-gui/orders'; constructor(@inject(MpSalesOrdersRepository) private repository: MpSalesOrdersRepository) { super(); 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 c20c5147..f59abe25 100644 --- a/cypress/support/pages/yves/agent-login/agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -1,23 +1,22 @@ -import { AbstractPage } from '../../abstract-page'; 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 {User} from "../../../types/user"; +import { YvesPage } from '../yves-page'; @injectable() @autoWired -export class AgentLoginPage extends AbstractPage { - public PAGE_URL: string = '/agent/login'; +export class AgentLoginPage extends YvesPage { + protected PAGE_URL: string = '/agent/login'; constructor(@inject(TYPES.YvesAgentLoginRepository) private repository: AgentLoginRepository) { super(); } - public login = (user: User): void => { - this.repository.getLoginEmailInput().clear().type(user.username); - this.repository.getLoginPasswordInput().clear().type(user.password); + public login = (username: string, password: string): void => { + this.repository.getLoginEmailInput().clear().type(username); + this.repository.getLoginPasswordInput().clear().type(password); this.repository.getLoginForm().submit(); }; diff --git a/cypress/support/pages/yves/agent-login/repositories/suite-yves-agent-login-repository.ts b/cypress/support/pages/yves/agent-login/repositories/suite-agent-login-repository.ts similarity index 85% rename from cypress/support/pages/yves/agent-login/repositories/suite-yves-agent-login-repository.ts rename to cypress/support/pages/yves/agent-login/repositories/suite-agent-login-repository.ts index 4a615d0a..a020cc9c 100644 --- a/cypress/support/pages/yves/agent-login/repositories/suite-yves-agent-login-repository.ts +++ b/cypress/support/pages/yves/agent-login/repositories/suite-agent-login-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { AgentLoginRepository } from '../agent-login-repository'; @injectable() -export class SuiteYvesAgentLoginRepository implements AgentLoginRepository { +export class SuiteAgentLoginRepository implements AgentLoginRepository { getLoginEmailInput = (): Cypress.Chainable => cy.get('#loginForm_email'); getLoginPasswordInput = (): Cypress.Chainable => cy.get('#loginForm_password'); getLoginForm = (): Cypress.Chainable => cy.get('form[name=loginForm]'); diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index 76545b2f..e18c1cc0 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -1,14 +1,14 @@ import 'reflect-metadata'; -import { AbstractPage } from '../../abstract-page'; import { inject, injectable } from 'inversify'; import { TYPES } from '../../../utils/inversify/types'; import { CartRepository } from './cart-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; +import { YvesPage } from '../yves-page'; @injectable() @autoWired -export class CartPage extends AbstractPage { - public PAGE_URL: string = '/cart'; +export class CartPage extends YvesPage { + protected PAGE_URL: string = '/cart'; constructor(@inject(TYPES.YvesCartRepository) private repository: CartRepository) { super(); @@ -39,10 +39,6 @@ export class CartPage extends AbstractPage { form.submit(); }; - public visit = (): void => { - cy.visit(this.PAGE_URL); - } - public changeQuantity = (sku: string, newQuantity: number): void => { const form = this.repository.findCartItemChangeQuantityForm(sku); const input = this.repository.getCartItemChangeQuantityField(sku); diff --git a/cypress/support/pages/yves/cart/repositories/b2b-yves-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts similarity index 95% rename from cypress/support/pages/yves/cart/repositories/b2b-yves-cart-repository.ts rename to cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts index 6e98415d..1fd8e27c 100644 --- a/cypress/support/pages/yves/cart/repositories/b2b-yves-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts @@ -3,7 +3,7 @@ import { injectable } from 'inversify'; import { CartRepository } from '../cart-repository'; @injectable() -export class B2bYvesCartRepository implements CartRepository { +export class B2bCartRepository implements CartRepository { getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[name="sku"]'); getQuickAddToCartQuantityField = (): Cypress.Chainable> => cy.get('#quantity'); getQuickAddToCartSubmitButton = (): Cypress.Chainable> => diff --git a/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts similarity index 95% rename from cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts rename to cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts index 19ff10a9..be72de97 100644 --- a/cypress/support/pages/yves/cart/repositories/suite-yves-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts @@ -3,7 +3,7 @@ import { injectable } from 'inversify'; import { CartRepository } from '../cart-repository'; @injectable() -export class SuiteYvesCartRepository implements CartRepository { +export class SuiteCartRepository implements CartRepository { getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[name="sku"]'); getQuickAddToCartQuantityField = (): Cypress.Chainable> => cy.get('#quantity'); getQuickAddToCartSubmitButton = (): Cypress.Chainable> => 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 6e41cd9e..7eebbdb8 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -1,16 +1,15 @@ -import { AbstractPage } from '../../../abstract-page'; 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 {CheckoutAddress} from "../../../../types/yves/checkout"; - +import { YvesPage } from '../../yves-page'; @injectable() @autoWired -export class CheckoutAddressPage extends AbstractPage { - public PAGE_URL: string = '/checkout/address'; +export class CheckoutAddressPage extends YvesPage { + protected PAGE_URL: string = '/checkout/address'; constructor(@inject(TYPES.YvesCheckoutAddressRepository) private repository: CheckoutAddressRepository) { super(); diff --git a/cypress/support/pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts similarity index 98% rename from cypress/support/pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository.ts rename to cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts index d794dbbd..297b4361 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() -export class SuiteYvesCheckoutAddressRepository implements CheckoutAddressRepository { +export class SuiteCheckoutAddressRepository implements CheckoutAddressRepository { getSelectShippingAddressField = (): Cypress.Chainable => cy.get('.select__select.js-address__form-select-shippingAddress'); getShippingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_first_name'); 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 63106ecb..919dd569 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -1,17 +1,15 @@ -import { AbstractPage } from '../../../abstract-page'; 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 {Guest} from "../../../../types/refactor_this_file_and_drop_it"; - - +import { YvesPage } from '../../yves-page'; @injectable() @autoWired -export class CheckoutCustomerPage extends AbstractPage { - public PAGE_URL: string = '/checkout/customer'; +export class CheckoutCustomerPage extends YvesPage { + protected PAGE_URL: string = '/checkout/customer'; constructor(@inject(TYPES.YvesCheckoutCustomerRepository) private repository: CheckoutCustomerRepository) { super(); diff --git a/cypress/support/pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts similarity index 89% rename from cypress/support/pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository.ts rename to cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts index c2c7eb0d..24e48822 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { CheckoutCustomerRepository } from '../checkout-customer-repository'; @injectable() -export class SuiteYvesCheckoutCustomerRepository implements CheckoutCustomerRepository { +export class SuiteCheckoutCustomerRepository implements CheckoutCustomerRepository { getGuestRadioButton = (): Cypress.Chainable => cy.get('[data-qa="component toggler-radio checkoutProceedAs guest"]'); getGuestFirstNameField = (): Cypress.Chainable => cy.get('#guestForm_customer_first_name'); getGuestLastNameField = (): Cypress.Chainable => cy.get('#guestForm_customer_last_name'); 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 900aca50..252c7c42 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -1,14 +1,14 @@ -import { AbstractPage } from '../../../abstract-page'; 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'; @injectable() @autoWired -export class CheckoutPaymentPage extends AbstractPage { - public PAGE_URL: string = '/checkout/payment'; +export class CheckoutPaymentPage extends YvesPage { + protected PAGE_URL: string = '/checkout/payment'; constructor(@inject(TYPES.YvesCheckoutPaymentRepository) private repository: CheckoutPaymentRepository) { super(); diff --git a/cypress/support/pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts similarity index 89% rename from cypress/support/pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository.ts rename to cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts index 7e6df951..1a545d3b 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { CheckoutPaymentRepository } from '../checkout-payment-repository'; @injectable() -export class SuiteYvesCheckoutPaymentRepository implements CheckoutPaymentRepository { +export class SuiteCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice'); getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); getGoToSummaryButton = (): Cypress.Chainable => cy.contains('button', 'Go to Summary'); 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 30dc91bf..304743b8 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -1,14 +1,14 @@ -import { AbstractPage } from '../../../abstract-page'; 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'; @injectable() @autoWired -export class CheckoutShipmentPage extends AbstractPage { - public PAGE_URL: string = '/checkout/shipment'; +export class CheckoutShipmentPage extends YvesPage { + protected PAGE_URL: string = '/checkout/shipment'; constructor(@inject(TYPES.YvesCheckoutShipmentRepository) private repository: CheckoutShipmentRepository) { super(); diff --git a/cypress/support/pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository.ts similarity index 86% rename from cypress/support/pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository.ts rename to cypress/support/pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository.ts index 60352c7e..7ab4d9b7 100644 --- a/cypress/support/pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/repositories/suite-checkout-shipment-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { CheckoutShipmentRepository } from '../checkout-shipment-repository'; @injectable() -export class SuiteYvesCheckoutShipmentRepository implements CheckoutShipmentRepository { +export class SuiteCheckoutShipmentRepository implements CheckoutShipmentRepository { getMultiShipmentItemElement = (): Cypress.Chainable => cy.get('.form__fields.grid.grid--bottom'); getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0`); 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 7b00ea26..2897d251 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -1,14 +1,14 @@ -import { AbstractPage } from '../../../abstract-page'; 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'; @injectable() @autoWired -export class CheckoutSummaryPage extends AbstractPage { - public PAGE_URL: string = '/checkout/summary'; +export class CheckoutSummaryPage extends YvesPage { + protected PAGE_URL: string = '/checkout/summary'; constructor(@inject(TYPES.YvesCheckoutSummaryRepository) private repository: CheckoutSummaryRepository) { super(); diff --git a/cypress/support/pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts similarity index 80% rename from cypress/support/pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository.ts rename to cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts index 6f00b9b6..f62075a5 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() -export class SuiteYvesCheckoutSummaryRepository implements CheckoutSummaryRepository { +export class SuiteCheckoutSummaryRepository implements CheckoutSummaryRepository { getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[name="acceptTermsAndConditions"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); } 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 de437c66..73473d08 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -1,23 +1,19 @@ import 'reflect-metadata'; -import { AbstractPage } from '../../../abstract-page'; 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 { YvesPage } from '../../yves-page'; @injectable() @autoWired -export class CommentCartPage extends AbstractPage { - public PAGE_URL: string = '/cart'; +export class CommentCartPage extends YvesPage { + protected PAGE_URL: string = '/cart'; constructor(@inject(TYPES.YvesCommentCartRepository) private repository: CommentCartRepository) { super(); } - public visit = (): void => { - cy.visit(this.PAGE_URL); - } - public addComment = (commentMessage: string): void => { this.repository.getAddCommentForm().last().find('textarea').clear().type(commentMessage); this.repository.getAddCommentForm().last().find(this.repository.getAddCommentButtonSelector()).click(); @@ -29,12 +25,14 @@ export class CommentCartPage extends AbstractPage { this.getCommentThreadListSection().first().find(this.repository.getUpdateCommentButtonSelector()).click(); }; + public 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 => { this.repository .getCommentTextareaByCommentText(commentMessage) diff --git a/cypress/support/pages/yves/comment/cart/comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/comment-cart-repository.ts index dfaa5139..76ae9823 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-repository.ts @@ -4,8 +4,6 @@ export interface CommentCartRepository { getAddCommentButtonSelector(): string; getRemoveCommentButtonSelector(): string; getFirstCommentTextarea(): Cypress.Chainable; - getCommentTextareaByCommentText(commentText: string): Cypress.Chainable; - getUpdateCommentButtonSelector(): string; } diff --git a/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts similarity index 92% rename from cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts rename to cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts index eb4592ba..91e72bf8 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts @@ -3,7 +3,7 @@ import { injectable } from 'inversify'; import { CommentCartRepository } from '../comment-cart-repository'; @injectable() -export class B2bYvesCommentCartRepository implements CommentCartRepository { +export class B2bCommentCartRepository implements CommentCartRepository { getAddCommentForm = (): Cypress.Chainable => cy.get('[data-qa="component add-comment-form"]'); getCommentThreadListSection = (): Cypress.Chainable => cy.get('[data-qa="component comment-thread-list"]'); getAddCommentButtonSelector = (): string => '[data-qa="component icon"]'; diff --git a/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/suite-comment-cart-repository.ts similarity index 91% rename from cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts rename to cypress/support/pages/yves/comment/cart/repositories/suite-comment-cart-repository.ts index d29795c9..f780f7d6 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/suite-comment-cart-repository.ts @@ -3,7 +3,7 @@ import { injectable } from 'inversify'; import { CommentCartRepository } from '../comment-cart-repository'; @injectable() -export class SuiteYvesCommentCartRepository implements CommentCartRepository { +export class SuiteCommentCartRepository implements CommentCartRepository { getAddCommentForm = (): Cypress.Chainable => cy.get('[data-qa="component comment-form"]'); getCommentThreadListSection = (): Cypress.Chainable => cy.get('[data-qa="component comment-thread-list"]'); getAddCommentButtonSelector = (): string => 'button:contains("Add")'; diff --git a/cypress/support/pages/yves/login/login-page.ts b/cypress/support/pages/yves/login/login-page.ts index e31098eb..3c4dff85 100644 --- a/cypress/support/pages/yves/login/login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -1,30 +1,24 @@ -import { AbstractPage } from '../../abstract-page'; 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'; @injectable() @autoWired -export class LoginPage extends AbstractPage { - public PAGE_URL: string = '/login'; - - private DEFAULT_SALUTATION: string = 'Mr'; - private DEFAULT_PASSWORD_PREFIX: string = 'Change123@_'; +export class LoginPage extends YvesPage { + protected PAGE_URL: string = '/login'; constructor(@inject(TYPES.YvesLoginRepository) private repository: LoginRepository) { super(); } public login = (email: string, password: string): void => { - cy.session([email, password], () => { - cy.visit(this.PAGE_URL); - this.repository.getLoginEmailInput().clear().type(email); - this.repository.getLoginPasswordInput().clear().type(password); + this.repository.getLoginEmailInput().clear().type(email); + this.repository.getLoginPasswordInput().clear().type(password); - this.repository.getLoginForm().submit(); - }); + this.repository.getLoginForm().submit(); }; public getFailedAuthenticationText = (): string => { diff --git a/cypress/support/pages/yves/login/repositories/b2b-yves-login-repository.ts b/cypress/support/pages/yves/login/repositories/b2b-login-repository.ts similarity index 94% rename from cypress/support/pages/yves/login/repositories/b2b-yves-login-repository.ts rename to cypress/support/pages/yves/login/repositories/b2b-login-repository.ts index 4be1bb27..3e1837c4 100644 --- a/cypress/support/pages/yves/login/repositories/b2b-yves-login-repository.ts +++ b/cypress/support/pages/yves/login/repositories/b2b-login-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { LoginRepository } from '../login-repository'; @injectable() -export class B2bYvesLoginRepository implements LoginRepository { +export class B2bLoginRepository implements LoginRepository { getLoginEmailInput = (): Cypress.Chainable => cy.get('#loginForm_email'); getLoginPasswordInput = (): Cypress.Chainable => cy.get('#loginForm_password'); getLoginForm = (): Cypress.Chainable => cy.get('form[name=loginForm]'); diff --git a/cypress/support/pages/yves/login/repositories/suite-yves-login-repository.ts b/cypress/support/pages/yves/login/repositories/suite-login-repository.ts similarity index 94% rename from cypress/support/pages/yves/login/repositories/suite-yves-login-repository.ts rename to cypress/support/pages/yves/login/repositories/suite-login-repository.ts index 2fff6705..2ec28051 100644 --- a/cypress/support/pages/yves/login/repositories/suite-yves-login-repository.ts +++ b/cypress/support/pages/yves/login/repositories/suite-login-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { LoginRepository } from '../login-repository'; @injectable() -export class SuiteYvesLoginRepository implements LoginRepository { +export class SuiteLoginRepository implements LoginRepository { getLoginEmailInput = (): Cypress.Chainable => cy.get('#loginForm_email'); getLoginPasswordInput = (): Cypress.Chainable => cy.get('#loginForm_password'); getLoginForm = (): Cypress.Chainable => cy.get('form[name=loginForm]'); 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 84537f13..a49c5d2a 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -1,14 +1,14 @@ -import { AbstractPage } from '../../abstract-page'; 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'; @injectable() @autoWired -export class MultiCartPage extends AbstractPage { - public PAGE_URL: string = '/multi-cart'; +export class MultiCartPage extends YvesPage { + protected PAGE_URL: string = '/multi-cart'; constructor(@inject(TYPES.YvesMultiCartRepository) private repository: MultiCartRepository) { super(); diff --git a/cypress/support/pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts similarity index 80% rename from cypress/support/pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository.ts rename to cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts index e686c7ca..faee5049 100644 --- a/cypress/support/pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { MultiCartRepository } from '../multi-cart-repository'; @injectable() -export class B2bYvesMultiCartRepository implements MultiCartRepository { +export class B2bMultiCartRepository implements MultiCartRepository { getCreateCartNameInput = (): Cypress.Chainable => cy.get('#quoteForm_name'); getCreateCartForm = (): Cypress.Chainable => cy.get('form[name=quoteForm]'); } diff --git a/cypress/support/pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/repositories/suite-multi-cart-repository.ts similarity index 80% rename from cypress/support/pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository.ts rename to cypress/support/pages/yves/multi-cart/repositories/suite-multi-cart-repository.ts index 194b36bb..92b19ede 100644 --- a/cypress/support/pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/repositories/suite-multi-cart-repository.ts @@ -3,7 +3,7 @@ import 'reflect-metadata'; import { MultiCartRepository } from '../multi-cart-repository'; @injectable() -export class SuiteYvesMultiCartRepository implements MultiCartRepository { +export class SuiteMultiCartRepository implements MultiCartRepository { getCreateCartNameInput = (): Cypress.Chainable => cy.get('#quoteForm_name'); getCreateCartForm = (): Cypress.Chainable => cy.get('form[name=quoteForm]'); } diff --git a/cypress/support/pages/yves/yves-page.ts b/cypress/support/pages/yves/yves-page.ts new file mode 100644 index 00000000..f4b6f38e --- /dev/null +++ b/cypress/support/pages/yves/yves-page.ts @@ -0,0 +1,10 @@ +import 'reflect-metadata'; +import { injectable } from 'inversify'; +import { AbstractPage } from '../abstract-page'; + +@injectable() +export class YvesPage extends AbstractPage { + public visit = (): void => { + cy.visit(this.PAGE_URL); + } +} diff --git a/cypress/support/scenarios/backoffice/backoffice-login-user-scenario.ts b/cypress/support/scenarios/backoffice/backoffice-login-user-scenario.ts deleted file mode 100644 index 192adbd6..00000000 --- a/cypress/support/scenarios/backoffice/backoffice-login-user-scenario.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { inject, injectable } from 'inversify'; -import { BackofficeLoginPage } from '../../pages/backoffice/login/backoffice-login-page'; -import { autoWired } from '../../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class BackofficeLoginUserScenario { - constructor(@inject(BackofficeLoginPage) private loginPage: BackofficeLoginPage) {} - - public execute = (user: User): void => { - cy.visitBackoffice(this.loginPage.PAGE_URL); - this.loginPage.login(user); - }; -} diff --git a/cypress/support/scenarios/backoffice/index.ts b/cypress/support/scenarios/backoffice/index.ts index 060fcaf5..ee32f11f 100644 --- a/cypress/support/scenarios/backoffice/index.ts +++ b/cypress/support/scenarios/backoffice/index.ts @@ -1,3 +1,3 @@ -export * from './backoffice-login-user-scenario'; +export * from './user-login-scenario'; export * from './create-root-user-scenario'; diff --git a/cypress/support/scenarios/backoffice/user-login-scenario.ts b/cypress/support/scenarios/backoffice/user-login-scenario.ts new file mode 100644 index 00000000..7dfac19d --- /dev/null +++ b/cypress/support/scenarios/backoffice/user-login-scenario.ts @@ -0,0 +1,16 @@ +import { inject, injectable } from 'inversify'; +import { LoginPage } from '../../pages/backoffice/login/login-page'; +import { autoWired } from '../../utils/inversify/auto-wired'; + +@injectable() +@autoWired +export class UserLoginScenario { + constructor(@inject(LoginPage) private loginPage: LoginPage) {} + + public 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/.gitkeep b/cypress/support/scenarios/mp/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/cypress/support/scenarios/yves/agent-login-scenario.ts b/cypress/support/scenarios/yves/agent-login-scenario.ts index a1d5189d..747bcf66 100644 --- a/cypress/support/scenarios/yves/agent-login-scenario.ts +++ b/cypress/support/scenarios/yves/agent-login-scenario.ts @@ -1,14 +1,16 @@ import { inject, injectable } from 'inversify'; import { autoWired } from '../../utils/inversify/auto-wired'; -import { AgentLoginPage } from '../../pages/yves/agent-login/agent-login-page'; +import { AgentLoginPage } from '../../pages/yves'; @injectable() @autoWired export class AgentLoginScenario { constructor(@inject(AgentLoginPage) private loginPage: AgentLoginPage) {} - public execute = (user: User): void => { - cy.visit(this.loginPage.PAGE_URL); - this.loginPage.login(user); + public 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/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index 9afec337..b24e39ae 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -8,6 +8,9 @@ export class CustomerLoginScenario { constructor(@inject(LoginPage) private loginPage: LoginPage) {} public execute = (email: string, password: string): void => { - this.loginPage.login(email, password); + cy.session([email, password], () => { + this.loginPage.visit(); + this.loginPage.login(email, password); + }); }; } diff --git a/cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts b/cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts deleted file mode 100644 index 452ace0c..00000000 --- a/cypress/support/scenarios/yves/place-guest-mp-order-scenario.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { inject, injectable } from 'inversify'; -import 'reflect-metadata'; -import { CartPage } from '../../pages/yves/cart/cart-page'; -import { CheckoutCustomerPage } from '../../pages/yves/checkout/customer/checkout-customer-page'; -import { CheckoutAddressPage } from '../../pages/yves/checkout/address/checkout-address-page'; -import { CheckoutShipmentPage } from '../../pages/yves/checkout/shipment/checkout-shipment-page'; -import { CheckoutPaymentPage } from '../../pages/yves/checkout/payment/checkout-payment-page'; -import { CheckoutSummaryPage } from '../../pages/yves/checkout/summary/checkout-summary-page'; -import { autoWired } from '../../utils/inversify/auto-wired'; -import { CliHelper } from '../../helpers/cli-helper'; -import {Guest} from "../../types/refactor_this_file_and_drop_it"; - -@injectable() -@autoWired -export class PlaceGuestMpOrderScenario { - constructor( - @inject(CartPage) private cartPage: CartPage, - @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage, - @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage, - @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage, - @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage, - @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage, - @inject(CliHelper) private cliHelper: CliHelper - ) {} - - public execute = (productSkus: string[]): Guest => { - cy.visit(this.cartPage.PAGE_URL); - productSkus.forEach((productSku: string) => { - this.cartPage.quickAddToCart(productSku, 1); - }); - - this.cartPage.startCheckout(); - - const guest: Guest = this.checkoutCustomerPage.checkoutAsGuest(); - this.checkoutAddressPage.fillShippingAddress(); - this.checkoutShipmentPage.setStandardShippingMethod(); - this.checkoutPaymentPage.setDummyMarketplacePaymentMethod(); - this.checkoutSummaryPage.placeOrder(); - - this.cliHelper.run('console oms:check-condition'); - this.cliHelper.run('console oms:check-timeout'); - - return guest; - }; -} diff --git a/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts b/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts index 56d052a8..71be2206 100644 --- a/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts +++ b/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts @@ -1,7 +1,11 @@ -export interface CheckoutByLoggedInCustomerStaticFixtures { - customer: Customer; +export interface CustomerAgentLoginPageStaticFixtures { + rootUser: User; + merchantAgentUser: User; + customerAgentUser: User; + merchantUser: User; } -interface Customer { +interface User { + username: string; password: string; } diff --git a/cypress/support/types/yves/cart/comment/common/product.ts b/cypress/support/types/yves/comments/cart/common/product.ts similarity index 100% rename from cypress/support/types/yves/cart/comment/common/product.ts rename to cypress/support/types/yves/comments/cart/common/product.ts diff --git a/cypress/support/types/yves/cart/comment/common/quote.ts b/cypress/support/types/yves/comments/cart/common/quote.ts similarity index 100% rename from cypress/support/types/yves/cart/comment/common/quote.ts rename to cypress/support/types/yves/comments/cart/common/quote.ts diff --git a/cypress/support/types/yves/cart/comment/dynamic-fixture-types.ts b/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts similarity index 79% rename from cypress/support/types/yves/cart/comment/dynamic-fixture-types.ts rename to cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts index f169e7e1..7cf2e803 100644 --- a/cypress/support/types/yves/cart/comment/dynamic-fixture-types.ts +++ b/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts @@ -1,8 +1,7 @@ import {Quote} from "./common/quote"; import {Product} from "./common/product"; - -export interface CartCommentDynamicFixtures { +export interface DynamicFixtures { quote: Quote; customer: Customer; product: Product; diff --git a/cypress/support/types/yves/cart/comment/index.ts b/cypress/support/types/yves/comments/cart/index.ts similarity index 100% rename from cypress/support/types/yves/cart/comment/index.ts rename to cypress/support/types/yves/comments/cart/index.ts diff --git a/cypress/support/types/yves/cart/comment/static-fixture-types.ts b/cypress/support/types/yves/comments/cart/static-fixture-types.ts similarity index 79% rename from cypress/support/types/yves/cart/comment/static-fixture-types.ts rename to cypress/support/types/yves/comments/cart/static-fixture-types.ts index 465e22ef..dd3d6598 100644 --- a/cypress/support/types/yves/cart/comment/static-fixture-types.ts +++ b/cypress/support/types/yves/comments/cart/static-fixture-types.ts @@ -1,4 +1,4 @@ -export interface CartCommentStaticFixtures { +export interface StaticFixtures { commentsToAdd: string[]; commentToModify: string; modifiedComment: string; diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index 09407c89..e588e009 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -2,43 +2,43 @@ import 'reflect-metadata'; import { Container } from 'inversify'; import { TYPES } from './types'; -import { B2bYvesMultiCartRepository } from '../../pages/yves/multi-cart/repositories/b2b-yves-multi-cart-repository'; -import { B2bYvesCommentCartRepository } from '../../pages/yves/comment/cart/repositories/b2b-yves-comment-cart-repository'; -import { SuiteYvesMultiCartRepository } from '../../pages/yves/multi-cart/repositories/suite-yves-multi-cart-repository'; -import { SuiteYvesCommentCartRepository } from '../../pages/yves/comment/cart/repositories/suite-yves-comment-cart-repository'; -import { SuiteYvesAgentLoginRepository } from '../../pages/yves/agent-login/repositories/suite-yves-agent-login-repository'; -import { SuiteYvesLoginRepository } from '../../pages/yves/login/repositories/suite-yves-login-repository'; -import { B2bYvesLoginRepository } from '../../pages/yves/login/repositories/b2b-yves-login-repository'; -import { SuiteYvesCartRepository } from '../../pages/yves/cart/repositories/suite-yves-cart-repository'; -import { SuiteYvesCheckoutCustomerRepository } from '../../pages/yves/checkout/customer/repositories/suite-yves-checkout-customer-repository'; -import { SuiteYvesCheckoutAddressRepository } from '../../pages/yves/checkout/address/repositories/suite-yves-checkout-address-repository'; -import { SuiteYvesCheckoutShipmentRepository } from '../../pages/yves/checkout/shipment/repositories/suite-yves-checkout-shipment-repository'; -import { SuiteYvesCheckoutPaymentRepository } from '../../pages/yves/checkout/payment/repositories/suite-yves-checkout-payment-repository'; -import { SuiteYvesCheckoutSummaryRepository } from '../../pages/yves/checkout/summary/repositories/suite-yves-checkout-summary-repository'; -import { B2bYvesCartRepository } from '../../pages/yves/cart/repositories/b2b-yves-cart-repository'; +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 { 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 { SuiteCheckoutPaymentRepository } from '../../pages/yves/checkout/payment/repositories/suite-checkout-payment-repository'; +import { SuiteCheckoutSummaryRepository } from '../../pages/yves/checkout/summary/repositories/suite-checkout-summary-repository'; +import { B2bCartRepository } from '../../pages/yves/cart/repositories/b2b-cart-repository'; // eslint-disable-next-line @typescript-eslint/no-explicit-any type ClassConstructor = new (...args: any[]) => any; type BindingsMap = { [key: string]: ClassConstructor }; const suiteMappings: BindingsMap = { - [TYPES.YvesLoginRepository]: SuiteYvesLoginRepository, - [TYPES.YvesCartRepository]: SuiteYvesCartRepository, - [TYPES.YvesMultiCartRepository]: SuiteYvesMultiCartRepository, - [TYPES.YvesCommentCartRepository]: SuiteYvesCommentCartRepository, - [TYPES.YvesCheckoutCustomerRepository]: SuiteYvesCheckoutCustomerRepository, - [TYPES.YvesCheckoutAddressRepository]: SuiteYvesCheckoutAddressRepository, - [TYPES.YvesCheckoutShipmentRepository]: SuiteYvesCheckoutShipmentRepository, - [TYPES.YvesCheckoutPaymentRepository]: SuiteYvesCheckoutPaymentRepository, - [TYPES.YvesCheckoutSummaryRepository]: SuiteYvesCheckoutSummaryRepository, - [TYPES.YvesAgentLoginRepository]: SuiteYvesAgentLoginRepository, + [TYPES.YvesLoginRepository]: SuiteLoginRepository, + [TYPES.YvesCartRepository]: SuiteCartRepository, + [TYPES.YvesMultiCartRepository]: SuiteMultiCartRepository, + [TYPES.YvesCommentCartRepository]: SuiteCommentCartRepository, + [TYPES.YvesCheckoutCustomerRepository]: SuiteCheckoutCustomerRepository, + [TYPES.YvesCheckoutAddressRepository]: SuiteCheckoutAddressRepository, + [TYPES.YvesCheckoutShipmentRepository]: SuiteCheckoutShipmentRepository, + [TYPES.YvesCheckoutPaymentRepository]: SuiteCheckoutPaymentRepository, + [TYPES.YvesCheckoutSummaryRepository]: SuiteCheckoutSummaryRepository, + [TYPES.YvesAgentLoginRepository]: SuiteAgentLoginRepository, }; const b2bMappings: BindingsMap = { - [TYPES.YvesLoginRepository]: B2bYvesLoginRepository, - [TYPES.YvesCartRepository]: B2bYvesCartRepository, - [TYPES.YvesMultiCartRepository]: B2bYvesMultiCartRepository, - [TYPES.YvesCommentCartRepository]: B2bYvesCommentCartRepository, + [TYPES.YvesLoginRepository]: B2bLoginRepository, + [TYPES.YvesCartRepository]: B2bCartRepository, + [TYPES.YvesMultiCartRepository]: B2bMultiCartRepository, + [TYPES.YvesCommentCartRepository]: B2bCommentCartRepository, }; const container = new Container(); diff --git a/package-lock.json b/package-lock.json index c1c6888b..fc38f50e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "cypress-spryker-poc", + "name": "spryker-cypress-tests", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "cypress-spryker-poc", + "name": "spryker-cypress-tests", "version": "0.1.0", "license": "MIT", "devDependencies": { @@ -14,7 +14,7 @@ "@types/dotenv": "^8.2.0", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", - "cypress": "^13.6.3", + "cypress": "^13.6.6", "eslint": "^8.55.0", "inversify": "^6.0.2", "prettier": "3.1.0", @@ -1733,9 +1733,9 @@ } }, "node_modules/cypress": { - "version": "13.6.5", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.5.tgz", - "integrity": "sha512-2NxSDcO2zHw5kTcosc6dzv2zppEqiXrFFhZw5cx/EWrSNZABTzpr/EyvYzGgrWm46o5173JUfuJfDQcaiZZPVQ==", + "version": "13.6.6", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.6.tgz", + "integrity": "sha512-S+2S9S94611hXimH9a3EAYt81QM913ZVA03pUmGDfLTFa5gyp85NJ8dJGSlEAEmyRsYkioS1TtnWtbv/Fzt11A==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/package.json b/package.json index bc09a93d..8524ac05 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,13 @@ { - "name": "cypress-spryker-poc", + "name": "spryker-cypress-tests", "version": "0.1.0", - "description": "", + "description": "End-to-end tests for Spryker applications.", "main": "index.js", - "author": "dmiseev@gmail.com", + "author": { + "name": "Spryker Systems GmbH", + "email": "info@spryker.com", + "url": "https://spryker.com/" + }, "license": "MIT", "scripts": { "lint": "eslint . --ext .ts", @@ -11,18 +15,17 @@ "prettier:write": "npx prettier . --write", "cy:open": "cypress open", "cy:run": "cypress run --headless --browser chrome", - "test:tag:smoke": "npx cypress run --env grepTags=@smoke --headless --browser chrome", - "test:feture:checkout": "npx cypress run --spec \"cypress/e2e/checkout/*\" --headless --browser chrome", - "test:feture:comment": "npx cypress run --spec \"cypress/e2e/comment/*\" --headless --browser chrome", - "test:feture:merchant-agent-assist": "npx cypress run --spec \"cypress/e2e/merchant-agent-assist/*\" --headless --browser chrome", - "test:feture:order-management": "npx cypress run --spec \"cypress/e2e/order-management/*\" --headless --browser chrome" + "cy:yves": "npx cypress run --spec cypress/e2e/yves/* --headless --browser chrome", + "cy:backoffice": "npx cypress run --spec cypress/e2e/backoffice/* --headless --browser chrome", + "cy:mp": "npx cypress run --spec cypress/e2e/mp/* --headless --browser chrome", + "cy:smoke": "npx cypress run --env grepTags=@smoke --headless --browser chrome" }, "engines": { "node": ">=18.0.0", "npm": ">=10.0.0" }, "devDependencies": { - "cypress": "^13.6.3", + "cypress": "^13.6.6", "@cypress/grep": "^4.0.1", "@faker-js/faker": "^8.3.1", "@types/dotenv": "^8.2.0", diff --git a/readme.md b/readme.md index 503a634f..7ab852a1 100644 --- a/readme.md +++ b/readme.md @@ -1,35 +1,16 @@ -# Cypress Spryker [POC] - -_This project serves as a proof of concept to evaluate Cypress as an effective tool for end-to-end (E2E) testing. It aims to demonstrate the capabilities, ease of use, and integration features of Cypress within a typical web application development workflow._ - -_By implementing a variety of test cases, the project showcases how Cypress can be utilized for comprehensive E2E testing, highlighting its strengths in terms of readability, maintainability, and robustness in handling various testing scenarios._ - -_The insights gained from this project will guide decisions on whether Cypress is the suitable choice for future web application testing needs._ - ## Setup -- **Install Dependencies:** `npm install` -- **Environment Configuration:** - - Copy the `.env.example` file to a new file named `.env`. - - Open the `.env` file and fill in the necessary environment variables. These variables will be used by Cypress for various configurations. - -## Running Tests - -Run Cypress tests with: - -```bash -npm run cy:open -``` - -## Environment Variables - -Ensure to specify the required environment variables in the `.env` file. For example: +- **Install Dependencies:** To get started, run `npm install` to install all necessary dependencies. +- **Environment Configuration:** Copy the `.env.example` file to a new file named `.env`. -- `ENV_MAIL_CATCHER_URL`: URL for the mail catcher service. -- `E2E_BASE_URL`: The base URL for your E2E tests. +## About This Package -These variables will be loaded into Cypress's configuration as per the setup in the Cypress configuration file. +This package is used for end-to-end (E2E) testing with Cypress at Spryker. It provides a robust and +efficient way to ensure the quality of our web applications by automating the testing process. By +using this package, we can simulate real user interactions and catch potential issues before they +reach production. ## Contributing -Feel free to fork and submit pull requests. +While this package is primarily for internal use at Spryker, we welcome contributions that can +improve its functionality and efficiency. Feel free to fork the repository and submit pull requests. From f20dd5fa90889d942ff0e2d56bb244b7b90e4668 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 26 Feb 2024 20:15:33 +0300 Subject: [PATCH 10/53] Updated readme and package.json. --- package.json | 2 +- readme.md | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 8524ac05..0190727a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "spryker-cypress-tests", + "name": "cypress-tests", "version": "0.1.0", "description": "End-to-end tests for Spryker applications.", "main": "index.js", diff --git a/readme.md b/readme.md index 7ab852a1..e0c7eafe 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,36 @@ +## Description + +This repository is dedicated to housing an extensive collection of UI end-to-end tests, meticulously crafted using +Cypress for Spryker applications. These tests are designed to thoroughly evaluate the user interface, ensuring that all +interactions and visual elements function as intended in real-world scenarios. By leveraging Cypress's advanced browser +automation capabilities, this suite provides an efficient and effective means of validating the user experience, +confirming the seamless operation and aesthetic integrity of Spryker's front-end components. Our commitment to rigorous +UI testing helps maintain the high standard of quality and reliability that Spryker users expect. + ## Setup -- **Install Dependencies:** To get started, run `npm install` to install all necessary dependencies. -- **Environment Configuration:** Copy the `.env.example` file to a new file named `.env`. +To get started with these tests, follow these setup steps: + +1. **Install Dependencies:** + +- Install all necessary dependencies required for running the tests. + ```bash + npm install + ``` + +2. **Environment Configuration:** + +- Set up your environment variables for Cypress. + - Copy the `.env.example` file to a new file named `.env`. + - Open the `.env` file and fill in the necessary environment variables. + - These variables are crucial for Cypress to connect with your Spryker application and perform tests effectively. -## About This Package +## Running Tests -This package is used for end-to-end (E2E) testing with Cypress at Spryker. It provides a robust and -efficient way to ensure the quality of our web applications by automating the testing process. By -using this package, we can simulate real user interactions and catch potential issues before they -reach production. +To run the Cypress tests, use the following command: -## Contributing +```bash +npm run cy:open +``` -While this package is primarily for internal use at Spryker, we welcome contributions that can -improve its functionality and efficiency. Feel free to fork the repository and submit pull requests. +This command opens the Cypress Test Runner, a powerful interface that allows you to see tests running in real time. From 218331431715a9629fdcbcebcf157fdde117f1d2 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 26 Feb 2024 22:49:16 +0300 Subject: [PATCH 11/53] Refactored backoffice agent-assist spec file [slip ci] --- .../agent-permission-in-backoffice.cy.ts | 102 +++++++++++++++++ .../agent-permission-in-backoffice.cy.ts | 104 ------------------ .../customer-agent-login-page.cy.ts | 4 +- .../agent-permission-in-backoffice.json | 36 ++++++ .../agent-permission-in-backoffice.json | 2 +- cypress/support/pages/backoffice/index.ts | 13 +++ ...e-page.ts => merchant-user-create-page.ts} | 6 +- ....ts => merchant-user-create-repository.ts} | 2 +- ...create-page.ts => merchant-create-page.ts} | 6 +- ...itory.ts => merchant-create-repository.ts} | 2 +- ...ant-list-page.ts => merchant-list-page.ts} | 6 +- ...ository.ts => merchant-list-repository.ts} | 2 +- ...update-page.ts => merchant-update-page.ts} | 6 +- ...itory.ts => merchant-update-repository.ts} | 2 +- ...age.ts => sales-return-gui-create-page.ts} | 6 +- ... => sales-return-gui-create-repository.ts} | 2 +- ...es-detail-page.ts => sales-detail-page.ts} | 6 +- ...pository.ts => sales-detail-repository.ts} | 2 +- ...ales-index-page.ts => sales-index-page.ts} | 6 +- ...epository.ts => sales-index-repository.ts} | 2 +- ...ser-create-page.ts => user-create-page.ts} | 6 +- ...epository.ts => user-create-repository.ts} | 2 +- ...ser-delete-page.ts => user-delete-page.ts} | 6 +- ...epository.ts => user-delete-repository.ts} | 2 +- ...-user-index-page.ts => user-index-page.ts} | 6 +- ...repository.ts => user-index-repository.ts} | 2 +- ...ser-update-page.ts => user-update-page.ts} | 6 +- ...epository.ts => user-update-repository.ts} | 2 +- .../backoffice/create-merchant-scenario.ts | 8 +- .../create-merchant-user-scenario.ts | 20 ++-- .../backoffice/create-root-user-scenario.ts | 9 +- .../dynamic-fixture-types.ts | 8 ++ .../marketplace-agent-assist/index.ts | 2 + .../static-fixture-types.ts | 10 ++ .../index.ts | 0 .../static-fixture-types.ts | 0 36 files changed, 236 insertions(+), 170 deletions(-) create mode 100644 cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts delete mode 100644 cypress/e2e/backoffice/order-management/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts create mode 100644 cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json rename cypress/fixtures/suite/backoffice/{order-management => }/marketplace-agent-assist/static/agent-permission-in-backoffice.json (94%) create mode 100644 cypress/support/pages/backoffice/index.ts rename cypress/support/pages/backoffice/merchant-user/create/{backoffice-merchant-user-create-page.ts => merchant-user-create-page.ts} (78%) rename cypress/support/pages/backoffice/merchant-user/create/{backoffice-merchant-user-create-repository.ts => merchant-user-create-repository.ts} (90%) rename cypress/support/pages/backoffice/merchant/create/{backoffice-merchant-create-page.ts => merchant-create-page.ts} (80%) rename cypress/support/pages/backoffice/merchant/create/{backoffice-merchant-create-repository.ts => merchant-create-repository.ts} (93%) rename cypress/support/pages/backoffice/merchant/list/{backoffice-merchant-list-page.ts => merchant-list-page.ts} (87%) rename cypress/support/pages/backoffice/merchant/list/{backoffice-merchant-list-repository.ts => merchant-list-repository.ts} (93%) rename cypress/support/pages/backoffice/merchant/update/{backoffice-merchant-update-page.ts => merchant-update-page.ts} (75%) rename cypress/support/pages/backoffice/merchant/update/{backoffice-merchant-update-repository.ts => merchant-update-repository.ts} (91%) rename cypress/support/pages/backoffice/sales-return-gui/create/{backoffice-sales-return-gui-create-page.ts => sales-return-gui-create-page.ts} (62%) rename cypress/support/pages/backoffice/sales-return-gui/create/{backoffice-sales-return-gui-create-repository.ts => sales-return-gui-create-repository.ts} (87%) rename cypress/support/pages/backoffice/sales/detail/{backoffice-sales-detail-page.ts => sales-detail-page.ts} (81%) rename cypress/support/pages/backoffice/sales/detail/{backoffice-sales-detail-repository.ts => sales-detail-repository.ts} (90%) rename cypress/support/pages/backoffice/sales/index/{backoffice-sales-index-page.ts => sales-index-page.ts} (62%) rename cypress/support/pages/backoffice/sales/index/{backoffice-sales-index-repository.ts => sales-index-repository.ts} (83%) rename cypress/support/pages/backoffice/user/create/{backoffice-user-create-page.ts => user-create-page.ts} (87%) rename cypress/support/pages/backoffice/user/create/{backoffice-user-create-repository.ts => user-create-repository.ts} (95%) rename cypress/support/pages/backoffice/user/delete/{backoffice-user-delete-page.ts => user-delete-page.ts} (60%) rename cypress/support/pages/backoffice/user/delete/{backoffice-user-delete-repository.ts => user-delete-repository.ts} (84%) rename cypress/support/pages/backoffice/user/index/{backoffice-user-index-page.ts => user-index-page.ts} (87%) rename cypress/support/pages/backoffice/user/index/{backoffice-user-index-repository.ts => user-index-repository.ts} (94%) rename cypress/support/pages/backoffice/user/update/{backoffice-user-update-page.ts => user-update-page.ts} (79%) rename cypress/support/pages/backoffice/user/update/{backoffice-user-update-repository.ts => user-update-repository.ts} (92%) create mode 100644 cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts create mode 100644 cypress/support/types/backoffice/marketplace-agent-assist/index.ts create mode 100644 cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts rename cypress/support/types/mp/{merchant-agent-assist => marketplace-agent-assist}/index.ts (100%) rename cypress/support/types/mp/{merchant-agent-assist => marketplace-agent-assist}/static-fixture-types.ts (100%) diff --git a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts new file mode 100644 index 00000000..2da406e7 --- /dev/null +++ b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts @@ -0,0 +1,102 @@ +import { UserIndexPage, UserUpdatePage } from '../../../support/pages/backoffice'; +import { UserLoginScenario } from '../../../support/scenarios/backoffice'; +import { container } from '../../../support/utils/inversify/inversify.config'; +import { DynamicFixtures, StaticFixtures } from '../../../support/types/backoffice/marketplace-agent-assist'; + +/** + * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} + */ +describe('agent permission in backoffice', (): void => { + const userIndexPage: UserIndexPage = container.get(UserIndexPage); + const userUpdatePage: UserUpdatePage = container.get(UserUpdatePage); + const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: StaticFixtures; + let dynamicFixtures: DynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + cy.resetBackofficeCookies(); + }); + + beforeEach((): void => { + userLoginScenario.execute(staticFixtures.rootUser.username, staticFixtures.rootUser.password); + }); + + it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { + userIndexPage.visit(); + userIndexPage.editUser(staticFixtures.rootUser.username); + + userUpdatePage + .getAgentMerchantCheckbox() + .should('exist') + .parent() + .contains('This user is an agent in Merchant Portal'); + }); + + it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { + userIndexPage.visit(); + userIndexPage.editUser(staticFixtures.rootUser.username); + + userUpdatePage.getAgentCustomerCheckbox().should('exist').parent().contains('This user is an agent in Storefront'); + }); + + it('backoffice user should be able to see existing user with merchant agent permission', (): void => { + userIndexPage.visit(); + userIndexPage.editUser(staticFixtures.merchantAgentUser.username); + + userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); + + it('backoffice user should be able to see "Agent Customer" column in user table', (): void => { + userIndexPage.visit(); + userIndexPage.getUserTableHeader().contains('Agent Customer'); + }); + + it('backoffice user should be able to see "Agent Merchant" column in user table', (): void => { + userIndexPage.visit(); + userIndexPage.getUserTableHeader().contains('Agent Merchant'); + }); + + it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => { + userIndexPage.visit(); + + userIndexPage.findUser(staticFixtures.customerAgentUser.username) + .contains('Agent') + .should('have.length', 1); + }); + + it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { + userIndexPage.visit(); + + userIndexPage.findUser(staticFixtures.merchantAgentUser.username) + .contains('Agent') + .should('have.length', 1); + }); + + it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => { + userIndexPage.visit(); + userIndexPage.editUser(dynamicFixtures.rootUser.username); + + userUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); + }); + + it('backoffice user should be able to create new user with merchant agent permission', (): void => { + userIndexPage.visit(); + userIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); + + userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); + + it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => { + userIndexPage.visit(); + + userIndexPage.editUser(dynamicFixtures.rootUser.username); + userUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); + + userUpdatePage.checkMerchantAgentCheckbox(); + + userIndexPage.editUser(dynamicFixtures.rootUser.username); + userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); +}); diff --git a/cypress/e2e/backoffice/order-management/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts b/cypress/e2e/backoffice/order-management/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts deleted file mode 100644 index 12d540e3..00000000 --- a/cypress/e2e/backoffice/order-management/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { BackofficeUserIndexPage } from '../../support/pages/backoffice/user/index/backoffice-user-index-page'; -import { BackofficeUserUpdatePage } from '../../support/pages/backoffice/user/update/backoffice-user-update-page'; -import { BackofficeUserCreatePage } from '../../support/pages/backoffice/user/create/backoffice-user-create-page'; -import { CreateRootUserScenario } from '../../support/scenarios/backoffice/create-root-user-scenario'; -import { BackofficeLoginUserScenario } from '../../support/scenarios/backoffice/backoffice-login-user-scenario'; - -/** - * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} - */ -describe('agent permission in backoffice', (): void => { - const userIndexPage: BackofficeUserIndexPage = container.get(BackofficeUserIndexPage); - const userUpdatePage: BackofficeUserUpdatePage = container.get(BackofficeUserUpdatePage); - const userCreatePage: BackofficeUserCreatePage = container.get(BackofficeUserCreatePage); - - const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario); - const createRootUserScenario: CreateRootUserScenario = container.get(CreateRootUserScenario); - - let fixtures: AgentPermissionInBackofficeFixtures; - - before((): void => { - fixtures = Cypress.env('fixtures'); - }); - - beforeEach((): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.user); - }); - - it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.editUser(fixtures.user.username); - - userUpdatePage - .getAgentMerchantCheckbox() - .should('exist') - .parent() - .contains('This user is an agent in Merchant Portal'); - }); - - it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.editUser(fixtures.user.username); - - userUpdatePage.getAgentCustomerCheckbox().should('exist').parent().contains('This user is an agent in Storefront'); - }); - - it('backoffice user should be able to see existing user with merchant agent permission', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.editUser(fixtures.merchantAgentUser.username); - - userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); - - it('backoffice user should be able to see "Agent Customer" column in user table', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.getUserTableHeader().contains('Agent Customer'); - }); - - it('backoffice user should be able to see "Agent Merchant" column in user table', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.getUserTableHeader().contains('Agent Merchant'); - }); - - it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - - userIndexPage.findUser(fixtures.customerAgentUser.username).contains('Agent').should('have.length', 1); - }); - - it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - - userIndexPage.findUser(fixtures.merchantAgentUser.username).contains('Agent').should('have.length', 1); - }); - - it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => { - const user: User = createRootUserScenario.execute(); - - userIndexPage.editUser(user.username); - userUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); - }); - - it('backoffice user should be able to create new user with merchant agent permission', (): void => { - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.createNewUser(); - const user: User = userCreatePage.createAgentMerchantUser(); - - userIndexPage.editUser(user.username); - userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); - - it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => { - const user: User = createRootUserScenario.execute(); - - userIndexPage.editUser(user.username); - userUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); - - userUpdatePage.checkMerchantAgentCheckbox(); - - userIndexPage.editUser(user.username); - userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); -}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts index 3e66449b..4ffa17bc 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts @@ -1,8 +1,8 @@ import { container } from '../../../support/utils/inversify/inversify.config'; -import { IndexPage } from '../../../support/pages/backoffice/index/index-page'; +import { IndexPage } from '../../../support/pages/backoffice'; import { UserLoginScenario } from '../../../support/scenarios/backoffice'; import { AgentLoginPage, LoginPage } from '../../../support/pages/yves'; -import { CustomerAgentLoginPageStaticFixtures } from '../../../support/types/mp/merchant-agent-assist'; +import { CustomerAgentLoginPageStaticFixtures } from '../../../support/types/mp/marketplace-agent-assist'; /** * 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/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json new file mode 100644 index 00000000..a03e234d --- /dev/null +++ b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json @@ -0,0 +1,36 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser" + }, + { + "type": "helper", + "name": "addUserToGroup", + "key": "dummyGroupFlag1", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [ + { + "isMerchantAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "key": "dummyGroupFlag2", + "arguments": ["#merchantAgentUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/order-management/marketplace-agent-assist/static/agent-permission-in-backoffice.json b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json similarity index 94% rename from cypress/fixtures/suite/backoffice/order-management/marketplace-agent-assist/static/agent-permission-in-backoffice.json rename to cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json index 0e2d8ac2..cb3b5337 100644 --- a/cypress/fixtures/suite/backoffice/order-management/marketplace-agent-assist/static/agent-permission-in-backoffice.json +++ b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json @@ -1,5 +1,5 @@ { - "user": { + "rootUser": { "username": "admin@spryker.com", "password": "change123" }, diff --git a/cypress/support/pages/backoffice/index.ts b/cypress/support/pages/backoffice/index.ts new file mode 100644 index 00000000..2faeedfc --- /dev/null +++ b/cypress/support/pages/backoffice/index.ts @@ -0,0 +1,13 @@ +export * from './index/index-page'; +export * from './login/login-page'; +export * from './merchant/create/merchant-create-page'; +export * from './merchant/list/merchant-list-page'; +export * from './merchant/update/merchant-update-page'; +export * from './merchant-user/create/merchant-user-create-page'; +export * from './sales/detail/sales-detail-page'; +export * from './sales/index/sales-index-page'; +export * from './sales-return-gui/create/sales-return-gui-create-page'; +export * from './user/create/user-create-page'; +export * from './user/delete/user-delete-page'; +export * from './user/index/user-index-page'; +export * from './user/update/user-update-page'; diff --git a/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts similarity index 78% rename from cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page.ts rename to cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts index 08165c4b..e03786d5 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts @@ -1,16 +1,16 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeMerchantUserCreateRepository } from './backoffice-merchant-user-create-repository'; +import { MerchantUserCreateRepository } from './merchant-user-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantUserCreatePage extends BackofficePage { +export class MerchantUserCreatePage extends BackofficePage { protected PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; constructor( - @inject(BackofficeMerchantUserCreateRepository) private repository: BackofficeMerchantUserCreateRepository + @inject(MerchantUserCreateRepository) private repository: MerchantUserCreateRepository ) { super(); } diff --git a/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-repository.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts similarity index 90% rename from cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-repository.ts rename to cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts index 80f82549..ae216de4 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/backoffice-merchant-user-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeMerchantUserCreateRepository { +export class MerchantUserCreateRepository { getEmailInput = (): Cypress.Chainable => cy.get('#merchant-user_username'); getFirstNameInput = (): Cypress.Chainable => cy.get('#merchant-user_firstName'); getLastNameInput = (): Cypress.Chainable => cy.get('#merchant-user_lastName'); diff --git a/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-page.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts similarity index 80% rename from cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-page.ts rename to cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts index 6ff45bc0..12be878c 100644 --- a/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeMerchantCreateRepository } from './backoffice-merchant-create-repository'; +import { MerchantCreateRepository } from './merchant-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantCreatePage extends BackofficePage { +export class MerchantCreatePage extends BackofficePage { protected PAGE_URL: string = '/merchant-gui/create-merchant'; - constructor(@inject(BackofficeMerchantCreateRepository) private repository: BackofficeMerchantCreateRepository) { + constructor(@inject(MerchantCreateRepository) private repository: MerchantCreateRepository) { super(); } diff --git a/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-repository.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts similarity index 93% rename from cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-repository.ts rename to cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts index df644643..74d3d464 100644 --- a/cypress/support/pages/backoffice/merchant/create/backoffice-merchant-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeMerchantCreateRepository { +export class MerchantCreateRepository { getNameInput = (): Cypress.Chainable => cy.get('#merchant_name'); getReferenceInput = (): Cypress.Chainable => cy.get('#merchant_merchant_reference'); getEmailInput = (): Cypress.Chainable => cy.get('#merchant_email'); diff --git a/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-page.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts similarity index 87% rename from cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-page.ts rename to cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts index 9e4383c1..5fdc4f65 100644 --- a/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeMerchantListRepository } from './backoffice-merchant-list-repository'; +import { MerchantListRepository } from './merchant-list-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantListPage extends BackofficePage { +export class MerchantListPage extends BackofficePage { protected PAGE_URL: string = '/merchant-gui/list-merchant'; - constructor(@inject(BackofficeMerchantListRepository) private repository: BackofficeMerchantListRepository) { + constructor(@inject(MerchantListRepository) private repository: MerchantListRepository) { super(); } diff --git a/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-repository.ts b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts similarity index 93% rename from cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-repository.ts rename to cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts index 27c178d4..73712ca3 100644 --- a/cypress/support/pages/backoffice/merchant/list/backoffice-merchant-list-repository.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeMerchantListRepository { +export class MerchantListRepository { getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); getSearchSelector = (): string => '[type="search"]'; getEditButtonSelector = (): string => 'a:contains("Edit")'; diff --git a/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-page.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts similarity index 75% rename from cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-page.ts rename to cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts index 14f7f5bf..00ca8b9d 100644 --- a/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeMerchantUpdateRepository } from './backoffice-merchant-update-repository'; +import { MerchantUpdateRepository } from './merchant-update-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeMerchantUpdatePage extends BackofficePage { +export class MerchantUpdatePage extends BackofficePage { protected PAGE_URL: string = '/merchant-gui/edit-merchant'; - constructor(@inject(BackofficeMerchantUpdateRepository) private repository: BackofficeMerchantUpdateRepository) { + constructor(@inject(MerchantUpdateRepository) private repository: MerchantUpdateRepository) { super(); } diff --git a/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-repository.ts b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts similarity index 91% rename from cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-repository.ts rename to cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts index a208ae5a..2319ebea 100644 --- a/cypress/support/pages/backoffice/merchant/update/backoffice-merchant-update-repository.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeMerchantUpdateRepository { +export class MerchantUpdateRepository { getUsersTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-merchant-user"]'); getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); getSearchSelector = (): string => '.dataTables_filter input[type="search"]'; diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts similarity index 62% rename from cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page.ts rename to cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts index ba1aa935..394f617a 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-page.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-page.ts @@ -1,16 +1,16 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeSalesReturnGuiCreateRepository } from './backoffice-sales-return-gui-create-repository'; +import { SalesReturnGuiCreateRepository } from './sales-return-gui-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeSalesReturnGuiCreatePage extends BackofficePage { +export class SalesReturnGuiCreatePage extends BackofficePage { protected PAGE_URL: string = '/sales-return-gui/create'; constructor( - @inject(BackofficeSalesReturnGuiCreateRepository) private repository: BackofficeSalesReturnGuiCreateRepository + @inject(SalesReturnGuiCreateRepository) private repository: SalesReturnGuiCreateRepository ) { super(); } diff --git a/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-repository.ts b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts similarity index 87% rename from cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-repository.ts rename to cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts index 811f3f6a..e8ec874a 100644 --- a/cypress/support/pages/backoffice/sales-return-gui/create/backoffice-sales-return-gui-create-repository.ts +++ b/cypress/support/pages/backoffice/sales-return-gui/create/sales-return-gui-create-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeSalesReturnGuiCreateRepository { +export class SalesReturnGuiCreateRepository { getAllItemsCheckbox = (): Cypress.Chainable => cy.get('.js-check-all-items'); getCreateReturnButton = (): Cypress.Chainable => cy.get('form[name=return_create_form]').find('button:contains("Create return")'); diff --git a/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts similarity index 81% rename from cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-page.ts rename to cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts index 1030379c..78a6fd84 100644 --- a/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -1,17 +1,17 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeSalesDetailRepository } from './backoffice-sales-detail-repository'; +import { SalesDetailRepository } from './sales-detail-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { CliHelper } from '../../../../helpers/cli-helper'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeSalesDetailPage extends BackofficePage { +export class SalesDetailPage extends BackofficePage { protected PAGE_URL: string = '/sales/detail'; constructor( - @inject(BackofficeSalesDetailRepository) private repository: BackofficeSalesDetailRepository, + @inject(SalesDetailRepository) private repository: SalesDetailRepository, @inject(CliHelper) private cliHelper: CliHelper ) { super(); diff --git a/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-repository.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts similarity index 90% rename from cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-repository.ts rename to cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts index f7ef1bd8..30fe1ae1 100644 --- a/cypress/support/pages/backoffice/sales/detail/backoffice-sales-detail-repository.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeSalesDetailRepository { +export class SalesDetailRepository { getTriggerOmsDivSelector = (): string => '.col-md-12 > .row > .col-lg-12 > .ibox > .ibox-content'; getOmsButtonSelector = (action: string): string => `button:contains("${action}")`; getReturnButton = (): Cypress.Chainable => cy.get('.title-action').find('a:contains("Return")'); diff --git a/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-page.ts b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts similarity index 62% rename from cypress/support/pages/backoffice/sales/index/backoffice-sales-index-page.ts rename to cypress/support/pages/backoffice/sales/index/sales-index-page.ts index eef9e569..6444565e 100644 --- a/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-page.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeSalesIndexRepository } from './backoffice-sales-index-repository'; +import { SalesIndexRepository } from './sales-index-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeSalesIndexPage extends BackofficePage { +export class SalesIndexPage extends BackofficePage { protected PAGE_URL: string = '/sales'; - constructor(@inject(BackofficeSalesIndexRepository) private repository: BackofficeSalesIndexRepository) { + constructor(@inject(SalesIndexRepository) private repository: SalesIndexRepository) { super(); } diff --git a/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-repository.ts b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts similarity index 83% rename from cypress/support/pages/backoffice/sales/index/backoffice-sales-index-repository.ts rename to cypress/support/pages/backoffice/sales/index/sales-index-repository.ts index c4b1b983..e30b4f4d 100644 --- a/cypress/support/pages/backoffice/sales/index/backoffice-sales-index-repository.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts @@ -4,6 +4,6 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeSalesIndexRepository { +export class SalesIndexRepository { getViewButtons = (): Cypress.Chainable => cy.get('.btn-view'); } diff --git a/cypress/support/pages/backoffice/user/create/backoffice-user-create-page.ts b/cypress/support/pages/backoffice/user/create/user-create-page.ts similarity index 87% rename from cypress/support/pages/backoffice/user/create/backoffice-user-create-page.ts rename to cypress/support/pages/backoffice/user/create/user-create-page.ts index 80b2a6f2..8ef7337b 100644 --- a/cypress/support/pages/backoffice/user/create/backoffice-user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-page.ts @@ -1,18 +1,18 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeUserCreateRepository } from './backoffice-user-create-repository'; +import { UserCreateRepository } from './user-create-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserCreatePage extends BackofficePage { +export class UserCreatePage extends BackofficePage { protected PAGE_URL: string = '/user/edit/create'; private DEFAULT_PASSWORD: string = 'Change123@_'; private EN_LOCALE_VALUE: string = '66'; - constructor(@inject(BackofficeUserCreateRepository) private repository: BackofficeUserCreateRepository) { + constructor(@inject(UserCreateRepository) private repository: UserCreateRepository) { super(); } diff --git a/cypress/support/pages/backoffice/user/create/backoffice-user-create-repository.ts b/cypress/support/pages/backoffice/user/create/user-create-repository.ts similarity index 95% rename from cypress/support/pages/backoffice/user/create/backoffice-user-create-repository.ts rename to cypress/support/pages/backoffice/user/create/user-create-repository.ts index 3bf44518..70f9332f 100644 --- a/cypress/support/pages/backoffice/user/create/backoffice-user-create-repository.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeUserCreateRepository { +export class UserCreateRepository { getUsernameInput = (): Cypress.Chainable => cy.get('#user_username'); getPasswordInput = (): Cypress.Chainable => cy.get('#user_password_first'); getRepeatPasswordInput = (): Cypress.Chainable => cy.get('#user_password_second'); diff --git a/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-page.ts b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts similarity index 60% rename from cypress/support/pages/backoffice/user/delete/backoffice-user-delete-page.ts rename to cypress/support/pages/backoffice/user/delete/user-delete-page.ts index 5ced9bb9..c79e5b12 100644 --- a/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-page.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { BackofficeUserDeleteRepository } from './backoffice-user-delete-repository'; +import { UserDeleteRepository } from './user-delete-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserDeletePage extends BackofficePage { +export class UserDeletePage extends BackofficePage { protected PAGE_URL: string = '/user/edit/confirm-delete'; - constructor(@inject(BackofficeUserDeleteRepository) private repository: BackofficeUserDeleteRepository) { + constructor(@inject(UserDeleteRepository) private repository: UserDeleteRepository) { super(); } diff --git a/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-repository.ts b/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts similarity index 84% rename from cypress/support/pages/backoffice/user/delete/backoffice-user-delete-repository.ts rename to cypress/support/pages/backoffice/user/delete/user-delete-repository.ts index 5b5d288b..808a5f06 100644 --- a/cypress/support/pages/backoffice/user/delete/backoffice-user-delete-repository.ts +++ b/cypress/support/pages/backoffice/user/delete/user-delete-repository.ts @@ -4,6 +4,6 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeUserDeleteRepository { +export class UserDeleteRepository { getDeleteButton = (): Cypress.Chainable => cy.get('form[name=delete_confirm_form]'); } diff --git a/cypress/support/pages/backoffice/user/index/backoffice-user-index-page.ts b/cypress/support/pages/backoffice/user/index/user-index-page.ts similarity index 87% rename from cypress/support/pages/backoffice/user/index/backoffice-user-index-page.ts rename to cypress/support/pages/backoffice/user/index/user-index-page.ts index a35b1106..88969c9d 100644 --- a/cypress/support/pages/backoffice/user/index/backoffice-user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-page.ts @@ -1,4 +1,4 @@ -import { BackofficeUserIndexRepository } from './backoffice-user-index-repository'; +import { UserIndexRepository } from './user-index-repository'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { autoWired } from '../../../../utils/inversify/auto-wired'; @@ -6,10 +6,10 @@ import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserIndexPage extends BackofficePage { +export class UserIndexPage extends BackofficePage { protected PAGE_URL: string = '/user'; - constructor(@inject(BackofficeUserIndexRepository) private repository: BackofficeUserIndexRepository) { + constructor(@inject(UserIndexRepository) private repository: UserIndexRepository) { super(); } diff --git a/cypress/support/pages/backoffice/user/index/backoffice-user-index-repository.ts b/cypress/support/pages/backoffice/user/index/user-index-repository.ts similarity index 94% rename from cypress/support/pages/backoffice/user/index/backoffice-user-index-repository.ts rename to cypress/support/pages/backoffice/user/index/user-index-repository.ts index c81d900a..6dee5d86 100644 --- a/cypress/support/pages/backoffice/user/index/backoffice-user-index-repository.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeUserIndexRepository { +export class UserIndexRepository { getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); getEditButtonSelector = (): string => 'a:contains("Edit")'; getDeactivateButtonSelector = (): string => 'button:contains("Deactivate")'; diff --git a/cypress/support/pages/backoffice/user/update/backoffice-user-update-page.ts b/cypress/support/pages/backoffice/user/update/user-update-page.ts similarity index 79% rename from cypress/support/pages/backoffice/user/update/backoffice-user-update-page.ts rename to cypress/support/pages/backoffice/user/update/user-update-page.ts index db4f0063..967c850c 100644 --- a/cypress/support/pages/backoffice/user/update/backoffice-user-update-page.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-page.ts @@ -1,4 +1,4 @@ -import { BackofficeUserUpdateRepository } from './backoffice-user-update-repository'; +import { UserUpdateRepository } from './user-update-repository'; import { inject, injectable } from 'inversify'; import 'reflect-metadata'; import { autoWired } from '../../../../utils/inversify/auto-wired'; @@ -6,11 +6,11 @@ import { BackofficePage } from '../../backoffice-page'; @injectable() @autoWired -export class BackofficeUserUpdatePage extends BackofficePage { +export class UserUpdatePage extends BackofficePage { protected PAGE_URL: string = '/user/edit/update'; public DEFAULT_PASSWORD: string = 'Change123@_'; - constructor(@inject(BackofficeUserUpdateRepository) private repository: BackofficeUserUpdateRepository) { + constructor(@inject(UserUpdateRepository) private repository: UserUpdateRepository) { super(); } diff --git a/cypress/support/pages/backoffice/user/update/backoffice-user-update-repository.ts b/cypress/support/pages/backoffice/user/update/user-update-repository.ts similarity index 92% rename from cypress/support/pages/backoffice/user/update/backoffice-user-update-repository.ts rename to cypress/support/pages/backoffice/user/update/user-update-repository.ts index 5aa1da16..97a77854 100644 --- a/cypress/support/pages/backoffice/user/update/backoffice-user-update-repository.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class BackofficeUserUpdateRepository { +export class UserUpdateRepository { getAgentMerchantCheckbox = (): Cypress.Chainable => cy.get('#user_is_merchant_agent'); getAgentCustomerCheckbox = (): Cypress.Chainable => cy.get('#user_is_agent'); getUpdateUserButton = (): Cypress.Chainable => cy.get('form[name=user]').find('[type="submit"]'); diff --git a/cypress/support/scenarios/backoffice/create-merchant-scenario.ts b/cypress/support/scenarios/backoffice/create-merchant-scenario.ts index 3985d906..01e1012e 100644 --- a/cypress/support/scenarios/backoffice/create-merchant-scenario.ts +++ b/cypress/support/scenarios/backoffice/create-merchant-scenario.ts @@ -1,14 +1,14 @@ import { inject, injectable } from 'inversify'; -import { BackofficeMerchantCreatePage } from '../../pages/backoffice/merchant/create/backoffice-merchant-create-page'; -import { BackofficeMerchantListPage } from '../../pages/backoffice/merchant/list/backoffice-merchant-list-page'; +import { MerchantCreatePage } from '../../pages/backoffice/merchant/create/merchant-create-page'; +import { MerchantListPage } from '../../pages/backoffice/merchant/list/merchant-list-page'; import { autoWired } from '../../utils/inversify/auto-wired'; @injectable() @autoWired export class CreateMerchantScenario { constructor( - @inject(BackofficeMerchantCreatePage) private merchantCreatePage: BackofficeMerchantCreatePage, - @inject(BackofficeMerchantListPage) private merchantListPage: BackofficeMerchantListPage + @inject(MerchantCreatePage) private merchantCreatePage: MerchantCreatePage, + @inject(MerchantListPage) private merchantListPage: MerchantListPage ) {} public execute = (): Merchant => { diff --git a/cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts b/cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts index 02045c25..f85ac9a4 100644 --- a/cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts +++ b/cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts @@ -1,20 +1,20 @@ import { inject, injectable } from 'inversify'; -import { BackofficeMerchantListPage } from '../../pages/backoffice/merchant/list/backoffice-merchant-list-page'; -import { BackofficeMerchantUserCreatePage } from '../../pages/backoffice/merchant-user/create/backoffice-merchant-user-create-page'; -import { BackofficeUserIndexPage } from '../../pages/backoffice/user/index/backoffice-user-index-page'; -import { BackofficeUserUpdatePage } from '../../pages/backoffice/user/update/backoffice-user-update-page'; -import { BackofficeMerchantUpdatePage } from '../../pages/backoffice/merchant/update/backoffice-merchant-update-page'; +import { MerchantListPage } from '../../pages/backoffice/merchant/list/merchant-list-page'; +import { MerchantUserCreatePage } from '../../pages/backoffice/merchant-user/create/merchant-user-create-page'; +import { UserIndexPage } from '../../pages/backoffice/user/index/user-index-page'; +import { UserUpdatePage } from '../../pages/backoffice/user/update/user-update-page'; +import { MerchantUpdatePage } from '../../pages/backoffice/merchant/update/merchant-update-page'; import { autoWired } from '../../utils/inversify/auto-wired'; @injectable() @autoWired export class CreateMerchantUserScenario { constructor( - @inject(BackofficeMerchantListPage) private merchantListPage: BackofficeMerchantListPage, - @inject(BackofficeMerchantUpdatePage) private merchantUpdatePage: BackofficeMerchantUpdatePage, - @inject(BackofficeMerchantUserCreatePage) private merchantUserCreatePage: BackofficeMerchantUserCreatePage, - @inject(BackofficeUserIndexPage) private userIndexPage: BackofficeUserIndexPage, - @inject(BackofficeUserUpdatePage) private userUpdatePage: BackofficeUserUpdatePage + @inject(MerchantListPage) private merchantListPage: MerchantListPage, + @inject(MerchantUpdatePage) private merchantUpdatePage: MerchantUpdatePage, + @inject(MerchantUserCreatePage) private merchantUserCreatePage: MerchantUserCreatePage, + @inject(UserIndexPage) private userIndexPage: UserIndexPage, + @inject(UserUpdatePage) private userUpdatePage: UserUpdatePage ) {} public execute = (merchantName: string): MerchantUser => { diff --git a/cypress/support/scenarios/backoffice/create-root-user-scenario.ts b/cypress/support/scenarios/backoffice/create-root-user-scenario.ts index e93ed5ec..ef1e0967 100644 --- a/cypress/support/scenarios/backoffice/create-root-user-scenario.ts +++ b/cypress/support/scenarios/backoffice/create-root-user-scenario.ts @@ -1,19 +1,18 @@ import { inject, injectable } from 'inversify'; -import { BackofficeUserCreatePage } from '../../pages/backoffice/user/create/backoffice-user-create-page'; -import { BackofficeUserIndexPage } from '../../pages/backoffice/user/index/backoffice-user-index-page'; import { autoWired } from '../../utils/inversify/auto-wired'; import {User} from "../../types/refactor_this_file_and_drop_it"; +import { UserCreatePage, UserIndexPage } from '../../pages/backoffice'; @injectable() @autoWired export class CreateRootUserScenario { constructor( - @inject(BackofficeUserCreatePage) private userCreatePage: BackofficeUserCreatePage, - @inject(BackofficeUserIndexPage) private userIndexPage: BackofficeUserIndexPage + @inject(UserCreatePage) private userCreatePage: UserCreatePage, + @inject(UserIndexPage) private userIndexPage: UserIndexPage ) {} public execute = (): User => { - cy.visitBackoffice(this.userIndexPage.PAGE_URL); + this.userIndexPage.visit(); this.userIndexPage.createNewUser(); return this.userCreatePage.createRootUser(); diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts b/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts new file mode 100644 index 00000000..6281ad09 --- /dev/null +++ b/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts @@ -0,0 +1,8 @@ +export interface DynamicFixtures { + rootUser: User; + merchantAgentUser: User; +} + +interface User { + username: string; +} diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/index.ts b/cypress/support/types/backoffice/marketplace-agent-assist/index.ts new file mode 100644 index 00000000..368fb45a --- /dev/null +++ b/cypress/support/types/backoffice/marketplace-agent-assist/index.ts @@ -0,0 +1,2 @@ +export * from './static-fixture-types'; +export * from './dynamic-fixture-types'; diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts b/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts new file mode 100644 index 00000000..99b5bc9d --- /dev/null +++ b/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts @@ -0,0 +1,10 @@ +export interface StaticFixtures { + rootUser: User; + merchantAgentUser: User; + customerAgentUser: User; +} + +interface User { + username: string; + password: string; +} diff --git a/cypress/support/types/mp/merchant-agent-assist/index.ts b/cypress/support/types/mp/marketplace-agent-assist/index.ts similarity index 100% rename from cypress/support/types/mp/merchant-agent-assist/index.ts rename to cypress/support/types/mp/marketplace-agent-assist/index.ts diff --git a/cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts b/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts similarity index 100% rename from cypress/support/types/mp/merchant-agent-assist/static-fixture-types.ts rename to cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts From 99ae73b9cca39b9213f9eb31831884ce81fcbf86 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Tue, 27 Feb 2024 11:06:44 +0100 Subject: [PATCH 12/53] CC-32482: Added the docker base infrastructure. --- Dockerfile | 18 ++++++++++++++++++ docker-compose.cypress.yml | 25 +++++++++++++++++++++++++ set-env-vars.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.cypress.yml create mode 100755 set-env-vars.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5e63253d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Start the final image +FROM cypress/browsers:latest + +# Set and create the working directory +ENV CYPRESS_TESTS_WORK_DIR /opt/cypress-tests +RUN mkdir -p ${CYPRESS_TESTS_WORK_DIR} + +# Set the working directory +WORKDIR ${CYPRESS_TESTS_WORK_DIR} + +# Copy the package.json and package-lock.json files to the working directory +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm install + +# Source the .env file to export the variables +ENTRYPOINT ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"] diff --git a/docker-compose.cypress.yml b/docker-compose.cypress.yml new file mode 100644 index 00000000..80ee9b8a --- /dev/null +++ b/docker-compose.cypress.yml @@ -0,0 +1,25 @@ +version: '3' +services: + cypress-tests: + build: + context: ./vendor/spryker/cypress-tests + dockerfile: Dockerfile + networks: + - private + env_file: + - ${DEPLOYMENT_PATH}/env/cli/testing.env # depends on application setup + - ${DEPLOYMENT_PATH}/env/cli/de.env # depends on application setup + - ${DEPLOYMENT_PATH}/terraform/cli/de.env # depends on application setup + - ./.cypress/.env + labels: + 'spryker.app.name': cypress-tests + 'spryker.app.type': cypress-tests + 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} + volumes: + - ./vendor/spryker/cypress-tests:/opt/cypress-tests:rw + - ./.cypress/screenshots:/opt/cypress-tests/cypress/screenshots:rw + - ./.cypress/videos:/opt/cypress-tests/cypress/videos:rw + - ./.cypress/logs:/opt/cypress-tests/cypress/logs:rw + - /tmp/.X11-unix:/tmp/.X11-unix +# environment: +# - DISPLAY=${DISPLAY_IP} diff --git a/set-env-vars.sh b/set-env-vars.sh new file mode 100755 index 00000000..66a49549 --- /dev/null +++ b/set-env-vars.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + # Linux + DISPLAY_IP=$(hostname -I | awk '{print $1}'):0 +elif [[ "$OSTYPE" == "darwin"* ]]; then + # Mac OSX + DISPLAY_IP=$(ipconfig getifaddr en0):0 +fi + +if [[ "$SPRYKER_SSL_ENABLE" == "true" ]]; then + SPRYKER_URL_PROTOCOL="https" +else + SPRYKER_URL_PROTOCOL="http" +fi + +ENV_BACKOFFICE_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_BE_HOST} +ENV_MERCHANT_PORTAL_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_MP_HOST} +ENV_MAIL_CATCHER_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_SMTP_HOST} +OPERATION_RUNNER_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_GLUE_BACKEND_HOST}/test-operation-runner +E2E_BASE_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_FE_HOST} + +export DISPLAY_IP=$DISPLAY_IP +export SPRYKER_URL_PROTOCOL=$SPRYKER_URL_PROTOCOL +export ENV_BACKOFFICE_URL=$ENV_BACKOFFICE_URL +export ENV_MERCHANT_PORTAL_URL=$ENV_MERCHANT_PORTAL_URL +export ENV_MAIL_CATCHER_URL=$ENV_MAIL_CATCHER_URL +export OPERATION_RUNNER_URL=$OPERATION_RUNNER_URL +export E2E_BASE_URL=$E2E_BASE_URL + +exit 0 From 4e0a0b39cc37911d05be16964caea2a25a00ec7b Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Tue, 27 Feb 2024 15:36:14 +0300 Subject: [PATCH 13/53] Fixed flaky tests, rework backoffice pages [skip ci] --- .../agent-permission-in-backoffice.cy.ts | 23 ++--- .../customer-agent-login-page.cy.ts | 22 +++-- .../comments/cart/empty-cart-comment.cy.ts | 7 +- .../cart/not-empty-cart-comment.cy.ts | 7 +- .../agent-permission-in-backoffice.json | 26 +++++- .../agent-permission-in-backoffice.json | 13 +-- .../dynamic/customer-agent-login-page.json | 86 +++++++++++++++++++ .../static/customer-agent-login-page.json | 17 +--- .../checkout/address/checkout-address-page.ts | 6 +- .../backoffice/user-login-scenario.ts | 4 +- .../scenarios/yves/agent-login-scenario.ts | 2 + .../scenarios/yves/customer-login-scenario.ts | 2 + .../dynamic-fixture-types.ts | 3 +- .../static-fixture-types.ts | 11 +-- .../dynamic-fixture-types.ts | 10 +++ .../mp/marketplace-agent-assist/index.ts | 1 + .../static-fixture-types.ts | 10 +-- .../comments/cart/dynamic-fixture-types.ts | 2 +- .../comments/cart/static-fixture-types.ts | 2 +- 19 files changed, 172 insertions(+), 82 deletions(-) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json create mode 100644 cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts diff --git a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts index 2da406e7..a6f3a0c7 100644 --- a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts +++ b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts @@ -1,7 +1,10 @@ import { UserIndexPage, UserUpdatePage } from '../../../support/pages/backoffice'; import { UserLoginScenario } from '../../../support/scenarios/backoffice'; import { container } from '../../../support/utils/inversify/inversify.config'; -import { DynamicFixtures, StaticFixtures } from '../../../support/types/backoffice/marketplace-agent-assist'; +import { + AgentPermissionInBackofficeDynamicFixtures, + AgentPermissionInBackofficeStaticFixtures, +} from '../../../support/types/backoffice/marketplace-agent-assist'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} @@ -11,21 +14,21 @@ describe('agent permission in backoffice', (): void => { const userUpdatePage: UserUpdatePage = container.get(UserUpdatePage); const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); - let staticFixtures: StaticFixtures; - let dynamicFixtures: DynamicFixtures; + let dynamicFixtures: AgentPermissionInBackofficeDynamicFixtures; + let staticFixtures: AgentPermissionInBackofficeStaticFixtures; before((): void => { - ({ staticFixtures, dynamicFixtures } = Cypress.env()); + ({ dynamicFixtures, staticFixtures } = Cypress.env()); cy.resetBackofficeCookies(); }); beforeEach((): void => { - userLoginScenario.execute(staticFixtures.rootUser.username, staticFixtures.rootUser.password); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); }); it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { userIndexPage.visit(); - userIndexPage.editUser(staticFixtures.rootUser.username); + userIndexPage.editUser(dynamicFixtures.rootUser.username); userUpdatePage .getAgentMerchantCheckbox() @@ -36,14 +39,14 @@ describe('agent permission in backoffice', (): void => { it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { userIndexPage.visit(); - userIndexPage.editUser(staticFixtures.rootUser.username); + userIndexPage.editUser(dynamicFixtures.rootUser.username); userUpdatePage.getAgentCustomerCheckbox().should('exist').parent().contains('This user is an agent in Storefront'); }); it('backoffice user should be able to see existing user with merchant agent permission', (): void => { userIndexPage.visit(); - userIndexPage.editUser(staticFixtures.merchantAgentUser.username); + userIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); }); @@ -61,7 +64,7 @@ describe('agent permission in backoffice', (): void => { it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => { userIndexPage.visit(); - userIndexPage.findUser(staticFixtures.customerAgentUser.username) + userIndexPage.findUser(dynamicFixtures.customerAgentUser.username) .contains('Agent') .should('have.length', 1); }); @@ -69,7 +72,7 @@ describe('agent permission in backoffice', (): void => { it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { userIndexPage.visit(); - userIndexPage.findUser(staticFixtures.merchantAgentUser.username) + userIndexPage.findUser(dynamicFixtures.merchantAgentUser.username) .contains('Agent') .should('have.length', 1); }); diff --git a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts index 4ffa17bc..cb82130b 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts @@ -2,7 +2,10 @@ import { container } from '../../../support/utils/inversify/inversify.config'; import { IndexPage } from '../../../support/pages/backoffice'; import { UserLoginScenario } from '../../../support/scenarios/backoffice'; import { AgentLoginPage, LoginPage } from '../../../support/pages/yves'; -import { CustomerAgentLoginPageStaticFixtures } from '../../../support/types/mp/marketplace-agent-assist'; +import { + CustomerAgentLoginPageDynamicFixtures, + CustomerAgentLoginPageStaticFixtures, +} from '../../../support/types/mp/marketplace-agent-assist'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} @@ -13,21 +16,22 @@ describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); + let dynamicFixtures: CustomerAgentLoginPageDynamicFixtures; let staticFixtures: CustomerAgentLoginPageStaticFixtures; before((): void => { - staticFixtures = Cypress.env('staticFixtures'); + ({ dynamicFixtures, staticFixtures } = Cypress.env()); }); it('agent (customer) should be able to login to backoffice', (): void => { - userLoginScenario.execute(staticFixtures.customerAgentUser.username, staticFixtures.customerAgentUser.password); + userLoginScenario.execute(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); indexPage.visit(); indexPage.assertPageLocation(); }); it('agent (merchant user) should be able to login to backoffice', (): void => { - userLoginScenario.execute(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + userLoginScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); indexPage.visit(); indexPage.assertPageLocation(); @@ -35,7 +39,7 @@ describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { agentLoginPage.visit(); - agentLoginPage.login(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); cy.contains(agentLoginPage.getFailedAuthenticationText()); agentLoginPage.assertPageLocation(); @@ -43,7 +47,7 @@ describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): it('merchant user should not be able to login to storefront agent dashboard', (): void => { agentLoginPage.visit(); - agentLoginPage.login(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); cy.contains(agentLoginPage.getFailedAuthenticationText()); agentLoginPage.assertPageLocation(); @@ -51,7 +55,7 @@ describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): it('agent (merchant user) should not be able to login to storefront', (): void => { loginPage.visit(); - loginPage.login(staticFixtures.merchantAgentUser.username, staticFixtures.merchantAgentUser.password); + loginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); cy.contains(loginPage.getFailedAuthenticationText()); loginPage.assertPageLocation(); @@ -59,7 +63,7 @@ describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): it('agent (customer) should not be able to login to storefront', (): void => { loginPage.visit(); - loginPage.login(staticFixtures.customerAgentUser.username, staticFixtures.customerAgentUser.password); + loginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); cy.contains(loginPage.getFailedAuthenticationText()); loginPage.assertPageLocation(); @@ -67,7 +71,7 @@ describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): it('merchant user should not be able to login to storefront', (): void => { loginPage.visit(); - loginPage.login(staticFixtures.merchantUser.username, staticFixtures.merchantUser.password); + loginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); cy.contains(loginPage.getFailedAuthenticationText()); loginPage.assertPageLocation(); diff --git a/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts index 584c5770..704eccad 100644 --- a/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts @@ -1,17 +1,16 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {DynamicFixtures, StaticFixtures} from "../../../../support/types/yves/comments/cart"; import {CommentCartPage} from "../../../../support/pages/yves"; import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; +import { CartCommentDynamicFixtures, CartCommentStaticFixtures } from '../../../../support/types/yves/comments/cart'; describe('empty cart comment',{tags: ['@comments']} , (): void => { const commentCartPage: CommentCartPage = container.get(CommentCartPage); const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - let dynamicFixtures: DynamicFixtures; - let staticFixtures: StaticFixtures; + let dynamicFixtures: CartCommentDynamicFixtures; + let staticFixtures: CartCommentStaticFixtures; before((): void => { - cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); }); diff --git a/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts index e990e2b3..58b90497 100644 --- a/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts @@ -1,17 +1,16 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {DynamicFixtures, StaticFixtures} from "../../../../support/types/yves/comments/cart"; import {CommentCartPage} from "../../../../support/pages/yves"; import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; +import { CartCommentDynamicFixtures, CartCommentStaticFixtures } from '../../../../support/types/yves/comments/cart'; describe('not empty cart comment',{tags: ['@comments']}, (): void => { const commentCartPage: CommentCartPage = container.get(CommentCartPage); const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - let dynamicFixtures: DynamicFixtures; - let staticFixtures: StaticFixtures; + let dynamicFixtures: CartCommentDynamicFixtures; + let staticFixtures: CartCommentStaticFixtures; before((): void => { - cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); }); diff --git a/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json index a03e234d..a09c7156 100644 --- a/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json +++ b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json @@ -6,12 +6,16 @@ { "type": "helper", "name": "haveUser", - "key": "rootUser" + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] }, { "type": "helper", "name": "addUserToGroup", - "key": "dummyGroupFlag1", "arguments": ["#rootUser.id_user", 1] }, { @@ -20,6 +24,7 @@ "key": "merchantAgentUser", "arguments": [ { + "password": "change123", "isMerchantAgent": true } ] @@ -27,8 +32,23 @@ { "type": "helper", "name": "addUserToGroup", - "key": "dummyGroupFlag2", "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "customerAgentUser", + "arguments": [ + { + "password": "change123", + "isAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#customerAgentUser.id_user", 1] } ] } diff --git a/cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json index cb3b5337..ba4339e8 100644 --- a/cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json +++ b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json @@ -1,14 +1,3 @@ { - "rootUser": { - "username": "admin@spryker.com", - "password": "change123" - }, - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "customerAgentUser": { - "username": "agent123@spryker.com", - "password": "change123" - } + "defaultPassword": "change123" } diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json new file mode 100644 index 00000000..b23d4880 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json @@ -0,0 +1,86 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [ + { + "password": "change123", + "isMerchantAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "customerAgentUser", + "arguments": [ + { + "password": "change123", + "isAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#customerAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "MerchantProfileTransfer", + "key": "merchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [{ + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + }] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json index 2490f7ba..ba4339e8 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json @@ -1,18 +1,3 @@ { - "rootUser": { - "username": "admin@spryker.com", - "password": "change123" - }, - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "customerAgentUser": { - "username": "agent123@spryker.com", - "password": "change123" - }, - "merchantUser": { - "username": "harald@spryker.com", - "password": "change123" - } + "defaultPassword": "change123" } 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 7eebbdb8..a644e180 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -116,9 +116,11 @@ export class CheckoutAddressPage extends YvesPage { }; private createDummyCheckoutAddress = (): CheckoutAddress => { + const prefix = '[e2e] '; + return { - firstName: this.faker.person.firstName(), - lastName: this.faker.person.lastName(), + firstName: prefix + '' + this.faker.person.firstName(), + lastName: prefix + '' + this.faker.person.lastName(), address1: this.faker.location.secondaryAddress(), address2: this.faker.location.buildingNumber(), zipCode: this.faker.location.zipCode(), diff --git a/cypress/support/scenarios/backoffice/user-login-scenario.ts b/cypress/support/scenarios/backoffice/user-login-scenario.ts index 7dfac19d..7fbbfcb7 100644 --- a/cypress/support/scenarios/backoffice/user-login-scenario.ts +++ b/cypress/support/scenarios/backoffice/user-login-scenario.ts @@ -1,6 +1,6 @@ import { inject, injectable } from 'inversify'; -import { LoginPage } from '../../pages/backoffice/login/login-page'; import { autoWired } from '../../utils/inversify/auto-wired'; +import { LoginPage } from '../../pages/backoffice'; @injectable() @autoWired @@ -8,6 +8,8 @@ export class UserLoginScenario { constructor(@inject(LoginPage) private loginPage: LoginPage) {} public execute = (username: string, password: string): void => { + cy.resetBackofficeCookies(); + 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 747bcf66..e259092d 100644 --- a/cypress/support/scenarios/yves/agent-login-scenario.ts +++ b/cypress/support/scenarios/yves/agent-login-scenario.ts @@ -8,6 +8,8 @@ export class AgentLoginScenario { constructor(@inject(AgentLoginPage) private loginPage: AgentLoginPage) {} public execute = (username: string, password: string): void => { + cy.resetYvesCookies(); + cy.session([username, password], () => { this.loginPage.visit(); this.loginPage.login(username, password); diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index b24e39ae..cc94e94b 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -8,6 +8,8 @@ export class CustomerLoginScenario { constructor(@inject(LoginPage) private loginPage: LoginPage) {} public execute = (email: string, password: string): void => { + cy.resetYvesCookies(); + cy.session([email, password], () => { this.loginPage.visit(); this.loginPage.login(email, password); diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts b/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts index 6281ad09..2e6ce2de 100644 --- a/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts +++ b/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts @@ -1,6 +1,7 @@ -export interface DynamicFixtures { +export interface AgentPermissionInBackofficeDynamicFixtures { rootUser: User; merchantAgentUser: User; + customerAgentUser: User; } interface User { diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts b/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts index 99b5bc9d..528bc66f 100644 --- a/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts +++ b/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts @@ -1,10 +1,3 @@ -export interface StaticFixtures { - rootUser: User; - merchantAgentUser: User; - customerAgentUser: User; -} - -interface User { - username: string; - password: string; +export interface AgentPermissionInBackofficeStaticFixtures { + defaultPassword: string; } diff --git a/cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts b/cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts new file mode 100644 index 00000000..f8fc6902 --- /dev/null +++ b/cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts @@ -0,0 +1,10 @@ +export interface CustomerAgentLoginPageDynamicFixtures { + rootUser: User; + merchantAgentUser: User; + customerAgentUser: User; + merchantUser: User; +} + +interface User { + username: string; +} diff --git a/cypress/support/types/mp/marketplace-agent-assist/index.ts b/cypress/support/types/mp/marketplace-agent-assist/index.ts index 1ea44b9b..cfc6ac0c 100644 --- a/cypress/support/types/mp/marketplace-agent-assist/index.ts +++ b/cypress/support/types/mp/marketplace-agent-assist/index.ts @@ -1 +1,2 @@ +export * from './dynamic-fixture-types'; export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts b/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts index 71be2206..73623dae 100644 --- a/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts +++ b/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts @@ -1,11 +1,3 @@ export interface CustomerAgentLoginPageStaticFixtures { - rootUser: User; - merchantAgentUser: User; - customerAgentUser: User; - merchantUser: User; -} - -interface User { - username: string; - password: string; + defaultPassword: string; } diff --git a/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts b/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts index 7cf2e803..0ce13e0b 100644 --- a/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts +++ b/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts @@ -1,7 +1,7 @@ import {Quote} from "./common/quote"; import {Product} from "./common/product"; -export interface DynamicFixtures { +export interface CartCommentDynamicFixtures { quote: Quote; customer: Customer; product: Product; diff --git a/cypress/support/types/yves/comments/cart/static-fixture-types.ts b/cypress/support/types/yves/comments/cart/static-fixture-types.ts index dd3d6598..465e22ef 100644 --- a/cypress/support/types/yves/comments/cart/static-fixture-types.ts +++ b/cypress/support/types/yves/comments/cart/static-fixture-types.ts @@ -1,4 +1,4 @@ -export interface StaticFixtures { +export interface CartCommentStaticFixtures { commentsToAdd: string[]; commentToModify: string; modifiedComment: string; From 47b89c572ed6334a470b347d059418748c2e404f Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Tue, 27 Feb 2024 19:21:47 +0300 Subject: [PATCH 14/53] Rework backoffice pages [skip ci] --- .../agent-permission-in-backoffice.cy.ts | 2 +- .../merchant-user-agent-dashboard.cy.ts | 205 +++++++++--------- .../merchant-user-agent-login-page.cy.ts | 56 ++--- .../dynamic/merchant-portal-agent-login.json | 84 ------- .../merchant-user-agent-dashboard.json | 74 ++++++- .../merchant-user-agent-login-page.json | 79 ++++++- .../static/merchant-portal-agent-login.json | 0 .../static/merchant-user-agent-dashboard.json | 9 +- .../merchant-user-agent-login-page.json | 13 +- ...hboard-page.ts => agent-dashboard-page.ts} | 6 +- ...itory.ts => agent-dashboard-repository.ts} | 2 +- ...gent-login-page.ts => agent-login-page.ts} | 7 +- ...epository.ts => agent-login-repository.ts} | 2 +- ...mp-dashboard-page.ts => dashboard-page.ts} | 6 +- ...-repository.ts => dashboard-repository.ts} | 2 +- cypress/support/pages/mp/index.ts | 8 + .../login/{mp-login-page.ts => login-page.ts} | 6 +- ...ogin-repository.ts => login-repository.ts} | 2 +- .../{mp-offers-page.ts => offers-page.ts} | 6 +- ...ers-repository.ts => offers-repository.ts} | 2 +- .../{mp-products-page.ts => products-page.ts} | 6 +- ...s-repository.ts => products-repository.ts} | 2 +- .../{mp-profile-page.ts => profile-page.ts} | 6 +- ...le-repository.ts => profile-repository.ts} | 2 +- ...es-orders-page.ts => sales-orders-page.ts} | 6 +- ...pository.ts => sales-orders-repository.ts} | 2 +- .../backoffice/create-merchant-scenario.ts | 23 -- .../create-merchant-user-scenario.ts | 41 ---- .../backoffice/create-root-user-scenario.ts | 20 -- cypress/support/scenarios/backoffice/index.ts | 1 - .../backoffice/user-login-scenario.ts | 2 - .../impersonate-as-merchant-user-scenario.ts | 12 +- cypress/support/scenarios/mp/index.ts | 4 + .../mp/merchant-agent-login-user-scenario.ts | 16 ++ .../mp/merchant-user-login-scenario.ts | 16 ++ .../mp/mp-agent-login-user-scenario.ts | 14 -- .../scenarios/mp/mp-login-user-scenario.ts | 14 -- .../scenarios/yves/agent-login-scenario.ts | 2 - .../scenarios/yves/customer-login-scenario.ts | 2 - .../dynamic-fixture-types.ts | 16 ++ .../mp/merchant-user-agent-dashboard/index.ts | 2 + .../static-fixture-types.ts | 3 + .../dynamic-fixture-types.ts | 9 + .../merchant-user-agent-login-page/index.ts | 2 + .../static-fixture-types.ts | 3 + 45 files changed, 383 insertions(+), 414 deletions(-) delete mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json delete mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-portal-agent-login.json rename cypress/support/pages/mp/agent-dashboard/{mp-agent-dashboard-page.ts => agent-dashboard-page.ts} (84%) rename cypress/support/pages/mp/agent-dashboard/{mp-agent-dashboard-repository.ts => agent-dashboard-repository.ts} (93%) rename cypress/support/pages/mp/agent-login/{mp-agent-login-page.ts => agent-login-page.ts} (72%) rename cypress/support/pages/mp/agent-login/{mp-agent-login-repository.ts => agent-login-repository.ts} (93%) rename cypress/support/pages/mp/dashboard/{mp-dashboard-page.ts => dashboard-page.ts} (68%) rename cypress/support/pages/mp/dashboard/{mp-dashboard-repository.ts => dashboard-repository.ts} (90%) create mode 100644 cypress/support/pages/mp/index.ts rename cypress/support/pages/mp/login/{mp-login-page.ts => login-page.ts} (79%) rename cypress/support/pages/mp/login/{mp-login-repository.ts => login-repository.ts} (94%) rename cypress/support/pages/mp/offers/{mp-offers-page.ts => offers-page.ts} (81%) rename cypress/support/pages/mp/offers/{mp-offers-repository.ts => offers-repository.ts} (92%) rename cypress/support/pages/mp/products/{mp-products-page.ts => products-page.ts} (80%) rename cypress/support/pages/mp/products/{mp-products-repository.ts => products-repository.ts} (91%) rename cypress/support/pages/mp/profile/{mp-profile-page.ts => profile-page.ts} (73%) rename cypress/support/pages/mp/profile/{mp-profile-repository.ts => profile-repository.ts} (91%) rename cypress/support/pages/mp/sales/{mp-sales-orders-page.ts => sales-orders-page.ts} (80%) rename cypress/support/pages/mp/sales/{mp-sales-orders-repository.ts => sales-orders-repository.ts} (90%) delete mode 100644 cypress/support/scenarios/backoffice/create-merchant-scenario.ts delete mode 100644 cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts delete mode 100644 cypress/support/scenarios/backoffice/create-root-user-scenario.ts create mode 100644 cypress/support/scenarios/mp/index.ts create mode 100644 cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts create mode 100644 cypress/support/scenarios/mp/merchant-user-login-scenario.ts delete mode 100644 cypress/support/scenarios/mp/mp-agent-login-user-scenario.ts delete mode 100644 cypress/support/scenarios/mp/mp-login-user-scenario.ts create mode 100644 cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts create mode 100644 cypress/support/types/mp/merchant-user-agent-dashboard/index.ts create mode 100644 cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts create mode 100644 cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts create mode 100644 cypress/support/types/mp/merchant-user-agent-login-page/index.ts create mode 100644 cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts diff --git a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts index a6f3a0c7..088ace1e 100644 --- a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts +++ b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts @@ -9,7 +9,7 @@ import { /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('agent permission in backoffice', (): void => { +describe('agent permission in backoffice', {tags: ['@marketplace-agent-assist']}, (): void => { const userIndexPage: UserIndexPage = container.get(UserIndexPage); const userUpdatePage: UserUpdatePage = container.get(UserUpdatePage); const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts index ed80893c..2c7cad02 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts @@ -1,47 +1,37 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { MpAgentDashboardPage } from '../../support/pages/mp/agent-dashboard/mp-agent-dashboard-page'; -import { BackofficeLoginUserScenario } from '../../support/scenarios/backoffice/backoffice-login-user-scenario'; -import { MpAgentLoginUserScenario } from '../../support/scenarios/mp/mp-agent-login-user-scenario'; -import { BackofficeUserIndexPage } from '../../support/pages/backoffice/user/index/backoffice-user-index-page'; -import { BackofficeUserDeletePage } from '../../support/pages/backoffice/user/delete/backoffice-user-delete-page'; -import { CreateMerchantUserScenario } from '../../support/scenarios/backoffice/create-merchant-user-scenario'; -import { CreateMerchantScenario } from '../../support/scenarios/backoffice/create-merchant-scenario'; -import { BackofficeMerchantListPage } from '../../support/pages/backoffice/merchant/list/backoffice-merchant-list-page'; -import { MpDashboardPage } from '../../support/pages/mp/dashboard/mp-dashboard-page'; +import { container } from '../../../support/utils/inversify/inversify.config'; +import { AgentDashboardPage, AgentLoginPage, DashboardPage } from '../../../support/pages/mp'; +import { MerchantListPage, UserDeletePage, UserIndexPage } from '../../../support/pages/backoffice'; +import { UserLoginScenario } from '../../../support/scenarios/backoffice'; +import { MerchantAgentLoginUserScenario } from '../../../support/scenarios/mp'; +import { + MerchantUserAgentDashboardDynamicFixtures, + MerchantUserAgentDashboardStaticFixtures, +} from '../../../support/types/mp/merchant-user-agent-dashboard'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('merchant user agent dashboard', (): void => { - const dashboardPage: MpDashboardPage = container.get(MpDashboardPage); - const agentDashboardPage: MpAgentDashboardPage = container.get(MpAgentDashboardPage); - const userIndexPage: BackofficeUserIndexPage = container.get(BackofficeUserIndexPage); - const userDeletePage: BackofficeUserDeletePage = container.get(BackofficeUserDeletePage); - const merchantListPage: BackofficeMerchantListPage = container.get(BackofficeMerchantListPage); - - const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario); - const agentLoginUserScenario: MpAgentLoginUserScenario = container.get(MpAgentLoginUserScenario); - const createMerchantUserScenario: CreateMerchantUserScenario = container.get(CreateMerchantUserScenario); - const createMerchantScenario: CreateMerchantScenario = container.get(CreateMerchantScenario); - - let fixtures: MerchantUserAgentDashboardFixtures; - let defaultMerchant: Merchant; - let defaultMerchantUser: MerchantUser; +describe('merchant user agent dashboard', {tags: ['@marketplace-agent-assist']}, (): void => { + const dashboardPage: DashboardPage = container.get(DashboardPage); + const agentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); + const userIndexPage: UserIndexPage = container.get(UserIndexPage); + const userDeletePage: UserDeletePage = container.get(UserDeletePage); + const merchantListPage: MerchantListPage = container.get(MerchantListPage); + const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); + const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); + const merchantAgentLoginUserScenario: MerchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); + + let dynamicFixtures: MerchantUserAgentDashboardDynamicFixtures; + let staticFixtures: MerchantUserAgentDashboardStaticFixtures; before((): void => { - fixtures = Cypress.env('fixtures'); - - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); - - defaultMerchant = createMerchantScenario.execute(); - defaultMerchantUser = createMerchantUserScenario.execute(defaultMerchant.name); + ({ dynamicFixtures, staticFixtures } = Cypress.env()); }); it('agent should be able to see "Merchant Users" table', (): void => { - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + agentDashboardPage.visit(); agentDashboardPage.assertPageLocation(); agentDashboardPage.getDashboardSidebarSelector().contains('Merchant Users'); @@ -54,130 +44,135 @@ describe('merchant user agent dashboard', (): void => { }); it('agent should be able to see active merchant user in a table', (): void => { - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); }); it('agent should be able to filter by merchant user properties', (): void => { - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - agentDashboardPage.findMerchantUser(defaultMerchant.name).should('exist'); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); - agentDashboardPage.findMerchantUser(defaultMerchantUser.firstName).should('exist'); - agentDashboardPage.findMerchantUser(defaultMerchantUser.lastName).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name).should('exist'); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.first_name).should('exist'); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.last_name).should('exist'); }); it('agent should be able to see/assist inactive merchant user in a table', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.deactivateUser(defaultMerchantUser.username); + userIndexPage.visit(); + userIndexPage.deactivateUser(dynamicFixtures.merchantUser.username); - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + + agentDashboardPage.visit(); + agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - cy.visitMerchantPortal(agentDashboardPage.PAGE_URL); - agentDashboardPage.assistMerchantUser(defaultMerchantUser.username); dashboardPage.assertPageLocation(); }); it('agent should be able to see/assist deleted merchant user in a table', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - cy.visitBackoffice(userIndexPage.PAGE_URL); - userIndexPage.deleteUser(defaultMerchantUser.username); + userIndexPage.visit(); + userIndexPage.deleteUser(dynamicFixtures.merchantUser.username); userDeletePage.confirmDelete(); - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - cy.visitMerchantPortal(agentDashboardPage.PAGE_URL); - agentDashboardPage.assistMerchantUser(defaultMerchantUser.username); dashboardPage.assertPageLocation(); }); it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.activateMerchant(defaultMerchant.name); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.approveAccessMerchant(defaultMerchant.name); + merchantListPage.visit(); + merchantListPage.activateMerchant(dynamicFixtures.merchant.name); + merchantListPage.visit(); + merchantListPage.approveAccessMerchant(dynamicFixtures.merchant.name); - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + + agentDashboardPage.visit(); + agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - cy.visitMerchantPortal(agentDashboardPage.PAGE_URL); - agentDashboardPage.assistMerchantUser(defaultMerchantUser.username); dashboardPage.assertPageLocation(); }); it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + merchantListPage.visit(); + merchantListPage.activateMerchant(dynamicFixtures.merchant.name); + merchantListPage.visit(); + merchantListPage.denyAccessMerchant(dynamicFixtures.merchant.name); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.activateMerchant(defaultMerchant.name); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.denyAccessMerchant(defaultMerchant.name); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - cy.visitMerchantPortal(agentDashboardPage.PAGE_URL); - agentDashboardPage.assistMerchantUser(defaultMerchantUser.username); dashboardPage.assertPageLocation(); }); it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.deactivateMerchant(defaultMerchant.name); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.approveAccessMerchant(defaultMerchant.name); + merchantListPage.visit(); + merchantListPage.deactivateMerchant(dynamicFixtures.merchant.name); + merchantListPage.visit(); + merchantListPage.approveAccessMerchant(dynamicFixtures.merchant.name); - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + + agentDashboardPage.visit(); + agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - cy.visitMerchantPortal(agentDashboardPage.PAGE_URL); - agentDashboardPage.assistMerchantUser(defaultMerchantUser.username); dashboardPage.assertPageLocation(); }); it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => { - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + merchantListPage.visit(); + merchantListPage.deactivateMerchant(dynamicFixtures.merchant.name); + merchantListPage.visit(); + merchantListPage.denyAccessMerchant(dynamicFixtures.merchant.name); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.deactivateMerchant(defaultMerchant.name); - cy.visitBackoffice(merchantListPage.PAGE_URL); - merchantListPage.denyAccessMerchant(defaultMerchant.name); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - cy.resetMerchantPortalCookies(); - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + agentDashboardPage.visit(); + agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - agentDashboardPage.findMerchantUser(defaultMerchantUser.username).should('exist'); + agentDashboardPage.visit(); + agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - cy.visitMerchantPortal(agentDashboardPage.PAGE_URL); - agentDashboardPage.assistMerchantUser(defaultMerchantUser.username); dashboardPage.assertPageLocation(); }); }); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts index facdf6ad..55941bef 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts @@ -1,75 +1,75 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { MpLoginPage } from '../../support/pages/mp/login/mp-login-page'; -import { MpAgentLoginPage } from '../../support/pages/mp/agent-login/mp-agent-login-page'; -import { MpDashboardPage } from '../../support/pages/mp/dashboard/mp-dashboard-page'; -import { MpAgentDashboardPage } from '../../support/pages/mp/agent-dashboard/mp-agent-dashboard-page'; -import { MpLoginUserScenario } from '../../support/scenarios/mp/mp-login-user-scenario'; -import { MpAgentLoginUserScenario } from '../../support/scenarios/mp/mp-agent-login-user-scenario'; +import { container } from '../../../support/utils/inversify/inversify.config'; +import { AgentDashboardPage, AgentLoginPage, DashboardPage, LoginPage } from '../../../support/pages/mp'; +import { + MerchantUserAgentLoginPageDynamicFixtures, + MerchantUserAgentLoginPageStaticFixtures, +} from '../../../support/types/mp/merchant-user-agent-login-page'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('merchant user agent login page', (): void => { - const loginPage: MpLoginPage = container.get(MpLoginPage); - const dashboardPage: MpDashboardPage = container.get(MpDashboardPage); - const agentLoginPage: MpAgentLoginPage = container.get(MpAgentLoginPage); - const agentDashboardPage: MpAgentDashboardPage = container.get(MpAgentDashboardPage); +describe('merchant user agent login page', {tags: ['@marketplace-agent-assist']}, (): void => { + const loginPage: LoginPage = container.get(LoginPage); + const dashboardPage: DashboardPage = container.get(DashboardPage); + const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); + const agentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); - const loginUserScenario: MpLoginUserScenario = container.get(MpLoginUserScenario); - const agentLoginUserScenario: MpAgentLoginUserScenario = container.get(MpAgentLoginUserScenario); - - let fixtures: MerchantUserAgentLoginPageFixtures; + let dynamicFixtures: MerchantUserAgentLoginPageDynamicFixtures; + let staticFixtures: MerchantUserAgentLoginPageStaticFixtures; before((): void => { - fixtures = Cypress.env('fixtures'); - }); - - beforeEach((): void => { - cy.resetMerchantPortalCookies(); + ({ dynamicFixtures, staticFixtures } = Cypress.env()); }); it('agent (customer) should not be able to login to MP dashboard', (): void => { - loginUserScenario.execute(fixtures.customerAgentUser); + loginPage.visit(); + loginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); cy.contains(loginPage.getFailedAuthenticationText()); loginPage.assertPageLocation(); }); it('agent (merchant user) should not be able to login to MP dashboard', (): void => { - loginUserScenario.execute(fixtures.merchantAgentUser); + loginPage.visit(); + loginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); cy.contains(loginPage.getFailedAuthenticationText()); loginPage.assertPageLocation(); }); it('merchant user should be able to login to MP dashboard', (): void => { - loginUserScenario.execute(fixtures.merchantUser); + loginPage.visit(); + loginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); cy.contains('Dashboard'); dashboardPage.assertPageLocation(); }); it('agent (customer) should not be able to login to MP agent dashboard', (): void => { - agentLoginUserScenario.execute(fixtures.customerAgentUser); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); cy.contains(agentLoginPage.getFailedAuthenticationText()); agentLoginPage.assertPageLocation(); }); it('merchant user should not be able to login to MP agent dashboard', (): void => { - agentLoginUserScenario.execute(fixtures.merchantUser); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); cy.contains(agentLoginPage.getFailedAuthenticationText()); agentLoginPage.assertPageLocation(); }); it('agent (merchant user) should be able to login to MP agent dashboard', (): void => { - agentLoginUserScenario.execute(fixtures.merchantAgentUser); + agentLoginPage.visit(); + agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + agentDashboardPage.assertPageLocation(); }); it('agent assist login page in MP should not contain "Forgot password" button', (): void => { - cy.visitMerchantPortal(agentLoginPage.PAGE_URL); + agentLoginPage.visit(); cy.contains('Agent Assist Login'); cy.get('body').contains('Forgot password').should('not.exist'); diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json deleted file mode 100644 index 70b0cf34..00000000 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-portal-agent-login.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "synchronize": true, - "operations": [ - { - "type": "transfer", - "name": "StoreTransfer", - "key": "store", - "arguments": { - "id_store": 1 - } - }, - { - "type": "helper", - "name": "haveFullProduct", - "key": "productOne", - "arguments": [] - }, - { - "type": "helper", - "name": "haveFullProduct", - "key": "productTwo", - "arguments": [] - }, - { - "type": "helper", - "name": "havePriceProduct", - "key": "productOneWithPrice", - "arguments": [ - { - "skuProductAbstract": "#productOne.abstract_sku", - "skuProduct": "#productOne.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } - } - ] - }, - { - "type": "helper", - "name": "havePriceProduct", - "key": "productTwoWithPrice", - "arguments": [ - { - "skuProductAbstract": "#productTwo.abstract_sku", - "skuProduct": "#productTwo.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } - } - ] - }, - { - "type": "helper", - "name": "haveProductInStockForStore", - "key": "productOneWithPriceAndStore", - "arguments": [ - "#store", - { - "sku": "#productOne.sku", - "isNeverOutOfStock": "1" - } - ] - }, - { - "type": "helper", - "name": "haveProductInStockForStore", - "key": "productTwoWithPriceAndStore", - "arguments": [ - "#store", - { - "sku": "#productTwo.sku", - "isNeverOutOfStock": "1" - } - ] - } - ] - } - } -} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json index e8e69945..30b57792 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json @@ -1,10 +1,70 @@ { - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "backofficeUser": { - "username": "admin@spryker.com", - "password": "change123" + "data": { + "type": "test-operation-runner", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [ + { + "password": "change123", + "isMerchantAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "MerchantProfileTransfer", + "key": "merchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [{ + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + }] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } } } diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json index 5cbc2e51..93dffbb9 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json @@ -1,14 +1,71 @@ { - "customerAgentUser": { - "username": "agent123@spryker.com", - "password": "change123" - }, - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "merchantUser": { - "username": "harald@spryker.com", - "password": "change123" + "data": { + "type": "test-operation-runner", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [ + { + "password": "change123", + "isMerchantAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "customerAgentUser", + "arguments": [ + { + "password": "change123", + "isAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#customerAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "MerchantProfileTransfer", + "key": "merchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [{ + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + }] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } } } diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-portal-agent-login.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-portal-agent-login.json deleted file mode 100644 index e69de29b..00000000 diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json index e8e69945..ba4339e8 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.json @@ -1,10 +1,3 @@ { - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "backofficeUser": { - "username": "admin@spryker.com", - "password": "change123" - } + "defaultPassword": "change123" } diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json index 5cbc2e51..ba4339e8 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-login-page.json @@ -1,14 +1,3 @@ { - "customerAgentUser": { - "username": "agent123@spryker.com", - "password": "change123" - }, - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "merchantUser": { - "username": "harald@spryker.com", - "password": "change123" - } + "defaultPassword": "change123" } diff --git a/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts similarity index 84% rename from cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-page.ts rename to cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts index 951986ad..297e7f06 100644 --- a/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpAgentDashboardRepository } from './mp-agent-dashboard-repository'; +import { AgentDashboardRepository } from './agent-dashboard-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpAgentDashboardPage extends MpPage { +export class AgentDashboardPage extends MpPage { protected PAGE_URL: string = '/agent-dashboard-merchant-portal-gui/merchant-users'; - constructor(@inject(MpAgentDashboardRepository) private repository: MpAgentDashboardRepository) { + constructor(@inject(AgentDashboardRepository) private repository: AgentDashboardRepository) { super(); } diff --git a/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-repository.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts similarity index 93% rename from cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-repository.ts rename to cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts index 2c4bf8dc..1909e6ff 100644 --- a/cypress/support/pages/mp/agent-dashboard/mp-agent-dashboard-repository.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpAgentDashboardRepository { +export class AgentDashboardRepository { getDashboardSidebarSelector = (): Cypress.Chainable => cy.get('spy-sidebar.spy-sidebar'); getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); getSearchSelector = (): string => '.spy-table-search-feature input[type="text"]'; diff --git a/cypress/support/pages/mp/agent-login/mp-agent-login-page.ts b/cypress/support/pages/mp/agent-login/agent-login-page.ts similarity index 72% rename from cypress/support/pages/mp/agent-login/mp-agent-login-page.ts rename to cypress/support/pages/mp/agent-login/agent-login-page.ts index ab03a179..6f55d046 100644 --- a/cypress/support/pages/mp/agent-login/mp-agent-login-page.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-page.ts @@ -1,20 +1,19 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpAgentLoginRepository } from './mp-agent-login-repository'; +import { AgentLoginRepository } from './agent-login-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpAgentLoginPage extends MpPage { +export class AgentLoginPage extends MpPage { protected PAGE_URL: string = '/agent-security-merchant-portal-gui/login'; - constructor(@inject(MpAgentLoginRepository) private repository: MpAgentLoginRepository) { + constructor(@inject(AgentLoginRepository) private repository: AgentLoginRepository) { super(); } public login = (username: string, password: string): void => { - cy.visitMerchantPortal(this.PAGE_URL); this.repository.getEmailInput().clear().type(username); this.repository.getPasswordInput().clear().type(password); diff --git a/cypress/support/pages/mp/agent-login/mp-agent-login-repository.ts b/cypress/support/pages/mp/agent-login/agent-login-repository.ts similarity index 93% rename from cypress/support/pages/mp/agent-login/mp-agent-login-repository.ts rename to cypress/support/pages/mp/agent-login/agent-login-repository.ts index 9d593d34..e6596888 100644 --- a/cypress/support/pages/mp/agent-login/mp-agent-login-repository.ts +++ b/cypress/support/pages/mp/agent-login/agent-login-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpAgentLoginRepository { +export class AgentLoginRepository { getEmailInput = (): Cypress.Chainable => cy.get('#agent-security-merchant-portal-gui_username'); getPasswordInput = (): Cypress.Chainable => cy.get('#agent-security-merchant-portal-gui_password'); getSubmitButton = (): Cypress.Chainable => diff --git a/cypress/support/pages/mp/dashboard/mp-dashboard-page.ts b/cypress/support/pages/mp/dashboard/dashboard-page.ts similarity index 68% rename from cypress/support/pages/mp/dashboard/mp-dashboard-page.ts rename to cypress/support/pages/mp/dashboard/dashboard-page.ts index f9da1567..3b7073e9 100644 --- a/cypress/support/pages/mp/dashboard/mp-dashboard-page.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpDashboardRepository } from './mp-dashboard-repository'; +import { DashboardRepository } from './dashboard-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpDashboardPage extends MpPage { +export class DashboardPage extends MpPage { protected PAGE_URL: string = '/dashboard-merchant-portal-gui/dashboard'; - constructor(@inject(MpDashboardRepository) private repository: MpDashboardRepository) { + constructor(@inject(DashboardRepository) private repository: DashboardRepository) { super(); } diff --git a/cypress/support/pages/mp/dashboard/mp-dashboard-repository.ts b/cypress/support/pages/mp/dashboard/dashboard-repository.ts similarity index 90% rename from cypress/support/pages/mp/dashboard/mp-dashboard-repository.ts rename to cypress/support/pages/mp/dashboard/dashboard-repository.ts index 781c68b6..508da501 100644 --- a/cypress/support/pages/mp/dashboard/mp-dashboard-repository.ts +++ b/cypress/support/pages/mp/dashboard/dashboard-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpDashboardRepository { +export class DashboardRepository { getUserProfileMenu = (): Cypress.Chainable => cy.get('.spy-user-menu'); getLogoutButton = (): Cypress.Chainable => cy.get('.spy-user-menu__content.ng-star-inserted').find('a:contains("Logout")'); diff --git a/cypress/support/pages/mp/index.ts b/cypress/support/pages/mp/index.ts new file mode 100644 index 00000000..805f3a11 --- /dev/null +++ b/cypress/support/pages/mp/index.ts @@ -0,0 +1,8 @@ +export * from './agent-dashboard/agent-dashboard-page'; +export * from './agent-login/agent-login-page'; +export * from './dashboard/dashboard-page'; +export * from './login/login-page'; +export * from './offers/offers-page'; +export * from './products/products-page'; +export * from './profile/profile-page'; +export * from './sales/sales-orders-page'; diff --git a/cypress/support/pages/mp/login/mp-login-page.ts b/cypress/support/pages/mp/login/login-page.ts similarity index 79% rename from cypress/support/pages/mp/login/mp-login-page.ts rename to cypress/support/pages/mp/login/login-page.ts index 3115efdb..b5ae5341 100644 --- a/cypress/support/pages/mp/login/mp-login-page.ts +++ b/cypress/support/pages/mp/login/login-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpLoginRepository } from './mp-login-repository'; +import { LoginRepository } from './login-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpLoginPage extends MpPage { +export class LoginPage extends MpPage { protected PAGE_URL: string = '/security-merchant-portal-gui/login'; - constructor(@inject(MpLoginRepository) private repository: MpLoginRepository) { + constructor(@inject(LoginRepository) private repository: LoginRepository) { super(); } diff --git a/cypress/support/pages/mp/login/mp-login-repository.ts b/cypress/support/pages/mp/login/login-repository.ts similarity index 94% rename from cypress/support/pages/mp/login/mp-login-repository.ts rename to cypress/support/pages/mp/login/login-repository.ts index c94a0bc3..66e8fb3d 100644 --- a/cypress/support/pages/mp/login/mp-login-repository.ts +++ b/cypress/support/pages/mp/login/login-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpLoginRepository { +export class LoginRepository { getEmailInput = (): Cypress.Chainable => cy.get('#security-merchant-portal-gui_username'); getPasswordInput = (): Cypress.Chainable => cy.get('#security-merchant-portal-gui_password'); getSubmitButton = (): Cypress.Chainable => diff --git a/cypress/support/pages/mp/offers/mp-offers-page.ts b/cypress/support/pages/mp/offers/offers-page.ts similarity index 81% rename from cypress/support/pages/mp/offers/mp-offers-page.ts rename to cypress/support/pages/mp/offers/offers-page.ts index c828fb14..4591e1e9 100644 --- a/cypress/support/pages/mp/offers/mp-offers-page.ts +++ b/cypress/support/pages/mp/offers/offers-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpOffersRepository } from './mp-offers-repository'; +import { OffersRepository } from './offers-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpOffersPage extends MpPage { +export class OffersPage extends MpPage { protected PAGE_URL: string = '/product-offer-merchant-portal-gui/product-offers'; - constructor(@inject(MpOffersRepository) private repository: MpOffersRepository) { + constructor(@inject(OffersRepository) private repository: OffersRepository) { super(); } diff --git a/cypress/support/pages/mp/offers/mp-offers-repository.ts b/cypress/support/pages/mp/offers/offers-repository.ts similarity index 92% rename from cypress/support/pages/mp/offers/mp-offers-repository.ts rename to cypress/support/pages/mp/offers/offers-repository.ts index 2d96f7bc..3e9e4259 100644 --- a/cypress/support/pages/mp/offers/mp-offers-repository.ts +++ b/cypress/support/pages/mp/offers/offers-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpOffersRepository { +export class OffersRepository { getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); getSearchSelector = (): string => '.spy-table-search-feature input[type="text"]'; getDrawer = (): Cypress.Chainable => cy.get('.spy-drawer-wrapper'); diff --git a/cypress/support/pages/mp/products/mp-products-page.ts b/cypress/support/pages/mp/products/products-page.ts similarity index 80% rename from cypress/support/pages/mp/products/mp-products-page.ts rename to cypress/support/pages/mp/products/products-page.ts index d36099e3..c6294048 100644 --- a/cypress/support/pages/mp/products/mp-products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpProductsRepository } from './mp-products-repository'; +import { ProductsRepository } from './products-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpProductsPage extends MpPage { +export class ProductsPage extends MpPage { protected PAGE_URL: string = '/product-merchant-portal-gui/products'; - constructor(@inject(MpProductsRepository) private repository: MpProductsRepository) { + constructor(@inject(ProductsRepository) private repository: ProductsRepository) { super(); } diff --git a/cypress/support/pages/mp/products/mp-products-repository.ts b/cypress/support/pages/mp/products/products-repository.ts similarity index 91% rename from cypress/support/pages/mp/products/mp-products-repository.ts rename to cypress/support/pages/mp/products/products-repository.ts index f1fcbd83..b68dd419 100644 --- a/cypress/support/pages/mp/products/mp-products-repository.ts +++ b/cypress/support/pages/mp/products/products-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpProductsRepository { +export class ProductsRepository { getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); getSearchSelector = (): string => '.spy-table-search-feature input[type="text"]'; getDrawer = (): Cypress.Chainable => cy.get('.spy-drawer-wrapper'); diff --git a/cypress/support/pages/mp/profile/mp-profile-page.ts b/cypress/support/pages/mp/profile/profile-page.ts similarity index 73% rename from cypress/support/pages/mp/profile/mp-profile-page.ts rename to cypress/support/pages/mp/profile/profile-page.ts index ecafa59d..310c6dc1 100644 --- a/cypress/support/pages/mp/profile/mp-profile-page.ts +++ b/cypress/support/pages/mp/profile/profile-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpProfileRepository } from './mp-profile-repository'; +import { ProfileRepository } from './profile-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpProfilePage extends MpPage { +export class ProfilePage extends MpPage { protected PAGE_URL: string = '/merchant-profile-merchant-portal-gui/profile'; - constructor(@inject(MpProfileRepository) private repository: MpProfileRepository) { + constructor(@inject(ProfileRepository) private repository: ProfileRepository) { super(); } diff --git a/cypress/support/pages/mp/profile/mp-profile-repository.ts b/cypress/support/pages/mp/profile/profile-repository.ts similarity index 91% rename from cypress/support/pages/mp/profile/mp-profile-repository.ts rename to cypress/support/pages/mp/profile/profile-repository.ts index 15ba9d69..50880b6c 100644 --- a/cypress/support/pages/mp/profile/mp-profile-repository.ts +++ b/cypress/support/pages/mp/profile/profile-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpProfileRepository { +export class ProfileRepository { getPhoneNumberInput = (): Cypress.Chainable => cy.get('#merchantProfile_businessInfoMerchantProfile_contact_person_phone'); getProfileForm = (): Cypress.Chainable => cy.get('form[name=merchantProfile]'); diff --git a/cypress/support/pages/mp/sales/mp-sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts similarity index 80% rename from cypress/support/pages/mp/sales/mp-sales-orders-page.ts rename to cypress/support/pages/mp/sales/sales-orders-page.ts index d82d4c27..37ee86b0 100644 --- a/cypress/support/pages/mp/sales/mp-sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -1,15 +1,15 @@ import { inject, injectable } from 'inversify'; import 'reflect-metadata'; -import { MpSalesOrdersRepository } from './mp-sales-orders-repository'; +import { SalesOrdersRepository } from './sales-orders-repository'; import { autoWired } from '../../../utils/inversify/auto-wired'; import { MpPage } from '../mp-page'; @injectable() @autoWired -export class MpSalesOrdersPage extends MpPage { +export class SalesOrdersPage extends MpPage { protected PAGE_URL: string = '/sales-merchant-portal-gui/orders'; - constructor(@inject(MpSalesOrdersRepository) private repository: MpSalesOrdersRepository) { + constructor(@inject(SalesOrdersRepository) private repository: SalesOrdersRepository) { super(); } diff --git a/cypress/support/pages/mp/sales/mp-sales-orders-repository.ts b/cypress/support/pages/mp/sales/sales-orders-repository.ts similarity index 90% rename from cypress/support/pages/mp/sales/mp-sales-orders-repository.ts rename to cypress/support/pages/mp/sales/sales-orders-repository.ts index bf3b9838..58f2e662 100644 --- a/cypress/support/pages/mp/sales/mp-sales-orders-repository.ts +++ b/cypress/support/pages/mp/sales/sales-orders-repository.ts @@ -4,7 +4,7 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @injectable() @autoWired -export class MpSalesOrdersRepository { +export class SalesOrdersRepository { getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); getSearchSelector = (): string => '.spy-table-search-feature input[type="text"]'; getDrawer = (): Cypress.Chainable => cy.get('.spy-drawer-wrapper'); diff --git a/cypress/support/scenarios/backoffice/create-merchant-scenario.ts b/cypress/support/scenarios/backoffice/create-merchant-scenario.ts deleted file mode 100644 index 01e1012e..00000000 --- a/cypress/support/scenarios/backoffice/create-merchant-scenario.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { inject, injectable } from 'inversify'; -import { MerchantCreatePage } from '../../pages/backoffice/merchant/create/merchant-create-page'; -import { MerchantListPage } from '../../pages/backoffice/merchant/list/merchant-list-page'; -import { autoWired } from '../../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class CreateMerchantScenario { - constructor( - @inject(MerchantCreatePage) private merchantCreatePage: MerchantCreatePage, - @inject(MerchantListPage) private merchantListPage: MerchantListPage - ) {} - - public execute = (): Merchant => { - cy.visitBackoffice(this.merchantCreatePage.PAGE_URL); - const merchant: Merchant = this.merchantCreatePage.createMerchant(); - - cy.visitBackoffice(this.merchantListPage.PAGE_URL); - this.merchantListPage.approveAccessMerchant(merchant.name); - - return merchant; - }; -} diff --git a/cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts b/cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts deleted file mode 100644 index f85ac9a4..00000000 --- a/cypress/support/scenarios/backoffice/create-merchant-user-scenario.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { inject, injectable } from 'inversify'; -import { MerchantListPage } from '../../pages/backoffice/merchant/list/merchant-list-page'; -import { MerchantUserCreatePage } from '../../pages/backoffice/merchant-user/create/merchant-user-create-page'; -import { UserIndexPage } from '../../pages/backoffice/user/index/user-index-page'; -import { UserUpdatePage } from '../../pages/backoffice/user/update/user-update-page'; -import { MerchantUpdatePage } from '../../pages/backoffice/merchant/update/merchant-update-page'; -import { autoWired } from '../../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class CreateMerchantUserScenario { - constructor( - @inject(MerchantListPage) private merchantListPage: MerchantListPage, - @inject(MerchantUpdatePage) private merchantUpdatePage: MerchantUpdatePage, - @inject(MerchantUserCreatePage) private merchantUserCreatePage: MerchantUserCreatePage, - @inject(UserIndexPage) private userIndexPage: UserIndexPage, - @inject(UserUpdatePage) private userUpdatePage: UserUpdatePage - ) {} - - public execute = (merchantName: string): MerchantUser => { - cy.visitBackoffice(this.merchantListPage.PAGE_URL); - this.merchantListPage.editMerchant(merchantName); - - this.merchantUpdatePage.createNewUser(); - const merchantUser: MerchantUser = this.merchantUserCreatePage.createMerchantUser(); - - cy.visitBackoffice(this.userIndexPage.PAGE_URL); - this.userIndexPage.activateUser(merchantUser.username); - cy.visitBackoffice(this.userIndexPage.PAGE_URL); - this.userIndexPage.editUser(merchantUser.username); - - this.userUpdatePage.setDefaultPassword(); - - merchantUser.user = { - username: merchantUser.username, - password: this.userUpdatePage.DEFAULT_PASSWORD, - }; - - return merchantUser; - }; -} diff --git a/cypress/support/scenarios/backoffice/create-root-user-scenario.ts b/cypress/support/scenarios/backoffice/create-root-user-scenario.ts deleted file mode 100644 index ef1e0967..00000000 --- a/cypress/support/scenarios/backoffice/create-root-user-scenario.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { inject, injectable } from 'inversify'; -import { autoWired } from '../../utils/inversify/auto-wired'; -import {User} from "../../types/refactor_this_file_and_drop_it"; -import { UserCreatePage, UserIndexPage } from '../../pages/backoffice'; - -@injectable() -@autoWired -export class CreateRootUserScenario { - constructor( - @inject(UserCreatePage) private userCreatePage: UserCreatePage, - @inject(UserIndexPage) private userIndexPage: UserIndexPage - ) {} - - public execute = (): User => { - this.userIndexPage.visit(); - this.userIndexPage.createNewUser(); - - return this.userCreatePage.createRootUser(); - }; -} diff --git a/cypress/support/scenarios/backoffice/index.ts b/cypress/support/scenarios/backoffice/index.ts index ee32f11f..dc41454b 100644 --- a/cypress/support/scenarios/backoffice/index.ts +++ b/cypress/support/scenarios/backoffice/index.ts @@ -1,3 +1,2 @@ export * from './user-login-scenario'; -export * from './create-root-user-scenario'; diff --git a/cypress/support/scenarios/backoffice/user-login-scenario.ts b/cypress/support/scenarios/backoffice/user-login-scenario.ts index 7fbbfcb7..e8f3f8d1 100644 --- a/cypress/support/scenarios/backoffice/user-login-scenario.ts +++ b/cypress/support/scenarios/backoffice/user-login-scenario.ts @@ -8,8 +8,6 @@ export class UserLoginScenario { constructor(@inject(LoginPage) private loginPage: LoginPage) {} public execute = (username: string, password: string): void => { - cy.resetBackofficeCookies(); - 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 bb4eee95..8e477655 100644 --- a/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts +++ b/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts @@ -1,18 +1,18 @@ import { inject, injectable } from 'inversify'; -import { MpAgentLoginUserScenario } from './mp-agent-login-user-scenario'; -import { MpAgentDashboardPage } from '../../pages/mp/agent-dashboard/mp-agent-dashboard-page'; import { autoWired } from '../../utils/inversify/auto-wired'; +import { AgentDashboardPage } from '../../pages/mp'; +import { MerchantAgentLoginUserScenario } from './merchant-agent-login-user-scenario'; @injectable() @autoWired export class ImpersonateAsMerchantUserScenario { constructor( - @inject(MpAgentLoginUserScenario) private mpAgentLoginUserScenario: MpAgentLoginUserScenario, - @inject(MpAgentDashboardPage) private mpAgentDashboardPage: MpAgentDashboardPage + @inject(MerchantAgentLoginUserScenario) private merchantAgentLoginUserScenario: MerchantAgentLoginUserScenario, + @inject(AgentDashboardPage) private mpAgentDashboardPage: AgentDashboardPage ) {} - public execute = (merchantAgentUser: User, merchantUsername: string): void => { - this.mpAgentLoginUserScenario.execute(merchantAgentUser); + public execute = (username: string, password: string, merchantUsername: string): void => { + this.merchantAgentLoginUserScenario.execute(username, password); this.mpAgentDashboardPage.assistMerchantUser(merchantUsername); }; diff --git a/cypress/support/scenarios/mp/index.ts b/cypress/support/scenarios/mp/index.ts new file mode 100644 index 00000000..92121bbf --- /dev/null +++ b/cypress/support/scenarios/mp/index.ts @@ -0,0 +1,4 @@ +export * from './impersonate-as-merchant-user-scenario'; +export * from './merchant-agent-login-user-scenario'; +export * from './merchant-user-login-scenario'; + diff --git a/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts new file mode 100644 index 00000000..09e8d8c3 --- /dev/null +++ b/cypress/support/scenarios/mp/merchant-agent-login-user-scenario.ts @@ -0,0 +1,16 @@ +import { inject, injectable } from 'inversify'; +import { autoWired } from '../../utils/inversify/auto-wired'; +import { AgentLoginPage } from '../../pages/mp'; + +@injectable() +@autoWired +export class MerchantAgentLoginUserScenario { + constructor(@inject(AgentLoginPage) private agentLoginPage: AgentLoginPage) {} + + public 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 new file mode 100644 index 00000000..cafa2257 --- /dev/null +++ b/cypress/support/scenarios/mp/merchant-user-login-scenario.ts @@ -0,0 +1,16 @@ +import { inject, injectable } from 'inversify'; +import { autoWired } from '../../utils/inversify/auto-wired'; +import { LoginPage } from '../../pages/mp'; + +@injectable() +@autoWired +export class MerchantUserLoginScenario { + constructor(@inject(LoginPage) private loginPage: LoginPage) {} + + public 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/mp-agent-login-user-scenario.ts b/cypress/support/scenarios/mp/mp-agent-login-user-scenario.ts deleted file mode 100644 index b01cd26d..00000000 --- a/cypress/support/scenarios/mp/mp-agent-login-user-scenario.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { inject, injectable } from 'inversify'; -import { MpAgentLoginPage } from '../../pages/mp/agent-login/mp-agent-login-page'; -import { autoWired } from '../../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class MpAgentLoginUserScenario { - constructor(@inject(MpAgentLoginPage) private loginPage: MpAgentLoginPage) {} - - public execute = (user: User): void => { - cy.visitMerchantPortal(this.loginPage.PAGE_URL); - this.loginPage.login(user); - }; -} diff --git a/cypress/support/scenarios/mp/mp-login-user-scenario.ts b/cypress/support/scenarios/mp/mp-login-user-scenario.ts deleted file mode 100644 index 748f004f..00000000 --- a/cypress/support/scenarios/mp/mp-login-user-scenario.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { inject, injectable } from 'inversify'; -import { MpLoginPage } from '../../pages/mp/login/mp-login-page'; -import { autoWired } from '../../utils/inversify/auto-wired'; - -@injectable() -@autoWired -export class MpLoginUserScenario { - constructor(@inject(MpLoginPage) private loginPage: MpLoginPage) {} - - public execute = (user: User): void => { - cy.visitMerchantPortal(this.loginPage.PAGE_URL); - this.loginPage.login(user); - }; -} diff --git a/cypress/support/scenarios/yves/agent-login-scenario.ts b/cypress/support/scenarios/yves/agent-login-scenario.ts index e259092d..747bcf66 100644 --- a/cypress/support/scenarios/yves/agent-login-scenario.ts +++ b/cypress/support/scenarios/yves/agent-login-scenario.ts @@ -8,8 +8,6 @@ export class AgentLoginScenario { constructor(@inject(AgentLoginPage) private loginPage: AgentLoginPage) {} public execute = (username: string, password: string): void => { - cy.resetYvesCookies(); - cy.session([username, password], () => { this.loginPage.visit(); this.loginPage.login(username, password); diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index cc94e94b..b24e39ae 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -8,8 +8,6 @@ export class CustomerLoginScenario { constructor(@inject(LoginPage) private loginPage: LoginPage) {} public execute = (email: string, password: string): void => { - cy.resetYvesCookies(); - cy.session([email, password], () => { this.loginPage.visit(); this.loginPage.login(email, password); diff --git a/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts new file mode 100644 index 00000000..4419e028 --- /dev/null +++ b/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts @@ -0,0 +1,16 @@ +export interface MerchantUserAgentDashboardDynamicFixtures { + rootUser: User; + merchantAgentUser: User; + merchantUser: User; + merchant: Merchant; +} + +interface User { + username: string; + first_name: string; + last_name: string; +} + +interface Merchant { + name: string; +} diff --git a/cypress/support/types/mp/merchant-user-agent-dashboard/index.ts b/cypress/support/types/mp/merchant-user-agent-dashboard/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/mp/merchant-user-agent-dashboard/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts new file mode 100644 index 00000000..9e0d9f22 --- /dev/null +++ b/cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts @@ -0,0 +1,3 @@ +export interface MerchantUserAgentDashboardStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts new file mode 100644 index 00000000..d9ebb479 --- /dev/null +++ b/cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts @@ -0,0 +1,9 @@ +export interface MerchantUserAgentLoginPageDynamicFixtures { + merchantAgentUser: User; + customerAgentUser: User; + merchantUser: User; +} + +interface User { + username: string; +} diff --git a/cypress/support/types/mp/merchant-user-agent-login-page/index.ts b/cypress/support/types/mp/merchant-user-agent-login-page/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/mp/merchant-user-agent-login-page/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts new file mode 100644 index 00000000..bd1aa6da --- /dev/null +++ b/cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts @@ -0,0 +1,3 @@ +export interface MerchantUserAgentLoginPageStaticFixtures { + defaultPassword: string; +} From 95ee85cf3a08d38ac32d8f6bf58e7016e404a23b Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Tue, 27 Feb 2024 20:06:07 +0300 Subject: [PATCH 15/53] Rework backoffice pages [skip ci] --- .../merchant-user-header-bar.cy.ts | 52 +++--- .../merchant-user-impersonation.cy.ts | 150 ++++++++---------- .../dynamic/merchant-user-header-bar.json | 61 +++++-- .../static/merchant-user-header-bar.json | 11 +- .../pages/backoffice/backoffice-page.ts | 5 +- cypress/support/pages/mp/mp-page.ts | 5 +- cypress/support/pages/yves/yves-page.ts | 5 +- .../impersonate-as-merchant-user-scenario.ts | 9 +- .../dynamic-fixture-types.ts | 15 ++ .../mp/merchant-user-header-bar/index.ts | 2 + .../static-fixture-types.ts | 3 + .../types/refactor_this_file_and_drop_it.ts | 47 ------ package-lock.json | 4 +- package.json | 4 +- 14 files changed, 189 insertions(+), 184 deletions(-) create mode 100644 cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts create mode 100644 cypress/support/types/mp/merchant-user-header-bar/index.ts create mode 100644 cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts delete mode 100644 cypress/support/types/refactor_this_file_and_drop_it.ts diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts index 6cd38168..f6b69f6d 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts @@ -1,41 +1,45 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { ImpersonateAsMerchantUserScenario } from '../../support/scenarios/mp/impersonate-as-merchant-user-scenario'; -import { MpDashboardPage } from '../../support/pages/mp/dashboard/mp-dashboard-page'; -import { MpAgentDashboardPage } from '../../support/pages/mp/agent-dashboard/mp-agent-dashboard-page'; -import { MpAgentLoginPage } from '../../support/pages/mp/agent-login/mp-agent-login-page'; -import { MpLoginPage } from '../../support/pages/mp/login/mp-login-page'; +import { container } from '../../../support/utils/inversify/inversify.config'; +import { AgentDashboardPage, AgentLoginPage, DashboardPage, LoginPage } from '../../../support/pages/mp'; +import { ImpersonateAsMerchantUserScenario } from '../../../support/scenarios/mp'; +import { + MerchantUserHeaderBarDynamicFixtures, + MerchantUserHeaderBarStaticFixtures, +} from '../../../support/types/mp/merchant-user-header-bar'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('merchant user header bar', (): void => { - const loginPage: MpLoginPage = container.get(MpLoginPage); - const agentLoginPage: MpAgentLoginPage = container.get(MpAgentLoginPage); - const dashboardPage: MpDashboardPage = container.get(MpDashboardPage); - const agentDashboardPage: MpAgentDashboardPage = container.get(MpAgentDashboardPage); - +describe('merchant user header bar', {tags: ['@marketplace-agent-assist']}, (): void => { + const loginPage: LoginPage = container.get(LoginPage); + const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); + const dashboardPage: DashboardPage = container.get(DashboardPage); + const agentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); - let fixtures: MerchantUserHeaderBarFixtures; + let dynamicFixtures: MerchantUserHeaderBarDynamicFixtures; + let staticFixtures: MerchantUserHeaderBarStaticFixtures; before((): void => { - fixtures = Cypress.env('fixtures'); + ({ dynamicFixtures, staticFixtures } = Cypress.env()); }); beforeEach((): void => { - cy.resetMerchantPortalCookies(); - impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.impersonatedMerchantUser.username); + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username, + ); }); - it('agent should be able to see merchant user information during impersonation', (): void => { - cy.visitMerchantPortal(dashboardPage.PAGE_URL); + it.only('agent should be able to see merchant user information during impersonation', (): void => { + dashboardPage.visit(); - cy.get('body').find(`div:contains("${fixtures.impersonatedMerchantName}")`).should('exist'); - cy.get('body').find(`div:contains("${fixtures.impersonatedMerchantUser.username}")`).should('exist'); + cy.get('body').find(`div:contains("${dynamicFixtures.merchant.name}")`).should('exist'); + cy.get('body').find(`div:contains("${dynamicFixtures.merchantUser.username}")`).should('exist'); cy.get('body') .find( - `div:contains("${fixtures.impersonatedMerchantUser.firstName} ${fixtures.impersonatedMerchantUser.lastName}")` + `div:contains("${dynamicFixtures.merchantUser.first_name} ${dynamicFixtures.merchantUser.last_name}")` ) .should('exist'); }); @@ -50,7 +54,7 @@ describe('merchant user header bar', (): void => { agentDashboardPage.assertPageLocation(); // Ensure that agent finished assistant session and don't have access to MP dashboard - cy.visitMerchantPortal(dashboardPage.PAGE_URL, { failOnStatusCode: false }); + dashboardPage.visit({ failOnStatusCode: false }); cy.get('body').contains('Access Denied.'); }); @@ -58,10 +62,10 @@ describe('merchant user header bar', (): void => { cy.get('body').find('a:contains("Log out Agent")').click(); agentLoginPage.assertPageLocation(); - cy.visitMerchantPortal(agentDashboardPage.PAGE_URL); + agentDashboardPage.visit(); agentLoginPage.assertPageLocation(); - cy.visitMerchantPortal(dashboardPage.PAGE_URL); + dashboardPage.visit(); loginPage.assertPageLocation(); }); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts index a7377cfb..ecca07f1 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts @@ -1,86 +1,76 @@ -import { container } from '../../support/utils/inversify/inversify.config'; -import { PlaceGuestMpOrderScenario } from '../../support/scenarios/yves/place-guest-mp-order-scenario'; -import { ImpersonateAsMerchantUserScenario } from '../../support/scenarios/mp/impersonate-as-merchant-user-scenario'; -import { BackofficeLoginUserScenario } from '../../support/scenarios/backoffice/backoffice-login-user-scenario'; -import { BackofficeSalesIndexPage } from '../../support/pages/backoffice/sales/index/backoffice-sales-index-page'; -import { BackofficeSalesDetailPage } from '../../support/pages/backoffice/sales/detail/backoffice-sales-detail-page'; -import { MpSalesOrdersPage } from '../../support/pages/mp/sales/mp-sales-orders-page'; -import { MpProfilePage } from '../../support/pages/mp/profile/mp-profile-page'; -import { MpProductsPage } from '../../support/pages/mp/products/mp-products-page'; -import { MpOffersPage } from '../../support/pages/mp/offers/mp-offers-page'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ describe('merchant user impersonation', (): void => { - const salesIndexPage: BackofficeSalesIndexPage = container.get(BackofficeSalesIndexPage); - const salesDetailPage: BackofficeSalesDetailPage = container.get(BackofficeSalesDetailPage); - const mpSalesOrdersPage: MpSalesOrdersPage = container.get(MpSalesOrdersPage); - const mpProfilePage: MpProfilePage = container.get(MpProfilePage); - const mpProductsPage: MpProductsPage = container.get(MpProductsPage); - const mpOffersPage: MpOffersPage = container.get(MpOffersPage); - - const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario); - const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); - const placeGuestMpOrderScenario: PlaceGuestMpOrderScenario = container.get(PlaceGuestMpOrderScenario); - - let fixtures: MerchantUserImpersonationFixtures; - - before((): void => { - fixtures = Cypress.env('fixtures'); - }); - - it('agent should be able to change order status during impersonation', (): void => { - cy.resetYvesCookies(); - const guest: Guest = placeGuestMpOrderScenario.execute(fixtures.productConcreteSkus); - - cy.resetBackofficeCookies(); - loginUserScenario.execute(fixtures.backofficeUser); - - salesIndexPage.viewLastPlacedOrder(); - salesDetailPage.triggerOms('Pay'); - salesDetailPage.triggerOms('skip picking', true); - - cy.resetMerchantPortalCookies(); - impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - - cy.visitMerchantPortal(mpSalesOrdersPage.PAGE_URL); - mpSalesOrdersPage.cancelOrder(guest.email); - - // Ensure that order was canceled - cy.visitMerchantPortal(mpSalesOrdersPage.PAGE_URL); - mpSalesOrdersPage.findOrder(guest.email).contains('canceled'); - }); - - it('agent should be able to modify merchant profile information during impersonation', (): void => { - cy.resetMerchantPortalCookies(); - impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - - cy.visitMerchantPortal(mpProfilePage.PAGE_URL); - mpProfilePage.updateMerchantPhoneNumber(); - - cy.get('body').contains('The Profile has been changed successfully.'); - }); - - it('agent should be able to modify product information during impersonation', (): void => { - cy.resetMerchantPortalCookies(); - impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - - cy.visitMerchantPortal(mpProductsPage.PAGE_URL); - mpProductsPage.findProduct(fixtures.productAbstractSku).click(); - mpProductsPage.getDrawer().find('button:contains("Save")').click(); - - cy.get('body').contains('The Product is saved.'); - }); - - it('agent should be able to modify offer information during impersonation', (): void => { - cy.resetMerchantPortalCookies(); - impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - - cy.visitMerchantPortal(mpOffersPage.PAGE_URL); - mpOffersPage.findOffer(fixtures.offerReference).click(); - mpOffersPage.getDrawer().find('button:contains("Save")').click(); - - cy.get('body').contains('The Offer is saved.'); - }); + // const salesIndexPage: BackofficeSalesIndexPage = container.get(BackofficeSalesIndexPage); + // const salesDetailPage: BackofficeSalesDetailPage = container.get(BackofficeSalesDetailPage); + // const mpSalesOrdersPage: MpSalesOrdersPage = container.get(MpSalesOrdersPage); + // const mpProfilePage: MpProfilePage = container.get(MpProfilePage); + // const mpProductsPage: MpProductsPage = container.get(MpProductsPage); + // const mpOffersPage: MpOffersPage = container.get(MpOffersPage); + // + // const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario); + // const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); + // const placeGuestMpOrderScenario: PlaceGuestMpOrderScenario = container.get(PlaceGuestMpOrderScenario); + // + // let fixtures: MerchantUserImpersonationFixtures; + // + // before((): void => { + // fixtures = Cypress.env('fixtures'); + // }); + // + // it('agent should be able to change order status during impersonation', (): void => { + // cy.resetYvesCookies(); + // const guest: Guest = placeGuestMpOrderScenario.execute(fixtures.productConcreteSkus); + // + // cy.resetBackofficeCookies(); + // loginUserScenario.execute(fixtures.backofficeUser); + // + // salesIndexPage.viewLastPlacedOrder(); + // salesDetailPage.triggerOms('Pay'); + // salesDetailPage.triggerOms('skip picking', true); + // + // cy.resetMerchantPortalCookies(); + // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); + // + // cy.visitMerchantPortal(mpSalesOrdersPage.PAGE_URL); + // mpSalesOrdersPage.cancelOrder(guest.email); + // + // // Ensure that order was canceled + // cy.visitMerchantPortal(mpSalesOrdersPage.PAGE_URL); + // mpSalesOrdersPage.findOrder(guest.email).contains('canceled'); + // }); + // + // it('agent should be able to modify merchant profile information during impersonation', (): void => { + // cy.resetMerchantPortalCookies(); + // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); + // + // cy.visitMerchantPortal(mpProfilePage.PAGE_URL); + // mpProfilePage.updateMerchantPhoneNumber(); + // + // cy.get('body').contains('The Profile has been changed successfully.'); + // }); + // + // it('agent should be able to modify product information during impersonation', (): void => { + // cy.resetMerchantPortalCookies(); + // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); + // + // cy.visitMerchantPortal(mpProductsPage.PAGE_URL); + // mpProductsPage.findProduct(fixtures.productAbstractSku).click(); + // mpProductsPage.getDrawer().find('button:contains("Save")').click(); + // + // cy.get('body').contains('The Product is saved.'); + // }); + // + // it('agent should be able to modify offer information during impersonation', (): void => { + // cy.resetMerchantPortalCookies(); + // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); + // + // cy.visitMerchantPortal(mpOffersPage.PAGE_URL); + // mpOffersPage.findOffer(fixtures.offerReference).click(); + // mpOffersPage.getDrawer().find('button:contains("Save")').click(); + // + // cy.get('body').contains('The Offer is saved.'); + // }); }); diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json index acb7cb49..eb363ce6 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json @@ -1,12 +1,55 @@ { - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "impersonatedMerchantName": "Spryker", - "impersonatedMerchantUser": { - "username": "harald@spryker.com", - "firstName": "Harald", - "lastName": "Schmidt" + "data": { + "type": "test-operation-runner", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [ + { + "password": "change123", + "isMerchantAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "MerchantProfileTransfer", + "key": "merchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [{ + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + }] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } } } diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json index acb7cb49..ba4339e8 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json @@ -1,12 +1,3 @@ { - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "impersonatedMerchantName": "Spryker", - "impersonatedMerchantUser": { - "username": "harald@spryker.com", - "firstName": "Harald", - "lastName": "Schmidt" - } + "defaultPassword": "change123" } diff --git a/cypress/support/pages/backoffice/backoffice-page.ts b/cypress/support/pages/backoffice/backoffice-page.ts index 97f5ae41..039d691d 100644 --- a/cypress/support/pages/backoffice/backoffice-page.ts +++ b/cypress/support/pages/backoffice/backoffice-page.ts @@ -1,10 +1,11 @@ import 'reflect-metadata'; import { injectable } from 'inversify'; import { AbstractPage } from '../abstract-page'; +import VisitOptions = Cypress.VisitOptions; @injectable() export class BackofficePage extends AbstractPage { - public visit = (): void => { - cy.visitBackoffice(this.PAGE_URL); + public visit = (options?: Partial): void => { + cy.visitBackoffice(this.PAGE_URL, options); } } diff --git a/cypress/support/pages/mp/mp-page.ts b/cypress/support/pages/mp/mp-page.ts index 17a0ba9f..2fd783e2 100644 --- a/cypress/support/pages/mp/mp-page.ts +++ b/cypress/support/pages/mp/mp-page.ts @@ -1,10 +1,11 @@ import 'reflect-metadata'; import { injectable } from 'inversify'; import { AbstractPage } from '../abstract-page'; +import VisitOptions = Cypress.VisitOptions; @injectable() export class MpPage extends AbstractPage { - public visit = (): void => { - cy.visitMerchantPortal(this.PAGE_URL); + public visit = (options?: Partial): void => { + cy.visitMerchantPortal(this.PAGE_URL, options); } } diff --git a/cypress/support/pages/yves/yves-page.ts b/cypress/support/pages/yves/yves-page.ts index f4b6f38e..48d78d1f 100644 --- a/cypress/support/pages/yves/yves-page.ts +++ b/cypress/support/pages/yves/yves-page.ts @@ -1,10 +1,11 @@ import 'reflect-metadata'; import { injectable } from 'inversify'; import { AbstractPage } from '../abstract-page'; +import VisitOptions = Cypress.VisitOptions; @injectable() export class YvesPage extends AbstractPage { - public visit = (): void => { - cy.visit(this.PAGE_URL); + public visit = (options?: Partial): void => { + cy.visit(this.PAGE_URL, options); } } 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 8e477655..2fcc9ac7 100644 --- a/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts +++ b/cypress/support/scenarios/mp/impersonate-as-merchant-user-scenario.ts @@ -1,19 +1,20 @@ import { inject, injectable } from 'inversify'; import { autoWired } from '../../utils/inversify/auto-wired'; -import { AgentDashboardPage } from '../../pages/mp'; -import { MerchantAgentLoginUserScenario } from './merchant-agent-login-user-scenario'; +import { AgentDashboardPage, AgentLoginPage } from '../../pages/mp'; @injectable() @autoWired export class ImpersonateAsMerchantUserScenario { constructor( - @inject(MerchantAgentLoginUserScenario) private merchantAgentLoginUserScenario: MerchantAgentLoginUserScenario, + @inject(AgentLoginPage) private agentLoginPage: AgentLoginPage, @inject(AgentDashboardPage) private mpAgentDashboardPage: AgentDashboardPage ) {} public execute = (username: string, password: string, merchantUsername: string): void => { - this.merchantAgentLoginUserScenario.execute(username, password); + this.agentLoginPage.visit(); + this.agentLoginPage.login(username, password); + this.mpAgentDashboardPage.visit(); this.mpAgentDashboardPage.assistMerchantUser(merchantUsername); }; } diff --git a/cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts new file mode 100644 index 00000000..7267f141 --- /dev/null +++ b/cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts @@ -0,0 +1,15 @@ +export interface MerchantUserHeaderBarDynamicFixtures { + merchantAgentUser: User; + merchantUser: User; + merchant: Merchant; +} + +interface User { + username: string; + first_name: string; + last_name: string; +} + +interface Merchant { + name: string; +} diff --git a/cypress/support/types/mp/merchant-user-header-bar/index.ts b/cypress/support/types/mp/merchant-user-header-bar/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/mp/merchant-user-header-bar/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts new file mode 100644 index 00000000..080aa189 --- /dev/null +++ b/cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts @@ -0,0 +1,3 @@ +export interface MerchantUserHeaderBarStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/refactor_this_file_and_drop_it.ts b/cypress/support/types/refactor_this_file_and_drop_it.ts deleted file mode 100644 index d645f965..00000000 --- a/cypress/support/types/refactor_this_file_and_drop_it.ts +++ /dev/null @@ -1,47 +0,0 @@ - -export interface BackofficeMerchantAgentFixtures { - user: User; - customerAgentUser: User; - merchantAgentUser: User; -} - -export interface MerchantPortalAgentLoginFixtures { - customerAgentUser: User; - merchantAgentUser: User; - merchantUser: User; -} - -type MerchantUserAgentDashboardFixtures = { - merchantAgentUser: User; - backofficeUser: User; -}; - -type MerchantUserImpersonationFixtures = { - merchantAgentUser: User; - backofficeUser: User; - merchantUsername: string; - productConcreteSkus: string[]; - productAbstractSku: string; - offerReference: string; -}; - -type MerchantUserHeaderBarFixtures = { - merchantAgentUser: User; - impersonatedMerchantName: string; - impersonatedMerchantUser: MerchantUser; -}; - -type MerchantUser = { - -}; - - -export interface User { - username: string; - password: string; -} -export interface Guest { - firstName: string; - lastName: string; - email: string; -} diff --git a/package-lock.json b/package-lock.json index fc38f50e..25679ac3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "spryker-cypress-tests", + "name": "cypress-tests", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "spryker-cypress-tests", + "name": "cypress-tests", "version": "0.1.0", "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 0190727a..5e015008 100644 --- a/package.json +++ b/package.json @@ -18,19 +18,19 @@ "cy:yves": "npx cypress run --spec cypress/e2e/yves/* --headless --browser chrome", "cy:backoffice": "npx cypress run --spec cypress/e2e/backoffice/* --headless --browser chrome", "cy:mp": "npx cypress run --spec cypress/e2e/mp/* --headless --browser chrome", - "cy:smoke": "npx cypress run --env grepTags=@smoke --headless --browser chrome" + "cy:feature:comments": "npx cypress run --env grepTags=@comments --headless --browser chrome" }, "engines": { "node": ">=18.0.0", "npm": ">=10.0.0" }, "devDependencies": { - "cypress": "^13.6.6", "@cypress/grep": "^4.0.1", "@faker-js/faker": "^8.3.1", "@types/dotenv": "^8.2.0", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", + "cypress": "^13.6.6", "eslint": "^8.55.0", "inversify": "^6.0.2", "prettier": "3.1.0", From 794d19858ca1fce95f9e0ab6df79b4cce03f7c3e Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Tue, 27 Feb 2024 18:54:24 +0100 Subject: [PATCH 16/53] CC-32482: Changed the docker file. --- Dockerfile | 8 ++++---- docker-compose.cypress.yml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e63253d..17227a14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,11 @@ RUN mkdir -p ${CYPRESS_TESTS_WORK_DIR} # Set the working directory WORKDIR ${CYPRESS_TESTS_WORK_DIR} -# Copy the package.json and package-lock.json files to the working directory -COPY package.json package-lock.json ./ +# Copy the cypress tests to the working directory +COPY . . -# Install dependencies +# Install the dependencies RUN npm install -# Source the .env file to export the variables +# Starts a bash shell in the container that ignores termination signals and keeps the container running indefinitely. ENTRYPOINT ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"] diff --git a/docker-compose.cypress.yml b/docker-compose.cypress.yml index 80ee9b8a..6d14e0e3 100644 --- a/docker-compose.cypress.yml +++ b/docker-compose.cypress.yml @@ -16,10 +16,10 @@ services: 'spryker.app.type': cypress-tests 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} volumes: - - ./vendor/spryker/cypress-tests:/opt/cypress-tests:rw + - ./vendor/spryker/cypress-tests/cypress/e2e:/opt/cypress-tests/cypress/e2e:rw + - ./vendor/spryker/cypress-tests/cypress/fixtures:/opt/cypress-tests/cypress/fixtures:rw + - ./vendor/spryker/cypress-tests/cypress/support:/opt/cypress-tests/cypress/support:rw - ./.cypress/screenshots:/opt/cypress-tests/cypress/screenshots:rw - ./.cypress/videos:/opt/cypress-tests/cypress/videos:rw - ./.cypress/logs:/opt/cypress-tests/cypress/logs:rw - /tmp/.X11-unix:/tmp/.X11-unix -# environment: -# - DISPLAY=${DISPLAY_IP} From f95b82801c8a07d31404a2121473934febf5b854 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Wed, 28 Feb 2024 12:24:25 +0100 Subject: [PATCH 17/53] CC-32482: Updated the configuration of the cypress. --- .env.example | 11 ++++---- cypress.config.ts | 56 +++++++++++++++++++++++--------------- docker-compose.cypress.yml | 5 ++-- set-env-vars.sh | 31 --------------------- 4 files changed, 42 insertions(+), 61 deletions(-) delete mode 100755 set-env-vars.sh diff --git a/.env.example b/.env.example index a4de757b..ab55ce5d 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,10 @@ ENV_REPOSITORY_ID=suite -ENV_BACKOFFICE_URL=http://backoffice.de.spryker.local -ENV_MERCHANT_PORTAL_URL=http://mp.de.spryker.local -ENV_GLUE_BACKEND_URL=http://glue-backend.de.spryker.local -ENV_MAIL_CATCHER_URL=http://mail.spryker.local +ENV_PROTOCOL=http +ENV_BACKOFFICE_HOST=backoffice.de.spryker.local +ENV_MERCHANT_PORTAL_HOST=mp.de.spryker.local +ENV_GLUE_BACKEND_HOST=glue-backend.de.spryker.local +ENV_MAIL_CATCHER_HOST=mail.spryker.local -E2E_BASE_URL=http://yves.de.spryker.local +E2E_BASE_HOST=yves.de.spryker.local VIEWPORT_WIDGTH=1920 VIEWPORT_HEIGHT=1080 diff --git a/cypress.config.ts b/cypress.config.ts index a4fd87ce..299f62bd 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,30 +1,42 @@ -import { defineConfig } from 'cypress'; +import {defineConfig} from 'cypress'; import dotenv from 'dotenv'; import * as fs from 'fs'; + dotenv.config(); +function getEnvVar(primary: string, fallback: string): string { + return process.env[primary] || process.env[fallback]; +} + +const protocol = getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE') ? 'https' : 'http'; +const backofficeHost = getEnvVar('ENV_BACKOFFICE_HOST', 'SPRYKER_BE_HOST'); +const merchantPortalHost = getEnvVar('ENV_MERCHANT_PORTAL_HOST', 'SPRYKER_MP_HOST'); +const glueBackendHost = getEnvVar('ENV_GLUE_BACKEND_HOST', 'SPRYKER_GLUE_BACKEND_HOST'); +const mailCatcherHost = getEnvVar('ENV_MAIL_CATCHER_HOST', 'SPRYKER_SMTP_HOST'); +const baseHost = getEnvVar('E2E_BASE_HOST', 'SPRYKER_FE_HOST'); + export default defineConfig({ - env: { - repositoryId: process.env.ENV_REPOSITORY_ID, - backofficeUrl: process.env.ENV_BACKOFFICE_URL, - merchantPortalUrl: process.env.ENV_MERCHANT_PORTAL_URL, - glueBackendUrl: process.env.ENV_GLUE_BACKEND_URL, - mailCatcherUrl: process.env.ENV_MAIL_CATCHER_URL, - }, - e2e: { - baseUrl: process.env.E2E_BASE_URL, - setupNodeEvents(on) { - on('task', { - isFileExists(filename): boolean { - return fs.existsSync(filename); - }, - }); + env: { + repositoryId: process.env.ENV_REPOSITORY_ID, + backofficeUrl: `${protocol}://${backofficeHost}`, + merchantPortalUrl: `${protocol}://${merchantPortalHost}`, + glueBackendUrl: `${protocol}://${glueBackendHost}`, + mailCatcherUrl: `${protocol}://${mailCatcherHost}`, }, - retries: { - runMode: 2, - openMode: 0, + e2e: { + baseUrl: `${protocol}://${baseHost}`, + setupNodeEvents(on) { + on('task', { + isFileExists(filename: string): boolean { + return fs.existsSync(filename); + }, + }); + }, + retries: { + runMode: 2, + openMode: 0, + }, }, - }, - viewportWidth: parseInt(process.env.VIEWPORT_WIDGTH ?? '1000', 10), - viewportHeight: parseInt(process.env.VIEWPORT_HEIGHT ?? '660', 10), + viewportWidth: parseInt(process.env.VIEWPORT_WIDGTH ?? '1000', 10), + viewportHeight: parseInt(process.env.VIEWPORT_HEIGHT ?? '660', 10), }); diff --git a/docker-compose.cypress.yml b/docker-compose.cypress.yml index 6d14e0e3..81896b8b 100644 --- a/docker-compose.cypress.yml +++ b/docker-compose.cypress.yml @@ -8,9 +8,8 @@ services: - private env_file: - ${DEPLOYMENT_PATH}/env/cli/testing.env # depends on application setup - - ${DEPLOYMENT_PATH}/env/cli/de.env # depends on application setup - - ${DEPLOYMENT_PATH}/terraform/cli/de.env # depends on application setup - - ./.cypress/.env + - ${DEPLOYMENT_PATH}/env/cli/de.env + - ${DEPLOYMENT_PATH}/terraform/cli/de.env labels: 'spryker.app.name': cypress-tests 'spryker.app.type': cypress-tests diff --git a/set-env-vars.sh b/set-env-vars.sh deleted file mode 100755 index 66a49549..00000000 --- a/set-env-vars.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - # Linux - DISPLAY_IP=$(hostname -I | awk '{print $1}'):0 -elif [[ "$OSTYPE" == "darwin"* ]]; then - # Mac OSX - DISPLAY_IP=$(ipconfig getifaddr en0):0 -fi - -if [[ "$SPRYKER_SSL_ENABLE" == "true" ]]; then - SPRYKER_URL_PROTOCOL="https" -else - SPRYKER_URL_PROTOCOL="http" -fi - -ENV_BACKOFFICE_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_BE_HOST} -ENV_MERCHANT_PORTAL_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_MP_HOST} -ENV_MAIL_CATCHER_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_SMTP_HOST} -OPERATION_RUNNER_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_GLUE_BACKEND_HOST}/test-operation-runner -E2E_BASE_URL=${SPRYKER_URL_PROTOCOL}://${SPRYKER_FE_HOST} - -export DISPLAY_IP=$DISPLAY_IP -export SPRYKER_URL_PROTOCOL=$SPRYKER_URL_PROTOCOL -export ENV_BACKOFFICE_URL=$ENV_BACKOFFICE_URL -export ENV_MERCHANT_PORTAL_URL=$ENV_MERCHANT_PORTAL_URL -export ENV_MAIL_CATCHER_URL=$ENV_MAIL_CATCHER_URL -export OPERATION_RUNNER_URL=$OPERATION_RUNNER_URL -export E2E_BASE_URL=$E2E_BASE_URL - -exit 0 From 8dbf3a2bc6b75e03de65de2ff18259a00cc11af4 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Wed, 28 Feb 2024 15:39:24 +0100 Subject: [PATCH 18/53] CC-32482: Fixed the ssl detection. --- cypress.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.config.ts b/cypress.config.ts index 299f62bd..ae12e412 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -8,7 +8,7 @@ function getEnvVar(primary: string, fallback: string): string { return process.env[primary] || process.env[fallback]; } -const protocol = getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE') ? 'https' : 'http'; +const protocol = getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE') == '1' ? 'https' : 'http'; const backofficeHost = getEnvVar('ENV_BACKOFFICE_HOST', 'SPRYKER_BE_HOST'); const merchantPortalHost = getEnvVar('ENV_MERCHANT_PORTAL_HOST', 'SPRYKER_MP_HOST'); const glueBackendHost = getEnvVar('ENV_GLUE_BACKEND_HOST', 'SPRYKER_GLUE_BACKEND_HOST'); From fdfd27afda94b4c879d114806e5b6a8702cfd407 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Wed, 28 Feb 2024 16:10:14 +0100 Subject: [PATCH 19/53] CC-32482: Added the protocol map. --- cypress.config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cypress.config.ts b/cypress.config.ts index ae12e412..b56399ba 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -8,7 +8,13 @@ function getEnvVar(primary: string, fallback: string): string { return process.env[primary] || process.env[fallback]; } -const protocol = getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE') == '1' ? 'https' : 'http'; +const protocolMap = { + '1': 'https', + '0': 'http', + 'http': 'http', + 'https': 'https', +}; +const protocol = protocolMap[getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE')]; const backofficeHost = getEnvVar('ENV_BACKOFFICE_HOST', 'SPRYKER_BE_HOST'); const merchantPortalHost = getEnvVar('ENV_MERCHANT_PORTAL_HOST', 'SPRYKER_MP_HOST'); const glueBackendHost = getEnvVar('ENV_GLUE_BACKEND_HOST', 'SPRYKER_GLUE_BACKEND_HOST'); From daf19056463008ded9793b018060efd9116315a3 Mon Sep 17 00:00:00 2001 From: Denys Sokolov Date: Wed, 28 Feb 2024 16:18:29 +0100 Subject: [PATCH 20/53] CC-32482: Added the type to the protocol map. --- cypress.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.config.ts b/cypress.config.ts index b56399ba..72c77303 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -8,7 +8,7 @@ function getEnvVar(primary: string, fallback: string): string { return process.env[primary] || process.env[fallback]; } -const protocolMap = { +const protocolMap: { [key: string]: 'http' | 'https' } = { '1': 'https', '0': 'http', 'http': 'http', From 92b84d9a7f12d449be3dc20ac476245dbc671eee Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Wed, 28 Feb 2024 23:46:50 +0300 Subject: [PATCH 21/53] Rework backoffice pages [skip ci] --- cypress.config.ts | 54 ++-- .../agent-permission-in-backoffice.cy.ts | 10 +- .../customer-agent-login-page.cy.ts | 2 +- .../merchant-user-agent-dashboard.cy.ts | 4 +- .../merchant-user-agent-login-page.cy.ts | 2 +- .../merchant-user-header-bar.cy.ts | 8 +- .../merchant-user-impersonation.cy.ts | 163 ++++++----- .../checkout/checkout-by-guest-customer.cy.ts | 14 +- .../checkout-by-logged-in-customer.cy.ts | 16 +- .../comments/cart/empty-cart-comment.cy.ts | 6 +- .../cart/not-empty-cart-comment.cy.ts | 6 +- .../order/create-order-by-customer.cy.ts | 17 +- .../order/create-order-by-guest.cy.ts | 12 +- .../dynamic/customer-agent-login-page.json | 12 +- .../merchant-user-agent-dashboard.json | 12 +- .../merchant-user-agent-login-page.json | 12 +- .../dynamic/merchant-user-header-bar.json | 12 +- .../dynamic/merchant-user-impersonation.json | 271 +++++++++++++++++- .../static/merchant-user-impersonation.json | 13 +- .../checkout-by-logged-in-customer.json | 4 +- .../dynamic/create-order-by-customer.json | 4 +- cypress/support/commands.js | 2 +- cypress/support/e2e.js | 34 ++- cypress/support/helpers/cli-helper.ts | 36 ++- .../pages/backoffice/backoffice-page.ts | 2 +- .../create/merchant-user-create-page.ts | 4 +- .../create/sales-return-gui-create-page.ts | 4 +- .../sales/detail/sales-detail-page.ts | 3 +- cypress/support/pages/mp/mp-page.ts | 2 +- .../pages/mp/products/products-page.ts | 9 +- cypress/support/pages/yves/cart/cart-page.ts | 4 +- .../pages/yves/cart/cart-repository.ts | 1 + .../cart/repositories/b2b-cart-repository.ts | 3 +- .../repositories/suite-cart-repository.ts | 3 +- .../checkout/address/checkout-address-page.ts | 2 +- .../customer/checkout-customer-page.ts | 7 +- .../yves/comment/cart/comment-cart-page.ts | 4 +- .../b2b-comment-cart-repository.ts | 6 +- .../suite-comment-cart-repository.ts | 6 +- cypress/support/pages/yves/yves-page.ts | 2 +- cypress/support/scenarios/backoffice/index.ts | 1 - cypress/support/scenarios/mp/index.ts | 1 - cypress/support/scenarios/yves/index.ts | 2 +- .../scenarios/yves/place-mp-order-scenario.ts | 40 +++ .../dynamic-fixture-types.ts | 2 - .../dynamic-fixture-types.ts | 28 ++ .../mp/merchant-user-impersonation/index.ts | 2 + .../static-fixture-types.ts | 3 + .../yves/checkout/dynamic-fixture-types.ts | 2 +- .../comments/cart/dynamic-fixture-types.ts | 4 +- .../order/dynamic-fixture-types.ts | 2 +- docker-compose.cypress.yml | 18 +- readme.md | 6 +- 53 files changed, 626 insertions(+), 273 deletions(-) create mode 100644 cypress/support/scenarios/yves/place-mp-order-scenario.ts create mode 100644 cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts create mode 100644 cypress/support/types/mp/merchant-user-impersonation/index.ts create mode 100644 cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts diff --git a/cypress.config.ts b/cypress.config.ts index 72c77303..6a50c77a 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,18 +1,18 @@ -import {defineConfig} from 'cypress'; +import { defineConfig } from 'cypress'; import dotenv from 'dotenv'; import * as fs from 'fs'; dotenv.config(); function getEnvVar(primary: string, fallback: string): string { - return process.env[primary] || process.env[fallback]; + return process.env[primary] || process.env[fallback]; } const protocolMap: { [key: string]: 'http' | 'https' } = { - '1': 'https', - '0': 'http', - 'http': 'http', - 'https': 'https', + '1': 'https', + '0': 'http', + http: 'http', + https: 'https', }; const protocol = protocolMap[getEnvVar('ENV_PROTOCOL', 'SPRYKER_SSL_ENABLE')]; const backofficeHost = getEnvVar('ENV_BACKOFFICE_HOST', 'SPRYKER_BE_HOST'); @@ -22,27 +22,27 @@ const mailCatcherHost = getEnvVar('ENV_MAIL_CATCHER_HOST', 'SPRYKER_SMTP_HOST'); const baseHost = getEnvVar('E2E_BASE_HOST', 'SPRYKER_FE_HOST'); export default defineConfig({ - env: { - repositoryId: process.env.ENV_REPOSITORY_ID, - backofficeUrl: `${protocol}://${backofficeHost}`, - merchantPortalUrl: `${protocol}://${merchantPortalHost}`, - glueBackendUrl: `${protocol}://${glueBackendHost}`, - mailCatcherUrl: `${protocol}://${mailCatcherHost}`, - }, - e2e: { - baseUrl: `${protocol}://${baseHost}`, - setupNodeEvents(on) { - on('task', { - isFileExists(filename: string): boolean { - return fs.existsSync(filename); - }, - }); - }, - retries: { - runMode: 2, - openMode: 0, + env: { + repositoryId: process.env.ENV_REPOSITORY_ID, + backofficeUrl: `${protocol}://${backofficeHost}`, + merchantPortalUrl: `${protocol}://${merchantPortalHost}`, + glueBackendUrl: `${protocol}://${glueBackendHost}`, + mailCatcherUrl: `${protocol}://${mailCatcherHost}`, + }, + e2e: { + baseUrl: `${protocol}://${baseHost}`, + setupNodeEvents(on) { + on('task', { + isFileExists(filename: string): boolean { + return fs.existsSync(filename); }, + }); + }, + retries: { + runMode: 2, + openMode: 0, }, - viewportWidth: parseInt(process.env.VIEWPORT_WIDGTH ?? '1000', 10), - viewportHeight: parseInt(process.env.VIEWPORT_HEIGHT ?? '660', 10), + }, + viewportWidth: parseInt(process.env.VIEWPORT_WIDGTH ?? '1000', 10), + viewportHeight: parseInt(process.env.VIEWPORT_HEIGHT ?? '660', 10), }); diff --git a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts index 088ace1e..e1b23d58 100644 --- a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts +++ b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts @@ -9,7 +9,7 @@ import { /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('agent permission in backoffice', {tags: ['@marketplace-agent-assist']}, (): void => { +describe('agent permission in backoffice', { tags: ['@marketplace-agent-assist'] }, (): void => { const userIndexPage: UserIndexPage = container.get(UserIndexPage); const userUpdatePage: UserUpdatePage = container.get(UserUpdatePage); const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); @@ -64,17 +64,13 @@ describe('agent permission in backoffice', {tags: ['@marketplace-agent-assist']} it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => { userIndexPage.visit(); - userIndexPage.findUser(dynamicFixtures.customerAgentUser.username) - .contains('Agent') - .should('have.length', 1); + userIndexPage.findUser(dynamicFixtures.customerAgentUser.username).contains('Agent').should('have.length', 1); }); it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { userIndexPage.visit(); - userIndexPage.findUser(dynamicFixtures.merchantAgentUser.username) - .contains('Agent') - .should('have.length', 1); + userIndexPage.findUser(dynamicFixtures.merchantAgentUser.username).contains('Agent').should('have.length', 1); }); it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => { diff --git a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts index cb82130b..a7c6f12c 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts @@ -10,7 +10,7 @@ import { /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('customer agent login page', {tags: ['@marketplace-agent-assist']}, (): void => { +describe('customer agent login page', { tags: ['@marketplace-agent-assist'] }, (): void => { const indexPage: IndexPage = container.get(IndexPage); const loginPage: LoginPage = container.get(LoginPage); const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts index 2c7cad02..75bdb88e 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts @@ -11,7 +11,7 @@ import { /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('merchant user agent dashboard', {tags: ['@marketplace-agent-assist']}, (): void => { +describe('merchant user agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void => { const dashboardPage: DashboardPage = container.get(DashboardPage); const agentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); const userIndexPage: UserIndexPage = container.get(UserIndexPage); @@ -56,8 +56,6 @@ describe('merchant user agent dashboard', {tags: ['@marketplace-agent-assist']}, agentDashboardPage.visit(); agentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name).should('exist'); agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.first_name).should('exist'); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.last_name).should('exist'); }); it('agent should be able to see/assist inactive merchant user in a table', (): void => { diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts index 55941bef..a66c6cca 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts @@ -8,7 +8,7 @@ import { /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('merchant user agent login page', {tags: ['@marketplace-agent-assist']}, (): void => { +describe('merchant user agent login page', { tags: ['@marketplace-agent-assist'] }, (): void => { const loginPage: LoginPage = container.get(LoginPage); const dashboardPage: DashboardPage = container.get(DashboardPage); const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts index f6b69f6d..269b1797 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts @@ -9,7 +9,7 @@ import { /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('merchant user header bar', {tags: ['@marketplace-agent-assist']}, (): void => { +describe('merchant user header bar', { tags: ['@marketplace-agent-assist'] }, (): void => { const loginPage: LoginPage = container.get(LoginPage); const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); const dashboardPage: DashboardPage = container.get(DashboardPage); @@ -27,7 +27,7 @@ describe('merchant user header bar', {tags: ['@marketplace-agent-assist']}, (): impersonateScenario.execute( dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword, - dynamicFixtures.merchantUser.username, + dynamicFixtures.merchantUser.username ); }); @@ -38,9 +38,7 @@ describe('merchant user header bar', {tags: ['@marketplace-agent-assist']}, (): cy.get('body').find(`div:contains("${dynamicFixtures.merchantUser.username}")`).should('exist'); cy.get('body') - .find( - `div:contains("${dynamicFixtures.merchantUser.first_name} ${dynamicFixtures.merchantUser.last_name}")` - ) + .find(`div:contains("${dynamicFixtures.merchantUser.first_name} ${dynamicFixtures.merchantUser.last_name}")`) .should('exist'); }); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts index ecca07f1..c1110d1a 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts @@ -1,76 +1,99 @@ +import { container } from '../../../support/utils/inversify/inversify.config'; +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 { + MerchantUserImpersonationDynamicFixtures, + MerchantUserImpersonationStaticFixtures, +} from '../../../support/types/mp/merchant-user-impersonation'; +import { CustomerLoginScenario, PlaceMpOrderScenario } from '../../../support/scenarios/yves'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ describe('merchant user impersonation', (): void => { - // const salesIndexPage: BackofficeSalesIndexPage = container.get(BackofficeSalesIndexPage); - // const salesDetailPage: BackofficeSalesDetailPage = container.get(BackofficeSalesDetailPage); - // const mpSalesOrdersPage: MpSalesOrdersPage = container.get(MpSalesOrdersPage); - // const mpProfilePage: MpProfilePage = container.get(MpProfilePage); - // const mpProductsPage: MpProductsPage = container.get(MpProductsPage); - // const mpOffersPage: MpOffersPage = container.get(MpOffersPage); - // - // const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario); - // const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); - // const placeGuestMpOrderScenario: PlaceGuestMpOrderScenario = container.get(PlaceGuestMpOrderScenario); - // - // let fixtures: MerchantUserImpersonationFixtures; - // - // before((): void => { - // fixtures = Cypress.env('fixtures'); - // }); - // - // it('agent should be able to change order status during impersonation', (): void => { - // cy.resetYvesCookies(); - // const guest: Guest = placeGuestMpOrderScenario.execute(fixtures.productConcreteSkus); - // - // cy.resetBackofficeCookies(); - // loginUserScenario.execute(fixtures.backofficeUser); - // - // salesIndexPage.viewLastPlacedOrder(); - // salesDetailPage.triggerOms('Pay'); - // salesDetailPage.triggerOms('skip picking', true); - // - // cy.resetMerchantPortalCookies(); - // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - // - // cy.visitMerchantPortal(mpSalesOrdersPage.PAGE_URL); - // mpSalesOrdersPage.cancelOrder(guest.email); - // - // // Ensure that order was canceled - // cy.visitMerchantPortal(mpSalesOrdersPage.PAGE_URL); - // mpSalesOrdersPage.findOrder(guest.email).contains('canceled'); - // }); - // - // it('agent should be able to modify merchant profile information during impersonation', (): void => { - // cy.resetMerchantPortalCookies(); - // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - // - // cy.visitMerchantPortal(mpProfilePage.PAGE_URL); - // mpProfilePage.updateMerchantPhoneNumber(); - // - // cy.get('body').contains('The Profile has been changed successfully.'); - // }); - // - // it('agent should be able to modify product information during impersonation', (): void => { - // cy.resetMerchantPortalCookies(); - // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - // - // cy.visitMerchantPortal(mpProductsPage.PAGE_URL); - // mpProductsPage.findProduct(fixtures.productAbstractSku).click(); - // mpProductsPage.getDrawer().find('button:contains("Save")').click(); - // - // cy.get('body').contains('The Product is saved.'); - // }); - // - // it('agent should be able to modify offer information during impersonation', (): void => { - // cy.resetMerchantPortalCookies(); - // impersonateScenario.execute(fixtures.merchantAgentUser, fixtures.merchantUsername); - // - // cy.visitMerchantPortal(mpOffersPage.PAGE_URL); - // mpOffersPage.findOffer(fixtures.offerReference).click(); - // mpOffersPage.getDrawer().find('button:contains("Save")').click(); - // - // cy.get('body').contains('The Offer is saved.'); - // }); + 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 placeMpOrderScenario: PlaceMpOrderScenario = container.get(PlaceMpOrderScenario); + + let dynamicFixtures: MerchantUserImpersonationDynamicFixtures; + let staticFixtures: MerchantUserImpersonationStaticFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('agent should be able to change order status during impersonation', (): void => { + customerLoginScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + placeMpOrderScenario.execute(dynamicFixtures.productConcreteForOffer.sku); + + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + salesIndexPage.viewLastPlacedOrder(); + salesDetailPage.triggerOms('Pay'); + salesDetailPage.triggerOms('skip picking', true); + + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + salesOrdersPage.visit(); + salesOrdersPage.cancelOrder(dynamicFixtures.customer.email); + + // Ensure that order was canceled + salesOrdersPage.visit(); + salesOrdersPage.findOrder(dynamicFixtures.customer.email).contains('canceled'); + }); + + it('agent should be able to modify merchant profile information during impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + profilePage.visit(); + profilePage.updateMerchantPhoneNumber(); + + cy.get('body').contains('The Profile has been changed successfully.'); + }); + + it('agent should be able to modify product information during impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + productsPage.visit(); + productsPage.findProduct(dynamicFixtures.productConcreteForMerchant.abstract_sku).click(); + productsPage.getDrawer().find('button:contains("Save")').click(); + + cy.get('body').contains('The Product is saved.'); + }); + + it('agent should be able to modify offer information during impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + offersPage.visit(); + offersPage.findOffer(dynamicFixtures.productOffer.product_offer_reference).click(); + offersPage.getDrawer().find('button:contains("Save")').click(); + + cy.get('body').contains('The Offer is saved.'); + }); }); diff --git a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts index d2b997c6..edb9a52c 100644 --- a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts @@ -1,13 +1,15 @@ import { container } from '../../../support/utils/inversify/inversify.config'; -import {CheckoutByGuestCustomerDynamicFixtures} from "../../../support/types/yves/checkout"; +import { CheckoutByGuestCustomerDynamicFixtures } from '../../../support/types/yves/checkout'; import { CartPage, CheckoutAddressPage, - CheckoutCustomerPage, CheckoutPaymentPage, - CheckoutShipmentPage, CheckoutSummaryPage -} from "../../../support/pages/yves"; + CheckoutCustomerPage, + CheckoutPaymentPage, + CheckoutShipmentPage, + CheckoutSummaryPage, +} from '../../../support/pages/yves'; -describe('checkout by guest customer', {tags: ['@checkout']}, (): void => { +describe('checkout by guest customer', { tags: ['@checkout'] }, (): void => { const cartPage: CartPage = container.get(CartPage); const checkoutCustomerPage: CheckoutCustomerPage = container.get(CheckoutCustomerPage); const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); @@ -77,5 +79,5 @@ describe('checkout by guest customer', {tags: ['@checkout']}, (): void => { checkoutShipmentPage.setStandardShippingMethod(); checkoutPaymentPage.setDummyPaymentMethod(); checkoutSummaryPage.placeOrder(); - } + }; }); diff --git a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts index 0bf64e58..0e2fc9a8 100644 --- a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts @@ -1,18 +1,18 @@ -import {container} from '../../../support/utils/inversify/inversify.config'; +import { container } from '../../../support/utils/inversify/inversify.config'; import { CheckoutByLoggedInCustomerDynamicFixtures, - CheckoutByLoggedInCustomerStaticFixtures -} from "../../../support/types/yves/checkout"; + CheckoutByLoggedInCustomerStaticFixtures, +} from '../../../support/types/yves/checkout'; import { CartPage, CheckoutAddressPage, CheckoutPaymentPage, CheckoutShipmentPage, - CheckoutSummaryPage -} from "../../../support/pages/yves"; -import {CustomerLoginScenario} from "../../../support/scenarios/yves"; + CheckoutSummaryPage, +} from '../../../support/pages/yves'; +import { CustomerLoginScenario } from '../../../support/scenarios/yves'; -describe('checkout by logged in customer', {tags: ['@checkout']}, (): void => { +describe('checkout by logged in customer', { tags: ['@checkout'] }, (): void => { const cartPage: CartPage = container.get(CartPage); const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); @@ -84,5 +84,5 @@ describe('checkout by logged in customer', {tags: ['@checkout']}, (): void => { checkoutShipmentPage.setStandardShippingMethod(); checkoutPaymentPage.setDummyPaymentMethod(); checkoutSummaryPage.placeOrder(); - } + }; }); diff --git a/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts index 704eccad..a27f55bb 100644 --- a/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts @@ -1,9 +1,9 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {CommentCartPage} from "../../../../support/pages/yves"; -import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; +import { CommentCartPage } from '../../../../support/pages/yves'; +import { CustomerLoginScenario } from '../../../../support/scenarios/yves'; import { CartCommentDynamicFixtures, CartCommentStaticFixtures } from '../../../../support/types/yves/comments/cart'; -describe('empty cart comment',{tags: ['@comments']} , (): void => { +describe('empty cart comment', { tags: ['@comments'] }, (): void => { const commentCartPage: CommentCartPage = container.get(CommentCartPage); const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); diff --git a/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts index 58b90497..dd337d6a 100644 --- a/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts +++ b/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts @@ -1,9 +1,9 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {CommentCartPage} from "../../../../support/pages/yves"; -import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; +import { CommentCartPage } from '../../../../support/pages/yves'; +import { CustomerLoginScenario } from '../../../../support/scenarios/yves'; import { CartCommentDynamicFixtures, CartCommentStaticFixtures } from '../../../../support/types/yves/comments/cart'; -describe('not empty cart comment',{tags: ['@comments']}, (): void => { +describe('not empty cart comment', { tags: ['@comments'] }, (): void => { const commentCartPage: CommentCartPage = container.get(CommentCartPage); const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts index 738fc5eb..4db25e54 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts @@ -1,11 +1,18 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {CreateOrderByCustomerDynamicFixtures, CreateOrderByCustomerStaticFixtures} from "../../../../support/types/yves/order-managment/order"; -import {CustomerLoginScenario} from "../../../../support/scenarios/yves"; import { - CartPage, CheckoutAddressPage, CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, -} from "../../../../support/pages/yves"; + CreateOrderByCustomerDynamicFixtures, + CreateOrderByCustomerStaticFixtures, +} from '../../../../support/types/yves/order-managment/order'; +import { CustomerLoginScenario } from '../../../../support/scenarios/yves'; +import { + CartPage, + CheckoutAddressPage, + CheckoutPaymentPage, + CheckoutShipmentPage, + CheckoutSummaryPage, +} from '../../../../support/pages/yves'; -describe('create order by customer',{tags: ['@order-management']}, (): void => { +describe('create order by customer', { tags: ['@order-management'] }, (): void => { const cartPage: CartPage = container.get(CartPage); const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts index c2ed4e6a..fd2d5a97 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts @@ -1,13 +1,15 @@ import { container } from '../../../../support/utils/inversify/inversify.config'; -import {CreateOrderByGuestDynamicFixtures} from "../../../../support/types/yves/order-managment/order"; +import { CreateOrderByGuestDynamicFixtures } from '../../../../support/types/yves/order-managment/order'; import { CartPage, - CheckoutAddressPage, CheckoutCustomerPage, + CheckoutAddressPage, + CheckoutCustomerPage, CheckoutPaymentPage, - CheckoutShipmentPage, CheckoutSummaryPage -} from "../../../../support/pages/yves"; + CheckoutShipmentPage, + CheckoutSummaryPage, +} from '../../../../support/pages/yves'; -describe('create order by guest',{tags: ['@order-management']}, (): void => { +describe('create order by guest', { tags: ['@order-management'] }, (): void => { const cartPage: CartPage = container.get(CartPage); const checkoutCustomerPage: CheckoutCustomerPage = container.get(CheckoutCustomerPage); const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json index b23d4880..7d3d68f4 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json @@ -69,11 +69,13 @@ "type": "helper", "name": "haveMerchant", "key": "merchant", - "arguments": [{ - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - }] + "arguments": [ + { + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + } + ] }, { "type": "helper", diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json index 30b57792..0522e27c 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json @@ -53,11 +53,13 @@ "type": "helper", "name": "haveMerchant", "key": "merchant", - "arguments": [{ - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - }] + "arguments": [ + { + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + } + ] }, { "type": "helper", diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json index 93dffbb9..5852af05 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json @@ -54,11 +54,13 @@ "type": "helper", "name": "haveMerchant", "key": "merchant", - "arguments": [{ - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - }] + "arguments": [ + { + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + } + ] }, { "type": "helper", diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json index eb363ce6..63bbce9c 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json @@ -38,11 +38,13 @@ "type": "helper", "name": "haveMerchant", "key": "merchant", - "arguments": [{ - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - }] + "arguments": [ + { + "merchant_profile": "#merchantProfile", + "is_active": true, + "status": "approved" + } + ] }, { "type": "helper", diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json index f1e73aa9..1597d118 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json @@ -1,14 +1,261 @@ { - "backofficeUser": { - "username": "admin@spryker.com", - "password": "change123" - }, - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "merchantUsername": "harald@spryker.com", - "productConcreteSkus": ["005_30663301"], - "productAbstractSku": "090", - "offerReference": "offer423" + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [ + { + "password": "change123", + "isMerchantAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "arrayObject", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#localeEN", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [ + { + "merchantProfile": "#merchantProfile", + "isActive": true, + "status": "approved", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productConcreteForOffer", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productConcreteForMerchant", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productConcreteForOffer.abstract_sku", + "skuProduct": "#productConcreteForOffer.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productConcreteForMerchant.abstract_sku", + "skuProduct": "#productConcreteForMerchant.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#productConcreteForOffer.id_product_concrete", + "concreteSku": "#productConcreteForOffer.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "key": "merchantProduct", + "arguments": [ + { + "idProductAbstract": "#productConcreteForMerchant.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + } + ] + } + } } diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json index f1e73aa9..ba4339e8 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json @@ -1,14 +1,3 @@ { - "backofficeUser": { - "username": "admin@spryker.com", - "password": "change123" - }, - "merchantAgentUser": { - "username": "agent-merchant@spryker.com", - "password": "change123" - }, - "merchantUsername": "harald@spryker.com", - "productConcreteSkus": ["005_30663301"], - "productAbstractSku": "090", - "offerReference": "offer423" + "defaultPassword": "change123" } diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json index 3e69a708..8f7fbc0e 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json @@ -36,9 +36,7 @@ "type": "helper", "name": "confirmCustomer", "key": "confirmedCustomer", - "arguments": [ - "#customer" - ] + "arguments": ["#customer"] }, { "type": "helper", diff --git a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json index bc1c02e8..f99901c8 100644 --- a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json +++ b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json @@ -36,9 +36,7 @@ "type": "helper", "name": "confirmCustomer", "key": "confirmedCustomer", - "arguments": [ - "#customer" - ] + "arguments": ["#customer"] }, { "type": "helper", diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 0713beb4..60c107ed 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -43,7 +43,7 @@ Cypress.Commands.add('loadDynamicFixturesByPayload', (dynamicFixturesFilePath) = 'Content-Type': 'application/vnd.api+json', }, body: operationRequestPayload, - timeout: 20000, + timeout: 40000, }) .then((response) => { if (Array.isArray(response.body.data)) { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 36382758..4cc4839f 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -28,23 +28,27 @@ const loadFixture = () => { 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) => { - if (isFileExists) { - cy.fixture(staticFixturesDefaultFilePath).then((staticFixtures) => { - if (staticFixtures) { - Cypress.env('staticFixtures', staticFixtures); - } - }); + cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${staticFixturesDefaultFilePath}.json`).then( + (isFileExists) => { + if (isFileExists) { + cy.fixture(staticFixturesDefaultFilePath).then((staticFixtures) => { + if (staticFixtures) { + Cypress.env('staticFixtures', staticFixtures); + } + }); + } } - }); + ); - cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${dynamicFixturesDefaultFilePath}.json`).then((isFileExists) => { - if (isFileExists) { - cy.loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath).then((dynamicFixturesData) => { - Cypress.env('dynamicFixtures', dynamicFixturesData); - }); + cy.task('isFileExists', `${Cypress.config('fixturesFolder')}/${dynamicFixturesDefaultFilePath}.json`).then( + (isFileExists) => { + if (isFileExists) { + cy.loadDynamicFixturesByPayload(dynamicFixturesDefaultFilePath).then((dynamicFixturesData) => { + Cypress.env('dynamicFixtures', dynamicFixturesData); + }); + } } - }); + ); }; const getFixtureFilePath = () => { @@ -59,6 +63,6 @@ const getFixtureFilePath = () => { return { directoryPart: directoryPart, - filePart: filePartWithoutExtension + filePart: filePartWithoutExtension, }; }; diff --git a/cypress/support/helpers/cli-helper.ts b/cypress/support/helpers/cli-helper.ts index 1f62c4b2..8e4f6a76 100644 --- a/cypress/support/helpers/cli-helper.ts +++ b/cypress/support/helpers/cli-helper.ts @@ -4,21 +4,29 @@ import { autoWired } from '../utils/inversify/auto-wired'; @injectable() @autoWired export class CliHelper { - private readonly store: string; - private readonly containerPath: string; - private readonly containerName: string; - - constructor() { - this.store = Cypress.env().cli.store; - this.containerPath = Cypress.env().cli.containerPath; - this.containerName = Cypress.env().cli.containerName; - } + public run = (commands: string[]): void => { + const operations = commands.map((command) => { + return { + type: 'cli-command', + name: command, + }; + }); - public run = (command: string): void => { - cy.exec(`docker ps -a -q -f name=${this.containerName}`).then((result) => { - if (result.stdout) { - cy.exec(`cd ${this.containerPath} && APPLICATION_STORE=${this.store} docker/sdk ${command}`); - } + cy.request({ + method: 'POST', + url: Cypress.env().glueBackendUrl + '/test-operation-runner', + headers: { + 'Content-Type': 'application/vnd.api+json', + }, + body: { + data: { + type: 'test-operation-runner', + attributes: { + operations: operations, + }, + }, + timeout: 20000, + }, }); }; } diff --git a/cypress/support/pages/backoffice/backoffice-page.ts b/cypress/support/pages/backoffice/backoffice-page.ts index 039d691d..bff88c36 100644 --- a/cypress/support/pages/backoffice/backoffice-page.ts +++ b/cypress/support/pages/backoffice/backoffice-page.ts @@ -7,5 +7,5 @@ import VisitOptions = Cypress.VisitOptions; export class BackofficePage extends AbstractPage { public visit = (options?: Partial): void => { cy.visitBackoffice(this.PAGE_URL, options); - } + }; } 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 e03786d5..7ba8e726 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,9 +9,7 @@ import { BackofficePage } from '../../backoffice-page'; export class MerchantUserCreatePage extends BackofficePage { protected PAGE_URL: string = '/merchant-user-gui/edit-merchant-user'; - constructor( - @inject(MerchantUserCreateRepository) private repository: MerchantUserCreateRepository - ) { + constructor(@inject(MerchantUserCreateRepository) private repository: MerchantUserCreateRepository) { super(); } 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 394f617a..66fc1aec 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,9 +9,7 @@ import { BackofficePage } from '../../backoffice-page'; export class SalesReturnGuiCreatePage extends BackofficePage { protected PAGE_URL: string = '/sales-return-gui/create'; - constructor( - @inject(SalesReturnGuiCreateRepository) private repository: SalesReturnGuiCreateRepository - ) { + constructor(@inject(SalesReturnGuiCreateRepository) private repository: SalesReturnGuiCreateRepository) { super(); } 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 78a6fd84..33557335 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -19,8 +19,7 @@ export class SalesDetailPage extends BackofficePage { public triggerOms = (state: string, shouldTriggerOmsInCli: boolean = false): void => { if (shouldTriggerOmsInCli) { - this.cliHelper.run('console oms:check-condition'); - this.cliHelper.run('console oms:check-timeout'); + this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); } cy.url().then((url) => { diff --git a/cypress/support/pages/mp/mp-page.ts b/cypress/support/pages/mp/mp-page.ts index 2fd783e2..5a9d1440 100644 --- a/cypress/support/pages/mp/mp-page.ts +++ b/cypress/support/pages/mp/mp-page.ts @@ -7,5 +7,5 @@ import VisitOptions = Cypress.VisitOptions; export class MpPage extends AbstractPage { public visit = (options?: Partial): void => { cy.visitMerchantPortal(this.PAGE_URL, options); - } + }; } diff --git a/cypress/support/pages/mp/products/products-page.ts b/cypress/support/pages/mp/products/products-page.ts index c6294048..247e2c03 100644 --- a/cypress/support/pages/mp/products/products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -24,6 +24,13 @@ export class ProductsPage extends MpPage { }; public getDrawer = (): Cypress.Chainable => { - return this.repository.getDrawer(); + const drawer = this.repository.getDrawer(); + + // Wait for the drawer to be visible + const interceptAlias = this.faker.string.uuid(); + cy.intercept('GET', '/product-merchant-portal-gui/products-concrete/table-data**').as(interceptAlias); + cy.wait(`@${interceptAlias}`).its('response.body.total').should('eq', 1); + + return drawer; }; } diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index e18c1cc0..1f477e3e 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -15,7 +15,9 @@ export class CartPage extends YvesPage { } public quickAddToCart = (sku: string, quantity?: number): void => { - this.repository.getQuickAddToCartSkuField().then((elem) => elem.val(sku)); + this.repository.getQuickAddToCartSkuField().clear().type(sku); + this.repository.getQuickAddToCartProductListField().click(); + this.repository .getQuickAddToCartQuantityField() .clear() diff --git a/cypress/support/pages/yves/cart/cart-repository.ts b/cypress/support/pages/yves/cart/cart-repository.ts index fc7e8f18..7c52bb24 100644 --- a/cypress/support/pages/yves/cart/cart-repository.ts +++ b/cypress/support/pages/yves/cart/cart-repository.ts @@ -1,5 +1,6 @@ export interface CartRepository { getQuickAddToCartSkuField(): Cypress.Chainable; + getQuickAddToCartProductListField(): Cypress.Chainable; getQuickAddToCartQuantityField(): Cypress.Chainable; getQuickAddToCartSubmitButton(): Cypress.Chainable; findCartItemRemovalForm(sku: string): Cypress.Chainable; 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 1fd8e27c..8001b668 100644 --- a/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts @@ -4,7 +4,8 @@ import { CartRepository } from '../cart-repository'; @injectable() export class B2bCartRepository implements CartRepository { - getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[name="sku"]'); + getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component autocomplete-form"] .input'); + getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); getQuickAddToCartQuantityField = (): Cypress.Chainable> => cy.get('#quantity'); getQuickAddToCartSubmitButton = (): Cypress.Chainable> => cy.get('.product-quick-add-form__button'); 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 be72de97..aa9aec45 100644 --- a/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts @@ -4,7 +4,8 @@ import { CartRepository } from '../cart-repository'; @injectable() export class SuiteCartRepository implements CartRepository { - getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[name="sku"]'); + getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component autocomplete-form"] .input'); + getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); getQuickAddToCartQuantityField = (): Cypress.Chainable> => cy.get('#quantity'); getQuickAddToCartSubmitButton = (): Cypress.Chainable> => cy.get('.js-product-quick-add-form__submit-button'); 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 a644e180..c142e9d8 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -3,7 +3,7 @@ import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; import { CheckoutAddressRepository } from './checkout-address-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; -import {CheckoutAddress} from "../../../../types/yves/checkout"; +import { CheckoutAddress } from '../../../../types/yves/checkout'; import { YvesPage } from '../../yves-page'; @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 919dd569..68ba0e14 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -3,7 +3,6 @@ import 'reflect-metadata'; import { TYPES } from '../../../../utils/inversify/types'; import { CheckoutCustomerRepository } from './checkout-customer-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; -import {Guest} from "../../../../types/refactor_this_file_and_drop_it"; import { YvesPage } from '../../yves-page'; @injectable() @@ -15,8 +14,8 @@ export class CheckoutCustomerPage extends YvesPage { super(); } - public checkoutAsGuest = (): Guest => { - const guest: Guest = { + public checkoutAsGuest = (): string => { + const guest = { firstName: this.faker.person.firstName(), lastName: this.faker.person.lastName(), email: this.faker.internet.email(), @@ -31,6 +30,6 @@ export class CheckoutCustomerPage extends YvesPage { this.repository.getGuestSubmitButton().click(); - return guest; + return guest.email; }; } 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 73473d08..f39e9dd0 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -25,14 +25,14 @@ export class CommentCartPage extends YvesPage { this.getCommentThreadListSection().first().find(this.repository.getUpdateCommentButtonSelector()).click(); }; - + public 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 => { this.repository .getCommentTextareaByCommentText(commentMessage) 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 91e72bf8..1bb4e80f 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 @@ -15,7 +15,7 @@ export class B2bCommentCartRepository implements CommentCartRepository { }; getUpdateCommentButtonSelector = (): string => 'button:contains("Update")'; - getCommentTextareaByCommentText(commentText: string): Cypress.Chainable { - return this.getCommentThreadListSection().first().contains(commentText); - } + getCommentTextareaByCommentText(commentText: string): Cypress.Chainable { + return this.getCommentThreadListSection().first().contains(commentText); + } } 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 f780f7d6..4a38b336 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 @@ -10,7 +10,7 @@ export class SuiteCommentCartRepository implements CommentCartRepository { getRemoveCommentButtonSelector = (): string => 'button:contains("Remove")'; getFirstCommentTextarea = (): Cypress.Chainable => this.getCommentThreadListSection().first().find('textarea'); getUpdateCommentButtonSelector = (): string => 'button:contains("Update")'; - getCommentTextareaByCommentText(commentText: string): Cypress.Chainable { - return this.getCommentThreadListSection().first().contains(commentText); - } + getCommentTextareaByCommentText(commentText: string): Cypress.Chainable { + return this.getCommentThreadListSection().first().contains(commentText); + } } diff --git a/cypress/support/pages/yves/yves-page.ts b/cypress/support/pages/yves/yves-page.ts index 48d78d1f..52e00d1b 100644 --- a/cypress/support/pages/yves/yves-page.ts +++ b/cypress/support/pages/yves/yves-page.ts @@ -7,5 +7,5 @@ import VisitOptions = Cypress.VisitOptions; export class YvesPage extends AbstractPage { public visit = (options?: Partial): void => { cy.visit(this.PAGE_URL, options); - } + }; } diff --git a/cypress/support/scenarios/backoffice/index.ts b/cypress/support/scenarios/backoffice/index.ts index dc41454b..e2abd80f 100644 --- a/cypress/support/scenarios/backoffice/index.ts +++ b/cypress/support/scenarios/backoffice/index.ts @@ -1,2 +1 @@ export * from './user-login-scenario'; - diff --git a/cypress/support/scenarios/mp/index.ts b/cypress/support/scenarios/mp/index.ts index 92121bbf..800c368a 100644 --- a/cypress/support/scenarios/mp/index.ts +++ b/cypress/support/scenarios/mp/index.ts @@ -1,4 +1,3 @@ export * from './impersonate-as-merchant-user-scenario'; export * from './merchant-agent-login-user-scenario'; export * from './merchant-user-login-scenario'; - diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index 58a7d744..746076a4 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -1,3 +1,3 @@ export * from './customer-login-scenario'; export * from './agent-login-scenario'; - +export * from './place-mp-order-scenario'; diff --git a/cypress/support/scenarios/yves/place-mp-order-scenario.ts b/cypress/support/scenarios/yves/place-mp-order-scenario.ts new file mode 100644 index 00000000..251bf9f2 --- /dev/null +++ b/cypress/support/scenarios/yves/place-mp-order-scenario.ts @@ -0,0 +1,40 @@ +import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; +import { autoWired } from '../../utils/inversify/auto-wired'; +import { CliHelper } from '../../helpers/cli-helper'; +import { + CartPage, + CheckoutAddressPage, + CheckoutCustomerPage, + CheckoutPaymentPage, + CheckoutShipmentPage, + CheckoutSummaryPage, +} from '../../pages/yves'; + +@injectable() +@autoWired +export class PlaceMpOrderScenario { + constructor( + @inject(CartPage) private cartPage: CartPage, + @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage, + @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage, + @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage, + @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage, + @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage, + @inject(CliHelper) private cliHelper: CliHelper + ) {} + + public execute = (productSku: string): void => { + this.cartPage.visit(); + this.cartPage.quickAddToCart(productSku); + + this.cartPage.startCheckout(); + + this.checkoutAddressPage.fillShippingAddress(); + this.checkoutShipmentPage.setStandardShippingMethod(); + this.checkoutPaymentPage.setDummyMarketplacePaymentMethod(); + this.checkoutSummaryPage.placeOrder(); + + this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); + }; +} diff --git a/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts index 4419e028..580fe8d8 100644 --- a/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts +++ b/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts @@ -7,8 +7,6 @@ export interface MerchantUserAgentDashboardDynamicFixtures { interface User { username: string; - first_name: string; - last_name: string; } interface Merchant { diff --git a/cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts new file mode 100644 index 00000000..322272b9 --- /dev/null +++ b/cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts @@ -0,0 +1,28 @@ +export interface MerchantUserImpersonationDynamicFixtures { + rootUser: User; + merchantAgentUser: User; + merchantUser: User; + customer: Customer; + productConcreteForOffer: ProductConcrete; + productConcreteForMerchant: ProductConcrete; + productOffer: ProductOffer; +} + +interface Customer { + email: string; +} + +interface User { + username: string; + first_name: string; + last_name: string; +} + +interface ProductConcrete { + sku: string; + abstract_sku: string; +} + +interface ProductOffer { + product_offer_reference: string; +} diff --git a/cypress/support/types/mp/merchant-user-impersonation/index.ts b/cypress/support/types/mp/merchant-user-impersonation/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/mp/merchant-user-impersonation/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts new file mode 100644 index 00000000..11f8ef57 --- /dev/null +++ b/cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts @@ -0,0 +1,3 @@ +export interface MerchantUserImpersonationStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/yves/checkout/dynamic-fixture-types.ts b/cypress/support/types/yves/checkout/dynamic-fixture-types.ts index bb8adb01..c3b13aef 100644 --- a/cypress/support/types/yves/checkout/dynamic-fixture-types.ts +++ b/cypress/support/types/yves/checkout/dynamic-fixture-types.ts @@ -1,4 +1,4 @@ -import {Product} from "./common/product"; +import { Product } from './common/product'; export interface CheckoutByLoggedInCustomerDynamicFixtures { customer: Customer; diff --git a/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts b/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts index 0ce13e0b..02bba9d1 100644 --- a/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts +++ b/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts @@ -1,5 +1,5 @@ -import {Quote} from "./common/quote"; -import {Product} from "./common/product"; +import { Quote } from './common/quote'; +import { Product } from './common/product'; export interface CartCommentDynamicFixtures { quote: Quote; diff --git a/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts b/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts index 8d1a0cfa..603e726d 100644 --- a/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts +++ b/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts @@ -1,4 +1,4 @@ -import {Product} from "./common/product"; +import { Product } from './common/product'; export interface CreateOrderByCustomerDynamicFixtures { customer: Customer; diff --git a/docker-compose.cypress.yml b/docker-compose.cypress.yml index 81896b8b..74cd6500 100644 --- a/docker-compose.cypress.yml +++ b/docker-compose.cypress.yml @@ -2,18 +2,18 @@ version: '3' services: cypress-tests: build: - context: ./vendor/spryker/cypress-tests - dockerfile: Dockerfile + context: ./vendor/spryker/cypress-tests + dockerfile: Dockerfile networks: - - private + - private env_file: - - ${DEPLOYMENT_PATH}/env/cli/testing.env # depends on application setup - - ${DEPLOYMENT_PATH}/env/cli/de.env - - ${DEPLOYMENT_PATH}/terraform/cli/de.env + - ${DEPLOYMENT_PATH}/env/cli/testing.env # depends on application setup + - ${DEPLOYMENT_PATH}/env/cli/de.env + - ${DEPLOYMENT_PATH}/terraform/cli/de.env labels: - 'spryker.app.name': cypress-tests - 'spryker.app.type': cypress-tests - 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} + 'spryker.app.name': cypress-tests + 'spryker.app.type': cypress-tests + 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} volumes: - ./vendor/spryker/cypress-tests/cypress/e2e:/opt/cypress-tests/cypress/e2e:rw - ./vendor/spryker/cypress-tests/cypress/fixtures:/opt/cypress-tests/cypress/fixtures:rw diff --git a/readme.md b/readme.md index e0c7eafe..dc114bd1 100644 --- a/readme.md +++ b/readme.md @@ -21,9 +21,9 @@ To get started with these tests, follow these setup steps: 2. **Environment Configuration:** - Set up your environment variables for Cypress. - - Copy the `.env.example` file to a new file named `.env`. - - Open the `.env` file and fill in the necessary environment variables. - - These variables are crucial for Cypress to connect with your Spryker application and perform tests effectively. + - Copy the `.env.example` file to a new file named `.env`. + - Open the `.env` file and fill in the necessary environment variables. + - These variables are crucial for Cypress to connect with your Spryker application and perform tests effectively. ## Running Tests From 824ad78079aea1506456654e739f6aae0f01e2e6 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Thu, 29 Feb 2024 20:52:43 +0300 Subject: [PATCH 22/53] Adjusted tests, returned return-scenario test. --- .../merchant-user-header-bar.cy.ts | 2 +- .../merchant-user-impersonation.cy.ts | 13 +- .../order/create-order-by-customer.cy.ts | 1 - .../return/create-return-by-user.cy.ts | 71 ++++++++ .../dynamic/merchant-user-impersonation.json | 33 ++++ .../dynamic/checkout-by-guest-customer.json | 33 ++++ .../checkout-by-logged-in-customer.json | 33 ++++ .../cart/dynamic/empty-cart-comment.json | 21 +++ .../cart/dynamic/not-empty-cart-comment.json | 108 ++++++++++++- .../dynamic/create-order-by-customer.json | 21 +++ .../order/dynamic/create-order-by-guest.json | 21 +++ .../return/dynamic/create-return-by-user.json | 151 ++++++++++++++++++ .../return/static/create-return-by-user.json | 3 + .../sales/detail/sales-detail-page.ts | 2 +- .../pages/yves/multi-cart/multi-cart-page.ts | 4 + .../yves/multi-cart/multi-cart-repository.ts | 1 + .../repositories/b2b-multi-cart-repository.ts | 1 + .../suite-multi-cart-repository.ts | 1 + ...er-scenario.ts => checkout-mp-scenario.ts} | 8 +- .../scenarios/yves/checkout-scenario.ts | 36 +++++ cypress/support/scenarios/yves/index.ts | 5 +- .../types/yves/comments/cart/common/quote.ts | 1 + .../order-managment/order/common/customer.ts | 3 + .../order-managment/return/common/product.ts | 3 + .../return/dynamic-fixture-types.ts | 21 +++ .../yves/order-managment/return/index.ts | 2 + .../return/static-fixture-types.ts | 3 + 27 files changed, 585 insertions(+), 17 deletions(-) create mode 100644 cypress/e2e/yves/order-management/return/create-return-by-user.cy.ts create mode 100644 cypress/fixtures/suite/yves/order-management/return/dynamic/create-return-by-user.json create mode 100644 cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json rename cypress/support/scenarios/yves/{place-mp-order-scenario.ts => checkout-mp-scenario.ts} (83%) create mode 100644 cypress/support/scenarios/yves/checkout-scenario.ts create mode 100644 cypress/support/types/yves/order-managment/order/common/customer.ts create mode 100644 cypress/support/types/yves/order-managment/return/common/product.ts create mode 100644 cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts create mode 100644 cypress/support/types/yves/order-managment/return/index.ts create mode 100644 cypress/support/types/yves/order-managment/return/static-fixture-types.ts diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts index 269b1797..dd3a9ea2 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts @@ -31,7 +31,7 @@ describe('merchant user header bar', { tags: ['@marketplace-agent-assist'] }, () ); }); - it.only('agent should be able to see merchant user information during impersonation', (): void => { + it('agent should be able to see merchant user information during impersonation', (): void => { dashboardPage.visit(); cy.get('body').find(`div:contains("${dynamicFixtures.merchant.name}")`).should('exist'); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts index c1110d1a..d6691cf7 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts @@ -7,12 +7,14 @@ import { MerchantUserImpersonationDynamicFixtures, MerchantUserImpersonationStaticFixtures, } from '../../../support/types/mp/merchant-user-impersonation'; -import { CustomerLoginScenario, PlaceMpOrderScenario } from '../../../support/scenarios/yves'; +import { CheckoutMpScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; +import { CartPage } from '../../../support/pages/yves'; /** * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} */ -describe('merchant user impersonation', (): void => { +describe('merchant user impersonation', { 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); @@ -23,7 +25,7 @@ describe('merchant user impersonation', (): void => { const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); const customerLoginScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - const placeMpOrderScenario: PlaceMpOrderScenario = container.get(PlaceMpOrderScenario); + const checkoutMpScenario: CheckoutMpScenario = container.get(CheckoutMpScenario); let dynamicFixtures: MerchantUserImpersonationDynamicFixtures; let staticFixtures: MerchantUserImpersonationStaticFixtures; @@ -34,7 +36,10 @@ describe('merchant user impersonation', (): void => { it('agent should be able to change order status during impersonation', (): void => { customerLoginScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - placeMpOrderScenario.execute(dynamicFixtures.productConcreteForOffer.sku); + + cartPage.visit(); + cartPage.quickAddToCart(dynamicFixtures.productConcreteForOffer.sku); + checkoutMpScenario.execute(); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts index 4db25e54..d6073a31 100644 --- a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts +++ b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts @@ -24,7 +24,6 @@ describe('create order by customer', { tags: ['@order-management'] }, (): void = let dynamicFixtures: CreateOrderByCustomerDynamicFixtures; before((): void => { - cy.resetYvesCookies(); ({ staticFixtures, dynamicFixtures } = Cypress.env()); }); diff --git a/cypress/e2e/yves/order-management/return/create-return-by-user.cy.ts b/cypress/e2e/yves/order-management/return/create-return-by-user.cy.ts new file mode 100644 index 00000000..4d4ac592 --- /dev/null +++ b/cypress/e2e/yves/order-management/return/create-return-by-user.cy.ts @@ -0,0 +1,71 @@ +import { container } from '../../../../support/utils/inversify/inversify.config'; +import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '../../../../support/pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '../../../../support/scenarios/yves'; +import { + CreateReturnByUserDynamicFixtures, + CreateReturnByUserStaticFixtures, +} from '../../../../support/types/yves/order-managment/return'; +import { UserLoginScenario } from '../../../../support/scenarios/backoffice'; +import { MultiCartPage } from '../../../../support/pages/yves'; + +describe('create return by user', { tags: ['@order-management'] }, (): void => { + const multiCartPage: MultiCartPage = container.get(MultiCartPage); + 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); + + let staticFixtures: CreateReturnByUserStaticFixtures; + let dynamicFixtures: CreateReturnByUserDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + }); + + it('should be able to create return from (from shipped order state)', (): void => { + multiCartPage.visit(); + multiCartPage.selectCart(dynamicFixtures.quoteOne.name); + checkoutScenario.execute(); + + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + salesIndexPage.visit(); + salesIndexPage.viewLastPlacedOrder(); + salesDetailPage.triggerOms('Pay'); + salesDetailPage.triggerOms('Skip timeout'); + salesDetailPage.triggerOms('skip picking'); + salesDetailPage.triggerOms('Ship'); + + salesDetailPage.createReturn(); + salesReturnGuiCreatePage.createReturnForAllOrderItems(); + + cy.contains('Return was successfully created.'); + }); + + it('should be able to create return from (from delivery order state)', (): void => { + multiCartPage.visit(); + multiCartPage.selectCart(dynamicFixtures.quoteTwo.name); + checkoutScenario.execute(); + + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + salesIndexPage.visit(); + salesIndexPage.viewLastPlacedOrder(); + salesDetailPage.triggerOms('Pay'); + salesDetailPage.triggerOms('Skip timeout'); + salesDetailPage.triggerOms('skip picking'); + salesDetailPage.triggerOms('Ship'); + salesDetailPage.triggerOms('Stock update'); + + salesDetailPage.createReturn(); + salesReturnGuiCreatePage.createReturnForAllOrderItems(); + + cy.contains('Return was successfully created.'); + }); +}); diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json index 1597d118..8c7ab6c6 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.json @@ -168,6 +168,27 @@ } ] }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productConcreteForOffer.id_product_concrete", + "idProductAbstract": "#productConcreteForOffer.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "haveFullProduct", @@ -189,6 +210,18 @@ } ] }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productConcreteForMerchant.id_product_concrete", + "idProductAbstract": "#productConcreteForMerchant.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "havePriceProduct", diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json index 70b0cf34..b966fb37 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json @@ -18,12 +18,45 @@ "key": "productOne", "arguments": [] }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productOne.id_product_concrete", + "idProductAbstract": "#productOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "haveFullProduct", "key": "productTwo", "arguments": [] }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productTwo.id_product_concrete", + "idProductAbstract": "#productTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "havePriceProduct", diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json index 8f7fbc0e..74116656 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json @@ -44,12 +44,45 @@ "key": "productOne", "arguments": [] }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productOne.id_product_concrete", + "idProductAbstract": "#productOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "haveFullProduct", "key": "productTwo", "arguments": [] }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productTwo.id_product_concrete", + "idProductAbstract": "#productTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "havePriceProduct", diff --git a/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json index 60103304..7c533a90 100644 --- a/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json +++ b/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json @@ -36,6 +36,27 @@ "key": "product", "arguments": [] }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "havePersistentQuote", diff --git a/cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json index 557eeb71..ffe8b706 100644 --- a/cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json +++ b/cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json @@ -30,12 +30,110 @@ "key": "confirmedCustomer", "arguments": ["#customer"] }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, { "type": "helper", "name": "haveFullProduct", - "key": "product", + "key": "productOne", "arguments": [] }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productTwo", + "arguments": [] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productOne.abstract_sku", + "skuProduct": "#productOne.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productTwo.abstract_sku", + "skuProduct": "#productTwo.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productTwo.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "builder", + "name": "ProductImageBuilder", + "key": "productImageOne" + }, + { + "type": "builder", + "name": "ProductImageBuilder", + "key": "productImageTwo" + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productOne.id_product_concrete", + "idProductAbstract": "#productOne.fk_product_abstract", + "productImages": ["#productImageOne"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productTwo.id_product_concrete", + "idProductAbstract": "#productTwo.fk_product_abstract", + "productImages": ["#productImageTwo"] + } + ] + }, { "type": "helper", "name": "havePersistentQuote", @@ -45,8 +143,14 @@ "customer": "#customer", "items": [ { - "sku": "#product.sku", + "sku": "#productOne.sku", + "abstractSku": "#productOne.abstract_sku", "quantity": 1 + }, + { + "sku": "#productTwo.sku", + "abstractSku": "#productTwo.abstract_sku", + "quantity": 2 } ] } diff --git a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json index f99901c8..15aa0ecb 100644 --- a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json +++ b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json @@ -44,6 +44,27 @@ "key": "product", "arguments": [] }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "havePriceProduct", diff --git a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json index b0858186..206c8187 100644 --- a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json +++ b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json @@ -18,6 +18,27 @@ "key": "product", "arguments": [] }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, { "type": "helper", "name": "havePriceProduct", diff --git a/cypress/fixtures/suite/yves/order-management/return/dynamic/create-return-by-user.json b/cypress/fixtures/suite/yves/order-management/return/dynamic/create-return-by-user.json new file mode 100644 index 00000000..5b8a0be4 --- /dev/null +++ b/cypress/fixtures/suite/yves/order-management/return/dynamic/create-return-by-user.json @@ -0,0 +1,151 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 50000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quoteOne", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "name": "#product.name", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quoteTwo", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "name": "#product.name", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json b/cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} 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 33557335..244a7b39 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -28,7 +28,7 @@ export class SalesDetailPage extends BackofficePage { this.repository.getOmsButtonSelector(state), this.repository.getTriggerOmsDivSelector(), 30, - 2000 + 500 ); cy.get(this.repository.getTriggerOmsDivSelector()).find(this.repository.getOmsButtonSelector(state)).click(); 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 a49c5d2a..182b682b 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -23,4 +23,8 @@ export class MultiCartPage extends YvesPage { cy.contains(`Cart '${cartName}' was created successfully`).should('exist'); }; + + public selectCart = (name: string): void => { + this.repository.getQuoteTable().contains(name).click(); + }; } diff --git a/cypress/support/pages/yves/multi-cart/multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/multi-cart-repository.ts index d135be08..a46ab027 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-repository.ts @@ -1,4 +1,5 @@ export interface MultiCartRepository { getCreateCartNameInput(): Cypress.Chainable; getCreateCartForm(): Cypress.Chainable; + getQuoteTable(): Cypress.Chainable; } 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 faee5049..0df3b252 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 @@ -6,4 +6,5 @@ import { MultiCartRepository } from '../multi-cart-repository'; export class B2bMultiCartRepository implements MultiCartRepository { getCreateCartNameInput = (): Cypress.Chainable => cy.get('#quoteForm_name'); getCreateCartForm = (): Cypress.Chainable => cy.get('form[name=quoteForm]'); + getQuoteTable = (): Cypress.Chainable => cy.get('[data-qa="component quote-table"]'); } 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 92b19ede..d471865e 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 @@ -6,4 +6,5 @@ import { MultiCartRepository } from '../multi-cart-repository'; export class SuiteMultiCartRepository implements MultiCartRepository { getCreateCartNameInput = (): Cypress.Chainable => cy.get('#quoteForm_name'); getCreateCartForm = (): Cypress.Chainable => cy.get('form[name=quoteForm]'); + getQuoteTable = (): Cypress.Chainable => cy.get('[data-qa="component quote-table"]'); } diff --git a/cypress/support/scenarios/yves/place-mp-order-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts similarity index 83% rename from cypress/support/scenarios/yves/place-mp-order-scenario.ts rename to cypress/support/scenarios/yves/checkout-mp-scenario.ts index 251bf9f2..a47fba5e 100644 --- a/cypress/support/scenarios/yves/place-mp-order-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -5,7 +5,6 @@ import { CliHelper } from '../../helpers/cli-helper'; import { CartPage, CheckoutAddressPage, - CheckoutCustomerPage, CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, @@ -13,10 +12,9 @@ import { @injectable() @autoWired -export class PlaceMpOrderScenario { +export class CheckoutMpScenario { constructor( @inject(CartPage) private cartPage: CartPage, - @inject(CheckoutCustomerPage) private checkoutCustomerPage: CheckoutCustomerPage, @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage, @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage, @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage, @@ -24,12 +22,10 @@ export class PlaceMpOrderScenario { @inject(CliHelper) private cliHelper: CliHelper ) {} - public execute = (productSku: string): void => { + public execute = (): void => { this.cartPage.visit(); - this.cartPage.quickAddToCart(productSku); this.cartPage.startCheckout(); - this.checkoutAddressPage.fillShippingAddress(); this.checkoutShipmentPage.setStandardShippingMethod(); this.checkoutPaymentPage.setDummyMarketplacePaymentMethod(); diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts new file mode 100644 index 00000000..55eb2a38 --- /dev/null +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -0,0 +1,36 @@ +import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; +import { autoWired } from '../../utils/inversify/auto-wired'; +import { CliHelper } from '../../helpers/cli-helper'; +import { + CartPage, + CheckoutAddressPage, + CheckoutPaymentPage, + CheckoutShipmentPage, + CheckoutSummaryPage, +} from '../../pages/yves'; + +@injectable() +@autoWired +export class CheckoutScenario { + constructor( + @inject(CartPage) private cartPage: CartPage, + @inject(CheckoutAddressPage) private checkoutAddressPage: CheckoutAddressPage, + @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage, + @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage, + @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage, + @inject(CliHelper) private cliHelper: CliHelper + ) {} + + public execute = (): void => { + this.cartPage.visit(); + + this.cartPage.startCheckout(); + this.checkoutAddressPage.fillShippingAddress(); + this.checkoutShipmentPage.setStandardShippingMethod(); + this.checkoutPaymentPage.setDummyPaymentMethod(); + this.checkoutSummaryPage.placeOrder(); + + this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); + }; +} diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index 746076a4..6583dd71 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -1,3 +1,4 @@ -export * from './customer-login-scenario'; export * from './agent-login-scenario'; -export * from './place-mp-order-scenario'; +export * from './checkout-scenario'; +export * from './checkout-mp-scenario'; +export * from './customer-login-scenario'; diff --git a/cypress/support/types/yves/comments/cart/common/quote.ts b/cypress/support/types/yves/comments/cart/common/quote.ts index 430c92e4..f6790776 100644 --- a/cypress/support/types/yves/comments/cart/common/quote.ts +++ b/cypress/support/types/yves/comments/cart/common/quote.ts @@ -1,5 +1,6 @@ export interface Quote { id_quote: number; + name: string; customer_reference: string; uuid: string; totals: string; diff --git a/cypress/support/types/yves/order-managment/order/common/customer.ts b/cypress/support/types/yves/order-managment/order/common/customer.ts new file mode 100644 index 00000000..9e663dd4 --- /dev/null +++ b/cypress/support/types/yves/order-managment/order/common/customer.ts @@ -0,0 +1,3 @@ +export interface Customer { + email: string; +} diff --git a/cypress/support/types/yves/order-managment/return/common/product.ts b/cypress/support/types/yves/order-managment/return/common/product.ts new file mode 100644 index 00000000..666aaada --- /dev/null +++ b/cypress/support/types/yves/order-managment/return/common/product.ts @@ -0,0 +1,3 @@ +export interface Product { + sku: string; +} diff --git a/cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts b/cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts new file mode 100644 index 00000000..240340f2 --- /dev/null +++ b/cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts @@ -0,0 +1,21 @@ +import { Product } from './common/product'; + +export interface CreateReturnByUserDynamicFixtures { + rootUser: User; + customer: Customer; + product: Product; + quoteOne: Quote; + quoteTwo: Quote; +} + +interface User { + username: string; +} + +interface Customer { + email: string; +} + +interface Quote { + name: string; +} diff --git a/cypress/support/types/yves/order-managment/return/index.ts b/cypress/support/types/yves/order-managment/return/index.ts new file mode 100644 index 00000000..cfc6ac0c --- /dev/null +++ b/cypress/support/types/yves/order-managment/return/index.ts @@ -0,0 +1,2 @@ +export * from './dynamic-fixture-types'; +export * from './static-fixture-types'; diff --git a/cypress/support/types/yves/order-managment/return/static-fixture-types.ts b/cypress/support/types/yves/order-managment/return/static-fixture-types.ts new file mode 100644 index 00000000..6f1a24ae --- /dev/null +++ b/cypress/support/types/yves/order-managment/return/static-fixture-types.ts @@ -0,0 +1,3 @@ +export interface CreateReturnByUserStaticFixtures { + defaultPassword: string; +} From 8d84ba67d00dae7f90b19223ed5284a4fa36fb24 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Fri, 1 Mar 2024 21:57:32 +0300 Subject: [PATCH 23/53] Optimized test suites. --- .../agent-permission-in-backoffice.cy.ts | 101 ---- .../order-management-suite-1.cy.ts | 49 ++ .../return-management-suite-1.cy.ts} | 25 +- .../customer-agent-login-page.cy.ts | 79 --- .../marketplace-agent-assist-suite-1.cy.ts | 453 ++++++++++++++++++ ...=> marketplace-agent-assist-suite-2.cy.ts} | 14 +- .../merchant-user-agent-dashboard.cy.ts | 176 ------- .../merchant-user-agent-login-page.cy.ts | 77 --- .../merchant-user-header-bar.cy.ts | 74 --- .../checkout/checkout-by-guest-customer.cy.ts | 83 ---- .../checkout-by-logged-in-customer.cy.ts | 88 ---- .../e2e/yves/checkout/checkout-suite-1.cy.ts | 56 +++ .../comments/cart/empty-cart-comment.cy.ts | 43 -- .../cart/not-empty-cart-comment.cy.ts | 43 -- .../e2e/yves/comments/comments-suite-1.cy.ts | 78 +++ .../order/create-order-by-customer.cy.ts | 45 -- .../order/create-order-by-guest.cy.ts | 39 -- .../comment/dynamic/empty-cart-comment.json | 52 -- .../dynamic/not-empty-cart-comment.json | 58 --- .../comment/static/empty-cart-comment.json | 12 - .../static/not-empty-cart-comment.json | 12 - .../comments/dynamic/comments-suite-1.json} | 29 +- .../comments/static/comments-suite-1.json} | 6 +- .../agent-permission-in-backoffice.json | 56 --- .../dynamic/order-management-suite-1.json} | 34 ++ .../static/order-management-suite-1.json} | 0 .../dynamic/return-management-suite-1.json} | 0 .../static/return-management-suite-1.json} | 0 .../dynamic/customer-agent-login-page.json | 88 ---- .../marketplace-agent-assist-suite-1.json | 285 +++++++++++ ... => marketplace-agent-assist-suite-2.json} | 0 .../merchant-user-agent-dashboard.json | 72 --- .../merchant-user-agent-login-page.json | 73 --- .../dynamic/merchant-user-header-bar.json | 57 --- ... => marketplace-agent-assist-suite-1.json} | 0 ... => marketplace-agent-assist-suite-2.json} | 0 .../static/merchant-user-impersonation.json | 3 - ...st-customer.json => checkout-suite-1.json} | 78 +++ .../checkout-by-logged-in-customer.json | 5 - .../checkout/static/checkout-suite-1.json} | 0 .../cart/dynamic/empty-cart-comment.json | 73 --- .../dynamic/comments-suite-1.json} | 114 +++-- .../comments-suite-1.json} | 6 +- .../order/dynamic/create-order-by-guest.json | 72 --- .../static/create-order-by-customer.json | 5 - .../return/static/create-return-by-user.json | 3 - .../agent-dashboard/agent-dashboard-page.ts | 4 +- .../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 | 23 +- .../scenarios/yves/checkout-scenario.ts | 23 +- .../dynamic-fixture-types.ts | 9 - .../marketplace-agent-assist/index.ts | 2 - .../static-fixture-types.ts | 3 - .../order-managment/fixture-types.ts | 11 + .../transfer/transfer-types.ts | 12 + .../return-managment/fixture-types.ts | 13 + .../transfer/transfer-types.ts | 15 + .../dynamic-fixture-types.ts | 10 - .../marketplace-agent-assist/fixture-types.ts | 28 ++ .../mp/marketplace-agent-assist/index.ts | 2 - .../static-fixture-types.ts | 3 - .../transfer/transfer-types.ts | 22 + .../dynamic-fixture-types.ts | 14 - .../mp/merchant-user-agent-dashboard/index.ts | 2 - .../static-fixture-types.ts | 3 - .../dynamic-fixture-types.ts | 9 - .../merchant-user-agent-login-page/index.ts | 2 - .../static-fixture-types.ts | 3 - .../dynamic-fixture-types.ts | 15 - .../mp/merchant-user-header-bar/index.ts | 2 - .../static-fixture-types.ts | 3 - .../dynamic-fixture-types.ts | 28 -- .../mp/merchant-user-impersonation/index.ts | 2 - .../static-fixture-types.ts | 3 - .../types/yves/checkout/common/customer.ts | 5 - .../types/yves/checkout/common/product.ts | 3 - .../common/\321\201heckout-address.ts" | 10 - .../yves/checkout/dynamic-fixture-types.ts | 16 - .../types/yves/checkout/fixture-types.ts | 13 + cypress/support/types/yves/checkout/index.ts | 4 - .../yves/checkout/static-fixture-types.ts | 7 - .../yves/checkout/transfer/transfer-types.ts | 11 + .../yves/comments/cart/common/product.ts | 5 - .../comments/cart/dynamic-fixture-types.ts | 12 - .../support/types/yves/comments/cart/index.ts | 2 - .../comments/cart/static-fixture-types.ts | 11 - .../types/yves/comments/fixture-types.ts | 16 + .../quote.ts => transfer/transfer-types.ts} | 10 + .../order-managment/order/common/customer.ts | 3 - .../order-managment/order/common/product.ts | 3 - .../order/dynamic-fixture-types.ts | 14 - .../types/yves/order-managment/order/index.ts | 2 - .../order/static-fixture-types.ts | 7 - .../order-managment/return/common/product.ts | 3 - .../return/dynamic-fixture-types.ts | 21 - .../yves/order-managment/return/index.ts | 2 - .../return/static-fixture-types.ts | 3 - .../utils/inversify/inversify.config.ts | 28 +- cypress/support/utils/inversify/types.ts | 20 +- 108 files changed, 1373 insertions(+), 1860 deletions(-) delete mode 100644 cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts create mode 100644 cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts rename cypress/e2e/{yves/order-management/return/create-return-by-user.cy.ts => backoffice/return-management/return-management-suite-1.cy.ts} (78%) delete mode 100644 cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts create mode 100644 cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts rename cypress/e2e/mp/marketplace-agent-assist/{merchant-user-impersonation.cy.ts => marketplace-agent-assist-suite-2.cy.ts} (91%) delete mode 100644 cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts delete mode 100644 cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts delete mode 100644 cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts delete mode 100644 cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts delete mode 100644 cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts create mode 100644 cypress/e2e/yves/checkout/checkout-suite-1.cy.ts delete mode 100644 cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts delete mode 100644 cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts create mode 100644 cypress/e2e/yves/comments/comments-suite-1.cy.ts delete mode 100644 cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts delete mode 100644 cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts delete mode 100644 cypress/fixtures/b2b/yves/cart/comment/dynamic/empty-cart-comment.json delete mode 100644 cypress/fixtures/b2b/yves/cart/comment/dynamic/not-empty-cart-comment.json delete mode 100644 cypress/fixtures/b2b/yves/cart/comment/static/empty-cart-comment.json delete mode 100644 cypress/fixtures/b2b/yves/cart/comment/static/not-empty-cart-comment.json rename cypress/fixtures/{suite/yves/comments/cart/dynamic/not-empty-cart-comment.json => b2b/yves/comments/dynamic/comments-suite-1.json} (85%) rename cypress/fixtures/{suite/yves/comments/cart/static/not-empty-cart-comment.json => b2b/yves/comments/static/comments-suite-1.json} (88%) delete mode 100644 cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json rename cypress/fixtures/suite/{yves/order-management/order/dynamic/create-order-by-customer.json => backoffice/order-management/dynamic/order-management-suite-1.json} (74%) rename cypress/fixtures/suite/backoffice/{marketplace-agent-assist/static/agent-permission-in-backoffice.json => order-management/static/order-management-suite-1.json} (100%) rename cypress/fixtures/suite/{yves/order-management/return/dynamic/create-return-by-user.json => backoffice/return-management/dynamic/return-management-suite-1.json} (100%) rename cypress/fixtures/suite/{mp/marketplace-agent-assist/static/customer-agent-login-page.json => backoffice/return-management/static/return-management-suite-1.json} (100%) delete mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/marketplace-agent-assist-suite-1.json rename cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/{merchant-user-impersonation.json => marketplace-agent-assist-suite-2.json} (100%) delete mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json delete mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json delete mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json rename cypress/fixtures/suite/mp/marketplace-agent-assist/static/{merchant-user-agent-dashboard.json => marketplace-agent-assist-suite-1.json} (100%) rename cypress/fixtures/suite/mp/marketplace-agent-assist/static/{merchant-user-agent-login-page.json => marketplace-agent-assist-suite-2.json} (100%) delete mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json rename cypress/fixtures/suite/yves/checkout/dynamic/{checkout-by-guest-customer.json => checkout-suite-1.json} (59%) delete mode 100644 cypress/fixtures/suite/yves/checkout/static/checkout-by-logged-in-customer.json rename cypress/fixtures/suite/{mp/marketplace-agent-assist/static/merchant-user-header-bar.json => yves/checkout/static/checkout-suite-1.json} (100%) delete mode 100644 cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json rename cypress/fixtures/suite/yves/{checkout/dynamic/checkout-by-logged-in-customer.json => comments/dynamic/comments-suite-1.json} (81%) rename cypress/fixtures/suite/yves/comments/{cart/static/empty-cart-comment.json => static/comments-suite-1.json} (88%) delete mode 100644 cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json delete mode 100644 cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json delete mode 100644 cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json delete mode 100644 cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/backoffice/marketplace-agent-assist/index.ts delete mode 100644 cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts create mode 100644 cypress/support/types/backoffice/order-managment/fixture-types.ts create mode 100644 cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts create mode 100644 cypress/support/types/backoffice/return-managment/fixture-types.ts create mode 100644 cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts delete mode 100644 cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts create mode 100644 cypress/support/types/mp/marketplace-agent-assist/fixture-types.ts delete mode 100644 cypress/support/types/mp/marketplace-agent-assist/index.ts delete mode 100644 cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts create mode 100644 cypress/support/types/mp/marketplace-agent-assist/transfer/transfer-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-agent-dashboard/index.ts delete mode 100644 cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-agent-login-page/index.ts delete mode 100644 cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-header-bar/index.ts delete mode 100644 cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/mp/merchant-user-impersonation/index.ts delete mode 100644 cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts delete mode 100644 cypress/support/types/yves/checkout/common/customer.ts delete mode 100644 cypress/support/types/yves/checkout/common/product.ts delete mode 100644 "cypress/support/types/yves/checkout/common/\321\201heckout-address.ts" delete mode 100644 cypress/support/types/yves/checkout/dynamic-fixture-types.ts create mode 100644 cypress/support/types/yves/checkout/fixture-types.ts delete mode 100644 cypress/support/types/yves/checkout/index.ts delete mode 100644 cypress/support/types/yves/checkout/static-fixture-types.ts create mode 100644 cypress/support/types/yves/checkout/transfer/transfer-types.ts delete mode 100644 cypress/support/types/yves/comments/cart/common/product.ts delete mode 100644 cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/yves/comments/cart/index.ts delete mode 100644 cypress/support/types/yves/comments/cart/static-fixture-types.ts create mode 100644 cypress/support/types/yves/comments/fixture-types.ts rename cypress/support/types/yves/comments/{cart/common/quote.ts => transfer/transfer-types.ts} (50%) delete mode 100644 cypress/support/types/yves/order-managment/order/common/customer.ts delete mode 100644 cypress/support/types/yves/order-managment/order/common/product.ts delete mode 100644 cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/yves/order-managment/order/index.ts delete mode 100644 cypress/support/types/yves/order-managment/order/static-fixture-types.ts delete mode 100644 cypress/support/types/yves/order-managment/return/common/product.ts delete mode 100644 cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts delete mode 100644 cypress/support/types/yves/order-managment/return/index.ts delete mode 100644 cypress/support/types/yves/order-managment/return/static-fixture-types.ts diff --git a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts b/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts deleted file mode 100644 index e1b23d58..00000000 --- a/cypress/e2e/backoffice/marketplace-agent-assist/agent-permission-in-backoffice.cy.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { UserIndexPage, UserUpdatePage } from '../../../support/pages/backoffice'; -import { UserLoginScenario } from '../../../support/scenarios/backoffice'; -import { container } from '../../../support/utils/inversify/inversify.config'; -import { - AgentPermissionInBackofficeDynamicFixtures, - AgentPermissionInBackofficeStaticFixtures, -} from '../../../support/types/backoffice/marketplace-agent-assist'; - -/** - * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} - */ -describe('agent permission in backoffice', { tags: ['@marketplace-agent-assist'] }, (): void => { - const userIndexPage: UserIndexPage = container.get(UserIndexPage); - const userUpdatePage: UserUpdatePage = container.get(UserUpdatePage); - const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); - - let dynamicFixtures: AgentPermissionInBackofficeDynamicFixtures; - let staticFixtures: AgentPermissionInBackofficeStaticFixtures; - - before((): void => { - ({ dynamicFixtures, staticFixtures } = Cypress.env()); - cy.resetBackofficeCookies(); - }); - - beforeEach((): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - }); - - it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { - userIndexPage.visit(); - userIndexPage.editUser(dynamicFixtures.rootUser.username); - - userUpdatePage - .getAgentMerchantCheckbox() - .should('exist') - .parent() - .contains('This user is an agent in Merchant Portal'); - }); - - it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { - userIndexPage.visit(); - userIndexPage.editUser(dynamicFixtures.rootUser.username); - - userUpdatePage.getAgentCustomerCheckbox().should('exist').parent().contains('This user is an agent in Storefront'); - }); - - it('backoffice user should be able to see existing user with merchant agent permission', (): void => { - userIndexPage.visit(); - userIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); - - userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); - - it('backoffice user should be able to see "Agent Customer" column in user table', (): void => { - userIndexPage.visit(); - userIndexPage.getUserTableHeader().contains('Agent Customer'); - }); - - it('backoffice user should be able to see "Agent Merchant" column in user table', (): void => { - userIndexPage.visit(); - userIndexPage.getUserTableHeader().contains('Agent Merchant'); - }); - - it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => { - userIndexPage.visit(); - - userIndexPage.findUser(dynamicFixtures.customerAgentUser.username).contains('Agent').should('have.length', 1); - }); - - it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { - userIndexPage.visit(); - - userIndexPage.findUser(dynamicFixtures.merchantAgentUser.username).contains('Agent').should('have.length', 1); - }); - - it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => { - userIndexPage.visit(); - userIndexPage.editUser(dynamicFixtures.rootUser.username); - - userUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); - }); - - it('backoffice user should be able to create new user with merchant agent permission', (): void => { - userIndexPage.visit(); - userIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); - - userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); - - it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => { - userIndexPage.visit(); - - userIndexPage.editUser(dynamicFixtures.rootUser.username); - userUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); - - userUpdatePage.checkMerchantAgentCheckbox(); - - userIndexPage.editUser(dynamicFixtures.rootUser.username); - userUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); -}); 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 new file mode 100644 index 00000000..9434eddb --- /dev/null +++ b/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts @@ -0,0 +1,49 @@ +import { CartPage } from '../../../support/pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; +import { container } from '../../../support/utils/inversify/inversify.config'; +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); + + let staticFixtures: OrderManagementStaticFixtures; + let dynamicFixtures: OrderManagementSuite1DynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('should be able to create an order by existing customer', (): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + + checkoutScenario.execute(); + cy.contains('Your order has been placed successfully!'); + + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + salesIndexPage.viewLastPlacedOrder(); + + 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); + + checkoutScenario.execute(true); + cy.contains('Your order has been placed successfully!'); + + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + salesIndexPage.viewLastPlacedOrder(); + + cy.get('body').contains(dynamicFixtures.product.name); + }); +}); diff --git a/cypress/e2e/yves/order-management/return/create-return-by-user.cy.ts b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts similarity index 78% rename from cypress/e2e/yves/order-management/return/create-return-by-user.cy.ts rename to cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts index 4d4ac592..4bb30cba 100644 --- a/cypress/e2e/yves/order-management/return/create-return-by-user.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts @@ -1,14 +1,14 @@ -import { container } from '../../../../support/utils/inversify/inversify.config'; -import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '../../../../support/pages/backoffice'; -import { CheckoutScenario, CustomerLoginScenario } from '../../../../support/scenarios/yves'; +import { MultiCartPage } from '../../../support/pages/yves'; +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 { - CreateReturnByUserDynamicFixtures, - CreateReturnByUserStaticFixtures, -} from '../../../../support/types/yves/order-managment/return'; -import { UserLoginScenario } from '../../../../support/scenarios/backoffice'; -import { MultiCartPage } from '../../../../support/pages/yves'; + ReturnManagementStaticFixtures, + ReturnManagementSuite1DynamicFixtures, +} from '../../../support/types/backoffice/return-managment/fixture-types'; -describe('create return by user', { tags: ['@order-management'] }, (): void => { +describe('return management suite 1', { tags: ['@return-management'] }, (): void => { const multiCartPage: MultiCartPage = container.get(MultiCartPage); const salesIndexPage: SalesIndexPage = container.get(SalesIndexPage); const salesDetailPage: SalesDetailPage = container.get(SalesDetailPage); @@ -17,8 +17,8 @@ describe('create return by user', { tags: ['@order-management'] }, (): void => { const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); const checkoutScenario: CheckoutScenario = container.get(CheckoutScenario); - let staticFixtures: CreateReturnByUserStaticFixtures; - let dynamicFixtures: CreateReturnByUserDynamicFixtures; + let dynamicFixtures: ReturnManagementSuite1DynamicFixtures; + let staticFixtures: ReturnManagementStaticFixtures; before((): void => { ({ staticFixtures, dynamicFixtures } = Cypress.env()); @@ -26,10 +26,10 @@ describe('create return by user', { tags: ['@order-management'] }, (): void => { beforeEach((): void => { customerLoginScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + multiCartPage.visit(); }); it('should be able to create return from (from shipped order state)', (): void => { - multiCartPage.visit(); multiCartPage.selectCart(dynamicFixtures.quoteOne.name); checkoutScenario.execute(); @@ -49,7 +49,6 @@ describe('create return by user', { tags: ['@order-management'] }, (): void => { }); it('should be able to create return from (from delivery order state)', (): void => { - multiCartPage.visit(); multiCartPage.selectCart(dynamicFixtures.quoteTwo.name); checkoutScenario.execute(); diff --git a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts deleted file mode 100644 index a7c6f12c..00000000 --- a/cypress/e2e/mp/marketplace-agent-assist/customer-agent-login-page.cy.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { IndexPage } from '../../../support/pages/backoffice'; -import { UserLoginScenario } from '../../../support/scenarios/backoffice'; -import { AgentLoginPage, LoginPage } from '../../../support/pages/yves'; -import { - CustomerAgentLoginPageDynamicFixtures, - CustomerAgentLoginPageStaticFixtures, -} from '../../../support/types/mp/marketplace-agent-assist'; - -/** - * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} - */ -describe('customer agent login page', { tags: ['@marketplace-agent-assist'] }, (): void => { - const indexPage: IndexPage = container.get(IndexPage); - const loginPage: LoginPage = container.get(LoginPage); - const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); - const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); - - let dynamicFixtures: CustomerAgentLoginPageDynamicFixtures; - let staticFixtures: CustomerAgentLoginPageStaticFixtures; - - before((): void => { - ({ dynamicFixtures, staticFixtures } = Cypress.env()); - }); - - it('agent (customer) should be able to login to backoffice', (): void => { - userLoginScenario.execute(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); - - indexPage.visit(); - indexPage.assertPageLocation(); - }); - - it('agent (merchant user) should be able to login to backoffice', (): void => { - userLoginScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - indexPage.visit(); - indexPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(agentLoginPage.getFailedAuthenticationText()); - agentLoginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to storefront agent dashboard', (): void => { - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(agentLoginPage.getFailedAuthenticationText()); - agentLoginPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to storefront', (): void => { - loginPage.visit(); - loginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); - - it('agent (customer) should not be able to login to storefront', (): void => { - loginPage.visit(); - loginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to storefront', (): void => { - loginPage.visit(); - loginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); -}); 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 new file mode 100644 index 00000000..cf2a2af7 --- /dev/null +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts @@ -0,0 +1,453 @@ +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 { + AgentDashboardPage, + DashboardPage, + LoginPage as MpLoginPage, + AgentLoginPage as MpAgentLoginPage, +} from '../../../support/pages/mp'; +import { ImpersonateAsMerchantUserScenario, MerchantAgentLoginUserScenario } from '../../../support/scenarios/mp'; + +/** + * 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); + + let dynamicFixtures: MarketplaceAgentAssistSuite1DynamicFixtures; + let staticFixtures: MarketplaceAgentAssistStaticFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('agent (customer) should be able to login to backoffice', (): void => { + userLoginScenario.execute(dynamicFixtures.customerAgentUser.username, 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); + + backofficeIndexPage.visit(); + backofficeIndexPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { + yvesAgentLoginPage.visit(); + yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); + yvesAgentLoginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to storefront agent dashboard', (): void => { + yvesAgentLoginPage.visit(); + yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); + yvesAgentLoginPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to storefront', (): void => { + yvesLoginPage.visit(); + yvesLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesLoginPage.getFailedAuthenticationText()); + yvesLoginPage.assertPageLocation(); + }); + + it('agent (customer) should not be able to login to storefront', (): void => { + yvesLoginPage.visit(); + yvesLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesLoginPage.getFailedAuthenticationText()); + yvesLoginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to storefront', (): void => { + yvesLoginPage.visit(); + yvesLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesLoginPage.getFailedAuthenticationText()); + yvesLoginPage.assertPageLocation(); + }); + + it('agent should be able to see "Merchant Users" table', (): void => { + merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assertPageLocation(); + mpAgentDashboardPage.getDashboardSidebarSelector().contains('Merchant Users'); + + cy.contains('Merchant'); + cy.contains('Merchant Approval'); + cy.contains('First Name'); + cy.contains('Last Name'); + cy.contains('Email'); + cy.contains('User Status'); + }); + + it('agent should be able to see active merchant user in a table', (): void => { + merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, 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); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name, 3).should('exist'); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + }); + + it('agent should be able to see/assist inactive merchant user in a table', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deactivatedMerchantUser.username).should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deactivatedMerchantUser.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist deleted merchant user in a table', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deletedMerchantUser.username).should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deletedMerchantUser.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage + .findMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username) + .should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage + .findMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username) + .should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage + .findMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username) + .should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent (customer) should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('merchant user should be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); + + cy.contains('Dashboard'); + mpDashboardPage.assertPageLocation(); + }); + + it('deactivated merchant user should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.deactivatedMerchantUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('deleted merchant user should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.deletedMerchantUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('agent (customer) should not be able to login to MP agent dashboard', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(mpAgentLoginPage.getFailedAuthenticationText()); + mpAgentLoginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to MP agent dashboard', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); + + cy.contains(mpAgentLoginPage.getFailedAuthenticationText()); + mpAgentLoginPage.assertPageLocation(); + }); + + it('agent (merchant user) should be able to login to MP agent dashboard', (): void => { + merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assertPageLocation(); + }); + + it('agent assist login page in MP should not contain "Forgot password" button', (): void => { + mpAgentLoginPage.visit(); + + cy.contains('Agent Assist Login'); + cy.get('body').contains('Forgot password').should('not.exist'); + }); + + it('agent should be able to see merchant user information during impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + mpDashboardPage.visit(); + cy.get('body').find(`div:contains("${dynamicFixtures.merchant.name}")`).should('exist'); + cy.get('body').find(`div:contains("${dynamicFixtures.merchantUser.username}")`).should('exist'); + + cy.get('body') + .find(`div:contains("${dynamicFixtures.merchantUser.first_name} ${dynamicFixtures.merchantUser.last_name}")`) + .should('exist'); + }); + + it('agent should be able to see agent assist buttons during impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + cy.get('body').find('a:contains("End User Assistance")').should('exist'); + cy.get('body').find('a:contains("Log out Agent")').should('exist'); + }); + + it('agent should be able to finish impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + cy.get('body').find('a:contains("End User Assistance")').click(); + mpAgentDashboardPage.assertPageLocation(); + + // Ensure that agent finished assistant session and don't have access to MP dashboard + mpDashboardPage.visit({ failOnStatusCode: false }); + cy.get('body').contains('Access Denied.'); + }); + + it('agent should be able to fully logout from all sessions', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + cy.get('body').find('a:contains("Log out Agent")').click(); + mpAgentLoginPage.assertPageLocation(); + + mpAgentDashboardPage.visit(); + mpAgentLoginPage.assertPageLocation(); + + mpDashboardPage.visit(); + mpLoginPage.assertPageLocation(); + }); + + it('agent should be able to fully logout from user profile menu', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + mpDashboardPage.logout(); + yvesLoginPage.assertPageLocation(); + }); + + it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + + backofficeUserUpdatePage + .getAgentMerchantCheckbox() + .should('exist') + .parent() + .contains('This user is an agent in Merchant Portal'); + }); + + it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + + backofficeUserUpdatePage + .getAgentCustomerCheckbox() + .should('exist') + .parent() + .contains('This user is an agent in Storefront'); + }); + + it('backoffice user should be able to see existing user with merchant agent permission', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); + + it('backoffice user should be able to see "Agent Customer" column in user table', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, 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); + + 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); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage + .findUser(dynamicFixtures.customerAgentUser.username) + .contains('Agent') + .should('have.length', 1); + }); + + it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage + .findUser(dynamicFixtures.merchantAgentUser.username) + .contains('Agent') + .should('have.length', 1); + }); + + 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); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); + }); + + it('backoffice user should be able to create new user with merchant agent permission', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); + + it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => { + userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); + + backofficeUserUpdatePage.checkMerchantAgentCheckbox(); + + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); +}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts similarity index 91% rename from cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts rename to cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts index d6691cf7..8a06a6c1 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-impersonation.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts @@ -3,17 +3,17 @@ import { OffersPage, ProductsPage, ProfilePage, SalesOrdersPage } from '../../.. import { SalesDetailPage, SalesIndexPage } from '../../../support/pages/backoffice'; import { UserLoginScenario } from '../../../support/scenarios/backoffice'; import { ImpersonateAsMerchantUserScenario } from '../../../support/scenarios/mp'; -import { - MerchantUserImpersonationDynamicFixtures, - MerchantUserImpersonationStaticFixtures, -} from '../../../support/types/mp/merchant-user-impersonation'; import { CheckoutMpScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; import { CartPage } from '../../../support/pages/yves'; +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} */ -describe('merchant user impersonation', { tags: ['@marketplace-agent-assist'] }, (): void => { +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); @@ -27,8 +27,8 @@ describe('merchant user impersonation', { tags: ['@marketplace-agent-assist'] }, const customerLoginScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); const checkoutMpScenario: CheckoutMpScenario = container.get(CheckoutMpScenario); - let dynamicFixtures: MerchantUserImpersonationDynamicFixtures; - let staticFixtures: MerchantUserImpersonationStaticFixtures; + let dynamicFixtures: MarketplaceAgentAssistSuite2DynamicFixtures; + let staticFixtures: MarketplaceAgentAssistStaticFixtures; before((): void => { ({ dynamicFixtures, staticFixtures } = Cypress.env()); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts deleted file mode 100644 index 75bdb88e..00000000 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-dashboard.cy.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { AgentDashboardPage, AgentLoginPage, DashboardPage } from '../../../support/pages/mp'; -import { MerchantListPage, UserDeletePage, UserIndexPage } from '../../../support/pages/backoffice'; -import { UserLoginScenario } from '../../../support/scenarios/backoffice'; -import { MerchantAgentLoginUserScenario } from '../../../support/scenarios/mp'; -import { - MerchantUserAgentDashboardDynamicFixtures, - MerchantUserAgentDashboardStaticFixtures, -} from '../../../support/types/mp/merchant-user-agent-dashboard'; - -/** - * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} - */ -describe('merchant user agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void => { - const dashboardPage: DashboardPage = container.get(DashboardPage); - const agentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); - const userIndexPage: UserIndexPage = container.get(UserIndexPage); - const userDeletePage: UserDeletePage = container.get(UserDeletePage); - const merchantListPage: MerchantListPage = container.get(MerchantListPage); - const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); - const userLoginScenario: UserLoginScenario = container.get(UserLoginScenario); - const merchantAgentLoginUserScenario: MerchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); - - let dynamicFixtures: MerchantUserAgentDashboardDynamicFixtures; - let staticFixtures: MerchantUserAgentDashboardStaticFixtures; - - before((): void => { - ({ dynamicFixtures, staticFixtures } = Cypress.env()); - }); - - it('agent should be able to see "Merchant Users" table', (): void => { - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.assertPageLocation(); - agentDashboardPage.getDashboardSidebarSelector().contains('Merchant Users'); - - cy.contains('Merchant'); - cy.contains('Merchant Approval'); - cy.contains('First Name'); - cy.contains('Last Name'); - cy.contains('Email'); - cy.contains('User Status'); - }); - - it('agent should be able to see active merchant user in a table', (): void => { - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.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); - - agentDashboardPage.visit(); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name).should('exist'); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - }); - - it('agent should be able to see/assist inactive merchant user in a table', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - - userIndexPage.visit(); - userIndexPage.deactivateUser(dynamicFixtures.merchantUser.username); - - merchantAgentLoginUserScenario.execute(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - - agentDashboardPage.visit(); - agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - - dashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist deleted merchant user in a table', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - - userIndexPage.visit(); - userIndexPage.deleteUser(dynamicFixtures.merchantUser.username); - userDeletePage.confirmDelete(); - - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - - agentDashboardPage.visit(); - agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - - dashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - - merchantListPage.visit(); - merchantListPage.activateMerchant(dynamicFixtures.merchant.name); - merchantListPage.visit(); - merchantListPage.approveAccessMerchant(dynamicFixtures.merchant.name); - - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - - agentDashboardPage.visit(); - agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - - dashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - - merchantListPage.visit(); - merchantListPage.activateMerchant(dynamicFixtures.merchant.name); - merchantListPage.visit(); - merchantListPage.denyAccessMerchant(dynamicFixtures.merchant.name); - - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - - agentDashboardPage.visit(); - agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - - dashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - - merchantListPage.visit(); - merchantListPage.deactivateMerchant(dynamicFixtures.merchant.name); - merchantListPage.visit(); - merchantListPage.approveAccessMerchant(dynamicFixtures.merchant.name); - - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - - agentDashboardPage.visit(); - agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - - dashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => { - userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); - - merchantListPage.visit(); - merchantListPage.deactivateMerchant(dynamicFixtures.merchant.name); - merchantListPage.visit(); - merchantListPage.denyAccessMerchant(dynamicFixtures.merchant.name); - - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.visit(); - agentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - - agentDashboardPage.visit(); - agentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - - dashboardPage.assertPageLocation(); - }); -}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts deleted file mode 100644 index a66c6cca..00000000 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-agent-login-page.cy.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { AgentDashboardPage, AgentLoginPage, DashboardPage, LoginPage } from '../../../support/pages/mp'; -import { - MerchantUserAgentLoginPageDynamicFixtures, - MerchantUserAgentLoginPageStaticFixtures, -} from '../../../support/types/mp/merchant-user-agent-login-page'; - -/** - * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} - */ -describe('merchant user agent login page', { tags: ['@marketplace-agent-assist'] }, (): void => { - const loginPage: LoginPage = container.get(LoginPage); - const dashboardPage: DashboardPage = container.get(DashboardPage); - const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); - const agentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); - - let dynamicFixtures: MerchantUserAgentLoginPageDynamicFixtures; - let staticFixtures: MerchantUserAgentLoginPageStaticFixtures; - - before((): void => { - ({ dynamicFixtures, staticFixtures } = Cypress.env()); - }); - - it('agent (customer) should not be able to login to MP dashboard', (): void => { - loginPage.visit(); - loginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to MP dashboard', (): void => { - loginPage.visit(); - loginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(loginPage.getFailedAuthenticationText()); - loginPage.assertPageLocation(); - }); - - it('merchant user should be able to login to MP dashboard', (): void => { - loginPage.visit(); - loginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); - - cy.contains('Dashboard'); - dashboardPage.assertPageLocation(); - }); - - it('agent (customer) should not be able to login to MP agent dashboard', (): void => { - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(agentLoginPage.getFailedAuthenticationText()); - agentLoginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to MP agent dashboard', (): void => { - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); - - cy.contains(agentLoginPage.getFailedAuthenticationText()); - agentLoginPage.assertPageLocation(); - }); - - it('agent (merchant user) should be able to login to MP agent dashboard', (): void => { - agentLoginPage.visit(); - agentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - agentDashboardPage.assertPageLocation(); - }); - - it('agent assist login page in MP should not contain "Forgot password" button', (): void => { - agentLoginPage.visit(); - - cy.contains('Agent Assist Login'); - cy.get('body').contains('Forgot password').should('not.exist'); - }); -}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts deleted file mode 100644 index dd3a9ea2..00000000 --- a/cypress/e2e/mp/marketplace-agent-assist/merchant-user-header-bar.cy.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { AgentDashboardPage, AgentLoginPage, DashboardPage, LoginPage } from '../../../support/pages/mp'; -import { ImpersonateAsMerchantUserScenario } from '../../../support/scenarios/mp'; -import { - MerchantUserHeaderBarDynamicFixtures, - MerchantUserHeaderBarStaticFixtures, -} from '../../../support/types/mp/merchant-user-header-bar'; - -/** - * Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} - */ -describe('merchant user header bar', { tags: ['@marketplace-agent-assist'] }, (): void => { - const loginPage: LoginPage = container.get(LoginPage); - const agentLoginPage: AgentLoginPage = container.get(AgentLoginPage); - const dashboardPage: DashboardPage = container.get(DashboardPage); - const agentDashboardPage: AgentDashboardPage = container.get(AgentDashboardPage); - const impersonateScenario: ImpersonateAsMerchantUserScenario = container.get(ImpersonateAsMerchantUserScenario); - - let dynamicFixtures: MerchantUserHeaderBarDynamicFixtures; - let staticFixtures: MerchantUserHeaderBarStaticFixtures; - - before((): void => { - ({ dynamicFixtures, staticFixtures } = Cypress.env()); - }); - - beforeEach((): void => { - impersonateScenario.execute( - dynamicFixtures.merchantAgentUser.username, - staticFixtures.defaultPassword, - dynamicFixtures.merchantUser.username - ); - }); - - it('agent should be able to see merchant user information during impersonation', (): void => { - dashboardPage.visit(); - - cy.get('body').find(`div:contains("${dynamicFixtures.merchant.name}")`).should('exist'); - cy.get('body').find(`div:contains("${dynamicFixtures.merchantUser.username}")`).should('exist'); - - cy.get('body') - .find(`div:contains("${dynamicFixtures.merchantUser.first_name} ${dynamicFixtures.merchantUser.last_name}")`) - .should('exist'); - }); - - it('agent should be able to see agent assist buttons during impersonation', (): void => { - cy.get('body').find('a:contains("End User Assistance")').should('exist'); - cy.get('body').find('a:contains("Log out Agent")').should('exist'); - }); - - it('agent should be able to finish impersonation', (): void => { - cy.get('body').find('a:contains("End User Assistance")').click(); - agentDashboardPage.assertPageLocation(); - - // Ensure that agent finished assistant session and don't have access to MP dashboard - dashboardPage.visit({ failOnStatusCode: false }); - cy.get('body').contains('Access Denied.'); - }); - - it('agent should be able to fully logout from all sessions', (): void => { - cy.get('body').find('a:contains("Log out Agent")').click(); - agentLoginPage.assertPageLocation(); - - agentDashboardPage.visit(); - agentLoginPage.assertPageLocation(); - - dashboardPage.visit(); - loginPage.assertPageLocation(); - }); - - it('agent should be able to fully logout from user profile menu', (): void => { - dashboardPage.logout(); - loginPage.assertPageLocation(); - }); -}); diff --git a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts deleted file mode 100644 index edb9a52c..00000000 --- a/cypress/e2e/yves/checkout/checkout-by-guest-customer.cy.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { CheckoutByGuestCustomerDynamicFixtures } from '../../../support/types/yves/checkout'; -import { - CartPage, - CheckoutAddressPage, - CheckoutCustomerPage, - CheckoutPaymentPage, - CheckoutShipmentPage, - CheckoutSummaryPage, -} from '../../../support/pages/yves'; - -describe('checkout by guest customer', { tags: ['@checkout'] }, (): void => { - const cartPage: CartPage = container.get(CartPage); - const checkoutCustomerPage: CheckoutCustomerPage = container.get(CheckoutCustomerPage); - const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); - const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); - const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); - const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); - - let dynamicFixtures: CheckoutByGuestCustomerDynamicFixtures; - - before((): void => { - cy.resetYvesCookies(); - dynamicFixtures = Cypress.env('dynamicFixtures'); - }); - - beforeEach((): void => { - cartPage.visit(); - cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 2); - }); - - it('should checkout with one concrete product', (): void => { - cartPage.quickAddToCart(dynamicFixtures.productOne.sku); - completeGuestCheckoutProcess(); - - cy.contains('Your order has been placed successfully!'); - }); - - it('should checkout with two concrete products to single shipment', (): void => { - cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); - completeGuestCheckoutProcess(); - - cy.contains('Your order has been placed successfully!'); - }); - - it('should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { - cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); - completeGuestCheckoutProcess(); - - cy.contains('Your order has been placed successfully!'); - }); - - it('should checkout with strict checkout step redirects', (): void => { - cartPage.assertPageLocation(); - cartPage.startCheckout(); - - checkoutCustomerPage.assertPageLocation(); - checkoutCustomerPage.checkoutAsGuest(); - - checkoutAddressPage.assertPageLocation(); - checkoutAddressPage.fillShippingAddress(); - - checkoutShipmentPage.assertPageLocation(); - checkoutShipmentPage.setStandardShippingMethod(); - - checkoutPaymentPage.assertPageLocation(); - checkoutPaymentPage.setDummyPaymentMethod(); - - checkoutSummaryPage.assertPageLocation(); - checkoutSummaryPage.placeOrder(); - - cy.url().should('include', '/checkout/success'); - }); - - const completeGuestCheckoutProcess = () => { - cartPage.startCheckout(); - checkoutCustomerPage.checkoutAsGuest(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); - }; -}); diff --git a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts b/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts deleted file mode 100644 index 0e2fc9a8..00000000 --- a/cypress/e2e/yves/checkout/checkout-by-logged-in-customer.cy.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { container } from '../../../support/utils/inversify/inversify.config'; -import { - CheckoutByLoggedInCustomerDynamicFixtures, - CheckoutByLoggedInCustomerStaticFixtures, -} from '../../../support/types/yves/checkout'; -import { - CartPage, - CheckoutAddressPage, - CheckoutPaymentPage, - CheckoutShipmentPage, - CheckoutSummaryPage, -} from '../../../support/pages/yves'; -import { CustomerLoginScenario } from '../../../support/scenarios/yves'; - -describe('checkout by logged in customer', { tags: ['@checkout'] }, (): void => { - const cartPage: CartPage = container.get(CartPage); - const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); - const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); - const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); - const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); - const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - - let staticFixtures: CheckoutByLoggedInCustomerStaticFixtures; - let dynamicFixtures: CheckoutByLoggedInCustomerDynamicFixtures; - - before((): void => { - cy.resetYvesCookies(); - ({ staticFixtures, dynamicFixtures } = Cypress.env()); - }); - - beforeEach((): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); - cartPage.visit(); - cartPage.quickAddToCart(dynamicFixtures.productOne.sku); - }); - - it('should checkout with one concrete product', (): void => { - completeCustomerCheckoutProcessWithSingleShipment(); - - cy.contains('Your order has been placed successfully!'); - }); - - it('should checkout with two concrete products to single shipment', (): void => { - cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); - completeCustomerCheckoutProcessWithSingleShipment(); - - cy.contains('Your order has been placed successfully!'); - }); - - it('should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { - cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 2); - - cartPage.startCheckout(); - checkoutAddressPage.fillMultiShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); - - cy.contains('Your order has been placed successfully!'); - }); - - it('should checkout with strict checkout step redirects', (): void => { - cartPage.assertPageLocation(); - cartPage.startCheckout(); - - checkoutAddressPage.assertPageLocation(); - checkoutAddressPage.fillShippingAddress(); - - checkoutShipmentPage.assertPageLocation(); - checkoutShipmentPage.setStandardShippingMethod(); - - checkoutPaymentPage.assertPageLocation(); - checkoutPaymentPage.setDummyPaymentMethod(); - - checkoutSummaryPage.assertPageLocation(); - checkoutSummaryPage.placeOrder(); - - cy.url().should('include', '/checkout/success'); - }); - - const completeCustomerCheckoutProcessWithSingleShipment = () => { - cartPage.startCheckout(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); - }; -}); diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts new file mode 100644 index 00000000..98abf4ce --- /dev/null +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -0,0 +1,56 @@ +import { container } from '../../../support/utils/inversify/inversify.config'; +import { CartPage } from '../../../support/pages/yves'; +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); + const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); + const checkoutScenario: CheckoutScenario = container.get(CheckoutScenario); + + let staticFixtures: CheckoutStaticFixtures; + let dynamicFixtures: CheckoutSuite1DynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('guest customer should checkout to single shipment', (): void => { + cartPage.visit(); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 1); + cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 1); + + checkoutScenario.execute(true); + + cy.contains('Your order has been placed successfully!'); + }); + + it('guest customer should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { + cartPage.visit(); + cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 1); + cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 1); + + checkoutScenario.execute(true, true); + + cy.contains('Your order has been placed successfully!'); + }); + + it('customer should checkout to single shipment', (): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + + checkoutScenario.execute(); + + cy.contains('Your order has been placed successfully!'); + }); + + it('customer should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + + checkoutScenario.execute(false, true); + + cy.contains('Your order has been placed successfully!'); + }); +}); diff --git a/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts deleted file mode 100644 index a27f55bb..00000000 --- a/cypress/e2e/yves/comments/cart/empty-cart-comment.cy.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { container } from '../../../../support/utils/inversify/inversify.config'; -import { CommentCartPage } from '../../../../support/pages/yves'; -import { CustomerLoginScenario } from '../../../../support/scenarios/yves'; -import { CartCommentDynamicFixtures, CartCommentStaticFixtures } from '../../../../support/types/yves/comments/cart'; - -describe('empty cart comment', { tags: ['@comments'] }, (): void => { - const commentCartPage: CommentCartPage = container.get(CommentCartPage); - const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - - let dynamicFixtures: CartCommentDynamicFixtures; - let staticFixtures: CartCommentStaticFixtures; - - before((): void => { - ({ staticFixtures, dynamicFixtures } = Cypress.env()); - }); - - beforeEach((): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); - commentCartPage.visit(); - }); - - it('customer should be able to add comments to empty cart', (): void => { - staticFixtures.commentsToAdd.forEach((commentMessage) => { - commentCartPage.addComment(commentMessage); - - commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); - }); - }); - - it('customer should be able to modify comment in empty cart', (): void => { - commentCartPage.addComment(staticFixtures.commentToModify); - commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); - - commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); - }); - - it('customer should be able to remove comment in empty cart', (): void => { - commentCartPage.addComment(staticFixtures.commentsToRemove); - commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); - - commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist'); - }); -}); diff --git a/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts b/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts deleted file mode 100644 index dd337d6a..00000000 --- a/cypress/e2e/yves/comments/cart/not-empty-cart-comment.cy.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { container } from '../../../../support/utils/inversify/inversify.config'; -import { CommentCartPage } from '../../../../support/pages/yves'; -import { CustomerLoginScenario } from '../../../../support/scenarios/yves'; -import { CartCommentDynamicFixtures, CartCommentStaticFixtures } from '../../../../support/types/yves/comments/cart'; - -describe('not empty cart comment', { tags: ['@comments'] }, (): void => { - const commentCartPage: CommentCartPage = container.get(CommentCartPage); - const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - - let dynamicFixtures: CartCommentDynamicFixtures; - let staticFixtures: CartCommentStaticFixtures; - - before((): void => { - ({ staticFixtures, dynamicFixtures } = Cypress.env()); - }); - - beforeEach((): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); - commentCartPage.visit(); - }); - - it('customer should be able to add comments to cart', (): void => { - staticFixtures.commentsToAdd.forEach((commentMessage) => { - commentCartPage.addComment(commentMessage); - - commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); - }); - }); - - it('customer should be able to modify comment in cart', (): void => { - commentCartPage.addComment(staticFixtures.commentToModify); - commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); - - commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); - }); - - it('customer should be able to remove comment in cart', (): void => { - commentCartPage.addComment(staticFixtures.commentsToRemove); - commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); - - commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist'); - }); -}); diff --git a/cypress/e2e/yves/comments/comments-suite-1.cy.ts b/cypress/e2e/yves/comments/comments-suite-1.cy.ts new file mode 100644 index 00000000..a7cfe71e --- /dev/null +++ b/cypress/e2e/yves/comments/comments-suite-1.cy.ts @@ -0,0 +1,78 @@ +import { CommentCartPage, MultiCartPage } from '../../../support/pages/yves'; +import { CustomerLoginScenario } from '../../../support/scenarios/yves'; +import { container } from '../../../support/utils/inversify/inversify.config'; +import { + CommentsSuite1DynamicFixtures, + CommentsSuite1StaticFixtures, +} from '../../../support/types/yves/comments/fixture-types'; + +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); + + let dynamicFixtures: CommentsSuite1DynamicFixtures; + let staticFixtures: CommentsSuite1StaticFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + }); + + it('customer should be able to add comments to cart with items', (): void => { + multiCartPage.visit(); + multiCartPage.selectCart(dynamicFixtures.quote.name); + + commentCartPage.visit(); + staticFixtures.commentsToAdd.forEach((commentMessage) => { + commentCartPage.addComment(commentMessage); + commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); + }); + }); + + it('customer should be able to modify comment in cart with items', (): void => { + commentCartPage.visit(); + commentCartPage.addComment(staticFixtures.commentToModify); + commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); + }); + + it('customer should be able to remove comment in cart with items', (): void => { + commentCartPage.visit(); + commentCartPage.addComment(staticFixtures.commentsToRemove); + commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist'); + }); + + it('customer should be able to add comments to empty cart', (): void => { + multiCartPage.visit(); + multiCartPage.selectCart(dynamicFixtures.emptyQuote.name); + + commentCartPage.visit(); + staticFixtures.commentsToAdd.forEach((commentMessage) => { + commentCartPage.addComment(commentMessage); + commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist'); + }); + }); + + it('customer should be able to modify comment in empty cart', (): void => { + commentCartPage.visit(); + commentCartPage.addComment(staticFixtures.commentToModify); + commentCartPage.updateCommentByCommentText(staticFixtures.commentToModify, staticFixtures.modifiedComment); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist'); + }); + + it('customer should be able to remove comment in empty cart', (): void => { + commentCartPage.visit(); + commentCartPage.addComment(staticFixtures.commentsToRemove); + commentCartPage.removeCommentByCommentText(staticFixtures.commentsToRemove); + + commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist'); + }); +}); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts deleted file mode 100644 index d6073a31..00000000 --- a/cypress/e2e/yves/order-management/order/create-order-by-customer.cy.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { container } from '../../../../support/utils/inversify/inversify.config'; -import { - CreateOrderByCustomerDynamicFixtures, - CreateOrderByCustomerStaticFixtures, -} from '../../../../support/types/yves/order-managment/order'; -import { CustomerLoginScenario } from '../../../../support/scenarios/yves'; -import { - CartPage, - CheckoutAddressPage, - CheckoutPaymentPage, - CheckoutShipmentPage, - CheckoutSummaryPage, -} from '../../../../support/pages/yves'; - -describe('create order by customer', { tags: ['@order-management'] }, (): void => { - const cartPage: CartPage = container.get(CartPage); - const loginCustomerScenario: CustomerLoginScenario = container.get(CustomerLoginScenario); - const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); - const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); - const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); - const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); - - let staticFixtures: CreateOrderByCustomerStaticFixtures; - let dynamicFixtures: CreateOrderByCustomerDynamicFixtures; - - before((): void => { - ({ staticFixtures, dynamicFixtures } = Cypress.env()); - }); - - beforeEach((): void => { - loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.customer.password); - cartPage.visit(); - }); - - it('should be able to create an order by existing customer', (): void => { - cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); - cartPage.startCheckout(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); - - cy.contains('Your order has been placed successfully!'); - }); -}); diff --git a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts b/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts deleted file mode 100644 index fd2d5a97..00000000 --- a/cypress/e2e/yves/order-management/order/create-order-by-guest.cy.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { container } from '../../../../support/utils/inversify/inversify.config'; -import { CreateOrderByGuestDynamicFixtures } from '../../../../support/types/yves/order-managment/order'; -import { - CartPage, - CheckoutAddressPage, - CheckoutCustomerPage, - CheckoutPaymentPage, - CheckoutShipmentPage, - CheckoutSummaryPage, -} from '../../../../support/pages/yves'; - -describe('create order by guest', { tags: ['@order-management'] }, (): void => { - const cartPage: CartPage = container.get(CartPage); - const checkoutCustomerPage: CheckoutCustomerPage = container.get(CheckoutCustomerPage); - const checkoutAddressPage: CheckoutAddressPage = container.get(CheckoutAddressPage); - const checkoutShipmentPage: CheckoutShipmentPage = container.get(CheckoutShipmentPage); - const checkoutPaymentPage: CheckoutPaymentPage = container.get(CheckoutPaymentPage); - const checkoutSummaryPage: CheckoutSummaryPage = container.get(CheckoutSummaryPage); - - let dynamicFixtures: CreateOrderByGuestDynamicFixtures; - - before((): void => { - cy.resetYvesCookies(); - dynamicFixtures = Cypress.env('dynamicFixtures'); - }); - - it('should be able to create an order by guest', (): void => { - cartPage.visit(); - cartPage.quickAddToCart(dynamicFixtures.product.sku, 1); - cartPage.startCheckout(); - checkoutCustomerPage.checkoutAsGuest(); - checkoutAddressPage.fillShippingAddress(); - checkoutShipmentPage.setStandardShippingMethod(); - checkoutPaymentPage.setDummyPaymentMethod(); - checkoutSummaryPage.placeOrder(); - - cy.contains('Your order has been placed successfully!'); - }); -}); diff --git a/cypress/fixtures/b2b/yves/cart/comment/dynamic/empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/dynamic/empty-cart-comment.json deleted file mode 100644 index 60103304..00000000 --- a/cypress/fixtures/b2b/yves/cart/comment/dynamic/empty-cart-comment.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "synchronize": true, - "operations": [ - { - "type": "transfer", - "name": "LocaleTransfer", - "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } - }, - { - "type": "helper", - "name": "haveCustomer", - "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] - }, - { - "type": "helper", - "name": "confirmCustomer", - "key": "confirmedCustomer", - "arguments": ["#customer"] - }, - { - "type": "helper", - "name": "haveFullProduct", - "key": "product", - "arguments": [] - }, - { - "type": "helper", - "name": "havePersistentQuote", - "key": "quote", - "arguments": [ - { - "customer": "#customer" - } - ] - } - ] - } - } -} diff --git a/cypress/fixtures/b2b/yves/cart/comment/dynamic/not-empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/dynamic/not-empty-cart-comment.json deleted file mode 100644 index 557eeb71..00000000 --- a/cypress/fixtures/b2b/yves/cart/comment/dynamic/not-empty-cart-comment.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "synchronize": true, - "operations": [ - { - "type": "transfer", - "name": "LocaleTransfer", - "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } - }, - { - "type": "helper", - "name": "haveCustomer", - "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] - }, - { - "type": "helper", - "name": "confirmCustomer", - "key": "confirmedCustomer", - "arguments": ["#customer"] - }, - { - "type": "helper", - "name": "haveFullProduct", - "key": "product", - "arguments": [] - }, - { - "type": "helper", - "name": "havePersistentQuote", - "key": "quote", - "arguments": [ - { - "customer": "#customer", - "items": [ - { - "sku": "#product.sku", - "quantity": 1 - } - ] - } - ] - } - ] - } - } -} diff --git a/cypress/fixtures/b2b/yves/cart/comment/static/empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/static/empty-cart-comment.json deleted file mode 100644 index f367949b..00000000 --- a/cypress/fixtures/b2b/yves/cart/comment/static/empty-cart-comment.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "commentsToAdd": [ - "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", - "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." - ], - "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", - "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", - "commentsToRemove": "The app is so slow. It takes forever to load the product images.", - "customer": { - "password": "change123" - } -} diff --git a/cypress/fixtures/b2b/yves/cart/comment/static/not-empty-cart-comment.json b/cypress/fixtures/b2b/yves/cart/comment/static/not-empty-cart-comment.json deleted file mode 100644 index f367949b..00000000 --- a/cypress/fixtures/b2b/yves/cart/comment/static/not-empty-cart-comment.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "commentsToAdd": [ - "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", - "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." - ], - "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", - "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", - "commentsToRemove": "The app is so slow. It takes forever to load the product images.", - "customer": { - "password": "change123" - } -} diff --git a/cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json similarity index 85% rename from cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json rename to cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json index ffe8b706..ad0249b8 100644 --- a/cypress/fixtures/suite/yves/comments/cart/dynamic/not-empty-cart-comment.json +++ b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json @@ -101,14 +101,13 @@ ] }, { - "type": "builder", - "name": "ProductImageBuilder", - "key": "productImageOne" - }, - { - "type": "builder", - "name": "ProductImageBuilder", - "key": "productImageTwo" + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } }, { "type": "helper", @@ -118,7 +117,7 @@ "name": "default", "idProduct": "#productOne.id_product_concrete", "idProductAbstract": "#productOne.fk_product_abstract", - "productImages": ["#productImageOne"] + "productImages": ["#productImage"] } ] }, @@ -130,7 +129,7 @@ "name": "default", "idProduct": "#productTwo.id_product_concrete", "idProductAbstract": "#productTwo.fk_product_abstract", - "productImages": ["#productImageTwo"] + "productImages": ["#productImage"] } ] }, @@ -155,6 +154,16 @@ ] } ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "emptyQuote", + "arguments": [ + { + "customer": "#customer" + } + ] } ] } diff --git a/cypress/fixtures/suite/yves/comments/cart/static/not-empty-cart-comment.json b/cypress/fixtures/b2b/yves/comments/static/comments-suite-1.json similarity index 88% rename from cypress/fixtures/suite/yves/comments/cart/static/not-empty-cart-comment.json rename to cypress/fixtures/b2b/yves/comments/static/comments-suite-1.json index f367949b..05511e65 100644 --- a/cypress/fixtures/suite/yves/comments/cart/static/not-empty-cart-comment.json +++ b/cypress/fixtures/b2b/yves/comments/static/comments-suite-1.json @@ -1,12 +1,10 @@ { + "defaultPassword": "change123", "commentsToAdd": [ "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." ], "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", - "commentsToRemove": "The app is so slow. It takes forever to load the product images.", - "customer": { - "password": "change123" - } + "commentsToRemove": "The app is so slow. It takes forever to load the product images." } diff --git a/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json b/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json deleted file mode 100644 index a09c7156..00000000 --- a/cypress/fixtures/suite/backoffice/marketplace-agent-assist/dynamic/agent-permission-in-backoffice.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "operations": [ - { - "type": "helper", - "name": "haveUser", - "key": "rootUser", - "arguments": [ - { - "password": "change123" - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#rootUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "merchantAgentUser", - "arguments": [ - { - "password": "change123", - "isMerchantAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#merchantAgentUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "customerAgentUser", - "arguments": [ - { - "password": "change123", - "isAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#customerAgentUser.id_user", 1] - } - ] - } - } -} diff --git a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json b/cypress/fixtures/suite/backoffice/order-management/dynamic/order-management-suite-1.json similarity index 74% rename from cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json rename to cypress/fixtures/suite/backoffice/order-management/dynamic/order-management-suite-1.json index 15aa0ecb..5ab76c19 100644 --- a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-customer.json +++ b/cypress/fixtures/suite/backoffice/order-management/dynamic/order-management-suite-1.json @@ -91,6 +91,40 @@ "isNeverOutOfStock": "1" } ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "name": "#product.name", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] } ] } diff --git a/cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json b/cypress/fixtures/suite/backoffice/order-management/static/order-management-suite-1.json similarity index 100% rename from cypress/fixtures/suite/backoffice/marketplace-agent-assist/static/agent-permission-in-backoffice.json rename to cypress/fixtures/suite/backoffice/order-management/static/order-management-suite-1.json diff --git a/cypress/fixtures/suite/yves/order-management/return/dynamic/create-return-by-user.json b/cypress/fixtures/suite/backoffice/return-management/dynamic/return-management-suite-1.json similarity index 100% rename from cypress/fixtures/suite/yves/order-management/return/dynamic/create-return-by-user.json rename to cypress/fixtures/suite/backoffice/return-management/dynamic/return-management-suite-1.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.json b/cypress/fixtures/suite/backoffice/return-management/static/return-management-suite-1.json similarity index 100% rename from cypress/fixtures/suite/mp/marketplace-agent-assist/static/customer-agent-login-page.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/customer-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json deleted file mode 100644 index 7d3d68f4..00000000 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/customer-agent-login-page.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "operations": [ - { - "type": "helper", - "name": "haveUser", - "key": "rootUser", - "arguments": [ - { - "password": "change123" - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#rootUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "merchantAgentUser", - "arguments": [ - { - "password": "change123", - "isMerchantAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#merchantAgentUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "customerAgentUser", - "arguments": [ - { - "password": "change123", - "isAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#customerAgentUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "merchantUser", - "arguments": [ - { - "password": "change123" - } - ] - }, - { - "type": "transfer", - "name": "MerchantProfileTransfer", - "key": "merchantProfile" - }, - { - "type": "helper", - "name": "haveMerchant", - "key": "merchant", - "arguments": [ - { - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - } - ] - }, - { - "type": "helper", - "name": "haveMerchantUserWithAclEntities", - "arguments": ["#merchant", "#merchantUser"] - } - ] - } - } -} 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 new file mode 100644 index 00000000..0ea2a9be --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/marketplace-agent-assist-suite-1.json @@ -0,0 +1,285 @@ +{ + "data": { + "type": "test-operation-runner", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [ + { + "password": "change123", + "isMerchantAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "customerAgentUser", + "arguments": [ + { + "password": "change123", + "isAgent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#customerAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "deactivatedMerchantUser", + "arguments": [ + { + "password": "change123", + "status": "blocked" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "deletedMerchantUser", + "arguments": [ + { + "password": "change123", + "status": "deleted" + } + ] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "arrayObject", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [ + { + "merchantProfile": "#merchantProfile", + "isActive": true, + "status": "approved", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#deactivatedMerchantUser"] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#deletedMerchantUser"] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "inactiveApprovedMerchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "inactiveApprovedMerchant", + "arguments": [ + { + "merchantProfile": "#inactiveApprovedMerchantProfile", + "isActive": false, + "status": "approved", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUserFromInactiveApprovedMerchant", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#inactiveApprovedMerchant", "#merchantUserFromInactiveApprovedMerchant"] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "activeDeniedMerchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "activeDeniedMerchant", + "arguments": [ + { + "merchantProfile": "#activeDeniedMerchantProfile", + "isActive": true, + "status": "denied", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUserFromActiveDeniedMerchant", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#activeDeniedMerchant", "#merchantUserFromActiveDeniedMerchant"] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "inactiveDeniedMerchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "inactiveDeniedMerchant", + "arguments": [ + { + "merchantProfile": "#inactiveDeniedMerchantProfile", + "isActive": false, + "status": "denied", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUserFromInactiveDeniedMerchant", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#inactiveDeniedMerchant", "#merchantUserFromInactiveDeniedMerchant"] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-impersonation.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/merchant-user-impersonation.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/dynamic/merchant-user-agent-dashboard.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json deleted file mode 100644 index 0522e27c..00000000 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-dashboard.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "operations": [ - { - "type": "helper", - "name": "haveUser", - "key": "rootUser", - "arguments": [ - { - "password": "change123" - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#rootUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "merchantAgentUser", - "arguments": [ - { - "password": "change123", - "isMerchantAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#merchantAgentUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "merchantUser", - "arguments": [ - { - "password": "change123" - } - ] - }, - { - "type": "transfer", - "name": "MerchantProfileTransfer", - "key": "merchantProfile" - }, - { - "type": "helper", - "name": "haveMerchant", - "key": "merchant", - "arguments": [ - { - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - } - ] - }, - { - "type": "helper", - "name": "haveMerchantUserWithAclEntities", - "arguments": ["#merchant", "#merchantUser"] - } - ] - } - } -} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json deleted file mode 100644 index 5852af05..00000000 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-agent-login-page.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "operations": [ - { - "type": "helper", - "name": "haveUser", - "key": "merchantAgentUser", - "arguments": [ - { - "password": "change123", - "isMerchantAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#merchantAgentUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "customerAgentUser", - "arguments": [ - { - "password": "change123", - "isAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#customerAgentUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "merchantUser", - "arguments": [ - { - "password": "change123" - } - ] - }, - { - "type": "transfer", - "name": "MerchantProfileTransfer", - "key": "merchantProfile" - }, - { - "type": "helper", - "name": "haveMerchant", - "key": "merchant", - "arguments": [ - { - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - } - ] - }, - { - "type": "helper", - "name": "haveMerchantUserWithAclEntities", - "arguments": ["#merchant", "#merchantUser"] - } - ] - } - } -} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json deleted file mode 100644 index 63bbce9c..00000000 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic/merchant-user-header-bar.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "operations": [ - { - "type": "helper", - "name": "haveUser", - "key": "merchantAgentUser", - "arguments": [ - { - "password": "change123", - "isMerchantAgent": true - } - ] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#merchantAgentUser.id_user", 1] - }, - { - "type": "helper", - "name": "haveUser", - "key": "merchantUser", - "arguments": [ - { - "password": "change123" - } - ] - }, - { - "type": "transfer", - "name": "MerchantProfileTransfer", - "key": "merchantProfile" - }, - { - "type": "helper", - "name": "haveMerchant", - "key": "merchant", - "arguments": [ - { - "merchant_profile": "#merchantProfile", - "is_active": true, - "status": "approved" - } - ] - }, - { - "type": "helper", - "name": "haveMerchantUserWithAclEntities", - "arguments": ["#merchant", "#merchantUser"] - } - ] - } - } -} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-agent-dashboard.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/merchant-user-agent-dashboard.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/merchant-user-agent-login-page.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/merchant-user-agent-login-page.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/static/marketplace-agent-assist-suite-2.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json deleted file mode 100644 index ba4339e8..00000000 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-impersonation.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultPassword": "change123" -} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json similarity index 59% rename from cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json rename to cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json index b966fb37..b7ae5486 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-guest-customer.json +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json @@ -12,6 +12,32 @@ "id_store": 1 } }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#locale", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "confirmCustomer", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, { "type": "helper", "name": "haveFullProduct", @@ -110,6 +136,58 @@ "isNeverOutOfStock": "1" } ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quoteOne", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#productOne.sku", + "abstractSku": "#productOne.abstract_sku", + "name": "#productOne.name", + "quantity": 1, + "unitPrice": 30000 + }, + { + "sku": "#productTwo.sku", + "abstractSku": "#productTwo.abstract_sku", + "name": "#productTwo.name", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quoteTwo", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#productOne.sku", + "abstractSku": "#productOne.abstract_sku", + "name": "#productOne.name", + "quantity": 1, + "unitPrice": 30000 + }, + { + "sku": "#productTwo.sku", + "abstractSku": "#productTwo.abstract_sku", + "name": "#productTwo.name", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] } ] } diff --git a/cypress/fixtures/suite/yves/checkout/static/checkout-by-logged-in-customer.json b/cypress/fixtures/suite/yves/checkout/static/checkout-by-logged-in-customer.json deleted file mode 100644 index 46ebaa8b..00000000 --- a/cypress/fixtures/suite/yves/checkout/static/checkout-by-logged-in-customer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "customer": { - "password": "change123" - } -} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json b/cypress/fixtures/suite/yves/checkout/static/checkout-suite-1.json similarity index 100% rename from cypress/fixtures/suite/mp/marketplace-agent-assist/static/merchant-user-header-bar.json rename to cypress/fixtures/suite/yves/checkout/static/checkout-suite-1.json diff --git a/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json deleted file mode 100644 index 7c533a90..00000000 --- a/cypress/fixtures/suite/yves/comments/cart/dynamic/empty-cart-comment.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "synchronize": true, - "operations": [ - { - "type": "transfer", - "name": "LocaleTransfer", - "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } - }, - { - "type": "helper", - "name": "haveCustomer", - "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] - }, - { - "type": "helper", - "name": "confirmCustomer", - "key": "confirmedCustomer", - "arguments": ["#customer"] - }, - { - "type": "helper", - "name": "haveFullProduct", - "key": "product", - "arguments": [] - }, - { - "type": "transfer", - "name": "ProductImageTransfer", - "key": "productImage", - "arguments": { - "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", - "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" - } - }, - { - "type": "helper", - "name": "haveProductImageSet", - "arguments": [ - { - "name": "default", - "idProduct": "#product.id_product_concrete", - "idProductAbstract": "#product.fk_product_abstract", - "productImages": ["#productImage"] - } - ] - }, - { - "type": "helper", - "name": "havePersistentQuote", - "key": "quote", - "arguments": [ - { - "customer": "#customer" - } - ] - } - ] - } - } -} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json similarity index 81% rename from cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json rename to cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json index 74116656..ad0249b8 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-by-logged-in-customer.json +++ b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json @@ -4,14 +4,6 @@ "attributes": { "synchronize": true, "operations": [ - { - "type": "transfer", - "name": "StoreTransfer", - "key": "store", - "arguments": { - "id_store": 1 - } - }, { "type": "transfer", "name": "LocaleTransfer", @@ -38,32 +30,19 @@ "key": "confirmedCustomer", "arguments": ["#customer"] }, - { - "type": "helper", - "name": "haveFullProduct", - "key": "productOne", - "arguments": [] - }, { "type": "transfer", - "name": "ProductImageTransfer", - "key": "productImage", + "name": "StoreTransfer", + "key": "store", "arguments": { - "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", - "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + "id_store": 1 } }, { "type": "helper", - "name": "haveProductImageSet", - "arguments": [ - { - "name": "default", - "idProduct": "#productOne.id_product_concrete", - "idProductAbstract": "#productOne.fk_product_abstract", - "productImages": ["#productImage"] - } - ] + "name": "haveFullProduct", + "key": "productOne", + "arguments": [] }, { "type": "helper", @@ -71,22 +50,9 @@ "key": "productTwo", "arguments": [] }, - { - "type": "helper", - "name": "haveProductImageSet", - "arguments": [ - { - "name": "default", - "idProduct": "#productTwo.id_product_concrete", - "idProductAbstract": "#productTwo.fk_product_abstract", - "productImages": ["#productImage"] - } - ] - }, { "type": "helper", "name": "havePriceProduct", - "key": "productOneWithPrice", "arguments": [ { "skuProductAbstract": "#productOne.abstract_sku", @@ -101,7 +67,6 @@ { "type": "helper", "name": "havePriceProduct", - "key": "productTwoWithPrice", "arguments": [ { "skuProductAbstract": "#productTwo.abstract_sku", @@ -116,7 +81,6 @@ { "type": "helper", "name": "haveProductInStockForStore", - "key": "productOneWithPriceAndStore", "arguments": [ "#store", { @@ -128,7 +92,6 @@ { "type": "helper", "name": "haveProductInStockForStore", - "key": "productTwoWithPriceAndStore", "arguments": [ "#store", { @@ -136,6 +99,71 @@ "isNeverOutOfStock": "1" } ] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productOne.id_product_concrete", + "idProductAbstract": "#productOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productTwo.id_product_concrete", + "idProductAbstract": "#productTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#productOne.sku", + "abstractSku": "#productOne.abstract_sku", + "quantity": 1 + }, + { + "sku": "#productTwo.sku", + "abstractSku": "#productTwo.abstract_sku", + "quantity": 2 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "emptyQuote", + "arguments": [ + { + "customer": "#customer" + } + ] } ] } diff --git a/cypress/fixtures/suite/yves/comments/cart/static/empty-cart-comment.json b/cypress/fixtures/suite/yves/comments/static/comments-suite-1.json similarity index 88% rename from cypress/fixtures/suite/yves/comments/cart/static/empty-cart-comment.json rename to cypress/fixtures/suite/yves/comments/static/comments-suite-1.json index f367949b..05511e65 100644 --- a/cypress/fixtures/suite/yves/comments/cart/static/empty-cart-comment.json +++ b/cypress/fixtures/suite/yves/comments/static/comments-suite-1.json @@ -1,12 +1,10 @@ { + "defaultPassword": "change123", "commentsToAdd": [ "Had a great experience shopping from your app. It's user-friendly and makes shopping on the go so easy!", "The loyalty program is fantastic. It really makes me feel appreciated as a regular customer." ], "commentToModify": "I'm not happy with the quality of the products. I've had to return a few items already.", "modifiedComment": "The customer service team was very helpful in processing my returns. I'm happy with the service, but I hope the quality of the products improves.", - "commentsToRemove": "The app is so slow. It takes forever to load the product images.", - "customer": { - "password": "change123" - } + "commentsToRemove": "The app is so slow. It takes forever to load the product images." } diff --git a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json b/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json deleted file mode 100644 index 206c8187..00000000 --- a/cypress/fixtures/suite/yves/order-management/order/dynamic/create-order-by-guest.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "data": { - "type": "test-operation-runner", - "attributes": { - "synchronize": true, - "operations": [ - { - "type": "transfer", - "name": "StoreTransfer", - "key": "store", - "arguments": { - "id_store": 1 - } - }, - { - "type": "helper", - "name": "haveFullProduct", - "key": "product", - "arguments": [] - }, - { - "type": "transfer", - "name": "ProductImageTransfer", - "key": "productImage", - "arguments": { - "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", - "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" - } - }, - { - "type": "helper", - "name": "haveProductImageSet", - "arguments": [ - { - "name": "default", - "idProduct": "#product.id_product_concrete", - "idProductAbstract": "#product.fk_product_abstract", - "productImages": ["#productImage"] - } - ] - }, - { - "type": "helper", - "name": "havePriceProduct", - "key": "productWithPrice", - "arguments": [ - { - "skuProductAbstract": "#product.abstract_sku", - "skuProduct": "#product.sku", - "moneyValue": { - "netAmount": 50000, - "grossAmount": 50000 - } - } - ] - }, - { - "type": "helper", - "name": "haveProductInStockForStore", - "key": "productWithPriceAndStore", - "arguments": [ - "#store", - { - "sku": "#product.sku", - "isNeverOutOfStock": "1" - } - ] - } - ] - } - } -} diff --git a/cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json b/cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json deleted file mode 100644 index 46ebaa8b..00000000 --- a/cypress/fixtures/suite/yves/order-management/order/static/create-order-by-customer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "customer": { - "password": "change123" - } -} diff --git a/cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json b/cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json deleted file mode 100644 index ba4339e8..00000000 --- a/cypress/fixtures/suite/yves/order-management/return/static/create-return-by-user.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultPassword": "change123" -} 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 297e7f06..84120ce8 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -28,12 +28,12 @@ export class AgentDashboardPage extends MpPage { }); }; - public findMerchantUser = (query: string): Cypress.Chainable => { + public findMerchantUser = (query: string, counter: number = 1): Cypress.Chainable => { cy.get(this.repository.getSearchSelector()).clear().type(query); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/agent-dashboard-merchant-portal-gui/merchant-users/table-data**').as(interceptAlias); - cy.wait(`@${interceptAlias}`).its('response.body.total').should('eq', 1); + cy.wait(`@${interceptAlias}`).its('response.body.total').should('eq', counter); return this.repository.getFirstTableRow(); }; 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 f59abe25..deff202c 100644 --- a/cypress/support/pages/yves/agent-login/agent-login-page.ts +++ b/cypress/support/pages/yves/agent-login/agent-login-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../yves-page'; export class AgentLoginPage extends YvesPage { protected PAGE_URL: string = '/agent/login'; - constructor(@inject(TYPES.YvesAgentLoginRepository) private repository: AgentLoginRepository) { + constructor(@inject(TYPES.AgentLoginRepository) private repository: AgentLoginRepository) { super(); } diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index 1f477e3e..cc7df5a3 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../yves-page'; export class CartPage extends YvesPage { protected PAGE_URL: string = '/cart'; - constructor(@inject(TYPES.YvesCartRepository) private repository: CartRepository) { + constructor(@inject(TYPES.CartRepository) private repository: CartRepository) { super(); } 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 c142e9d8..f5fcd46c 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -11,7 +11,7 @@ import { YvesPage } from '../../yves-page'; export class CheckoutAddressPage extends YvesPage { protected PAGE_URL: string = '/checkout/address'; - constructor(@inject(TYPES.YvesCheckoutAddressRepository) private repository: CheckoutAddressRepository) { + constructor(@inject(TYPES.CheckoutAddressRepository) private repository: CheckoutAddressRepository) { super(); } 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 68ba0e14..c15638f9 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../../yves-page'; export class CheckoutCustomerPage extends YvesPage { protected PAGE_URL: string = '/checkout/customer'; - constructor(@inject(TYPES.YvesCheckoutCustomerRepository) private repository: CheckoutCustomerRepository) { + constructor(@inject(TYPES.CheckoutCustomerRepository) private repository: CheckoutCustomerRepository) { super(); } 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 252c7c42..17eebe72 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../../yves-page'; export class CheckoutPaymentPage extends YvesPage { protected PAGE_URL: string = '/checkout/payment'; - constructor(@inject(TYPES.YvesCheckoutPaymentRepository) private repository: CheckoutPaymentRepository) { + constructor(@inject(TYPES.CheckoutPaymentRepository) private repository: CheckoutPaymentRepository) { super(); } 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 304743b8..2955fd85 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../../yves-page'; export class CheckoutShipmentPage extends YvesPage { protected PAGE_URL: string = '/checkout/shipment'; - constructor(@inject(TYPES.YvesCheckoutShipmentRepository) private repository: CheckoutShipmentRepository) { + constructor(@inject(TYPES.CheckoutShipmentRepository) private repository: CheckoutShipmentRepository) { super(); } 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 2897d251..16c2c768 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../../yves-page'; export class CheckoutSummaryPage extends YvesPage { protected PAGE_URL: string = '/checkout/summary'; - constructor(@inject(TYPES.YvesCheckoutSummaryRepository) private repository: CheckoutSummaryRepository) { + constructor(@inject(TYPES.CheckoutSummaryRepository) private repository: CheckoutSummaryRepository) { super(); } 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 f39e9dd0..6d291dfc 100644 --- a/cypress/support/pages/yves/comment/cart/comment-cart-page.ts +++ b/cypress/support/pages/yves/comment/cart/comment-cart-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../../yves-page'; export class CommentCartPage extends YvesPage { protected PAGE_URL: string = '/cart'; - constructor(@inject(TYPES.YvesCommentCartRepository) private repository: CommentCartRepository) { + constructor(@inject(TYPES.CommentCartRepository) private repository: CommentCartRepository) { super(); } diff --git a/cypress/support/pages/yves/login/login-page.ts b/cypress/support/pages/yves/login/login-page.ts index 3c4dff85..247908dc 100644 --- a/cypress/support/pages/yves/login/login-page.ts +++ b/cypress/support/pages/yves/login/login-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../yves-page'; export class LoginPage extends YvesPage { protected PAGE_URL: string = '/login'; - constructor(@inject(TYPES.YvesLoginRepository) private repository: LoginRepository) { + constructor(@inject(TYPES.LoginRepository) private repository: LoginRepository) { super(); } 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 182b682b..6b1c2ada 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -10,7 +10,7 @@ import { YvesPage } from '../yves-page'; export class MultiCartPage extends YvesPage { protected PAGE_URL: string = '/multi-cart'; - constructor(@inject(TYPES.YvesMultiCartRepository) private repository: MultiCartRepository) { + constructor(@inject(TYPES.MultiCartRepository) private repository: MultiCartRepository) { super(); } diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index a47fba5e..01be286e 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -5,6 +5,7 @@ import { CliHelper } from '../../helpers/cli-helper'; import { CartPage, CheckoutAddressPage, + CheckoutCustomerPage, CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, @@ -16,21 +17,37 @@ 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 ) {} - public execute = (): void => { + public execute = (isGuest: boolean = false, isMultiShipment: boolean = false): void => { this.cartPage.visit(); - this.cartPage.startCheckout(); - this.checkoutAddressPage.fillShippingAddress(); + + if (isGuest) { + this.checkoutCustomerPage.checkoutAsGuest(); + } + + this.fillShippingAddress(isMultiShipment); this.checkoutShipmentPage.setStandardShippingMethod(); this.checkoutPaymentPage.setDummyMarketplacePaymentMethod(); this.checkoutSummaryPage.placeOrder(); + cy.wait(1000); // Wait for OMS to process the order this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; + + private fillShippingAddress = (isMultiShipment: boolean = false): void => { + if (isMultiShipment) { + this.checkoutAddressPage.fillMultiShippingAddress(); + + return; + } + + this.checkoutAddressPage.fillShippingAddress(); + }; } diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 55eb2a38..38ec1a7a 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -5,6 +5,7 @@ import { CliHelper } from '../../helpers/cli-helper'; import { CartPage, CheckoutAddressPage, + CheckoutCustomerPage, CheckoutPaymentPage, CheckoutShipmentPage, CheckoutSummaryPage, @@ -16,21 +17,37 @@ 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 ) {} - public execute = (): void => { + public execute = (isGuest: boolean = false, isMultiShipment: boolean = false): void => { this.cartPage.visit(); - this.cartPage.startCheckout(); - this.checkoutAddressPage.fillShippingAddress(); + + if (isGuest) { + this.checkoutCustomerPage.checkoutAsGuest(); + } + + this.fillShippingAddress(isMultiShipment); this.checkoutShipmentPage.setStandardShippingMethod(); this.checkoutPaymentPage.setDummyPaymentMethod(); this.checkoutSummaryPage.placeOrder(); + cy.wait(1000); this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; + + private fillShippingAddress = (isMultiShipment: boolean = false): void => { + if (isMultiShipment) { + this.checkoutAddressPage.fillMultiShippingAddress(); + + return; + } + + this.checkoutAddressPage.fillShippingAddress(); + }; } diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts b/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts deleted file mode 100644 index 2e6ce2de..00000000 --- a/cypress/support/types/backoffice/marketplace-agent-assist/dynamic-fixture-types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface AgentPermissionInBackofficeDynamicFixtures { - rootUser: User; - merchantAgentUser: User; - customerAgentUser: User; -} - -interface User { - username: string; -} diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/index.ts b/cypress/support/types/backoffice/marketplace-agent-assist/index.ts deleted file mode 100644 index 368fb45a..00000000 --- a/cypress/support/types/backoffice/marketplace-agent-assist/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './static-fixture-types'; -export * from './dynamic-fixture-types'; diff --git a/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts b/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts deleted file mode 100644 index 528bc66f..00000000 --- a/cypress/support/types/backoffice/marketplace-agent-assist/static-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface AgentPermissionInBackofficeStaticFixtures { - defaultPassword: string; -} diff --git a/cypress/support/types/backoffice/order-managment/fixture-types.ts b/cypress/support/types/backoffice/order-managment/fixture-types.ts new file mode 100644 index 00000000..d9b1a794 --- /dev/null +++ b/cypress/support/types/backoffice/order-managment/fixture-types.ts @@ -0,0 +1,11 @@ +import { Customer, Product, User } from './transfer/transfer-types'; + +export interface OrderManagementSuite1DynamicFixtures { + customer: Customer; + product: Product; + rootUser: User; +} + +export interface OrderManagementStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts b/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts new file mode 100644 index 00000000..f49145d6 --- /dev/null +++ b/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts @@ -0,0 +1,12 @@ +export interface Customer { + email: string; +} + +export interface Product { + sku: string; + name: string; +} + +export interface User { + username: string; +} diff --git a/cypress/support/types/backoffice/return-managment/fixture-types.ts b/cypress/support/types/backoffice/return-managment/fixture-types.ts new file mode 100644 index 00000000..b9169f9d --- /dev/null +++ b/cypress/support/types/backoffice/return-managment/fixture-types.ts @@ -0,0 +1,13 @@ +import { Customer, Product, Quote, User } from './transfer/transfer-types'; + +export interface ReturnManagementSuite1DynamicFixtures { + rootUser: User; + customer: Customer; + product: Product; + quoteOne: Quote; + quoteTwo: Quote; +} + +export interface ReturnManagementStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts b/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts new file mode 100644 index 00000000..41cc8b9f --- /dev/null +++ b/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts @@ -0,0 +1,15 @@ +export interface Customer { + email: string; +} + +export interface Product { + sku: string; +} + +export interface User { + username: string; +} + +export interface Quote { + name: string; +} diff --git a/cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts b/cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts deleted file mode 100644 index f8fc6902..00000000 --- a/cypress/support/types/mp/marketplace-agent-assist/dynamic-fixture-types.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface CustomerAgentLoginPageDynamicFixtures { - rootUser: User; - merchantAgentUser: User; - customerAgentUser: User; - merchantUser: User; -} - -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/fixture-types.ts new file mode 100644 index 00000000..ec795181 --- /dev/null +++ b/cypress/support/types/mp/marketplace-agent-assist/fixture-types.ts @@ -0,0 +1,28 @@ +import { Customer, Merchant, ProductConcrete, ProductOffer, User } from './transfer/transfer-types'; + +export interface MarketplaceAgentAssistSuite1DynamicFixtures { + rootUser: User; + merchantAgentUser: User; + customerAgentUser: User; + merchant: Merchant; + merchantUser: User; + deletedMerchantUser: User; + deactivatedMerchantUser: User; + merchantUserFromActiveDeniedMerchant: User; + merchantUserFromInactiveApprovedMerchant: User; + merchantUserFromInactiveDeniedMerchant: User; +} + +export interface MarketplaceAgentAssistSuite2DynamicFixtures { + rootUser: User; + merchantAgentUser: User; + merchantUser: User; + customer: Customer; + productConcreteForOffer: ProductConcrete; + productConcreteForMerchant: ProductConcrete; + productOffer: ProductOffer; +} + +export interface MarketplaceAgentAssistStaticFixtures { + defaultPassword: string; +} 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 cfc6ac0c..00000000 --- a/cypress/support/types/mp/marketplace-agent-assist/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts b/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts deleted file mode 100644 index 73623dae..00000000 --- a/cypress/support/types/mp/marketplace-agent-assist/static-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface CustomerAgentLoginPageStaticFixtures { - defaultPassword: string; -} 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 new file mode 100644 index 00000000..c263a57d --- /dev/null +++ b/cypress/support/types/mp/marketplace-agent-assist/transfer/transfer-types.ts @@ -0,0 +1,22 @@ +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/merchant-user-agent-dashboard/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts deleted file mode 100644 index 580fe8d8..00000000 --- a/cypress/support/types/mp/merchant-user-agent-dashboard/dynamic-fixture-types.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface MerchantUserAgentDashboardDynamicFixtures { - rootUser: User; - merchantAgentUser: User; - merchantUser: User; - merchant: Merchant; -} - -interface User { - username: string; -} - -interface Merchant { - name: string; -} diff --git a/cypress/support/types/mp/merchant-user-agent-dashboard/index.ts b/cypress/support/types/mp/merchant-user-agent-dashboard/index.ts deleted file mode 100644 index cfc6ac0c..00000000 --- a/cypress/support/types/mp/merchant-user-agent-dashboard/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts deleted file mode 100644 index 9e0d9f22..00000000 --- a/cypress/support/types/mp/merchant-user-agent-dashboard/static-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface MerchantUserAgentDashboardStaticFixtures { - defaultPassword: string; -} diff --git a/cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts deleted file mode 100644 index d9ebb479..00000000 --- a/cypress/support/types/mp/merchant-user-agent-login-page/dynamic-fixture-types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface MerchantUserAgentLoginPageDynamicFixtures { - merchantAgentUser: User; - customerAgentUser: User; - merchantUser: User; -} - -interface User { - username: string; -} diff --git a/cypress/support/types/mp/merchant-user-agent-login-page/index.ts b/cypress/support/types/mp/merchant-user-agent-login-page/index.ts deleted file mode 100644 index cfc6ac0c..00000000 --- a/cypress/support/types/mp/merchant-user-agent-login-page/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts deleted file mode 100644 index bd1aa6da..00000000 --- a/cypress/support/types/mp/merchant-user-agent-login-page/static-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface MerchantUserAgentLoginPageStaticFixtures { - defaultPassword: string; -} diff --git a/cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts deleted file mode 100644 index 7267f141..00000000 --- a/cypress/support/types/mp/merchant-user-header-bar/dynamic-fixture-types.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface MerchantUserHeaderBarDynamicFixtures { - merchantAgentUser: User; - merchantUser: User; - merchant: Merchant; -} - -interface User { - username: string; - first_name: string; - last_name: string; -} - -interface Merchant { - name: string; -} diff --git a/cypress/support/types/mp/merchant-user-header-bar/index.ts b/cypress/support/types/mp/merchant-user-header-bar/index.ts deleted file mode 100644 index cfc6ac0c..00000000 --- a/cypress/support/types/mp/merchant-user-header-bar/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts deleted file mode 100644 index 080aa189..00000000 --- a/cypress/support/types/mp/merchant-user-header-bar/static-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface MerchantUserHeaderBarStaticFixtures { - defaultPassword: string; -} diff --git a/cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts b/cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts deleted file mode 100644 index 322272b9..00000000 --- a/cypress/support/types/mp/merchant-user-impersonation/dynamic-fixture-types.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface MerchantUserImpersonationDynamicFixtures { - rootUser: User; - merchantAgentUser: User; - merchantUser: User; - customer: Customer; - productConcreteForOffer: ProductConcrete; - productConcreteForMerchant: ProductConcrete; - productOffer: ProductOffer; -} - -interface Customer { - email: string; -} - -interface User { - username: string; - first_name: string; - last_name: string; -} - -interface ProductConcrete { - sku: string; - abstract_sku: string; -} - -interface ProductOffer { - product_offer_reference: string; -} diff --git a/cypress/support/types/mp/merchant-user-impersonation/index.ts b/cypress/support/types/mp/merchant-user-impersonation/index.ts deleted file mode 100644 index cfc6ac0c..00000000 --- a/cypress/support/types/mp/merchant-user-impersonation/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts b/cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts deleted file mode 100644 index 11f8ef57..00000000 --- a/cypress/support/types/mp/merchant-user-impersonation/static-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface MerchantUserImpersonationStaticFixtures { - defaultPassword: string; -} diff --git a/cypress/support/types/yves/checkout/common/customer.ts b/cypress/support/types/yves/checkout/common/customer.ts deleted file mode 100644 index 4087c36c..00000000 --- a/cypress/support/types/yves/checkout/common/customer.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface Customer { - firstName: string; - lastName: string; - email: string; -} diff --git a/cypress/support/types/yves/checkout/common/product.ts b/cypress/support/types/yves/checkout/common/product.ts deleted file mode 100644 index 666aaada..00000000 --- a/cypress/support/types/yves/checkout/common/product.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Product { - sku: string; -} diff --git "a/cypress/support/types/yves/checkout/common/\321\201heckout-address.ts" "b/cypress/support/types/yves/checkout/common/\321\201heckout-address.ts" deleted file mode 100644 index f249898c..00000000 --- "a/cypress/support/types/yves/checkout/common/\321\201heckout-address.ts" +++ /dev/null @@ -1,10 +0,0 @@ -export interface CheckoutAddress { - firstName: string; - lastName: string; - address1: string; - address2: string; - zipCode: string; - city: string; - company: string; - phone: string; -} diff --git a/cypress/support/types/yves/checkout/dynamic-fixture-types.ts b/cypress/support/types/yves/checkout/dynamic-fixture-types.ts deleted file mode 100644 index c3b13aef..00000000 --- a/cypress/support/types/yves/checkout/dynamic-fixture-types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Product } from './common/product'; - -export interface CheckoutByLoggedInCustomerDynamicFixtures { - customer: Customer; - productOne: Product; - productTwo: Product; -} - -export interface CheckoutByGuestCustomerDynamicFixtures { - productOne: Product; - productTwo: Product; -} - -interface Customer { - email: string; -} diff --git a/cypress/support/types/yves/checkout/fixture-types.ts b/cypress/support/types/yves/checkout/fixture-types.ts new file mode 100644 index 00000000..ec26ad6d --- /dev/null +++ b/cypress/support/types/yves/checkout/fixture-types.ts @@ -0,0 +1,13 @@ +import { Customer, Product, Quote } from './transfer/transfer-types'; + +export interface CheckoutSuite1DynamicFixtures { + customer: Customer; + productOne: Product; + productTwo: Product; + quoteOne: Quote; + quoteTwo: Quote; +} + +export interface CheckoutStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/yves/checkout/index.ts b/cypress/support/types/yves/checkout/index.ts deleted file mode 100644 index 2a6e23ad..00000000 --- a/cypress/support/types/yves/checkout/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; -export * from './common/customer'; -export * from './common/сheckout-address'; diff --git a/cypress/support/types/yves/checkout/static-fixture-types.ts b/cypress/support/types/yves/checkout/static-fixture-types.ts deleted file mode 100644 index 56d052a8..00000000 --- a/cypress/support/types/yves/checkout/static-fixture-types.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface CheckoutByLoggedInCustomerStaticFixtures { - customer: Customer; -} - -interface Customer { - password: string; -} diff --git a/cypress/support/types/yves/checkout/transfer/transfer-types.ts b/cypress/support/types/yves/checkout/transfer/transfer-types.ts new file mode 100644 index 00000000..2c40c2e8 --- /dev/null +++ b/cypress/support/types/yves/checkout/transfer/transfer-types.ts @@ -0,0 +1,11 @@ +export interface Customer { + email: string; +} + +export interface Product { + sku: string; +} + +export interface Quote { + name: string; +} diff --git a/cypress/support/types/yves/comments/cart/common/product.ts b/cypress/support/types/yves/comments/cart/common/product.ts deleted file mode 100644 index 47e94acf..00000000 --- a/cypress/support/types/yves/comments/cart/common/product.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface Product { - id_product_concrete: number; - sku: string; - abstract_sku: string; -} diff --git a/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts b/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts deleted file mode 100644 index 02bba9d1..00000000 --- a/cypress/support/types/yves/comments/cart/dynamic-fixture-types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Quote } from './common/quote'; -import { Product } from './common/product'; - -export interface CartCommentDynamicFixtures { - quote: Quote; - customer: Customer; - product: Product; -} - -interface Customer { - email: string; -} diff --git a/cypress/support/types/yves/comments/cart/index.ts b/cypress/support/types/yves/comments/cart/index.ts deleted file mode 100644 index cfc6ac0c..00000000 --- a/cypress/support/types/yves/comments/cart/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/yves/comments/cart/static-fixture-types.ts b/cypress/support/types/yves/comments/cart/static-fixture-types.ts deleted file mode 100644 index 465e22ef..00000000 --- a/cypress/support/types/yves/comments/cart/static-fixture-types.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface CartCommentStaticFixtures { - commentsToAdd: string[]; - commentToModify: string; - modifiedComment: string; - commentsToRemove: string; - customer: Customer; -} - -interface Customer { - password: string; -} diff --git a/cypress/support/types/yves/comments/fixture-types.ts b/cypress/support/types/yves/comments/fixture-types.ts new file mode 100644 index 00000000..097fe0e6 --- /dev/null +++ b/cypress/support/types/yves/comments/fixture-types.ts @@ -0,0 +1,16 @@ +import { Customer, Product, Quote } from './transfer/transfer-types'; + +export interface CommentsSuite1DynamicFixtures { + customer: Customer; + product: Product; + quote: Quote; + emptyQuote: Quote; +} + +export interface CommentsSuite1StaticFixtures { + defaultPassword: string; + commentsToAdd: string[]; + commentToModify: string; + modifiedComment: string; + commentsToRemove: string; +} diff --git a/cypress/support/types/yves/comments/cart/common/quote.ts b/cypress/support/types/yves/comments/transfer/transfer-types.ts similarity index 50% rename from cypress/support/types/yves/comments/cart/common/quote.ts rename to cypress/support/types/yves/comments/transfer/transfer-types.ts index f6790776..6bd9543c 100644 --- a/cypress/support/types/yves/comments/cart/common/quote.ts +++ b/cypress/support/types/yves/comments/transfer/transfer-types.ts @@ -1,3 +1,9 @@ +export interface Product { + id_product_concrete: number; + sku: string; + abstract_sku: string; +} + export interface Quote { id_quote: number; name: string; @@ -6,3 +12,7 @@ export interface Quote { totals: string; price_mode: string; } + +export interface Customer { + email: string; +} diff --git a/cypress/support/types/yves/order-managment/order/common/customer.ts b/cypress/support/types/yves/order-managment/order/common/customer.ts deleted file mode 100644 index 9e663dd4..00000000 --- a/cypress/support/types/yves/order-managment/order/common/customer.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Customer { - email: string; -} diff --git a/cypress/support/types/yves/order-managment/order/common/product.ts b/cypress/support/types/yves/order-managment/order/common/product.ts deleted file mode 100644 index 666aaada..00000000 --- a/cypress/support/types/yves/order-managment/order/common/product.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Product { - sku: string; -} diff --git a/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts b/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts deleted file mode 100644 index 603e726d..00000000 --- a/cypress/support/types/yves/order-managment/order/dynamic-fixture-types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Product } from './common/product'; - -export interface CreateOrderByCustomerDynamicFixtures { - customer: Customer; - product: Product; -} - -export interface CreateOrderByGuestDynamicFixtures { - product: Product; -} - -interface Customer { - email: string; -} diff --git a/cypress/support/types/yves/order-managment/order/index.ts b/cypress/support/types/yves/order-managment/order/index.ts deleted file mode 100644 index cfc6ac0c..00000000 --- a/cypress/support/types/yves/order-managment/order/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/yves/order-managment/order/static-fixture-types.ts b/cypress/support/types/yves/order-managment/order/static-fixture-types.ts deleted file mode 100644 index 60aa5df3..00000000 --- a/cypress/support/types/yves/order-managment/order/static-fixture-types.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface CreateOrderByCustomerStaticFixtures { - customer: Customer; -} - -interface Customer { - password: string; -} diff --git a/cypress/support/types/yves/order-managment/return/common/product.ts b/cypress/support/types/yves/order-managment/return/common/product.ts deleted file mode 100644 index 666aaada..00000000 --- a/cypress/support/types/yves/order-managment/return/common/product.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Product { - sku: string; -} diff --git a/cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts b/cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts deleted file mode 100644 index 240340f2..00000000 --- a/cypress/support/types/yves/order-managment/return/dynamic-fixture-types.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Product } from './common/product'; - -export interface CreateReturnByUserDynamicFixtures { - rootUser: User; - customer: Customer; - product: Product; - quoteOne: Quote; - quoteTwo: Quote; -} - -interface User { - username: string; -} - -interface Customer { - email: string; -} - -interface Quote { - name: string; -} diff --git a/cypress/support/types/yves/order-managment/return/index.ts b/cypress/support/types/yves/order-managment/return/index.ts deleted file mode 100644 index cfc6ac0c..00000000 --- a/cypress/support/types/yves/order-managment/return/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dynamic-fixture-types'; -export * from './static-fixture-types'; diff --git a/cypress/support/types/yves/order-managment/return/static-fixture-types.ts b/cypress/support/types/yves/order-managment/return/static-fixture-types.ts deleted file mode 100644 index 6f1a24ae..00000000 --- a/cypress/support/types/yves/order-managment/return/static-fixture-types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface CreateReturnByUserStaticFixtures { - defaultPassword: string; -} diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index e588e009..08dd493d 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -22,23 +22,23 @@ type ClassConstructor = new (...args: any[]) => any; type BindingsMap = { [key: string]: ClassConstructor }; const suiteMappings: BindingsMap = { - [TYPES.YvesLoginRepository]: SuiteLoginRepository, - [TYPES.YvesCartRepository]: SuiteCartRepository, - [TYPES.YvesMultiCartRepository]: SuiteMultiCartRepository, - [TYPES.YvesCommentCartRepository]: SuiteCommentCartRepository, - [TYPES.YvesCheckoutCustomerRepository]: SuiteCheckoutCustomerRepository, - [TYPES.YvesCheckoutAddressRepository]: SuiteCheckoutAddressRepository, - [TYPES.YvesCheckoutShipmentRepository]: SuiteCheckoutShipmentRepository, - [TYPES.YvesCheckoutPaymentRepository]: SuiteCheckoutPaymentRepository, - [TYPES.YvesCheckoutSummaryRepository]: SuiteCheckoutSummaryRepository, - [TYPES.YvesAgentLoginRepository]: SuiteAgentLoginRepository, + [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, }; const b2bMappings: BindingsMap = { - [TYPES.YvesLoginRepository]: B2bLoginRepository, - [TYPES.YvesCartRepository]: B2bCartRepository, - [TYPES.YvesMultiCartRepository]: B2bMultiCartRepository, - [TYPES.YvesCommentCartRepository]: B2bCommentCartRepository, + [TYPES.LoginRepository]: B2bLoginRepository, + [TYPES.CartRepository]: B2bCartRepository, + [TYPES.MultiCartRepository]: B2bMultiCartRepository, + [TYPES.CommentCartRepository]: B2bCommentCartRepository, }; const container = new Container(); diff --git a/cypress/support/utils/inversify/types.ts b/cypress/support/utils/inversify/types.ts index 365c9d83..463702b3 100644 --- a/cypress/support/utils/inversify/types.ts +++ b/cypress/support/utils/inversify/types.ts @@ -1,14 +1,14 @@ const TYPES = { - YvesLoginRepository: 'YvesLoginRepository', - YvesCartRepository: 'YvesCartRepository', - YvesCommentCartRepository: 'YvesCommentCartRepository', - YvesMultiCartRepository: 'YvesMultiCartRepository', - YvesCheckoutAddressRepository: 'YvesCheckoutAddressRepository', - YvesCheckoutCustomerRepository: 'YvesCheckoutCustomerRepository', - YvesCheckoutShipmentRepository: 'YvesCheckoutShipmentRepository', - YvesCheckoutPaymentRepository: 'YvesCheckoutPaymentRepository', - YvesCheckoutSummaryRepository: 'YvesCheckoutSummaryRepository', - YvesAgentLoginRepository: 'YvesAgentLoginRepository', + LoginRepository: 'LoginRepository', + CartRepository: 'CartRepository', + CommentCartRepository: 'CommentCartRepository', + MultiCartRepository: 'MultiCartRepository', + CheckoutAddressRepository: 'CheckoutAddressRepository', + CheckoutCustomerRepository: 'CheckoutCustomerRepository', + CheckoutShipmentRepository: 'CheckoutShipmentRepository', + CheckoutPaymentRepository: 'CheckoutPaymentRepository', + CheckoutSummaryRepository: 'CheckoutSummaryRepository', + AgentLoginRepository: 'AgentLoginRepository', }; export { TYPES }; From 96dd1f9ba0ddde69a4ae7b173a45b2231ea491a9 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Fri, 1 Mar 2024 22:58:54 +0300 Subject: [PATCH 24/53] Added qa-attributes to shop pages. --- .../repositories/suite-agent-login-repository.ts | 6 +++--- .../yves/cart/repositories/suite-cart-repository.ts | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) 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 a020cc9c..8df1b6d7 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 @@ -4,8 +4,8 @@ import { AgentLoginRepository } from '../agent-login-repository'; @injectable() export class SuiteAgentLoginRepository implements AgentLoginRepository { - getLoginEmailInput = (): Cypress.Chainable => cy.get('#loginForm_email'); - getLoginPasswordInput = (): Cypress.Chainable => cy.get('#loginForm_password'); - getLoginForm = (): Cypress.Chainable => cy.get('form[name=loginForm]'); + getLoginEmailInput = (): Cypress.Chainable => cy.get('[data-qa="agent-login-form-email-input"]'); + getLoginPasswordInput = (): Cypress.Chainable => cy.get('[data-qa="agent-login-form-password-input"]'); + getLoginForm = (): Cypress.Chainable => cy.get('[data-qa="agent-login-form"]'); getFailedAuthenticationText = (): string => 'Authentication failed'; } 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 aa9aec45..2e6fe25f 100644 --- a/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts @@ -4,11 +4,13 @@ import { CartRepository } from '../cart-repository'; @injectable() export class SuiteCartRepository implements CartRepository { - getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component autocomplete-form"] .input'); + getQuickAddToCartSkuField = (): Cypress.Chainable => + cy.get('[data-qa="component product-quick-add-form"] input').first(); getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); - getQuickAddToCartQuantityField = (): Cypress.Chainable> => cy.get('#quantity'); + getQuickAddToCartQuantityField = (): Cypress.Chainable> => + cy.get('[data-qa="product-quick-add-form-quantity-input"]'); getQuickAddToCartSubmitButton = (): Cypress.Chainable> => - cy.get('.js-product-quick-add-form__submit-button'); + cy.get('[data-qa="product-quick-add-form-submit-button"]'); findCartItemRemovalForm = (sku: string): Cypress.Chainable => { return cy.get('[action]').filter((index, element) => { const regex = new RegExp(`^/\\w+/cart/remove/${sku}/\\w+$`); @@ -22,7 +24,7 @@ export class SuiteCartRepository implements CartRepository { }); }; getCartItemChangeQuantityField = (sku: string): Cypress.Chainable => - this.findCartItemChangeQuantityForm(sku).find('[data-qa="component formatted-number-input"]'); - findClearCartForm = (): Cypress.Chainable => cy.get('form[name=multi_cart_clear_form]'); + this.findCartItemChangeQuantityForm(sku).find('[data-qa="cart-item-quantity-input"]'); + findClearCartForm = (): Cypress.Chainable => cy.get('[data-qa="multi-cart-clear-form"]'); getCheckoutButton = (): Cypress.Chainable => cy.get('[data-qa="cart-go-to-checkout"]'); } From 5b2999aca7c3f6f41054a2a9bf5e09b09d4fc897 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 4 Mar 2024 12:37:33 +0300 Subject: [PATCH 25/53] Adjusted fixtures, removed types from pages. --- .../comments/dynamic/comments-suite-1.json | 54 +++----------- .../dynamic/order-management-suite-1.json | 33 ++------- .../dynamic/return-management-suite-1.json | 38 ++-------- .../marketplace-agent-assist-suite-1.json | 73 +++---------------- .../marketplace-agent-assist-suite-2.json | 71 ++++-------------- .../checkout/dynamic/checkout-suite-1.json | 43 ++--------- .../comments/dynamic/comments-suite-1.json | 54 +++----------- .../create/merchant-user-create-page.ts | 16 ++-- .../merchant/create/merchant-create-page.ts | 4 +- .../user/create/user-create-page.ts | 20 ++--- .../checkout/address/checkout-address-page.ts | 26 ++----- .../scenarios/yves/checkout-scenario.ts | 2 +- 12 files changed, 94 insertions(+), 340 deletions(-) diff --git a/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json index ad0249b8..bce312ee 100644 --- a/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json +++ b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json @@ -8,21 +8,13 @@ "type": "transfer", "name": "LocaleTransfer", "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } + "arguments": { "id_locale": 66, "locale_name": "en_US" } }, { "type": "helper", "name": "haveCustomer", "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] + "arguments": [{ "locale": "#locale", "password": "change123" }] }, { "type": "helper", @@ -34,21 +26,17 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { - "id_store": 1 - } + "arguments": { "id_store": 1 } }, { "type": "helper", "name": "haveFullProduct", - "key": "productOne", - "arguments": [] + "key": "productOne" }, { "type": "helper", "name": "haveFullProduct", - "key": "productTwo", - "arguments": [] + "key": "productTwo" }, { "type": "helper", @@ -57,10 +45,7 @@ { "skuProductAbstract": "#productOne.abstract_sku", "skuProduct": "#productOne.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] }, @@ -71,34 +56,19 @@ { "skuProductAbstract": "#productTwo.abstract_sku", "skuProduct": "#productTwo.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": [ - "#store", - { - "sku": "#productOne.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#productOne.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": [ - "#store", - { - "sku": "#productTwo.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#productTwo.sku", "isNeverOutOfStock": "1" }] }, { "type": "transfer", @@ -159,11 +129,7 @@ "type": "helper", "name": "havePersistentQuote", "key": "emptyQuote", - "arguments": [ - { - "customer": "#customer" - } - ] + "arguments": [{ "customer": "#customer" }] } ] } 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 index 5ab76c19..177aa115 100644 --- 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 @@ -8,29 +8,19 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { - "id_store": 1 - } + "arguments": { "id_store": 1 } }, { "type": "transfer", "name": "LocaleTransfer", "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } + "arguments": { "id_locale": 66, "locale_name": "en_US" } }, { "type": "helper", "name": "haveCustomer", "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] + "arguments": [{ "locale": "#locale", "password": "change123" }] }, { "type": "helper", @@ -41,8 +31,7 @@ { "type": "helper", "name": "haveFullProduct", - "key": "product", - "arguments": [] + "key": "product" }, { "type": "transfer", @@ -84,13 +73,7 @@ "type": "helper", "name": "haveProductInStockForStore", "key": "productWithPriceAndStore", - "arguments": [ - "#store", - { - "sku": "#product.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#product.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", @@ -115,11 +98,7 @@ "type": "helper", "name": "haveUser", "key": "rootUser", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", 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 index 5b8a0be4..b9edc3b5 100644 --- 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 @@ -8,11 +8,7 @@ "type": "helper", "name": "haveUser", "key": "rootUser", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", @@ -23,29 +19,19 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { - "id_store": 1 - } + "arguments": { "id_store": 1 } }, { "type": "transfer", "name": "LocaleTransfer", "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } + "arguments": { "id_locale": 66, "locale_name": "en_US" } }, { "type": "helper", "name": "haveCustomer", "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] + "arguments": [{ "locale": "#locale", "password": "change123" }] }, { "type": "helper", @@ -56,8 +42,7 @@ { "type": "helper", "name": "haveFullProduct", - "key": "product", - "arguments": [] + "key": "product" }, { "type": "transfer", @@ -88,10 +73,7 @@ { "skuProductAbstract": "#product.abstract_sku", "skuProduct": "#product.sku", - "moneyValue": { - "netAmount": 50000, - "grossAmount": 50000 - } + "moneyValue": { "netAmount": 50000, "grossAmount": 50000 } } ] }, @@ -99,13 +81,7 @@ "type": "helper", "name": "haveProductInStockForStore", "key": "productWithPriceAndStore", - "arguments": [ - "#store", - { - "sku": "#product.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#product.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", 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 index 0ea2a9be..b973e1a4 100644 --- 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 @@ -8,11 +8,7 @@ "type": "helper", "name": "haveUser", "key": "rootUser", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", @@ -23,12 +19,7 @@ "type": "helper", "name": "haveUser", "key": "merchantAgentUser", - "arguments": [ - { - "password": "change123", - "isMerchantAgent": true - } - ] + "arguments": [{ "password": "change123", "isMerchantAgent": true }] }, { "type": "helper", @@ -39,12 +30,7 @@ "type": "helper", "name": "haveUser", "key": "customerAgentUser", - "arguments": [ - { - "password": "change123", - "isAgent": true - } - ] + "arguments": [{ "password": "change123", "isAgent": true }] }, { "type": "helper", @@ -55,33 +41,19 @@ "type": "helper", "name": "haveUser", "key": "merchantUser", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", "name": "haveUser", "key": "deactivatedMerchantUser", - "arguments": [ - { - "password": "change123", - "status": "blocked" - } - ] + "arguments": [{ "password": "change123", "status": "blocked" }] }, { "type": "helper", "name": "haveUser", "key": "deletedMerchantUser", - "arguments": [ - { - "password": "change123", - "status": "deleted" - } - ] + "arguments": [{ "password": "change123", "status": "deleted" }] }, { "type": "builder", @@ -92,10 +64,7 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { - "id_store": 1, - "name": "DE" - } + "arguments": { "id_store": 1, "name": "DE" } }, { "type": "arrayObject", @@ -106,19 +75,13 @@ "type": "transfer", "name": "LocaleTransfer", "key": "localeEN", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } + "arguments": { "id_locale": 66, "locale_name": "en_US" } }, { "type": "transfer", "name": "LocaleTransfer", "key": "localeDE", - "arguments": { - "id_locale": 46, - "locale_name": "de_DE" - } + "arguments": { "id_locale": 46, "locale_name": "de_DE" } }, { "type": "helper", @@ -198,11 +161,7 @@ "type": "helper", "name": "haveUser", "key": "merchantUserFromInactiveApprovedMerchant", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", @@ -233,11 +192,7 @@ "type": "helper", "name": "haveUser", "key": "merchantUserFromActiveDeniedMerchant", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", @@ -268,11 +223,7 @@ "type": "helper", "name": "haveUser", "key": "merchantUserFromInactiveDeniedMerchant", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", 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 index 8c7ab6c6..f1ba5aad 100644 --- 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 @@ -8,11 +8,7 @@ "type": "helper", "name": "haveUser", "key": "rootUser", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "helper", @@ -23,12 +19,7 @@ "type": "helper", "name": "haveUser", "key": "merchantAgentUser", - "arguments": [ - { - "password": "change123", - "isMerchantAgent": true - } - ] + "arguments": [{ "password": "change123", "isMerchantAgent": true }] }, { "type": "helper", @@ -39,11 +30,7 @@ "type": "helper", "name": "haveUser", "key": "merchantUser", - "arguments": [ - { - "password": "change123" - } - ] + "arguments": [{ "password": "change123" }] }, { "type": "builder", @@ -54,10 +41,7 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { - "id_store": 1, - "name": "DE" - } + "arguments": { "id_store": 1, "name": "DE" } }, { "type": "arrayObject", @@ -68,30 +52,19 @@ "type": "transfer", "name": "LocaleTransfer", "key": "localeEN", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } + "arguments": { "id_locale": 66, "locale_name": "en_US" } }, { "type": "transfer", "name": "LocaleTransfer", "key": "localeDE", - "arguments": { - "id_locale": 46, - "locale_name": "de_DE" - } + "arguments": { "id_locale": 46, "locale_name": "de_DE" } }, { "type": "helper", "name": "haveCustomer", "key": "customer", - "arguments": [ - { - "locale": "#localeEN", - "password": "change123" - } - ] + "arguments": [{ "locale": "#localeEN", "password": "change123" }] }, { "type": "helper", @@ -156,14 +129,8 @@ { "idTaxSet": 1, "localizedAttributes": [ - { - "locale": "#localeEN", - "name": "#localizedAttribute.name" - }, - { - "locale": "#localeDE", - "name": "#localizedAttribute.name" - } + { "locale": "#localeEN", "name": "#localizedAttribute.name" }, + { "locale": "#localeDE", "name": "#localizedAttribute.name" } ] } ] @@ -198,14 +165,8 @@ { "idTaxSet": 1, "localizedAttributes": [ - { - "locale": "#localeEN", - "name": "#localizedAttribute.name" - }, - { - "locale": "#localeDE", - "name": "#localizedAttribute.name" - } + { "locale": "#localeEN", "name": "#localizedAttribute.name" }, + { "locale": "#localeDE", "name": "#localizedAttribute.name" } ] } ] @@ -229,10 +190,7 @@ { "skuProductAbstract": "#productConcreteForOffer.abstract_sku", "skuProduct": "#productConcreteForOffer.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] }, @@ -243,10 +201,7 @@ { "skuProductAbstract": "#productConcreteForMerchant.abstract_sku", "skuProduct": "#productConcreteForMerchant.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] }, diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json index b7ae5486..9aa147fb 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json @@ -8,29 +8,19 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { - "id_store": 1 - } + "arguments": { "id_store": 1 } }, { "type": "transfer", "name": "LocaleTransfer", "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } + "arguments": { "id_locale": 66, "locale_name": "en_US" } }, { "type": "helper", "name": "haveCustomer", "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] + "arguments": [{ "locale": "#locale", "password": "change123" }] }, { "type": "helper", @@ -41,8 +31,7 @@ { "type": "helper", "name": "haveFullProduct", - "key": "productOne", - "arguments": [] + "key": "productOne" }, { "type": "transfer", @@ -68,8 +57,7 @@ { "type": "helper", "name": "haveFullProduct", - "key": "productTwo", - "arguments": [] + "key": "productTwo" }, { "type": "helper", @@ -106,10 +94,7 @@ { "skuProductAbstract": "#productTwo.abstract_sku", "skuProduct": "#productTwo.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] }, @@ -117,25 +102,13 @@ "type": "helper", "name": "haveProductInStockForStore", "key": "productOneWithPriceAndStore", - "arguments": [ - "#store", - { - "sku": "#productOne.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#productOne.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", "name": "haveProductInStockForStore", "key": "productTwoWithPriceAndStore", - "arguments": [ - "#store", - { - "sku": "#productTwo.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#productTwo.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", diff --git a/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json index ad0249b8..bce312ee 100644 --- a/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json +++ b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json @@ -8,21 +8,13 @@ "type": "transfer", "name": "LocaleTransfer", "key": "locale", - "arguments": { - "id_locale": 66, - "locale_name": "en_US" - } + "arguments": { "id_locale": 66, "locale_name": "en_US" } }, { "type": "helper", "name": "haveCustomer", "key": "customer", - "arguments": [ - { - "locale": "#locale", - "password": "change123" - } - ] + "arguments": [{ "locale": "#locale", "password": "change123" }] }, { "type": "helper", @@ -34,21 +26,17 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { - "id_store": 1 - } + "arguments": { "id_store": 1 } }, { "type": "helper", "name": "haveFullProduct", - "key": "productOne", - "arguments": [] + "key": "productOne" }, { "type": "helper", "name": "haveFullProduct", - "key": "productTwo", - "arguments": [] + "key": "productTwo" }, { "type": "helper", @@ -57,10 +45,7 @@ { "skuProductAbstract": "#productOne.abstract_sku", "skuProduct": "#productOne.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] }, @@ -71,34 +56,19 @@ { "skuProductAbstract": "#productTwo.abstract_sku", "skuProduct": "#productTwo.sku", - "moneyValue": { - "netAmount": 30000, - "grossAmount": 30000 - } + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": [ - "#store", - { - "sku": "#productOne.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#productOne.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": [ - "#store", - { - "sku": "#productTwo.sku", - "isNeverOutOfStock": "1" - } - ] + "arguments": ["#store", { "sku": "#productTwo.sku", "isNeverOutOfStock": "1" }] }, { "type": "transfer", @@ -159,11 +129,7 @@ "type": "helper", "name": "havePersistentQuote", "key": "emptyQuote", - "arguments": [ - { - "customer": "#customer" - } - ] + "arguments": [{ "customer": "#customer" }] } ] } 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 7ba8e726..00bb4de1 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 @@ -13,16 +13,14 @@ export class MerchantUserCreatePage extends BackofficePage { super(); } - public createMerchantUser = (merchantUser?: MerchantUser): MerchantUser => { - if (!merchantUser) { - const uniquePrefix: string = this.faker.number.int({ min: 1000, max: 9999 }).toString(); + public createMerchantUser = () => { + const uniquePrefix: string = this.faker.number.int({ min: 1000, max: 9999 }).toString(); - merchantUser = { - username: this.faker.internet.email(), - firstName: uniquePrefix + '_' + this.faker.person.firstName(), - lastName: uniquePrefix + '_' + this.faker.person.lastName(), - }; - } + const merchantUser = { + username: this.faker.internet.email(), + firstName: uniquePrefix + '_' + this.faker.person.firstName(), + lastName: uniquePrefix + '_' + this.faker.person.lastName(), + }; this.repository.getEmailInput().clear().type(merchantUser.username); this.repository.getFirstNameInput().clear().type(merchantUser.firstName); 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 12be878c..159f5c0b 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts @@ -13,10 +13,10 @@ export class MerchantCreatePage extends BackofficePage { super(); } - public createMerchant = (): Merchant => { + public createMerchant = () => { const identifier: string = this.faker.string.uuid(); - const merchant: Merchant = { + const merchant = { name: 'Name: ' + identifier, reference: 'ref-' + identifier, email: this.faker.internet.email(), 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 8ef7337b..a2acdcec 100644 --- a/cypress/support/pages/backoffice/user/create/user-create-page.ts +++ b/cypress/support/pages/backoffice/user/create/user-create-page.ts @@ -16,13 +16,13 @@ export class UserCreatePage extends BackofficePage { super(); } - public createRootUser = (): User => { - const user: User = { + public createRootUser = () => { + const user = { username: this.faker.internet.email(), password: this.DEFAULT_PASSWORD, }; - this.fillCreateUserForm(user); + this.fillCreateUserForm(user.username, user.password); this.repository.getRootGroupCheckbox().check(); this.repository.getCreateUserButton().click(); @@ -31,13 +31,13 @@ export class UserCreatePage extends BackofficePage { return user; }; - public createAgentMerchantUser = (): User => { - const user: User = { + public createAgentMerchantUser = () => { + const user = { username: this.faker.internet.email(), password: this.DEFAULT_PASSWORD, }; - this.fillCreateUserForm(user); + this.fillCreateUserForm(user.username, user.password); this.repository.getRootGroupCheckbox().check(); this.repository.getAgentMerchantCheckbox().check(); @@ -47,10 +47,10 @@ export class UserCreatePage extends BackofficePage { return user; }; - private fillCreateUserForm = (user: User): void => { - this.repository.getUsernameInput().clear().type(user.username); - this.repository.getPasswordInput().clear().type(user.password); - this.repository.getRepeatPasswordInput().clear().type(user.password); + private fillCreateUserForm = (username: string, password: string): void => { + this.repository.getUsernameInput().clear().type(username); + this.repository.getPasswordInput().clear().type(password); + this.repository.getRepeatPasswordInput().clear().type(password); this.repository.getFirstNameInput().clear().type(this.faker.person.firstName()); this.repository.getLastNameInput().clear().type(this.faker.person.lastName()); this.repository.getInterfaceLanguageSelect().select(this.EN_LOCALE_VALUE); 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 f5fcd46c..f3d128c4 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -3,7 +3,6 @@ import { TYPES } from '../../../../utils/inversify/types'; import 'reflect-metadata'; import { CheckoutAddressRepository } from './checkout-address-repository'; import { autoWired } from '../../../../utils/inversify/auto-wired'; -import { CheckoutAddress } from '../../../../types/yves/checkout'; import { YvesPage } from '../../yves-page'; @injectable() @@ -15,13 +14,10 @@ export class CheckoutAddressPage extends YvesPage { super(); } - public fillShippingAddress = (checkoutAddress?: CheckoutAddress): void => { + public fillShippingAddress = (): void => { + const checkoutAddress = this.createDummyCheckoutAddress(); this.repository.getSelectShippingAddressField().select('0'); - if (!checkoutAddress) { - checkoutAddress = this.createDummyCheckoutAddress(); - } - // Setting mandatory fields this.repository.getShippingAddressFirstNameField().clear().type(checkoutAddress.firstName); this.repository.getShippingAddressLastNameField().clear().type(checkoutAddress.lastName); @@ -38,21 +34,18 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getNextButton().click(); }; - public fillMultiShippingAddress = (checkoutAddresses?: CheckoutAddress[]): void => { + public fillMultiShippingAddress = (): void => { this.repository.getMultiShipmentTriggerButton().click(); this.repository .getMultiShipmentAddressItemElement() .children() .each(($addressItem, index) => { + const checkoutAddress = this.createDummyCheckoutAddress(); + this.repository.getMultiShipmentAddressItemDeliveryRadio($addressItem).click({ force: true }); this.repository.getMultiShipmentAddressItemAddressField($addressItem).select('0', { force: true }); - let checkoutAddress: CheckoutAddress | null = checkoutAddresses ? checkoutAddresses[index] : null; - if (!checkoutAddress) { - checkoutAddress = this.createDummyCheckoutAddress(); - } - // Setting mandatory fields this.repository .getMultiShipmentAddressItemAddressFirstNameField($addressItem, index) @@ -93,13 +86,10 @@ export class CheckoutAddressPage extends YvesPage { this.fillBillingAddress(); }; - public fillBillingAddress = (checkoutAddress?: CheckoutAddress): void => { + public fillBillingAddress = (): void => { + const checkoutAddress = this.createDummyCheckoutAddress(); this.repository.getSelectBillingAddressField().select('0'); - if (!checkoutAddress) { - checkoutAddress = this.createDummyCheckoutAddress(); - } - // Setting mandatory fields this.repository.getBillingAddressFirstNameField().clear().type(checkoutAddress.firstName); this.repository.getBillingAddressLastNameField().clear().type(checkoutAddress.lastName); @@ -115,7 +105,7 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getNextButton().click(); }; - private createDummyCheckoutAddress = (): CheckoutAddress => { + private createDummyCheckoutAddress = () => { const prefix = '[e2e] '; return { diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 38ec1a7a..6e68ac05 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -37,7 +37,7 @@ export class CheckoutScenario { this.checkoutPaymentPage.setDummyPaymentMethod(); this.checkoutSummaryPage.placeOrder(); - cy.wait(1000); + cy.wait(1000); // Wait for OMS to process the order this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; From 9b874188a23bd34dd4b12feac8d4325b61e902a6 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 4 Mar 2024 17:08:31 +0300 Subject: [PATCH 26/53] Added data-qa attributes. --- .../agent-dashboard-repository.ts | 5 +++-- .../checkout/address/checkout-address-page.ts | 4 ++-- .../address/checkout-address-repository.ts | 4 ++-- .../suite-checkout-address-repository.ts | 16 +++++++--------- .../suite-checkout-customer-repository.ts | 2 +- .../suite-checkout-payment-repository.ts | 2 +- .../checkout/shipment/checkout-shipment-page.ts | 10 +++------- .../shipment/checkout-shipment-repository.ts | 2 +- .../suite-checkout-shipment-repository.ts | 4 ++-- .../suite-checkout-summary-repository.ts | 3 ++- .../suite-comment-cart-repository.ts | 6 +++--- 11 files changed, 27 insertions(+), 31 deletions(-) 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 1909e6ff..4b43e69c 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-repository.ts @@ -6,8 +6,9 @@ import { autoWired } from '../../../utils/inversify/auto-wired'; @autoWired export class AgentDashboardRepository { getDashboardSidebarSelector = (): Cypress.Chainable => cy.get('spy-sidebar.spy-sidebar'); - getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1)'); + getFirstTableRow = (): Cypress.Chainable => cy.get('nz-table-inner-default tbody > :nth-child(1)'); getSearchSelector = (): string => '.spy-table-search-feature input[type="text"]'; getAssistUserButtonSelector = (): string => 'button:contains("Assist User")'; - getModalConfirmButton = (): Cypress.Chainable => cy.get('.ant-modal-confirm-col').find('button:contains("Confirm")'); + getModalConfirmButton = (): Cypress.Chainable => + cy.get('[ng-reflect-ng-class="ant-modal--confirmation"]').find('button:contains("Confirm")'); } 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 f3d128c4..12ef7331 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -43,8 +43,8 @@ export class CheckoutAddressPage extends YvesPage { .each(($addressItem, index) => { const checkoutAddress = this.createDummyCheckoutAddress(); - this.repository.getMultiShipmentAddressItemDeliveryRadio($addressItem).click({ force: true }); - this.repository.getMultiShipmentAddressItemAddressField($addressItem).select('0', { force: true }); + this.repository.getMultiShipmentAddressItemDeliveryRadio($addressItem, index).click({ force: true }); + this.repository.getMultiShipmentAddressItemAddressField($addressItem, index).select('0', { force: true }); // Setting mandatory fields this.repository diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts index fe4a5835..bbd369dd 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts @@ -21,8 +21,8 @@ export interface CheckoutAddressRepository { getBillingAddressPhoneField(): Cypress.Chainable; getMultiShipmentTriggerButton(): Cypress.Chainable; getMultiShipmentAddressItemElement(): Cypress.Chainable; - getMultiShipmentAddressItemDeliveryRadio($addressItem: JQuery): Cypress.Chainable; - getMultiShipmentAddressItemAddressField($addressItem: JQuery): Cypress.Chainable; + getMultiShipmentAddressItemDeliveryRadio($addressItem: JQuery, index: number): Cypress.Chainable; + getMultiShipmentAddressItemAddressField($addressItem: JQuery, index: number): Cypress.Chainable; getMultiShipmentAddressItemAddressFirstNameField($addressItem: JQuery, index: number): Cypress.Chainable; getMultiShipmentAddressItemAddressLastNameField($addressItem: JQuery, index: number): Cypress.Chainable; getMultiShipmentAddressItemAddressAddress1Field($addressItem: JQuery, index: number): Cypress.Chainable; 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 297b4361..50b1f2c4 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 @@ -4,8 +4,7 @@ import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() export class SuiteCheckoutAddressRepository implements CheckoutAddressRepository { - getSelectShippingAddressField = (): Cypress.Chainable => - cy.get('.select__select.js-address__form-select-shippingAddress'); + getSelectShippingAddressField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_id_customer_address'); getShippingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_first_name'); getShippingAddressLastNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_last_name'); getShippingAddressAddress1Field = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_address1'); @@ -16,7 +15,7 @@ export class SuiteCheckoutAddressRepository implements CheckoutAddressRepository getShippingAddressPhoneField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_phone'); getShippingAddressBillingSameAsShippingCheckbox = (): Cypress.Chainable => cy.get('#addressesForm_billingSameAsShipping'); - getNextButton = (): Cypress.Chainable => cy.contains('button', 'Next'); + getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-address-form-button"]'); getSelectBillingAddressField = (): Cypress.Chainable => cy.get('#addressesForm_billingAddress_id_customer_address'); getBillingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_billingAddress_first_name'); getBillingAddressLastNameField = (): Cypress.Chainable => cy.get('#addressesForm_billingAddress_last_name'); @@ -26,14 +25,13 @@ export class SuiteCheckoutAddressRepository implements CheckoutAddressRepository getBillingAddressCityField = (): Cypress.Chainable => cy.get('#addressesForm_billingAddress_city'); getBillingAddressCompanyField = (): Cypress.Chainable => cy.get('#addressesForm_billingAddress_company'); getBillingAddressPhoneField = (): Cypress.Chainable => cy.get('#addressesForm_billingAddress_phone'); - getMultiShipmentTriggerButton = (): Cypress.Chainable => - cy.get('.js-multiple-shipment-toggler__multiple-shipment-trigger'); + getMultiShipmentTriggerButton = (): Cypress.Chainable => cy.get('[data-qa="multiple-shipment-trigger-button"]'); getMultiShipmentAddressItemElement = (): Cypress.Chainable => cy.get('[data-qa="component address-item-form-field-list"]'); - getMultiShipmentAddressItemDeliveryRadio = ($addressItem: JQuery): Cypress.Chainable => - cy.wrap($addressItem).contains('span', 'Delivery'); - getMultiShipmentAddressItemAddressField = ($addressItem: JQuery): Cypress.Chainable => - cy.wrap($addressItem).contains('select', 'Select an address'); + getMultiShipmentAddressItemDeliveryRadio = ($addressItem: JQuery, index: number): Cypress.Chainable => + cy.wrap($addressItem).get(`#addressesForm_multiShippingAddresses_${index}_shipmentType_key_1`); + getMultiShipmentAddressItemAddressField = ($addressItem: JQuery, index: number): Cypress.Chainable => + cy.wrap($addressItem).get(`#addressesForm_multiShippingAddresses_${index}_shippingAddress_id_customer_address`); getMultiShipmentAddressItemAddressFirstNameField = ( $addressItem: JQuery, index: number 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 24e48822..42862b94 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 @@ -10,5 +10,5 @@ export class SuiteCheckoutCustomerRepository implements CheckoutCustomerReposito getGuestEmailField = (): Cypress.Chainable => cy.get('#guestForm_customer_email'); getGuestTermsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="component checkbox guestForm[customer][accept_terms] guestForm_customer_accept_terms"]'); - getGuestSubmitButton = (): Cypress.Chainable => cy.contains('button', 'Submit'); + getGuestSubmitButton = (): Cypress.Chainable => cy.get('[data-qa="guest-form-submit-button"]'); } 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 1a545d3b..2c461e25 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 @@ -6,7 +6,7 @@ import { CheckoutPaymentRepository } from '../checkout-payment-repository'; export class SuiteCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice'); getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); - getGoToSummaryButton = (): Cypress.Chainable => cy.contains('button', 'Go to Summary'); + getGoToSummaryButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getDummyMarketplacePaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyMarketplacePaymentInvoice'); getDummyMarketplacePaymentInvoiceDateField = (): Cypress.Chainable => 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 2955fd85..98337d8c 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -15,13 +15,9 @@ export class CheckoutShipmentPage extends YvesPage { } public setStandardShippingMethod = (): void => { - this.repository - .getMultiShipmentItemElement() - .children() - .filter(':contains("Spryker Dummy Shipment")') - .each(($shipmentItem, index) => { - this.repository.getStandardShipmentRadio($shipmentItem, index).click({ force: true }); - }); + this.repository.getMultiShipmentGroups().each(($shipmentItem, index) => { + this.repository.getStandardShipmentRadio($shipmentItem, index).click({ force: true }); + }); this.repository.getNextButton().click(); }; diff --git a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts index 874c9496..8806d5db 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts @@ -1,5 +1,5 @@ export interface CheckoutShipmentRepository { - getMultiShipmentItemElement(): Cypress.Chainable; + getMultiShipmentGroups(): Cypress.Chainable; getStandardShipmentRadio($shipmentItem: JQuery, index: number): Cypress.Chainable; getNextButton(): Cypress.Chainable; } 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 7ab4d9b7..a3d3444e 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 @@ -4,8 +4,8 @@ import { CheckoutShipmentRepository } from '../checkout-shipment-repository'; @injectable() export class SuiteCheckoutShipmentRepository implements CheckoutShipmentRepository { - getMultiShipmentItemElement = (): Cypress.Chainable => cy.get('.form__fields.grid.grid--bottom'); + getMultiShipmentGroups = (): Cypress.Chainable => cy.get('[data-qa="multi-shipment-group"]'); getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0`); - getNextButton = (): Cypress.Chainable => cy.contains('button', 'Next'); + getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); } 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 f62075a5..5d139481 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 @@ -4,6 +4,7 @@ import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() export class SuiteCheckoutSummaryRepository implements CheckoutSummaryRepository { - getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[name="acceptTermsAndConditions"]'); + getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => + cy.get('[data-qa="accept-terms-and-conditions-input"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); } 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 4a38b336..7862c8e0 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 @@ -6,10 +6,10 @@ import { CommentCartRepository } from '../comment-cart-repository'; export class SuiteCommentCartRepository implements CommentCartRepository { getAddCommentForm = (): Cypress.Chainable => cy.get('[data-qa="component comment-form"]'); getCommentThreadListSection = (): Cypress.Chainable => cy.get('[data-qa="component comment-thread-list"]'); - getAddCommentButtonSelector = (): string => 'button:contains("Add")'; - getRemoveCommentButtonSelector = (): string => 'button:contains("Remove")'; + getAddCommentButtonSelector = (): string => '[data-qa="comment-form-add-button"]'; + getRemoveCommentButtonSelector = (): string => '[data-qa="comment-form-remove-button"]'; getFirstCommentTextarea = (): Cypress.Chainable => this.getCommentThreadListSection().first().find('textarea'); - getUpdateCommentButtonSelector = (): string => 'button:contains("Update")'; + getUpdateCommentButtonSelector = (): string => '[data-qa="comment-form-update-button"]'; getCommentTextareaByCommentText(commentText: string): Cypress.Chainable { return this.getCommentThreadListSection().first().contains(commentText); } From 58485d86dd04cda9cfb60b81d797a00cb1089d53 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 4 Mar 2024 18:55:21 +0300 Subject: [PATCH 27/53] Added additional tests to checkout feature. --- .../order-management-suite-1.cy.ts | 2 +- .../return-management-suite-1.cy.ts | 11 +- .../e2e/yves/checkout/checkout-suite-1.cy.ts | 40 ++++-- .../comments/dynamic/comments-suite-1.json | 32 ++--- .../dynamic/order-management-suite-1.json | 11 ++ .../dynamic/return-management-suite-1.json | 15 ++- .../checkout/dynamic/checkout-suite-1.json | 123 +++++++++++++----- .../comments/dynamic/comments-suite-1.json | 32 ++--- .../checkout/address/checkout-address-page.ts | 22 +++- .../scenarios/yves/checkout-scenario.ts | 10 +- .../order-managment/fixture-types.ts | 3 +- .../transfer/transfer-types.ts | 4 + .../return-managment/fixture-types.ts | 7 +- .../transfer/transfer-types.ts | 4 + .../types/yves/checkout/fixture-types.ts | 13 +- .../yves/checkout/transfer/transfer-types.ts | 4 + 16 files changed, 235 insertions(+), 98 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 9434eddb..1bf401ee 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 @@ -25,7 +25,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); - checkoutScenario.execute(); + checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); 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 4bb30cba..f4d1a76a 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,3 @@ -import { MultiCartPage } from '../../../support/pages/yves'; import { container } from '../../../support/utils/inversify/inversify.config'; import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '../../../support/pages/backoffice'; import { CheckoutScenario, CustomerLoginScenario } from '../../../support/scenarios/yves'; @@ -9,7 +8,6 @@ import { } from '../../../support/types/backoffice/return-managment/fixture-types'; describe('return management suite 1', { tags: ['@return-management'] }, (): void => { - const multiCartPage: MultiCartPage = container.get(MultiCartPage); const salesIndexPage: SalesIndexPage = container.get(SalesIndexPage); const salesDetailPage: SalesDetailPage = container.get(SalesDetailPage); const salesReturnGuiCreatePage: SalesReturnGuiCreatePage = container.get(SalesReturnGuiCreatePage); @@ -26,13 +24,10 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void beforeEach((): void => { customerLoginScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - multiCartPage.visit(); }); it('should be able to create return from (from shipped order state)', (): void => { - multiCartPage.selectCart(dynamicFixtures.quoteOne.name); - checkoutScenario.execute(); - + checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); salesIndexPage.visit(); @@ -49,9 +44,7 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void }); it('should be able to create return from (from delivery order state)', (): void => { - multiCartPage.selectCart(dynamicFixtures.quoteTwo.name); - checkoutScenario.execute(); - + checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); userLoginScenario.execute(dynamicFixtures.rootUser.username, staticFixtures.defaultPassword); salesIndexPage.visit(); diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts index 98abf4ce..1e0f18ee 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts @@ -20,8 +20,8 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { it('guest customer should checkout to single shipment', (): void => { cartPage.visit(); - cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 1); - cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 1); + cartPage.quickAddToCart(dynamicFixtures.product1.sku, 1); + cartPage.quickAddToCart(dynamicFixtures.product2.sku, 1); checkoutScenario.execute(true); @@ -30,27 +30,51 @@ describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { it('guest customer should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { cartPage.visit(); - cartPage.quickAddToCart(dynamicFixtures.productOne.sku, 1); - cartPage.quickAddToCart(dynamicFixtures.productTwo.sku, 1); + cartPage.quickAddToCart(dynamicFixtures.product1.sku, 1); + cartPage.quickAddToCart(dynamicFixtures.product2.sku, 1); checkoutScenario.execute(true, true); cy.contains('Your order has been placed successfully!'); }); - it('customer should checkout to single shipment', (): void => { + it('customer should checkout to single shipment (with customer shipping address)', (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(); + checkoutScenario.execute(false, false, dynamicFixtures.address.id_customer_address); cy.contains('Your order has been placed successfully!'); }); - it('customer should checkout to multi shipment address', { tags: ['@smoke'] }, (): void => { + it('customer should checkout to single shipment (with new shipping address)', (): void => { loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); - checkoutScenario.execute(false, true); + checkoutScenario.execute(false, false); cy.contains('Your order has been placed successfully!'); }); + + it( + 'customer should checkout to multi shipment address (with customer shipping address)', + { tags: ['@smoke'] }, + (): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + + checkoutScenario.execute(false, true, dynamicFixtures.address.id_customer_address); + + cy.contains('Your order has been placed successfully!'); + } + ); + + it( + 'customer should checkout to multi shipment address (with new shipping address)', + { tags: ['@smoke'] }, + (): void => { + loginCustomerScenario.execute(dynamicFixtures.customer.email, staticFixtures.defaultPassword); + + checkoutScenario.execute(false, true); + + cy.contains('Your order has been placed successfully!'); + } + ); }); diff --git a/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json index bce312ee..52004230 100644 --- a/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json +++ b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json @@ -31,20 +31,20 @@ { "type": "helper", "name": "haveFullProduct", - "key": "productOne" + "key": "product1" }, { "type": "helper", "name": "haveFullProduct", - "key": "productTwo" + "key": "product2" }, { "type": "helper", "name": "havePriceProduct", "arguments": [ { - "skuProductAbstract": "#productOne.abstract_sku", - "skuProduct": "#productOne.sku", + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] @@ -54,8 +54,8 @@ "name": "havePriceProduct", "arguments": [ { - "skuProductAbstract": "#productTwo.abstract_sku", - "skuProduct": "#productTwo.sku", + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] @@ -63,12 +63,12 @@ { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#productOne.sku", "isNeverOutOfStock": "1" }] + "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#productTwo.sku", "isNeverOutOfStock": "1" }] + "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] }, { "type": "transfer", @@ -85,8 +85,8 @@ "arguments": [ { "name": "default", - "idProduct": "#productOne.id_product_concrete", - "idProductAbstract": "#productOne.fk_product_abstract", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", "productImages": ["#productImage"] } ] @@ -97,8 +97,8 @@ "arguments": [ { "name": "default", - "idProduct": "#productTwo.id_product_concrete", - "idProductAbstract": "#productTwo.fk_product_abstract", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", "productImages": ["#productImage"] } ] @@ -112,13 +112,13 @@ "customer": "#customer", "items": [ { - "sku": "#productOne.sku", - "abstractSku": "#productOne.abstract_sku", + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", "quantity": 1 }, { - "sku": "#productTwo.sku", - "abstractSku": "#productTwo.abstract_sku", + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", "quantity": 2 } ] 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 index 177aa115..e9f56091 100644 --- 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 @@ -16,12 +16,23 @@ "key": "locale", "arguments": { "id_locale": 66, "locale_name": "en_US" } }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, { "type": "helper", "name": "haveCustomer", "key": "customer", "arguments": [{ "locale": "#locale", "password": "change123" }] }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [{ "fkCustomer": "#customer.id_customer", "fkCountry": "#country.id_country" }] + }, { "type": "helper", "name": "confirmCustomer", 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 index b9edc3b5..dbc9038d 100644 --- 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 @@ -27,12 +27,23 @@ "key": "locale", "arguments": { "id_locale": 66, "locale_name": "en_US" } }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, { "type": "helper", "name": "haveCustomer", "key": "customer", "arguments": [{ "locale": "#locale", "password": "change123" }] }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [{ "fkCustomer": "#customer.id_customer", "fkCountry": "#country.id_country" }] + }, { "type": "helper", "name": "confirmCustomer", @@ -86,7 +97,7 @@ { "type": "helper", "name": "havePersistentQuote", - "key": "quoteOne", + "key": "quote1", "arguments": [ { "customer": "#customer", @@ -105,7 +116,7 @@ { "type": "helper", "name": "havePersistentQuote", - "key": "quoteTwo", + "key": "quote2", "arguments": [ { "customer": "#customer", diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json index 9aa147fb..5013f70c 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json @@ -16,12 +16,23 @@ "key": "locale", "arguments": { "id_locale": 66, "locale_name": "en_US" } }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, { "type": "helper", "name": "haveCustomer", "key": "customer", "arguments": [{ "locale": "#locale", "password": "change123" }] }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [{ "fkCustomer": "#customer.id_customer", "fkCountry": "#country.id_country" }] + }, { "type": "helper", "name": "confirmCustomer", @@ -31,7 +42,7 @@ { "type": "helper", "name": "haveFullProduct", - "key": "productOne" + "key": "product1" }, { "type": "transfer", @@ -48,8 +59,8 @@ "arguments": [ { "name": "default", - "idProduct": "#productOne.id_product_concrete", - "idProductAbstract": "#productOne.fk_product_abstract", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", "productImages": ["#productImage"] } ] @@ -57,7 +68,7 @@ { "type": "helper", "name": "haveFullProduct", - "key": "productTwo" + "key": "product2" }, { "type": "helper", @@ -65,8 +76,8 @@ "arguments": [ { "name": "default", - "idProduct": "#productTwo.id_product_concrete", - "idProductAbstract": "#productTwo.fk_product_abstract", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", "productImages": ["#productImage"] } ] @@ -74,11 +85,11 @@ { "type": "helper", "name": "havePriceProduct", - "key": "productOneWithPrice", + "key": "product1WithPrice", "arguments": [ { - "skuProductAbstract": "#productOne.abstract_sku", - "skuProduct": "#productOne.sku", + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", "moneyValue": { "netAmount": 30000, "grossAmount": 30000 @@ -89,11 +100,11 @@ { "type": "helper", "name": "havePriceProduct", - "key": "productTwoWithPrice", + "key": "product2WithPrice", "arguments": [ { - "skuProductAbstract": "#productTwo.abstract_sku", - "skuProduct": "#productTwo.sku", + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] @@ -101,34 +112,86 @@ { "type": "helper", "name": "haveProductInStockForStore", - "key": "productOneWithPriceAndStore", - "arguments": ["#store", { "sku": "#productOne.sku", "isNeverOutOfStock": "1" }] + "key": "product1WithPriceAndStore", + "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", "name": "haveProductInStockForStore", - "key": "productTwoWithPriceAndStore", - "arguments": ["#store", { "sku": "#productTwo.sku", "isNeverOutOfStock": "1" }] + "key": "product2WithPriceAndStore", + "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote1", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "name": "#product1.name", + "quantity": 1, + "unitPrice": 30000 + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "name": "#product2.name", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote2", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "name": "#product1.name", + "quantity": 1, + "unitPrice": 30000 + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "name": "#product2.name", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] }, { "type": "helper", "name": "havePersistentQuote", - "key": "quoteOne", + "key": "quote3", "arguments": [ { "customer": "#customer", "items": [ { - "sku": "#productOne.sku", - "abstractSku": "#productOne.abstract_sku", - "name": "#productOne.name", + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "name": "#product1.name", "quantity": 1, "unitPrice": 30000 }, { - "sku": "#productTwo.sku", - "abstractSku": "#productTwo.abstract_sku", - "name": "#productTwo.name", + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "name": "#product2.name", "quantity": 1, "unitPrice": 30000 } @@ -139,22 +202,22 @@ { "type": "helper", "name": "havePersistentQuote", - "key": "quoteTwo", + "key": "quote4", "arguments": [ { "customer": "#customer", "items": [ { - "sku": "#productOne.sku", - "abstractSku": "#productOne.abstract_sku", - "name": "#productOne.name", + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "name": "#product1.name", "quantity": 1, "unitPrice": 30000 }, { - "sku": "#productTwo.sku", - "abstractSku": "#productTwo.abstract_sku", - "name": "#productTwo.name", + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "name": "#product2.name", "quantity": 1, "unitPrice": 30000 } diff --git a/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json index bce312ee..52004230 100644 --- a/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json +++ b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json @@ -31,20 +31,20 @@ { "type": "helper", "name": "haveFullProduct", - "key": "productOne" + "key": "product1" }, { "type": "helper", "name": "haveFullProduct", - "key": "productTwo" + "key": "product2" }, { "type": "helper", "name": "havePriceProduct", "arguments": [ { - "skuProductAbstract": "#productOne.abstract_sku", - "skuProduct": "#productOne.sku", + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] @@ -54,8 +54,8 @@ "name": "havePriceProduct", "arguments": [ { - "skuProductAbstract": "#productTwo.abstract_sku", - "skuProduct": "#productTwo.sku", + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } } ] @@ -63,12 +63,12 @@ { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#productOne.sku", "isNeverOutOfStock": "1" }] + "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#productTwo.sku", "isNeverOutOfStock": "1" }] + "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] }, { "type": "transfer", @@ -85,8 +85,8 @@ "arguments": [ { "name": "default", - "idProduct": "#productOne.id_product_concrete", - "idProductAbstract": "#productOne.fk_product_abstract", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", "productImages": ["#productImage"] } ] @@ -97,8 +97,8 @@ "arguments": [ { "name": "default", - "idProduct": "#productTwo.id_product_concrete", - "idProductAbstract": "#productTwo.fk_product_abstract", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", "productImages": ["#productImage"] } ] @@ -112,13 +112,13 @@ "customer": "#customer", "items": [ { - "sku": "#productOne.sku", - "abstractSku": "#productOne.abstract_sku", + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", "quantity": 1 }, { - "sku": "#productTwo.sku", - "abstractSku": "#productTwo.abstract_sku", + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", "quantity": 2 } ] 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 12ef7331..9acbd647 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -14,7 +14,16 @@ export class CheckoutAddressPage extends YvesPage { super(); } - public fillShippingAddress = (): void => { + public fillShippingAddress = (idCustomerAddress?: number): void => { + if (idCustomerAddress) { + this.repository.getSelectShippingAddressField().select(idCustomerAddress.toString()); + this.repository.getShippingAddressBillingSameAsShippingCheckbox().check({ force: true }); + + this.repository.getNextButton().click(); + + return; + } + const checkoutAddress = this.createDummyCheckoutAddress(); this.repository.getSelectShippingAddressField().select('0'); @@ -34,7 +43,7 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getNextButton().click(); }; - public fillMultiShippingAddress = (): void => { + public fillMultiShippingAddress = (idCustomerAddress?: number): void => { this.repository.getMultiShipmentTriggerButton().click(); this.repository @@ -44,6 +53,15 @@ export class CheckoutAddressPage extends YvesPage { const checkoutAddress = this.createDummyCheckoutAddress(); this.repository.getMultiShipmentAddressItemDeliveryRadio($addressItem, index).click({ force: true }); + + if (idCustomerAddress) { + this.repository + .getMultiShipmentAddressItemAddressField($addressItem, index) + .select(idCustomerAddress.toString(), { force: true }); + + return; + } + this.repository.getMultiShipmentAddressItemAddressField($addressItem, index).select('0', { force: true }); // Setting mandatory fields diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 6e68ac05..6b74dc36 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): void => { + public execute = (isGuest: boolean = false, isMultiShipment: boolean = false, idCustomerAddress?: number): void => { this.cartPage.visit(); this.cartPage.startCheckout(); @@ -32,7 +32,7 @@ export class CheckoutScenario { this.checkoutCustomerPage.checkoutAsGuest(); } - this.fillShippingAddress(isMultiShipment); + this.fillShippingAddress(isMultiShipment, idCustomerAddress); this.checkoutShipmentPage.setStandardShippingMethod(); this.checkoutPaymentPage.setDummyPaymentMethod(); this.checkoutSummaryPage.placeOrder(); @@ -41,13 +41,13 @@ export class CheckoutScenario { this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; - private fillShippingAddress = (isMultiShipment: boolean = false): void => { + private fillShippingAddress = (isMultiShipment: boolean = false, idCustomerAddress?: number): void => { if (isMultiShipment) { - this.checkoutAddressPage.fillMultiShippingAddress(); + this.checkoutAddressPage.fillMultiShippingAddress(idCustomerAddress); return; } - this.checkoutAddressPage.fillShippingAddress(); + this.checkoutAddressPage.fillShippingAddress(idCustomerAddress); }; } diff --git a/cypress/support/types/backoffice/order-managment/fixture-types.ts b/cypress/support/types/backoffice/order-managment/fixture-types.ts index d9b1a794..f9085bfd 100644 --- a/cypress/support/types/backoffice/order-managment/fixture-types.ts +++ b/cypress/support/types/backoffice/order-managment/fixture-types.ts @@ -1,7 +1,8 @@ -import { Customer, Product, User } from './transfer/transfer-types'; +import { Address, Customer, Product, User } from './transfer/transfer-types'; export interface OrderManagementSuite1DynamicFixtures { customer: Customer; + address: Address; product: Product; rootUser: User; } diff --git a/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts b/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts index f49145d6..efc8e3d4 100644 --- a/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts +++ b/cypress/support/types/backoffice/order-managment/transfer/transfer-types.ts @@ -2,6 +2,10 @@ export interface Customer { email: string; } +export interface Address { + id_customer_address: number; +} + export interface Product { sku: string; name: string; diff --git a/cypress/support/types/backoffice/return-managment/fixture-types.ts b/cypress/support/types/backoffice/return-managment/fixture-types.ts index b9169f9d..ac136175 100644 --- a/cypress/support/types/backoffice/return-managment/fixture-types.ts +++ b/cypress/support/types/backoffice/return-managment/fixture-types.ts @@ -1,11 +1,12 @@ -import { Customer, Product, Quote, User } from './transfer/transfer-types'; +import { Address, Customer, Product, Quote, User } from './transfer/transfer-types'; export interface ReturnManagementSuite1DynamicFixtures { rootUser: User; customer: Customer; + address: Address; product: Product; - quoteOne: Quote; - quoteTwo: Quote; + quote1: Quote; + quote2: Quote; } export interface ReturnManagementStaticFixtures { diff --git a/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts b/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts index 41cc8b9f..9f3db3e2 100644 --- a/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts +++ b/cypress/support/types/backoffice/return-managment/transfer/transfer-types.ts @@ -2,6 +2,10 @@ export interface Customer { email: string; } +export interface Address { + id_customer_address: number; +} + export interface Product { sku: string; } diff --git a/cypress/support/types/yves/checkout/fixture-types.ts b/cypress/support/types/yves/checkout/fixture-types.ts index ec26ad6d..07b533ab 100644 --- a/cypress/support/types/yves/checkout/fixture-types.ts +++ b/cypress/support/types/yves/checkout/fixture-types.ts @@ -1,11 +1,14 @@ -import { Customer, Product, Quote } from './transfer/transfer-types'; +import { Address, Customer, Product, Quote } from './transfer/transfer-types'; export interface CheckoutSuite1DynamicFixtures { customer: Customer; - productOne: Product; - productTwo: Product; - quoteOne: Quote; - quoteTwo: Quote; + address: Address; + product1: Product; + product2: Product; + quote1: Quote; + quote2: Quote; + quote3: Quote; + quote4: Quote; } export interface CheckoutStaticFixtures { diff --git a/cypress/support/types/yves/checkout/transfer/transfer-types.ts b/cypress/support/types/yves/checkout/transfer/transfer-types.ts index 2c40c2e8..929f7b8e 100644 --- a/cypress/support/types/yves/checkout/transfer/transfer-types.ts +++ b/cypress/support/types/yves/checkout/transfer/transfer-types.ts @@ -9,3 +9,7 @@ export interface Product { export interface Quote { name: string; } + +export interface Address { + id_customer_address: number; +} From c4d5961ad8061b7d9d370c0ca9de2176582d07df Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 4 Mar 2024 19:36:59 +0300 Subject: [PATCH 28/53] Fixed issues after enabling eslint. --- .eslintrc | 10 ++++-- .../merchant/list/merchant-list-page.ts | 4 ++- .../merchant/update/merchant-update-page.ts | 4 ++- .../backoffice/user/index/user-index-page.ts | 4 ++- .../agent-dashboard/agent-dashboard-page.ts | 4 ++- .../support/pages/mp/offers/offers-page.ts | 4 ++- .../pages/mp/products/products-page.ts | 4 ++- .../pages/mp/sales/sales-orders-page.ts | 4 ++- .../scenarios/yves/checkout-mp-scenario.ts | 1 - .../scenarios/yves/checkout-scenario.ts | 1 - package-lock.json | 33 +++++++++++++------ package.json | 5 +-- tsconfig.json | 2 +- 13 files changed, 56 insertions(+), 24 deletions(-) diff --git a/.eslintrc b/.eslintrc index 79bd6ef2..6b6d43e3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,6 +5,12 @@ "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ] + "plugin:@typescript-eslint/recommended", + "plugin:cypress/recommended" + ], + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module", + "project": "./tsconfig.json" + } } 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 5fdc4f65..5f7a322a 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts @@ -58,7 +58,9 @@ export class MerchantListPage extends BackofficePage { }; public findMerchant = (query: string): Cypress.Chainable => { - cy.get(this.repository.getSearchSelector()).clear().type(query); + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(query); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/merchant-gui/list-merchant/table**').as(interceptAlias); 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 00ca8b9d..fb26990f 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -14,7 +14,9 @@ export class MerchantUpdatePage extends BackofficePage { } public findUser = (email: string): Cypress.Chainable => { - cy.get(this.repository.getSearchSelector()).clear().type(email); + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(email); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/merchant-user-gui/index/table**').as(interceptAlias); 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 88969c9d..1ab0e093 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-page.ts @@ -52,7 +52,9 @@ export class UserIndexPage extends BackofficePage { }; public findUser = (query: string): Cypress.Chainable => { - cy.get(this.repository.getSearchSelector()).clear().type(query); + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(query); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/user/index/table**').as(interceptAlias); 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 84120ce8..f9f8c2ae 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -29,7 +29,9 @@ export class AgentDashboardPage extends MpPage { }; public findMerchantUser = (query: string, counter: number = 1): Cypress.Chainable => { - cy.get(this.repository.getSearchSelector()).clear().type(query); + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(query); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/agent-dashboard-merchant-portal-gui/merchant-users/table-data**').as(interceptAlias); diff --git a/cypress/support/pages/mp/offers/offers-page.ts b/cypress/support/pages/mp/offers/offers-page.ts index 4591e1e9..4330c2ee 100644 --- a/cypress/support/pages/mp/offers/offers-page.ts +++ b/cypress/support/pages/mp/offers/offers-page.ts @@ -14,7 +14,9 @@ export class OffersPage extends MpPage { } public findOffer = (query: string): Cypress.Chainable => { - cy.get(this.repository.getSearchSelector()).clear().type(query); + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(query); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/product-offer-merchant-portal-gui/product-offers/table-data**').as(interceptAlias); diff --git a/cypress/support/pages/mp/products/products-page.ts b/cypress/support/pages/mp/products/products-page.ts index 247e2c03..32060228 100644 --- a/cypress/support/pages/mp/products/products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -14,7 +14,9 @@ export class ProductsPage extends MpPage { } public findProduct = (query: string): Cypress.Chainable => { - cy.get(this.repository.getSearchSelector()).clear().type(query); + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(query); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/product-merchant-portal-gui/products/table-data**').as(interceptAlias); diff --git a/cypress/support/pages/mp/sales/sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts index 37ee86b0..d27900f0 100644 --- a/cypress/support/pages/mp/sales/sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -14,7 +14,9 @@ export class SalesOrdersPage extends MpPage { } public findOrder = (query: string): Cypress.Chainable => { - cy.get(this.repository.getSearchSelector()).clear().type(query); + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(query); const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', '/sales-merchant-portal-gui/orders/table-data**').as(interceptAlias); diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index 01be286e..3f01b64c 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -37,7 +37,6 @@ export class CheckoutMpScenario { this.checkoutPaymentPage.setDummyMarketplacePaymentMethod(); this.checkoutSummaryPage.placeOrder(); - cy.wait(1000); // Wait for OMS to process the order this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 6b74dc36..305a9485 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -37,7 +37,6 @@ export class CheckoutScenario { this.checkoutPaymentPage.setDummyPaymentMethod(); this.checkoutSummaryPage.placeOrder(); - cy.wait(1000); // Wait for OMS to process the order this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); }; diff --git a/package-lock.json b/package-lock.json index 25679ac3..e7ab94e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,10 +12,11 @@ "@cypress/grep": "^4.0.1", "@faker-js/faker": "^8.3.1", "@types/dotenv": "^8.2.0", - "@typescript-eslint/eslint-plugin": "^6.13.1", + "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.13.1", "cypress": "^13.6.6", - "eslint": "^8.55.0", + "eslint": "^8.57.0", + "eslint-plugin-cypress": "^2.15.1", "inversify": "^6.0.2", "prettier": "3.1.0", "reflect-metadata": "^0.2.0", @@ -709,9 +710,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1981,16 +1982,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -2035,6 +2036,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-plugin-cypress": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.15.1.tgz", + "integrity": "sha512-eLHLWP5Q+I4j2AWepYq0PgFEei9/s5LvjuSqWrxurkg1YZ8ltxdvMNmdSf0drnsNo57CTgYY/NIHHLRSWejR7w==", + "dev": true, + "dependencies": { + "globals": "^13.20.0" + }, + "peerDependencies": { + "eslint": ">= 3.2.1" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", diff --git a/package.json b/package.json index 5e015008..4ddc69cb 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,11 @@ "@cypress/grep": "^4.0.1", "@faker-js/faker": "^8.3.1", "@types/dotenv": "^8.2.0", - "@typescript-eslint/eslint-plugin": "^6.13.1", + "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.13.1", "cypress": "^13.6.6", - "eslint": "^8.55.0", + "eslint": "^8.57.0", + "eslint-plugin-cypress": "^2.15.1", "inversify": "^6.0.2", "prettier": "3.1.0", "reflect-metadata": "^0.2.0", diff --git a/tsconfig.json b/tsconfig.json index 12f3540b..0d9b7d5a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,5 @@ "emitDecoratorMetadata": true, "baseUrl": "./" }, - "include": ["cypress/**/*.ts"] + "include": ["cypress/**/*.ts", "cypress.config.ts", "cypress/support/commands.js", "cypress/support/e2e.js"] } From 76ef14c601c8073ea5956b3b79e2a414213c7eb8 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 4 Mar 2024 19:43:12 +0300 Subject: [PATCH 29/53] Small adjustments. --- cypress.config.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index 6a50c77a..32347cbc 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -4,10 +4,6 @@ import * as fs from 'fs'; dotenv.config(); -function getEnvVar(primary: string, fallback: string): string { - return process.env[primary] || process.env[fallback]; -} - const protocolMap: { [key: string]: 'http' | 'https' } = { '1': 'https', '0': 'http', @@ -46,3 +42,10 @@ export default defineConfig({ viewportWidth: parseInt(process.env.VIEWPORT_WIDGTH ?? '1000', 10), viewportHeight: parseInt(process.env.VIEWPORT_HEIGHT ?? '660', 10), }); + +function getEnvVar(primary: string, fallback: string): string { + const primaryValue = process.env[primary]; + const fallbackValue = process.env[fallback]; + + return primaryValue !== undefined ? primaryValue : fallbackValue !== undefined ? fallbackValue : ''; +} From 0519a0e5427ddc81052a305445b6037392cd36f5 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Tue, 5 Mar 2024 19:55:17 +0300 Subject: [PATCH 30/53] Adjustments after refactoring. --- .../b2b/yves/comments/dynamic/comments-suite-1.json | 2 +- .../dynamic/order-management-suite-1.json | 2 +- .../dynamic/return-management-suite-1.json | 2 +- .../dynamic/marketplace-agent-assist-suite-1.json | 2 +- .../dynamic/marketplace-agent-assist-suite-2.json | 2 +- .../suite/yves/checkout/dynamic/checkout-suite-1.json | 2 +- .../suite/yves/comments/dynamic/comments-suite-1.json | 2 +- cypress/support/commands.js | 8 +++----- cypress/support/helpers/cli-helper.ts | 4 ++-- 9 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json index 52004230..80bced72 100644 --- a/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json +++ b/cypress/fixtures/b2b/yves/comments/dynamic/comments-suite-1.json @@ -1,6 +1,6 @@ { "data": { - "type": "test-operation-runner", + "type": "dynamic-fixtures", "attributes": { "synchronize": true, "operations": [ 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 index e9f56091..04fabb77 100644 --- 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 @@ -1,6 +1,6 @@ { "data": { - "type": "test-operation-runner", + "type": "dynamic-fixtures", "attributes": { "synchronize": true, "operations": [ 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 index dbc9038d..b92bf7ca 100644 --- 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 @@ -1,6 +1,6 @@ { "data": { - "type": "test-operation-runner", + "type": "dynamic-fixtures", "attributes": { "synchronize": true, "operations": [ 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 index b973e1a4..37d44589 100644 --- 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 @@ -1,6 +1,6 @@ { "data": { - "type": "test-operation-runner", + "type": "dynamic-fixtures", "attributes": { "synchronize": true, "operations": [ 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 index f1ba5aad..0074e849 100644 --- 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 @@ -1,6 +1,6 @@ { "data": { - "type": "test-operation-runner", + "type": "dynamic-fixtures", "attributes": { "synchronize": true, "operations": [ diff --git a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json index 5013f70c..cb9eed78 100644 --- a/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json +++ b/cypress/fixtures/suite/yves/checkout/dynamic/checkout-suite-1.json @@ -1,6 +1,6 @@ { "data": { - "type": "test-operation-runner", + "type": "dynamic-fixtures", "attributes": { "synchronize": true, "operations": [ diff --git a/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json index 52004230..80bced72 100644 --- a/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json +++ b/cypress/fixtures/suite/yves/comments/dynamic/comments-suite-1.json @@ -1,6 +1,6 @@ { "data": { - "type": "test-operation-runner", + "type": "dynamic-fixtures", "attributes": { "synchronize": true, "operations": [ diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 60c107ed..6d46d888 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -38,7 +38,7 @@ Cypress.Commands.add('loadDynamicFixturesByPayload', (dynamicFixturesFilePath) = return cy .request({ method: 'POST', - url: Cypress.env().glueBackendUrl + '/test-operation-runner', + url: Cypress.env().glueBackendUrl + '/dynamic-fixtures', headers: { 'Content-Type': 'application/vnd.api+json', }, @@ -47,15 +47,13 @@ Cypress.Commands.add('loadDynamicFixturesByPayload', (dynamicFixturesFilePath) = }) .then((response) => { if (Array.isArray(response.body.data)) { - // If the response data is an array, map over it and create an object with dynamic keys return response.body.data.reduce((acc, item) => { - acc[item.type] = item.attributes; + acc[item.attributes.key] = item.attributes.data; return acc; }, {}); } else { - // If the response data is a single item, create an object with a dynamic key return { - [response.body.data.type]: response.body.data.attributes.properties, + [response.body.data.attributes.key]: response.body.data.attributes.data, }; } }); diff --git a/cypress/support/helpers/cli-helper.ts b/cypress/support/helpers/cli-helper.ts index 8e4f6a76..e75e5bc1 100644 --- a/cypress/support/helpers/cli-helper.ts +++ b/cypress/support/helpers/cli-helper.ts @@ -14,13 +14,13 @@ export class CliHelper { cy.request({ method: 'POST', - url: Cypress.env().glueBackendUrl + '/test-operation-runner', + url: Cypress.env().glueBackendUrl + '/dynamic-fixtures', headers: { 'Content-Type': 'application/vnd.api+json', }, body: { data: { - type: 'test-operation-runner', + type: 'dynamic-fixtures', attributes: { operations: operations, }, From 9295c8269e187b5c61490e080afbbaf788aa98db Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Wed, 6 Mar 2024 15:46:45 +0300 Subject: [PATCH 31/53] Adjusted npm version. --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7ab94e7..4b010ae1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ }, "engines": { "node": ">=18.0.0", - "npm": ">=10.0.0" + "npm": ">=9.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 4ddc69cb..57ad3856 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "engines": { "node": ">=18.0.0", - "npm": ">=10.0.0" + "npm": ">=9.0.0" }, "devDependencies": { "@cypress/grep": "^4.0.1", From 12e6987e0159e35aad213c4bc583d303d9008b44 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Wed, 6 Mar 2024 16:53:09 +0300 Subject: [PATCH 32/53] Adjusted default browser to enable it in CI. --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 57ad3856..12cd3d20 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,11 @@ "prettier:check": "npx prettier . --check", "prettier:write": "npx prettier . --write", "cy:open": "cypress open", - "cy:run": "cypress run --headless --browser chrome", - "cy:yves": "npx cypress run --spec cypress/e2e/yves/* --headless --browser chrome", - "cy:backoffice": "npx cypress run --spec cypress/e2e/backoffice/* --headless --browser chrome", - "cy:mp": "npx cypress run --spec cypress/e2e/mp/* --headless --browser chrome", - "cy:feature:comments": "npx cypress run --env grepTags=@comments --headless --browser chrome" + "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" }, "engines": { "node": ">=18.0.0", From ef5e9f7516227fa5cabb491034840b5a74191d74 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 6 Mar 2024 19:29:13 +0200 Subject: [PATCH 33/53] 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 34/53] 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 35/53] 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 36/53] 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 37/53] 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 38/53] 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 39/53] 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 40/53] 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 41/53] 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 42/53] 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 43/53] 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 44/53] 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 45/53] 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 46/53] 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 47/53] 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 48/53] 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 = ( From 2355852f556a4f52e005dd06a1ee8302300d0c2f Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 11 Mar 2024 15:30:28 +0300 Subject: [PATCH 49/53] Fixed array-object type. --- .../dynamic-marketplace-agent-assist-suite-1.json | 2 +- .../dynamic-marketplace-agent-assist-suite-2.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 index 37d44589..382d4ca5 100644 --- 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 @@ -67,7 +67,7 @@ "arguments": { "id_store": 1, "name": "DE" } }, { - "type": "arrayObject", + "type": "array-object", "key": "stores", "arguments": ["#store"] }, 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 index 0074e849..4b6145d0 100644 --- 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 @@ -44,7 +44,7 @@ "arguments": { "id_store": 1, "name": "DE" } }, { - "type": "arrayObject", + "type": "array-object", "key": "stores", "arguments": ["#store"] }, From 4f2b7e62b8f35cc4a4dd587b13d17e699265e56a Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Tue, 12 Mar 2024 13:25:05 +0300 Subject: [PATCH 50/53] Removed cli-helper. --- cypress/support/commands.ts | 26 +++++++++++++++ cypress/support/index.d.ts | 5 +++ .../sales/detail/sales-detail-page.ts | 12 ++----- .../scenarios/yves/checkout-mp-scenario.ts | 5 ++- .../scenarios/yves/checkout-scenario.ts | 5 ++- cypress/support/utils/cli-helper.ts | 32 ------------------- cypress/support/utils/index.ts | 1 - 7 files changed, 38 insertions(+), 48 deletions(-) delete mode 100644 cypress/support/utils/cli-helper.ts diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 97421b08..63f84680 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -99,3 +99,29 @@ Cypress.Commands.add('reloadUntilFound', (url, findSelector, getSelector = 'body } }); }); + +Cypress.Commands.add('runCliCommands', (commands) => { + const operations = commands.map((command) => { + return { + type: 'cli-command', + name: command, + }; + }); + + cy.request({ + method: 'POST', + url: Cypress.env().glueBackendUrl + '/dynamic-fixtures', + headers: { + 'Content-Type': 'application/vnd.api+json', + }, + body: { + data: { + type: 'dynamic-fixtures', + attributes: { + operations: operations, + }, + }, + timeout: 20000, + }, + }); +}); diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index dfa7217a..4580fe2e 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -41,5 +41,10 @@ declare namespace Cypress { * @example cy.reloadUntilFound('/transactions', 'td:contains($4.44)') */ reloadUntilFound(url: string, findSelector: string, getSelector: string, retries: number, retryWait: number): void; + + /** + * @example cy.runCliCommands(['console oms:check-condition', 'console oms:check-timeout']) + */ + runCliCommands(commands: string[]): void; } } 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 b3f4de11..ab24a8a4 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,5 @@ -import { autoWired, CliHelper } from '@utils'; +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; - import { BackofficePage } from '../../backoffice-page'; import { SalesDetailRepository } from './sales-detail-repository'; @@ -9,16 +8,11 @@ import { SalesDetailRepository } from './sales-detail-repository'; export class SalesDetailPage extends BackofficePage { protected PAGE_URL = '/sales/detail'; - constructor( - @inject(SalesDetailRepository) private repository: SalesDetailRepository, - @inject(CliHelper) private cliHelper: CliHelper - ) { - super(); - } + @inject(SalesDetailRepository) private repository: SalesDetailRepository; triggerOms = (state: string, shouldTriggerOmsInCli = false): void => { if (shouldTriggerOmsInCli) { - this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); + cy.runCliCommands(['console oms:check-condition', 'console oms:check-timeout']); } cy.url().then((url) => { diff --git a/cypress/support/scenarios/yves/checkout-mp-scenario.ts b/cypress/support/scenarios/yves/checkout-mp-scenario.ts index 3a22951f..eb74c40a 100644 --- a/cypress/support/scenarios/yves/checkout-mp-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-mp-scenario.ts @@ -6,7 +6,7 @@ import { CheckoutShipmentPage, CheckoutSummaryPage, } from '@pages/yves'; -import { CliHelper, autoWired } from '@utils'; +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; interface CheckoutMpExecuteParams { @@ -23,7 +23,6 @@ export class CheckoutMpScenario { @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage; @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage; @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage; - @inject(CliHelper) private cliHelper: CliHelper; execute = (params: CheckoutMpExecuteParams): void => { const { isGuest, isMultiShipment } = params; @@ -40,7 +39,7 @@ export class CheckoutMpScenario { this.checkoutPaymentPage.setDummyMarketplacePaymentMethod(); this.checkoutSummaryPage.placeOrder(); - this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); + cy.runCliCommands(['console oms:check-condition', 'console oms:check-timeout']); }; private fillShippingAddress = (isMultiShipment = false): void => { diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 4e032f37..e9f1419a 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -6,7 +6,7 @@ import { CheckoutShipmentPage, CheckoutSummaryPage, } from '@pages/yves'; -import { CliHelper, autoWired } from '@utils'; +import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; interface CheckoutExecuteParams { @@ -24,7 +24,6 @@ export class CheckoutScenario { @inject(CheckoutShipmentPage) private checkoutShipmentPage: CheckoutShipmentPage; @inject(CheckoutPaymentPage) private checkoutPaymentPage: CheckoutPaymentPage; @inject(CheckoutSummaryPage) private checkoutSummaryPage: CheckoutSummaryPage; - @inject(CliHelper) private cliHelper: CliHelper; execute = (params: CheckoutExecuteParams): void => { const { isGuest, isMultiShipment, idCustomerAddress } = params; @@ -41,7 +40,7 @@ export class CheckoutScenario { this.checkoutPaymentPage.setDummyPaymentMethod(); this.checkoutSummaryPage.placeOrder(); - this.cliHelper.run(['console oms:check-condition', 'console oms:check-timeout']); + cy.runCliCommands(['console oms:check-condition', 'console oms:check-timeout']); }; private fillShippingAddress = (isMultiShipment = false, idCustomerAddress?: number): void => { diff --git a/cypress/support/utils/cli-helper.ts b/cypress/support/utils/cli-helper.ts deleted file mode 100644 index 15edd904..00000000 --- a/cypress/support/utils/cli-helper.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { injectable } from 'inversify'; -import { autoWired } from './inversify'; - -@injectable() -@autoWired -export class CliHelper { - run = (commands: string[]): void => { - const operations = commands.map((command) => { - return { - type: 'cli-command', - name: command, - }; - }); - - cy.request({ - method: 'POST', - url: Cypress.env().glueBackendUrl + '/dynamic-fixtures', - headers: { - 'Content-Type': 'application/vnd.api+json', - }, - body: { - data: { - type: 'dynamic-fixtures', - attributes: { - operations: operations, - }, - }, - timeout: 20000, - }, - }); - }; -} diff --git a/cypress/support/utils/index.ts b/cypress/support/utils/index.ts index 8d54c9bb..2d0ff09e 100644 --- a/cypress/support/utils/index.ts +++ b/cypress/support/utils/index.ts @@ -1,2 +1 @@ -export * from './cli-helper'; export * from './inversify'; From 6cdc3f24dc15683e602b7c7f5c94377d8adc1c54 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Tue, 12 Mar 2024 19:01:01 +0300 Subject: [PATCH 51/53] Fixed flaky tests. --- .../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 03f1e92e..1d2b9964 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_0`); + cy.wrap($addressItem).get(`#addressesForm_multiShippingAddresses_${index}_shipmentType_key [value="delivery"]`); getMultiShipmentAddressItemAddressField = ($addressItem: JQuery, index: number): Cypress.Chainable => cy.wrap($addressItem).get(`#addressesForm_multiShippingAddresses_${index}_shippingAddress_id_customer_address`); getMultiShipmentAddressItemAddressFirstNameField = ( From 2ea4e2dad1e7d64c0b6a6e15d4d9b7dae2682a0e Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Wed, 13 Mar 2024 15:28:13 +0300 Subject: [PATCH 52/53] Restructured tests into smaller parts. --- ...ent-suite-1.cy.ts => order-creation.cy.ts} | 6 +- ...nt-suite-1.cy.ts => return-creation.cy.ts} | 10 +- .../agent-authorization.cy.ts | 84 +++ .../agent-dashboard.cy.ts | 166 ++++++ .../agent-impersonation.cy.ts | 99 ++++ .../agent-login.cy.ts | 100 ++++ ...te-2.cy.ts => agent-merchant-portal.cy.ts} | 6 +- .../agent-permission.cy.ts | 147 +++++ .../marketplace-agent-assist-suite-1.cy.ts | 510 ------------------ ...out-suite-1.cy.ts => basic-checkout.cy.ts} | 6 +- ...ents-suite-1.cy.ts => cart-comments.cy.ts} | 8 +- ...uite-1.json => dynamic-cart-comments.json} | 0 ...suite-1.json => static-cart-comments.json} | 0 ...ite-1.json => dynamic-order-creation.json} | 0 ...uite-1.json => static-order-creation.json} | 0 ...te-1.json => dynamic-return-creation.json} | 0 ...ite-1.json => static-return-creation.json} | 0 .../dynamic-agent-authorization.json | 108 ++++ ...te-1.json => dynamic-agent-dashboard.json} | 11 - .../dynamic-agent-impersonation.json | 99 ++++ .../dynamic-agent-login.json | 132 +++++ ...son => dynamic-agent-merchant-portal.json} | 0 .../dynamic-agent-permission.json | 42 ++ ...1.json => static-agent-authorization.json} | 0 ...ite-2.json => static-agent-dashboard.json} | 0 .../static-agent-impersonation.json} | 0 .../static-agent-login.json | 3 + .../static-agent-merchant-portal.json | 3 + .../static-agent-permission.json | 3 + ...ite-1.json => dynamic-basic-checkout.json} | 0 .../yves/checkout/static-basic-checkout.json | 3 + ...uite-1.json => dynamic-cart-comments.json} | 0 ...suite-1.json => static-cart-comments.json} | 0 .../types/backoffice/order-management.ts | 2 +- .../types/backoffice/return-management.ts | 2 +- .../types/mp/marketplace-agent-assist.ts | 31 +- cypress/support/types/yves/checkout.ts | 2 +- cypress/support/types/yves/comments.ts | 4 +- 38 files changed, 1040 insertions(+), 547 deletions(-) rename cypress/e2e/backoffice/order-management/{order-management-suite-1.cy.ts => order-creation.cy.ts} (88%) rename cypress/e2e/backoffice/return-management/{return-management-suite-1.cy.ts => return-creation.cy.ts} (88%) create mode 100644 cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts create mode 100644 cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts create mode 100644 cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts create mode 100644 cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts rename cypress/e2e/mp/marketplace-agent-assist/{marketplace-agent-assist-suite-2.cy.ts => agent-merchant-portal.cy.ts} (93%) create mode 100644 cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts delete mode 100644 cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts rename cypress/e2e/yves/checkout/{checkout-suite-1.cy.ts => basic-checkout.cy.ts} (93%) rename cypress/e2e/yves/comments/{comments-suite-1.cy.ts => cart-comments.cy.ts} (91%) rename cypress/fixtures/b2b/yves/comments/{dynamic-comments-suite-1.json => dynamic-cart-comments.json} (100%) rename cypress/fixtures/b2b/yves/comments/{static-comments-suite-1.json => static-cart-comments.json} (100%) rename cypress/fixtures/suite/backoffice/order-management/{dynamic-order-management-suite-1.json => dynamic-order-creation.json} (100%) rename cypress/fixtures/suite/backoffice/order-management/{static-order-management-suite-1.json => static-order-creation.json} (100%) rename cypress/fixtures/suite/backoffice/return-management/{dynamic-return-management-suite-1.json => dynamic-return-creation.json} (100%) rename cypress/fixtures/suite/backoffice/return-management/{static-return-management-suite-1.json => static-return-creation.json} (100%) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-authorization.json rename cypress/fixtures/suite/mp/marketplace-agent-assist/{dynamic-marketplace-agent-assist-suite-1.json => dynamic-agent-dashboard.json} (95%) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-impersonation.json create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-login.json rename cypress/fixtures/suite/mp/marketplace-agent-assist/{dynamic-marketplace-agent-assist-suite-2.json => dynamic-agent-merchant-portal.json} (100%) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-permission.json rename cypress/fixtures/suite/mp/marketplace-agent-assist/{static-marketplace-agent-assist-suite-1.json => static-agent-authorization.json} (100%) rename cypress/fixtures/suite/mp/marketplace-agent-assist/{static-marketplace-agent-assist-suite-2.json => static-agent-dashboard.json} (100%) rename cypress/fixtures/suite/{yves/checkout/static-checkout-suite-1.json => mp/marketplace-agent-assist/static-agent-impersonation.json} (100%) create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-login.json create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-merchant-portal.json create mode 100644 cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-permission.json rename cypress/fixtures/suite/yves/checkout/{dynamic-checkout-suite-1.json => dynamic-basic-checkout.json} (100%) create mode 100644 cypress/fixtures/suite/yves/checkout/static-basic-checkout.json rename cypress/fixtures/suite/yves/comments/{dynamic-comments-suite-1.json => dynamic-cart-comments.json} (100%) rename cypress/fixtures/suite/yves/comments/{static-comments-suite-1.json => static-cart-comments.json} (100%) diff --git a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts b/cypress/e2e/backoffice/order-management/order-creation.cy.ts similarity index 88% rename from cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts rename to cypress/e2e/backoffice/order-management/order-creation.cy.ts index 520793d2..82527348 100644 --- a/cypress/e2e/backoffice/order-management/order-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/order-management/order-creation.cy.ts @@ -1,11 +1,11 @@ -import { OrderManagementStaticFixtures, OrderManagementSuite1DynamicFixtures } from '@interfaces/backoffice'; +import { OrderCreationDynamicFixtures, OrderManagementStaticFixtures } from '@interfaces/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'; -describe('order management suite 1', { tags: ['@order-management'] }, (): void => { +describe('order creation', { tags: ['@order-management'] }, (): void => { const cartPage = container.get(CartPage); const salesIndexPage = container.get(SalesIndexPage); const loginCustomerScenario = container.get(CustomerLoginScenario); @@ -13,7 +13,7 @@ describe('order management suite 1', { tags: ['@order-management'] }, (): void = const userLoginScenario = container.get(UserLoginScenario); let staticFixtures: OrderManagementStaticFixtures; - let dynamicFixtures: OrderManagementSuite1DynamicFixtures; + let dynamicFixtures: OrderCreationDynamicFixtures; before((): void => { ({ staticFixtures, dynamicFixtures } = Cypress.env()); diff --git a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts b/cypress/e2e/backoffice/return-management/return-creation.cy.ts similarity index 88% rename from cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts rename to cypress/e2e/backoffice/return-management/return-creation.cy.ts index d308443e..8ec1ea63 100644 --- a/cypress/e2e/backoffice/return-management/return-management-suite-1.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-creation.cy.ts @@ -1,10 +1,10 @@ -import { ReturnManagementStaticFixtures, ReturnManagementSuite1DynamicFixtures } from '@interfaces/backoffice'; +import { ReturnCreationDynamicFixtures, ReturnManagementStaticFixtures } from '@interfaces/backoffice'; import { SalesDetailPage, SalesIndexPage, SalesReturnGuiCreatePage } from '@pages/backoffice'; import { UserLoginScenario } from '@scenarios/backoffice'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -describe('return management suite 1', { tags: ['@return-management'] }, (): void => { +describe('return creation', { tags: ['@return-management'] }, (): void => { const salesIndexPage = container.get(SalesIndexPage); const salesDetailPage = container.get(SalesDetailPage); const salesReturnGuiCreatePage = container.get(SalesReturnGuiCreatePage); @@ -12,7 +12,7 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void const userLoginScenario = container.get(UserLoginScenario); const checkoutScenario = container.get(CheckoutScenario); - let dynamicFixtures: ReturnManagementSuite1DynamicFixtures; + let dynamicFixtures: ReturnCreationDynamicFixtures; let staticFixtures: ReturnManagementStaticFixtures; before((): void => { @@ -39,7 +39,7 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void salesIndexPage.visit(); salesIndexPage.viewLastPlacedOrder(); - salesDetailPage.triggerOms('Pay'); + salesDetailPage.triggerOms('Pay', true); salesDetailPage.triggerOms('Skip timeout'); salesDetailPage.triggerOms('skip picking'); salesDetailPage.triggerOms('Ship'); @@ -63,7 +63,7 @@ describe('return management suite 1', { tags: ['@return-management'] }, (): void salesIndexPage.visit(); salesIndexPage.viewLastPlacedOrder(); - salesDetailPage.triggerOms('Pay'); + salesDetailPage.triggerOms('Pay', true); salesDetailPage.triggerOms('Skip timeout'); salesDetailPage.triggerOms('skip picking'); salesDetailPage.triggerOms('Ship'); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts new file mode 100644 index 00000000..6c58b0e0 --- /dev/null +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts @@ -0,0 +1,84 @@ +import { AgentAuthorizationDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; +import { IndexPage } from '@pages/backoffice'; +import { AgentLoginPage, LoginPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { 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} + */ +describe('agent authorization', { tags: ['@marketplace-agent-assist'] }, (): void => { + const yvesLoginPage = container.get(LoginPage); + const yvesAgentLoginPage = container.get(AgentLoginPage); + const backofficeIndexPage = container.get(IndexPage); + const userLoginScenario = container.get(UserLoginScenario); + const merchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); + + let dynamicFixtures: AgentAuthorizationDynamicFixtures; + let staticFixtures: MarketplaceAgentAssistStaticFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('agent (customer) should be able to login to backoffice', (): void => { + 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({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeIndexPage.visit(); + backofficeIndexPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { + yvesAgentLoginPage.visit(); + yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); + yvesAgentLoginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to storefront agent dashboard', (): void => { + yvesAgentLoginPage.visit(); + yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); + yvesAgentLoginPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to storefront', (): void => { + yvesLoginPage.visit(); + yvesLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesLoginPage.getFailedAuthenticationText()); + yvesLoginPage.assertPageLocation(); + }); + + it('agent (customer) should not be able to login to storefront', (): void => { + yvesLoginPage.visit(); + yvesLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesLoginPage.getFailedAuthenticationText()); + yvesLoginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to storefront', (): void => { + yvesLoginPage.visit(); + yvesLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); + + cy.contains(yvesLoginPage.getFailedAuthenticationText()); + yvesLoginPage.assertPageLocation(); + }); +}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts new file mode 100644 index 00000000..a001284b --- /dev/null +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts @@ -0,0 +1,166 @@ +import { AgentDashboardDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; +import { AgentDashboardPage, DashboardPage, AgentLoginPage as MpAgentLoginPage } from '@pages/mp'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { 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} + */ +describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void => { + const mpAgentLoginPage = container.get(MpAgentLoginPage); + const mpDashboardPage = container.get(DashboardPage); + const mpAgentDashboardPage = container.get(AgentDashboardPage); + const userLoginScenario = container.get(UserLoginScenario); + const merchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); + + let dynamicFixtures: AgentDashboardDynamicFixtures; + let staticFixtures: MarketplaceAgentAssistStaticFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('agent should be able to see "Merchant Users" table', (): void => { + merchantAgentLoginUserScenario.execute({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assertPageLocation(); + mpAgentDashboardPage.getDashboardSidebarSelector().contains('Merchant Users'); + + cy.contains('Merchant'); + cy.contains('Merchant Approval'); + cy.contains('First Name'); + cy.contains('Last Name'); + cy.contains('Email'); + cy.contains('User Status'); + }); + + it('agent should be able to see active merchant user in a table', (): void => { + 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({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name, 3).should('exist'); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + }); + + it('agent should be able to see/assist inactive merchant user in a table', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deactivatedMerchantUser.username).should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deactivatedMerchantUser.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist deleted merchant user in a table', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deletedMerchantUser.username).should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deletedMerchantUser.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage + .findMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username) + .should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage + .findMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username) + .should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage + .findMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username) + .should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username); + + mpDashboardPage.assertPageLocation(); + }); + + it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); + + mpDashboardPage.assertPageLocation(); + }); +}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts new file mode 100644 index 00000000..bfffbdd4 --- /dev/null +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts @@ -0,0 +1,99 @@ +import { AgentImpersonationDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; +import { + AgentDashboardPage, + DashboardPage, + AgentLoginPage as MpAgentLoginPage, + LoginPage as MpLoginPage, +} from '@pages/mp'; +import { LoginPage } from '@pages/yves'; +import { ImpersonateAsMerchantUserScenario } 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} + */ +describe('agent impersonation', { tags: ['@marketplace-agent-assist'] }, (): void => { + const yvesLoginPage = container.get(LoginPage); + const mpLoginPage = container.get(MpLoginPage); + const mpAgentLoginPage = container.get(MpAgentLoginPage); + const mpDashboardPage = container.get(DashboardPage); + const mpAgentDashboardPage = container.get(AgentDashboardPage); + const impersonateScenario = container.get(ImpersonateAsMerchantUserScenario); + + let dynamicFixtures: AgentImpersonationDynamicFixtures; + let staticFixtures: MarketplaceAgentAssistStaticFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('agent should be able to see merchant user information during impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + mpDashboardPage.visit(); + cy.get('body').find(`div:contains("${dynamicFixtures.merchant.name}")`).should('exist'); + cy.get('body').find(`div:contains("${dynamicFixtures.merchantUser.username}")`).should('exist'); + + cy.get('body') + .find(`div:contains("${dynamicFixtures.merchantUser.first_name} ${dynamicFixtures.merchantUser.last_name}")`) + .should('exist'); + }); + + it('agent should be able to see agent assist buttons during impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + cy.get('body').find('a:contains("End User Assistance")').should('exist'); + cy.get('body').find('a:contains("Log out Agent")').should('exist'); + }); + + it('agent should be able to finish impersonation', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + cy.get('body').find('a:contains("End User Assistance")').click(); + mpAgentDashboardPage.assertPageLocation(); + + // Ensure that agent finished assistant session and don't have access to MP dashboard + mpDashboardPage.visit({ failOnStatusCode: false }); + cy.get('body').contains('Access Denied.'); + }); + + it('agent should be able to fully logout from all sessions', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + cy.get('body').find('a:contains("Log out Agent")').click(); + mpAgentLoginPage.assertPageLocation(); + + mpAgentDashboardPage.visit(); + mpAgentLoginPage.assertPageLocation(); + + mpDashboardPage.visit(); + mpLoginPage.assertPageLocation(); + }); + + it('agent should be able to fully logout from user profile menu', (): void => { + impersonateScenario.execute( + dynamicFixtures.merchantAgentUser.username, + staticFixtures.defaultPassword, + dynamicFixtures.merchantUser.username + ); + + mpDashboardPage.logout(); + yvesLoginPage.assertPageLocation(); + }); +}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts new file mode 100644 index 00000000..e95cad18 --- /dev/null +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts @@ -0,0 +1,100 @@ +import { AgentLoginDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; +import { + AgentDashboardPage, + DashboardPage, + AgentLoginPage as MpAgentLoginPage, + LoginPage as MpLoginPage, +} from '@pages/mp'; +import { 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} + */ +describe('agent login', { tags: ['@marketplace-agent-assist'] }, (): void => { + const mpLoginPage = container.get(MpLoginPage); + const mpAgentLoginPage = container.get(MpAgentLoginPage); + const mpDashboardPage = container.get(DashboardPage); + const mpAgentDashboardPage = container.get(AgentDashboardPage); + const merchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); + + let dynamicFixtures: AgentLoginDynamicFixtures; + let staticFixtures: MarketplaceAgentAssistStaticFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('agent (customer) should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('agent (merchant user) should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('merchant user should be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); + + cy.contains('Dashboard'); + mpDashboardPage.assertPageLocation(); + }); + + it('deactivated merchant user should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.deactivatedMerchantUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('deleted merchant user should not be able to login to MP dashboard', (): void => { + mpLoginPage.visit(); + mpLoginPage.login(dynamicFixtures.deletedMerchantUser.username, staticFixtures.defaultPassword); + + cy.contains(mpLoginPage.getFailedAuthenticationText()); + mpLoginPage.assertPageLocation(); + }); + + it('agent (customer) should not be able to login to MP agent dashboard', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); + + cy.contains(mpAgentLoginPage.getFailedAuthenticationText()); + mpAgentLoginPage.assertPageLocation(); + }); + + it('merchant user should not be able to login to MP agent dashboard', (): void => { + mpAgentLoginPage.visit(); + mpAgentLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); + + cy.contains(mpAgentLoginPage.getFailedAuthenticationText()); + mpAgentLoginPage.assertPageLocation(); + }); + + it('agent (merchant user) should be able to login to MP agent dashboard', (): void => { + merchantAgentLoginUserScenario.execute({ + username: dynamicFixtures.merchantAgentUser.username, + password: staticFixtures.defaultPassword, + }); + + mpAgentDashboardPage.visit(); + mpAgentDashboardPage.assertPageLocation(); + }); + + it('agent assist login page in MP should not contain "Forgot password" button', (): void => { + mpAgentLoginPage.visit(); + + cy.contains('Agent Assist Login'); + cy.get('body').contains('Forgot password').should('not.exist'); + }); +}); diff --git a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts similarity index 93% rename from cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts rename to cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts index ed9a8c3f..a3863ac5 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-2.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts @@ -1,4 +1,4 @@ -import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite2DynamicFixtures } from '@interfaces/mp'; +import { AgentMerchantPortalDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; import { OffersPage, ProductsPage, ProfilePage, SalesOrdersPage } from '@pages/mp'; import { CartPage } from '@pages/yves'; @@ -10,7 +10,7 @@ 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 => { +describe('agent merchant portal', { tags: ['@marketplace-agent-assist'] }, (): void => { const cartPage = container.get(CartPage); const salesIndexPage = container.get(SalesIndexPage); const salesDetailPage = container.get(SalesDetailPage); @@ -23,7 +23,7 @@ describe('marketplace agent assist suite 2', { tags: ['@marketplace-agent-assist const customerLoginScenario = container.get(CustomerLoginScenario); const checkoutMpScenario = container.get(CheckoutMpScenario); - let dynamicFixtures: MarketplaceAgentAssistSuite2DynamicFixtures; + let dynamicFixtures: AgentMerchantPortalDynamicFixtures; let staticFixtures: MarketplaceAgentAssistStaticFixtures; before((): void => { diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts new file mode 100644 index 00000000..4f7781bf --- /dev/null +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts @@ -0,0 +1,147 @@ +import { AgentPermissionDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; +import { UserIndexPage, UserUpdatePage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; +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('agent permission', { tags: ['@marketplace-agent-assist'] }, (): void => { + const backofficeUserIndexPage = container.get(UserIndexPage); + const backofficeUserUpdatePage = container.get(UserUpdatePage); + const userLoginScenario = container.get(UserLoginScenario); + + let dynamicFixtures: AgentPermissionDynamicFixtures; + let staticFixtures: MarketplaceAgentAssistStaticFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + + backofficeUserUpdatePage + .getAgentMerchantCheckbox() + .should('exist') + .parent() + .contains('This user is an agent in Merchant Portal'); + }); + + it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + + backofficeUserUpdatePage + .getAgentCustomerCheckbox() + .should('exist') + .parent() + .contains('This user is an agent in Storefront'); + }); + + it('backoffice user should be able to see existing user with merchant agent permission', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); + + it('backoffice user should be able to see "Agent Customer" column in user table', (): void => { + 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({ + 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({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage + .findUser(dynamicFixtures.customerAgentUser.username) + .contains('Agent') + .should('have.length', 1); + }); + + it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage + .findUser(dynamicFixtures.merchantAgentUser.username) + .contains('Agent') + .should('have.length', 1); + }); + + it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); + }); + + it('backoffice user should be able to create new user with merchant agent permission', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); + + it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + backofficeUserIndexPage.visit(); + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); + + backofficeUserUpdatePage.checkMerchantAgentCheckbox(); + + backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); + backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); + }); +}); 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 deleted file mode 100644 index c1943d93..00000000 --- a/cypress/e2e/mp/marketplace-agent-assist/marketplace-agent-assist-suite-1.cy.ts +++ /dev/null @@ -1,510 +0,0 @@ -import { MarketplaceAgentAssistStaticFixtures, MarketplaceAgentAssistSuite1DynamicFixtures } from '@interfaces/mp'; -import { IndexPage, UserIndexPage, UserUpdatePage } from '@pages/backoffice'; -import { - AgentDashboardPage, - DashboardPage, - AgentLoginPage as MpAgentLoginPage, - LoginPage as MpLoginPage, -} 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} - */ -describe('marketplace agent assist suite 1', { tags: ['@marketplace-agent-assist'] }, (): void => { - 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; - - before((): void => { - ({ dynamicFixtures, staticFixtures } = Cypress.env()); - }); - - it('agent (customer) should be able to login to backoffice', (): void => { - 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({ - username: dynamicFixtures.merchantAgentUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeIndexPage.visit(); - backofficeIndexPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { - yvesAgentLoginPage.visit(); - yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); - yvesAgentLoginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to storefront agent dashboard', (): void => { - yvesAgentLoginPage.visit(); - yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); - yvesAgentLoginPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to storefront', (): void => { - yvesLoginPage.visit(); - yvesLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(yvesLoginPage.getFailedAuthenticationText()); - yvesLoginPage.assertPageLocation(); - }); - - it('agent (customer) should not be able to login to storefront', (): void => { - yvesLoginPage.visit(); - yvesLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(yvesLoginPage.getFailedAuthenticationText()); - yvesLoginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to storefront', (): void => { - yvesLoginPage.visit(); - yvesLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); - - cy.contains(yvesLoginPage.getFailedAuthenticationText()); - yvesLoginPage.assertPageLocation(); - }); - - it('agent should be able to see "Merchant Users" table', (): void => { - merchantAgentLoginUserScenario.execute({ - username: dynamicFixtures.merchantAgentUser.username, - password: staticFixtures.defaultPassword, - }); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assertPageLocation(); - mpAgentDashboardPage.getDashboardSidebarSelector().contains('Merchant Users'); - - cy.contains('Merchant'); - cy.contains('Merchant Approval'); - cy.contains('First Name'); - cy.contains('Last Name'); - cy.contains('Email'); - cy.contains('User Status'); - }); - - it('agent should be able to see active merchant user in a table', (): void => { - 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({ - username: dynamicFixtures.merchantAgentUser.username, - password: staticFixtures.defaultPassword, - }); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name, 3).should('exist'); - mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - }); - - it('agent should be able to see/assist inactive merchant user in a table', (): void => { - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deactivatedMerchantUser.username).should('exist'); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deactivatedMerchantUser.username); - - mpDashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist deleted merchant user in a table', (): void => { - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deletedMerchantUser.username).should('exist'); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deletedMerchantUser.username); - - mpDashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage - .findMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username) - .should('exist'); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username); - - mpDashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage - .findMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username) - .should('exist'); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username); - - mpDashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage - .findMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username) - .should('exist'); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username); - - mpDashboardPage.assertPageLocation(); - }); - - it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); - - mpDashboardPage.assertPageLocation(); - }); - - it('agent (customer) should not be able to login to MP dashboard', (): void => { - mpLoginPage.visit(); - mpLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(mpLoginPage.getFailedAuthenticationText()); - mpLoginPage.assertPageLocation(); - }); - - it('agent (merchant user) should not be able to login to MP dashboard', (): void => { - mpLoginPage.visit(); - mpLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(mpLoginPage.getFailedAuthenticationText()); - mpLoginPage.assertPageLocation(); - }); - - it('merchant user should be able to login to MP dashboard', (): void => { - mpLoginPage.visit(); - mpLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); - - cy.contains('Dashboard'); - mpDashboardPage.assertPageLocation(); - }); - - it('deactivated merchant user should not be able to login to MP dashboard', (): void => { - mpLoginPage.visit(); - mpLoginPage.login(dynamicFixtures.deactivatedMerchantUser.username, staticFixtures.defaultPassword); - - cy.contains(mpLoginPage.getFailedAuthenticationText()); - mpLoginPage.assertPageLocation(); - }); - - it('deleted merchant user should not be able to login to MP dashboard', (): void => { - mpLoginPage.visit(); - mpLoginPage.login(dynamicFixtures.deletedMerchantUser.username, staticFixtures.defaultPassword); - - cy.contains(mpLoginPage.getFailedAuthenticationText()); - mpLoginPage.assertPageLocation(); - }); - - it('agent (customer) should not be able to login to MP agent dashboard', (): void => { - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); - - cy.contains(mpAgentLoginPage.getFailedAuthenticationText()); - mpAgentLoginPage.assertPageLocation(); - }); - - it('merchant user should not be able to login to MP agent dashboard', (): void => { - mpAgentLoginPage.visit(); - mpAgentLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); - - cy.contains(mpAgentLoginPage.getFailedAuthenticationText()); - mpAgentLoginPage.assertPageLocation(); - }); - - it('agent (merchant user) should be able to login to MP agent dashboard', (): void => { - merchantAgentLoginUserScenario.execute({ - username: dynamicFixtures.merchantAgentUser.username, - password: staticFixtures.defaultPassword, - }); - - mpAgentDashboardPage.visit(); - mpAgentDashboardPage.assertPageLocation(); - }); - - it('agent assist login page in MP should not contain "Forgot password" button', (): void => { - mpAgentLoginPage.visit(); - - cy.contains('Agent Assist Login'); - cy.get('body').contains('Forgot password').should('not.exist'); - }); - - it('agent should be able to see merchant user information during impersonation', (): void => { - impersonateScenario.execute( - dynamicFixtures.merchantAgentUser.username, - staticFixtures.defaultPassword, - dynamicFixtures.merchantUser.username - ); - - mpDashboardPage.visit(); - cy.get('body').find(`div:contains("${dynamicFixtures.merchant.name}")`).should('exist'); - cy.get('body').find(`div:contains("${dynamicFixtures.merchantUser.username}")`).should('exist'); - - cy.get('body') - .find(`div:contains("${dynamicFixtures.merchantUser.first_name} ${dynamicFixtures.merchantUser.last_name}")`) - .should('exist'); - }); - - it('agent should be able to see agent assist buttons during impersonation', (): void => { - impersonateScenario.execute( - dynamicFixtures.merchantAgentUser.username, - staticFixtures.defaultPassword, - dynamicFixtures.merchantUser.username - ); - - cy.get('body').find('a:contains("End User Assistance")').should('exist'); - cy.get('body').find('a:contains("Log out Agent")').should('exist'); - }); - - it('agent should be able to finish impersonation', (): void => { - impersonateScenario.execute( - dynamicFixtures.merchantAgentUser.username, - staticFixtures.defaultPassword, - dynamicFixtures.merchantUser.username - ); - - cy.get('body').find('a:contains("End User Assistance")').click(); - mpAgentDashboardPage.assertPageLocation(); - - // Ensure that agent finished assistant session and don't have access to MP dashboard - mpDashboardPage.visit({ failOnStatusCode: false }); - cy.get('body').contains('Access Denied.'); - }); - - it('agent should be able to fully logout from all sessions', (): void => { - impersonateScenario.execute( - dynamicFixtures.merchantAgentUser.username, - staticFixtures.defaultPassword, - dynamicFixtures.merchantUser.username - ); - - cy.get('body').find('a:contains("Log out Agent")').click(); - mpAgentLoginPage.assertPageLocation(); - - mpAgentDashboardPage.visit(); - mpAgentLoginPage.assertPageLocation(); - - mpDashboardPage.visit(); - mpLoginPage.assertPageLocation(); - }); - - it('agent should be able to fully logout from user profile menu', (): void => { - impersonateScenario.execute( - dynamicFixtures.merchantAgentUser.username, - staticFixtures.defaultPassword, - dynamicFixtures.merchantUser.username - ); - - mpDashboardPage.logout(); - yvesLoginPage.assertPageLocation(); - }); - - it('backoffice user should be able to see new merchant agent permission checkbox', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); - - backofficeUserUpdatePage - .getAgentMerchantCheckbox() - .should('exist') - .parent() - .contains('This user is an agent in Merchant Portal'); - }); - - it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); - - backofficeUserUpdatePage - .getAgentCustomerCheckbox() - .should('exist') - .parent() - .contains('This user is an agent in Storefront'); - }); - - it('backoffice user should be able to see existing user with merchant agent permission', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); - backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); - - it('backoffice user should be able to see "Agent Customer" column in user table', (): void => { - 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({ - 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({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage - .findUser(dynamicFixtures.customerAgentUser.username) - .contains('Agent') - .should('have.length', 1); - }); - - it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage - .findUser(dynamicFixtures.merchantAgentUser.username) - .contains('Agent') - .should('have.length', 1); - }); - - it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); - backofficeUserUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); - }); - - it('backoffice user should be able to create new user with merchant agent permission', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage.editUser(dynamicFixtures.merchantAgentUser.username); - backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); - - it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => { - userLoginScenario.execute({ - username: dynamicFixtures.rootUser.username, - password: staticFixtures.defaultPassword, - }); - - backofficeUserIndexPage.visit(); - backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); - backofficeUserUpdatePage.getAgentMerchantCheckbox().should('not.be.checked'); - - backofficeUserUpdatePage.checkMerchantAgentCheckbox(); - - backofficeUserIndexPage.editUser(dynamicFixtures.rootUser.username); - backofficeUserUpdatePage.getAgentMerchantCheckbox().should('be.checked'); - }); -}); diff --git a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts b/cypress/e2e/yves/checkout/basic-checkout.cy.ts similarity index 93% rename from cypress/e2e/yves/checkout/checkout-suite-1.cy.ts rename to cypress/e2e/yves/checkout/basic-checkout.cy.ts index 668a5b7d..e61a7d06 100644 --- a/cypress/e2e/yves/checkout/checkout-suite-1.cy.ts +++ b/cypress/e2e/yves/checkout/basic-checkout.cy.ts @@ -1,15 +1,15 @@ -import { CheckoutStaticFixtures, CheckoutSuite1DynamicFixtures } from '@interfaces/yves'; +import { CheckoutStaticFixtures, BasicCheckoutDynamicFixtures } from '@interfaces/yves'; import { CartPage } from '@pages/yves'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -describe('checkout suite 1', { tags: ['@checkout'] }, (): void => { +describe('basic checkout', { tags: ['@checkout'] }, (): void => { const cartPage = container.get(CartPage); const loginCustomerScenario = container.get(CustomerLoginScenario); const checkoutScenario = container.get(CheckoutScenario); let staticFixtures: CheckoutStaticFixtures; - let dynamicFixtures: CheckoutSuite1DynamicFixtures; + let dynamicFixtures: BasicCheckoutDynamicFixtures; before((): void => { ({ staticFixtures, dynamicFixtures } = Cypress.env()); diff --git a/cypress/e2e/yves/comments/comments-suite-1.cy.ts b/cypress/e2e/yves/comments/cart-comments.cy.ts similarity index 91% rename from cypress/e2e/yves/comments/comments-suite-1.cy.ts rename to cypress/e2e/yves/comments/cart-comments.cy.ts index afa6db28..4b51c851 100644 --- a/cypress/e2e/yves/comments/comments-suite-1.cy.ts +++ b/cypress/e2e/yves/comments/cart-comments.cy.ts @@ -1,15 +1,15 @@ -import { CommentsSuite1DynamicFixtures, CommentsSuite1StaticFixtures } from '@interfaces/yves'; +import { CartCommentsDynamicFixtures, CartCommentsStaticFixtures } from '@interfaces/yves'; import { CommentCartPage, MultiCartPage } from '@pages/yves'; import { CustomerLoginScenario } from '@scenarios/yves'; import { container } from '@utils'; -describe('comments suite 1', { tags: ['@comments'] }, (): void => { +describe('cart comments', { tags: ['@comments'] }, (): void => { const multiCartPage = container.get(MultiCartPage); const commentCartPage = container.get(CommentCartPage); const loginCustomerScenario = container.get(CustomerLoginScenario); - let dynamicFixtures: CommentsSuite1DynamicFixtures; - let staticFixtures: CommentsSuite1StaticFixtures; + let dynamicFixtures: CartCommentsDynamicFixtures; + let staticFixtures: CartCommentsStaticFixtures; before((): void => { ({ staticFixtures, dynamicFixtures } = Cypress.env()); diff --git a/cypress/fixtures/b2b/yves/comments/dynamic-comments-suite-1.json b/cypress/fixtures/b2b/yves/comments/dynamic-cart-comments.json similarity index 100% rename from cypress/fixtures/b2b/yves/comments/dynamic-comments-suite-1.json rename to cypress/fixtures/b2b/yves/comments/dynamic-cart-comments.json diff --git a/cypress/fixtures/b2b/yves/comments/static-comments-suite-1.json b/cypress/fixtures/b2b/yves/comments/static-cart-comments.json similarity index 100% rename from cypress/fixtures/b2b/yves/comments/static-comments-suite-1.json rename to cypress/fixtures/b2b/yves/comments/static-cart-comments.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-creation.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-creation.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-creation.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-creation.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-creation.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-creation.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-creation.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-creation.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-authorization.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-authorization.json new file mode 100644 index 00000000..0cb5aa22 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-authorization.json @@ -0,0 +1,108 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [{ "password": "change123", "isMerchantAgent": true }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "customerAgentUser", + "arguments": [{ "password": "change123", "isAgent": true }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#customerAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1, "name": "DE" } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { "id_locale": 66, "locale_name": "en_US" } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { "id_locale": 46, "locale_name": "de_DE" } + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [ + { + "merchantProfile": "#merchantProfile", + "isActive": true, + "status": "approved", + "storeRelation": { "idStores": ["#store.id_store"] } + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } + } +} 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-agent-dashboard.json similarity index 95% 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-agent-dashboard.json index 382d4ca5..b8122565 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-marketplace-agent-assist-suite-1.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-dashboard.json @@ -26,17 +26,6 @@ "name": "addUserToGroup", "arguments": ["#merchantAgentUser.id_user", 1] }, - { - "type": "helper", - "name": "haveUser", - "key": "customerAgentUser", - "arguments": [{ "password": "change123", "isAgent": true }] - }, - { - "type": "helper", - "name": "addUserToGroup", - "arguments": ["#customerAgentUser.id_user", 1] - }, { "type": "helper", "name": "haveUser", diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-impersonation.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-impersonation.json new file mode 100644 index 00000000..32636a0a --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-impersonation.json @@ -0,0 +1,99 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [{ "password": "change123", "isMerchantAgent": true }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1, "name": "DE" } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { "id_locale": 66, "locale_name": "en_US" } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { "id_locale": 46, "locale_name": "de_DE" } + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [ + { + "merchantProfile": "#merchantProfile", + "isActive": true, + "status": "approved", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-login.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-login.json new file mode 100644 index 00000000..3e1beddf --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-login.json @@ -0,0 +1,132 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [{ "password": "change123", "isMerchantAgent": true }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "customerAgentUser", + "arguments": [{ "password": "change123", "isAgent": true }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#customerAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "haveUser", + "key": "deactivatedMerchantUser", + "arguments": [{ "password": "change123", "status": "blocked" }] + }, + { + "type": "helper", + "name": "haveUser", + "key": "deletedMerchantUser", + "arguments": [{ "password": "change123", "status": "deleted" }] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1, "name": "DE" } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { "id_locale": 66, "locale_name": "en_US" } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { "id_locale": 46, "locale_name": "de_DE" } + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [ + { + "merchantProfile": "#merchantProfile", + "isActive": true, + "status": "approved", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#deactivatedMerchantUser"] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#deletedMerchantUser"] + } + ] + } + } +} 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-agent-merchant-portal.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-agent-merchant-portal.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-permission.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-permission.json new file mode 100644 index 00000000..d07fca4e --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-permission.json @@ -0,0 +1,42 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantAgentUser", + "arguments": [{ "password": "change123", "isMerchantAgent": true }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#merchantAgentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "customerAgentUser", + "arguments": [{ "password": "change123", "isAgent": true }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#customerAgentUser.id_user", 1] + } + ] + } + } +} 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-agent-authorization.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-agent-authorization.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-agent-dashboard.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-agent-dashboard.json diff --git a/cypress/fixtures/suite/yves/checkout/static-checkout-suite-1.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-impersonation.json similarity index 100% rename from cypress/fixtures/suite/yves/checkout/static-checkout-suite-1.json rename to cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-impersonation.json diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-login.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-login.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-login.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-merchant-portal.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-merchant-portal.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-merchant-portal.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-permission.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-permission.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/static-agent-permission.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic-checkout-suite-1.json b/cypress/fixtures/suite/yves/checkout/dynamic-basic-checkout.json similarity index 100% rename from cypress/fixtures/suite/yves/checkout/dynamic-checkout-suite-1.json rename to cypress/fixtures/suite/yves/checkout/dynamic-basic-checkout.json diff --git a/cypress/fixtures/suite/yves/checkout/static-basic-checkout.json b/cypress/fixtures/suite/yves/checkout/static-basic-checkout.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/static-basic-checkout.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/yves/comments/dynamic-comments-suite-1.json b/cypress/fixtures/suite/yves/comments/dynamic-cart-comments.json similarity index 100% rename from cypress/fixtures/suite/yves/comments/dynamic-comments-suite-1.json rename to cypress/fixtures/suite/yves/comments/dynamic-cart-comments.json diff --git a/cypress/fixtures/suite/yves/comments/static-comments-suite-1.json b/cypress/fixtures/suite/yves/comments/static-cart-comments.json similarity index 100% rename from cypress/fixtures/suite/yves/comments/static-comments-suite-1.json rename to cypress/fixtures/suite/yves/comments/static-cart-comments.json diff --git a/cypress/support/types/backoffice/order-management.ts b/cypress/support/types/backoffice/order-management.ts index d2928442..98daea58 100644 --- a/cypress/support/types/backoffice/order-management.ts +++ b/cypress/support/types/backoffice/order-management.ts @@ -1,6 +1,6 @@ import { Address, Customer, Product, User } from './shared'; -export interface OrderManagementSuite1DynamicFixtures { +export interface OrderCreationDynamicFixtures { customer: Customer; address: Address; product: Product; diff --git a/cypress/support/types/backoffice/return-management.ts b/cypress/support/types/backoffice/return-management.ts index 51ecd48d..218918ae 100644 --- a/cypress/support/types/backoffice/return-management.ts +++ b/cypress/support/types/backoffice/return-management.ts @@ -1,6 +1,6 @@ import { Address, Customer, Product, Quote, User } from './shared'; -export interface ReturnManagementSuite1DynamicFixtures { +export interface ReturnCreationDynamicFixtures { rootUser: User; customer: Customer; address: Address; diff --git a/cypress/support/types/mp/marketplace-agent-assist.ts b/cypress/support/types/mp/marketplace-agent-assist.ts index a71e1f71..62614e8e 100644 --- a/cypress/support/types/mp/marketplace-agent-assist.ts +++ b/cypress/support/types/mp/marketplace-agent-assist.ts @@ -1,9 +1,14 @@ import { Customer, Merchant, ProductConcrete, ProductOffer, User } from './shared'; -export interface MarketplaceAgentAssistSuite1DynamicFixtures { - rootUser: User; +export interface AgentAuthorizationDynamicFixtures { merchantAgentUser: User; customerAgentUser: User; + merchantUser: User; +} + +export interface AgentDashboardDynamicFixtures { + rootUser: User; + merchantAgentUser: User; merchant: Merchant; merchantUser: User; deletedMerchantUser: User; @@ -13,7 +18,27 @@ export interface MarketplaceAgentAssistSuite1DynamicFixtures { merchantUserFromInactiveDeniedMerchant: User; } -export interface MarketplaceAgentAssistSuite2DynamicFixtures { +export interface AgentLoginDynamicFixtures { + merchantAgentUser: User; + customerAgentUser: User; + merchantUser: User; + deletedMerchantUser: User; + deactivatedMerchantUser: User; +} + +export interface AgentImpersonationDynamicFixtures { + merchantAgentUser: User; + merchant: Merchant; + merchantUser: User; +} + +export interface AgentPermissionDynamicFixtures { + rootUser: User; + merchantAgentUser: User; + customerAgentUser: User; +} + +export interface AgentMerchantPortalDynamicFixtures { rootUser: User; merchantAgentUser: User; merchantUser: User; diff --git a/cypress/support/types/yves/checkout.ts b/cypress/support/types/yves/checkout.ts index da2eb42a..dd42c6fe 100644 --- a/cypress/support/types/yves/checkout.ts +++ b/cypress/support/types/yves/checkout.ts @@ -1,6 +1,6 @@ import { Address, Customer, Product, Quote } from './shared'; -export interface CheckoutSuite1DynamicFixtures { +export interface BasicCheckoutDynamicFixtures { customer: Customer; address: Address; product1: Product; diff --git a/cypress/support/types/yves/comments.ts b/cypress/support/types/yves/comments.ts index c7156113..ad871584 100644 --- a/cypress/support/types/yves/comments.ts +++ b/cypress/support/types/yves/comments.ts @@ -1,13 +1,13 @@ import { Customer, Product, Quote } from './shared'; -export interface CommentsSuite1DynamicFixtures { +export interface CartCommentsDynamicFixtures { customer: Customer; product: Product; quote: Quote; emptyQuote: Quote; } -export interface CommentsSuite1StaticFixtures { +export interface CartCommentsStaticFixtures { defaultPassword: string; commentsToAdd: string[]; commentToModify: string; From f7fc7024c053fa63015a136965633b362c248981 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Wed, 13 Mar 2024 16:01:54 +0300 Subject: [PATCH 53/53] Small adjustments. --- cypress/support/commands.ts | 2 +- cypress/support/e2e.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 63f84680..f91dac9a 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -1,5 +1,5 @@ // *********************************************** -// This example commands.js shows you how to +// This commands.js shows you how to // create various custom commands and overwrite // existing commands. // diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index a1631040..f444d05f 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -1,5 +1,5 @@ // *********************************************************** -// This example support/e2e.js is processed and +// This support/e2e.js is processed and // loaded automatically before your test files. // // This is a great place to put global configuration and