diff --git a/.gitignore b/.gitignore index 4151f360..0afeb5cf 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ build/Release # Dependency directories node_modules/ +vendor/ jspm_packages/ # TypeScript v1 declaration files @@ -66,7 +67,6 @@ typings/ # dotenv environment variable files .env -.env.test # parcel-bundler cache (https://parceljs.org/) .cache diff --git a/cypress/e2e/api/cms/cms-page-search-dms.cy.ts b/cypress/e2e/api/cms/cms-page-search-dms.cy.ts new file mode 100644 index 00000000..15d599be --- /dev/null +++ b/cypress/e2e/api/cms/cms-page-search-dms.cy.ts @@ -0,0 +1,49 @@ +import { container } from '@utils'; +import { CmsPageSearchDmsDynamicFixtures, CmsPageSearchDmsStaticFixtures } from '@interfaces/api'; +import { CreateCmsPageScenario, CreateStoreScenario, UserLoginScenario } from '@scenarios/backoffice'; + +describeIfDynamicStoreEnabled('cms page search dms', { tags: ['@api', '@cms', '@dms'] }, () => { + const userLoginScenario = container.get(UserLoginScenario); + const createStoreScenario = container.get(CreateStoreScenario); + const createCmsPageScenario = container.get(CreateCmsPageScenario); + + let staticFixtures: CmsPageSearchDmsStaticFixtures; + let dynamicFixtures: CmsPageSearchDmsDynamicFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + createStoreAndCmsPage(); + }); + + it('should be able to see the cms page for new store', (): void => { + cy.request({ + method: 'GET', + url: Cypress.env().glueUrl + '/cms-pages', + headers: { + Store: staticFixtures.store.name, + }, + }).then((response) => { + expect(response.status).to.eq(200); + const hasCmsPage = response.body.data.some( + (item: { type: string; attributes: { name: string } }) => item.attributes.name === staticFixtures.cmsPageName + ); + expect(hasCmsPage).to.be.true; + }); + }); + + function createStoreAndCmsPage(): void { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true }); + + staticFixtures.cmsPageName = `${staticFixtures.cmsPageName}-${Date.now()}`; + createCmsPageScenario.execute({ cmsPageName: staticFixtures.cmsPageName, shouldTriggerPublishAndSync: true }); + } +}); + +function describeIfDynamicStoreEnabled(title: string, options: { tags: string[] }, fn: () => void): void { + (Cypress.env('isDynamicStoreEnabled') ? describe : describe.skip)(title, fn); +} diff --git a/cypress/e2e/backoffice/category/category-edit.cy.ts b/cypress/e2e/backoffice/category/category-edit.cy.ts index cfe0db31..7379ee3f 100644 --- a/cypress/e2e/backoffice/category/category-edit.cy.ts +++ b/cypress/e2e/backoffice/category/category-edit.cy.ts @@ -1,11 +1,9 @@ import { container } from '@utils'; import { CategoryEditStaticFixtures } from '@interfaces/backoffice'; -import { CategoryEditPage } from '@pages/backoffice'; -import { CategoryListPage } from '@pages/backoffice'; +import { CategoryEditPage, CategoryListPage, ActionEnum } from '@pages/backoffice'; import { UserLoginScenario } from '@scenarios/backoffice'; -import { ActionEnum } from '../../../support/pages/backoffice'; -describe('category edit', { tags: ['@catalog'] }, (): void => { +describe('category edit', { tags: ['@backoffice', '@catalog'] }, (): void => { const categoryListPage = container.get(CategoryListPage); const categoryEditPage = container.get(CategoryEditPage); const userLoginScenario = container.get(UserLoginScenario); diff --git a/cypress/e2e/backoffice/merchant-b2b-contract-requests/request-management.cy.ts b/cypress/e2e/backoffice/merchant-b2b-contract-requests/request-management.cy.ts index 477ee760..7dc2f4e1 100644 --- a/cypress/e2e/backoffice/merchant-b2b-contract-requests/request-management.cy.ts +++ b/cypress/e2e/backoffice/merchant-b2b-contract-requests/request-management.cy.ts @@ -13,7 +13,7 @@ import { */ (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'request management', - { tags: ['@merchant-b2b-contract-requests'] }, + { tags: ['@backoffice', '@merchant-b2b-contract-requests'] }, (): void => { const merchantRelationRequestListPage = container.get(MerchantRelationRequestListPage); const merchantRelationRequestEditPage = container.get(MerchantRelationRequestEditPage); diff --git a/cypress/e2e/backoffice/order-management/custom-order-reference-management.cy.ts b/cypress/e2e/backoffice/order-management/custom-order-reference-management.cy.ts index 8d51818c..646ee3f6 100644 --- a/cypress/e2e/backoffice/order-management/custom-order-reference-management.cy.ts +++ b/cypress/e2e/backoffice/order-management/custom-order-reference-management.cy.ts @@ -10,7 +10,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'custom order reference management', - { tags: ['@order-management'] }, + { tags: ['@backoffice', '@order-management'] }, (): void => { const cartPage = container.get(CartPage); const salesIndexPage = container.get(SalesIndexPage); diff --git a/cypress/e2e/backoffice/order-management/order-creation.cy.ts b/cypress/e2e/backoffice/order-management/order-creation.cy.ts index 63fa9889..e90fcae4 100644 --- a/cypress/e2e/backoffice/order-management/order-creation.cy.ts +++ b/cypress/e2e/backoffice/order-management/order-creation.cy.ts @@ -5,7 +5,7 @@ import { CatalogPage, CustomerOverviewPage, ProductPage } from '@pages/yves'; import { UserLoginScenario } from '@scenarios/backoffice'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; -describe('order creation', { tags: ['@order-management'] }, (): void => { +describe('order creation', { tags: ['@backoffice', '@order-management'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); const customerOverviewPage = container.get(CustomerOverviewPage); diff --git a/cypress/e2e/backoffice/return-management/return-creation.cy.ts b/cypress/e2e/backoffice/return-management/return-creation.cy.ts index 70195db9..8f29ea52 100644 --- a/cypress/e2e/backoffice/return-management/return-creation.cy.ts +++ b/cypress/e2e/backoffice/return-management/return-creation.cy.ts @@ -7,7 +7,7 @@ import { CatalogPage, ProductPage } from '@pages/yves'; (['b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'return creation', - { tags: ['@return-management'] }, + { tags: ['@backoffice', '@return-management'] }, (): void => { const catalogPage = container.get(CatalogPage); const productsPage = container.get(ProductPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts index d935deff..ec89e094 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-authorization.cy.ts @@ -10,7 +10,7 @@ import { MerchantAgentLoginUserScenario } from '@scenarios/mp'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'agent authorization', - { tags: ['@marketplace-agent-assist'] }, + { tags: ['@mp', '@marketplace-agent-assist'] }, (): void => { const yvesLoginPage = container.get(LoginPage); const yvesAgentLoginPage = container.get(AgentLoginPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts index bd46a36b..1e2858fc 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.cy.ts @@ -8,7 +8,7 @@ import { MerchantAgentLoginUserScenario } from '@scenarios/mp'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'agent dashboard', - { tags: ['@marketplace-agent-assist'] }, + { tags: ['@mp', '@marketplace-agent-assist'] }, (): void => { const mpAgentLoginPage = container.get(MpAgentLoginPage); const mpDashboardPage = container.get(DashboardPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts index 078e5d31..cf07260a 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-impersonation.cy.ts @@ -14,7 +14,7 @@ import { ImpersonateAsMerchantUserScenario } from '@scenarios/mp'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'agent impersonation', - { tags: ['@marketplace-agent-assist'] }, + { tags: ['@mp', '@marketplace-agent-assist'] }, (): void => { const yvesLoginPage = container.get(LoginPage); const mpLoginPage = container.get(MpLoginPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts index 99b0cfb9..b8e14df6 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts @@ -13,7 +13,7 @@ import { MerchantAgentLoginUserScenario } from '@scenarios/mp'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'agent login', - { tags: ['@marketplace-agent-assist'] }, + { tags: ['@mp', '@marketplace-agent-assist'] }, (): void => { const mpLoginPage = container.get(MpLoginPage); const mpAgentLoginPage = container.get(MpAgentLoginPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts index 49c6d241..5aa499da 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-merchant-portal.cy.ts @@ -11,7 +11,7 @@ import { CheckoutMpScenario, CustomerLoginScenario } from '@scenarios/yves'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'agent merchant portal', - { tags: ['@marketplace-agent-assist'] }, + { tags: ['@mp', '@marketplace-agent-assist'] }, (): void => { const salesIndexPage = container.get(SalesIndexPage); const salesDetailPage = container.get(SalesDetailPage); diff --git a/cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts b/cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts index b2b3a83b..6f6cb20d 100644 --- a/cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts +++ b/cypress/e2e/mp/marketplace-agent-assist/agent-permission.cy.ts @@ -8,7 +8,7 @@ import { UserLoginScenario } from '@scenarios/backoffice'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'agent permission', - { tags: ['@marketplace-agent-assist'] }, + { tags: ['@mp', '@marketplace-agent-assist'] }, (): void => { const backofficeUserIndexPage = container.get(UserIndexPage); const backofficeUserUpdatePage = container.get(UserUpdatePage); @@ -69,7 +69,7 @@ import { UserLoginScenario } from '@scenarios/backoffice'; it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => { backofficeUserIndexPage.visit(); backofficeUserIndexPage - .find({ query: dynamicFixtures.customerAgentUser.username }) + .findUser({ query: dynamicFixtures.customerAgentUser.username }) .contains('Agent') .should('have.length', 1); }); @@ -77,7 +77,7 @@ import { UserLoginScenario } from '@scenarios/backoffice'; it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => { backofficeUserIndexPage.visit(); backofficeUserIndexPage - .find({ query: dynamicFixtures.merchantAgentUser.username }) + .findUser({ query: dynamicFixtures.merchantAgentUser.username }) .contains('Agent') .should('have.length', 1); }); diff --git a/cypress/e2e/mp/marketplace-merchant-commission/commission-calculation.cy.ts b/cypress/e2e/mp/marketplace-merchant-commission/commission-calculation.cy.ts index 1cf3dee7..0ea88894 100644 --- a/cypress/e2e/mp/marketplace-merchant-commission/commission-calculation.cy.ts +++ b/cypress/e2e/mp/marketplace-merchant-commission/commission-calculation.cy.ts @@ -12,7 +12,7 @@ import { CatalogPage, MultiCartPage, ProductPage } from '@pages/yves'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'commission calculation', - { tags: ['@marketplace-merchant-commission'] }, + { tags: ['@mp', '@marketplace-merchant-commission'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); diff --git a/cypress/e2e/mp/marketplace-product-concretes/product-concrete-management.cy.ts b/cypress/e2e/mp/marketplace-product-concretes/product-concrete-management.cy.ts index 674d6511..27e1dcfa 100644 --- a/cypress/e2e/mp/marketplace-product-concretes/product-concrete-management.cy.ts +++ b/cypress/e2e/mp/marketplace-product-concretes/product-concrete-management.cy.ts @@ -5,7 +5,7 @@ import { MerchantUserLoginScenario } from '@scenarios/mp'; (['b2b', 'b2c'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'product concretes management', - { tags: ['@merchant-product-concretes'] }, + { tags: ['@mp', '@merchant-product-concretes'] }, (): void => { const variantsPage = container.get(VariantsPage); const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); diff --git a/cypress/e2e/mp/merchant-b2b-contract-requests/request-management.cy.ts b/cypress/e2e/mp/merchant-b2b-contract-requests/request-management.cy.ts index 03948738..b459ebfc 100644 --- a/cypress/e2e/mp/merchant-b2b-contract-requests/request-management.cy.ts +++ b/cypress/e2e/mp/merchant-b2b-contract-requests/request-management.cy.ts @@ -8,7 +8,7 @@ import { MerchantUserLoginScenario } from '@scenarios/mp'; */ (['b2c', 'b2b', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'request management', - { tags: ['@merchant-b2b-contract-requests'] }, + { tags: ['@mp', '@merchant-b2b-contract-requests'] }, (): void => { const merchantRelationRequestsPage = container.get(MerchantRelationRequestsPage); const merchantRelationsPage = container.get(MerchantRelationsPage); diff --git a/cypress/e2e/smoke/api/health-check.cy.ts b/cypress/e2e/smoke/api/health-check.cy.ts index b767f80e..793635ab 100644 --- a/cypress/e2e/smoke/api/health-check.cy.ts +++ b/cypress/e2e/smoke/api/health-check.cy.ts @@ -1,7 +1,7 @@ /** * Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands. */ -describe('health check', { tags: '@smoke' }, () => { +describe('health check', { tags: ['@smoke', '@api'] }, () => { it('GLUE endpoint should return 200', () => { cy.request(Cypress.env().glueUrl + '/catalog-search') .its('status') diff --git a/cypress/e2e/smoke/catalog/product-search.cy.ts b/cypress/e2e/smoke/catalog/product-search.cy.ts index e08017c8..53d30411 100644 --- a/cypress/e2e/smoke/catalog/product-search.cy.ts +++ b/cypress/e2e/smoke/catalog/product-search.cy.ts @@ -3,7 +3,10 @@ import { CatalogPage, ProductPage } from '@pages/yves'; import { ProductSearchStaticFixtures } from '@interfaces/smoke'; import { CustomerLoginScenario } from '@scenarios/yves'; -describe('product search', { tags: ['@smoke'] }, (): void => { +/** + * Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands. + */ +describe('product search', { tags: ['@smoke', '@catalog'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); const customerLoginScenario = container.get(CustomerLoginScenario); diff --git a/cypress/e2e/smoke/checkout/basic-checkout.cy.ts b/cypress/e2e/smoke/checkout/basic-checkout.cy.ts index 315da22c..de21f8b2 100644 --- a/cypress/e2e/smoke/checkout/basic-checkout.cy.ts +++ b/cypress/e2e/smoke/checkout/basic-checkout.cy.ts @@ -6,7 +6,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; /** * Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands. */ -describe('basic checkout', { tags: ['@smoke'] }, (): void => { +describe('basic checkout', { tags: ['@smoke', '@checkout'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); const customerOverviewPage = container.get(CustomerOverviewPage); diff --git a/cypress/e2e/smoke/customer-account-management/customer-auth.cy.ts b/cypress/e2e/smoke/customer-account-management/customer-auth.cy.ts index 8c3c6465..c1b1f63e 100644 --- a/cypress/e2e/smoke/customer-account-management/customer-auth.cy.ts +++ b/cypress/e2e/smoke/customer-account-management/customer-auth.cy.ts @@ -5,7 +5,7 @@ import { CustomerAuthStaticFixtures } from '@interfaces/smoke'; /** * Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands. */ -describe('customer auth', { tags: ['@smoke'] }, (): void => { +describe('customer auth', { tags: ['@smoke', '@customer-account-management'] }, (): void => { const loginPage = container.get(LoginPage); const customerOverviewPage = container.get(CustomerOverviewPage); diff --git a/cypress/e2e/smoke/merchant-portal/login.cy.ts b/cypress/e2e/smoke/merchant-portal/login.cy.ts index 419e5b27..8616ebc7 100644 --- a/cypress/e2e/smoke/merchant-portal/login.cy.ts +++ b/cypress/e2e/smoke/merchant-portal/login.cy.ts @@ -7,7 +7,7 @@ import { LoginStaticFixtures } from '@interfaces/smoke'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'login', - { tags: ['@smoke'] }, + { tags: ['@smoke', '@merchant-portal'] }, (): void => { const loginPage = container.get(LoginPage); const dashboardPage = container.get(DashboardPage); diff --git a/cypress/e2e/smoke/order-management/dummy-payment-oms-flow.cy.ts b/cypress/e2e/smoke/order-management/dummy-payment-oms-flow.cy.ts index 85208f4a..715f14d0 100644 --- a/cypress/e2e/smoke/order-management/dummy-payment-oms-flow.cy.ts +++ b/cypress/e2e/smoke/order-management/dummy-payment-oms-flow.cy.ts @@ -10,7 +10,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; */ (['b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'dummy payment OMS flow', - { tags: ['@smoke'] }, + { tags: ['@smoke', '@order-management'] }, (): void => { const catalogPage = container.get(CatalogPage); const productsPage = container.get(ProductPage); diff --git a/cypress/e2e/smoke/order-management/marketplace-payment-oms-flow.cy.ts b/cypress/e2e/smoke/order-management/marketplace-payment-oms-flow.cy.ts index b92bacc3..ef8e3f1b 100644 --- a/cypress/e2e/smoke/order-management/marketplace-payment-oms-flow.cy.ts +++ b/cypress/e2e/smoke/order-management/marketplace-payment-oms-flow.cy.ts @@ -12,7 +12,7 @@ import { CatalogPage, ProductPage } from '@pages/yves'; */ (['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'marketplace payment OMS flow', - { tags: ['@smoke'] }, + { tags: ['@smoke', '@order-management'] }, (): void => { const catalogPage = container.get(CatalogPage); const productsPage = container.get(ProductPage); diff --git a/cypress/e2e/smoke/product/publish-and-synchronize.cy.ts b/cypress/e2e/smoke/product/publish-and-synchronize.cy.ts index 2833043a..0aa20218 100644 --- a/cypress/e2e/smoke/product/publish-and-synchronize.cy.ts +++ b/cypress/e2e/smoke/product/publish-and-synchronize.cy.ts @@ -7,7 +7,7 @@ import { CustomerLoginScenario } from '@scenarios/yves'; /** * Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands. */ -describe('publish and synchronize', { tags: ['@smoke'] }, (): void => { +describe('publish and synchronize', { tags: ['@smoke', '@product'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); const userLoginScenario = container.get(UserLoginScenario); diff --git a/cypress/e2e/yves/cart/cart-item-note-management.cy.ts b/cypress/e2e/yves/cart/cart-item-note-management.cy.ts index b2e70675..5ce13206 100644 --- a/cypress/e2e/yves/cart/cart-item-note-management.cy.ts +++ b/cypress/e2e/yves/cart/cart-item-note-management.cy.ts @@ -6,7 +6,7 @@ import { CustomerLoginScenario } from '@scenarios/yves'; /** * Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist} */ -describe('cart item note management', { tags: ['@cart'] }, (): void => { +describe('cart item note management', { tags: ['@yves', '@cart'] }, (): void => { const cartPage = container.get(CartPage); const customerLoginScenario = container.get(CustomerLoginScenario); diff --git a/cypress/e2e/yves/cart/change-cart-item-quantity.cy.ts b/cypress/e2e/yves/cart/change-cart-item-quantity.cy.ts index 26684267..9c149d2c 100644 --- a/cypress/e2e/yves/cart/change-cart-item-quantity.cy.ts +++ b/cypress/e2e/yves/cart/change-cart-item-quantity.cy.ts @@ -6,7 +6,7 @@ import { CustomerLoginScenario } from '@scenarios/yves'; /** * Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist} */ -describe('change cart item quantity', { tags: ['@cart'] }, (): void => { +describe('change cart item quantity', { tags: ['@yves', '@cart'] }, (): void => { const cartPage = container.get(CartPage); const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); diff --git a/cypress/e2e/yves/cart/remove-cart-item.cy.ts b/cypress/e2e/yves/cart/remove-cart-item.cy.ts index 39030595..b5122b09 100644 --- a/cypress/e2e/yves/cart/remove-cart-item.cy.ts +++ b/cypress/e2e/yves/cart/remove-cart-item.cy.ts @@ -6,7 +6,7 @@ import { CustomerLoginScenario } from '@scenarios/yves'; /** * Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist} */ -describe('remove cart item', { tags: ['@cart'] }, (): void => { +describe('remove cart item', { tags: ['@yves', '@cart'] }, (): void => { const cartPage = container.get(CartPage); const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); diff --git a/cypress/e2e/yves/catalog/product-search-dms.cy.ts b/cypress/e2e/yves/catalog/product-search-dms.cy.ts new file mode 100644 index 00000000..32f397ae --- /dev/null +++ b/cypress/e2e/yves/catalog/product-search-dms.cy.ts @@ -0,0 +1,94 @@ +import { container } from '@utils'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { ProductSearchDmsDynamicFixtures, ProductSearchDmsStaticFixtures } from '@interfaces/yves'; +import { CustomerLoginScenario, SelectStoreScenario } from '@scenarios/yves'; +import { AssignStoreToProductScenario, CreateStoreScenario, UserLoginScenario } from '@scenarios/backoffice'; + +describeIfDynamicStoreEnabled('product search dms', { tags: ['@yves', '@catalog', '@dms'] }, (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const selectStoreScenario = container.get(SelectStoreScenario); + const assignStoreToProductScenario = container.get(AssignStoreToProductScenario); + const userLoginScenario = container.get(UserLoginScenario); + const createStoreScenario = container.get(CreateStoreScenario); + + let staticFixtures: ProductSearchDmsStaticFixtures; + let dynamicFixtures: ProductSearchDmsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true }); + + assignStoreToProductScenario.execute({ + abstractProductSku: dynamicFixtures.product.abstract_sku, + storeName: staticFixtures.store.name, + bulkProductPrice: staticFixtures.productPrice, + shouldTriggerPublishAndSync: true, + }); + }); + + beforeEach((): void => { + selectStoreScenario.execute(staticFixtures.store.name); + }); + + skipB2BIt('guest should be able to find product abstract in catalog', (): void => { + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.abstract_sku }); + + assertProductDetailInformation(); + }); + + skipB2BIt('guest should be able to find product concrete in catalog', (): void => { + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + + assertProductDetailInformation(); + }); + + it('customer should be able to find product abstract in catalog', (): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.abstract_sku }); + + assertProductDetailInformation(); + }); + + it('customer should be able to find product concrete in catalog', (): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + + assertProductDetailInformation(); + }); + + function assertProductDetailInformation(): void { + cy.contains(dynamicFixtures.product.localized_attributes[0].name); + productPage.getProductConfigurator().should('contain', staticFixtures.productPrice); + productPage.getProductConfigurator().should('contain', dynamicFixtures.product.sku); + } + + function skipB2BIt(description: string, testFn: () => void): void { + (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? it.skip : it)(description, testFn); + } +}); + +function describeIfDynamicStoreEnabled(title: string, options: { tags: string[] }, fn: () => void): void { + (Cypress.env('isDynamicStoreEnabled') ? describe : describe.skip)(title, fn); +} diff --git a/cypress/e2e/yves/checkout/basic-checkout-dms.cy.ts b/cypress/e2e/yves/checkout/basic-checkout-dms.cy.ts new file mode 100644 index 00000000..869241df --- /dev/null +++ b/cypress/e2e/yves/checkout/basic-checkout-dms.cy.ts @@ -0,0 +1,205 @@ +import { container } from '@utils'; +import { BasicCheckoutDmsDynamicFixtures, BasicCheckoutDmsStaticFixtures } from '@interfaces/yves'; +import { CatalogPage, CustomerOverviewPage, ProductPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario, SelectStoreScenario } from '@scenarios/yves'; +import { + AssignStoreToPaymentMethodsScenario, + AssignStoreToDefaultShipmentMethodsScenario, + AssignStoreToDefaultShipmentTypesScenario, + AssignStoreToDefaultWarehouseScenario, + AssignStoreToProductScenario, + CreateStoreScenario, + UserLoginScenario, +} from '@scenarios/backoffice'; + +describeIfDynamicStoreEnabled('basic checkout dms', { tags: ['@yves', '@checkout', '@dms'] }, (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const loginCustomerScenario = container.get(CustomerLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + const assignStoreToProductScenario = container.get(AssignStoreToProductScenario); + const selectStoreScenario = container.get(SelectStoreScenario); + const userLoginScenario = container.get(UserLoginScenario); + const assignStoreToDefaultShipmentMethodsScenario = container.get(AssignStoreToDefaultShipmentMethodsScenario); + const assignStoreToPaymentMethodsScenario = container.get(AssignStoreToPaymentMethodsScenario); + const assignStoreToDefaultShipmentTypesScenario = container.get(AssignStoreToDefaultShipmentTypesScenario); + const assignStoreToDefaultWarehouseScenario = container.get(AssignStoreToDefaultWarehouseScenario); + const createStoreScenario = container.get(CreateStoreScenario); + + let staticFixtures: BasicCheckoutDmsStaticFixtures; + let dynamicFixtures: BasicCheckoutDmsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true }); + + assignStoreToProduct(dynamicFixtures.product1.abstract_sku); + assignStoreToProduct(dynamicFixtures.product2.abstract_sku); + + setupDefaultStoreRelations(); + }); + + beforeEach((): void => { + selectStoreScenario.execute(staticFixtures.store.name); + }); + + skipB2BIt('guest customer should checkout to single shipment', (): void => { + addTwoProductsToCart(); + + checkoutScenario.execute({ + isGuest: true, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + cy.contains(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + + skipB2BIt('guest customer should checkout to multi shipment address', (): void => { + addTwoProductsToCart(); + + checkoutScenario.execute({ + isGuest: true, + isMultiShipment: true, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + cy.contains(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + + it('customer should checkout to single shipment (with customer shipping address)', (): void => { + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + addTwoProductsToCart(); + + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + cy.contains(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + + it('customer should checkout to single shipment (with new shipping address)', (): void => { + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + addTwoProductsToCart(); + + checkoutScenario.execute({ + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + cy.contains(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + + it('customer should checkout to multi shipment address (with customer shipping address)', (): void => { + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + addTwoProductsToCart(); + + checkoutScenario.execute({ + isMultiShipment: true, + idCustomerAddress: dynamicFixtures.address.id_customer_address, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + cy.contains(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + + it('customer should checkout to multi shipment address (with new shipping address)', (): void => { + loginCustomerScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + addTwoProductsToCart(); + + checkoutScenario.execute({ + isMultiShipment: true, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + cy.contains(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + + function getPaymentMethodBasedOnEnv(): string { + return ['b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId')) + ? 'dummyMarketplacePaymentInvoice' + : 'dummyPaymentInvoice'; + } + + function addTwoProductsToCart(): void { + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product1.sku }); + productPage.addToCart(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product2.sku }); + productPage.addToCart(); + } + + function assignStoreToProduct(abstractSku: string): void { + assignStoreToProductScenario.execute({ + abstractProductSku: abstractSku, + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + }); + } + + function setupDefaultStoreRelations(): void { + assignStoreToDefaultWarehouseScenario.execute({ + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + }); + assignStoreToDefaultShipmentMethodsScenario.execute({ + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + }); + assignStoreToPaymentMethodsScenario.execute({ + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + paymentMethods: staticFixtures.paymentMethods, + }); + + if (['suite', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + assignStoreToDefaultShipmentTypesScenario.execute({ + store: staticFixtures.store.name, + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + } + } + + function skipB2BIt(description: string, testFn: () => void): void { + (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? it.skip : it)(description, testFn); + } +}); + +function describeIfDynamicStoreEnabled(title: string, options: { tags: string[] }, fn: () => void): void { + (Cypress.env('isDynamicStoreEnabled') ? describe : describe.skip)(title, fn); +} diff --git a/cypress/e2e/yves/checkout/basic-checkout.cy.ts b/cypress/e2e/yves/checkout/basic-checkout.cy.ts index ea9215c5..9cf214ec 100644 --- a/cypress/e2e/yves/checkout/basic-checkout.cy.ts +++ b/cypress/e2e/yves/checkout/basic-checkout.cy.ts @@ -3,7 +3,7 @@ import { CheckoutStaticFixtures, BasicCheckoutDynamicFixtures } from '@interface import { CatalogPage, CustomerOverviewPage, ProductPage } from '@pages/yves'; import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; -describe('basic checkout', { tags: ['@checkout'] }, (): void => { +describe('basic checkout', { tags: ['@yves', '@checkout'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); const customerOverviewPage = container.get(CustomerOverviewPage); diff --git a/cypress/e2e/yves/cms/cms-page-search-dms.cy.ts b/cypress/e2e/yves/cms/cms-page-search-dms.cy.ts new file mode 100644 index 00000000..a7605217 --- /dev/null +++ b/cypress/e2e/yves/cms/cms-page-search-dms.cy.ts @@ -0,0 +1,74 @@ +import { container } from '@utils'; +import { CmsContentPage } from '@pages/yves'; +import { CmsPageSearchDmsDynamicFixtures, CmsPageSearchDmsStaticFixtures } from '@interfaces/yves'; +import { CustomerLoginScenario, SelectStoreScenario } from '@scenarios/yves'; +import { CreateStoreScenario, CreateCmsPageScenario, UserLoginScenario } from '@scenarios/backoffice'; + +describeIfDynamicStoreEnabled('cms page search dms', { tags: ['@yves', '@cms', '@dms'] }, (): void => { + const contentPage = container.get(CmsContentPage); + const userLoginScenario = container.get(UserLoginScenario); + const createStoreScenario = container.get(CreateStoreScenario); + const selectStoreScenario = container.get(SelectStoreScenario); + const createCmsPageScenario = container.get(CreateCmsPageScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: CmsPageSearchDmsStaticFixtures; + let dynamicFixtures: CmsPageSearchDmsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + createStoreAndCmsPage(); + }); + + beforeEach((): void => { + selectStoreScenario.execute(staticFixtures.store.name); + }); + + it('guest should be able to find cms page in search box', (): void => { + contentPage.findCmsPageFromSuggestions({ query: staticFixtures.cmsPageName }); + + assertCmsPage(); + }); + + it('customer should be able to find cms page in search box', (): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + contentPage.findCmsPageFromSuggestions({ query: staticFixtures.cmsPageName }); + + assertCmsPage(); + }); + + function assertCmsPage(): void { + const locale = staticFixtures.store.locale.split('_')[0] ? staticFixtures.store.locale.split('_')[0] : 'en'; + + const storeName = staticFixtures.store.name; + + const regex = new RegExp( + `^${Cypress.config('baseUrl')}(?:/${storeName})?/${locale}/${staticFixtures.cmsPageName}$` + ); + + cy.url().should('match', regex); + + cy.contains(staticFixtures.cmsPageName).should('exist'); + } + + function createStoreAndCmsPage(): void { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true }); + + staticFixtures.cmsPageName = `${staticFixtures.cmsPageName}-${Date.now()}`; + createCmsPageScenario.execute({ cmsPageName: staticFixtures.cmsPageName, shouldTriggerPublishAndSync: true }); + } +}); + +function describeIfDynamicStoreEnabled(title: string, options: { tags: string[] }, fn: () => void): void { + (Cypress.env('isDynamicStoreEnabled') ? describe : describe.skip)(title, fn); +} diff --git a/cypress/e2e/yves/comments/cart-comments.cy.ts b/cypress/e2e/yves/comments/cart-comments.cy.ts index 34cd2221..2e6b1f3e 100644 --- a/cypress/e2e/yves/comments/cart-comments.cy.ts +++ b/cypress/e2e/yves/comments/cart-comments.cy.ts @@ -5,7 +5,7 @@ import { CustomerLoginScenario } from '@scenarios/yves'; (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'cart comments', - { tags: ['@comments'] }, + { tags: ['@yves', '@comments'] }, (): void => { const multiCartPage = container.get(MultiCartPage); const commentCartPage = container.get(CommentCartPage); diff --git a/cypress/e2e/yves/core/locale-switching.cy.ts b/cypress/e2e/yves/core/locale-switching.cy.ts index 4d4f1c7a..04b8dca5 100644 --- a/cypress/e2e/yves/core/locale-switching.cy.ts +++ b/cypress/e2e/yves/core/locale-switching.cy.ts @@ -1,13 +1,13 @@ import { container } from '@utils'; import { LocaleSwitchingScenario } from '@scenarios/yves'; -import { CatalogPage, IndexPage } from '@pages/yves'; +import { CatalogPage, HomePage } from '@pages/yves'; import { LocaleStaticFixtures } from '@interfaces/yves'; (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'locale switching', { tags: ['@core', '@yves'] }, (): void => { - const indexPage = container.get(IndexPage); + const homePage = container.get(HomePage); const catalogPage = container.get(CatalogPage); const localeSwitchingScenario = container.get(LocaleSwitchingScenario); @@ -20,36 +20,38 @@ import { LocaleStaticFixtures } from '@interfaces/yves'; /** * Helper method for testing locale switching on any page. * @param visitPage - Function to visit the page (e.g., `catalogPage.visit`). + * @param page - The page object containing methods like `getAvailableLocales`. */ - const testLocaleSwitching = (visitPage: () => void): void => { + const testLocaleSwitching = (visitPage: () => void, page: { getAvailableLocales: () => void }): void => { visitPage(); - localeSwitchingScenario.getAvailableLocales().then((locales) => { - expect(locales).to.include.members(staticFixtures.availableLocales); - }); + page.getAvailableLocales(); - localeSwitchingScenario.switchLocale(staticFixtures.localeDE.split('_')[0]); - localeSwitchingScenario.getCurrentLocale(staticFixtures.localeDE); + localeSwitchingScenario.execute({ + currentLocale: staticFixtures.localeEN, + selectedLocale: staticFixtures.localeDE, + }); cy.reload(); - localeSwitchingScenario.getCurrentLocale(staticFixtures.localeDE); - - localeSwitchingScenario.switchLocale(staticFixtures.localeEN.split('_')[0]); - localeSwitchingScenario.getCurrentLocale(staticFixtures.localeEN); + localeSwitchingScenario.execute({ + currentLocale: staticFixtures.localeDE, + selectedLocale: staticFixtures.localeEN, + }); }; - // it('Should be able to switch locales at the home page.', (): void => { - // testLocaleSwitching(() => indexPage.visit()); - // }); - // - // it('Should be able to switch locales at the catalog page.', (): void => { - // testLocaleSwitching(() => catalogPage.visit()); - // }); + it('Should be able to switch locales at the home page.', (): void => { + testLocaleSwitching(() => homePage.visit(), homePage); + }); - it('Should be able to switch locales at the product detailed page.', (): void => { - catalogPage.visit(); + it('Should be able to switch locales at the catalog page.', (): void => { + testLocaleSwitching(() => catalogPage.visit(), catalogPage); + }); - testLocaleSwitching(() => catalogPage.search({ query: 'Canon IXUS 285' })); + it('Should be able to switch locales at the product detailed page.', (): void => { + testLocaleSwitching(() => { + catalogPage.visit(); + catalogPage.search({ query: staticFixtures.productName }); + }, catalogPage); }); } ); diff --git a/cypress/e2e/yves/customer-account-management/customer-auth-dms.cy.ts b/cypress/e2e/yves/customer-account-management/customer-auth-dms.cy.ts new file mode 100644 index 00000000..7a98970b --- /dev/null +++ b/cypress/e2e/yves/customer-account-management/customer-auth-dms.cy.ts @@ -0,0 +1,71 @@ +import { container } from '@utils'; +import { LoginPage, CustomerOverviewPage } from '@pages/yves'; +import { CustomerAuthDmsDynamicFixtures, CustomerAuthDmsStaticFixtures } from '@interfaces/yves'; +import { CreateStoreScenario, EnableCmsBlockForAllStoresScenario, UserLoginScenario } from '@scenarios/backoffice'; +import { SelectStoreScenario } from '@scenarios/yves'; + +describeIfDynamicStoreEnabled( + 'customer auth dms', + { tags: ['@yves', '@customer-account-management', '@dms'] }, + (): void => { + const loginPage = container.get(LoginPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const userLoginScenario = container.get(UserLoginScenario); + const createStoreScenario = container.get(CreateStoreScenario); + const selectStoreScenario = container.get(SelectStoreScenario); + const enableCmsBlockForAllStoresScenario = container.get(EnableCmsBlockForAllStoresScenario); + + let dynamicFixtures: CustomerAuthDmsDynamicFixtures; + let staticFixtures: CustomerAuthDmsStaticFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true }); + + enableCmsBlockForAllStoresScenario.execute({ + cmsBlockName: 'customer-registration_token--text', + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + }); + enableCmsBlockForAllStoresScenario.execute({ + cmsBlockName: 'customer-registration_token--html', + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + }); + }); + + beforeEach((): void => { + selectStoreScenario.execute(staticFixtures.store.name); + }); + + skipB2BIt('guest should be able to register and login as new customer', (): void => { + loginPage.visit(); + const registeredCustomer = loginPage.register(); + cy.contains(loginPage.getRegistrationCompletedMessage()); + + loginPage.login({ email: registeredCustomer.email, password: registeredCustomer.password }); + customerOverviewPage.assertPageLocation(); + }); + + it('customer should be able to login into storefront application', (): void => { + loginPage.visit(); + loginPage.login({ email: dynamicFixtures.customer.email, password: staticFixtures.defaultPassword }); + + customerOverviewPage.assertPageLocation(); + }); + + function skipB2BIt(description: string, testFn: () => void): void { + (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? it.skip : it)(description, testFn); + } + } +); + +function describeIfDynamicStoreEnabled(title: string, options: { tags: string[] }, fn: () => void): void { + (Cypress.env('isDynamicStoreEnabled') ? describe : describe.skip)(title, fn); +} diff --git a/cypress/e2e/yves/customer-account-management/customer-auth.cy.ts b/cypress/e2e/yves/customer-account-management/customer-auth.cy.ts index c43a8a02..202161e8 100644 --- a/cypress/e2e/yves/customer-account-management/customer-auth.cy.ts +++ b/cypress/e2e/yves/customer-account-management/customer-auth.cy.ts @@ -2,7 +2,7 @@ import { container } from '@utils'; import { LoginPage, CustomerOverviewPage } from '@pages/yves'; import { CustomerAuthDynamicFixtures, CustomerAuthStaticFixtures } from '@interfaces/yves'; -describe('customer auth', { tags: ['@customer-account-management'] }, (): void => { +describe('customer auth', { tags: ['@yves', '@customer-account-management'] }, (): void => { const loginPage = container.get(LoginPage); const customerOverviewPage = container.get(CustomerOverviewPage); diff --git a/cypress/e2e/yves/merchant-b2b-contract-requests/request-creation.cy.ts b/cypress/e2e/yves/merchant-b2b-contract-requests/request-creation.cy.ts index f7f08f65..b800aeb6 100644 --- a/cypress/e2e/yves/merchant-b2b-contract-requests/request-creation.cy.ts +++ b/cypress/e2e/yves/merchant-b2b-contract-requests/request-creation.cy.ts @@ -16,7 +16,7 @@ import { CustomerLoginScenario } from '@scenarios/yves'; */ (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'request creation', - { tags: ['@merchant-b2b-contract-requests'] }, + { tags: ['@yves', '@merchant-b2b-contract-requests'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); diff --git a/cypress/e2e/yves/merchant-b2b-contract-requests/request-management.cy.ts b/cypress/e2e/yves/merchant-b2b-contract-requests/request-management.cy.ts index 0bdb9be7..e25f285c 100644 --- a/cypress/e2e/yves/merchant-b2b-contract-requests/request-management.cy.ts +++ b/cypress/e2e/yves/merchant-b2b-contract-requests/request-management.cy.ts @@ -12,7 +12,7 @@ import { CustomerLoginScenario } from '@scenarios/yves'; */ (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'request management', - { tags: ['@merchant-b2b-contract-requests'] }, + { tags: ['@yves', '@merchant-b2b-contract-requests'] }, (): void => { const companyUserSelectPage = container.get(CompanyUserSelectPage); const merchantRelationRequestIndexPage = container.get(MerchantRelationRequestIndexPage); diff --git a/cypress/e2e/yves/order-amendment/order-amendment-cancel.cy.ts b/cypress/e2e/yves/order-amendment/order-amendment-cancel.cy.ts index 3573b1ae..3e42358c 100644 --- a/cypress/e2e/yves/order-amendment/order-amendment-cancel.cy.ts +++ b/cypress/e2e/yves/order-amendment/order-amendment-cancel.cy.ts @@ -8,7 +8,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; */ (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'order amendment cancel', - { tags: ['@order-amendment'] }, + { tags: ['@yves', '@order-amendment'] }, (): void => { const customerOverviewPage = container.get(CustomerOverviewPage); const orderDetailsPage = container.get(OrderDetailsPage); diff --git a/cypress/e2e/yves/order-amendment/order-amendment-finish.cy.ts b/cypress/e2e/yves/order-amendment/order-amendment-finish.cy.ts index bbb9a891..7ee2efc8 100644 --- a/cypress/e2e/yves/order-amendment/order-amendment-finish.cy.ts +++ b/cypress/e2e/yves/order-amendment/order-amendment-finish.cy.ts @@ -8,7 +8,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; */ (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'order amendment finish', - { tags: ['@order-amendment'] }, + { tags: ['@yves', '@order-amendment'] }, (): void => { const customerOverviewPage = container.get(CustomerOverviewPage); const orderDetailsPage = container.get(OrderDetailsPage); diff --git a/cypress/e2e/yves/order-amendment/order-amendment-start.cy.ts b/cypress/e2e/yves/order-amendment/order-amendment-start.cy.ts index 5af37f35..d4643d03 100644 --- a/cypress/e2e/yves/order-amendment/order-amendment-start.cy.ts +++ b/cypress/e2e/yves/order-amendment/order-amendment-start.cy.ts @@ -11,7 +11,7 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice */ (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'order amendment start', - { tags: ['@order-amendment'] }, + { tags: ['@yves', '@order-amendment'] }, (): void => { const customerOverviewPage = container.get(CustomerOverviewPage); const orderDetailsPage = container.get(OrderDetailsPage); @@ -69,10 +69,7 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice it('customer should be able to replace current cart (quote) with previous order items', (): void => { placeCustomerOrder(dynamicFixtures.customer3.email, dynamicFixtures.address3.id_customer_address); - - catalogPage.visit(); - catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); - productPage.addToCart({ quantity: 2 }); + addProductsToCart(dynamicFixtures.product.sku, 2); customerOverviewPage.viewLastPlacedOrder(); orderDetailsPage.editOrder(); @@ -88,10 +85,7 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice cartPage.visit(); cartPage.changeQuantity({ sku: dynamicFixtures.product.sku, quantity: 2 }); - - catalogPage.visit(); - catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); - productPage.addToCart({ quantity: 2 }); + addProductsToCart(dynamicFixtures.product.sku, 2); cartPage.getCartItemChangeQuantityField(dynamicFixtures.product.sku).each(($input) => { cy.wrap($input).should('have.value', '2'); @@ -99,7 +93,19 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice }); it('customer should not be able to amend order when item was deactivated', (): void => { - placeCustomerOrder(dynamicFixtures.customer5.email, dynamicFixtures.address5.id_customer_address); + customerLoginScenario.execute({ + email: dynamicFixtures.customer5.email, + password: staticFixtures.defaultPassword, + }); + + addProductsToCart(dynamicFixtures.product.sku); + addProductsToCart(dynamicFixtures.productInActive.sku); + + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address5.id_customer_address, + shouldTriggerOmsInCli: true, + }); + deactivateProductInBackoffice(); customerLoginScenario.execute({ @@ -119,7 +125,19 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice }); it('customer should not be able to amend order when item was out-of-stock', (): void => { - placeCustomerOrder(dynamicFixtures.customer6.email, dynamicFixtures.address6.id_customer_address); + customerLoginScenario.execute({ + email: dynamicFixtures.customer6.email, + password: staticFixtures.defaultPassword, + }); + + addProductsToCart(dynamicFixtures.product.sku); + addProductsToCart(dynamicFixtures.productOutOfStock.sku); + + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address6.id_customer_address, + shouldTriggerOmsInCli: true, + }); + removeProductStock(); customerLoginScenario.execute({ @@ -136,6 +154,12 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice cy.get('body').contains(dynamicFixtures.productOutOfStock.localized_attributes[0].name).should('not.exist'); }); + function addProductsToCart(sku: string, quantity?: number): void { + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: sku }); + productPage.addToCart({ quantity: quantity ?? 1 }); + } + function placeCustomerOrder(email: string, idCustomerAddress: number): void { customerLoginScenario.execute({ email: email, diff --git a/cypress/e2e/yves/product-comparison/product-comparison.cy.ts b/cypress/e2e/yves/product-comparison/product-comparison.cy.ts index 7f62a5ca..3b35d979 100644 --- a/cypress/e2e/yves/product-comparison/product-comparison.cy.ts +++ b/cypress/e2e/yves/product-comparison/product-comparison.cy.ts @@ -4,7 +4,7 @@ import { CatalogPage, ProductPage, ProductComparisonPage } from '@pages/yves'; (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'product comparison', - { tags: ['@product-comparison'] }, + { tags: ['@yves', '@product-comparison'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); diff --git a/cypress/e2e/yves/product/publish-and-synchronize-dms.cy.ts b/cypress/e2e/yves/product/publish-and-synchronize-dms.cy.ts new file mode 100644 index 00000000..0cfdfb23 --- /dev/null +++ b/cypress/e2e/yves/product/publish-and-synchronize-dms.cy.ts @@ -0,0 +1,89 @@ +import { container } from '@utils'; +import { CreateProductScenario, CreateStoreScenario, UserLoginScenario } from '@scenarios/backoffice'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { PublishAndSynchronizeDmsDynamicFixtures, PublishAndSynchronizeDmsStaticFixtures } from '@interfaces/yves'; +import { CustomerLoginScenario, SelectStoreScenario } from '@scenarios/yves'; + +describeIfDynamicStoreEnabled('publish and synchronize dms', { tags: ['@yves', '@product', '@dms'] }, (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const userLoginScenario = container.get(UserLoginScenario); + const createProductScenario = container.get(CreateProductScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + const createStoreScenario = container.get(CreateStoreScenario); + const selectStoreScenario = container.get(SelectStoreScenario); + + let dynamicFixtures: PublishAndSynchronizeDmsDynamicFixtures; + let staticFixtures: PublishAndSynchronizeDmsStaticFixtures; + let productAbstract: ProductAbstract; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true }); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + productAbstract = createProductScenario.execute({ shouldTriggerPublishAndSync: true }); + selectStoreScenario.execute(staticFixtures.store.name); + }); + + it('backoffice user should be able to create new product that will be available for guests in storefront', (): void => { + catalogPage.visit(); + catalogPage.search({ query: productAbstract.name }); + + catalogPage.search({ query: productAbstract.name }); + + cy.contains(productAbstract.name); + cy.contains(productAbstract.sku); + cy.contains(productAbstract.description); + + if (!['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + cy.contains(productAbstract.price); + productPage.addToCart(); + cy.contains(productPage.getAddToCartSuccessMessage()); + } + }); + + it('backoffice user should be able to create new product that will be available for customers in storefront', (): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + catalogPage.visit(); + catalogPage.search({ query: productAbstract.name }); + + catalogPage.search({ query: productAbstract.name }); + + cy.contains(productAbstract.name); + cy.contains(productAbstract.sku); + cy.contains(productAbstract.description); + cy.contains(productAbstract.price); + + productPage.addToCart(); + cy.contains(productPage.getAddToCartSuccessMessage()); + }); +}); + +function describeIfDynamicStoreEnabled(title: string, options: { tags: string[] }, fn: () => void): void { + (Cypress.env('isDynamicStoreEnabled') ? describe : describe.skip)(title, fn); +} + +interface ProductAbstract { + name: string; + sku: string; + price: string; + description: string; +} diff --git a/cypress/e2e/yves/product/publish-and-synchronize.cy.ts b/cypress/e2e/yves/product/publish-and-synchronize.cy.ts index 8084ab5f..8932df62 100644 --- a/cypress/e2e/yves/product/publish-and-synchronize.cy.ts +++ b/cypress/e2e/yves/product/publish-and-synchronize.cy.ts @@ -4,7 +4,7 @@ import { CatalogPage, ProductPage } from '@pages/yves'; import { PublishAndSynchronizeStaticFixtures, PublishAndSynchronizeDynamicFixtures } from '@interfaces/yves'; import { CustomerLoginScenario } from '@scenarios/yves'; -describe('publish and synchronize', { tags: ['@product'] }, (): void => { +describe('publish and synchronize', { tags: ['@yves', '@product'] }, (): void => { const catalogPage = container.get(CatalogPage); const productPage = container.get(ProductPage); const userLoginScenario = container.get(UserLoginScenario); diff --git a/cypress/e2e/yves/reorder/reorder-concrete-products.cy.ts b/cypress/e2e/yves/reorder/reorder-concrete-products.cy.ts index a082c167..2bcefbbd 100644 --- a/cypress/e2e/yves/reorder/reorder-concrete-products.cy.ts +++ b/cypress/e2e/yves/reorder/reorder-concrete-products.cy.ts @@ -5,7 +5,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'reorder concrete products', - { tags: ['@reorder'] }, + { tags: ['@yves', '@reorder'] }, (): void => { const customerOverviewPage = container.get(CustomerOverviewPage); const orderDetailsPage = container.get(OrderDetailsPage); diff --git a/cypress/e2e/yves/reorder/reorder-product-bundles.cy.ts b/cypress/e2e/yves/reorder/reorder-product-bundles.cy.ts index 02fd4537..24219909 100644 --- a/cypress/e2e/yves/reorder/reorder-product-bundles.cy.ts +++ b/cypress/e2e/yves/reorder/reorder-product-bundles.cy.ts @@ -5,7 +5,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'reorder product bundles', - { tags: ['@order-amendment'] }, + { tags: ['@yves', '@order-amendment'] }, (): void => { const customerOverviewPage = container.get(CustomerOverviewPage); const orderDetailsPage = container.get(OrderDetailsPage); diff --git a/cypress/e2e/yves/reorder/reorder-product-offers.cy.ts b/cypress/e2e/yves/reorder/reorder-product-offers.cy.ts index 7a089c15..7fca8eb2 100644 --- a/cypress/e2e/yves/reorder/reorder-product-offers.cy.ts +++ b/cypress/e2e/yves/reorder/reorder-product-offers.cy.ts @@ -5,7 +5,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'reorder product offers', - { tags: ['@order-amendment'] }, + { tags: ['@yves', '@order-amendment'] }, (): void => { const customerOverviewPage = container.get(CustomerOverviewPage); const orderDetailsPage = container.get(OrderDetailsPage); diff --git a/cypress/e2e/yves/reorder/reorder-random-weight-products.cy.ts b/cypress/e2e/yves/reorder/reorder-random-weight-products.cy.ts index 1bb6ee2c..d1a04457 100644 --- a/cypress/e2e/yves/reorder/reorder-random-weight-products.cy.ts +++ b/cypress/e2e/yves/reorder/reorder-random-weight-products.cy.ts @@ -5,7 +5,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'reorder random weight products', - { tags: ['@order-amendment'] }, + { tags: ['@yves', '@order-amendment'] }, (): void => { const customerOverviewPage = container.get(CustomerOverviewPage); const orderDetailsPage = container.get(OrderDetailsPage); diff --git a/cypress/fixtures/b2b-mp/api/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2b-mp/api/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..756947ed --- /dev/null +++ b/cypress/fixtures/b2b-mp/api/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,20 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/api/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2b-mp/api/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..411a0128 --- /dev/null +++ b/cypress/fixtures/b2b-mp/api/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-glue", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/catalog/dynamic-product-search-dms.json b/cypress/fixtures/b2b-mp/yves/catalog/dynamic-product-search-dms.json new file mode 100644 index 00000000..97006787 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/catalog/dynamic-product-search-dms.json @@ -0,0 +1,118 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "LocaleTransfer", + "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", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [{ "isDefault": true, "fkCompany": "#company.id_company" }, ["#permission1"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 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": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/catalog/static-product-search-dms.json b/cypress/fixtures/b2b-mp/yves/catalog/static-product-search-dms.json new file mode 100644 index 00000000..8253f29e --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/catalog/static-product-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "156" +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/dynamic-basic-checkout-dms.json b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-basic-checkout-dms.json new file mode 100644 index 00000000..8464c6fe --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-basic-checkout-dms.json @@ -0,0 +1,326 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "helper", + "name": "haveStore", + "key": "store", + "arguments": [{ "name": "TEST_STORE" }] + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "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": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [{ "locale": "#localeEN", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [{ "fkCustomer": "#customer.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "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": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { "isDefault": true, "fkCompany": "#company.id_company" }, + ["#permission1", "#permission2", "#permission3", "#permission4", "#permission5", "#permission6"] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute1" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute2" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + { + "idTaxSet": 1, + "localizedAttributes": [ + { "locale": "#localeEN", "name": "#localizedAttribute1.name" }, + { "locale": "#localeDE", "name": "#localizedAttribute1.name" } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [ + { + "idTaxSet": 1, + "localizedAttributes": [ + { "locale": "#localeEN", "name": "#localizedAttribute2.name" }, + { "locale": "#localeDE", "name": "#localizedAttribute2.name" } + ] + } + ] + }, + { + "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": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000, "store": "#store" } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000, "store": "#store" } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/static-basic-checkout-dms.json b/cypress/fixtures/b2b-mp/yves/checkout/static-basic-checkout-dms.json new file mode 100644 index 00000000..669f67f7 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/static-basic-checkout-dms.json @@ -0,0 +1,26 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "paymentMethods": [ + { + "key": "dummyMarketplacePaymentInvoice", + "name": "Dummy Marketplace Payment" + } + ], + "shipmentMethods": [ + { + "key": "spryker_dummy_shipment-standard", + "name": "Standard" + }, + { + "key": "spryker_dummy_shipment-express", + "name": "Express" + } + ] +} diff --git a/cypress/fixtures/b2b-mp/yves/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2b-mp/yves/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..b845b649 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,38 @@ +{ + "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": "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"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2b-mp/yves/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..1f91fbee --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-yves", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/customer-account-management/dynamic-customer-auth-dms.json b/cypress/fixtures/b2b-mp/yves/customer-account-management/dynamic-customer-auth-dms.json new file mode 100644 index 00000000..1c5e8bdf --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/customer-account-management/dynamic-customer-auth-dms.json @@ -0,0 +1,63 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "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": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/customer-account-management/static-customer-auth-dms.json b/cypress/fixtures/b2b-mp/yves/customer-account-management/static-customer-auth-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/customer-account-management/static-customer-auth-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-publish-and-synchronize-dms.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-publish-and-synchronize-dms.json new file mode 100644 index 00000000..9b29cafb --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-publish-and-synchronize-dms.json @@ -0,0 +1,112 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { "id_locale": 66, "locale_name": "en_US" } + }, + { + "type": "helper", + "name": "haveStore", + "key": "store", + "arguments": [{ "name": "TEST_STORE" }] + }, + { + "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", + "arguments": ["#customer"] + }, + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [ + { + "merchantProfile": "#merchantProfile", + "isActive": true, + "status": "approved", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [{ "isDefault": true, "fkCompany": "#company.id_company" }, ["#permission1"]] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-publish-and-synchronize-dms.json b/cypress/fixtures/b2b-mp/yves/product/static-publish-and-synchronize-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-publish-and-synchronize-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2b/api/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2b/api/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..756947ed --- /dev/null +++ b/cypress/fixtures/b2b/api/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,20 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/api/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2b/api/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..411a0128 --- /dev/null +++ b/cypress/fixtures/b2b/api/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-glue", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2b/backoffice/category/static-category-edit.json b/cypress/fixtures/b2b/backoffice/category/static-category-edit.json new file mode 100644 index 00000000..98b6c085 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/category/static-category-edit.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "rootUser": { + "username": "admin@spryker.com" + }, + "childCategoryName": "cables", + "helpText": "If a store is not selectable, please make sure that the parent category is assigned to it first.", + "parentCategoryName": "demoshop", + "storeNameToUnassign": "AT" +} diff --git a/cypress/fixtures/b2b/yves/catalog/dynamic-product-search-dms.json b/cypress/fixtures/b2b/yves/catalog/dynamic-product-search-dms.json new file mode 100644 index 00000000..97006787 --- /dev/null +++ b/cypress/fixtures/b2b/yves/catalog/dynamic-product-search-dms.json @@ -0,0 +1,118 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "LocaleTransfer", + "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", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [{ "isDefault": true, "fkCompany": "#company.id_company" }, ["#permission1"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 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": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/catalog/static-product-search-dms.json b/cypress/fixtures/b2b/yves/catalog/static-product-search-dms.json new file mode 100644 index 00000000..8253f29e --- /dev/null +++ b/cypress/fixtures/b2b/yves/catalog/static-product-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "156" +} diff --git a/cypress/fixtures/b2b/yves/checkout/dynamic-basic-checkout-dms.json b/cypress/fixtures/b2b/yves/checkout/dynamic-basic-checkout-dms.json new file mode 100644 index 00000000..a195258a --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/dynamic-basic-checkout-dms.json @@ -0,0 +1,156 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "LocaleTransfer", + "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", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission2", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission3", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { "isDefault": true, "fkCompany": "#company.id_company" }, + ["#permission1", "#permission2", "#permission3"] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [{}, { "idTaxSet": 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": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product1.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product2.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/checkout/static-basic-checkout-dms.json b/cypress/fixtures/b2b/yves/checkout/static-basic-checkout-dms.json new file mode 100644 index 00000000..48d7732f --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/static-basic-checkout-dms.json @@ -0,0 +1,26 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "paymentMethods": [ + { + "key": "dummyPaymentInvoice", + "name": "Dummy Payment" + } + ], + "shipmentMethods": [ + { + "key": "spryker_dummy_shipment-standard", + "name": "Standard" + }, + { + "key": "spryker_dummy_shipment-express", + "name": "Express" + } + ] +} diff --git a/cypress/fixtures/b2b/yves/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2b/yves/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..b845b649 --- /dev/null +++ b/cypress/fixtures/b2b/yves/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,38 @@ +{ + "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": "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"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2b/yves/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..1f91fbee --- /dev/null +++ b/cypress/fixtures/b2b/yves/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-yves", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2b/yves/customer-account-management/dynamic-customer-auth-dms.json b/cypress/fixtures/b2b/yves/customer-account-management/dynamic-customer-auth-dms.json new file mode 100644 index 00000000..711c2ce2 --- /dev/null +++ b/cypress/fixtures/b2b/yves/customer-account-management/dynamic-customer-auth-dms.json @@ -0,0 +1,107 @@ +{ + "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": "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": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { "isDefault": true, "fkCompany": "#company.id_company" }, + ["#permission1", "#permission2", "#permission3", "#permission4", "#permission5", "#permission6"] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/customer-account-management/static-customer-auth-dms.json b/cypress/fixtures/b2b/yves/customer-account-management/static-customer-auth-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2b/yves/customer-account-management/static-customer-auth-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-publish-and-synchronize-dms.json b/cypress/fixtures/b2b/yves/product/dynamic-publish-and-synchronize-dms.json new file mode 100644 index 00000000..1933a5b8 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-publish-and-synchronize-dms.json @@ -0,0 +1,75 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "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": "haveCompany", + "key": "company", + "arguments": [{ "isActive": true, "status": "approved" }] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [{ "isDefault": true, "fkCompany": "#company.id_company" }, ["#permission"]] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnitFromCompany", + "arguments": [{ "fkCompany": "#company.id_company" }] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUserFromCompany", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnitFromCompany.id_company_business_unit" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/static-publish-and-synchronize-dms.json b/cypress/fixtures/b2b/yves/product/static-publish-and-synchronize-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-publish-and-synchronize-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c-mp/api/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2c-mp/api/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..756947ed --- /dev/null +++ b/cypress/fixtures/b2c-mp/api/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,20 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/api/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2c-mp/api/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..411a0128 --- /dev/null +++ b/cypress/fixtures/b2c-mp/api/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-glue", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c-mp/yves/catalog/dynamic-product-search-dms.json b/cypress/fixtures/b2c-mp/yves/catalog/dynamic-product-search-dms.json new file mode 100644 index 00000000..2542d2f3 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/catalog/dynamic-product-search-dms.json @@ -0,0 +1,70 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "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", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 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": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/catalog/static-product-search-dms.json b/cypress/fixtures/b2c-mp/yves/catalog/static-product-search-dms.json new file mode 100644 index 00000000..8253f29e --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/catalog/static-product-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "156" +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/dynamic-basic-checkout-dms.json b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-basic-checkout-dms.json new file mode 100644 index 00000000..f4471597 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-basic-checkout-dms.json @@ -0,0 +1,191 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "builder", + "name": "MerchantProfileBuilder", + "key": "merchantProfile" + }, + { + "type": "helper", + "name": "haveStore", + "key": "store", + "arguments": [{ "name": "TEST_STORE" }] + }, + { + "type": "helper", + "name": "haveMerchant", + "key": "merchant", + "arguments": [ + { + "merchantProfile": "#merchantProfile", + "isActive": true, + "status": "approved", + "storeRelation": { + "idStores": ["#store.id_store"] + } + } + ] + }, + + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "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", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [{}, { "idTaxSet": 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": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product1.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product2.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/static-basic-checkout-dms.json b/cypress/fixtures/b2c-mp/yves/checkout/static-basic-checkout-dms.json new file mode 100644 index 00000000..2eb2df2d --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/static-basic-checkout-dms.json @@ -0,0 +1,34 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "paymentMethods": [ + { + "key": "dummyMarketplacePaymentInvoice", + "name": "Dummy Marketplace Payment" + }, + { + "key": "dummyPaymentInvoice", + "name": "Dummy Payment" + }, + { + "key": "dummyPaymentCreditCard", + "name": "Credit Card" + } + ], + "shipmentMethods": [ + { + "key": "spryker_dummy_shipment-standard", + "name": "Standard" + }, + { + "key": "spryker_dummy_shipment-express", + "name": "Express" + } + ] +} diff --git a/cypress/fixtures/b2c-mp/yves/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2c-mp/yves/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..b845b649 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,38 @@ +{ + "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": "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"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2c-mp/yves/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..1f91fbee --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-yves", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c-mp/yves/customer-account-management/dynamic-customer-auth-dms.json b/cypress/fixtures/b2c-mp/yves/customer-account-management/dynamic-customer-auth-dms.json new file mode 100644 index 00000000..70fb7f10 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/customer-account-management/dynamic-customer-auth-dms.json @@ -0,0 +1,38 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "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": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/customer-account-management/static-customer-auth-dms.json b/cypress/fixtures/b2c-mp/yves/customer-account-management/static-customer-auth-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/customer-account-management/static-customer-auth-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-publish-and-synchronize-dms.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-publish-and-synchronize-dms.json new file mode 100644 index 00000000..97ba0630 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-publish-and-synchronize-dms.json @@ -0,0 +1,39 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-publish-and-synchronize-dms.json b/cypress/fixtures/b2c-mp/yves/product/static-publish-and-synchronize-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-publish-and-synchronize-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c/api/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2c/api/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..756947ed --- /dev/null +++ b/cypress/fixtures/b2c/api/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,20 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/api/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2c/api/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..411a0128 --- /dev/null +++ b/cypress/fixtures/b2c/api/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-glue", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c/yves/cart/dynamic-cart-item-note-management.json b/cypress/fixtures/b2c/yves/cart/dynamic-cart-item-note-management.json new file mode 100644 index 00000000..33ebb2e7 --- /dev/null +++ b/cypress/fixtures/b2c/yves/cart/dynamic-cart-item-note-management.json @@ -0,0 +1,94 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1, "name": "DE" } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#product.sku", "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": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 2 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/cart/static-cart-item-note-management.json b/cypress/fixtures/b2c/yves/cart/static-cart-item-note-management.json new file mode 100644 index 00000000..d4864ecf --- /dev/null +++ b/cypress/fixtures/b2c/yves/cart/static-cart-item-note-management.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "cartItemNote": "test cart item note" +} diff --git a/cypress/fixtures/b2c/yves/catalog/dynamic-product-search-dms.json b/cypress/fixtures/b2c/yves/catalog/dynamic-product-search-dms.json new file mode 100644 index 00000000..2542d2f3 --- /dev/null +++ b/cypress/fixtures/b2c/yves/catalog/dynamic-product-search-dms.json @@ -0,0 +1,70 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "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", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 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": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/catalog/static-product-search-dms.json b/cypress/fixtures/b2c/yves/catalog/static-product-search-dms.json new file mode 100644 index 00000000..8253f29e --- /dev/null +++ b/cypress/fixtures/b2c/yves/catalog/static-product-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "156" +} diff --git a/cypress/fixtures/b2c/yves/checkout/dynamic-basic-checkout-dms.json b/cypress/fixtures/b2c/yves/checkout/dynamic-basic-checkout-dms.json new file mode 100644 index 00000000..4a2b706c --- /dev/null +++ b/cypress/fixtures/b2c/yves/checkout/dynamic-basic-checkout-dms.json @@ -0,0 +1,105 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "LocaleTransfer", + "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", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [{}, { "idTaxSet": 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": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product1.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product2.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/checkout/static-basic-checkout-dms.json b/cypress/fixtures/b2c/yves/checkout/static-basic-checkout-dms.json new file mode 100644 index 00000000..c76290e8 --- /dev/null +++ b/cypress/fixtures/b2c/yves/checkout/static-basic-checkout-dms.json @@ -0,0 +1,26 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "paymentMethods": [ + { + "key": "dummyPaymentInvoice", + "name": "Invoice" + }, + { + "key": "dummyPaymentCreditCard", + "name": "Credit Card" + } + ], + "shipmentMethods": [ + { + "key": "spryker_dummy_shipment-standard", + "name": "Standard" + } + ] +} diff --git a/cypress/fixtures/b2c/yves/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/b2c/yves/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..b845b649 --- /dev/null +++ b/cypress/fixtures/b2c/yves/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,38 @@ +{ + "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": "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"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/cms/static-cms-page-search-dms.json b/cypress/fixtures/b2c/yves/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..1f91fbee --- /dev/null +++ b/cypress/fixtures/b2c/yves/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-yves", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c/yves/comments/dynamic-cart-comments.json b/cypress/fixtures/b2c/yves/comments/dynamic-cart-comments.json new file mode 100644 index 00000000..d7518273 --- /dev/null +++ b/cypress/fixtures/b2c/yves/comments/dynamic-cart-comments.json @@ -0,0 +1,139 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1 } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#product2.sku", "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": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1 + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "quantity": 2 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "emptyQuote", + "arguments": [{ "customer": "#customer" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/comments/static-cart-comments.json b/cypress/fixtures/b2c/yves/comments/static-cart-comments.json new file mode 100644 index 00000000..05511e65 --- /dev/null +++ b/cypress/fixtures/b2c/yves/comments/static-cart-comments.json @@ -0,0 +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." +} diff --git a/cypress/fixtures/b2c/yves/customer-account-management/dynamic-customer-auth-dms.json b/cypress/fixtures/b2c/yves/customer-account-management/dynamic-customer-auth-dms.json new file mode 100644 index 00000000..70fb7f10 --- /dev/null +++ b/cypress/fixtures/b2c/yves/customer-account-management/dynamic-customer-auth-dms.json @@ -0,0 +1,38 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "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": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/customer-account-management/static-customer-auth-dms.json b/cypress/fixtures/b2c/yves/customer-account-management/static-customer-auth-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2c/yves/customer-account-management/static-customer-auth-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-cancel.json b/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-cancel.json new file mode 100644 index 00000000..53293fe2 --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-cancel.json @@ -0,0 +1,103 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "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": "confirmCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [{ "fkCustomer": "#customer.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1, "name": "DE" } + }, + { + "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": "haveFullProduct", + "key": "product", + "arguments": [{ "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#product.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-finish.json b/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-finish.json new file mode 100644 index 00000000..ee60392a --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-finish.json @@ -0,0 +1,170 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "locale", + "arguments": { "id_locale": 66, "locale_name": "en_US" } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer1", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer2", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer1"] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer2"] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address1", + "arguments": [{ "fkCustomer": "#customer1.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address2", + "arguments": [{ "fkCustomer": "#customer2.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1, "name": "DE" } + }, + { + "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": "haveFullProduct", + "key": "product1", + "arguments": [{ "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [{ "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer1", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer2", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-start.json b/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-start.json new file mode 100644 index 00000000..b2d9cf8b --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-amendment/dynamic-order-amendment-start.json @@ -0,0 +1,315 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "LocaleTransfer", + "key": "locale", + "arguments": { "id_locale": 66, "locale_name": "en_US" } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer1", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer2", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer3", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer4", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer5", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer6", + "arguments": [{ "locale": "#locale", "password": "change123" }] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer1"] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer2"] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer3"] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer4"] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer5"] + }, + { + "type": "helper", + "name": "confirmCustomer", + "arguments": ["#customer6"] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address1", + "arguments": [{ "fkCustomer": "#customer1.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address2", + "arguments": [{ "fkCustomer": "#customer2.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address3", + "arguments": [{ "fkCustomer": "#customer3.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address4", + "arguments": [{ "fkCustomer": "#customer4.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address5", + "arguments": [{ "fkCustomer": "#customer5.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address6", + "arguments": [{ "fkCustomer": "#customer6.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { "id_store": 1, "name": "DE" } + }, + { + "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": "haveFullProduct", + "key": "product", + "arguments": [{ "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#product.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productInActive", + "arguments": [{ "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productInActive.abstract_sku", + "skuProduct": "#productInActive.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#productInActive.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productInActive.id_product_concrete", + "idProductAbstract": "#productInActive.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productOutOfStock", + "arguments": [{ "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productOutOfStock.abstract_sku", + "skuProduct": "#productOutOfStock.sku", + "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": ["#store", { "sku": "#productOutOfStock.sku", "isNeverOutOfStock": "1" }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productOutOfStock.id_product_concrete", + "idProductAbstract": "#productOutOfStock.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer1", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer2", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer3", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer4", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-cancel.json b/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-cancel.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-cancel.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-finish.json b/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-finish.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-finish.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-start.json b/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-start.json new file mode 100644 index 00000000..ba4339e8 --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-amendment/static-order-amendment-start.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/yves/product-comparison/dynamic-product-comparison.json b/cypress/fixtures/b2c/yves/product-comparison/dynamic-product-comparison.json new file mode 100644 index 00000000..4054efcb --- /dev/null +++ b/cypress/fixtures/b2c/yves/product-comparison/dynamic-product-comparison.json @@ -0,0 +1,301 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute" + }, + { + "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": "haveFullProduct", + "key": "product1", + "arguments": [ + { + "attributes": { + "attribute_key_1": "attribute_value_1-1", + "attribute_key_2": "attribute_value_2-1" + }, + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "product1WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product1WithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [ + { + "attributes": { + "attribute_key_1": "attribute_value_1-2", + "attribute_key_2": "attribute_value_2-2" + }, + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "product2WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product2WithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + { + "attributes": { + "attribute_key_1": "attribute_value_1-3" + }, + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product3.id_product_concrete", + "idProductAbstract": "#product3.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "product3WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product3.abstract_sku", + "skuProduct": "#product3.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product3WithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product4", + "arguments": [ + { + "attributes": { + "attribute_key_1": "attribute_value_1-4", + "attribute_key_2": "attribute_value_2-4" + }, + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product4.id_product_concrete", + "idProductAbstract": "#product4.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "product4WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product4.abstract_sku", + "skuProduct": "#product4.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product4WithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product4.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-publish-and-synchronize-dms.json b/cypress/fixtures/b2c/yves/product/dynamic-publish-and-synchronize-dms.json new file mode 100644 index 00000000..97ba0630 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-publish-and-synchronize-dms.json @@ -0,0 +1,39 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/static-publish-and-synchronize-dms.json b/cypress/fixtures/b2c/yves/product/static-publish-and-synchronize-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-publish-and-synchronize-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/suite/api/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/suite/api/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..756947ed --- /dev/null +++ b/cypress/fixtures/suite/api/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,20 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/api/cms/static-cms-page-search-dms.json b/cypress/fixtures/suite/api/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..411a0128 --- /dev/null +++ b/cypress/fixtures/suite/api/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-glue", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-merchant-portal.json b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-merchant-portal.json index fb3b048c..8cd70c8a 100644 --- a/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-merchant-portal.json +++ b/cypress/fixtures/suite/mp/marketplace-agent-assist/dynamic-agent-merchant-portal.json @@ -260,6 +260,48 @@ "taxTotal": "#taxTotal" } }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "totals": "#totals", + "items": [ + { + "sku": "#productConcreteForOffer.sku", + "abstractSku": "#productConcreteForOffer.abstract_sku", + "idProductAbstract": "#productConcreteForOffer.fk_product_abstract", + "productOfferReference": "#productOffer.product_offer_reference", + "merchantReference": "#productOffer.merchant_reference", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "totals": "#totals", + "items": [ + { + "sku": "#productConcreteForOffer.sku", + "abstractSku": "#productConcreteForOffer.abstract_sku", + "idProductAbstract": "#productConcreteForOffer.fk_product_abstract", + "productOfferReference": "#productOffer.product_offer_reference", + "merchantReference": "#productOffer.merchant_reference", + "quantity": 1, + "unitPrice": 30000 + } + ] + } + ] + }, { "type": "helper", "name": "havePersistentQuote", diff --git a/cypress/fixtures/suite/yves/catalog/dynamic-product-search-dms.json b/cypress/fixtures/suite/yves/catalog/dynamic-product-search-dms.json new file mode 100644 index 00000000..2542d2f3 --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/dynamic-product-search-dms.json @@ -0,0 +1,70 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "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", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 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": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/catalog/static-product-search-dms.json b/cypress/fixtures/suite/yves/catalog/static-product-search-dms.json new file mode 100644 index 00000000..8253f29e --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/static-product-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "156" +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic-basic-checkout-dms.json b/cypress/fixtures/suite/yves/checkout/dynamic-basic-checkout-dms.json new file mode 100644 index 00000000..4a2b706c --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic-basic-checkout-dms.json @@ -0,0 +1,105 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "LocaleTransfer", + "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", + "key": "confirmedCustomer", + "arguments": ["#customer"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [{}, { "idTaxSet": 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": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product1.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product2.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/checkout/static-basic-checkout-dms.json b/cypress/fixtures/suite/yves/checkout/static-basic-checkout-dms.json new file mode 100644 index 00000000..2eb2df2d --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/static-basic-checkout-dms.json @@ -0,0 +1,34 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "paymentMethods": [ + { + "key": "dummyMarketplacePaymentInvoice", + "name": "Dummy Marketplace Payment" + }, + { + "key": "dummyPaymentInvoice", + "name": "Dummy Payment" + }, + { + "key": "dummyPaymentCreditCard", + "name": "Credit Card" + } + ], + "shipmentMethods": [ + { + "key": "spryker_dummy_shipment-standard", + "name": "Standard" + }, + { + "key": "spryker_dummy_shipment-express", + "name": "Express" + } + ] +} diff --git a/cypress/fixtures/suite/yves/cms/dynamic-cms-page-search-dms.json b/cypress/fixtures/suite/yves/cms/dynamic-cms-page-search-dms.json new file mode 100644 index 00000000..b845b649 --- /dev/null +++ b/cypress/fixtures/suite/yves/cms/dynamic-cms-page-search-dms.json @@ -0,0 +1,38 @@ +{ + "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": "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"] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/cms/static-cms-page-search-dms.json b/cypress/fixtures/suite/yves/cms/static-cms-page-search-dms.json new file mode 100644 index 00000000..1f91fbee --- /dev/null +++ b/cypress/fixtures/suite/yves/cms/static-cms-page-search-dms.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "test-cms-page-dms-yves", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/suite/yves/core/static-locale.json b/cypress/fixtures/suite/yves/core/static-locale-switching.json similarity index 52% rename from cypress/fixtures/suite/yves/core/static-locale.json rename to cypress/fixtures/suite/yves/core/static-locale-switching.json index 83d4068b..c4ec4473 100644 --- a/cypress/fixtures/suite/yves/core/static-locale.json +++ b/cypress/fixtures/suite/yves/core/static-locale-switching.json @@ -1,5 +1,6 @@ { "availableLocales": ["de", "en"], "localeDE": "de_DE", - "localeEN": "en_US" + "localeEN": "en_US", + "productName": "Canon IXUS 285" } diff --git a/cypress/fixtures/suite/yves/customer-account-management/dynamic-customer-auth-dms.json b/cypress/fixtures/suite/yves/customer-account-management/dynamic-customer-auth-dms.json new file mode 100644 index 00000000..70fb7f10 --- /dev/null +++ b/cypress/fixtures/suite/yves/customer-account-management/dynamic-customer-auth-dms.json @@ -0,0 +1,38 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "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": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/customer-account-management/static-customer-auth-dms.json b/cypress/fixtures/suite/yves/customer-account-management/static-customer-auth-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/suite/yves/customer-account-management/static-customer-auth-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/fixtures/suite/yves/order-amendment/dynamic-order-amendment-start.json b/cypress/fixtures/suite/yves/order-amendment/dynamic-order-amendment-start.json index 5b8e3699..b2d9cf8b 100644 --- a/cypress/fixtures/suite/yves/order-amendment/dynamic-order-amendment-start.json +++ b/cypress/fixtures/suite/yves/order-amendment/dynamic-order-amendment-start.json @@ -308,48 +308,6 @@ ] } ] - }, - { - "type": "helper", - "name": "havePersistentQuote", - "arguments": [ - { - "customer": "#customer5", - "items": [ - { - "sku": "#product.sku", - "abstractSku": "#product.abstract_sku", - "quantity": 1 - }, - { - "sku": "#productInActive.sku", - "abstractSku": "#productInActive.abstract_sku", - "quantity": 1 - } - ] - } - ] - }, - { - "type": "helper", - "name": "havePersistentQuote", - "arguments": [ - { - "customer": "#customer6", - "items": [ - { - "sku": "#product.sku", - "abstractSku": "#product.abstract_sku", - "quantity": 1 - }, - { - "sku": "#productOutOfStock.sku", - "abstractSku": "#productOutOfStock.abstract_sku", - "quantity": 1 - } - ] - } - ] } ] } diff --git a/cypress/fixtures/suite/yves/product/dynamic-publish-and-synchronize-dms.json b/cypress/fixtures/suite/yves/product/dynamic-publish-and-synchronize-dms.json new file mode 100644 index 00000000..97ba0630 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-publish-and-synchronize-dms.json @@ -0,0 +1,39 @@ +{ + "data": { + "type": "dynamic-fixtures", + "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": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/static-publish-and-synchronize-dms.json b/cypress/fixtures/suite/yves/product/static-publish-and-synchronize-dms.json new file mode 100644 index 00000000..e2529b5b --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-publish-and-synchronize-dms.json @@ -0,0 +1,10 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "TEST_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + } +} diff --git a/cypress/support/pages/backoffice/availability/index/availability-index-page.ts b/cypress/support/pages/backoffice/availability/index/availability-index-page.ts index 3ba0b6b7..31612497 100644 --- a/cypress/support/pages/backoffice/availability/index/availability-index-page.ts +++ b/cypress/support/pages/backoffice/availability/index/availability-index-page.ts @@ -11,27 +11,16 @@ export class AvailabilityIndexPage extends BackofficePage { protected PAGE_URL = '/availability-gui'; update = (params: UpdateParams): void => { - const findParams = { query: params.query, expectedCount: 1 }; - - this.find(findParams).then(($merchantRow) => { - if (params.action === ActionEnum.view) { - cy.wrap($merchantRow).find(this.repository.getViewButtonSelector()).should('exist').click({ force: true }); + this.find({ tableUrl: '/availability-gui/index/availability-abstract-table**', searchQuery: params.query }).then( + ($availabilityRow) => { + if (params.action === ActionEnum.view) { + cy.wrap($availabilityRow) + .find(this.repository.getViewButtonSelector()) + .should('exist') + .click({ force: true }); + } } - }); - }; - - find = (params: FindParams): Cypress.Chainable => { - const searchSelector = this.repository.getSearchSelector(); - cy.get(searchSelector).clear(); - cy.get(searchSelector).invoke('val', params.query); - cy.get(searchSelector).type('{enter}'); - - this.interceptTable({ - url: '/availability-gui/index/availability-abstract-table**', - expectedCount: params.expectedCount, - }); - - return this.repository.getFirstTableRow(); + ); }; } @@ -39,8 +28,3 @@ interface UpdateParams { action: ActionEnum; query: string; } - -interface FindParams { - query: string; - expectedCount?: number; -} diff --git a/cypress/support/pages/backoffice/backoffice-page.ts b/cypress/support/pages/backoffice/backoffice-page.ts index d62d054c..bc4a1187 100644 --- a/cypress/support/pages/backoffice/backoffice-page.ts +++ b/cypress/support/pages/backoffice/backoffice-page.ts @@ -1,7 +1,7 @@ import { injectable } from 'inversify'; - import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; +import Chainable = Cypress.Chainable; @injectable() export class BackofficePage extends AbstractPage { @@ -9,17 +9,105 @@ export class BackofficePage extends AbstractPage { cy.visitBackoffice(this.PAGE_URL, options); }; - protected interceptTable = (params: InterceptGuiTableParams): void => { + public interceptTable = (params: InterceptGuiTableParams, callback?: () => void): Chainable => { const expectedCount = params.expectedCount ?? 1; const interceptAlias = this.faker.string.uuid(); cy.intercept('GET', params.url).as(interceptAlias); - cy.wait(`@${interceptAlias}`) + return cy + .wait(`@${interceptAlias}`) .its('response.body.recordsFiltered') - .should((total: number) => { - const valueToBeAtMost = expectedCount + Cypress.currentRetry; - assert.isTrue(total === expectedCount || total >= valueToBeAtMost); + .should((total) => { + if (params.expectedCount !== null) { + const valueToBeAtMost = expectedCount + Cypress.currentRetry; + assert.isTrue(total === expectedCount || total >= valueToBeAtMost); + } + }) + .then(() => { + if (callback) { + return callback(); + } + }); + }; + + public find = (params: UpdateParams): Cypress.Chainable => { + // eslint-disable-next-line cypress/unsafe-to-chain-command + return cy + .get('[type="search"]') + .clear() + .invoke('val', params.searchQuery) + .trigger('input') + .then(() => { + return this.interceptTable({ url: params.tableUrl, expectedCount: params.expectedCount }, () => { + cy.get('tbody > tr:visible').then(($rows) => { + let rows = Cypress.$($rows); + + if (params.rowFilter && params.rowFilter.length > 0) { + params.rowFilter.forEach((filterFn) => { + if (rows.length > 0) { + rows = rows.filter((index, row) => filterFn(Cypress.$(row))); + } + }); + } + + if (rows.length > 0) { + return cy.wrap(rows.first()); + } else { + cy.log('No rows found after filtering'); + return null; + } + }); + }); + }); + }; + + public findWithRetry = (params: UpdateWithRetryParams): Cypress.Chainable => { + const retryCount = 2; + let attempts = 0; + + const searchAndIntercept = (): Cypress.Chainable => { + attempts++; + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get('[type="search"]') + .clear() + .then(() => { + cy.visitBackoffice(params.pageUrl); + }); + + return this.interceptTable({ url: params.tableUrl }).then(() => { + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get('[type="search"]') + .invoke('val', params.searchQuery) + .trigger('input') + .then(() => { + return this.interceptTable({ url: params.tableUrl, expectedCount: params.expectedCount }, () => { + cy.get('tbody > tr:visible').then(($rows) => { + let rows = Cypress.$($rows); + + if (params.rowFilter && params.rowFilter.length > 0) { + params.rowFilter.forEach((filterFn) => { + if (rows.length > 0) { + rows = rows.filter((index, row) => filterFn(Cypress.$(row))); + } + }); + } + + if (rows.length > 0) { + return cy.wrap(rows.first()); + } else if (attempts < retryCount) { + cy.log(`Retrying... Attempt ${attempts}`); + return searchAndIntercept(); + } else { + cy.log('No rows found after filtering'); + return null; + } + }); + }); + }); }); + }; + + return searchAndIntercept(); }; } @@ -36,5 +124,20 @@ export enum ActionEnum { interface InterceptGuiTableParams { url: string; + expectedCount?: number | null; +} + +interface UpdateParams { + searchQuery: string; + tableUrl: string; + rowFilter?: Array<(row: JQuery) => boolean>; expectedCount?: number; } + +interface UpdateWithRetryParams { + searchQuery: string; + tableUrl: string; + rowFilter?: Array<(row: JQuery) => boolean>; + expectedCount?: number | null; + pageUrl: string; +} diff --git a/cypress/support/pages/backoffice/catalog/category/list/category-list-page.ts b/cypress/support/pages/backoffice/catalog/category/list/category-list-page.ts index 0791fe42..ec6c61fd 100644 --- a/cypress/support/pages/backoffice/catalog/category/list/category-list-page.ts +++ b/cypress/support/pages/backoffice/catalog/category/list/category-list-page.ts @@ -11,10 +11,8 @@ export class CategoryListPage extends BackofficePage { protected PAGE_URL = '/category-gui/list'; update = (params: UpdateParams): void => { - const findParams = { query: params.query, expectedCount: 1 }; - - this.find(findParams).then(($merchantRow) => { - cy.wrap($merchantRow).find(this.repository.getDropdownToggleButtonSelector()).should('exist').click(); + this.find({ tableUrl: '/category-gui/list/table**', searchQuery: params.query }).then(($categoryRow) => { + cy.wrap($categoryRow).find(this.repository.getDropdownToggleButtonSelector()).should('exist').click(); cy.get(this.repository.getDropdownMenuSelector()) .find(this.repository.getEditButtonSelector()) @@ -22,24 +20,9 @@ export class CategoryListPage extends BackofficePage { .click(); }); }; - - find = (params: FindParams): Cypress.Chainable => { - const searchSelector = this.repository.getSearchSelector(); - cy.get(searchSelector).clear(); - cy.get(searchSelector).type(params.query); - - this.interceptTable({ url: 'category-gui/list/table**', expectedCount: params.expectedCount }); - - return this.repository.getFirstTableRow(); - }; } interface UpdateParams { action: ActionEnum; query: string; } - -interface FindParams { - query: string; - expectedCount?: number; -} diff --git a/cypress/support/pages/backoffice/cms/block/list/block-list-page.ts b/cypress/support/pages/backoffice/cms/block/list/block-list-page.ts new file mode 100644 index 00000000..e5dfb2ec --- /dev/null +++ b/cypress/support/pages/backoffice/cms/block/list/block-list-page.ts @@ -0,0 +1,44 @@ +import { autoWired } from '@utils'; +import { BackofficePage } from '@pages/backoffice'; +import { inject, injectable } from 'inversify'; +import { BlockListRepository } from './block-list-repository'; + +@injectable() +@autoWired +export class BlockListPage extends BackofficePage { + @inject(BlockListRepository) private repository: BlockListRepository; + + protected PAGE_URL = '/cms-block-gui/list-block'; + + getPageUrl(): string { + return this.PAGE_URL; + } + + update = (params: UpdateParams): void => { + this.find({ searchQuery: params.query, tableUrl: 'cms-block-gui/list-block/table**' }).then(($storeRow) => { + cy.wrap($storeRow).as('row'); + cy.get('@row').find(this.repository.getEditButtonSelector()).should('exist').click(); + }); + }; + + clickEditAction = (row: JQuery): void => { + cy.wrap(row).find(this.repository.getEditButtonSelector()).should('exist').click(); + }; + + rowIsAssignedToStore = (params: IsAssignedParams): boolean => { + if (typeof params.storeName !== 'string') { + return false; + } + + return params.row.find(this.repository.getStoreCellSelector()).text().includes(params.storeName); + }; +} + +interface IsAssignedParams { + row: JQuery; + storeName?: string; +} + +interface UpdateParams { + query: string; +} diff --git a/cypress/support/pages/backoffice/cms/block/list/block-list-repository.ts b/cypress/support/pages/backoffice/cms/block/list/block-list-repository.ts new file mode 100644 index 00000000..da66cb78 --- /dev/null +++ b/cypress/support/pages/backoffice/cms/block/list/block-list-repository.ts @@ -0,0 +1,11 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class BlockListRepository { + getEditButtonSelector = (): string => 'a:contains("Edit Block")'; + getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); + getSearchSelector = (): string => '[type="search"]'; + getStoreCellSelector = (): string => '.column-Store'; +} diff --git a/cypress/support/pages/backoffice/cms/block/update/block-update-page.ts b/cypress/support/pages/backoffice/cms/block/update/block-update-page.ts new file mode 100644 index 00000000..4a80c56b --- /dev/null +++ b/cypress/support/pages/backoffice/cms/block/update/block-update-page.ts @@ -0,0 +1,19 @@ +import { autoWired } from '@utils'; +import { BackofficePage } from '@pages/backoffice'; +import { inject, injectable } from 'inversify'; +import { BlockUpdateRepository } from './block-update-repository'; + +@injectable() +@autoWired +export class BlockUpdatePage extends BackofficePage { + @inject(BlockUpdateRepository) private repository: BlockUpdateRepository; + + protected PAGE_URL = '/cms-block-gui/edit-block'; + assignAllAvailableStore = (): void => { + this.repository.getAllAvailableStoresInputs().check(); + }; + + save = (): void => { + this.repository.getSaveButton().click(); + }; +} diff --git a/cypress/support/pages/backoffice/cms/block/update/block-update-repository.ts b/cypress/support/pages/backoffice/cms/block/update/block-update-repository.ts new file mode 100644 index 00000000..49180bbc --- /dev/null +++ b/cypress/support/pages/backoffice/cms/block/update/block-update-repository.ts @@ -0,0 +1,9 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class BlockUpdateRepository { + getAllAvailableStoresInputs = (): Cypress.Chainable => cy.get('input[name="cms_block[storeRelation][id_stores][]"]'); + getSaveButton = (): Cypress.Chainable => cy.get('input[type="submit"]'); +} diff --git a/cypress/support/pages/backoffice/cms/cms-placeholder/edit/cms-placeholder-edit-page.ts b/cypress/support/pages/backoffice/cms/cms-placeholder/edit/cms-placeholder-edit-page.ts new file mode 100644 index 00000000..27bdeaac --- /dev/null +++ b/cypress/support/pages/backoffice/cms/cms-placeholder/edit/cms-placeholder-edit-page.ts @@ -0,0 +1,41 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { CmsPlaceholderEditRepository } from './cms-placeholder-edit-repository'; + +@injectable() +@autoWired +export class CmsPlaceholderEditPage extends BackofficePage { + @inject(CmsPlaceholderEditRepository) private repository: CmsPlaceholderEditRepository; + + protected PAGE_URL = '/cms-gui/create-glossary/index'; + + update = (params: UpdateParams): void => { + this.repository + .getTitleBlock() + .find(this.repository.getAllCollapsedIboxButtonsSelector()) + .each(($button) => { + cy.wrap($button).click(); + }); + + this.repository + .getTitleBlock() + .find(this.repository.getAllIboxesSelector()) + .each(($ibox) => { + cy.wrap($ibox) + .find(this.repository.getLocalizedTextareaSelector()) + .each(($input) => { + cy.wrap($input).clear({ force: true }); + cy.wrap($input).type(params.cmsPageName, { force: true }); + }); + }); + + this.repository.getUpdatePlaceholderButton().click(); + + this.repository.getPublishPageButton().click({ force: true }); + }; +} + +interface UpdateParams { + cmsPageName: string; +} diff --git a/cypress/support/pages/backoffice/cms/cms-placeholder/edit/cms-placeholder-edit-repository.ts b/cypress/support/pages/backoffice/cms/cms-placeholder/edit/cms-placeholder-edit-repository.ts new file mode 100644 index 00000000..fad0114c --- /dev/null +++ b/cypress/support/pages/backoffice/cms/cms-placeholder/edit/cms-placeholder-edit-repository.ts @@ -0,0 +1,13 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CmsPlaceholderEditRepository { + getTitleBlock = (): Cypress.Chainable => cy.get('#tab-content-title'); + getAllIboxesSelector = (): string => '.placeholder-translation-container > .ibox.nested'; + getAllCollapsedIboxButtonsSelector = (): string => '.placeholder-translation-container > .collapsed .collapse-link'; + getLocalizedTextareaSelector = (): string => '.note-editor .note-editable'; + getPublishPageButton = (): Cypress.Chainable => cy.get('[name="publish_version_page_form"]').find('.safe-submit'); + getUpdatePlaceholderButton = (): Cypress.Chainable => cy.get('form[name=cms_glossary]').find('[type="submit"]'); +} diff --git a/cypress/support/pages/backoffice/cms/page/create/cms-page-create-page.ts b/cypress/support/pages/backoffice/cms/page/create/cms-page-create-page.ts new file mode 100644 index 00000000..e157cb6f --- /dev/null +++ b/cypress/support/pages/backoffice/cms/page/create/cms-page-create-page.ts @@ -0,0 +1,42 @@ +import { autoWired } from '@utils'; +import { BackofficePage } from '@pages/backoffice'; +import { inject, injectable } from 'inversify'; +import { CmsPageCreateRepository } from './cms-page-create-repository'; + +@injectable() +@autoWired +export class CmsPageCreatePage extends BackofficePage { + @inject(CmsPageCreateRepository) private repository: CmsPageCreateRepository; + + protected PAGE_URL = '/cms-gui/create-page'; + + create = (params: CreateParams): void => { + this.repository.getIsSearchableCheckbox().check(); + + this.repository + .getGeneralBlock() + .find(this.repository.getAllCollapsedIboxButtonsSelector()) + .each(($button) => { + cy.wrap($button).click({ force: true }); + }); + + this.repository + .getGeneralBlock() + .find(this.repository.getAllIboxesSelector()) + .each(($ibox) => { + cy.wrap($ibox) + .find(this.repository.getLocalizedFieldSelector()) + .each(($field) => { + cy.wrap($field).as('field'); + cy.get('@field').clear({ force: true }); + cy.get('@field').type(params.cmsPageName, { force: true }); + }); + }); + + this.repository.getCreatePageButton().click(); + }; +} + +interface CreateParams { + cmsPageName: string; +} diff --git a/cypress/support/pages/backoffice/cms/page/create/cms-page-create-repository.ts b/cypress/support/pages/backoffice/cms/page/create/cms-page-create-repository.ts new file mode 100644 index 00000000..32d16210 --- /dev/null +++ b/cypress/support/pages/backoffice/cms/page/create/cms-page-create-repository.ts @@ -0,0 +1,13 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CmsPageCreateRepository { + getGeneralBlock = (): Cypress.Chainable => cy.get('#tab-content-general'); + getAllCollapsedIboxButtonsSelector = (): string => '.collapsed .collapse-link'; + getAllIboxesSelector = (): string => '.ibox.nested'; + getLocalizedFieldSelector = (): string => 'input[type="text"]'; + getCreatePageButton = (): Cypress.Chainable => cy.get('form[name=cms_page]').find('[type="submit"]'); + getIsSearchableCheckbox = (): Cypress.Chainable => cy.get('#cms_page_isSearchable'); +} diff --git a/cypress/support/pages/backoffice/index.ts b/cypress/support/pages/backoffice/index.ts index 830dc902..ec1ac57b 100644 --- a/cypress/support/pages/backoffice/index.ts +++ b/cypress/support/pages/backoffice/index.ts @@ -7,6 +7,10 @@ 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 './cms/block/list/block-list-page'; +export * from './cms/block/update/block-update-page'; +export * from './cms/page/create/cms-page-create-page'; +export * from './cms/cms-placeholder/edit/cms-placeholder-edit-page'; export * from './sales/detail/sales-detail-page'; export * from './sales/index/sales-index-page'; export * from './sales-return/create/sales-return-create-page'; @@ -24,3 +28,11 @@ export * from './product-management/edit/variant/product-management-edit-variant export * from './availability/view/availability-view-page'; export * from './availability/edit/availability-edit-page'; export * from './availability/index/availability-index-page'; +export * from './store/list/store-list-page'; +export * from './store/create/store-create-page'; +export * from './stock/list/stock-list-page'; +export * from './stock/edit/stock-edit-page'; +export * from './shipment/shipment-method/list/shipment-method-list-page'; +export * from './shipment/shipment-method/edit/shipment-method-edit-page'; +export * from './payment-method/list/payment-method-list-page'; +export * from './payment-method/edit/payment-method-edit-page'; 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 2c9de007..991a1552 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,9 @@ export class MerchantListPage extends BackofficePage { protected PAGE_URL = '/merchant-gui/list-merchant'; update = (params: UpdateParams): void => { - const findParams = { query: params.query, expectedCount: 1 }; - - this.find(findParams).then(($merchantRow) => { + this.find({ tableUrl: '/merchant-gui/list-merchant/table**', searchQuery: params.query }).then(($merchantRow) => { if (params.action === ActionEnum.edit) { - cy.wrap($merchantRow).find(this.repository.getEditButtonSelector()).should('exist').click({ force: true }); + this.clickEditAction($merchantRow); } if (params.action === ActionEnum.activate) { @@ -45,15 +43,16 @@ export class MerchantListPage extends BackofficePage { }); }; - find = (params: FindParams): Cypress.Chainable => { - const searchSelector = this.repository.getSearchSelector(); - cy.get(searchSelector).clear(); - cy.get(searchSelector).invoke('val', params.query); - cy.get(searchSelector).type('{enter}'); + clickEditAction = ($row: JQuery): void => { + cy.wrap($row).find(this.repository.getEditButtonSelector()).click(); + }; - this.interceptTable({ url: '/merchant-gui/list-merchant/table**', expectedCount: params.expectedCount }); + rowIsAssignedToStore = (params: IsAssignedParams): boolean => { + if (typeof params.storeName !== 'string') { + return false; + } - return this.repository.getFirstTableRow(); + return params.row.find(this.repository.getStoreCellSelector()).text().includes(params.storeName); }; } @@ -62,7 +61,7 @@ interface UpdateParams { query: string; } -interface FindParams { - query: string; - expectedCount?: number; +interface IsAssignedParams { + row: JQuery; + storeName?: string; } 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 7d559291..b457ed79 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts @@ -11,4 +11,5 @@ export class MerchantListRepository { getDeactivateButtonSelector = (): string => 'button:contains("Deactivate")'; getApproveAccessButtonSelector = (): string => 'button:contains("Approve Access")'; getDenyAccessButtonSelector = (): string => 'button:contains("Deny Access")'; + getStoreCellSelector = (): string => 'td[class*="column-spy_merchant_store"]'; } 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 c24f4134..e1d2ab83 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -10,24 +10,13 @@ export class MerchantUpdatePage extends BackofficePage { protected PAGE_URL = '/merchant-gui/edit-merchant'; - find = (params: FindParams): Cypress.Chainable => { - const searchSelector = this.repository.getSearchSelector(); - cy.get(searchSelector).clear(); - cy.get(searchSelector).invoke('val', params.query); - cy.get(searchSelector).type('{enter}'); - - this.interceptTable({ url: '/merchant-user-gui/index/table**', expectedCount: params.expectedCount }); - - return this.repository.getFirstTableRow(); - }; - create = (): void => { this.repository.getUsersTab().click(); this.repository.getAddMerchantUserButton().click(); }; -} -interface FindParams { - query: string; - expectedCount?: number; + assignAllAvailableStore = (): void => { + this.repository.getAllAvailableStoresInputs().check(); + this.repository.getSaveButton().click(); + }; } 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 01e8ca64..c7fad9e3 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts @@ -8,4 +8,6 @@ export class MerchantUpdateRepository { getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); getSearchSelector = (): string => '.dataTables_filter input[type="search"]'; getAddMerchantUserButton = (): Cypress.Chainable => cy.get('body').find('a:contains("Add Merchant User")'); + getAllAvailableStoresInputs = (): Cypress.Chainable => cy.get('input[name="merchant[storeRelation][id_stores][]"]'); + getSaveButton = (): Cypress.Chainable => cy.get('input[type="submit"]'); } diff --git a/cypress/support/pages/backoffice/payment-method/edit/payment-method-edit-page.ts b/cypress/support/pages/backoffice/payment-method/edit/payment-method-edit-page.ts new file mode 100644 index 00000000..01d9ac86 --- /dev/null +++ b/cypress/support/pages/backoffice/payment-method/edit/payment-method-edit-page.ts @@ -0,0 +1,19 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { PaymentMethodEditRepository } from './payment-method-edit-repository'; +import { BackofficePage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class PaymentMethodEditPage extends BackofficePage { + @inject(PaymentMethodEditRepository) private repository: PaymentMethodEditRepository; + + assignAllAvailableStore = (): void => { + this.repository.getStoreRelationTab().click(); + this.repository.getAllAvailableStoresInputs().check(); + }; + + save = (): void => { + this.repository.getSaveButton().click(); + }; +} diff --git a/cypress/support/pages/backoffice/payment-method/edit/payment-method-edit-repository.ts b/cypress/support/pages/backoffice/payment-method/edit/payment-method-edit-repository.ts new file mode 100644 index 00000000..a3095ed6 --- /dev/null +++ b/cypress/support/pages/backoffice/payment-method/edit/payment-method-edit-repository.ts @@ -0,0 +1,11 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class PaymentMethodEditRepository { + getStoreRelationTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-store-relation"]'); + getAllAvailableStoresInputs = (): Cypress.Chainable => + cy.get('input[name="payment_method_form[storeRelation][id_stores][]"]'); + getSaveButton = (): Cypress.Chainable => cy.get('[type="submit"]'); +} diff --git a/cypress/support/pages/backoffice/payment-method/list/payment-method-list-page.ts b/cypress/support/pages/backoffice/payment-method/list/payment-method-list-page.ts new file mode 100644 index 00000000..2b99c914 --- /dev/null +++ b/cypress/support/pages/backoffice/payment-method/list/payment-method-list-page.ts @@ -0,0 +1,33 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { PaymentMethodListRepository } from './payment-method-list-repository'; + +@injectable() +@autoWired +export class PaymentMethodListPage extends BackofficePage { + @inject(PaymentMethodListRepository) private repository: PaymentMethodListRepository; + + protected PAGE_URL = '/payment-gui/payment-method'; + + getEditButtonSelector = (): string => { + return this.repository.getEditButtonSelector(); + }; + + getMethodKeyRowSelector = (): string => { + return this.repository.getMethodKeyRowSelector(); + }; + + rowIsAssignedToStore = (params: IsAssignedParams): boolean => { + if (typeof params.storeName !== 'string') { + return false; + } + + return params.row.find(this.repository.getStoreCellSelector()).text().includes(params.storeName); + }; +} + +interface IsAssignedParams { + row: JQuery; + storeName?: string; +} diff --git a/cypress/support/pages/backoffice/payment-method/list/payment-method-list-repository.ts b/cypress/support/pages/backoffice/payment-method/list/payment-method-list-repository.ts new file mode 100644 index 00000000..6657ccdf --- /dev/null +++ b/cypress/support/pages/backoffice/payment-method/list/payment-method-list-repository.ts @@ -0,0 +1,12 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class PaymentMethodListRepository { + getEditButtonSelector = (): string => 'a:contains("Edit")'; + getMethodKeyRowSelector = (): string => 'td[class*="payment_method_key"]'; + getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); + getSearchSelector = (): string => '[type="search"]'; + getStoreCellSelector = (): string => 'td[class*="column-spy_store"]'; +} diff --git a/cypress/support/pages/backoffice/product-management/add/product-management-add-page.ts b/cypress/support/pages/backoffice/product-management/add/product-management-add-page.ts index 10fbd7aa..81d88433 100644 --- a/cypress/support/pages/backoffice/product-management/add/product-management-add-page.ts +++ b/cypress/support/pages/backoffice/product-management/add/product-management-add-page.ts @@ -30,10 +30,9 @@ export class ProductManagementAddPage extends BackofficePage { this.repository.getPriceTaxTab().click(); - this.repository.getDefaultGrossPriceInput().type(productAbstract.price); - this.repository.getOriginalGrossPriceInput().type(productAbstract.price); - this.repository.getDefaultNetPriceInput().type(productAbstract.price); - this.repository.getOriginalNetPriceInput().type(productAbstract.price); + this.repository.getAllPriceInputs().each(($el) => { + cy.wrap($el).type(productAbstract.price, { force: true }); + }); if (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { this.repository.getTaxSelect().select('Standard Taxes', { force: true }); diff --git a/cypress/support/pages/backoffice/product-management/add/product-management-add-repository.ts b/cypress/support/pages/backoffice/product-management/add/product-management-add-repository.ts index 9e405b43..edd018c4 100644 --- a/cypress/support/pages/backoffice/product-management/add/product-management-add-repository.ts +++ b/cypress/support/pages/backoffice/product-management/add/product-management-add-repository.ts @@ -14,6 +14,7 @@ export class ProductManagementAddRepository { getNewFromInput = (): Cypress.Chainable => cy.get('#product_form_add_new_from'); getNewToInput = (): Cypress.Chainable => cy.get('#product_form_add_new_to'); getPriceTaxTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-price_and_tax"]'); + getAllPriceInputs = (): Cypress.Chainable => cy.get('#price-table-collection [data-decimal-rounding="2"]'); getDefaultGrossPriceInput = (): Cypress.Chainable => cy.get('#product_form_add_prices_1-93-DEFAULT-BOTH_moneyValue_gross_amount'); getOriginalGrossPriceInput = (): Cypress.Chainable => diff --git a/cypress/support/pages/backoffice/product-management/edit/product-management-edit-page.ts b/cypress/support/pages/backoffice/product-management/edit/product-management-edit-page.ts index 34a9a6d9..6d374064 100644 --- a/cypress/support/pages/backoffice/product-management/edit/product-management-edit-page.ts +++ b/cypress/support/pages/backoffice/product-management/edit/product-management-edit-page.ts @@ -24,4 +24,24 @@ export class ProductManagementEditPage extends BackofficePage { cy.get('@editVariantButton').should('be.visible').click({ force: true }); }); }; + + assignAllPossibleStores = (): void => { + this.repository.getGeneralTab().click({ force: true }); + this.repository.getAllStockInputs().check(); + }; + + bulkPriceUpdate = (productPrice: string): void => { + this.repository.getPriceTaxTab().click(); + this.repository.getAllPriceInputs().each(($el) => { + cy.wrap($el).type(productPrice, { force: true, delay: 0 }); + }); + }; + + setDummyDEName = (): void => { + this.repository.getProductNameDEInput().type(this.faker.commerce.productName()); + }; + + save = (): void => { + this.repository.getSaveButton().click(); + }; } diff --git a/cypress/support/pages/backoffice/product-management/edit/product-management-edit-repository.ts b/cypress/support/pages/backoffice/product-management/edit/product-management-edit-repository.ts index 693a357e..bdb137ff 100644 --- a/cypress/support/pages/backoffice/product-management/edit/product-management-edit-repository.ts +++ b/cypress/support/pages/backoffice/product-management/edit/product-management-edit-repository.ts @@ -8,4 +8,10 @@ export class ProductManagementEditRepository { getVariantsTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-variants"]'); getVariantFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); getVariantEditButtonSelector = (): string => 'a:contains("Edit")'; + getGeneralTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-general"]'); + getPriceTaxTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-price_and_tax"]'); + getAllStockInputs = (): Cypress.Chainable => cy.get('input[name="product_form_edit[store_relation][id_stores][]"]'); + getAllPriceInputs = (): Cypress.Chainable => cy.get('#price-table-collection [data-decimal-rounding="2"]'); + getSaveButton = (): Cypress.Chainable => cy.get('[name="product_form_edit"] [value="Save"]'); + getProductNameDEInput = (): Cypress.Chainable => cy.get('#product_form_edit_general_de_DE_name'); } diff --git a/cypress/support/pages/backoffice/product-management/edit/variant/product-management-edit-variant-repository.ts b/cypress/support/pages/backoffice/product-management/edit/variant/product-management-edit-variant-repository.ts index bde89231..acdad712 100644 --- a/cypress/support/pages/backoffice/product-management/edit/variant/product-management-edit-variant-repository.ts +++ b/cypress/support/pages/backoffice/product-management/edit/variant/product-management-edit-variant-repository.ts @@ -12,6 +12,6 @@ export class ProductManagementEditVariantRepository { getSearchableENCheckbox = (): Cypress.Chainable => cy.get('#product_concrete_form_edit_general_en_US_is_searchable'); getPriceStockTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-price"]'); getIsNeverOutOfStockCheckbox = (): Cypress.Chainable => - cy.get('#product_concrete_form_edit_price_and_stock_1_is_never_out_of_stock'); + cy.get('#product_concrete_form_edit_price_and_stock_0_is_never_out_of_stock'); getSaveButton = (): Cypress.Chainable => cy.get('[type="submit"]'); } diff --git a/cypress/support/pages/backoffice/product-management/list/product-management-list-page.ts b/cypress/support/pages/backoffice/product-management/list/product-management-list-page.ts index 307a1b39..4e549942 100644 --- a/cypress/support/pages/backoffice/product-management/list/product-management-list-page.ts +++ b/cypress/support/pages/backoffice/product-management/list/product-management-list-page.ts @@ -11,10 +11,20 @@ export class ProductManagementListPage extends BackofficePage { protected PAGE_URL = '/product-management'; - update = (params: UpdateParams): void => { - const findParams = { query: params.query, expectedCount: 1 }; + clickEditAction = ($row: JQuery): void => { + cy.wrap($row).find(this.repository.getEditButtonSelector()).should('exist').click(); + }; + + rowIsAssignedToStore = (params: IsAssignedParams): boolean => { + if (typeof params.storeName !== 'string') { + return false; + } + + return params.row.find(this.repository.getStoreCellSelector()).text().includes(params.storeName); + }; - this.find(findParams).then(($productRow) => { + update = (params: UpdateParams): void => { + this.find({ searchQuery: params.query, tableUrl: '/product-management/index/table**' }).then(($productRow) => { if (params.action === ActionEnum.edit) { cy.wrap($productRow).find(this.repository.getEditButtonSelector()).as('editButton'); cy.get('@editButton').click(); @@ -25,25 +35,14 @@ export class ProductManagementListPage extends BackofficePage { } }); }; - - find = (params: FindParams): Cypress.Chainable => { - const searchSelector = this.repository.getSearchSelector(); - cy.get(searchSelector).clear(); - cy.get(searchSelector).invoke('val', params.query); - cy.get(searchSelector).type('{enter}'); - - this.interceptTable({ url: '/product-management/index/table**', expectedCount: params.expectedCount }); - - return this.repository.getFirstTableRow(); - }; -} - -interface FindParams { - query: string; - expectedCount?: number; } interface UpdateParams { action: ActionEnum; query: string; } + +interface IsAssignedParams { + row: JQuery; + storeName?: string; +} diff --git a/cypress/support/pages/backoffice/product-management/list/product-management-list-repository.ts b/cypress/support/pages/backoffice/product-management/list/product-management-list-repository.ts index b9196bc4..f8258245 100644 --- a/cypress/support/pages/backoffice/product-management/list/product-management-list-repository.ts +++ b/cypress/support/pages/backoffice/product-management/list/product-management-list-repository.ts @@ -7,5 +7,6 @@ export class ProductManagementListRepository { getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); getSearchSelector = (): string => '[type="search"]'; getEditButtonSelector = (): string => 'a:contains("Edit")'; + getStoreCellSelector = (): string => 'td[class*="column-store_relation"]'; getDenyButtonSelector = (): string => 'a:contains("Deny")'; } diff --git a/cypress/support/pages/backoffice/shipment/shipment-method/edit/shipment-method-edit-page.ts b/cypress/support/pages/backoffice/shipment/shipment-method/edit/shipment-method-edit-page.ts new file mode 100644 index 00000000..e71271f7 --- /dev/null +++ b/cypress/support/pages/backoffice/shipment/shipment-method/edit/shipment-method-edit-page.ts @@ -0,0 +1,26 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { ShipmentMethodEditRepository } from './shipment-method-edit-repository'; +import { BackofficePage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class ShipmentMethodEditPage extends BackofficePage { + @inject(ShipmentMethodEditRepository) private repository: ShipmentMethodEditRepository; + + assignAllAvailableStore = (): void => { + this.repository.getStoreRelationTab().click(); + this.repository.getAllAvailableStoresInputs().check(); + }; + + addPrices = (price = '1.00'): void => { + this.repository.getPricesTab().click(); + this.repository.getPriceInputs().each(($input) => { + cy.wrap($input).type(price, { delay: 0 }); + }); + }; + + save = (): void => { + this.repository.getSaveButton().click(); + }; +} diff --git a/cypress/support/pages/backoffice/shipment/shipment-method/edit/shipment-method-edit-repository.ts b/cypress/support/pages/backoffice/shipment/shipment-method/edit/shipment-method-edit-repository.ts new file mode 100644 index 00000000..cf6c928d --- /dev/null +++ b/cypress/support/pages/backoffice/shipment/shipment-method/edit/shipment-method-edit-repository.ts @@ -0,0 +1,13 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ShipmentMethodEditRepository { + getStoreRelationTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-store-relation"]'); + getAllAvailableStoresInputs = (): Cypress.Chainable => + cy.get('input[name="shipment_method[storeRelation][id_stores][]"]'); + getPricesTab = (): Cypress.Chainable => cy.get('.nav-tabs li[data-tab-content-id="tab-content-price-tax"]'); + getPriceInputs = (): Cypress.Chainable => cy.get('#tab-content-price-tax input:text'); + getSaveButton = (): Cypress.Chainable => cy.get('[type="submit"]'); +} diff --git a/cypress/support/pages/backoffice/shipment/shipment-method/list/shipment-method-list-page.ts b/cypress/support/pages/backoffice/shipment/shipment-method/list/shipment-method-list-page.ts new file mode 100644 index 00000000..a38bf32f --- /dev/null +++ b/cypress/support/pages/backoffice/shipment/shipment-method/list/shipment-method-list-page.ts @@ -0,0 +1,33 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { ShipmentMethodListRepository } from './shipment-method-list-repository'; + +@injectable() +@autoWired +export class ShipmentMethodListPage extends BackofficePage { + @inject(ShipmentMethodListRepository) private repository: ShipmentMethodListRepository; + + protected PAGE_URL = '/shipment-gui/shipment-method'; + + getEditButtonSelector = (): string => { + return this.repository.getEditButtonSelector(); + }; + + getMethodKeyRowSelector = (): string => { + return this.repository.getMethodKeyRowSelector(); + }; + + rowIsAssignedToStore = (params: IsAssignedParams): boolean => { + if (typeof params.storeName !== 'string') { + return false; + } + + return params.row.find(this.repository.getStoreCellSelector()).text().includes(params.storeName); + }; +} + +interface IsAssignedParams { + row: JQuery; + storeName?: string; +} diff --git a/cypress/support/pages/backoffice/shipment/shipment-method/list/shipment-method-list-repository.ts b/cypress/support/pages/backoffice/shipment/shipment-method/list/shipment-method-list-repository.ts new file mode 100644 index 00000000..0a23a3ee --- /dev/null +++ b/cypress/support/pages/backoffice/shipment/shipment-method/list/shipment-method-list-repository.ts @@ -0,0 +1,12 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ShipmentMethodListRepository { + getEditButtonSelector = (): string => 'a:contains("Edit")'; + getMethodKeyRowSelector = (): string => 'td[class*="shipment_method_key"]'; + getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); + getSearchSelector = (): string => '[type="search"]'; + getStoreCellSelector = (): string => 'td[class*="column-spy_store"]'; +} diff --git a/cypress/support/pages/backoffice/stock/edit/stock-edit-page.ts b/cypress/support/pages/backoffice/stock/edit/stock-edit-page.ts new file mode 100644 index 00000000..6f9fbf4f --- /dev/null +++ b/cypress/support/pages/backoffice/stock/edit/stock-edit-page.ts @@ -0,0 +1,20 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { BackofficePage } from '@pages/backoffice'; +import { StockEditRepository } from './stock-edit-repository'; + +@injectable() +@autoWired +export class StockEditPage extends BackofficePage { + @inject(StockEditRepository) private repository: StockEditRepository; + + protected PAGE_URL = '/stock-gui/edit-warehouse'; + + assignAllAvailableStore = (): void => { + this.repository.getStoreRelationTab().click(); + this.repository.getAllAvailableStoresInputs().check(); + + this.repository.getSaveButton().click(); + }; +} diff --git a/cypress/support/pages/backoffice/stock/edit/stock-edit-repository.ts b/cypress/support/pages/backoffice/stock/edit/stock-edit-repository.ts new file mode 100644 index 00000000..412bf113 --- /dev/null +++ b/cypress/support/pages/backoffice/stock/edit/stock-edit-repository.ts @@ -0,0 +1,10 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class StockEditRepository { + getStoreRelationTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-store-relation"]'); + getAllAvailableStoresInputs = (): Cypress.Chainable => cy.get('input[name="stock[storeRelation][id_stores][]"]'); + getSaveButton = (): Cypress.Chainable => cy.get('[type="submit"]'); +} diff --git a/cypress/support/pages/backoffice/stock/list/stock-list-page.ts b/cypress/support/pages/backoffice/stock/list/stock-list-page.ts new file mode 100644 index 00000000..25c2f900 --- /dev/null +++ b/cypress/support/pages/backoffice/stock/list/stock-list-page.ts @@ -0,0 +1,29 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { StockListRepository } from './stock-list-repository'; + +@injectable() +@autoWired +export class StockListPage extends BackofficePage { + @inject(StockListRepository) private repository: StockListRepository; + + protected PAGE_URL = '/stock-gui/warehouse/list'; + + getEditButtonSelector = (): string => { + return this.repository.getEditButtonSelector(); + }; + + rowIsAssignedToStore = (params: IsAssignedParams): boolean => { + if (typeof params.storeName !== 'string') { + return false; + } + + return params.row.find(this.repository.getStoreCellSelector()).text().includes(params.storeName); + }; +} + +interface IsAssignedParams { + row: JQuery; + storeName?: string; +} diff --git a/cypress/support/pages/backoffice/stock/list/stock-list-repository.ts b/cypress/support/pages/backoffice/stock/list/stock-list-repository.ts new file mode 100644 index 00000000..31180e59 --- /dev/null +++ b/cypress/support/pages/backoffice/stock/list/stock-list-repository.ts @@ -0,0 +1,12 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class StockListRepository { + getEditButtonSelector = (): string => 'a:contains("Edit")'; + getViewButtonSelector = (): string => 'a:contains("View")'; + getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); + getSearchSelector = (): string => '[type="search"]'; + getStoreCellSelector = (): string => 'td.column-available_in_store'; +} diff --git a/cypress/support/pages/backoffice/store/create/store-create-page.ts b/cypress/support/pages/backoffice/store/create/store-create-page.ts new file mode 100644 index 00000000..028932b6 --- /dev/null +++ b/cypress/support/pages/backoffice/store/create/store-create-page.ts @@ -0,0 +1,51 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { BackofficePage } from '@pages/backoffice'; +import { StoreCreateRepository } from './store-create-repository'; + +@injectable() +@autoWired +export class StoreCreatePage extends BackofficePage { + @inject(StoreCreateRepository) private repository: StoreCreateRepository; + + protected PAGE_URL = '/store-gui/create'; + + create = (store: Store): void => { + this.repository.getNameInput().type(store.name); + + this.repository.getLocalesTab().click(); + this.repository.getDefaultLocaleSelect().select(store.locale, { force: true }); + this.repository.getLocaleSearchInput().clear().type(store.locale, { delay: 0 }); + this.interceptTable({ url: '/locale-gui/index/available-locale-table-selectable**' }).then(() => { + this.repository.getAvailableLocaleInput(store.locale).click({ force: true }); + }); + + this.repository.getCurrenciesTab().click(); + this.repository.getDefaultCurrencySelect().select(store.currency, { force: true }); + this.repository.getCurrencySearchInput().clear().type(store.currency); + this.interceptTable({ url: '/currency-gui/index/available-currency-table-selectable**' }).then(() => { + this.repository.getAvailableCurrencyInput(store.currency).click({ force: true }); + }); + + this.repository.getDisplayRegionsTab().click(); + this.repository.getCountrySearchInput().clear().type(store.country); + this.interceptTable({ url: '/country-gui/index/available-country-table-selectable**' }).then(() => { + this.repository.getAvailableCountryInput(store.country).click({ force: true }); + }); + + this.repository.getStoreContextTabButton().click(); + this.repository.getAddStoreContextButton().click(); + this.repository.getTimezoneSelector().select(store.timezone); + + this.repository.getSaveButton().click(); + }; +} + +interface Store { + name: string; + locale: string; + currency: string; + country: string; + timezone: string; +} diff --git a/cypress/support/pages/backoffice/store/create/store-create-repository.ts b/cypress/support/pages/backoffice/store/create/store-create-repository.ts new file mode 100644 index 00000000..2cb5ed1a --- /dev/null +++ b/cypress/support/pages/backoffice/store/create/store-create-repository.ts @@ -0,0 +1,27 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class StoreCreateRepository { + getNameInput = (): Cypress.Chainable => cy.get('#store_name'); + getLocalesTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-locale_store_relation"]'); + getDefaultLocaleSelect = (): Cypress.Chainable => cy.get('[name="store[defaultLocaleIsoCode]"]'); + getCurrenciesTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-locale_currency_relation"]'); + getDefaultCurrencySelect = (): Cypress.Chainable => cy.get('[name="store[defaultCurrencyIsoCode]"]'); + getLocaleSearchInput = (): Cypress.Chainable => cy.get('#available-locale-table_filter').find('input'); + getCurrencySearchInput = (): Cypress.Chainable => cy.get('#available-currency-table_filter').find('input'); + getAvailableLocaleInput = (locale: string): Cypress.Chainable => + cy.get(`#available-locale-table_wrapper [value="${locale}"]`); + getAvailableCurrencyInput = (currency: string): Cypress.Chainable => + cy.get(`#available-currency-table [value="${currency}"]`); + getDisplayRegionsTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-country_store_relation"]'); + getCountrySearchInput = (): Cypress.Chainable => cy.get('#available-country-table_filter').find('input'); + getAvailableCountryInput = (country: string): Cypress.Chainable => + cy.get(`#available-country-table [value="${country}"]`); + getSaveButton = (): Cypress.Chainable => cy.get('[type="submit"]'); + getStoreContextTabButton = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-store_context"]'); + getAddStoreContextButton = (): Cypress.Chainable => cy.get('#tab-content-store_context .btn.add-store-context'); + getTimezoneSelector = (): Cypress.Chainable => + cy.get('#store_applicationContextCollection_applicationContexts_1_timezone'); +} diff --git a/cypress/support/pages/backoffice/store/list/store-list-page.ts b/cypress/support/pages/backoffice/store/list/store-list-page.ts new file mode 100644 index 00000000..9ad45574 --- /dev/null +++ b/cypress/support/pages/backoffice/store/list/store-list-page.ts @@ -0,0 +1,47 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage, ActionEnum } from '@pages/backoffice'; +import { StoreListRepository } from './store-list-repository'; + +@injectable() +@autoWired +export class StoreListPage extends BackofficePage { + @inject(StoreListRepository) private repository: StoreListRepository; + + protected PAGE_URL = '/store-gui/list'; + + createStore = (): void => { + this.repository.getCreateStoreButton().click(); + }; + + update = (params: UpdateParams): void => { + this.find({ searchQuery: params.query, tableUrl: '/store-gui/list/table**' }).then(($storeRow) => { + if (params.action === ActionEnum.edit) { + cy.wrap($storeRow).find(this.repository.getEditButtonSelector()).should('exist').click(); + } + + if (params.action === ActionEnum.view) { + cy.wrap($storeRow).find(this.repository.getViewButtonSelector()).should('exist').click(); + } + }); + }; + + hasStore = (storeName: string): Cypress.Chainable => { + const searchSelector = this.repository.getSearchSelector(); + cy.get(searchSelector).clear(); + cy.get(searchSelector).type(storeName); + + return this.interceptTable({ url: '/store-gui/list/table**', expectedCount: 0 }).then((recordsFiltered: number) => { + if (recordsFiltered > 0) { + return cy.wrap(true); + } else { + return cy.wrap(false); + } + }); + }; +} + +interface UpdateParams { + action: ActionEnum; + query: string; +} diff --git a/cypress/support/pages/backoffice/store/list/store-list-repository.ts b/cypress/support/pages/backoffice/store/list/store-list-repository.ts new file mode 100644 index 00000000..aa541098 --- /dev/null +++ b/cypress/support/pages/backoffice/store/list/store-list-repository.ts @@ -0,0 +1,12 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class StoreListRepository { + getCreateStoreButton = (): Cypress.Chainable => cy.get('body').find('a:contains("Create Store")'); + getEditButtonSelector = (): string => 'a:contains("Edit Store")'; + getViewButtonSelector = (): string => 'a:contains("View Store")'; + getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); + getSearchSelector = (): string => '[type="search"]'; +} 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 b26cdf29..cc6321f4 100644 --- a/cypress/support/pages/backoffice/user/index/user-index-page.ts +++ b/cypress/support/pages/backoffice/user/index/user-index-page.ts @@ -2,6 +2,7 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; import { BackofficePage, ActionEnum } from '@pages/backoffice'; import { UserIndexRepository } from './user-index-repository'; +import Chainable = Cypress.Chainable; @injectable() @autoWired @@ -14,10 +15,15 @@ export class UserIndexPage extends BackofficePage { this.repository.getAddNewUserButton().click(); }; - update = (params: UpdateParams): void => { - const findParams = { query: params.query, expectedCount: 1 }; + findUser(params: FindParams): Chainable { + return this.find({ searchQuery: params.query, tableUrl: '/user/index/table**' }); + } - this.find(findParams).then(($userRow) => { + update = (params: UpdateParams): void => { + this.find({ + searchQuery: params.query, + tableUrl: '/user/index/table**', + }).then(($userRow) => { if (params.action === ActionEnum.edit) { cy.wrap($userRow).find(this.repository.getEditButtonSelector()).should('exist').click({ force: true }); } @@ -36,28 +42,17 @@ export class UserIndexPage extends BackofficePage { }); }; - find = (params: FindParams): Cypress.Chainable => { - const searchSelector = this.repository.getSearchSelector(); - cy.get(searchSelector).clear(); - cy.get(searchSelector).invoke('val', params.query); - cy.get(searchSelector).type('{enter}'); - - this.interceptTable({ url: '/user/index/table**', expectedCount: params.expectedCount }); - - return this.repository.getFirstTableRow(); - }; - getUserTableHeader = (): Cypress.Chainable => { return this.repository.getTableHeader(); }; } -interface FindParams { +interface UpdateParams { + action: ActionEnum; query: string; - expectedCount?: number; } -interface UpdateParams { - action: ActionEnum; +interface FindParams { query: string; + expectedCount?: number; } diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index f89cb631..effbfef2 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -25,7 +25,7 @@ export class CartPage extends YvesPage { }; startCheckout = (): void => { - this.repository.getCheckoutButton().click(); + this.repository.getCheckoutButton().click({ force: true }); }; removeProduct = (params: RemoveProductParams): void => { diff --git a/cypress/support/pages/yves/catalog/catalog-page.ts b/cypress/support/pages/yves/catalog/catalog-page.ts index 43c69489..7722f914 100644 --- a/cypress/support/pages/yves/catalog/catalog-page.ts +++ b/cypress/support/pages/yves/catalog/catalog-page.ts @@ -17,7 +17,10 @@ export class CatalogPage extends YvesPage { } this.repository.getSearchInput().clear().invoke('val', params.query); - this.repository.getFirstSuggestedProduct().click(); + cy.intercept('**/search/suggestion**').as('searchSuggestion'); + cy.wait('@searchSuggestion').then(() => { + this.repository.getFirstSuggestedProduct().click(); + }); }; search = (params: SearchParams): void => { @@ -39,6 +42,16 @@ export class CatalogPage extends YvesPage { this.repository.getProductItemBlocks().first().find(this.repository.getViewButtonSelector()).click(); }); }; + + hasProductsInCatalog = (): Cypress.Chainable => { + return cy.get('body').then((body) => { + if (body.find(this.repository.getFirstProductItemBlockSelector()).length > 0) { + return cy.wrap(true); + } else { + return cy.wrap(false); + } + }); + }; } interface SearchParams { 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 aa036bfe..00866e3f 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -24,17 +24,17 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getSelectShippingAddressField().select('0', { force: true }); // Setting mandatory fields - this.repository.getShippingAddressFirstNameField().clear().type(checkoutAddress.firstName); - this.repository.getShippingAddressLastNameField().clear().type(checkoutAddress.lastName); - this.repository.getShippingAddressAddress1Field().clear().type(checkoutAddress.address1); - this.repository.getShippingAddressAddress2Field().clear().type(checkoutAddress.address2); - this.repository.getShippingAddressZipCodeField().clear().type(checkoutAddress.zipCode); - this.repository.getShippingAddressCityField().clear().type(checkoutAddress.city); + this.repository.getShippingAddressFirstNameField().clear().type(checkoutAddress.firstName, { delay: 0 }); + this.repository.getShippingAddressLastNameField().clear().type(checkoutAddress.lastName, { delay: 0 }); + this.repository.getShippingAddressAddress1Field().clear().type(checkoutAddress.address1, { delay: 0 }); + this.repository.getShippingAddressAddress2Field().clear().type(checkoutAddress.address2, { delay: 0 }); + this.repository.getShippingAddressZipCodeField().clear().type(checkoutAddress.zipCode, { delay: 0 }); + this.repository.getShippingAddressCityField().clear().type(checkoutAddress.city, { delay: 0 }); this.repository.getShippingAddressBillingSameAsShippingCheckbox().check({ force: true }); // Setting optional fields - this.repository.getShippingAddressCompanyField().clear().type(checkoutAddress.company); - this.repository.getShippingAddressPhoneField().clear().type(checkoutAddress.phone); + this.repository.getShippingAddressCompanyField().clear().type(checkoutAddress.company, { delay: 0 }); + this.repository.getShippingAddressPhoneField().clear().type(checkoutAddress.phone, { delay: 0 }); this.repository.getNextButton().click(); }; @@ -70,37 +70,37 @@ export class CheckoutAddressPage extends YvesPage { this.repository .getMultiShipmentAddressItemAddressFirstNameField($addressItem, index) .clear() - .type(checkoutAddress.firstName); + .type(checkoutAddress.firstName, { delay: 0 }); this.repository .getMultiShipmentAddressItemAddressLastNameField($addressItem, index) .clear() - .type(checkoutAddress.lastName); + .type(checkoutAddress.lastName, { delay: 0 }); this.repository .getMultiShipmentAddressItemAddressAddress1Field($addressItem, index) .clear() - .type(checkoutAddress.address1); + .type(checkoutAddress.address1, { delay: 0 }); this.repository .getMultiShipmentAddressItemAddressAddress2Field($addressItem, index) .clear() - .type(checkoutAddress.address2); + .type(checkoutAddress.address2, { delay: 0 }); this.repository .getMultiShipmentAddressItemAddressZipCodeField($addressItem, index) .clear() - .type(checkoutAddress.zipCode); + .type(checkoutAddress.zipCode, { delay: 0 }); this.repository .getMultiShipmentAddressItemAddressCityField($addressItem, index) .clear() - .type(checkoutAddress.city); + .type(checkoutAddress.city, { delay: 0 }); // Setting optional fields this.repository .getMultiShipmentAddressItemAddressCompanyField($addressItem, index) .clear() - .type(checkoutAddress.company); + .type(checkoutAddress.company, { delay: 0 }); this.repository .getMultiShipmentAddressItemAddressPhoneField($addressItem, index) .clear() - .type(checkoutAddress.phone); + .type(checkoutAddress.phone, { delay: 0 }); }); this.fillBillingAddress(); @@ -111,16 +111,16 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getSelectBillingAddressField().select('0', { force: true }); // Setting mandatory fields - this.repository.getBillingAddressFirstNameField().clear().type(checkoutAddress.firstName); - this.repository.getBillingAddressLastNameField().clear().type(checkoutAddress.lastName); - this.repository.getBillingAddressAddress1Field().clear().type(checkoutAddress.address1); - this.repository.getBillingAddressAddress2Field().clear().type(checkoutAddress.address2); - this.repository.getBillingAddressZipCodeField().clear().type(checkoutAddress.zipCode); - this.repository.getBillingAddressCityField().clear().type(checkoutAddress.city); + this.repository.getBillingAddressFirstNameField().clear().type(checkoutAddress.firstName, { delay: 0 }); + this.repository.getBillingAddressLastNameField().clear().type(checkoutAddress.lastName, { delay: 0 }); + this.repository.getBillingAddressAddress1Field().clear().type(checkoutAddress.address1, { delay: 0 }); + this.repository.getBillingAddressAddress2Field().clear().type(checkoutAddress.address2, { delay: 0 }); + this.repository.getBillingAddressZipCodeField().clear().type(checkoutAddress.zipCode, { delay: 0 }); + this.repository.getBillingAddressCityField().clear().type(checkoutAddress.city, { delay: 0 }); // Setting optional fields - this.repository.getBillingAddressCompanyField().clear().type(checkoutAddress.company); - this.repository.getBillingAddressPhoneField().clear().type(checkoutAddress.phone); + this.repository.getBillingAddressCompanyField().clear().type(checkoutAddress.company, { delay: 0 }); + this.repository.getBillingAddressPhoneField().clear().type(checkoutAddress.phone, { delay: 0 }); this.repository.getNextButton().click(); }; 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 5d160339..44de35cb 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts @@ -16,6 +16,10 @@ export class CheckoutShipmentPage extends YvesPage { this.repository.getStandardShipmentRadio($shipmentItem, index).click({ force: true }); }); + this.repository + .getShipmentDateInput() + .clear() + .type(new Date(+new Date().setHours(0, 0, 0, 0) + 86400000).toLocaleDateString('fr-CA')); 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 8806d5db..041d8b3e 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts @@ -2,4 +2,5 @@ export interface CheckoutShipmentRepository { getMultiShipmentGroups(): Cypress.Chainable; getStandardShipmentRadio($shipmentItem: JQuery, index: number): Cypress.Chainable; getNextButton(): Cypress.Chainable; + getShipmentDateInput(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/checkout/shipment/repositories/b2b-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/repositories/b2b-checkout-shipment-repository.ts index 12f96716..22168765 100644 --- a/cypress/support/pages/yves/checkout/shipment/repositories/b2b-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/repositories/b2b-checkout-shipment-repository.ts @@ -8,4 +8,6 @@ export class B2bCheckoutShipmentRepository implements CheckoutShipmentRepository getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0 input`); getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); + getShipmentDateInput = (): Cypress.Chainable => + cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); } diff --git a/cypress/support/pages/yves/checkout/shipment/repositories/b2b-mp-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/repositories/b2b-mp-checkout-shipment-repository.ts index 03fb91af..4c7c4186 100644 --- a/cypress/support/pages/yves/checkout/shipment/repositories/b2b-mp-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/repositories/b2b-mp-checkout-shipment-repository.ts @@ -8,4 +8,6 @@ export class B2bMpCheckoutShipmentRepository implements CheckoutShipmentReposito getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0 input`); getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); + getShipmentDateInput = (): Cypress.Chainable => + cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); } diff --git a/cypress/support/pages/yves/checkout/shipment/repositories/b2c-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/repositories/b2c-checkout-shipment-repository.ts index 2837ce38..df179e9a 100644 --- a/cypress/support/pages/yves/checkout/shipment/repositories/b2c-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/repositories/b2c-checkout-shipment-repository.ts @@ -8,4 +8,6 @@ export class B2cCheckoutShipmentRepository implements CheckoutShipmentRepository getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0`); getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); + getShipmentDateInput = (): Cypress.Chainable => + cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); } diff --git a/cypress/support/pages/yves/checkout/shipment/repositories/b2c-mp-checkout-shipment-repository.ts b/cypress/support/pages/yves/checkout/shipment/repositories/b2c-mp-checkout-shipment-repository.ts index a86c2aa1..8c8114bf 100644 --- a/cypress/support/pages/yves/checkout/shipment/repositories/b2c-mp-checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/repositories/b2c-mp-checkout-shipment-repository.ts @@ -8,4 +8,6 @@ export class B2cMpCheckoutShipmentRepository implements CheckoutShipmentReposito getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0`); getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); + getShipmentDateInput = (): Cypress.Chainable => + cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); } 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 6c0cdef0..c6125864 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 @@ -8,4 +8,6 @@ export class SuiteCheckoutShipmentRepository implements CheckoutShipmentReposito getStandardShipmentRadio = ($shipmentItem: JQuery, index: number): Cypress.Chainable => cy.wrap($shipmentItem).get(`#shipmentCollectionForm_shipmentGroups_${index}_shipment_shipmentSelection_0`); getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); + getShipmentDateInput = (): Cypress.Chainable => + cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); } diff --git a/cypress/support/pages/yves/content/cms-content-page.ts b/cypress/support/pages/yves/content/cms-content-page.ts new file mode 100644 index 00000000..f770301b --- /dev/null +++ b/cypress/support/pages/yves/content/cms-content-page.ts @@ -0,0 +1,25 @@ +import { REPOSITORIES, autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { YvesPage } from '@pages/yves'; +import { ContentRepository } from './content-repository'; + +@injectable() +@autoWired +export class CmsContentPage extends YvesPage { + @inject(REPOSITORIES.ContentRepository) private repository: ContentRepository; + + protected PAGE_URL = '/search'; + + findCmsPageFromSuggestions = (params: SearchParams): void => { + this.repository.search(params.query); + cy.intercept('**/search/suggestion**').as('searchSuggestion'); + cy.wait('@searchSuggestion').then(() => { + this.repository.getFirstSuggestedCmsPage(params.query).click(); + }); + }; +} + +interface SearchParams { + query: string; +} diff --git a/cypress/support/pages/yves/content/content-repository.ts b/cypress/support/pages/yves/content/content-repository.ts new file mode 100644 index 00000000..bd63b2cf --- /dev/null +++ b/cypress/support/pages/yves/content/content-repository.ts @@ -0,0 +1,4 @@ +export interface ContentRepository { + search(query: string): void; + getFirstSuggestedCmsPage(cmsPageName: string): Cypress.Chainable; +} diff --git a/cypress/support/pages/yves/content/repositories/b2b-content-repository.ts b/cypress/support/pages/yves/content/repositories/b2b-content-repository.ts new file mode 100644 index 00000000..65e8cc9c --- /dev/null +++ b/cypress/support/pages/yves/content/repositories/b2b-content-repository.ts @@ -0,0 +1,12 @@ +import { injectable } from 'inversify'; +import { ContentRepository } from '../content-repository'; + +@injectable() +export class B2bContentRepository implements ContentRepository { + search(query: string): void { + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get('[name="q"]').first().clear().invoke('val', query); + } + getFirstSuggestedCmsPage = (cmsPageName: string): Cypress.Chainable => + cy.get(`h6:contains("Pages")`).first().closest('div').find(`a:contains("${cmsPageName}")`).first(); +} diff --git a/cypress/support/pages/yves/content/repositories/b2b-mp-content-repository.ts b/cypress/support/pages/yves/content/repositories/b2b-mp-content-repository.ts new file mode 100644 index 00000000..136a7e95 --- /dev/null +++ b/cypress/support/pages/yves/content/repositories/b2b-mp-content-repository.ts @@ -0,0 +1,12 @@ +import { injectable } from 'inversify'; +import { ContentRepository } from '../content-repository'; + +@injectable() +export class B2bMpContentRepository implements ContentRepository { + search(query: string): void { + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get('[name="q"]').first().clear().invoke('val', query); + } + getFirstSuggestedCmsPage = (cmsPageName: string): Cypress.Chainable => + cy.get(`h6:contains("Pages")`).first().closest('div').find(`a:contains("${cmsPageName}")`).first(); +} diff --git a/cypress/support/pages/yves/content/repositories/b2c-content-repository.ts b/cypress/support/pages/yves/content/repositories/b2c-content-repository.ts new file mode 100644 index 00000000..fa2880b2 --- /dev/null +++ b/cypress/support/pages/yves/content/repositories/b2c-content-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; +import { ContentRepository } from '../content-repository'; + +@injectable() +export class B2cContentRepository implements ContentRepository { + search(query: string): void { + cy.get('header .header__search-open').click(); + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get('[name="q"]').first().clear().invoke('val', query); + } + getFirstSuggestedCmsPage = (cmsPageName: string): Cypress.Chainable => + cy.get(`h4:contains("Pages")`).first().closest('div').find(`a:contains("${cmsPageName}")`).first(); +} diff --git a/cypress/support/pages/yves/content/repositories/b2c-mp-content-repository.ts b/cypress/support/pages/yves/content/repositories/b2c-mp-content-repository.ts new file mode 100644 index 00000000..12fb4a21 --- /dev/null +++ b/cypress/support/pages/yves/content/repositories/b2c-mp-content-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; +import { ContentRepository } from '../content-repository'; + +@injectable() +export class B2cMpContentRepository implements ContentRepository { + search(query: string): void { + cy.get('header .header__search-open').click(); + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get('[name="q"]').first().clear().invoke('val', query); + } + getFirstSuggestedCmsPage = (cmsPageName: string): Cypress.Chainable => + cy.get(`h4:contains("Pages")`).first().closest('div').find(`a:contains("${cmsPageName}")`).first(); +} diff --git a/cypress/support/pages/yves/content/repositories/suite-content-repository.ts b/cypress/support/pages/yves/content/repositories/suite-content-repository.ts new file mode 100644 index 00000000..c5bc3b02 --- /dev/null +++ b/cypress/support/pages/yves/content/repositories/suite-content-repository.ts @@ -0,0 +1,11 @@ +import { injectable } from 'inversify'; +import { ContentRepository } from '../content-repository'; + +@injectable() +export class SuiteContentRepository implements ContentRepository { + search = (query: string): Cypress.Chainable => + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get('[data-qa="component search-form"] input').first().clear().invoke('val', query); + getFirstSuggestedCmsPage = (cmsPageName: string): Cypress.Chainable => + cy.get(`h6:contains("In CMS pages")`).first().closest('div').find(`a:contains("${cmsPageName}")`).first(); +} diff --git a/cypress/support/pages/yves/home/home-page.ts b/cypress/support/pages/yves/home/home-page.ts new file mode 100644 index 00000000..b1954d75 --- /dev/null +++ b/cypress/support/pages/yves/home/home-page.ts @@ -0,0 +1,28 @@ +import { autoWired, REPOSITORIES } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { YvesPage } from '@pages/yves'; +import { HomeRepository } from './home-repository'; + +@injectable() +@autoWired +export class HomePage extends YvesPage { + @inject(REPOSITORIES.HomeRepository) private repository: HomeRepository; + + protected PAGE_URL = '/'; + + waitTillStoreAvailable = (store: string): void => { + cy.reloadUntilFound( + this.PAGE_URL, + this.repository.getStoreSelectorOption(store), + this.repository.getStoreSelectorHeader(), + 25, + 5000 + ); + }; + + selectStore = (store: string): void => { + this.repository.selectStore(store); + cy.url().should('include', `${store}`); + }; +} diff --git a/cypress/support/pages/yves/home/home-repository.ts b/cypress/support/pages/yves/home/home-repository.ts new file mode 100644 index 00000000..e460b139 --- /dev/null +++ b/cypress/support/pages/yves/home/home-repository.ts @@ -0,0 +1,5 @@ +export interface HomeRepository { + selectStore(storeName: string): Cypress.Chainable; + getStoreSelectorOption(storeName: string): string; + getStoreSelectorHeader(): string; +} diff --git a/cypress/support/pages/yves/home/repositories/b2b-home-repository.ts b/cypress/support/pages/yves/home/repositories/b2b-home-repository.ts new file mode 100644 index 00000000..b7649d30 --- /dev/null +++ b/cypress/support/pages/yves/home/repositories/b2b-home-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; + +import { HomeRepository } from '../home-repository'; + +@injectable() +export class B2bHomeRepository implements HomeRepository { + selectStore = (storeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="component custom-select _store"] [name="_store"]') + .select(storeName, { force: true }); + getStoreSelectorOption = (storeName: string): string => `select[name="_store"] option[value*="${storeName}"]`; + getStoreSelectorHeader = (): string => `header [data-qa="component custom-select _store"]`; +} diff --git a/cypress/support/pages/yves/home/repositories/b2b-mp-home-repository.ts b/cypress/support/pages/yves/home/repositories/b2b-mp-home-repository.ts new file mode 100644 index 00000000..e0a21706 --- /dev/null +++ b/cypress/support/pages/yves/home/repositories/b2b-mp-home-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; + +import { HomeRepository } from '../home-repository'; + +@injectable() +export class B2bMpHomeRepository implements HomeRepository { + selectStore = (storeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="component custom-select _store"] [name="_store"]') + .select(storeName, { force: true }); + getStoreSelectorOption = (storeName: string): string => `select[name="_store"] option[value*="${storeName}"]`; + getStoreSelectorHeader = (): string => `header [data-qa="component custom-select _store"]`; +} diff --git a/cypress/support/pages/yves/home/repositories/b2c-home-repository.ts b/cypress/support/pages/yves/home/repositories/b2c-home-repository.ts new file mode 100644 index 00000000..863cc69d --- /dev/null +++ b/cypress/support/pages/yves/home/repositories/b2c-home-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; + +import { HomeRepository } from '../home-repository'; + +@injectable() +export class B2cHomeRepository implements HomeRepository { + selectStore = (storeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="component custom-select _store"] [name="_store"]') + .select(storeName, { force: true }); + getStoreSelectorOption = (storeName: string): string => `select[name="_store"] option[value*="${storeName}"]`; + getStoreSelectorHeader = (): string => `header [data-qa="component custom-select _store"]`; +} diff --git a/cypress/support/pages/yves/home/repositories/b2c-mp-home-repository.ts b/cypress/support/pages/yves/home/repositories/b2c-mp-home-repository.ts new file mode 100644 index 00000000..7027c2df --- /dev/null +++ b/cypress/support/pages/yves/home/repositories/b2c-mp-home-repository.ts @@ -0,0 +1,14 @@ +import { injectable } from 'inversify'; + +import { HomeRepository } from '../home-repository'; +import * as Cypress from 'cypress'; + +@injectable() +export class B2cMpHomeRepository implements HomeRepository { + selectStore = (storeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="component custom-select _store"] [name="_store"]') + .select(storeName, { force: true }); + getStoreSelectorOption = (storeName: string): string => `select[name="_store"] option[value*="${storeName}"]`; + getStoreSelectorHeader = (): string => `header [data-qa="component custom-select _store"]`; +} diff --git a/cypress/support/pages/yves/home/repositories/suite-home-repository.ts b/cypress/support/pages/yves/home/repositories/suite-home-repository.ts new file mode 100644 index 00000000..4c4494bc --- /dev/null +++ b/cypress/support/pages/yves/home/repositories/suite-home-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; + +import { HomeRepository } from '../home-repository'; + +@injectable() +export class SuiteHomeRepository implements HomeRepository { + selectStore = (storeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="component select _store"] [name="_store"]') + .select('Store: ' + storeName, { force: true }); + getStoreSelectorOption = (storeName: string): string => `select[name="_store"] option[value*="${storeName}"]`; + getStoreSelectorHeader = (): string => `header [data-qa="component select _store"]`; +} diff --git a/cypress/support/pages/yves/index.ts b/cypress/support/pages/yves/index.ts index 959ef311..3cbffa11 100644 --- a/cypress/support/pages/yves/index.ts +++ b/cypress/support/pages/yves/index.ts @@ -1,4 +1,5 @@ export * from './yves-page'; +export * from './home/home-page'; export * from './cart/cart-page'; export * from './agent-login/agent-login-page'; export * from './checkout/address/checkout-address-page'; @@ -19,4 +20,4 @@ export * from './product/product-page'; export * from './customer/overview/customer-overview-page'; export * from './customer/order/order-details-page'; export * from './product-comparison/product-comparison-page'; -export * from './index/index-page'; +export * from './content/cms-content-page'; diff --git a/cypress/support/pages/yves/index/index-page.ts b/cypress/support/pages/yves/index/index-page.ts deleted file mode 100644 index 0dd13239..00000000 --- a/cypress/support/pages/yves/index/index-page.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { autoWired } from '@utils'; -import { injectable } from 'inversify'; - -import { YvesPage } from '@pages/yves'; - -@injectable() -@autoWired -export class IndexPage extends YvesPage { - protected PAGE_URL = '/'; -} diff --git a/cypress/support/pages/yves/index/index-repository.ts b/cypress/support/pages/yves/index/index-repository.ts deleted file mode 100644 index 7a00b230..00000000 --- a/cypress/support/pages/yves/index/index-repository.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { autoWired } from '@utils'; -import { injectable } from 'inversify'; - -@injectable() -@autoWired -export class IndexRepository {} diff --git a/cypress/support/pages/yves/product/product-page.ts b/cypress/support/pages/yves/product/product-page.ts index aff52435..e63218a1 100644 --- a/cypress/support/pages/yves/product/product-page.ts +++ b/cypress/support/pages/yves/product/product-page.ts @@ -16,7 +16,7 @@ export class ProductPage extends YvesPage { this.repository.getQuantityInput().invoke('val', params.quantity.toString()); } - this.repository.getAddToCartButton().click({ force: true }); + this.repository.getAddToCartButton().click(); }; getAddToCartSuccessMessage = (): string => { diff --git a/cypress/support/pages/yves/repositories/b2b-mp-yves-repository.ts b/cypress/support/pages/yves/repositories/b2b-mp-yves-repository.ts new file mode 100644 index 00000000..3502d60a --- /dev/null +++ b/cypress/support/pages/yves/repositories/b2b-mp-yves-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; + +import { YvesRepository } from '../yves-repository'; + +@injectable() +export class B2bMpYvesRepository implements YvesRepository { + selectLocale = (localeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="language-selector"] [name="_locale"]') + .select(localeName, { force: true }); + getLocaleOptionsSelector = (): string => `[data-qa="language-selector"] option`; + getLocaleAttributeName = (): string => 'data-locale'; +} diff --git a/cypress/support/pages/yves/repositories/b2b-yves-repository.ts b/cypress/support/pages/yves/repositories/b2b-yves-repository.ts new file mode 100644 index 00000000..c23469c3 --- /dev/null +++ b/cypress/support/pages/yves/repositories/b2b-yves-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; + +import { YvesRepository } from '../yves-repository'; + +@injectable() +export class B2bYvesRepository implements YvesRepository { + selectLocale = (localeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="language-selector"] [name="_locale"]') + .select(localeName, { force: true }); + getLocaleOptionsSelector = (): string => `[data-qa="language-selector"] option`; + getLocaleAttributeName = (): string => 'data-locale'; +} diff --git a/cypress/support/pages/yves/repositories/b2c-mp-yves-repository.ts b/cypress/support/pages/yves/repositories/b2c-mp-yves-repository.ts new file mode 100644 index 00000000..747c4c7c --- /dev/null +++ b/cypress/support/pages/yves/repositories/b2c-mp-yves-repository.ts @@ -0,0 +1,14 @@ +import { injectable } from 'inversify'; + +import * as Cypress from 'cypress'; +import { YvesRepository } from '../yves-repository'; + +@injectable() +export class B2cMpYvesRepository implements YvesRepository { + selectLocale = (localeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="language-selector"] [name="_locale"]') + .select(localeName, { force: true }); + getLocaleOptionsSelector = (): string => `[data-qa="language-selector"] option`; + getLocaleAttributeName = (): string => 'data-locale'; +} diff --git a/cypress/support/pages/yves/repositories/b2c-yves-repository.ts b/cypress/support/pages/yves/repositories/b2c-yves-repository.ts new file mode 100644 index 00000000..89307a4c --- /dev/null +++ b/cypress/support/pages/yves/repositories/b2c-yves-repository.ts @@ -0,0 +1,13 @@ +import { injectable } from 'inversify'; + +import { YvesRepository } from '../yves-repository'; + +@injectable() +export class B2cYvesRepository implements YvesRepository { + selectLocale = (localeName: string): Cypress.Chainable => + cy + .get('[data-qa="component header"] [data-qa="language-selector"] [name="_locale"]') + .select(localeName, { force: true }); + getLocaleOptionsSelector = (): string => `[data-qa="language-selector"] option`; + getLocaleAttributeName = (): string => 'data-locale'; +} diff --git a/cypress/support/pages/yves/repositories/suite-yves-repository.ts b/cypress/support/pages/yves/repositories/suite-yves-repository.ts new file mode 100644 index 00000000..33e491bc --- /dev/null +++ b/cypress/support/pages/yves/repositories/suite-yves-repository.ts @@ -0,0 +1,11 @@ +import { injectable } from 'inversify'; + +import { YvesRepository } from '../yves-repository'; + +@injectable() +export class SuiteYvesRepository implements YvesRepository { + selectLocale = (localeName: string): Cypress.Chainable => + cy.get('[data-qa="component header"] [data-qa="language-selector"]').select(localeName, { force: true }); + getLocaleOptionsSelector = (): string => `[data-qa="language-selector"] option`; + getLocaleAttributeName = (): string => 'data-locale'; +} diff --git a/cypress/support/pages/yves/yves-page.ts b/cypress/support/pages/yves/yves-page.ts index c3371a93..c4ad1c5c 100644 --- a/cypress/support/pages/yves/yves-page.ts +++ b/cypress/support/pages/yves/yves-page.ts @@ -1,11 +1,32 @@ -import { injectable } from 'inversify'; +import { autoWired, REPOSITORIES } from '@utils'; +import { inject, injectable } from 'inversify'; import { AbstractPage } from '../abstract-page'; import VisitOptions = Cypress.VisitOptions; +import { YvesRepository } from './yves-repository'; @injectable() +@autoWired export class YvesPage extends AbstractPage { + @inject(REPOSITORIES.YvesRepository) private yvesRepository: YvesRepository; + visit = (options?: Partial): void => { cy.visit(this.PAGE_URL, options); }; + + getAvailableLocales = (): Cypress.Chainable => { + return cy.get(this.yvesRepository.getLocaleOptionsSelector()).then((options) => { + const values = Array.from(options).map((option) => option.textContent?.trim() || ''); + return Cypress.Promise.resolve(values); + }); + }; + + selectLocale = (locale: string): void => { + this.yvesRepository.selectLocale(locale); + cy.url().should('include', `${locale}`); + }; + + assertCurrentLocale = (locale: string): Cypress.Chainable => { + return cy.get('html').should('have.attr', this.yvesRepository.getLocaleAttributeName(), locale); + }; } diff --git a/cypress/support/pages/yves/yves-repository.ts b/cypress/support/pages/yves/yves-repository.ts index 221756d4..ca7c0b75 100644 --- a/cypress/support/pages/yves/yves-repository.ts +++ b/cypress/support/pages/yves/yves-repository.ts @@ -1,2 +1,5 @@ export interface YvesRepository { + selectLocale(localeName: string): Cypress.Chainable; + getLocaleOptionsSelector(): string; + getLocaleAttributeName(): string; } diff --git a/cypress/support/scenarios/backoffice/assign-store-to-default-payment-methods-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-default-payment-methods-scenario.ts new file mode 100644 index 00000000..f8b3b91b --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-default-payment-methods-scenario.ts @@ -0,0 +1,32 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { AssignStoreToPaymentMethodScenario } from '@scenarios/backoffice'; + +@injectable() +@autoWired +export class AssignStoreToPaymentMethodsScenario { + @inject(AssignStoreToPaymentMethodScenario) + private assignStoreToPaymentMethodScenario: AssignStoreToPaymentMethodScenario; + + execute = (params: ExecuteParams): void => { + params.paymentMethods.forEach((paymentMethod) => { + this.assignStoreToPaymentMethodScenario.execute({ + storeName: params.storeName, + paymentMethodName: paymentMethod.name, + paymentMethodKey: paymentMethod.key, + shouldTriggerPublishAndSync: params.shouldTriggerPublishAndSync, + }); + }); + }; +} + +interface ExecuteParams { + storeName: string; + paymentMethods: PaymentMethod[]; + shouldTriggerPublishAndSync?: boolean; +} + +interface PaymentMethod { + key: string; + name: string; +} diff --git a/cypress/support/scenarios/backoffice/assign-store-to-default-shipment-methods-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-default-shipment-methods-scenario.ts new file mode 100644 index 00000000..9f90d19a --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-default-shipment-methods-scenario.ts @@ -0,0 +1,37 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { AssignStoreToShipmentMethodScenario } from '@scenarios/backoffice'; + +@injectable() +@autoWired +export class AssignStoreToDefaultShipmentMethodsScenario { + @inject(AssignStoreToShipmentMethodScenario) + private assignStoreToShipmentMethodScenario: AssignStoreToShipmentMethodScenario; + + DEFAULT_SHIPMENT_METHODS = [ + { + key: 'spryker_dummy_shipment-standard', + name: 'Standard', + }, + { + key: 'spryker_dummy_shipment-express', + name: 'Express', + }, + ]; + + execute = (params: ExecuteParams): void => { + this.DEFAULT_SHIPMENT_METHODS.forEach((shipmentMethod) => { + this.assignStoreToShipmentMethodScenario.execute({ + storeName: params.storeName, + shipmentMethodName: shipmentMethod.name, + shipmentMethodKey: shipmentMethod.key, + shouldTriggerPublishAndSync: params.shouldTriggerPublishAndSync, + }); + }); + }; +} + +interface ExecuteParams { + storeName: string; + shouldTriggerPublishAndSync?: boolean; +} diff --git a/cypress/support/scenarios/backoffice/assign-store-to-default-shipment-types-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-default-shipment-types-scenario.ts new file mode 100644 index 00000000..417cb7c7 --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-default-shipment-types-scenario.ts @@ -0,0 +1,78 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class AssignStoreToDefaultShipmentTypesScenario { + execute = (params: ExecuteParams): void => { + cy.request({ + method: 'POST', + url: Cypress.env().glueBackendUrl + '/token', + headers: { + Store: params.store, + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: `grantType=password&username=${params.username}&password=${params.password}`, + }).then((response) => { + const authToken = response.body.access_token; + cy.wrap(authToken).as('authToken'); + + cy.request({ + method: 'GET', + url: Cypress.env().glueBackendUrl + '/shipment-types', + headers: { + Authorization: `Bearer ${authToken}`, + 'Content-Type': 'application/vnd.api+json', + }, + }).then((response) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const deliveryIds = response.body.data.map((item: any) => item.id); + cy.wrap(deliveryIds).as('deliveryIds'); + }); + + cy.request({ + method: 'GET', + url: Cypress.env().backofficeUrl + '/store-gui/list/table', + }).then((response) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const storeNames = response.body.data.map((store: any) => store[1]); + cy.wrap(storeNames).as('storeNames'); + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + cy.get('@deliveryIds').then((deliveryIds: any) => { + cy.get('@storeNames').then((storeNames) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + deliveryIds.forEach((deliveryId: any) => { + cy.request({ + method: 'PATCH', + url: `${Cypress.env().glueBackendUrl}/shipment-types/${deliveryId}`, + headers: { + Authorization: `Bearer ${authToken}`, + 'Content-Type': 'application/vnd.api+json', + }, + body: { + data: { + type: 'shipment-types', + attributes: { + stores: storeNames, + }, + }, + }, + }).then((patchResponse) => { + expect(patchResponse.status).to.eq(200); + }); + }); + }); + }); + }); + + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + }; +} + +interface ExecuteParams { + store: string; + username: string; + password: string; +} diff --git a/cypress/support/scenarios/backoffice/assign-store-to-default-warehouse-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-default-warehouse-scenario.ts new file mode 100644 index 00000000..fbb3e3db --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-default-warehouse-scenario.ts @@ -0,0 +1,24 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { AssignStoreToWarehouseScenario } from '@scenarios/backoffice'; + +@injectable() +@autoWired +export class AssignStoreToDefaultWarehouseScenario { + @inject(AssignStoreToWarehouseScenario) private assignStoreToWarehouseScenario: AssignStoreToWarehouseScenario; + + DEFAULT_WAREHOUSE = 'Warehouse1'; + + execute = (params: ExecuteParams): void => { + this.assignStoreToWarehouseScenario.execute({ + warehouseName: this.DEFAULT_WAREHOUSE, + storeName: params.storeName, + shouldTriggerPublishAndSync: params.shouldTriggerPublishAndSync, + }); + }; +} + +interface ExecuteParams { + storeName?: string; + shouldTriggerPublishAndSync?: boolean; +} diff --git a/cypress/support/scenarios/backoffice/assign-store-to-payment-method-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-payment-method-scenario.ts new file mode 100644 index 00000000..9de17838 --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-payment-method-scenario.ts @@ -0,0 +1,45 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { PaymentMethodListPage, PaymentMethodEditPage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class AssignStoreToPaymentMethodScenario { + @inject(PaymentMethodListPage) private listPaymentMethodPage: PaymentMethodListPage; + @inject(PaymentMethodEditPage) private editPaymentMethodPage: PaymentMethodEditPage; + + execute = (params: ExecuteParams): void => { + this.listPaymentMethodPage.visit(); + this.listPaymentMethodPage + .find({ + searchQuery: params.paymentMethodName, + tableUrl: '/payment-gui/payment-method/table**', + rowFilter: [ + (row): boolean => !this.listPaymentMethodPage.rowIsAssignedToStore({ row, storeName: params.storeName }), + (row): boolean => + row.find(this.listPaymentMethodPage.getMethodKeyRowSelector()).text().trim() === params.paymentMethodKey, + ], + }) + .then(($row) => { + if ($row === null) { + return; + } + + cy.wrap($row).find(this.listPaymentMethodPage.getEditButtonSelector()).click(); + + this.editPaymentMethodPage.assignAllAvailableStore(); + this.editPaymentMethodPage.save(); + + if (params?.shouldTriggerPublishAndSync) { + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + } + }); + }; +} + +interface ExecuteParams { + paymentMethodName: string; + paymentMethodKey: string; + shouldTriggerPublishAndSync?: boolean; + storeName?: string; +} diff --git a/cypress/support/scenarios/backoffice/assign-store-to-product-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-product-scenario.ts new file mode 100644 index 00000000..1c0dd8ed --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-product-scenario.ts @@ -0,0 +1,48 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { ProductManagementEditPage, ProductManagementListPage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class AssignStoreToProductScenario { + @inject(ProductManagementEditPage) private productManagementEditPage: ProductManagementEditPage; + @inject(ProductManagementListPage) private productManagementListPage: ProductManagementListPage; + + protected DEFAULT_BULK_PRODUCT_PRICE = '300'; + + execute = (params: ExecuteParams): void => { + this.productManagementListPage.visit(); + this.productManagementListPage + .find({ + searchQuery: params.abstractProductSku, + tableUrl: '/product-management/index/table**', + }) + .then(($row) => { + const isStoreAssigned = this.productManagementListPage.rowIsAssignedToStore({ + row: $row, + storeName: params.storeName, + }); + + this.productManagementListPage.clickEditAction($row); + this.productManagementEditPage.setDummyDEName(); // Gap in dynamic fixtures + + if (!isStoreAssigned) { + this.productManagementEditPage.assignAllPossibleStores(); + } + + this.productManagementEditPage.bulkPriceUpdate(params.bulkProductPrice ?? this.DEFAULT_BULK_PRODUCT_PRICE); + this.productManagementEditPage.save(); + + if (params.shouldTriggerPublishAndSync) { + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + } + }); + }; +} + +interface ExecuteParams { + abstractProductSku: string; + storeName?: string; + bulkProductPrice?: string; + shouldTriggerPublishAndSync?: boolean; +} diff --git a/cypress/support/scenarios/backoffice/assign-store-to-shipment-method-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-shipment-method-scenario.ts new file mode 100644 index 00000000..f797abde --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-shipment-method-scenario.ts @@ -0,0 +1,46 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { ShipmentMethodEditPage, ShipmentMethodListPage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class AssignStoreToShipmentMethodScenario { + @inject(ShipmentMethodListPage) private shipmentMethodListPage: ShipmentMethodListPage; + @inject(ShipmentMethodEditPage) private shipmentMethodEditPage: ShipmentMethodEditPage; + + execute = (params: ExecuteParams): void => { + this.shipmentMethodListPage.visit(); + this.shipmentMethodListPage + .find({ + searchQuery: params.shipmentMethodName, + tableUrl: '/shipment-gui/shipment-method/table**', + rowFilter: [ + (row): boolean => !this.shipmentMethodListPage.rowIsAssignedToStore({ row, storeName: params.storeName }), + (row): boolean => + row.find(this.shipmentMethodListPage.getMethodKeyRowSelector()).text().trim() === params.shipmentMethodKey, + ], + }) + .then(($row) => { + if ($row === null) { + return; + } + + cy.wrap($row).find(this.shipmentMethodListPage.getEditButtonSelector()).click(); + + this.shipmentMethodEditPage.assignAllAvailableStore(); + this.shipmentMethodEditPage.addPrices(); + this.shipmentMethodEditPage.save(); + + if (params?.shouldTriggerPublishAndSync) { + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + } + }); + }; +} + +interface ExecuteParams { + shipmentMethodName: string; + shipmentMethodKey: string; + storeName?: string; + shouldTriggerPublishAndSync?: boolean; +} diff --git a/cypress/support/scenarios/backoffice/assign-store-to-warehouse-scenario.ts b/cypress/support/scenarios/backoffice/assign-store-to-warehouse-scenario.ts new file mode 100644 index 00000000..3831aa85 --- /dev/null +++ b/cypress/support/scenarios/backoffice/assign-store-to-warehouse-scenario.ts @@ -0,0 +1,40 @@ +import { StockEditPage, StockListPage } from '@pages/backoffice'; +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +@injectable() +@autoWired +export class AssignStoreToWarehouseScenario { + @inject(StockEditPage) private stockEditPage: StockEditPage; + @inject(StockListPage) private stockListPage: StockListPage; + + execute = (params: ExecuteParams): void => { + this.stockListPage.visit(); + this.stockListPage + .find({ + searchQuery: params.warehouseName, + tableUrl: '/stock-gui/warehouse/table**', + rowFilter: [ + (row): boolean => !this.stockListPage.rowIsAssignedToStore({ row: row, storeName: params.storeName }), + ], + }) + .then(($row) => { + if ($row === null) { + return; + } + + cy.wrap($row).find(this.stockListPage.getEditButtonSelector()).click(); + this.stockEditPage.assignAllAvailableStore(); + + if (params.shouldTriggerPublishAndSync) { + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + } + }); + }; +} + +interface ExecuteParams { + warehouseName: string; + storeName?: string; + shouldTriggerPublishAndSync?: boolean; +} diff --git a/cypress/support/scenarios/backoffice/create-cms-page-scenario.ts b/cypress/support/scenarios/backoffice/create-cms-page-scenario.ts new file mode 100644 index 00000000..01d812ff --- /dev/null +++ b/cypress/support/scenarios/backoffice/create-cms-page-scenario.ts @@ -0,0 +1,26 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { CmsPageCreatePage, CmsPlaceholderEditPage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class CreateCmsPageScenario { + @inject(CmsPageCreatePage) private cmsPageCreatePage: CmsPageCreatePage; + @inject(CmsPlaceholderEditPage) private cmsPlaceholderEditPage: CmsPlaceholderEditPage; + + execute = (params: ExecuteParams): void => { + this.cmsPageCreatePage.visit(); + this.cmsPageCreatePage.create({ cmsPageName: params.cmsPageName }); + + this.cmsPlaceholderEditPage.update({ cmsPageName: params.cmsPageName }); + + if (params.shouldTriggerPublishAndSync) { + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + } + }; +} + +interface ExecuteParams { + cmsPageName: string; + shouldTriggerPublishAndSync?: boolean; +} diff --git a/cypress/support/scenarios/backoffice/create-store-scenario.ts b/cypress/support/scenarios/backoffice/create-store-scenario.ts new file mode 100644 index 00000000..1d862107 --- /dev/null +++ b/cypress/support/scenarios/backoffice/create-store-scenario.ts @@ -0,0 +1,39 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { StoreCreatePage, StoreListPage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class CreateStoreScenario { + @inject(StoreListPage) private storeListPage: StoreListPage; + @inject(StoreCreatePage) private storeCreatePage: StoreCreatePage; + + execute = (params: ExecuteParams): void => { + this.storeListPage.visit(); + const store = params.store; + + this.storeListPage.hasStore(store.name).then((isExists: boolean) => { + if (!isExists) { + this.storeListPage.createStore(); + this.storeCreatePage.create(store); + + if (params?.shouldTriggerPublishAndSync) { + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + } + } + }); + }; +} + +interface ExecuteParams { + store: Store; + shouldTriggerPublishAndSync?: boolean; +} + +interface Store { + name: string; + locale: string; + currency: string; + country: string; + timezone: string; +} diff --git a/cypress/support/scenarios/backoffice/enable-cms-block-for-all-stores-scenario.ts b/cypress/support/scenarios/backoffice/enable-cms-block-for-all-stores-scenario.ts new file mode 100644 index 00000000..cbffedd2 --- /dev/null +++ b/cypress/support/scenarios/backoffice/enable-cms-block-for-all-stores-scenario.ts @@ -0,0 +1,41 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BlockUpdatePage, BlockListPage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class EnableCmsBlockForAllStoresScenario { + @inject(BlockUpdatePage) private blockUpdatePage: BlockUpdatePage; + @inject(BlockListPage) private blockListPage: BlockListPage; + + execute = (params: ExecuteParams): void => { + this.blockListPage.visit(); + + this.blockListPage.interceptTable({ url: '/cms-block-gui/list-block/table**' }).then(() => { + this.blockListPage + .findWithRetry({ + searchQuery: params.cmsBlockName, + tableUrl: '/cms-block-gui/list-block/table**', + pageUrl: this.blockListPage.getPageUrl(), + }) + .then(($storeRow) => { + if (!this.blockListPage.rowIsAssignedToStore({ row: $storeRow, storeName: params.storeName })) { + this.blockListPage.clickEditAction($storeRow); + + this.blockUpdatePage.assignAllAvailableStore(); + this.blockUpdatePage.save(); + + if (params?.shouldTriggerPublishAndSync) { + cy.runCliCommands(['console queue:worker:start --stop-when-empty']); + } + } + }); + }); + }; +} + +interface ExecuteParams { + cmsBlockName: string; + shouldTriggerPublishAndSync?: boolean; + storeName?: string; +} diff --git a/cypress/support/scenarios/backoffice/index.ts b/cypress/support/scenarios/backoffice/index.ts index e49595c9..65ead81b 100644 --- a/cypress/support/scenarios/backoffice/index.ts +++ b/cypress/support/scenarios/backoffice/index.ts @@ -1,4 +1,15 @@ export * from './user-login-scenario'; +export * from './create-cms-page-scenario'; export * from './create-product-scenario'; export * from './deny-product-scenario'; export * from './remove-product-stock-scenario'; +export * from './create-store-scenario'; +export * from './assign-store-to-warehouse-scenario'; +export * from './assign-store-to-product-scenario'; +export * from './assign-store-to-shipment-method-scenario'; +export * from './assign-store-to-payment-method-scenario'; +export * from './assign-store-to-default-shipment-methods-scenario'; +export * from './assign-store-to-default-payment-methods-scenario'; +export * from './assign-store-to-default-shipment-types-scenario'; +export * from './assign-store-to-default-warehouse-scenario'; +export * from './enable-cms-block-for-all-stores-scenario'; diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 6d918e5c..50e86513 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -22,11 +22,9 @@ export class CheckoutScenario { execute = (params?: ExecuteParams): void => { this.cartPage.visit(); this.cartPage.startCheckout(); - if (params?.isGuest) { this.checkoutCustomerPage.checkoutAsGuest(); } - this.fillShippingAddress(params); this.checkoutShipmentPage.setStandardShippingMethod(); this.fillPaymentCheckoutStep(params); diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index 47422ee3..4df3876d 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -8,6 +8,13 @@ export class CustomerLoginScenario { @inject(LoginPage) private loginPage: LoginPage; execute = (params: ExecuteParams): void => { + if (params.withoutSession) { + this.loginPage.visit(); + this.loginPage.login(params); + + return; + } + cy.session([params.email, params.password], () => { this.loginPage.visit(); this.loginPage.login(params); @@ -18,4 +25,5 @@ export class CustomerLoginScenario { interface ExecuteParams { email: string; password: string; + withoutSession?: boolean; } diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index b2a441d4..8a3122b9 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -3,3 +3,4 @@ export * from './checkout-scenario'; export * from './checkout-mp-scenario'; export * from './customer-login-scenario'; export * from './locale-switching-scenario'; +export * from './select-store-scenario'; diff --git a/cypress/support/scenarios/yves/locale-switching-scenario.ts b/cypress/support/scenarios/yves/locale-switching-scenario.ts index cbb91d05..de68e55a 100644 --- a/cypress/support/scenarios/yves/locale-switching-scenario.ts +++ b/cypress/support/scenarios/yves/locale-switching-scenario.ts @@ -1,28 +1,20 @@ import { autoWired } from '@utils'; -import { injectable } from 'inversify'; +import { inject, injectable } from 'inversify'; +import { YvesPage, HomePage } from '../../pages/yves'; @injectable() @autoWired export class LocaleSwitchingScenario { - getAvailableLocales = (): Cypress.Chainable => { - return cy.get('[data-qa="language-selector"] option').then((options) => { - const values = Array.from(options).map((option) => option.textContent?.trim() || ''); - return Cypress.Promise.resolve(values); - }); - }; + @inject(HomePage) private yvesPage: YvesPage; - switchLocale = (locale: string): void => { - cy.get('[data-qa="language-selector"]').last().select(locale); - cy.get('[data-qa="language-selector"]') - .last() - .find('option:selected') - .invoke('text') - .then((text) => { - expect(text.trim()).to.equal(locale); - }); + execute = (params: ExecuteParams): void => { + this.yvesPage.assertCurrentLocale(params.currentLocale); + this.yvesPage.selectLocale(params.selectedLocale.split('_')[0]); + this.yvesPage.assertCurrentLocale(params.selectedLocale); }; +} - getCurrentLocale = (locale: string): Cypress.Chainable => { - return cy.get('html').should('have.attr', 'data-locale', locale); - }; +interface ExecuteParams { + currentLocale: string; + selectedLocale: string; } diff --git a/cypress/support/scenarios/yves/select-store-scenario.ts b/cypress/support/scenarios/yves/select-store-scenario.ts new file mode 100644 index 00000000..9413e6b5 --- /dev/null +++ b/cypress/support/scenarios/yves/select-store-scenario.ts @@ -0,0 +1,15 @@ +import { autoWired } from '@utils'; +import { HomePage } from '@pages/yves'; +import { inject, injectable } from 'inversify'; + +@injectable() +@autoWired +export class SelectStoreScenario { + @inject(HomePage) private homePage: HomePage; + + execute = (storeName: string): void => { + this.homePage.visit(); + this.homePage.waitTillStoreAvailable(storeName); + this.homePage.selectStore(storeName); + }; +} diff --git a/cypress/support/types/api/api.ts b/cypress/support/types/api/api.ts new file mode 100644 index 00000000..fcc743fe --- /dev/null +++ b/cypress/support/types/api/api.ts @@ -0,0 +1,10 @@ +import { Store, User } from './shared'; + +export interface HealthCheckDmsStaticFixtures { + store: Store; + defaultPassword: string; +} + +export interface HealthCheckDmsDynamicFixtures { + rootUser: User; +} diff --git a/cypress/support/types/api/cms.ts b/cypress/support/types/api/cms.ts new file mode 100644 index 00000000..52745c75 --- /dev/null +++ b/cypress/support/types/api/cms.ts @@ -0,0 +1,11 @@ +import { Store, User } from './shared'; + +export interface CmsPageSearchDmsDynamicFixtures { + rootUser: User; +} + +export interface CmsPageSearchDmsStaticFixtures { + defaultPassword: string; + store: Store; + cmsPageName: string; +} diff --git a/cypress/support/types/api/index.ts b/cypress/support/types/api/index.ts new file mode 100644 index 00000000..3d58fbb0 --- /dev/null +++ b/cypress/support/types/api/index.ts @@ -0,0 +1,2 @@ +export * from './api'; +export * from './cms'; diff --git a/cypress/support/types/api/shared/index.ts b/cypress/support/types/api/shared/index.ts new file mode 100644 index 00000000..af520a41 --- /dev/null +++ b/cypress/support/types/api/shared/index.ts @@ -0,0 +1,2 @@ +export * from './user'; +export * from './store'; diff --git a/cypress/support/types/api/shared/store.ts b/cypress/support/types/api/shared/store.ts new file mode 100644 index 00000000..3fc26c85 --- /dev/null +++ b/cypress/support/types/api/shared/store.ts @@ -0,0 +1,7 @@ +export interface Store { + name: string; + locale: string; + currency: string; + country: string; + timezone: string; +} diff --git a/cypress/support/types/api/shared/user.ts b/cypress/support/types/api/shared/user.ts new file mode 100644 index 00000000..63f2a4e3 --- /dev/null +++ b/cypress/support/types/api/shared/user.ts @@ -0,0 +1,5 @@ +export interface User { + username: string; + first_name: string; + last_name: string; +} diff --git a/cypress/support/types/backoffice/shared/index.ts b/cypress/support/types/backoffice/shared/index.ts index b97df43b..d3fae889 100644 --- a/cypress/support/types/backoffice/shared/index.ts +++ b/cypress/support/types/backoffice/shared/index.ts @@ -1,6 +1,8 @@ export * from './address'; export * from './customer'; export * from './product'; +export * from './product-concrete'; +export * from './product-offer'; export * from './quote'; export * from './user'; export * from './company'; @@ -8,4 +10,5 @@ export * from './company-business-unit'; export * from './company-user'; export * from './merchant'; export * from './merchant-relation-request'; +export * from './store'; export * from './url'; diff --git a/cypress/support/types/backoffice/shared/product-concrete.ts b/cypress/support/types/backoffice/shared/product-concrete.ts new file mode 100644 index 00000000..be4c4e81 --- /dev/null +++ b/cypress/support/types/backoffice/shared/product-concrete.ts @@ -0,0 +1,6 @@ +export interface ProductConcrete { + id_product_concrete: number; + sku: string; + abstract_sku: string; + name: string; +} diff --git a/cypress/support/types/backoffice/shared/product-offer.ts b/cypress/support/types/backoffice/shared/product-offer.ts new file mode 100644 index 00000000..4bd9a025 --- /dev/null +++ b/cypress/support/types/backoffice/shared/product-offer.ts @@ -0,0 +1,3 @@ +export interface ProductOffer { + product_offer_reference: string; +} diff --git a/cypress/support/types/backoffice/shared/product.ts b/cypress/support/types/backoffice/shared/product.ts index 4faafb6e..b44266b0 100644 --- a/cypress/support/types/backoffice/shared/product.ts +++ b/cypress/support/types/backoffice/shared/product.ts @@ -1,4 +1,5 @@ export interface Product { sku: string; name: string; + abstract_sku: string; } diff --git a/cypress/support/types/backoffice/shared/store.ts b/cypress/support/types/backoffice/shared/store.ts new file mode 100644 index 00000000..3fc26c85 --- /dev/null +++ b/cypress/support/types/backoffice/shared/store.ts @@ -0,0 +1,7 @@ +export interface Store { + name: string; + locale: string; + currency: string; + country: string; + timezone: string; +} diff --git a/cypress/support/types/smoke/shared/index.ts b/cypress/support/types/smoke/shared/index.ts index 14e2e584..6ae43064 100644 --- a/cypress/support/types/smoke/shared/index.ts +++ b/cypress/support/types/smoke/shared/index.ts @@ -11,3 +11,4 @@ export * from './url'; export * from './merchant'; export * from './user'; export * from './merchant-relation-request'; +export * from './store'; diff --git a/cypress/support/types/smoke/shared/product.ts b/cypress/support/types/smoke/shared/product.ts index 4faafb6e..b44266b0 100644 --- a/cypress/support/types/smoke/shared/product.ts +++ b/cypress/support/types/smoke/shared/product.ts @@ -1,4 +1,5 @@ export interface Product { sku: string; name: string; + abstract_sku: string; } diff --git a/cypress/support/types/smoke/shared/store.ts b/cypress/support/types/smoke/shared/store.ts new file mode 100644 index 00000000..3fc26c85 --- /dev/null +++ b/cypress/support/types/smoke/shared/store.ts @@ -0,0 +1,7 @@ +export interface Store { + name: string; + locale: string; + currency: string; + country: string; + timezone: string; +} diff --git a/cypress/support/types/yves/catalog.ts b/cypress/support/types/yves/catalog.ts new file mode 100644 index 00000000..e9d963e0 --- /dev/null +++ b/cypress/support/types/yves/catalog.ts @@ -0,0 +1,13 @@ +import { Customer, ProductConcrete, Store, User } from './shared'; + +export interface ProductSearchDmsStaticFixtures { + defaultPassword: string; + store: Store; + productPrice: string; +} + +export interface ProductSearchDmsDynamicFixtures { + rootUser: User; + customer: Customer; + product: ProductConcrete; +} diff --git a/cypress/support/types/yves/checkout.ts b/cypress/support/types/yves/checkout.ts index ba7a243b..955a6d78 100644 --- a/cypress/support/types/yves/checkout.ts +++ b/cypress/support/types/yves/checkout.ts @@ -1,14 +1,29 @@ -import { Address, Customer, ProductConcrete, Quote } from './shared'; +import { Address, Customer, ProductConcrete, Store, User } from './shared'; export interface BasicCheckoutDynamicFixtures { customer: Customer; address: Address; product1: ProductConcrete; product2: ProductConcrete; - quote1: Quote; - quote2: Quote; - quote3: Quote; - quote4: Quote; +} + +export interface BasicCheckoutDmsDynamicFixtures { + customer: Customer; + address: Address; + product1: ProductConcrete; + product2: ProductConcrete; + rootUser: User; +} + +export interface BasicCheckoutDmsStaticFixtures { + defaultPassword: string; + store: Store; + paymentMethods: PaymentMethod[]; +} + +interface PaymentMethod { + key: string; + name: string; } export interface CheckoutStaticFixtures { diff --git a/cypress/support/types/yves/cms.ts b/cypress/support/types/yves/cms.ts new file mode 100644 index 00000000..7eb87acb --- /dev/null +++ b/cypress/support/types/yves/cms.ts @@ -0,0 +1,12 @@ +import { Customer, Store, User } from './shared'; + +export interface CmsPageSearchDmsDynamicFixtures { + rootUser: User; + customer: Customer; +} + +export interface CmsPageSearchDmsStaticFixtures { + defaultPassword: string; + store: Store; + cmsPageName: string; +} diff --git a/cypress/support/types/yves/customer-account-management.ts b/cypress/support/types/yves/customer-account-management.ts index 37b23d5b..d11bd5a2 100644 --- a/cypress/support/types/yves/customer-account-management.ts +++ b/cypress/support/types/yves/customer-account-management.ts @@ -1,9 +1,19 @@ -import { Customer } from './shared'; +import { Customer, Store, User } from './shared'; export interface CustomerAuthDynamicFixtures { customer: Customer; } +export interface CustomerAuthDmsDynamicFixtures { + customer: Customer; + rootUser: User; +} + export interface CustomerAuthStaticFixtures { defaultPassword: string; } + +export interface CustomerAuthDmsStaticFixtures { + defaultPassword: string; + store: Store; +} diff --git a/cypress/support/types/yves/index.ts b/cypress/support/types/yves/index.ts index e031e848..d9ae99b2 100644 --- a/cypress/support/types/yves/index.ts +++ b/cypress/support/types/yves/index.ts @@ -3,8 +3,10 @@ export * from './checkout'; export * from './comments'; export * from './merchant-b2b-contract-requests'; export * from './customer-account-management'; +export * from './cms'; export * from './product-comparison'; export * from './product'; export * from './reorder'; export * from './order-amendment'; export * from './locale'; +export * from './catalog'; diff --git a/cypress/support/types/yves/locale.ts b/cypress/support/types/yves/locale.ts index 036c5199..ade691c3 100644 --- a/cypress/support/types/yves/locale.ts +++ b/cypress/support/types/yves/locale.ts @@ -1,8 +1,6 @@ -import { Locale, ProductConcrete } from './shared'; - export interface LocaleStaticFixtures { localeDE: string; localeEN: string; - availableLocales: Locale[]; - // concreteProduct: ProductConcrete; + availableLocales: string[]; + productName: string; } diff --git a/cypress/support/types/yves/product.ts b/cypress/support/types/yves/product.ts index 448c1ca0..11f4b080 100644 --- a/cypress/support/types/yves/product.ts +++ b/cypress/support/types/yves/product.ts @@ -1,4 +1,4 @@ -import { Customer, User } from './shared'; +import { Customer, Store, User } from './shared'; export interface PublishAndSynchronizeStaticFixtures { defaultPassword: string; @@ -8,3 +8,13 @@ export interface PublishAndSynchronizeDynamicFixtures { customer: Customer; rootUser: User; } + +export interface PublishAndSynchronizeDmsStaticFixtures { + defaultPassword: string; + store: Store; +} + +export interface PublishAndSynchronizeDmsDynamicFixtures { + rootUser: User; + customer: Customer; +} diff --git a/cypress/support/types/yves/shared/index.ts b/cypress/support/types/yves/shared/index.ts index 53a68c08..4bdbe917 100644 --- a/cypress/support/types/yves/shared/index.ts +++ b/cypress/support/types/yves/shared/index.ts @@ -13,4 +13,6 @@ export * from './merchant-relation-request'; export * from './discount'; export * from './product-option-value'; export * from './product-localized-attributes'; -export * from './locale'; +export * from './store'; +export * from './shipment-method'; +export * from './payment-method'; diff --git a/cypress/support/types/yves/shared/locale.ts b/cypress/support/types/yves/shared/locale.ts deleted file mode 100644 index ecbbc422..00000000 --- a/cypress/support/types/yves/shared/locale.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Locale { - localeName: string; -} diff --git a/cypress/support/types/yves/shared/payment-method.ts b/cypress/support/types/yves/shared/payment-method.ts new file mode 100644 index 00000000..18680081 --- /dev/null +++ b/cypress/support/types/yves/shared/payment-method.ts @@ -0,0 +1,4 @@ +export interface PaymentMethod { + key: string; + name: string; +} diff --git a/cypress/support/types/yves/shared/shipment-method.ts b/cypress/support/types/yves/shared/shipment-method.ts new file mode 100644 index 00000000..384fb4b9 --- /dev/null +++ b/cypress/support/types/yves/shared/shipment-method.ts @@ -0,0 +1,4 @@ +export interface ShipmentMethod { + key: string; + name: string; +} diff --git a/cypress/support/types/yves/shared/store.ts b/cypress/support/types/yves/shared/store.ts new file mode 100644 index 00000000..3fc26c85 --- /dev/null +++ b/cypress/support/types/yves/shared/store.ts @@ -0,0 +1,7 @@ +export interface Store { + name: string; + locale: string; + currency: string; + country: string; + timezone: string; +} diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index af9179a6..afa52f4d 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -18,6 +18,11 @@ import { SuiteLoginRepository } from '../../pages/yves/login/repositories/suite- import { B2bMultiCartRepository } from '../../pages/yves/multi-cart/repositories/b2b-multi-cart-repository'; import { SuiteMultiCartRepository } from '../../pages/yves/multi-cart/repositories/suite-multi-cart-repository'; import { SuiteCatalogRepository } from '../../pages/yves/catalog/repositories/suite-catalog-repository'; +import { SuiteContentRepository } from '../../pages/yves/content/repositories/suite-content-repository'; +import { B2cContentRepository } from '../../pages/yves/content/repositories/b2c-content-repository'; +import { B2bContentRepository } from '../../pages/yves/content/repositories/b2b-content-repository'; +import { B2cMpContentRepository } from '../../pages/yves/content/repositories/b2c-mp-content-repository'; +import { B2bMpContentRepository } from '../../pages/yves/content/repositories/b2b-mp-content-repository'; import { SuiteCompanyUserSelectRepository } from '../../pages/yves/company/user/select/repositories/suite-company-user-select-repository'; import { SuiteMerchantRelationRequestCreateRepository } from '../../pages/yves/company/merchant-relation-request/create/repositories/suite-merchant-relation-request-create-repository'; import { SuiteMerchantRelationRequestDetailsRepository } from '../../pages/yves/company/merchant-relation-request/details/repositories/suite-merchant-relation-request-details-repository'; @@ -103,10 +108,22 @@ import { B2cOrderDetailsRepository } from '../../pages/yves/customer/order/repos import { B2bOrderDetailsRepository } from '../../pages/yves/customer/order/repositories/b2b-order-details-repository'; import { B2cMpOrderDetailsRepository } from '../../pages/yves/customer/order/repositories/b2c-mp-order-details-repository'; import { B2bMpOrderDetailsRepository } from '../../pages/yves/customer/order/repositories/b2b-mp-order-details-repository'; +import { SuiteHomeRepository } from '../../pages/yves/home/repositories/suite-home-repository'; +import { B2cHomeRepository } from '../../pages/yves/home/repositories/b2c-home-repository'; +import { B2bHomeRepository } from '../../pages/yves/home/repositories/b2b-home-repository'; +import { B2cMpHomeRepository } from '../../pages/yves/home/repositories/b2c-mp-home-repository'; +import { B2bMpHomeRepository } from '../../pages/yves/home/repositories/b2b-mp-home-repository'; +import { B2cYvesRepository } from '../../pages/yves/repositories/b2c-yves-repository'; +import { B2bYvesRepository } from '../../pages/yves/repositories/b2b-yves-repository'; +import { B2cMpYvesRepository } from '../../pages/yves/repositories/b2c-mp-yves-repository'; +import { B2bMpYvesRepository } from '../../pages/yves/repositories/b2b-mp-yves-repository'; +import { SuiteYvesRepository } from '../../pages/yves/repositories/suite-yves-repository'; type BindingsMap = { [K in REPOSITORIES]?: interfaces.Newable }; const suiteMappings: BindingsMap = { + [REPOSITORIES.YvesRepository]: SuiteYvesRepository, + [REPOSITORIES.HomeRepository]: SuiteHomeRepository, [REPOSITORIES.LoginRepository]: SuiteLoginRepository, [REPOSITORIES.CartRepository]: SuiteCartRepository, [REPOSITORIES.MultiCartRepository]: SuiteMultiCartRepository, @@ -125,11 +142,14 @@ const suiteMappings: BindingsMap = { [REPOSITORIES.MerchantRelationRequestIndexRepository]: SuiteMerchantRelationRequestIndexRepository, [REPOSITORIES.MerchantRepository]: SuiteMerchantRepository, [REPOSITORIES.CustomerOverviewRepository]: SuiteCustomerOverviewRepository, + [REPOSITORIES.ContentRepository]: SuiteContentRepository, [REPOSITORIES.OrderDetailsRepository]: SuiteOrderDetailsRepository, [REPOSITORIES.ProductComparisonRepository]: SuiteProductComparisonRepository, }; const b2cMappings: BindingsMap = { + [REPOSITORIES.YvesRepository]: B2cYvesRepository, + [REPOSITORIES.HomeRepository]: B2cHomeRepository, [REPOSITORIES.LoginRepository]: B2cLoginRepository, [REPOSITORIES.CartRepository]: B2cCartRepository, [REPOSITORIES.MultiCartRepository]: B2cMultiCartRepository, @@ -149,10 +169,13 @@ const b2cMappings: BindingsMap = { [REPOSITORIES.MerchantRepository]: B2cMerchantRepository, [REPOSITORIES.CustomerOverviewRepository]: B2cCustomerOverviewRepository, [REPOSITORIES.OrderDetailsRepository]: B2cOrderDetailsRepository, + [REPOSITORIES.ContentRepository]: B2cContentRepository, [REPOSITORIES.ProductComparisonRepository]: B2cProductComparisonRepository, }; const b2bMappings: BindingsMap = { + [REPOSITORIES.YvesRepository]: B2bYvesRepository, + [REPOSITORIES.HomeRepository]: B2bHomeRepository, [REPOSITORIES.LoginRepository]: B2bLoginRepository, [REPOSITORIES.CartRepository]: B2bCartRepository, [REPOSITORIES.MultiCartRepository]: B2bMultiCartRepository, @@ -172,10 +195,13 @@ const b2bMappings: BindingsMap = { [REPOSITORIES.MerchantRepository]: B2bMerchantRepository, [REPOSITORIES.CustomerOverviewRepository]: B2bCustomerOverviewRepository, [REPOSITORIES.OrderDetailsRepository]: B2bOrderDetailsRepository, + [REPOSITORIES.ContentRepository]: B2bContentRepository, [REPOSITORIES.ProductComparisonRepository]: B2bProductComparisonRepository, }; const b2cMpMappings: BindingsMap = { + [REPOSITORIES.YvesRepository]: B2cMpYvesRepository, + [REPOSITORIES.HomeRepository]: B2cMpHomeRepository, [REPOSITORIES.LoginRepository]: B2cMpLoginRepository, [REPOSITORIES.CartRepository]: B2cMpCartRepository, [REPOSITORIES.MultiCartRepository]: B2cMpMultiCartRepository, @@ -195,10 +221,13 @@ const b2cMpMappings: BindingsMap = { [REPOSITORIES.MerchantRepository]: B2cMpMerchantRepository, [REPOSITORIES.CustomerOverviewRepository]: B2cMpCustomerOverviewRepository, [REPOSITORIES.OrderDetailsRepository]: B2cMpOrderDetailsRepository, + [REPOSITORIES.ContentRepository]: B2cMpContentRepository, [REPOSITORIES.ProductComparisonRepository]: B2cMpProductComparisonRepository, }; const b2bMpMappings: BindingsMap = { + [REPOSITORIES.YvesRepository]: B2bMpYvesRepository, + [REPOSITORIES.HomeRepository]: B2bMpHomeRepository, [REPOSITORIES.LoginRepository]: B2bMpLoginRepository, [REPOSITORIES.CartRepository]: B2bMpCartRepository, [REPOSITORIES.MultiCartRepository]: B2bMpMultiCartRepository, @@ -218,6 +247,7 @@ const b2bMpMappings: BindingsMap = { [REPOSITORIES.MerchantRepository]: B2bMpMerchantRepository, [REPOSITORIES.CustomerOverviewRepository]: B2bMpCustomerOverviewRepository, [REPOSITORIES.OrderDetailsRepository]: B2bMpOrderDetailsRepository, + [REPOSITORIES.ContentRepository]: B2bMpContentRepository, [REPOSITORIES.ProductComparisonRepository]: B2bMpProductComparisonRepository, }; diff --git a/cypress/support/utils/inversify/types.ts b/cypress/support/utils/inversify/types.ts index 9d8474c6..0eb6ffac 100644 --- a/cypress/support/utils/inversify/types.ts +++ b/cypress/support/utils/inversify/types.ts @@ -1,4 +1,6 @@ export const enum REPOSITORIES { + YvesRepository = 'YvesRepository', + HomeRepository = 'HomeRepository', LoginRepository = 'LoginRepository', CartRepository = 'CartRepository', CommentCartRepository = 'CommentCartRepository', @@ -17,6 +19,7 @@ export const enum REPOSITORIES { MerchantRelationRequestIndexRepository = 'MerchantRelationRequestIndexRepository', MerchantRepository = 'MerchantRepository', CustomerOverviewRepository = 'CustomerOverviewRepository', + ContentRepository = 'ContentRepository', ProductComparisonRepository = 'ProductComparisonRepository', OrderDetailsRepository = 'OrderDetailsRepository', } diff --git a/package-lock.json b/package-lock.json index 7c8b571d..00d99b5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "eslint": "^8.57.0", "eslint-plugin-cypress": "^2.15.2", "inversify": "^6.0.2", - "prettier": "^3.3.2", + "prettier": "^3.4.1", "reflect-metadata": "^0.2.2", "typescript": "~5.3.3" }, @@ -3556,10 +3556,11 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", + "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index 8a4641fd..f31e74aa 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "cy:run": "cypress run --spec \"cypress/e2e/!(smoke)/**/*.ts\"", "cy:ci": "cypress run --spec \"cypress/e2e/!(smoke)/**/*.ts\" --headless --browser chrome", "cy:smoke": "cypress run --spec \"cypress/e2e/smoke/**/*.ts\" --headless --browser chrome", - "cy:smoke:outdated": "cypress run --spec \"cypress/e2e/smoke/!(checkout|order-management|product)/*.ts\" --headless --browser chrome" + "cy:dms": "cypress run --spec \"cypress/e2e/!(smoke)/**/*dms.cy.ts\" --headless --browser chrome" }, "engines": { "node": ">=18.0.0", @@ -34,7 +34,7 @@ "eslint": "^8.57.0", "eslint-plugin-cypress": "^2.15.2", "inversify": "^6.0.2", - "prettier": "^3.3.2", + "prettier": "^3.4.1", "reflect-metadata": "^0.2.2", "typescript": "~5.3.3" }