diff --git a/cypress.config.ts b/cypress.config.ts index 2237f836d..4af66289b 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,6 +1,6 @@ import { defineConfig } from 'cypress'; import dotenv from 'dotenv'; -import { existsSync, mkdirSync, writeFileSync } from 'fs'; +import { existsSync, mkdirSync, rmSync, writeFileSync } from 'fs'; dotenv.config(); @@ -18,6 +18,7 @@ const glueBackendHost = getEnvVar('ENV_GLUE_BACKEND_HOST', 'SPRYKER_GLUE_BACKEND const glueStorefrontHost = getEnvVar('ENV_GLUE_STOREFRONT_HOST', 'SPRYKER_GLUE_STOREFRONT_HOST'); const mailCatcherHost = getEnvVar('ENV_MAIL_CATCHER_HOST', 'SPRYKER_SMTP_HOST'); const baseHost = getEnvVar('E2E_BASE_HOST', 'SPRYKER_FE_HOST'); +const PROBE_TIMEOUT_MS = 10000; export default defineConfig({ env: { @@ -44,6 +45,27 @@ export default defineConfig({ isFileExists(filename: string): boolean { return existsSync(filename); }, + deleteFile(filename: string): null { + if (existsSync(filename)) { + rmSync(filename); + } + + return null; + }, + async probeUrl(url: string): Promise { + try { + const response = await fetch(url, { redirect: 'manual', signal: AbortSignal.timeout(PROBE_TIMEOUT_MS) }); + + return response.status; + } catch { + return null; + } + }, + log(message: string): null { + console.log(message); + + return null; + }, }); if (!config.env.grepTags) { config.env.grepFilterSpecs = false; diff --git a/cypress/e2e/backoffice/acl/acl-navigation-access.cy.ts b/cypress/e2e/backoffice/acl/acl-navigation-access.cy.ts index 229cbf687..3d643a877 100644 --- a/cypress/e2e/backoffice/acl/acl-navigation-access.cy.ts +++ b/cypress/e2e/backoffice/acl/acl-navigation-access.cy.ts @@ -1,6 +1,7 @@ import { container } from '@utils'; import { AclNavigationAccessDynamicFixtures } from '@interfaces/backoffice'; -import { AclNavigationAccessScenario } from '@scenarios/backoffice'; +import { AclDeniedPage, LoginPage } from '@pages/backoffice'; +import { AclNavigationAccessScenario, UserLoginScenario } from '@scenarios/backoffice'; describe( 'ACL navigation access', @@ -12,6 +13,9 @@ describe( } const aclNavigationAccessScenario = container.get(AclNavigationAccessScenario); + const userLoginScenario = container.get(UserLoginScenario); + const aclDeniedPage = container.get(AclDeniedPage); + const loginPage = container.get(LoginPage); const password = 'Change123@_!'; it('single-role user with product-management permissions', (): void => { @@ -37,5 +41,32 @@ describe( deniedPaths: ['/sales/detail', '/cms-gui/list-page/index', '/user', '/product-management'], }); }); + + it('should deny an action for a role with an explicit deny rule', (): void => { + // Arrange + const { dynamicFixtures } = Cypress.env() as { dynamicFixtures: AclNavigationAccessDynamicFixtures }; + + // The user's other role allows every bundle, so only the deny rule can stop this request — + // which is what makes it a test of deny precedence rather than of a missing allow. + userLoginScenario.execute({ username: dynamicFixtures.deniedActionUser.username, password: password }); + + // Act + cy.visitBackoffice('/product-attribute-gui/attribute/create'); + + // Assert + aclDeniedPage.getAccessDeniedTitle().should('have.text', 'Access denied'); + }); + + it('should refuse login for a deactivated user', (): void => { + // Arrange + const { dynamicFixtures } = Cypress.env() as { dynamicFixtures: AclNavigationAccessDynamicFixtures }; + loginPage.visit(); + + // Act + loginPage.login({ username: dynamicFixtures.blockedUser.username, password: password }); + + // Assert + loginPage.getErrorMessage().should('contain.text', 'Authentication failed!'); + }); } ); diff --git a/cypress/e2e/backoffice/administration/glossary-management.cy.ts b/cypress/e2e/backoffice/administration/glossary-management.cy.ts new file mode 100644 index 000000000..0d922b590 --- /dev/null +++ b/cypress/e2e/backoffice/administration/glossary-management.cy.ts @@ -0,0 +1,72 @@ +import { container } from '@utils'; +import { GlossaryManagementDynamicFixtures, GlossaryManagementStaticFixtures } from '@interfaces/backoffice'; +import { GlossaryFormPage, GlossaryListPage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'glossary management', + { tags: ['@backoffice', 'glossary', 'spryker-core-back-office', 'spryker-core'] }, + (): void => { + const glossaryListPage = container.get(GlossaryListPage); + const glossaryFormPage = container.get(GlossaryFormPage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: GlossaryManagementStaticFixtures; + let dynamicFixtures: GlossaryManagementDynamicFixtures; + + // A key of its own for the update, so the test never edits a translation the storefront renders. + let existingGlossaryKey: string; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + + existingGlossaryKey = `${staticFixtures.glossaryKeyPrefix}.existing.${Date.now()}`; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + glossaryListPage.visit(); + glossaryListPage.clickCreateTranslation(); + glossaryFormPage.create({ glossaryKey: existingGlossaryKey, translation: staticFixtures.translation }); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a new glossary key when a translation is created for it then the glossary lists the key', (): void => { + // Arrange + // Drawn per attempt, so a retry does not collide with the key its previous attempt created. + const glossaryKey = `${staticFixtures.glossaryKeyPrefix}.${Date.now()}`; + glossaryListPage.visit(); + + // Act + glossaryListPage.clickCreateTranslation(); + glossaryFormPage.create({ glossaryKey: glossaryKey, translation: staticFixtures.translation }); + + // Assert + glossaryListPage.visit(); + glossaryListPage.findTranslation(glossaryKey).should('contain.text', glossaryKey); + }); + + it('given an existing glossary key when its translation is updated then every locale shows the new translation', (): void => { + // Arrange + glossaryListPage.visit(); + glossaryListPage.edit(existingGlossaryKey); + + // Act + glossaryFormPage.update(staticFixtures.updatedTranslation); + + // Assert + glossaryListPage.visit(); + glossaryListPage.edit(existingGlossaryKey); + glossaryFormPage.getLocaleTextareas().each(($textarea) => { + cy.wrap($textarea).should('have.value', staticFixtures.updatedTranslation); + }); + }); + } +); diff --git a/cypress/e2e/backoffice/company-account/company-structure-creation.cy.ts b/cypress/e2e/backoffice/company-account/company-structure-creation.cy.ts new file mode 100644 index 000000000..1ab2237d4 --- /dev/null +++ b/cypress/e2e/backoffice/company-account/company-structure-creation.cy.ts @@ -0,0 +1,133 @@ +import { container } from '@utils'; +import { + CompanyStructureCreationDynamicFixtures, + CompanyStructureCreationStaticFixtures, +} from '@interfaces/backoffice'; +import { + ActionEnum, + CompanyBusinessUnitCreatePage, + CompanyCreatePage, + CompanyListPage, + CompanyRoleCreatePage, + CompanyUserCreatePage, + CompanyUserListPage, +} from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { ImpersonateCustomerScenario } from '@scenarios/yves'; + +describe( + 'company structure creation', + { + tags: [ + '@backoffice', + '@company-account', + 'company-account', + 'spryker-core-back-office', + 'spryker-core', + 'agent-assist', + 'acl', + ], + }, + (): void => { + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because company accounts exist only in suite, b2b and b2b-mp', () => {}); + return; + } + + const userLoginScenario = container.get(UserLoginScenario); + const impersonateCustomerScenario = container.get(ImpersonateCustomerScenario); + const companyCreatePage = container.get(CompanyCreatePage); + const companyListPage = container.get(CompanyListPage); + const companyBusinessUnitCreatePage = container.get(CompanyBusinessUnitCreatePage); + const companyRoleCreatePage = container.get(CompanyRoleCreatePage); + const companyUserCreatePage = container.get(CompanyUserCreatePage); + const companyUserListPage = container.get(CompanyUserListPage); + + let staticFixtures: CompanyStructureCreationStaticFixtures; + let dynamicFixtures: CompanyStructureCreationDynamicFixtures; + + let companyName: string; + let businessUnitName: string; + let roleName: string; + let companyUserEmail: string; + let companyUserLastName: string; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + + const unique = Date.now(); + companyName = `Company${unique}`; + businessUnitName = `BusinessUnit${unique}`; + roleName = `Role${unique}`; + companyUserEmail = `company.user.${unique}@spryker.local`; + companyUserLastName = `User${unique}`; + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a back office user when a company, its business unit, its role and a company user are created then the company user list shows the user under its company', (): void => { + // Act + companyCreatePage.visit(); + companyCreatePage.create(companyName); + + // A company is created inactive and pending, and only an active approved one can carry users. + companyListPage.visit(); + companyListPage.update({ query: companyName, action: ActionEnum.activate }); + companyListPage.visit(); + companyListPage.update({ query: companyName, action: ActionEnum.approve }); + + companyBusinessUnitCreatePage.visit(); + companyBusinessUnitCreatePage.create({ companyName: companyName, name: businessUnitName }); + + companyRoleCreatePage.visit(); + companyRoleCreatePage.create({ + companyName: companyName, + name: roleName, + permissionNames: staticFixtures.companyUserRolePermissionNames, + }); + + companyUserCreatePage.visit(); + companyUserCreatePage.create({ + companyName: companyName, + businessUnitName: businessUnitName, + roleName: roleName, + email: companyUserEmail, + salutation: 'Ms', + firstName: 'Company', + lastName: companyUserLastName, + gender: 'Female', + }); + + // Assert + companyUserListPage.visit(); + companyUserListPage.findByCompanyName(companyName).should('contain.text', companyUserLastName); + }); + + it('given the company user created above when an agent impersonates it on the storefront then it reaches the pages its role allows and no others', (): void => { + // Arrange + // Nothing knows the new company user's password, so the agent switches into their session. + impersonateCustomerScenario.execute({ + agentUsername: dynamicFixtures.agentUser.username, + agentPassword: staticFixtures.defaultPassword, + customerEmail: companyUserEmail, + }); + + // Act + cy.visit(staticFixtures.companyUserPagePath, { failOnStatusCode: false }); + + // Assert + cy.url().should('include', staticFixtures.companyUserPagePath); + + // Act + cy.visit(staticFixtures.companyRolePagePath, { failOnStatusCode: false }); + + // Assert + cy.url().should('include', '403'); + }); + } +); diff --git a/cypress/e2e/backoffice/configuration/configuration-management.cy.ts b/cypress/e2e/backoffice/configuration/configuration-management.cy.ts index 6236679c5..06eeeb5ef 100644 --- a/cypress/e2e/backoffice/configuration/configuration-management.cy.ts +++ b/cypress/e2e/backoffice/configuration/configuration-management.cy.ts @@ -1,4 +1,4 @@ -import { container } from '@utils'; +import { container, skipWhenFeatureAbsent } from '@utils'; import { UserLoginScenario } from '@scenarios/backoffice'; import { ConfigurationPage } from '@pages/backoffice'; import { ConfigurationManagementDynamicFixtures, ConfigurationManagementStaticFixtures } from '@interfaces/backoffice'; @@ -9,6 +9,15 @@ describe( tags: ['@backoffice', '@configuration', 'configuration', 'spryker-core-back-office'], }, (): void => { + // The B2C shops do not install the configuration module. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C shops have no configuration management', () => {}); + + return; + } + + skipWhenFeatureAbsent('configuration', ['b2b']); + const configurationPage = container.get(ConfigurationPage); const userLoginScenario = container.get(UserLoginScenario); diff --git a/cypress/e2e/backoffice/configuration/configuration.cy.ts b/cypress/e2e/backoffice/configuration/configuration.cy.ts index 2b5939b1f..87965a68b 100644 --- a/cypress/e2e/backoffice/configuration/configuration.cy.ts +++ b/cypress/e2e/backoffice/configuration/configuration.cy.ts @@ -1,4 +1,4 @@ -import { container } from '@utils'; +import { container, skipWhenFeatureAbsent } from '@utils'; import { UserLoginScenario } from '@scenarios/backoffice'; import { ConfigurationPage } from '@pages/backoffice'; import { HomePage } from '@pages/yves'; @@ -10,6 +10,15 @@ describe( tags: ['@backoffice', '@configuration', 'shop-theme', 'spryker-core-back-office'], }, (): void => { + // The B2C shops do not install the configuration module. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C shops have no configuration management', () => {}); + + return; + } + + skipWhenFeatureAbsent('configuration', ['b2b']); + const merchantIt = (description: string, testFn: () => void): void => { (['suite', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? it : it.skip)(description, testFn); }; diff --git a/cypress/e2e/backoffice/core/dynamic-store-creation.cy.ts b/cypress/e2e/backoffice/core/dynamic-store-creation.cy.ts new file mode 100644 index 000000000..5fcc285dd --- /dev/null +++ b/cypress/e2e/backoffice/core/dynamic-store-creation.cy.ts @@ -0,0 +1,196 @@ +import { container } from '@utils'; +import { StoreCreatePage, StoreEditPage, StoreListPage } from '@pages/backoffice'; +import { CatalogPage, CmsContentPage, HomePage, LoginPage, ProductPage } from '@pages/yves'; +import { DynamicStoreCreationDynamicFixtures, DynamicStoreCreationStaticFixtures } from '@interfaces/backoffice'; +import { + AssignStoreToDefaultWarehouseScenario, + AssignStoreToProductScenario, + CreateCmsPageScenario, + CreateStoreScenario, + EnableCmsBlockForAllStoresScenario, + UserLoginScenario, +} from '@scenarios/backoffice'; +import { SelectStoreScenario } from '@scenarios/yves'; + +// Store names take capital letters and single underscores only, so the per-run suffix is drawn from +// the alphabet rather than from a counter. +const STORE_NAME_SUFFIX_LENGTH = 6; + +// The visibility checkbox is added by a store form expander the demoshops do not wire yet. +const VISIBLE_TO_CUSTOMER_REPOSITORY_IDS = ['suite']; + +// The B2B storefronts render their registration form only for a company user invitation, so a guest +// has no way to register there. +const NO_GUEST_REGISTRATION_REPOSITORY_IDS = ['b2b', 'b2b-mp']; + +describe( + 'dynamic store creation', + { + tags: [ + '@backoffice', + '@core', + '@dms', + 'spryker-core-back-office', + 'spryker-core', + 'customer-account-management', + 'cms', + 'content-item', + 'catalog', + 'search', + 'product', + 'prices', + ], + }, + (): void => { + if (!Cypress.env('isDynamicStoreEnabled')) { + it.skip('skipped due to disabled dynamic store feature', () => {}); + + return; + } + + const storeListPage = container.get(StoreListPage); + const storeCreatePage = container.get(StoreCreatePage); + const storeEditPage = container.get(StoreEditPage); + const homePage = container.get(HomePage); + const loginPage = container.get(LoginPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cmsContentPage = container.get(CmsContentPage); + const userLoginScenario = container.get(UserLoginScenario); + const createStoreScenario = container.get(CreateStoreScenario); + const selectStoreScenario = container.get(SelectStoreScenario); + const createCmsPageScenario = container.get(CreateCmsPageScenario); + const assignStoreToProductScenario = container.get(AssignStoreToProductScenario); + const enableCmsBlockForAllStoresScenario = container.get(EnableCmsBlockForAllStoresScenario); + const assignStoreToDefaultWarehouseScenario = container.get(AssignStoreToDefaultWarehouseScenario); + + let staticFixtures: DynamicStoreCreationStaticFixtures; + let dynamicFixtures: DynamicStoreCreationDynamicFixtures; + + let cmsPageName: string; + + // The storefront tests below share one store and its relations, which a scenario sets up once and + // reuses on a re-run; creating a store is itself under test in the first test, on a store of its own. + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + // The page name goes verbatim into every localized url and the server rejects a duplicate, + // so it has to be unique per run. + cmsPageName = `${staticFixtures.cmsPageName}-${Math.random().toString(36).substring(2, 8)}`; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true }); + + // A store with no warehouse sells nothing, so the product would read as unavailable there + // however well it is priced. + assignStoreToDefaultWarehouseScenario.execute({ + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + }); + + assignStoreToProductScenario.execute({ + abstractProductSku: dynamicFixtures.product.abstract_sku, + storeName: staticFixtures.store.name, + bulkProductPrice: staticFixtures.productPrice, + shouldTriggerPublishAndSync: true, + }); + + createCmsPageScenario.execute({ cmsPageName: cmsPageName, shouldTriggerPublishAndSync: true }); + + // Registration renders the double-opt-in blocks, and a store they are not enabled for + // fails the submit rather than the mail. + staticFixtures.registrationCmsBlockNames.forEach((cmsBlockName: string): void => { + enableCmsBlockForAllStoresScenario.execute({ + cmsBlockName: cmsBlockName, + storeName: staticFixtures.store.name, + shouldTriggerPublishAndSync: true, + }); + }); + }); + + it('given a back office user when a store is created with a default locale and a default currency then the saved store keeps both selected and is visible to customers', (): void => { + // Arrange + // A name drawn per attempt makes the create form the only way the store can exist. + const storeName = `${staticFixtures.store.name}_${Cypress._.times(STORE_NAME_SUFFIX_LENGTH, () => + String.fromCharCode(Cypress._.random(65, 90)) + ).join('')}`; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + storeListPage.visit(); + storeListPage.createStore(); + + // Act + storeCreatePage.create({ ...staticFixtures.store, name: storeName }); + + // Assert + storeListPage.hasStore(storeName).should('equal', true); + storeListPage.editListedStore(storeName); + storeEditPage.getDefaultLocaleSelect().should('have.value', staticFixtures.store.locale); + storeEditPage.getDefaultCurrencySelect().should('have.value', staticFixtures.store.currency); + + if (storeEditPage.isRepository(...VISIBLE_TO_CUSTOMER_REPOSITORY_IDS)) { + storeEditPage.getVisibleToCustomerCheckbox().should('be.checked'); + } + }); + + it('given a store is created in the back office when a shopper opens the storefront then the store switcher offers it', (): void => { + // Act + homePage.visit(); + homePage.waitTillStoreAvailable(staticFixtures.store.name); + + // Assert + homePage.getStoreSelectorOption(staticFixtures.store.name).should('exist'); + }); + + it('given a product is assigned to a newly created store when a shopper opens its detail page on that store then the product is offered there', (): void => { + // Arrange + selectStoreScenario.execute(staticFixtures.store.name); + + // Act + catalogPage.searchForProducts({ query: dynamicFixtures.product.abstract_sku }); + catalogPage.openProductDetailPageFromResults({ + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + + // Assert + productPage.getProductConfigurator().should('contain', dynamicFixtures.product.sku); + + if (!productPage.isRepository('b2b', 'b2b-mp')) { + productPage.getProductConfigurator().should('contain', staticFixtures.productPrice); + } + }); + + it('given a cms page is published when a shopper opens it on a newly created store then the page is served', (): void => { + // Arrange + selectStoreScenario.execute(staticFixtures.store.name); + + // Act + cmsContentPage.visitCmsPageOnCurrentStore({ cmsPageName, localeName: staticFixtures.store.locale }); + + // Assert + cmsContentPage.assertBodyContainsText(cmsPageName).should('exist'); + }); + + (NO_GUEST_REGISTRATION_REPOSITORY_IDS.includes(Cypress.env('repositoryId')) ? it.skip : it)( + 'given the registration content blocks are enabled for a newly created store when a guest registers there then the registration completes', + (): void => { + // Arrange + selectStoreScenario.execute(staticFixtures.store.name); + + // Act + loginPage.visit(); + loginPage.register(); + + // Assert + loginPage.assertBodyContainsText(loginPage.getRegistrationCompletedMessage()).should('exist'); + } + ); + } +); diff --git a/cypress/e2e/backoffice/data-exchange/api-specification-download.cy.ts b/cypress/e2e/backoffice/data-exchange/api-specification-download.cy.ts new file mode 100644 index 000000000..6647cb7ed --- /dev/null +++ b/cypress/e2e/backoffice/data-exchange/api-specification-download.cy.ts @@ -0,0 +1,85 @@ +import { container } from '@utils'; +import { + ApiSpecificationDownloadDynamicFixtures, + ApiSpecificationDownloadStaticFixtures, +} from '@interfaces/backoffice'; +import { DataExchangePage, FieldDefinition } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +// spy_mime_type is a core table with no configuration in demo data, so exposing it is observable +// as a resource the specification gained. +const TABLE_NAME = 'spy_mime_type'; + +const RESOURCE_PATH_PREFIX = '/dynamic-entity/'; + +// A resource demo data already exposes, so the very first download proves the file is the real +// specification and not an empty placeholder. +const ALREADY_EXPOSED_RESOURCE_PATH = '/dynamic-entity/product-abstracts'; + +const FIELD_DEFINITIONS: Array = [ + { name: 'id_mime_type', type: 'integer', isCreatable: true, isEditable: false, isRequired: false }, + { name: 'comment', type: 'string', isCreatable: true, isEditable: true, isRequired: false }, + { name: 'extensions', type: 'string', isCreatable: true, isEditable: true, isRequired: false }, + { name: 'is_allowed', type: 'boolean', isCreatable: true, isEditable: true, isRequired: true }, + { name: 'name', type: 'string', isCreatable: true, isEditable: true, isRequired: true }, +]; + +describe( + 'data exchange api specification download', + { tags: ['@backoffice', 'data-exchange-api', 'spryker-core-back-office', 'spryker-core'] }, + (): void => { + const dataExchangePage = container.get(DataExchangePage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: ApiSpecificationDownloadStaticFixtures; + let dynamicFixtures: ApiSpecificationDownloadDynamicFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // The browser saves a second download of the same name beside the first, so the file a retry + // would read has to be gone before this attempt downloads its own. + dataExchangePage.discardDownloadedApiSpecification(); + }); + + it('given a table exposed under a resource name the specification does not know when its data exchange api configuration is enabled and the specification is regenerated then the downloaded specification gains the resource', (): void => { + // Arrange + // The resource name is drawn per attempt, so it is absent from every specification generated + // before it and nothing an earlier run enabled has to be taken back first. + const resourceName = `mime-types-${Cypress._.random(100000, 999999)}`; + const resourcePath = `${RESOURCE_PATH_PREFIX}${resourceName}`; + + dataExchangePage.waitForApiSpecificationToBeCurrent(); + dataExchangePage.getDownloadSpecificationButton().should('not.have.class', 'disabled'); + dataExchangePage.downloadApiSpecification(); + dataExchangePage + .getDownloadedApiSpecification() + .should('contain', ALREADY_EXPOSED_RESOURCE_PATH) + .and('not.contain', resourcePath); + dataExchangePage.discardDownloadedApiSpecification(); + + // Act + dataExchangePage.openConfiguration(TABLE_NAME); + dataExchangePage.setResourceName(resourceName); + dataExchangePage.setConfigurationEnabled(true); + FIELD_DEFINITIONS.forEach((field: FieldDefinition): void => dataExchangePage.configureField(field)); + dataExchangePage.saveConfiguration(); + + // Assert + dataExchangePage.getErrorMessage().should('not.exist'); + dataExchangePage.visit(); + dataExchangePage.getDownloadSpecificationButton().should('have.class', 'disabled'); + + dataExchangePage.waitForApiSpecificationToBeCurrent(); + dataExchangePage.downloadApiSpecification(); + dataExchangePage.getDownloadedApiSpecification().should('contain', resourcePath); + }); + } +); diff --git a/cypress/e2e/backoffice/data-exchange/dynamic-entity-configuration.cy.ts b/cypress/e2e/backoffice/data-exchange/dynamic-entity-configuration.cy.ts new file mode 100644 index 000000000..20b554908 --- /dev/null +++ b/cypress/e2e/backoffice/data-exchange/dynamic-entity-configuration.cy.ts @@ -0,0 +1,85 @@ +import { container } from '@utils'; +import { + DynamicEntityConfigurationDynamicFixtures, + DynamicEntityConfigurationStaticFixtures, +} from '@interfaces/backoffice'; +import { DataExchangePage, FieldDefinition } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +// spy_mime_type carries one column of every type the form offers a choice for, so configuring it +// exercises the integer, string and boolean branches of the field-definition table in one pass. +const TABLE_NAME = 'spy_mime_type'; + +const FIELD_DEFINITIONS: Array = [ + { name: 'id_mime_type', type: 'integer', isCreatable: true, isEditable: false, isRequired: false }, + { name: 'comment', type: 'string', isCreatable: true, isEditable: true, isRequired: false }, + { name: 'extensions', type: 'string', isCreatable: true, isEditable: true, isRequired: false }, + { name: 'is_allowed', type: 'boolean', isCreatable: true, isEditable: true, isRequired: true }, + { name: 'name', type: 'string', isCreatable: true, isEditable: true, isRequired: true }, +]; + +describe( + 'data exchange api configuration', + { tags: ['@backoffice', 'data-exchange-api', 'spryker-core-back-office', 'spryker-core'] }, + (): void => { + const dataExchangePage = container.get(DataExchangePage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: DynamicEntityConfigurationStaticFixtures; + let dynamicFixtures: DynamicEntityConfigurationDynamicFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a data exchange api configuration for a table when its resource name and fields are configured and saved then the reloaded form renders back what was saved', (): void => { + // Arrange + // The resource name and the visible names are drawn per attempt, which makes them the witness + // that this run wrote the definition: every other value in the form is one an earlier run could + // have left behind, so the configuration is never reset and nothing is cleaned up afterwards. + const runMarker = `${Cypress._.random(100000, 999999)}`; + const resourceName = `mime-types-${runMarker}`; + const fieldDefinitions = FIELD_DEFINITIONS.map( + (field: FieldDefinition): FieldDefinition => ({ ...field, visibleName: `${field.name}_${runMarker}` }) + ); + + dataExchangePage.openConfiguration(TABLE_NAME); + + // Act + dataExchangePage.setResourceName(resourceName); + dataExchangePage.setConfigurationEnabled(true); + fieldDefinitions.forEach((field: FieldDefinition): void => dataExchangePage.configureField(field)); + dataExchangePage.saveConfiguration(); + + // Assert + dataExchangePage.getConfigurationSavedMessage().should('be.visible'); + dataExchangePage.getErrorMessage().should('not.exist'); + + dataExchangePage.openConfiguration(TABLE_NAME); + dataExchangePage.getResourceNameInput().should('have.value', resourceName); + dataExchangePage.getIsEnabledCheckbox().should('be.checked'); + + fieldDefinitions.forEach((field: FieldDefinition): void => { + dataExchangePage.getFieldControl(field.name, 'enabled').should('be.checked'); + dataExchangePage.getFieldControl(field.name, 'visibleName').should('have.value', field.visibleName); + dataExchangePage.getFieldControl(field.name, 'type').should('have.value', field.type); + dataExchangePage + .getFieldControl(field.name, 'creatable') + .should(field.isCreatable ? 'be.checked' : 'not.be.checked'); + dataExchangePage + .getFieldControl(field.name, 'editable') + .should(field.isEditable ? 'be.checked' : 'not.be.checked'); + dataExchangePage + .getFieldControl(field.name, 'required') + .should(field.isRequired ? 'be.checked' : 'not.be.checked'); + }); + }); + } +); diff --git a/cypress/e2e/backoffice/merchandising/product-set-management.cy.ts b/cypress/e2e/backoffice/merchandising/product-set-management.cy.ts new file mode 100644 index 000000000..26d38e6e2 --- /dev/null +++ b/cypress/e2e/backoffice/merchandising/product-set-management.cy.ts @@ -0,0 +1,91 @@ +import { container } from '@utils'; +import { ProductSetManagementDynamicFixtures, ProductSetManagementStaticFixtures } from '@interfaces/backoffice'; +import { ProductSetCreatePage, ProductSetListPage } from '@pages/backoffice'; +import { CartPage, ProductSetsPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'product set management', + { tags: ['@backoffice', '@merchandising', 'product-sets', 'product', 'cart', 'spryker-core'] }, + (): void => { + const productSetCreatePage = container.get(ProductSetCreatePage); + const productSetListPage = container.get(ProductSetListPage); + const productSetsPage = container.get(ProductSetsPage); + const cartPage = container.get(CartPage); + const userLoginScenario = container.get(UserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ProductSetManagementStaticFixtures; + let dynamicFixtures: ProductSetManagementDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given three products when a product set is created for them in the back office then the storefront serves the set and its whole content reaches the cart, and deleting the set retires the page but leaves the cart untouched', (): void => { + // Arrange + // The set key and the url key are unique per database row, so they are drawn inside the test: + // a value fixed at module scope is reused by a Cypress retry and collides with its own run. + const runMarker = Cypress._.uniqueId(`${Date.now()}`); + const productSetName = `Product Set ${runMarker}`; + const productSetUrlKey = `product-set-${runMarker}`; + const products = [dynamicFixtures.firstProduct, dynamicFixtures.secondProduct, dynamicFixtures.thirdProduct]; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + productSetCreatePage.create({ + name: productSetName, + urlKey: productSetUrlKey, + setKey: `product-set-key-${runMarker}`, + productAbstractSkus: products.map((product) => product.abstract_sku), + }); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + productSetsPage.waitUntilProductSetIsPublished(productSetUrlKey); + + // Assert + productSetsPage.getProductSetProductItems().should('have.length', products.length); + products.forEach((product) => { + productSetsPage.getProductSetDetails().should('contain', product.localized_attributes[0].name); + }); + + // Act + productSetsPage.addAllProductsToCart(); + cartPage.visit(); + + // Assert + products.forEach((product) => { + cartPage.findCartItem({ sku: product.sku }).should('exist'); + }); + + // Act + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + productSetListPage.delete(productSetName); + + // Assert + productSetsPage.waitUntilProductSetIsGone(productSetUrlKey); + + // A set only groups products for display, so the items it put into the cart are the customer's + // own and outlive it. + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + cartPage.visit(); + products.forEach((product) => { + cartPage.findCartItem({ sku: product.sku }).should('exist'); + }); + }); + } +); diff --git a/cypress/e2e/backoffice/merchant-management/merchant-crud.cy.ts b/cypress/e2e/backoffice/merchant-management/merchant-crud.cy.ts new file mode 100644 index 000000000..09b9dcc90 --- /dev/null +++ b/cypress/e2e/backoffice/merchant-management/merchant-crud.cy.ts @@ -0,0 +1,156 @@ +import { container } from '@utils'; +import { MerchantCrudDynamicFixtures, MerchantCrudStaticFixtures } from '@interfaces/backoffice'; +import { ActionEnum, MerchantCreatePage, MerchantListPage, MerchantUpdatePage } from '@pages/backoffice'; +import { MerchantPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +const MERCHANT_PROFILE_SELECTOR = '[data-qa="component merchant-profile"]'; + +// Republishing every merchant times the gateway out, so only the merchant under test is published. +const PUBLISH_MERCHANT_COMMAND = 'console publish:trigger-events -r merchant -i'; + +const QUEUE_WORKER_COMMAND = 'console queue:worker:start --stop-when-empty'; + +describe( + 'merchant crud', + { + tags: [ + '@backoffice', + '@marketplace-merchant', + 'marketplace-merchant', + 'merchant', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchants exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const merchantCreatePage = container.get(MerchantCreatePage); + const merchantListPage = container.get(MerchantListPage); + const merchantUpdatePage = container.get(MerchantUpdatePage); + const merchantPage = container.get(MerchantPage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: MerchantCrudStaticFixtures; + let dynamicFixtures: MerchantCrudDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a back office user when a merchant is created inactive for a store then the merchant list shows it inactive, waiting for approval and assigned to that store', (): void => { + // Arrange + merchantCreatePage.visit(); + + // Act + const merchant = merchantCreatePage.create({ isActive: false, storeName: 'DE' }); + + // Assert + merchantListPage.visit(); + merchantListPage.findRow({ query: merchant.name }).should('contain.text', 'Inactive'); + merchantListPage.findRow({ query: merchant.name }).should('contain.text', 'Waiting for Approval'); + merchantListPage.findRow({ query: merchant.name }).should('contain.text', 'DE'); + }); + + it('given an inactive merchant waiting for approval when the back office activates and approves it then the merchant list shows it active and approved', (): void => { + // Arrange + merchantListPage.visit(); + + // Act + merchantListPage.update({ query: dynamicFixtures.merchantWaitingForApproval.name, action: ActionEnum.activate }); + merchantListPage.update({ + query: dynamicFixtures.merchantWaitingForApproval.name, + action: ActionEnum.approveAccess, + }); + + // Assert + merchantListPage + .findRow({ query: dynamicFixtures.merchantWaitingForApproval.name }) + .should('contain.text', 'Active'); + merchantListPage + .findRow({ query: dynamicFixtures.merchantWaitingForApproval.name }) + .should('contain.text', 'Approved'); + }); + + it('given a merchant served on the storefront when the back office renames it then the storefront serves the new name', (): void => { + // Arrange + const renamedMerchantName = `${dynamicFixtures.renamedMerchant.name} renamed`; + const publishAndSyncCommands = [ + `${PUBLISH_MERCHANT_COMMAND} ${dynamicFixtures.renamedMerchant.id_merchant}`, + QUEUE_WORKER_COMMAND, + ]; + + cy.reloadUntilFound( + dynamicFixtures.renamedMerchantUrlEN.url, + MERCHANT_PROFILE_SELECTOR, + 'body', + 10, + 3000, + publishAndSyncCommands + ); + merchantPage.getBody().should('not.contain.text', renamedMerchantName); + + // Act + merchantListPage.visit(); + merchantListPage.update({ query: dynamicFixtures.renamedMerchant.name, action: ActionEnum.edit }); + merchantUpdatePage.rename({ name: renamedMerchantName }); + + // Assert + // The publish commands run before every visit, so the page is rendered from the renamed + // storage entry. The merchant name is the page heading, outside the profile component itself. + cy.reloadUntilFound( + dynamicFixtures.renamedMerchantUrlEN.url, + MERCHANT_PROFILE_SELECTOR, + 'body', + 10, + 3000, + publishAndSyncCommands + ); + merchantPage.getBody().should('contain.text', renamedMerchantName); + }); + + it('given a merchant served on the storefront when the back office unassigns all its stores then the storefront retires its page', (): void => { + // Arrange + const publishAndSyncCommands = [ + `${PUBLISH_MERCHANT_COMMAND} ${dynamicFixtures.unassignedMerchant.id_merchant}`, + QUEUE_WORKER_COMMAND, + ]; + + cy.reloadUntilFound( + dynamicFixtures.unassignedMerchantUrlEN.url, + MERCHANT_PROFILE_SELECTOR, + 'body', + 10, + 3000, + publishAndSyncCommands + ); + + // Act + merchantListPage.visit(); + merchantListPage.update({ query: dynamicFixtures.unassignedMerchant.name, action: ActionEnum.edit }); + merchantUpdatePage.unassignAllStores(); + + // Assert + cy.reloadUntilGone( + dynamicFixtures.unassignedMerchantUrlEN.url, + MERCHANT_PROFILE_SELECTOR, + 'body', + 10, + 3000, + publishAndSyncCommands + ); + }); + } +); diff --git a/cypress/e2e/backoffice/merchant-management/merchant-deactivation.cy.ts b/cypress/e2e/backoffice/merchant-management/merchant-deactivation.cy.ts new file mode 100644 index 000000000..241f8f765 --- /dev/null +++ b/cypress/e2e/backoffice/merchant-management/merchant-deactivation.cy.ts @@ -0,0 +1,102 @@ +import { container } from '@utils'; +import { MerchantDeactivationDynamicFixtures, MerchantDeactivationStaticFixtures } from '@interfaces/backoffice'; +import { ActionEnum, MerchantListPage } from '@pages/backoffice'; +import { ProfilePage } from '@pages/mp'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; + +describe( + 'merchant deactivation', + { + tags: [ + '@backoffice', + '@marketplace-merchant', + 'marketplace-merchant', + 'merchant', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchants exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const merchantListPage = container.get(MerchantListPage); + const profilePage = container.get(ProfilePage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const userLoginScenario = container.get(UserLoginScenario); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + + let staticFixtures: MerchantDeactivationStaticFixtures; + let dynamicFixtures: MerchantDeactivationDynamicFixtures; + let publishAndSyncCommands: Array; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + // Republishing every merchant times the gateway out, so only the merchant under test is published. + publishAndSyncCommands = [ + `console publish:trigger-events -r merchant -i ${dynamicFixtures.merchant.id_merchant}`, + 'console queue:worker:start --stop-when-empty', + ]; + + // The merchant has no online profile until the portal writes one, which is what puts it on the + // storefront. + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + profilePage.visit(); + profilePage.openOnlineProfileTab(); + profilePage.setStoreStatus({ isOnline: true }); + profilePage.save(); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a merchant offered on the storefront when the back office deactivates it then its profile and its products leave the storefront', (): void => { + // Arrange + cy.reloadUntilFound( + dynamicFixtures.merchantUrlEN.url, + '[data-qa="component merchant-profile"]', + 'body', + 10, + 3000, + publishAndSyncCommands + ); + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.merchantProduct.abstract_sku }); + productPage.getSoldByProductOffers().should('contain.text', dynamicFixtures.merchant.name); + + // Act + merchantListPage.visit(); + merchantListPage.update({ query: dynamicFixtures.merchant.name, action: ActionEnum.deactivate }); + + // Assert + cy.reloadUntilGone( + dynamicFixtures.merchantUrlEN.url, + '[data-qa="component merchant-profile"]', + 'body', + 10, + 3000, + publishAndSyncCommands + ); + + // A deactivated merchant takes its whole buy-box entry with it, so the merchant name has to be + // gone from the detail page rather than merely absent from a block that no longer exists. + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.merchantProduct.abstract_sku }); + productPage.getBody().should('not.contain.text', dynamicFixtures.merchant.name); + }); + } +); diff --git a/cypress/e2e/backoffice/merchant-management/merchant-user-management.cy.ts b/cypress/e2e/backoffice/merchant-management/merchant-user-management.cy.ts new file mode 100644 index 000000000..1681d2274 --- /dev/null +++ b/cypress/e2e/backoffice/merchant-management/merchant-user-management.cy.ts @@ -0,0 +1,88 @@ +import { container } from '@utils'; +import { MerchantUserManagementDynamicFixtures, MerchantUserManagementStaticFixtures } from '@interfaces/backoffice'; +import { ActionEnum, MerchantUpdatePage, MerchantUserCreatePage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'merchant user management', + { + tags: [ + '@backoffice', + '@marketplace-merchant', + 'marketplace-merchant', + 'merchant', + 'marketplace-merchant-user', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchant users exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const merchantUpdatePage = container.get(MerchantUpdatePage); + const merchantUserCreatePage = container.get(MerchantUserCreatePage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: MerchantUserManagementStaticFixtures; + let dynamicFixtures: MerchantUserManagementDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a merchant when the back office adds a user to it then the user can be activated, renamed, deactivated and deleted', (): void => { + // Arrange + merchantUpdatePage.visitUsersTab(dynamicFixtures.merchant.id_merchant); + merchantUpdatePage.create(); + + // Act + const merchantUser = merchantUserCreatePage.create(); + + // Assert + // A merchant user starts deactivated, so activating it is the first thing the back office does. + merchantUpdatePage.findMerchantUserRow({ email: merchantUser.username }).should('contain.text', DEACTIVATED); + + merchantUpdatePage.updateMerchantUser({ email: merchantUser.username, action: ActionEnum.activate }); + merchantUpdatePage.visitUsersTab(dynamicFixtures.merchant.id_merchant); + merchantUpdatePage.findMerchantUserRow({ email: merchantUser.username }).should('contain.text', ACTIVE); + + // Act + merchantUpdatePage.updateMerchantUser({ email: merchantUser.username, action: ActionEnum.edit }); + const renamedFirstName = `${merchantUser.firstName} renamed`; + merchantUserCreatePage.rename({ firstName: renamedFirstName }); + + // Assert + merchantUpdatePage.visitUsersTab(dynamicFixtures.merchant.id_merchant); + merchantUpdatePage.findMerchantUserRow({ email: merchantUser.username }).should('contain.text', renamedFirstName); + + // Act + merchantUpdatePage.updateMerchantUser({ email: merchantUser.username, action: ActionEnum.deactivate }); + + // Assert + merchantUpdatePage.visitUsersTab(dynamicFixtures.merchant.id_merchant); + merchantUpdatePage.findMerchantUserRow({ email: merchantUser.username }).should('contain.text', DEACTIVATED); + + // Act + merchantUpdatePage.updateMerchantUser({ email: merchantUser.username, action: ActionEnum.delete }); + + // Assert + merchantUpdatePage.getBody().should('contain.text', MERCHANT_USER_DELETED); + merchantUpdatePage.findDeletableMerchantUserRow({ email: merchantUser.username }).should('not.exist'); + }); + } +); + +const DEACTIVATED = 'Deactivated'; +const ACTIVE = 'Active'; +const MERCHANT_USER_DELETED = 'Merchant user was deleted successfully.'; diff --git a/cypress/e2e/backoffice/navigation/navigation-smoke.cy.ts b/cypress/e2e/backoffice/navigation/navigation-smoke.cy.ts new file mode 100644 index 000000000..b57ddb03a --- /dev/null +++ b/cypress/e2e/backoffice/navigation/navigation-smoke.cy.ts @@ -0,0 +1,56 @@ +import { container } from '@utils'; +import { NavigationSmokeDynamicFixtures, NavigationSmokeStaticFixtures } from '@interfaces/backoffice'; +import { IndexPage, NavigationMenuPage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'navigation smoke', + { tags: ['@backoffice', 'navigation', 'spryker-core-back-office', 'spryker-core'] }, + (): void => { + const indexPage = container.get(IndexPage); + const navigationMenuPage = container.get(NavigationMenuPage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: NavigationSmokeStaticFixtures; + let dynamicFixtures: NavigationSmokeDynamicFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + indexPage.visit(); + }); + + it('should open every left navigation node without an error', (): void => { + // Arrange + navigationMenuPage.getMenuItemPaths().then((paths) => { + expect(paths, 'navigable side-menu nodes').to.have.length.greaterThan(0); + cy.log(`crawling ${paths.length} navigation nodes`); + + // Act + paths.forEach((path) => { + cy.visitBackoffice(path); + + // Assert + // The user-navigation toggler only renders inside the full back-office chrome, so its + // absence is how a node that errored or bounced to the login page shows up. + navigationMenuPage.getUserNavigationToggler().should('exist'); + cy.url().should('not.include', staticFixtures.accessDeniedUrlPart); + }); + }); + }); + + it('should render an icon for every top level navigation node', (): void => { + // Act + navigationMenuPage.getTopLevelIcons().then(($icons) => { + // Assert + navigationMenuPage.getTopLevelMenuItems().should('have.length', $icons.length); + }); + }); + } +); diff --git a/cypress/e2e/backoffice/order-management/configurable-product-oms.cy.ts b/cypress/e2e/backoffice/order-management/configurable-product-oms.cy.ts new file mode 100644 index 000000000..f8dcc2434 --- /dev/null +++ b/cypress/e2e/backoffice/order-management/configurable-product-oms.cy.ts @@ -0,0 +1,136 @@ +import { container, getPaymentMethodBasedOnEnv, skipWhenFeatureAbsent } from '@utils'; +import { ConfigurableProductOmsDynamicFixtures, ConfigurableProductOmsStaticFixtures } from '@interfaces/backoffice'; +import { + CartPage, + CatalogPage, + CustomerOverviewPage, + OrderDetailsPage, + ProductConfiguratorPage, + ProductPage, +} from '@pages/yves'; +import { SalesDetailPage } from '@pages/backoffice'; +import { CustomerLoginScenario, PlaceOrderScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +// The group and option the configurator is driven to. Option one of each group is preselected, so +// picking the second is what makes the saved configuration differ from the default. +const CONFIGURED_GROUP_NUMBER = 1; + +const CONFIGURED_OPTION_NUMBER = 2; + +describe( + 'configurable product OMS', + { + tags: [ + '@backoffice', + '@order-management', + 'order-management', + 'marketplace-order-management', + 'configurable-product', + 'product', + 'state-machine', + 'cart', + 'checkout', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + skipWhenFeatureAbsent('dateTimeConfigurator', ['b2b']); + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const productConfiguratorPage = container.get(ProductConfiguratorPage); + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const salesDetailPage = container.get(SalesDetailPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const placeOrderScenario = container.get(PlaceOrderScenario); + + let staticFixtures: ConfigurableProductOmsStaticFixtures; + let dynamicFixtures: ConfigurableProductOmsDynamicFixtures; + let configuredOptionTitle: string; + let idSalesOrder: number; + + // The order item has to carry a configuration the customer saved, and no fixture helper persists + // one onto a sales order item, so the order is placed through the storefront once for both tests. + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.reloadUntilConfigurable(); + + productPage.configure(); + productConfiguratorPage.getHeading().should('be.visible'); + productConfiguratorPage + .getOptionTitle(CONFIGURED_GROUP_NUMBER, CONFIGURED_OPTION_NUMBER) + .then((title: string): void => { + configuredOptionTitle = title; + }); + productConfiguratorPage.selectOption(CONFIGURED_GROUP_NUMBER, CONFIGURED_OPTION_NUMBER); + productConfiguratorPage.save(); + productPage.getProductConfigurationStatus().should('contain', staticFixtures.configurationCompleteStatus); + productPage.addToCart(); + + placeOrderScenario + .execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }) + .then((placedIdSalesOrder: number): void => { + idSalesOrder = placedIdSalesOrder; + }); + }); + + it('given an order of a configured product when the back office drives it to shipped then the order item keeps the configuration', (): void => { + // Arrange + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesDetailPage.visit({ qs: { 'id-sales-order': idSalesOrder } }); + + salesDetailPage.getOrderItemTables().should((tables: JQuery): void => { + expect(tables.text()).to.contain(configuredOptionTitle); + }); + + // Act + // The marketplace order processes hand the order to its merchant after payment, so their back office walk + // ends there. + staticFixtures.orderShippingEvents.forEach((event) => salesDetailPage.triggerOms(event)); + + // Assert + salesDetailPage.getOrderItemTables().should((tables: JQuery): void => { + expect(tables.text()).to.contain(configuredOptionTitle); + }); + }); + + it('given an order of a configured product when the customer reorders it then the product is back in the cart without its configuration', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + customerOverviewPage.viewLastPlacedOrder(); + + // Act + // Reordering copies the item back into the cart, but a configuration belongs to the order it + // was made for, so the customer has to configure the product again before checking out. + orderDetailsPage.reorderAll(); + + // Assert + cartPage.assertPageLocation(); + cartPage + .getCartItems({ sku: dynamicFixtures.product.sku }) + .should('contain', staticFixtures.configurationNotCompleteStatus); + }); + } +); diff --git a/cypress/e2e/backoffice/order-management/order-refund.cy.ts b/cypress/e2e/backoffice/order-management/order-refund.cy.ts new file mode 100644 index 000000000..b6fa36839 --- /dev/null +++ b/cypress/e2e/backoffice/order-management/order-refund.cy.ts @@ -0,0 +1,129 @@ +import { container } from '@utils'; +import { OrderRefundDynamicFixtures, OrderRefundStaticFixtures } from '@interfaces/backoffice'; +import { RefundPage, SalesDetailPage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CustomerLoginScenario, PlaceOrderScenario } from '@scenarios/yves'; + +// The marketplace repositories run MarketplacePayment01, whose only route into `refunded` starts +// from `cancelled`; the delivered-to-refunded transition this journey drives exists in the Dummy +// process alone. +const UNSUPPORTED_REPOSITORY_IDS = ['b2c-mp', 'b2b-mp']; + +// The back office labels an item's manual events with ucfirst() of the event name. +const REFUND_ITEM_EVENT = 'Refund'; + +describe( + 'order refund', + { + tags: [ + '@backoffice', + '@order-management', + 'order-management', + 'refund', + 'sales', + 'state-machine', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + if (UNSUPPORTED_REPOSITORY_IDS.includes(Cypress.env('repositoryId'))) { + it.skip('skipped because only the dummy payment process refunds a delivered item', () => {}); + + return; + } + + const salesDetailPage = container.get(SalesDetailPage); + const refundPage = container.get(RefundPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const placeOrderScenario = container.get(PlaceOrderScenario); + + let staticFixtures: OrderRefundStaticFixtures; + let dynamicFixtures: OrderRefundDynamicFixtures; + let idSalesOrder: number; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + placeOrderScenario + .execute({ idCustomerAddress: dynamicFixtures.address.id_customer_address, shouldTriggerOmsInCli: true }) + .then((placedIdSalesOrder: number): void => { + idSalesOrder = placedIdSalesOrder; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesDetailPage.visit({ qs: { 'id-sales-order': idSalesOrder } }); + + // `refund` is reachable from `delivered` only, so the order has to walk the whole happy path + // first. Every event on it is manual, which is why each one is triggered rather than waited for. + salesDetailPage.triggerOms({ state: 'skip grace period', shouldTriggerOmsInCli: true }); + salesDetailPage.triggerOms({ state: 'Pay', shouldTriggerOmsInCli: true }); + salesDetailPage.triggerOms({ state: 'Skip timeout', shouldTriggerOmsInCli: true }); + salesDetailPage.triggerOms({ state: 'skip picking' }); + salesDetailPage.triggerOms({ state: 'Ship' }); + salesDetailPage.triggerOms({ state: 'Stock update' }); + }); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesDetailPage.visit({ qs: { 'id-sales-order': idSalesOrder } }); + }); + + it('given a delivered order of three items when they are refunded one by one then each refund is recorded and the grand total reaches zero', (): void => { + // Arrange + let firstItemAmount: number; + let grandTotalBeforeRefunds: number; + + refundPage.getItemTotalAmount(dynamicFixtures.firstRefundedProduct.sku).then((amount: number): void => { + firstItemAmount = amount; + }); + salesDetailPage.getGrandTotal().then((grandTotal: number): void => { + grandTotalBeforeRefunds = grandTotal; + }); + + // Act + salesDetailPage.triggerOmsForOrderItem({ + sku: dynamicFixtures.firstRefundedProduct.sku, + state: REFUND_ITEM_EVENT, + }); + + // Assert + refundPage.getRefundRows().should('have.length', 1); + refundPage.getTotalRefundedAmount().should((refunded: number): void => { + expect(refunded).to.equal(firstItemAmount); + }); + salesDetailPage.getGrandTotal().should((grandTotal: number): void => { + expect(grandTotal).to.equal(grandTotalBeforeRefunds - firstItemAmount); + }); + + // Act + salesDetailPage.triggerOmsForOrderItem({ + sku: dynamicFixtures.secondRefundedProduct.sku, + state: REFUND_ITEM_EVENT, + }); + salesDetailPage.triggerOmsForOrderItem({ + sku: dynamicFixtures.thirdRefundedProduct.sku, + state: REFUND_ITEM_EVENT, + }); + + // Assert + refundPage.getRefundRows().should('have.length', 3); + refundPage.getTotalRefundedAmount().should((refunded: number): void => { + expect(refunded).to.equal(grandTotalBeforeRefunds); + }); + salesDetailPage.getGrandTotal().should('equal', 0); + }); + } +); diff --git a/cypress/e2e/backoffice/order-management/shipment-management.cy.ts b/cypress/e2e/backoffice/order-management/shipment-management.cy.ts new file mode 100644 index 000000000..75c18bf74 --- /dev/null +++ b/cypress/e2e/backoffice/order-management/shipment-management.cy.ts @@ -0,0 +1,114 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { ShipmentManagementDynamicFixtures, ShipmentManagementStaticFixtures } from '@interfaces/backoffice'; +import { SalesDetailPage, SalesShipmentFormPage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CustomerLoginScenario, PlaceOrderScenario } from '@scenarios/yves'; + +describe( + 'shipment management', + { + tags: [ + '@backoffice', + '@order-management', + 'order-management', + 'marketplace-order-management', + 'shipment', + 'marketplace-shipment', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + const salesDetailPage = container.get(SalesDetailPage); + const salesShipmentFormPage = container.get(SalesShipmentFormPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const placeOrderScenario = container.get(PlaceOrderScenario); + + let staticFixtures: ShipmentManagementStaticFixtures; + let dynamicFixtures: ShipmentManagementDynamicFixtures; + let idSalesOrder: number; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + placeOrderScenario + .execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }) + .then((placedIdSalesOrder: number): void => { + idSalesOrder = placedIdSalesOrder; + }); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesDetailPage.visit({ qs: { 'id-sales-order': idSalesOrder } }); + }); + + it('given an order delivered as one shipment when a second shipment is created and then edited then the item moves and the edited address is kept', (): void => { + // Arrange + let createdShipmentMethodName: string; + let editedShipmentMethodName: string; + + salesDetailPage.getOrderItemTables().should('have.length', 1); + + // Act + salesDetailPage.createShipment(); + salesShipmentFormPage.fillNewDeliveryAddress(staticFixtures.newShipmentAddress); + salesShipmentFormPage.selectShipmentMethod('last').then((shipmentMethodName: string): void => { + createdShipmentMethodName = shipmentMethodName; + }); + salesShipmentFormPage.assignOrderItem(dynamicFixtures.movedProduct.sku); + salesShipmentFormPage.save(); + + // Assert + salesDetailPage.getOrderItemTables().should('have.length', 2); + salesDetailPage.getShipmentItemTable(1).should('not.contain', dynamicFixtures.movedProduct.sku); + salesDetailPage.getShipmentItemTable(1).should('contain', dynamicFixtures.keptProduct.sku); + salesDetailPage.getShipmentItemTable(2).should('contain', dynamicFixtures.movedProduct.sku); + salesDetailPage + .getShipmentDeliveryAddresses() + .eq(1) + .should('contain', staticFixtures.newShipmentAddress.address1); + salesDetailPage + .getShipmentShippingMethods() + .eq(1) + .should((method: JQuery): void => { + expect(method.text()).to.contain(createdShipmentMethodName); + }); + + // Act + // Editing carries the shipment's own id, so the address is corrected in place rather than + // splitting the order again. The method has to be picked again: the edit form hydrates the + // shipment's address but not its method, so leaving the select alone fails validation. + salesDetailPage.editShipment(2); + salesShipmentFormPage.fillNewDeliveryAddress(staticFixtures.editedShipmentAddress); + salesShipmentFormPage.selectShipmentMethod('first').then((shipmentMethodName: string): void => { + editedShipmentMethodName = shipmentMethodName; + }); + salesShipmentFormPage.save(); + + // Assert + salesDetailPage.getOrderItemTables().should('have.length', 2); + salesDetailPage + .getShipmentDeliveryAddresses() + .should('contain', staticFixtures.editedShipmentAddress.address1) + .and('not.contain', staticFixtures.newShipmentAddress.address1); + salesDetailPage.getShipmentShippingMethods().should((methods: JQuery): void => { + expect(methods.text()).to.contain(editedShipmentMethodName); + }); + salesDetailPage.getShipmentItemTable(2).should('contain', dynamicFixtures.movedProduct.sku); + }); + } +); diff --git a/cypress/e2e/backoffice/product-management/product-attachment-management.cy.ts b/cypress/e2e/backoffice/product-management/product-attachment-management.cy.ts index 74a5d0bd8..47aa2b222 100644 --- a/cypress/e2e/backoffice/product-management/product-attachment-management.cy.ts +++ b/cypress/e2e/backoffice/product-management/product-attachment-management.cy.ts @@ -1,4 +1,4 @@ -import { container } from '@utils'; +import { container, skipWhenFeatureAbsent } from '@utils'; import { ProductManagementListPage, ProductManagementEditPage, ProductPage } from '@pages/backoffice'; import { ProductManagementStaticFixtures, ProductManagementDynamicFixtures } from '@interfaces/backoffice'; import { UserLoginScenario } from '@scenarios/backoffice'; @@ -7,6 +7,15 @@ describe( 'product attachment management', { tags: ['@backoffice', '@product-attachment', 'product', 'spryker-core-back-office', 'spryker-core'] }, (): void => { + // The B2C shops carry the product attachment tables but wire neither the Back Office form nor the storefront. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C shops have no product attachments', () => {}); + + return; + } + + skipWhenFeatureAbsent('productAttachments', ['b2b']); + const productManagementListPage = container.get(ProductManagementListPage); const productManagementEditPage = container.get(ProductManagementEditPage); const userLoginScenario = container.get(UserLoginScenario); diff --git a/cypress/e2e/backoffice/product-management/product-lifecycle-management.cy.ts b/cypress/e2e/backoffice/product-management/product-lifecycle-management.cy.ts new file mode 100644 index 000000000..168061508 --- /dev/null +++ b/cypress/e2e/backoffice/product-management/product-lifecycle-management.cy.ts @@ -0,0 +1,98 @@ +import { container } from '@utils'; +import { + ProductLifecycleManagementDynamicFixtures, + ProductLifecycleManagementStaticFixtures, +} from '@interfaces/backoffice'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { ProductManagementEditVariantPage } from '@pages/backoffice'; +import { CreateProductScenario, UserLoginScenario } from '@scenarios/backoffice'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'product lifecycle management', + { + tags: [ + '@backoffice', + 'product', + 'marketplace-product', + 'product-approval-process', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const productManagementEditVariantPage = container.get(ProductManagementEditVariantPage); + const userLoginScenario = container.get(UserLoginScenario); + const createProductScenario = container.get(CreateProductScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ProductLifecycleManagementStaticFixtures; + let dynamicFixtures: ProductLifecycleManagementDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given an abstract product created and approved in the back office when the catalog is searched then the storefront lists it', (): void => { + // Arrange + const productAbstract = createProductScenario.execute({ shouldTriggerPublishAndSync: true }); + + // Act + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.visit(); + catalogPage.search({ query: productAbstract.name }); + + // Assert + productPage.assertBodyContainsText(productAbstract.sku); + }); + + it('given an abstract product whose only variant is deactivated in the back office when the catalog is searched then the storefront no longer lists it', (): void => { + // Arrange + // An absence is only evidence once the product has been seen in the catalog. + const productAbstract = createProductScenario.execute({ shouldTriggerPublishAndSync: true }); + // Product creation ends on the variant edit page, which is left to confirm the catalog listing. + let variantEditUrl: string; + cy.url().then((url: string): void => { + variantEditUrl = url; + }); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.waitUntilProductIsListed(productAbstract.name); + + // Act + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + cy.then((): void => { + cy.visit(variantEditUrl); + }); + productManagementEditVariantPage.deactivate(); + cy.runQueueWorker(); + + // Assert + // Deactivating the last active variant takes the abstract out of the catalog, so the card that + // was just seen there does not survive. + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.waitUntilProductIsNotListed(productAbstract.name); + }); + } +); diff --git a/cypress/e2e/backoffice/product-offer/offer-approval.cy.ts b/cypress/e2e/backoffice/product-offer/offer-approval.cy.ts new file mode 100644 index 000000000..3c2c7fa0c --- /dev/null +++ b/cypress/e2e/backoffice/product-offer/offer-approval.cy.ts @@ -0,0 +1,86 @@ +import { container } from '@utils'; +import { OfferApprovalDynamicFixtures, OfferApprovalStaticFixtures } from '@interfaces/backoffice'; +import { ProductOfferListPage } from '@pages/backoffice'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'offer approval', + { + tags: [ + '@backoffice', + '@marketplace-product-offer', + 'marketplace-product-offer', + 'product-offer', + 'marketplace-product-approval-process', + 'product-approval-process', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because product offers exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const productOfferListPage = container.get(ProductOfferListPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const userLoginScenario = container.get(UserLoginScenario); + + // A tree-wide publish times the gateway out, so this stays narrowed to what the journey reads. + const publishAndSyncCommands = [ + 'console publish:trigger-events -r product_abstract', + 'console queue:worker:start --stop-when-empty', + ]; + + let staticFixtures: OfferApprovalStaticFixtures; + let dynamicFixtures: OfferApprovalDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + cy.runCliCommands(publishAndSyncCommands); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given an approved offer on the storefront when the back office denies it then it leaves the detail page, and approving it again brings it back', (): void => { + // Arrange + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.merchantProduct.abstract_sku }); + productPage.getSoldByProductOffers().should('contain.text', dynamicFixtures.merchant.name); + + // Act + productOfferListPage.visit(); + productOfferListPage.findOffer({ query: dynamicFixtures.productOffer.product_offer_reference }); + productOfferListPage.clickDenyButton(); + cy.runCliCommands(publishAndSyncCommands); + + // Assert + // A denied offer takes its whole buy-box entry with it, so the merchant name has to be gone + // from the detail page rather than merely absent from a block that no longer exists. + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.merchantProduct.abstract_sku }); + productPage.getBody().should('not.contain.text', dynamicFixtures.merchant.name); + + // Act + productOfferListPage.visit(); + productOfferListPage.findOffer({ query: dynamicFixtures.productOffer.product_offer_reference }); + productOfferListPage.clickApproveButton(); + cy.runCliCommands(publishAndSyncCommands); + + // Assert + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.merchantProduct.abstract_sku }); + productPage.getSoldByProductOffers().should('contain.text', dynamicFixtures.merchant.name); + }); + } +); diff --git a/cypress/e2e/backoffice/product-offer/offer-view-and-filter.cy.ts b/cypress/e2e/backoffice/product-offer/offer-view-and-filter.cy.ts new file mode 100644 index 000000000..f1f1a30fc --- /dev/null +++ b/cypress/e2e/backoffice/product-offer/offer-view-and-filter.cy.ts @@ -0,0 +1,101 @@ +import { container } from '@utils'; +import { OfferViewAndFilterDynamicFixtures, OfferViewAndFilterStaticFixtures } from '@interfaces/backoffice'; +import { + ProductManagementListPage, + ProductManagementViewPage, + ProductOfferListPage, + ProductOfferViewPage, +} from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'offer view and filter', + { + tags: [ + '@backoffice', + '@marketplace-product-offer', + 'marketplace-product-offer', + 'product-offer', + 'marketplace-product', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchant products and offers exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const productManagementListPage = container.get(ProductManagementListPage); + const productManagementViewPage = container.get(ProductManagementViewPage); + const productOfferListPage = container.get(ProductOfferListPage); + const productOfferViewPage = container.get(ProductOfferViewPage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: OfferViewAndFilterStaticFixtures; + let dynamicFixtures: OfferViewAndFilterDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given two merchants each owning a product when the product table is filtered by one of them then only its product is listed and the view action shows the merchant, the approval status and the sku', (): void => { + // Arrange + productManagementListPage.visit(); + + // Act + productManagementListPage.filterByMerchant({ idMerchant: dynamicFixtures.merchant1.id_merchant }); + + // Assert + productManagementListPage.getTableRows().should('have.length', 1); + productManagementListPage.getTableRows().should('contain.text', dynamicFixtures.merchantProduct1.abstract_sku); + productManagementListPage + .getTableRows() + .should('not.contain.text', dynamicFixtures.merchantProduct2.abstract_sku); + + productManagementListPage.clickViewButton(); + + productManagementViewPage.getMerchantName().should('contain.text', dynamicFixtures.merchant1.name); + productManagementViewPage.getApprovalStatus().should('contain.text', APPROVED_LABEL); + productManagementViewPage.getStoreRelation().should('contain.text', STORE_NAME); + productManagementViewPage.getSku().should('contain.text', dynamicFixtures.merchantProduct1.abstract_sku); + }); + + it('given two merchants each owning an offer when the offer table is filtered by one of them then only its offer is listed and the view action shows the merchant, its sku and the offer status', (): void => { + // Arrange + productOfferListPage.visit(); + + // Act + productOfferListPage.filterByMerchant({ idMerchant: dynamicFixtures.merchant1.id_merchant }); + + // Assert + productOfferListPage.getTableRows().should('have.length', 1); + productOfferListPage.getTableRows().should('contain.text', dynamicFixtures.productOffer1.product_offer_reference); + productOfferListPage + .getTableRows() + .should('not.contain.text', dynamicFixtures.productOffer2.product_offer_reference); + + productOfferListPage.clickViewButton(); + + productOfferViewPage.getApprovalStatusContainer().should('contain.text', APPROVED_LABEL); + productOfferViewPage.getStatusContainer().should('contain.text', ACTIVE_LABEL); + productOfferViewPage.getStoreContainer().should('contain.text', STORE_NAME); + productOfferViewPage.getProductSkuContainer().should('contain.text', dynamicFixtures.merchantProduct1.sku); + productOfferViewPage.getMerchantNameContainer().should('contain.text', dynamicFixtures.merchant1.name); + productOfferViewPage.getMerchantSkuContainer().should('contain.text', dynamicFixtures.productOffer1.merchant_sku); + }); + } +); + +const APPROVED_LABEL = 'Approved'; +const ACTIVE_LABEL = 'Active'; +const STORE_NAME = 'DE'; diff --git a/cypress/e2e/backoffice/warehouse/warehouse-picking-oms.cy.ts b/cypress/e2e/backoffice/warehouse/warehouse-picking-oms.cy.ts new file mode 100644 index 000000000..ab044e258 --- /dev/null +++ b/cypress/e2e/backoffice/warehouse/warehouse-picking-oms.cy.ts @@ -0,0 +1,110 @@ +import { container } from '@utils'; +import { WarehousePickingOmsDynamicFixtures, WarehousePickingOmsStaticFixtures } from '@interfaces/backoffice'; +import { ActionEnum, SalesDetailPage, UserIndexPage, UserUpdatePage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +// Warehouse picking (the warehouse-user flag on the user form and the DummyPicking subprocess in the +// main OMS processes) ships with suite, b2c and b2c-mp. b2b and b2b-mp do not install the feature. +const WAREHOUSE_PICKING_REPOSITORY_IDS = ['suite', 'b2c', 'b2c-mp']; + +// The order has to come with a shipment, because the order detail page renders its items per shipment +// group. Only suite's dynamic fixtures carry a helper that seeds one (haveFullOrder); the b2c shops' +// can seed a bare order only, which the page renders without a single item to trigger an event on. +const SEEDED_ORDER_WITH_SHIPMENT_REPOSITORY_IDS = ['suite']; + +describe( + 'warehouse picking oms', + { + tags: [ + '@backoffice', + '@warehouse', + 'warehouse', + 'warehouse-picking', + 'order-management', + 'state-machine', + 'spryker-core-back-office', + 'spryker-core', + ], + }, + (): void => { + if (!WAREHOUSE_PICKING_REPOSITORY_IDS.includes(Cypress.env('repositoryId'))) { + it.skip('skipped because warehouse picking exists only in suite, b2c and b2c-mp', () => {}); + + return; + } + + const userIndexPage = container.get(UserIndexPage); + const userUpdatePage = container.get(UserUpdatePage); + const salesDetailPage = container.get(SalesDetailPage); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: WarehousePickingOmsStaticFixtures; + let dynamicFixtures: WarehousePickingOmsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a back office user when it is flagged as a warehouse user then the user list offers to assign it warehouses', (): void => { + // Arrange + userIndexPage.visit(); + userIndexPage.update({ + action: ActionEnum.edit, + query: dynamicFixtures.warehouseUser.username, + expectedToSeeInTable: dynamicFixtures.warehouseUser.username, + }); + + // Act + userUpdatePage.checkWarehouseUserCheckbox(); + + // Assert + userIndexPage.visit(); + userIndexPage + .findUser({ + query: dynamicFixtures.warehouseUser.username, + expectedToSeeInTable: dynamicFixtures.warehouseUser.username, + }) + .should('contain', 'Assign Warehouses'); + }); + + describe('picking list generation', (): void => { + if (!SEEDED_ORDER_WITH_SHIPMENT_REPOSITORY_IDS.includes(Cypress.env('repositoryId'))) { + it.skip('skipped because only suite fixtures can seed an order with a shipment', () => {}); + + return; + } + + // Runs once rather than per attempt: a retry finds the order already past these events. + before((): void => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesDetailPage.visit({ qs: { 'id-sales-order': dynamicFixtures.salesOrder.id_sales_order } }); + salesDetailPage.triggerOms({ state: 'skip grace period', shouldTriggerOmsInCli: true }); + salesDetailPage.triggerOms({ state: 'Pay', shouldTriggerOmsInCli: true }); + salesDetailPage.triggerOms({ state: 'Skip timeout', shouldTriggerOmsInCli: true }); + }); + + it('given a paid order item when picking list generation is scheduled then the item moves to ready for picking', (): void => { + // Arrange + salesDetailPage.visit({ qs: { 'id-sales-order': dynamicFixtures.salesOrder.id_sales_order } }); + + // Act + salesDetailPage.triggerOms({ state: 'picking list generation schedule', shouldTriggerOmsInCli: true }); + + // Assert + // Generating the lists is an onEnter command and the hand-over to `ready for picking` is + // condition guarded, so the item only settles once the OMS console commands have run again. + salesDetailPage.waitForOrderItemState({ state: 'ready for picking', sku: dynamicFixtures.product.sku }); + }); + }); + } +); diff --git a/cypress/e2e/backoffice/workflow/workflow-instance-lifecycle.cy.ts b/cypress/e2e/backoffice/workflow/workflow-instance-lifecycle.cy.ts index ba3d3733c..2b1ee5765 100644 --- a/cypress/e2e/backoffice/workflow/workflow-instance-lifecycle.cy.ts +++ b/cypress/e2e/backoffice/workflow/workflow-instance-lifecycle.cy.ts @@ -1,4 +1,4 @@ -import { container } from '@utils'; +import { container, skipWhenFeatureAbsent } from '@utils'; import { WorkflowInstanceLifecycleDynamicFixtures, WorkflowInstanceLifecycleStaticFixtures, @@ -12,6 +12,15 @@ describe( tags: ['@backoffice', '@workflow', 'workflow', 'spryker-core-back-office', 'spryker-core'], }, (): void => { + // The B2C shops do not install the workflow module. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C shops have no workflows', () => {}); + + return; + } + + skipWhenFeatureAbsent('workflow', ['b2b']); + const workflowInstanceLifecyclePage = container.get(WorkflowInstanceLifecyclePage); const userLoginScenario = container.get(UserLoginScenario); diff --git a/cypress/e2e/backoffice/workflow/workflow-management.cy.ts b/cypress/e2e/backoffice/workflow/workflow-management.cy.ts index 40fc008d6..481ec43d7 100644 --- a/cypress/e2e/backoffice/workflow/workflow-management.cy.ts +++ b/cypress/e2e/backoffice/workflow/workflow-management.cy.ts @@ -1,4 +1,4 @@ -import { container } from '@utils'; +import { container, skipWhenFeatureAbsent } from '@utils'; import { WorkflowManagementDynamicFixtures, WorkflowManagementStaticFixtures } from '@interfaces/backoffice'; import { UserLoginScenario } from '@scenarios/backoffice'; import { WorkflowManagementPage } from '@pages/backoffice'; @@ -9,6 +9,15 @@ describe( tags: ['@backoffice', '@workflow', 'workflow', 'spryker-core-back-office', 'spryker-core'], }, (): void => { + // The B2C shops do not install the workflow module. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C shops have no workflows', () => {}); + + return; + } + + skipWhenFeatureAbsent('workflow', ['b2b']); + const workflowManagementPage = container.get(WorkflowManagementPage); const userLoginScenario = container.get(UserLoginScenario); 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 3e0c4a91a..69deeaadd 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 @@ -117,8 +117,7 @@ describe( query: dynamicFixtures.merchantUser.username, }); - productsPage.visit(); - productsPage.find({ query: dynamicFixtures.productConcreteForMerchant.abstract_sku }).click(); + productsPage.openProduct({ query: dynamicFixtures.productConcreteForMerchant.abstract_sku }); productsPage.getDrawer().as('drawer'); @@ -140,8 +139,7 @@ describe( query: dynamicFixtures.merchantUser.username, }); - offersPage.visit(); - offersPage.find({ query: dynamicFixtures.productOffer.product_offer_reference }).click({ force: true }); + offersPage.openOffer({ query: dynamicFixtures.productOffer.product_offer_reference }); offersPage.getDrawer().find(offersPage.getSaveButtonSelector()).click(); offersPage.assertBodyContainsText('The Offer is saved.'); diff --git a/cypress/e2e/mp/marketplace-order-management/order-fulfilment.cy.ts b/cypress/e2e/mp/marketplace-order-management/order-fulfilment.cy.ts new file mode 100644 index 000000000..2fca6a002 --- /dev/null +++ b/cypress/e2e/mp/marketplace-order-management/order-fulfilment.cy.ts @@ -0,0 +1,126 @@ +import { container } from '@utils'; +import { OrderFulfilmentDynamicFixtures, OrderFulfilmentStaticFixtures } from '@interfaces/mp'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CheckoutMpScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { ActionEnum, SalesOrdersPage } from '@pages/mp'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; +import { retryableBefore } from '../../../support/e2e'; + +describe( + 'order fulfilment', + { + tags: [ + '@mp', + '@marketplace-order-management', + 'marketplace-order-management', + 'order-management', + 'state-machine', + 'checkout', + 'cart', + 'marketplace-merchantportal-core', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchant orders exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const salesOrdersPage = container.get(SalesOrdersPage); + const userLoginScenario = container.get(UserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + const checkoutMpScenario = container.get(CheckoutMpScenario); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + + let staticFixtures: OrderFulfilmentStaticFixtures; + let dynamicFixtures: OrderFulfilmentDynamicFixtures; + + let orderReference: string; + + // A retry needs an order its items have not moved in yet, so the order is placed per attempt. + retryableBefore((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + [dynamicFixtures.merchantProduct.sku, dynamicFixtures.merchantProduct2.sku].forEach((sku) => { + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: sku }); + productPage.addToCart(); + }); + + // Each item gets its own shipment, which is what puts them in the merchant's order as + // separate lines it can move one at a time. + checkoutMpScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + isMultiShipment: true, + shouldTriggerOmsInCli: true, + }); + + // Paying and skipping picking is what hands the order over to the merchant. + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + salesIndexPage.visit(); + salesIndexPage.viewByReference(dynamicFixtures.customer.email); + salesDetailPage.triggerOms({ state: 'skip grace period', shouldTriggerOmsInCli: true }); + salesDetailPage.triggerOms({ state: 'Pay', shouldTriggerOmsInCli: true }); + salesDetailPage.triggerOms({ state: 'skip picking', shouldTriggerOmsInCli: true }); + + // The B2B marketplace creates the merchant order on an OMS condition and timeout check. + if (['b2b-mp'].includes(Cypress.env('repositoryId'))) { + cy.runCliCommands(['console oms:check-condition', 'console oms:check-timeout']); + } + + salesIndexPage.getOrderReference().then((reference: string) => { + orderReference = reference.trim(); + }); + }); + + it("given an order with two of a merchant's items when the merchant ships it and delivers one item then each item carries its own state", (): void => { + // Arrange + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + salesOrdersPage.visit(); + salesOrdersPage.update({ query: orderReference, action: ActionEnum.ship }); + + salesOrdersPage.visit(); + salesOrdersPage.openOrder({ query: orderReference }); + salesOrdersPage.openItemsTab(); + salesOrdersPage.changeOrderItemState({ + sku: dynamicFixtures.merchantProduct.sku, + state: DELIVER_ORDER_ITEM_STATE, + }); + + // Assert + salesOrdersPage.visit(); + salesOrdersPage.openOrder({ query: orderReference }); + salesOrdersPage.openItemsTab(); + salesOrdersPage + .getOrderItemState({ sku: dynamicFixtures.merchantProduct.sku }) + .should('contain.text', staticFixtures.orderItemStates.delivered); + salesOrdersPage + .getOrderItemState({ sku: dynamicFixtures.merchantProduct2.sku }) + .should('contain.text', staticFixtures.orderItemStates.shipped); + }); + } +); + +const DELIVER_ORDER_ITEM_STATE = 'Deliver'; diff --git a/cypress/e2e/mp/marketplace-product-concretes/merchant-product-management.cy.ts b/cypress/e2e/mp/marketplace-product-concretes/merchant-product-management.cy.ts new file mode 100644 index 000000000..528d8d68b --- /dev/null +++ b/cypress/e2e/mp/marketplace-product-concretes/merchant-product-management.cy.ts @@ -0,0 +1,83 @@ +import { container } from '@utils'; +import { MerchantProductManagementDynamicFixtures, MerchantProductManagementStaticFixtures } from '@interfaces/mp'; +import { ProductsPage } from '@pages/mp'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; + +describe( + 'merchant product management', + { + tags: [ + '@mp', + '@merchant-product-concretes', + 'product', + 'marketplace-product', + 'marketplace-merchantportal-core', + 'marketplace-merchant-portal-product-management', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchant products exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const productsPage = container.get(ProductsPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + + let publishAndSyncCommands: string[]; + + let staticFixtures: MerchantProductManagementStaticFixtures; + let dynamicFixtures: MerchantProductManagementDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + // A tree-wide publish times the gateway out, so this stays narrowed to the product under test. + publishAndSyncCommands = [ + `console publish:trigger-events -r product_abstract -i ${dynamicFixtures.variantProduct.fk_product_abstract}`, + 'console queue:worker:start --stop-when-empty', + ]; + }); + + it('given a merchant product with one variant when the merchant adds another concrete then the storefront offers both variants', (): void => { + // Arrange + const addedConcrete = staticFixtures.addedConcrete; + const abstractSku = dynamicFixtures.variantProduct.abstract_sku; + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + productsPage.openProduct({ query: abstractSku }); + productsPage.openConcreteProductsTab(); + productsPage.addConcreteProducts({ attributeValues: [addedConcrete.attributeValue] }); + + // A concrete product reaches the storefront only once it is active, stocked and searchable. + productsPage.openProduct({ query: abstractSku }); + productsPage.openConcreteProductsTab(); + productsPage.openConcreteProduct({ rowText: addedConcrete.attributeValue }); + productsPage.activateConcreteProduct({ + stockQuantity: addedConcrete.stockQuantity, + searchableLocales: addedConcrete.searchableLocales, + }); + productsPage.save(); + productsPage.assertBodyContainsText(PRODUCT_SAVED_MESSAGE); + + cy.runCliCommands(publishAndSyncCommands); + + // Assert + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: abstractSku }); + productPage.getVariantAttributeOptions(staticFixtures.variantAttributeKey).should('have.length.at.least', 2); + }); + } +); + +const PRODUCT_SAVED_MESSAGE = 'The Product is saved.'; 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 3825c60ea..fbccd3b1b 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 @@ -1,7 +1,11 @@ import { container } from '@utils'; import { ProductConcreteManagementDynamicFixtures, ProductConcreteManagementStaticFixtures } from '@interfaces/mp'; -import { VariantsPage } from '@pages/mp'; +import { ProductsPage, VariantsPage } from '@pages/mp'; +import { ActionEnum, ProductManagementListPage } from '@pages/backoffice'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; import { MerchantUserLoginScenario } from '@scenarios/mp'; +import { CustomerLoginScenario } from '@scenarios/yves'; describe( 'product concretes management', @@ -22,13 +26,27 @@ describe( return; } const variantsPage = container.get(VariantsPage); + const productsPage = container.get(ProductsPage); + const productManagementListPage = container.get(ProductManagementListPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let publishAndSyncCommands: string[]; let dynamicFixtures: ProductConcreteManagementDynamicFixtures; let staticFixtures: ProductConcreteManagementStaticFixtures; before((): void => { ({ dynamicFixtures, staticFixtures } = Cypress.env()); + + // A tree-wide publish times the gateway out, so this stays narrowed to the product under test. + publishAndSyncCommands = [ + `console publish:trigger-events -r product_abstract -i ${dynamicFixtures.pendingProduct.fk_product_abstract}`, + 'console queue:worker:start --stop-when-empty', + ]; }); it('merchant user should be able to see table with product concretes', (): void => { @@ -40,5 +58,80 @@ describe( variantsPage.visit(); variantsPage.getProductConcretesCountSelector().contains('2 Result(s)'); }); + + it('given a merchant that created a multi sku product when it sends the product for approval then the product list shows it waiting for approval', (): void => { + // Arrange + const sku = `SKU${Date.now()}`; + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + + productsPage.visit(); + productsPage.createMultiConcreteProduct({ + sku: sku, + name: `Product ${sku}`, + attributeName: staticFixtures.createdProduct.attributeName, + attributeValues: staticFixtures.createdProduct.attributeValues, + }); + + // Act + productsPage.openProduct({ query: sku }); + productsPage.sendForApproval(); + + // Assert + productsPage.visit(); + productsPage.find({ query: sku }).should('contain.text', WAITING_FOR_APPROVAL_STATUS); + }); + + it('given a merchant product waiting for approval when the back office approves it then the storefront serves it, and denying it takes the detail page away', (): void => { + // Arrange + const abstractSku = dynamicFixtures.pendingProduct.abstract_sku; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + productManagementListPage.visit(); + productManagementListPage.update({ query: abstractSku, action: ActionEnum.approve }); + + cy.runCliCommands(publishAndSyncCommands); + + // The B2B marketplace shows prices to logged-in customers only. + if (dynamicFixtures.customer) { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + } + + // Assert + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: abstractSku }); + cy.url().then((productDetailPageUrl) => { + productPage.getSoldByProductOffers().should('contain.text', dynamicFixtures.approvalMerchant.name); + productPage.getProductDetailPrice().should('contain', staticFixtures.pendingProductPrice); + + // Act + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + productManagementListPage.visit(); + productManagementListPage.update({ query: abstractSku, action: ActionEnum.deny }); + + // Assert + cy.reloadUntilGone(productDetailPageUrl, ADD_TO_CART_BUTTON_SELECTOR, 'body', 10, 3000, publishAndSyncCommands); + }); + }); } ); + +const WAITING_FOR_APPROVAL_STATUS = 'Waiting for Approval'; + +// A denied product has no detail page left, and this is what the page loses first. It is the same +// attribute in every storefront theme, so it holds for all three repositories this spec runs in. +const ADD_TO_CART_BUTTON_SELECTOR = '[data-qa="add-to-cart-button"]'; diff --git a/cypress/e2e/mp/merchant-portal/customer-specific-prices.cy.ts b/cypress/e2e/mp/merchant-portal/customer-specific-prices.cy.ts new file mode 100644 index 000000000..1071b8d53 --- /dev/null +++ b/cypress/e2e/mp/merchant-portal/customer-specific-prices.cy.ts @@ -0,0 +1,125 @@ +import { container } from '@utils'; +import { CustomerSpecificPricesDynamicFixtures, CustomerSpecificPricesStaticFixtures } from '@interfaces/mp'; +import { MerchantRelationshipCreatePage } from '@pages/backoffice'; +import { ProductsPage } from '@pages/mp'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'customer specific prices', + { + tags: [ + '@mp', + '@merchant-portal', + 'prices', + 'marketplace-merchant-custom-prices', + 'merchant-custom-prices', + 'marketplace-product', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because customer specific prices need company users, which exist in suite and b2b-mp', () => {}); + + return; + } + + const merchantRelationshipCreatePage = container.get(MerchantRelationshipCreatePage); + const productsPage = container.get(ProductsPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const userLoginScenario = container.get(UserLoginScenario); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let publishAndSyncCommands: string[]; + + let staticFixtures: CustomerSpecificPricesStaticFixtures; + let dynamicFixtures: CustomerSpecificPricesDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + // A tree-wide publish times the gateway out, so this stays narrowed to the product under test. + publishAndSyncCommands = [ + `console publish:trigger-events -r product_abstract -i ${dynamicFixtures.merchantProduct.fk_product_abstract}`, + `console publish:trigger-events -r price_product_abstract -i ${dynamicFixtures.merchantProduct.fk_product_abstract}`, + 'console queue:worker:start --stop-when-empty', + ]; + + // There is no dynamic-fixture helper for a merchant relation, so the back office creates it. + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + merchantRelationshipCreatePage.visit(); + merchantRelationshipCreatePage.create({ + idMerchant: dynamicFixtures.merchant.id_merchant, + idCompany: dynamicFixtures.company.id_company, + idCompanyBusinessUnit: dynamicFixtures.businessUnit.id_company_business_unit, + }); + }); + + it('given a merchant relation to a business unit when the merchant prices a product for it then only that business unit is charged that price, and deleting the row restores the default one', (): void => { + // Arrange + const abstractSku = dynamicFixtures.merchantProduct.abstract_sku; + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + productsPage.openProduct({ query: abstractSku }); + productsPage.addPriceRow({ + customerBusinessUnitName: dynamicFixtures.businessUnit.name, + storeName: staticFixtures.storeName, + currency: staticFixtures.currency, + netAmount: staticFixtures.customerPrice.netAmount, + grossAmount: staticFixtures.customerPrice.grossAmount, + }); + + cy.runCliCommands(publishAndSyncCommands); + + // Assert + customerLoginScenario.execute({ + email: dynamicFixtures.companyCustomer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: abstractSku }); + productPage.getProductDetailPrice().should('contain', staticFixtures.customerPrice.displayed); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: abstractSku }); + productPage.getProductDetailPrice().should('contain', staticFixtures.defaultPrice); + + // Act + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + productsPage.openProduct({ query: abstractSku }); + productsPage.deletePriceRowByCustomer({ customerBusinessUnitName: dynamicFixtures.businessUnit.name }); + + cy.runCliCommands(publishAndSyncCommands); + + // Assert + customerLoginScenario.execute({ + email: dynamicFixtures.companyCustomer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: abstractSku }); + productPage.getProductDetailPrice().should('contain', staticFixtures.defaultPrice); + }); + } +); diff --git a/cypress/e2e/mp/merchant-portal/merchant-profile-update.cy.ts b/cypress/e2e/mp/merchant-portal/merchant-profile-update.cy.ts new file mode 100644 index 000000000..d1590a1b3 --- /dev/null +++ b/cypress/e2e/mp/merchant-portal/merchant-profile-update.cy.ts @@ -0,0 +1,66 @@ +import { container } from '@utils'; +import { MerchantProfileUpdateDynamicFixtures, MerchantProfileUpdateStaticFixtures } from '@interfaces/mp'; +import { ProfilePage } from '@pages/mp'; +import { MerchantPage } from '@pages/yves'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; + +describe( + 'merchant profile update', + { + tags: [ + '@mp', + '@marketplace-merchant', + 'marketplace-merchant', + 'merchant', + 'marketplace-merchantportal-core', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the merchant portal exists only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const profilePage = container.get(ProfilePage); + const merchantPage = container.get(MerchantPage); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + + let staticFixtures: MerchantProfileUpdateStaticFixtures; + let dynamicFixtures: MerchantProfileUpdateDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a merchant profile edited in the merchant portal when it is published then the storefront serves the new values', (): void => { + // Arrange + const publicEmail = `updated-${Date.now()}@merchant-portal.test`; + const publicPhone = '+11 222 333 444'; + const deliveryTime = '2-4 weeks'; + const dataPrivacy = 'Data privacy updated text'; + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + profilePage.visit(); + profilePage.openOnlineProfileTab(); + profilePage.updateOnlineProfile({ publicEmail, publicPhone, deliveryTime, dataPrivacy }); + profilePage.save(); + + cy.runQueueWorker(); + + // Assert + merchantPage.visitProfile({ url: dynamicFixtures.merchantUrlEN.url }); + + merchantPage.getInformationItemValue({ label: 'Email Address' }).should('contain.text', publicEmail); + merchantPage.getInformationItemValue({ label: 'Phone' }).should('contain.text', publicPhone); + merchantPage.getInformationItemValue({ label: 'Delivery Time' }).should('contain.text', deliveryTime); + merchantPage.getProfileContent().should('contain.text', dataPrivacy); + }); + } +); diff --git a/cypress/e2e/mp/merchant-portal/product-volume-prices.cy.ts b/cypress/e2e/mp/merchant-portal/product-volume-prices.cy.ts new file mode 100644 index 000000000..215094066 --- /dev/null +++ b/cypress/e2e/mp/merchant-portal/product-volume-prices.cy.ts @@ -0,0 +1,103 @@ +import { container } from '@utils'; +import { ProductVolumePricesDynamicFixtures, ProductVolumePricesStaticFixtures } from '@interfaces/mp'; +import { ProductsPage } from '@pages/mp'; +import { CartPage, CatalogPage, ProductPage } from '@pages/yves'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'product volume prices', + { + tags: [ + '@mp', + '@merchant-portal', + 'prices', + 'cart', + 'marketplace-cart', + 'marketplace-product', + 'marketplace-merchant-custom-prices', + 'marketplace-merchant-portal-product-management', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchant products exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const productsPage = container.get(ProductsPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ProductVolumePricesStaticFixtures; + let dynamicFixtures: ProductVolumePricesDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + // A tree-wide publish times the gateway out, so this stays narrowed to what the storefront reads. + cy.runCliCommands([ + `console publish:trigger-events -r product_abstract -i ${dynamicFixtures.merchantProduct.fk_product_abstract}`, + `console publish:trigger-events -r price_product_abstract -i ${dynamicFixtures.merchantProduct.fk_product_abstract}`, + 'console queue:worker:start --stop-when-empty', + ]); + }); + + it('given a merchant product carrying a volume price when the merchant deletes that price row then the product no longer lists it', (): void => { + // Arrange + const abstractSku = dynamicFixtures.editableProduct.abstract_sku; + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + productsPage.openProduct({ query: abstractSku }); + productsPage.deletePriceRowByQuantity({ quantity: staticFixtures.volumeTier.threshold }); + + // Assert + productsPage.openProduct({ query: abstractSku }); + productsPage.getPriceRowsByQuantity({ quantity: staticFixtures.volumeTier.threshold }).should('have.length', 0); + }); + + it('given a merchant product carrying a volume price when a customer orders more than its threshold then the storefront charges the volume price', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.merchantProduct.abstract_sku }); + productPage.getProductDetailPrice().should('contain', staticFixtures.unitPrice); + + // Act + productPage.setQuantity({ quantity: staticFixtures.volumeTier.quantity }); + + // Assert + productPage.getProductDetailPrice().should('contain', staticFixtures.volumeTier.price); + + // Act + productPage.addToCart(); + + // Assert + cartPage.visit(); + cartPage + .getCartItemsChargingUnitPrice({ + sku: dynamicFixtures.merchantProduct.sku, + unitPrice: staticFixtures.volumeTier.price, + quantity: staticFixtures.volumeTier.quantity, + }) + .should('have.length', 1); + }); + } +); diff --git a/cypress/e2e/mp/product-offer/offer-creation.cy.ts b/cypress/e2e/mp/product-offer/offer-creation.cy.ts new file mode 100644 index 000000000..2019d1f25 --- /dev/null +++ b/cypress/e2e/mp/product-offer/offer-creation.cy.ts @@ -0,0 +1,102 @@ +import { container } from '@utils'; +import { OfferCreationDynamicFixtures, OfferCreationStaticFixtures } from '@interfaces/mp'; +import { OffersPage } from '@pages/mp'; +import { CartPage, CatalogPage, ProductPage } from '@pages/yves'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'offer creation', + { + tags: [ + '@mp', + '@product-offer', + 'marketplace-product-offer', + 'product-offer', + 'marketplace-merchant-portal-product-offer-management', + 'cart', + 'marketplace-cart', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because product offers exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const offersPage = container.get(OffersPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: OfferCreationStaticFixtures; + let dynamicFixtures: OfferCreationDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a product owned by another merchant when a merchant creates an offer on it then the offer list carries the new offer', (): void => { + // Arrange + const merchantSku = `MERCHANT-SKU-${Date.now()}`; + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.offerMerchantUser.username, + password: staticFixtures.defaultPassword, + }); + + offersPage.visit(); + + // Act + offersPage.createOffer({ + concreteSku: dynamicFixtures.merchantProduct.sku, + merchantSku: merchantSku, + storeName: staticFixtures.storeName, + currency: staticFixtures.currency, + netAmount: staticFixtures.offer.netAmount, + grossAmount: staticFixtures.offer.grossAmount, + stockQuantity: staticFixtures.offer.stockQuantity, + }); + + // Assert + offersPage.visit(); + offersPage.find({ query: merchantSku }).should('contain.text', dynamicFixtures.merchantProduct.sku); + }); + + it('given a merchant offer on a product owned by another merchant when a customer adds the offer to the cart then the cart line carries that merchant at the offer price', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.offeredProduct.abstract_sku }); + + productPage.getSoldByProductOffers().should('contain.text', dynamicFixtures.offerMerchant.name); + productPage.getSoldByProductOffers().should('contain.text', staticFixtures.offer.displayedPrice); + + // Act + productPage.selectSoldByProductOffer({ + productOfferReference: dynamicFixtures.productOffer.product_offer_reference, + }); + productPage.addToCart(); + + // Assert + cartPage.visit(); + cartPage + .getProductCartItems() + .filter(`:contains("${dynamicFixtures.offeredProduct.localized_attributes[0].name}")`) + .should('have.length', 1) + .and('contain.text', dynamicFixtures.offerMerchant.name) + .and('contain.text', staticFixtures.offer.displayedPrice); + }); + } +); diff --git a/cypress/e2e/mp/product-offer/offer-volume-prices.cy.ts b/cypress/e2e/mp/product-offer/offer-volume-prices.cy.ts new file mode 100644 index 000000000..69ead2f29 --- /dev/null +++ b/cypress/e2e/mp/product-offer/offer-volume-prices.cy.ts @@ -0,0 +1,108 @@ +import { container } from '@utils'; +import { OfferVolumePricesDynamicFixtures, OfferVolumePricesStaticFixtures } from '@interfaces/mp'; +import { OffersPage } from '@pages/mp'; +import { CartPage, CatalogPage, ProductPage } from '@pages/yves'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'offer volume prices', + { + tags: [ + '@mp', + '@product-offer', + 'prices', + 'cart', + 'marketplace-cart', + 'marketplace-product-offer', + 'marketplace-merchant-custom-prices', + 'marketplace-merchant-portal-product-offer-management', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because product offers exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const offersPage = container.get(OffersPage); + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: OfferVolumePricesStaticFixtures; + let dynamicFixtures: OfferVolumePricesDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + // A tree-wide publish times the gateway out, so this stays narrowed to what the storefront reads. + cy.runCliCommands([ + `console publish:trigger-events -r product_abstract -i ${dynamicFixtures.merchantProduct.fk_product_abstract}`, + `console publish:trigger-events -r product_offer -i ${dynamicFixtures.productOffer.id_product_offer}`, + `console publish:trigger-events -r price_product_offer -i ${dynamicFixtures.productOfferPrice.id_price_product_offer}`, + 'console queue:worker:start --stop-when-empty', + ]); + }); + + it('given an offer carrying a volume price when the merchant deletes that price row then the offer no longer lists it', (): void => { + // Arrange + const offerReference = dynamicFixtures.editableProductOffer.product_offer_reference; + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + offersPage.openOffer({ query: offerReference }); + offersPage.deletePriceRowByQuantity({ quantity: staticFixtures.volumeTier.threshold }); + + // Assert + offersPage.openOffer({ query: offerReference }); + offersPage.getPriceRowsByQuantity({ quantity: staticFixtures.volumeTier.threshold }).should('have.length', 0); + }); + + it('given an offer carrying a volume price when a customer orders more than its threshold then the storefront charges the volume price', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.merchantProduct.abstract_sku }); + productPage.selectSoldByProductOffer({ + productOfferReference: dynamicFixtures.productOffer.product_offer_reference, + }); + productPage.getProductDetailPrice().should('contain', staticFixtures.offerPrice); + + // Act + productPage.setQuantity({ quantity: staticFixtures.volumeTier.quantity }); + + // Assert + productPage.getProductDetailPrice().should('contain', staticFixtures.volumeTier.price); + + // Act + productPage.addToCart(); + + // Assert + cartPage.visit(); + cartPage + .getCartItemsChargingUnitPrice({ + sku: dynamicFixtures.merchantProduct.sku, + unitPrice: staticFixtures.volumeTier.price, + quantity: staticFixtures.volumeTier.quantity, + }) + .should('have.length', 1) + .and('contain.text', dynamicFixtures.merchant.name); + }); + } +); diff --git a/cypress/e2e/yves/agent-assist/customer-impersonation.cy.ts b/cypress/e2e/yves/agent-assist/customer-impersonation.cy.ts new file mode 100644 index 000000000..e94ced11e --- /dev/null +++ b/cypress/e2e/yves/agent-assist/customer-impersonation.cy.ts @@ -0,0 +1,91 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { CustomerImpersonationDynamicFixtures, CustomerImpersonationStaticFixtures } from '@interfaces/yves'; +import { + AgentControlBarPage, + CheckoutSummaryPage, + CustomerOverviewPage, + CustomerProfilePage, + OrderPage, +} from '@pages/yves'; +import { CheckoutScenario, ImpersonateCustomerScenario } from '@scenarios/yves'; + +describe( + 'customer impersonation', + { + tags: ['@yves', '@agent-assist', 'agent-assist', 'customer-account-management', 'spryker-core'], + }, + (): void => { + const agentControlBarPage = container.get(AgentControlBarPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const customerProfilePage = container.get(CustomerProfilePage); + const checkoutSummaryPage = container.get(CheckoutSummaryPage); + const orderPage = container.get(OrderPage); + const impersonateCustomerScenario = container.get(ImpersonateCustomerScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let staticFixtures: CustomerImpersonationStaticFixtures; + let dynamicFixtures: CustomerImpersonationDynamicFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + impersonateCustomerScenario.execute({ + agentUsername: dynamicFixtures.agentUser.username, + agentPassword: staticFixtures.defaultPassword, + customerEmail: dynamicFixtures.customer.email, + }); + }); + + it('given an agent impersonating a customer when the agent opens the profile then the customer profile data is shown', (): void => { + // Act + customerProfilePage.visit(); + + // Assert + customerProfilePage.getFirstNameInput().should('have.value', dynamicFixtures.customer.first_name); + customerProfilePage.getLastNameInput().should('have.value', dynamicFixtures.customer.last_name); + }); + + it('given an agent impersonating a customer when the agent opens the account overview then it is shown with the assistance still running', (): void => { + // Act + customerOverviewPage.visit(); + + // Assert + customerOverviewPage.assertPageLocation(); + agentControlBarPage.getActiveAssistanceIndicator().should('exist'); + }); + + // The B2B marketplace agent control only ends the whole agent session, and the b2b id runs on it too. + (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? it.skip : it)( + 'given an agent impersonating a customer when the agent ends the assistance then the agent own session is back', + (): void => { + // Arrange + agentControlBarPage.getEndAssistanceLink().should('exist'); + + // Act + agentControlBarPage.endAssistance(); + + // Assert + // The control bar shows the customer search only when nobody is being assisted, and the exit + // link only while somebody is, so the swap is what proves the session was handed back. + agentControlBarPage.getCustomerSearchInput().should('exist'); + agentControlBarPage.getEndAssistanceLink().should('not.exist'); + } + ); + + it('given an agent impersonating a customer with a filled cart when the agent checks out then the order is in the customer order history', (): void => { + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + orderPage.visit(); + orderPage.getOrderHistoryRow(orderReference).should('exist'); + }); + }); + } +); diff --git a/cypress/e2e/yves/cart/shared-cart.cy.ts b/cypress/e2e/yves/cart/shared-cart.cy.ts new file mode 100644 index 000000000..52babe0c1 --- /dev/null +++ b/cypress/e2e/yves/cart/shared-cart.cy.ts @@ -0,0 +1,117 @@ +import { container, getPaymentMethodBasedOnEnv, skipWhenFeatureAbsent } from '@utils'; +import { CartPage, CustomerOverviewPage, MultiCartPage, OrderDetailsPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario, CustomerLogoutScenario } from '@scenarios/yves'; +import { SharedCartDynamicFixtures, SharedCartStaticFixtures } from '@interfaces/yves'; + +describe( + 'shared cart', + { + tags: [ + '@yves', + '@cart', + 'cart', + 'shared-carts', + 'multiple-carts', + 'persistent-cart-sharing', + 'checkout', + 'spryker-core', + ], + }, + (): void => { + // Sharing a cart is a multiple-carts feature, which the B2C storefronts do not carry. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no shared carts', (): void => {}); + + return; + } + + skipWhenFeatureAbsent('marketplaceStorefront', ['b2b']); + + const cartPage = container.get(CartPage); + const multiCartPage = container.get(MultiCartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const customerLogoutScenario = container.get(CustomerLogoutScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let dynamicFixtures: SharedCartDynamicFixtures; + let staticFixtures: SharedCartStaticFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a cart shared with a colleague at full access when the colleague orders it then the order is placed and keeps the merchant relation', (): void => { + // Arrange + // The share form lists colleagues last name first, which is not the order the account pages use. + const receiverName = `${dynamicFixtures.receiverCustomer.last_name} ${dynamicFixtures.receiverCustomer.first_name}`; + const cartName = dynamicFixtures.colleagueSharedQuote.name; + + customerLoginScenario.execute({ + email: dynamicFixtures.ownerCustomer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + multiCartPage.visit(); + multiCartPage.openShareCartPage(cartName); + multiCartPage.shareCartWithCompanyUser({ name: receiverName, accessLevel: staticFixtures.fullAccessText }); + + // Assert + customerLoginScenario.execute({ + email: dynamicFixtures.receiverCustomer.email, + password: staticFixtures.defaultPassword, + }); + + multiCartPage.visit(); + multiCartPage.getCartRow(cartName).should('contain.text', staticFixtures.fullAccessText); + + multiCartPage.selectCart({ name: cartName }); + cartPage.visit(); + // contains() rather than contain.text: the B2B themes break the line between the label and the + // merchant link, which only contains() reads as one space. + cartPage + .getProductCartItems() + .contains(`${staticFixtures.soldByText} ${dynamicFixtures.merchant.name}`) + .should('exist'); + + // Full access is only real if the colleague can order the cart, not merely look at it. + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.receiverAddress.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + isMultiShipment: Cypress.env('ENV_IS_SSP_ENABLED') ? true : false, + }); + + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage + .getOrderDetailTableBlock() + .contains(`${staticFixtures.soldByText} ${dynamicFixtures.merchant.name}`) + .should('exist'); + }); + + it('given a cart shared by external link when an anonymous visitor opens it then the cart is shown as a read-only preview', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.ownerCustomer.email, + password: staticFixtures.defaultPassword, + }); + multiCartPage.visit(); + multiCartPage.selectCart({ name: dynamicFixtures.linkSharedQuote.name }); + cartPage.visit(); + + // Act + cartPage.getExternalCartShareLink().then((externalCartShareLink: string) => { + // The point of the external link is that it works for someone who is not signed in. + customerLogoutScenario.execute(); + cy.visit(externalCartShareLink); + + // Assert + cartPage.assertBodyContainsText( + `${staticFixtures.cartPreviewTitlePrefix} ${dynamicFixtures.linkSharedQuote.name}` + ); + cartPage.assertBodyContainsText(dynamicFixtures.product.sku); + }); + }); + } +); diff --git a/cypress/e2e/yves/catalog/catalog-filters.cy.ts b/cypress/e2e/yves/catalog/catalog-filters.cy.ts new file mode 100644 index 000000000..945e2cbab --- /dev/null +++ b/cypress/e2e/yves/catalog/catalog-filters.cy.ts @@ -0,0 +1,140 @@ +import { container } from '@utils'; +import { CatalogFiltersDynamicFixtures, CatalogFiltersStaticFixtures } from '@interfaces/yves'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { retryableBefore } from '../../../support/e2e'; + +describe('catalog filters', { tags: ['@yves', 'catalog', 'search', 'prices', 'spryker-core'] }, (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: CatalogFiltersStaticFixtures; + let dynamicFixtures: CatalogFiltersDynamicFixtures; + + retryableBefore((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + // The B2B shops hide the catalog and its prices from guests, so every shop browses as a customer. + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + }); + + // Counts and prices are read back and compared rather than pinned to a number: the catalog is + // shared demo data, so any product added anywhere in the suite would invalidate a fixed total. + describe('on a search result', (): void => { + beforeEach((): void => { + catalogPage.visit(); + catalogPage.searchForProducts({ query: staticFixtures.searchTerm }); + }); + + it('given a search result when an attribute facet is applied then the catalog narrows to fewer products without emptying', (): void => { + // Arrange + let unfilteredCount = 0; + catalogPage.getFoundItemsCount().then((count: number) => { + unfilteredCount = count; + }); + + // Act + catalogPage.applyFilterValue({ + filterName: staticFixtures.attributeFilter.name, + filterValue: staticFixtures.attributeFilter.value, + }); + + // Assert + catalogPage.getFoundItemsCount().should((filteredCount: number) => { + expect(filteredCount).to.be.greaterThan(0); + expect(filteredCount).to.be.lessThan(unfilteredCount); + }); + }); + + it('given a search result when it is sorted by price ascending and then descending then the leading product goes from cheapest to dearest', (): void => { + // Arrange + let cheapestPrice = 0; + catalogPage.sortBy({ sortLabel: staticFixtures.ascendingPriceSortLabel }); + catalogPage.getFirstProductItemDefaultPriceAmount().then((price: number) => { + cheapestPrice = price; + }); + + // Act + catalogPage.sortBy({ sortLabel: staticFixtures.descendingPriceSortLabel }); + + // Assert + catalogPage.getFirstProductItemDefaultPriceAmount().should((dearestPrice: number) => { + expect(dearestPrice).to.be.greaterThan(cheapestPrice); + }); + }); + + it('given a search result when its facets are read then the catalog offers every filter it is configured with', (): void => { + // Act + const filterTitles = catalogPage.getFilterTitles(); + + // Assert + filterTitles.invoke('text').should((titles: string) => { + staticFixtures.filterTitles.forEach((title) => expect(titles).to.contain(title)); + }); + }); + + it('given a search result spanning more than one page when the second page is opened then it lists other products than the first', (): void => { + // Arrange + let firstPageLeadingProduct = ''; + catalogPage.getFirstProductItemText().then((text: string) => { + firstPageLeadingProduct = text; + }); + + // Act + catalogPage.openCatalogPage({ pageNumber: 2 }); + + // Assert + // The url is asserted first so the leading product is read from the page that was navigated to + // rather than from the one still on screen. + cy.url().should('include', 'page=2'); + catalogPage.getFirstProductItemText().should((text: string) => { + expect(text).to.not.equal(firstPageLeadingProduct); + }); + }); + }); + + describe('merchant filter', { tags: ['@marketplace-merchant', 'marketplace-merchant', 'merchant'] }, (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchants exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + before((): void => { + // The fixture products reach the catalog only once it has been rebuilt. A tree-wide publish + // times the gateway out, so this stays narrowed to the catalog. + cy.runCliCommands([ + 'console publish:trigger-events -r product_abstract', + 'console queue:worker:start --stop-when-empty', + ]); + }); + + it("given two merchants offering a product of the same name when the merchant facet is applied then only that merchant's product is listed", (): void => { + // Arrange + // Both fixture products carry the same name, so the query returns both of them alongside the + // catalog's own matches, and the merchant facet is what narrows the list. + catalogPage.visit(); + catalogPage.searchForProducts({ query: dynamicFixtures.localizedAttribute.name }); + catalogPage.getProductItemBlocks().should('have.length.at.least', 2); + + // Act + catalogPage.applyFilterValue({ + filterName: staticFixtures.merchantFilterName, + filterValue: dynamicFixtures.merchant2.name, + }); + + // Assert + // Only the second merchant's product carries that merchant, so the facet leaves exactly it. + catalogPage.getProductItemBlocks().should('have.length', 1); + + catalogPage.openFirstProductDetailPageFromResults(); + productPage.getSoldByProductOffers().should('contain.text', dynamicFixtures.merchant2.name); + }); + }); +}); diff --git a/cypress/e2e/yves/catalog/product-restrictions.cy.ts b/cypress/e2e/yves/catalog/product-restrictions.cy.ts new file mode 100644 index 000000000..fdbb3c7c0 --- /dev/null +++ b/cypress/e2e/yves/catalog/product-restrictions.cy.ts @@ -0,0 +1,97 @@ +import { container } from '@utils'; +import { ProductRestrictionsDynamicFixtures, ProductRestrictionsStaticFixtures } from '@interfaces/yves'; +import { CatalogPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'product restrictions', + { + tags: ['@yves', 'product-lists', 'product-customer-restrictions', 'catalog', 'search', 'spryker-core'], + }, + (): void => { + // The product lists are scoped to merchant relationships of the suite's demo data. + if (Cypress.env('repositoryId') !== 'suite') { + it.skip('skipped because tests run only for suite', () => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ProductRestrictionsStaticFixtures; + let dynamicFixtures: ProductRestrictionsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a whitelist scoped to a customer merchant relationship when that customer searches then only the whitelisted product is offered', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.whitelistedCustomer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + catalogPage.visit(); + catalogPage.searchSuggestionsFor({ query: dynamicFixtures.allowedProduct.sku }); + + // Assert + catalogPage.getSuggestedProducts().should('exist'); + + // Act + catalogPage.searchSuggestionsFor({ query: dynamicFixtures.hiddenProduct.sku }); + + // Assert + // A whitelist narrows the catalog to what it lists, so a product it does not name is not + // offered to this customer at all. + catalogPage.getSuggestedProducts().should('not.exist'); + }); + + it('given a blacklist scoped to a customer merchant relationship when that customer searches then every product but the blacklisted one is offered', (): void => { + // Arrange + customerLoginScenario.execute({ + email: staticFixtures.blacklistedCustomer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + catalogPage.visit(); + catalogPage.searchSuggestionsFor({ query: dynamicFixtures.allowedProduct.sku }); + + // Assert + // A blacklist only takes away what it lists, so a product it does not name stays offered. + catalogPage.getSuggestedProducts().should('exist'); + + // Act + catalogPage.searchSuggestionsFor({ query: dynamicFixtures.hiddenProduct.sku }); + + // Assert + catalogPage.getSuggestedProducts().should('not.exist'); + }); + + it('given a customer outside both merchant relationships when the same products are searched then both are offered', (): void => { + // Arrange + customerLoginScenario.execute({ + email: staticFixtures.unrestrictedCustomer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + catalogPage.visit(); + catalogPage.searchSuggestionsFor({ query: dynamicFixtures.allowedProduct.sku }); + + // Assert + catalogPage.getSuggestedProducts().should('exist'); + + // Act + catalogPage.searchSuggestionsFor({ query: dynamicFixtures.hiddenProduct.sku }); + + // Assert + // The lists belong to merchant relationships, so a customer outside them keeps the whole + // catalog — which is what proves the restrictions are scoped rather than global. + catalogPage.getSuggestedProducts().should('exist'); + }); + } +); diff --git a/cypress/e2e/yves/catalog/quick-add-to-cart.cy.ts b/cypress/e2e/yves/catalog/quick-add-to-cart.cy.ts new file mode 100644 index 000000000..1cf34c1f8 --- /dev/null +++ b/cypress/e2e/yves/catalog/quick-add-to-cart.cy.ts @@ -0,0 +1,80 @@ +import { container } from '@utils'; +import { QuickAddToCartDynamicFixtures, QuickAddToCartStaticFixtures } from '@interfaces/yves'; +import { CartPage, CatalogPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { retryableBefore } from '../../../support/e2e'; + +describe( + 'quick add to cart', + { tags: ['@yves', 'catalog', 'search', 'cart', 'quick-add-to-cart', 'product-groups', 'spryker-core'] }, + (): void => { + // Both marketplace themes empty the product card's add to cart block, in grid and list view alike, so their + // catalogs offer no quick add; only the non-marketplace lane of the B2B marketplace restores it. + if (['b2b-mp', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the marketplace catalog has no quick add to cart', () => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const cartPage = container.get(CartPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: QuickAddToCartStaticFixtures; + let dynamicFixtures: QuickAddToCartDynamicFixtures; + + retryableBefore((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + }); + + it('given a buyable product in the catalog when it is quick added from its card then it lands in the cart', (): void => { + // Arrange + catalogPage.visit(); + catalogPage.searchForProducts({ query: staticFixtures.buyableProduct.searchQuery }); + + // Act + catalogPage.quickAddFirstProductItemToCart(); + + // Assert + cartPage.visit(); + cartPage.getProductCartItems().should('contain.text', staticFixtures.buyableProduct.cartEntry); + }); + + it('given an unbuyable product in the catalog when its card is read then no usable add to cart is offered', (): void => { + // Arrange + catalogPage.visit(); + + // Act + catalogPage.searchForProducts({ query: staticFixtures.unbuyableProduct.searchQuery }); + + // Assert + // The card still renders the button, only disabled, so the absence of an *enabled* one is what + // says the product cannot be bought from the catalog. + catalogPage.getFirstProductItemEnabledAddToCartButton().should('not.exist'); + }); + + it('given a product card offering its group siblings by colour when a sibling colour is picked and quick added then the sibling is what lands in the cart', (): void => { + // Arrange + catalogPage.visit(); + catalogPage.searchForProducts({ query: staticFixtures.productGroup.searchQuery }); + + // Act + catalogPage.selectFirstProductItemColor({ swatchIdentifier: staticFixtures.productGroup.swatchIdentifier }); + catalogPage.quickAddFirstProductItemToCart(); + + // Assert + cartPage.visit(); + cartPage.getProductCartItems().should('contain.text', staticFixtures.productGroup.cartEntry); + }); + } +); diff --git a/cypress/e2e/yves/checkout/cart-approval-process.cy.ts b/cypress/e2e/yves/checkout/cart-approval-process.cy.ts new file mode 100644 index 000000000..3c0aed6ac --- /dev/null +++ b/cypress/e2e/yves/checkout/cart-approval-process.cy.ts @@ -0,0 +1,112 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { CartApprovalProcessDynamicFixtures, CartApprovalProcessStaticFixtures } from '@interfaces/yves'; +import { + CartPage, + CheckoutAddressPage, + MultiCartPage, + CheckoutPaymentPage, + CheckoutShipmentPage, + CheckoutSummaryPage, + OrderPage, +} from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'cart approval process', + { tags: ['@yves', '@checkout', 'checkout', 'cart', 'company-account', 'quote-approval', 'spryker-core'] }, + (): void => { + // The approval process belongs to company accounts, which the B2C storefronts do not have. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no company accounts', () => {}); + + return; + } + + const cartPage = container.get(CartPage); + const multiCartPage = container.get(MultiCartPage); + const checkoutAddressPage = container.get(CheckoutAddressPage); + const checkoutShipmentPage = container.get(CheckoutShipmentPage); + const checkoutPaymentPage = container.get(CheckoutPaymentPage); + const checkoutSummaryPage = container.get(CheckoutSummaryPage); + const orderPage = container.get(OrderPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: CartApprovalProcessStaticFixtures; + let dynamicFixtures: CartApprovalProcessDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a cart above the buyer spend limit when the approver approves the request then the buyer can place the order', (): void => { + // Arrange + // withoutSession, because this journey deliberately switches between two customers and a + // restored session snapshot would carry the previous one's cart and permissions. + customerLoginScenario.execute({ + email: dynamicFixtures.buyer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + resetSession: true, + }); + // Both customers accumulate carts across runs, and a cart waiting for approval is shared + // rather than made active, so every leg has to pick this run's cart out of the list first. + multiCartPage.visit(); + multiCartPage.selectCart({ name: dynamicFixtures.quote.name }); + cartPage.visit(); + cartPage.startCheckout(); + checkoutAddressPage.fillShippingAddress({ idCustomerAddress: dynamicFixtures.buyerAddress.id_customer_address }); + checkoutShipmentPage.setStandardShippingMethod(); + checkoutPaymentPage.setPaymentMethod(getPaymentMethodBasedOnEnv()); + + // Act + // The buyer's place-order permission is capped below the cart total, so the summary step + // offers an approval request instead of letting the order through. + checkoutSummaryPage.requestApproval(dynamicFixtures.approverCompanyUser.id_company_user); + + // Assert + checkoutSummaryPage.getApprovalStatus().should('contain', staticFixtures.waitingStatus); + checkoutSummaryPage.getCancelApprovalRequestButton().should('exist'); + + // Act + // A cart waiting for approval is shared with the approver, but it is not their active cart: + // it has to be picked out of the shared list first, or the approver checks out an empty one. + customerLoginScenario.execute({ + email: dynamicFixtures.approver.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + resetSession: true, + }); + multiCartPage.visit(); + multiCartPage.selectCart({ name: dynamicFixtures.quote.name }); + cartPage.visit(); + // The cart is locked while it waits, which is what the reset-lock form on it marks. + cartPage.getLockedCartResetForm().should('exist'); + // The B2B themes render the approval actions only on the checkout summary, which the buyer's + // address, shipment and payment already lead straight to. + cartPage.startCheckout(); + checkoutSummaryPage.approve(); + + // Assert + checkoutSummaryPage.getApprovalStatus().should('contain', staticFixtures.approvedStatus); + + // Act + customerLoginScenario.execute({ + email: dynamicFixtures.buyer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + resetSession: true, + }); + multiCartPage.visit(); + multiCartPage.selectCart({ name: dynamicFixtures.quote.name }); + cartPage.visit(); + cartPage.startCheckout(); + checkoutSummaryPage.placeOrder(); + + // Assert + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + orderPage.visit(); + orderPage.getOrderHistoryRow(orderReference).should('exist'); + }); + }); + } +); diff --git a/cypress/e2e/yves/checkout/checkout-authentication.cy.ts b/cypress/e2e/yves/checkout/checkout-authentication.cy.ts new file mode 100644 index 000000000..c0aba02c8 --- /dev/null +++ b/cypress/e2e/yves/checkout/checkout-authentication.cy.ts @@ -0,0 +1,106 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { CheckoutAuthenticationDynamicFixtures, CheckoutAuthenticationStaticFixtures } from '@interfaces/yves'; +import { CartPage, CheckoutCustomerPage, CheckoutSummaryPage, CustomerProfilePage, OrderPage } from '@pages/yves'; +import { CheckoutScenario, ProductAddToCartScenario } from '@scenarios/yves'; + +describe( + 'checkout authentication', + { tags: ['@yves', '@checkout', 'checkout', 'cart', 'customer-account-management', 'spryker-core'] }, + (): void => { + // Both journeys start as a guest at the customer step, which the B2B storefronts do not offer. + if (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2B storefronts have no guest checkout entry point', () => {}); + + return; + } + + const cartPage = container.get(CartPage); + const checkoutCustomerPage = container.get(CheckoutCustomerPage); + const checkoutSummaryPage = container.get(CheckoutSummaryPage); + const orderPage = container.get(OrderPage); + const customerProfilePage = container.get(CustomerProfilePage); + const checkoutScenario = container.get(CheckoutScenario); + const productAddToCartScenario = container.get(ProductAddToCartScenario); + + let staticFixtures: CheckoutAuthenticationStaticFixtures; + let dynamicFixtures: CheckoutAuthenticationDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + cy.resetYvesCookies(); + }); + + it('given a guest cart when the customer logs in at the checkout customer step then the order is placed on that account', (): void => { + // Arrange + productAddToCartScenario.execute({ sku: dynamicFixtures.product1.sku }); + cartPage.visit(); + cartPage.startCheckout(); + + // Act + checkoutCustomerPage.loginDuringCheckout({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + // execute() re-enters checkout from the cart; now that the customer is authenticated that + // lands on the address step rather than the customer step. + checkoutScenario.execute({ + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + orderPage.visit(); + orderPage.getOrderHistoryRow(orderReference).should('exist'); + }); + }); + + it('given a guest cart when the customer registers at the checkout customer step then the account is created and the order is placed on it', (): void => { + // Arrange + // Generated inside the test, never at module scope: a retry must not reuse a taken email. + const registration = { + salutation: staticFixtures.salutation, + firstName: 'Cypress', + lastName: 'Registrant', + email: `cypress.registrant.${Date.now()}@spryker.local`, + password: staticFixtures.registrationPassword, + }; + + productAddToCartScenario.execute({ sku: dynamicFixtures.product1.sku }); + cartPage.visit(); + cartPage.startCheckout(); + + // Act + checkoutCustomerPage.registerDuringCheckout(registration); + + // Double opt-in is enabled on this project, so a fresh account cannot authenticate until it + // is confirmed. The source read the registration key out of the database and posted it to + // Glue; the dynamic-fixture helper does the same thing through a supported entry point. + cy.confirmCustomerByEmail(registration.email); + checkoutCustomerPage.loginDuringCheckout({ + email: registration.email, + password: registration.password, + }); + + // execute() re-enters checkout from the cart; now that the customer is authenticated that + // lands on the address step rather than the customer step. + checkoutScenario.execute({ + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + orderPage.visit(); + orderPage.getOrderHistoryRow(orderReference).should('exist'); + }); + + customerProfilePage.visit(); + customerProfilePage.getFirstNameInput().should('have.value', registration.firstName); + customerProfilePage.getLastNameInput().should('have.value', registration.lastName); + customerProfilePage.getEmailInput().should('have.value', registration.email); + }); + } +); diff --git a/cypress/e2e/yves/checkout/click-and-collect.cy.ts b/cypress/e2e/yves/checkout/click-and-collect.cy.ts new file mode 100644 index 000000000..88f02bf7a --- /dev/null +++ b/cypress/e2e/yves/checkout/click-and-collect.cy.ts @@ -0,0 +1,116 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { ClickAndCollectDynamicFixtures, ClickAndCollectStaticFixtures } from '@interfaces/yves'; +import { + CartPage, + CheckoutAddressPage, + CheckoutPaymentPage, + CheckoutShipmentPage, + CheckoutSummaryPage, + CustomerOverviewPage, +} from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'click and collect', + { + tags: [ + '@yves', + '@checkout', + 'checkout', + 'cart', + 'marketplace-product-offer', + 'product-offer-shipment', + 'spryker-core', + ], + }, + (): void => { + // Only the suite picks the shipment type and service point on the address step. The marketplace + // B2B shop hides the shipment type choices there and takes them from the product page instead; + // the other shops have no service point finder at all. + if (!['suite'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because only suite chooses the pickup service point on the address step', () => {}); + + return; + } + + const cartPage = container.get(CartPage); + const checkoutAddressPage = container.get(CheckoutAddressPage); + const checkoutShipmentPage = container.get(CheckoutShipmentPage); + const checkoutPaymentPage = container.get(CheckoutPaymentPage); + const checkoutSummaryPage = container.get(CheckoutSummaryPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: ClickAndCollectStaticFixtures; + let dynamicFixtures: ClickAndCollectDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + // This drives the checkout steps itself rather than going through CheckoutScenario, so it + // repeats that scenario's recurring-order stub: without it the summary form is re-rendered + // and submit stays disabled. + cy.intercept('POST', '**/recurring-order/clear', { statusCode: 200, body: '' }); + }); + + it('given an offer collected at a service point when the order is placed then it ships to the service point as a single pickup shipment', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.assertBodyContainsText(dynamicFixtures.product1.sku); + + // Act + // A single-item cart gets the single-shipment address form, not the multi-shipment one, so + // the shipment type and the service point are chosen directly on it. + cartPage.startCheckout(); + + checkoutAddressPage.selectPickupAtServicePoint({ + shipmentTypeKey: staticFixtures.pickupShipmentTypeKey, + servicePointName: dynamicFixtures.servicePoint.name, + }); + // Pickup does not offer billing-same-as-shipping - there is no shipping address to + // mirror, the goods go to the store - so a billing address has to be entered. + checkoutAddressPage.typeBillingAddress(staticFixtures.billingAddress); + checkoutAddressPage.submitAddressStep(); + + // A pickup group is offered only the shipment methods of the pickup shipment type, and the + // fixture brings its own so that every shop has one to choose. + checkoutShipmentPage.setShippingMethod(dynamicFixtures.pickupShipmentMethod.name); + checkoutPaymentPage.setPaymentMethod(getPaymentMethodBasedOnEnv()); + checkoutSummaryPage.placeOrder(); + + cy.url({ timeout: 15000 }).should('not.include', '/checkout/summary'); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference); + + // Collecting at one service point is one shipment, and it ships to that point's address + // rather than to any address of the customer's. + salesDetailPage.getOrderItemTables().should('have.length', staticFixtures.expectedShipmentCount); + salesDetailPage.getShipmentDeliveryAddresses().should('contain', dynamicFixtures.servicePointAddress.address1); + salesDetailPage.getShipmentShippingMethods().should('contain', dynamicFixtures.pickupShipmentMethod.name); + }); + }); + } +); diff --git a/cypress/e2e/yves/checkout/multi-merchant-order.cy.ts b/cypress/e2e/yves/checkout/multi-merchant-order.cy.ts new file mode 100644 index 000000000..80c4f8008 --- /dev/null +++ b/cypress/e2e/yves/checkout/multi-merchant-order.cy.ts @@ -0,0 +1,86 @@ +import { container, getPaymentMethodBasedOnEnv, skipWhenFeatureAbsent } from '@utils'; +import { MultiMerchantOrderDynamicFixtures, MultiMerchantOrderStaticFixtures } from '@interfaces/yves'; +import { CartPage, CheckoutSummaryPage, CustomerOverviewPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'multi merchant order', + { + tags: [ + '@yves', + '@checkout', + 'checkout', + 'cart', + 'marketplace-product-offer', + 'product-offer-shipment', + 'marketplace-order-management', + 'spryker-core', + ], + }, + (): void => { + // Product offers belong to the marketplace storefronts; the plain B2C shop has none. + if (['b2c'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefront has no product offers', () => {}); + + return; + } + + skipWhenFeatureAbsent('marketplaceStorefront', ['b2b']); + + const cartPage = container.get(CartPage); + const checkoutSummaryPage = container.get(CheckoutSummaryPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: MultiMerchantOrderStaticFixtures; + let dynamicFixtures: MultiMerchantOrderDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a cart holding the main merchant product and an offer from each of two merchants when the order is placed then it is split into one shipment per merchant', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + // The cart names the merchant behind every offer, which is what the split is derived from. + cartPage.visit(); + cartPage.assertBodyContainsText(`${staticFixtures.soldByText} ${dynamicFixtures.merchant1.name}`); + cartPage.assertBodyContainsText(`${staticFixtures.soldByText} ${dynamicFixtures.merchant2.name}`); + + // Act + // No multi-shipment selection: the split here comes from the items' merchants, not from + // per-item delivery addresses, and setStandardShippingMethod covers every group it produces. + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference); + + salesDetailPage.getOrderItemTables().should('have.length', staticFixtures.expectedShipmentCount); + }); + }); + } +); diff --git a/cypress/e2e/yves/checkout/split-delivery.cy.ts b/cypress/e2e/yves/checkout/split-delivery.cy.ts new file mode 100644 index 000000000..8e8fd4a16 --- /dev/null +++ b/cypress/e2e/yves/checkout/split-delivery.cy.ts @@ -0,0 +1,100 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { SplitDeliveryDynamicFixtures, SplitDeliveryStaticFixtures } from '@interfaces/yves'; +import { CheckoutSummaryPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario, ProductAddToCartScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe('split delivery', { tags: ['@yves', '@checkout', 'checkout', 'shipment', 'spryker-core'] }, (): void => { + const customerLoginScenario = container.get(CustomerLoginScenario); + const productAddToCartScenario = container.get(ProductAddToCartScenario); + const checkoutScenario = container.get(CheckoutScenario); + const checkoutSummaryPage = container.get(CheckoutSummaryPage); + const userLoginScenario = container.get(UserLoginScenario); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + + let staticFixtures: SplitDeliveryStaticFixtures; + let dynamicFixtures: SplitDeliveryDynamicFixtures; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + }); + + it('given a customer cart of three items when each item is given its own delivery address then the order is split into one shipment per address', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + // Each item gets its own generated delivery address, which is what splits the order. + checkoutScenario.execute({ + isMultiShipment: true, + hasOwnAddressPerItem: true, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference); + + salesDetailPage.getOrderItemTables().should('have.length', staticFixtures.expectedShipmentCount); + }); + }); + + // Guest checkout is not offered by the B2B storefronts, so the guest half of this journey can only + // run where a guest may reach the cart at all. + const guestIt = ['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? it.skip : it; + + guestIt( + 'given a guest cart of three items when each item is given its own delivery address then the order is split into one shipment per address', + (): void => { + // Arrange + // No login, and no seeded quote: a guest cart has to be built from the storefront. + productAddToCartScenario.execute({ sku: dynamicFixtures.product1.sku }); + productAddToCartScenario.execute({ sku: dynamicFixtures.product2.sku }); + productAddToCartScenario.execute({ sku: dynamicFixtures.product3.sku }); + + // Act + // fillMultiShippingAddress generates a fresh address per address item, so the three items + // are what produce three different delivery addresses. + checkoutScenario.execute({ + isGuest: true, + isMultiShipment: true, + hasOwnAddressPerItem: true, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference); + + salesDetailPage.getOrderItemTables().should('have.length', staticFixtures.expectedShipmentCount); + salesDetailPage + .getShipmentDeliveryAddresses() + .should('have.length', staticFixtures.expectedShipmentCount) + .then(($addresses: JQuery) => { + const addresses = $addresses.toArray().map((element: HTMLElement) => element.innerText.trim()); + + expect(new Set(addresses).size, 'each shipment carries its own delivery address').to.equal( + staticFixtures.expectedShipmentCount + ); + }); + }); + } + ); +}); diff --git a/cypress/e2e/yves/cms/cms-page-publish.cy.ts b/cypress/e2e/yves/cms/cms-page-publish.cy.ts new file mode 100644 index 000000000..5140a871a --- /dev/null +++ b/cypress/e2e/yves/cms/cms-page-publish.cy.ts @@ -0,0 +1,56 @@ +import { container } from '@utils'; +import { CmsPagePublishDynamicFixtures, CmsPagePublishStaticFixtures } from '@interfaces/yves'; +import { CmsContentPage } from '@pages/yves'; +import { CreateCmsPageScenario, UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'cms page publish', + { tags: ['@yves', '@cms', 'cms', 'content-item', 'spryker-cms', 'spryker-cms-gui'] }, + (): void => { + const cmsContentPage = container.get(CmsContentPage); + const userLoginScenario = container.get(UserLoginScenario); + const createCmsPageScenario = container.get(CreateCmsPageScenario); + + let staticFixtures: CmsPagePublishStaticFixtures; + let dynamicFixtures: CmsPagePublishDynamicFixtures; + + // The page name is written verbatim into every localized url field and the server rejects a + // duplicate url, so it has to be unique per run. + let cmsPageName: string; + let titlePlaceholder: string; + let contentPlaceholder: string; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + cmsPageName = `${staticFixtures.cmsPageName}-${Date.now()}`; + titlePlaceholder = `${cmsPageName} title`; + contentPlaceholder = `${cmsPageName} content`; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // Publishing alone leaves the page invisible to the storefront until the queue is drained, + // which is what shouldTriggerPublishAndSync does. + createCmsPageScenario.execute({ + cmsPageName: cmsPageName, + placeholders: { title: titlePlaceholder, content: contentPlaceholder }, + shouldTriggerPublishAndSync: true, + }); + }); + + it('should render a published cms page with its title and content under its localized storefront url', (): void => { + // Arrange + const locale = staticFixtures.defaultLocaleName.split('_')[0]; + + // Act + cmsContentPage.visitCmsPage({ locale: locale, cmsPageName: cmsPageName }); + + // Assert + cy.url().should('include', `/${locale}/${cmsPageName}`); + cmsContentPage.assertBodyContainsText(titlePlaceholder).should('exist'); + cmsContentPage.assertBodyContainsText(contentPlaceholder).should('exist'); + }); + } +); diff --git a/cypress/e2e/yves/cms/multistore-cms-page.cy.ts b/cypress/e2e/yves/cms/multistore-cms-page.cy.ts new file mode 100644 index 000000000..955435323 --- /dev/null +++ b/cypress/e2e/yves/cms/multistore-cms-page.cy.ts @@ -0,0 +1,83 @@ +import { container } from '@utils'; +import { CmsContentPage } from '@pages/yves'; +import { CmsPageUpdatePage } from '@pages/backoffice'; +import { MultistoreCmsPageDynamicFixtures, MultistoreCmsPageStaticFixtures } from '@interfaces/yves'; +import { CreateCmsPageScenario, UserLoginScenario } from '@scenarios/backoffice'; +import { SelectStoreScenario, WaitForStorefrontUrlScenario } from '@scenarios/yves'; + +describe( + 'multistore cms page', + { tags: ['@yves', '@cms', 'cms', 'content-item', 'spryker-core', 'spryker-cms', 'spryker-cms-gui'] }, + (): void => { + const cmsContentPage = container.get(CmsContentPage); + const cmsPageUpdatePage = container.get(CmsPageUpdatePage); + const userLoginScenario = container.get(UserLoginScenario); + const createCmsPageScenario = container.get(CreateCmsPageScenario); + const selectStoreScenario = container.get(SelectStoreScenario); + const waitForStorefrontUrlScenario = container.get(WaitForStorefrontUrlScenario); + + let staticFixtures: MultistoreCmsPageStaticFixtures; + let dynamicFixtures: MultistoreCmsPageDynamicFixtures; + + let cmsPageName: string; + let cmsPageUrl: string; + let idCmsPage: string; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + // Each test needs a page of its own, so neither depends on what the other unassigned. + // The uid is generated per test, never at module scope, or a retry reuses it and the + // server rejects the duplicate localized url. + const uid = Math.random().toString(36).substring(2, 8); + cmsPageName = `${staticFixtures.cmsPageName}-${uid}`; + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // A freshly created page is assigned to every store, which is the state both tests start from. + createCmsPageScenario.execute({ cmsPageName: cmsPageName, shouldTriggerPublishAndSync: true }); + cy.url().then((viewPageUrl: string) => { + idCmsPage = new URL(viewPageUrl).searchParams.get('id-cms-page') ?? ''; + }); + + // The store switcher owns the store url prefix, so the storefront url of the page is + // only knowable at run time — reading it here keeps the spec free of a hard-coded path. + selectStoreScenario.execute(staticFixtures.storeName); + cmsContentPage + .getCmsPageUrlOnCurrentStore({ cmsPageName, localeName: staticFixtures.localeName }) + .then((url: string) => { + cmsPageUrl = url; + }); + }); + + it('given a cms page is assigned to a store when a shopper opens its url on that store then the page is served', (): void => { + // Arrange + cy.then(() => waitForStorefrontUrlScenario.execute({ url: cmsPageUrl, shouldBeServed: true })); + + // Act + cy.then(() => cmsContentPage.visitCmsPageUrl(cmsPageUrl)); + + // Assert + cmsContentPage.assertBodyContainsText(cmsPageName).should('exist'); + }); + + it('given a cms page is unassigned from a store when a shopper opens its url on that store then the page is not found', (): void => { + // Arrange + cy.then(() => waitForStorefrontUrlScenario.execute({ url: cmsPageUrl, shouldBeServed: true })); + + // Act + cy.then(() => cmsPageUpdatePage.visitPage(idCmsPage)); + cy.then(() => cmsPageUpdatePage.unassignStore(staticFixtures.storeName)); + cmsPageUpdatePage.saveAndPublish(); + cy.runQueueWorker(); + + // Assert + cy.then(() => waitForStorefrontUrlScenario.execute({ url: cmsPageUrl, shouldBeServed: false })); + }); + } +); diff --git a/cypress/e2e/yves/comments/cart-comments.cy.ts b/cypress/e2e/yves/comments/cart-comments.cy.ts index d9c268631..ef8911e78 100644 --- a/cypress/e2e/yves/comments/cart-comments.cy.ts +++ b/cypress/e2e/yves/comments/cart-comments.cy.ts @@ -1,7 +1,9 @@ -import { container } from '@utils'; +import { container, getPaymentMethodBasedOnEnv } from '@utils'; import { CartCommentsDynamicFixtures, CartCommentsStaticFixtures } from '@interfaces/yves'; -import { CommentCartPage, MultiCartPage } from '@pages/yves'; -import { CustomerLoginScenario } from '@scenarios/yves'; +import { CheckoutSummaryPage, CommentCartPage, CustomerOverviewPage, MultiCartPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario, ProductAddToCartScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; describe('cart comments', { tags: ['@yves', '@comments', 'cart', 'marketplace-cart', 'spryker-core'] }, (): void => { if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { @@ -10,7 +12,14 @@ describe('cart comments', { tags: ['@yves', '@comments', 'cart', 'marketplace-ca } const multiCartPage = container.get(MultiCartPage); const commentCartPage = container.get(CommentCartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const checkoutSummaryPage = container.get(CheckoutSummaryPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); const loginCustomerScenario = container.get(CustomerLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + const productAddToCartScenario = container.get(ProductAddToCartScenario); + const userLoginScenario = container.get(UserLoginScenario); let dynamicFixtures: CartCommentsDynamicFixtures; let staticFixtures: CartCommentsStaticFixtures; @@ -83,4 +92,44 @@ describe('cart comments', { tags: ['@yves', '@comments', 'cart', 'marketplace-ca commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist'); }); + it('given a cart carrying a comment when the order is placed then the comment is on the order in the storefront and in the back office', (): void => { + // Arrange + // The product is added to whatever cart is active rather than a named fixture cart: checkout + // consumes the cart, so a retry of this test must not depend on a cart an earlier attempt spent. + productAddToCartScenario.execute({ sku: dynamicFixtures.product1.sku }); + commentCartPage.visit(); + commentCartPage.add({ message: staticFixtures.commentToKeepThroughCheckout }); + commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentToKeepThroughCheckout).should('exist'); + + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + shouldTriggerOmsInCli: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + + // Assert + // The comment has to survive the cart-to-order copy, so it is read back on the storefront + // order details page and again in the back office, not just on the cart it was written on. + checkoutSummaryPage.getPlacedOrderReference().then((orderReference: string) => { + customerOverviewPage.viewLastPlacedOrder(); + commentCartPage + .getCommentThreadListSection() + .contains(staticFixtures.commentToKeepThroughCheckout) + .should('exist'); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference); + + salesDetailPage.getOrderComments().should('contain', staticFixtures.commentToKeepThroughCheckout); + }); + }); }); diff --git a/cypress/e2e/yves/comments/order-comments.cy.ts b/cypress/e2e/yves/comments/order-comments.cy.ts new file mode 100644 index 000000000..40e8e182b --- /dev/null +++ b/cypress/e2e/yves/comments/order-comments.cy.ts @@ -0,0 +1,79 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { OrderCommentsDynamicFixtures, OrderCommentsStaticFixtures } from '@interfaces/yves'; +import { CommentCartPage, CustomerOverviewPage, OrderDetailsPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +// Commenting on an order is a company-account journey; the B2C storefronts do not carry it, which +// is the same variant set the source test was written for. +const UNSUPPORTED_REPOSITORY_IDS = ['b2c', 'b2c-mp']; + +describe( + 'order comments', + { + tags: ['@yves', '@comments', 'order-management', 'marketplace-order-management', 'spryker-core'], + }, + (): void => { + if (UNSUPPORTED_REPOSITORY_IDS.includes(Cypress.env('repositoryId'))) { + it.skip('skipped because tests run only for suite, b2b and b2b-mp', () => {}); + + return; + } + + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + // The comment thread is one widget rendered on both the cart and the order details page, so the + // page object that drives it on the cart drives it here too. + const commentThreadPage = container.get(CommentCartPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let staticFixtures: OrderCommentsStaticFixtures; + let dynamicFixtures: OrderCommentsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a placed order when the customer comments on it in the storefront then the comment is shown there and in the back office', (): void => { + // Arrange + placeCustomerOrder(); + customerOverviewPage.viewLastPlacedOrder(); + + // Act + commentThreadPage.add({ message: staticFixtures.commentOnOrder }); + + // Assert + commentThreadPage.getCommentThreadListSection().contains(staticFixtures.commentOnOrder).should('exist'); + + orderDetailsPage.getOrderReferenceBlock().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference.trim()); + + salesDetailPage.getOrderComments().should('contain', staticFixtures.commentOnOrder); + }); + }); + + function placeCustomerOrder(): void { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }); + } + } +); diff --git a/cypress/e2e/yves/company-account/business-on-behalf.cy.ts b/cypress/e2e/yves/company-account/business-on-behalf.cy.ts new file mode 100644 index 000000000..5bfc0096a --- /dev/null +++ b/cypress/e2e/yves/company-account/business-on-behalf.cy.ts @@ -0,0 +1,63 @@ +import { container } from '@utils'; +import { CompanyUserSelectPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { BusinessOnBehalfDynamicFixtures, BusinessOnBehalfStaticFixtures } from '@interfaces/yves'; + +describe('business on behalf', { tags: ['@yves', '@company-account', 'company-account', 'spryker-core'] }, (): void => { + // Acting for a business unit only exists on the company-account storefronts. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no company accounts', (): void => {}); + + return; + } + + const companyUserSelectPage = container.get(CompanyUserSelectPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let dynamicFixtures: BusinessOnBehalfDynamicFixtures; + let staticFixtures: BusinessOnBehalfStaticFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a customer attached to two business units when they use the selector then they can act for either one', (): void => { + // Arrange + // The selector labels every account as " / ". + const businessUnitAccounts = [ + { + label: `${dynamicFixtures.company.name} / ${dynamicFixtures.firstBusinessUnit.name}`, + idCompanyUser: dynamicFixtures.firstCompanyUser.id_company_user, + }, + { + label: `${dynamicFixtures.company.name} / ${dynamicFixtures.secondBusinessUnit.name}`, + idCompanyUser: dynamicFixtures.secondCompanyUser.id_company_user, + }, + ]; + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + companyUserSelectPage.visit(); + + businessUnitAccounts.forEach(({ label }): void => { + companyUserSelectPage.getBusinessUnitOptions().should('contain.text', label); + }); + + businessUnitAccounts.forEach(({ label, idCompanyUser }, index): void => { + const otherLabel = businessUnitAccounts[businessUnitAccounts.length - 1 - index].label; + + // Act + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: idCompanyUser }); + + // Assert + // Offering both in the dropdown proves nothing on its own; the storefront has to end up + // acting for the one that was picked and not for its sibling, also on the next page it renders. + companyUserSelectPage.visit(); + companyUserSelectPage.getActiveBusinessUnit().should('contain.text', label).and('not.contain.text', otherLabel); + }); + }); +}); diff --git a/cypress/e2e/yves/company-account/business-unit-address-checkout.cy.ts b/cypress/e2e/yves/company-account/business-unit-address-checkout.cy.ts new file mode 100644 index 000000000..81d62dda4 --- /dev/null +++ b/cypress/e2e/yves/company-account/business-unit-address-checkout.cy.ts @@ -0,0 +1,79 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { + BusinessUnitAddressCheckoutDynamicFixtures, + BusinessUnitAddressCheckoutStaticFixtures, +} from '@interfaces/yves'; +import { + CartPage, + CheckoutAddressPage, + CompanyUserSelectPage, + CustomerOverviewPage, + OrderDetailsPage, +} from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario, ProductAddToCartScenario } from '@scenarios/yves'; + +describe( + 'business unit address on checkout', + { tags: ['@yves', '@checkout', 'checkout', 'company-account', 'cart', 'spryker-core'] }, + (): void => { + // Only the company-account storefronts put a business unit address in the checkout select. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no company accounts', () => {}); + + return; + } + + const cartPage = container.get(CartPage); + const checkoutAddressPage = container.get(CheckoutAddressPage); + const companyUserSelectPage = container.get(CompanyUserSelectPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + const productAddToCartScenario = container.get(ProductAddToCartScenario); + + let staticFixtures: BusinessUnitAddressCheckoutStaticFixtures; + let dynamicFixtures: BusinessUnitAddressCheckoutDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a company user with no personal address when the business unit address is chosen at checkout then the order ships to it', (): void => { + // Arrange + // The customer fixture deliberately has no address of its own, so the only address the + // checkout select can offer is the one belonging to the business unit. + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + // Without an active company user the storefront shows "No selected company" and the checkout + // address select offers nothing but "Define new address" - no business unit address at all. + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: dynamicFixtures.companyUser.id_company_user }); + + productAddToCartScenario.execute({ sku: dynamicFixtures.product1.sku }); + + cartPage.visit(); + cartPage.startCheckout(); + + // Act + checkoutAddressPage.setBillingSameAsShipping(true); + checkoutAddressPage.selectShippingAddressByText(staticFixtures.businessUnitAddressStreet); + checkoutAddressPage.submitAddressStep(); + + checkoutScenario.execute({ + shouldSkipAddressStep: true, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage.assertBodyContainsText(staticFixtures.businessUnitAddressStreet); + }); + } +); diff --git a/cypress/e2e/yves/company-account/company-structure-creation.cy.ts b/cypress/e2e/yves/company-account/company-structure-creation.cy.ts new file mode 100644 index 000000000..cab8d72c7 --- /dev/null +++ b/cypress/e2e/yves/company-account/company-structure-creation.cy.ts @@ -0,0 +1,93 @@ +import { container } from '@utils'; +import { CompanyStructureCreationDynamicFixtures, CompanyStructureCreationStaticFixtures } from '@interfaces/yves'; +import { CompanyBusinessUnitCreatePage, CompanyUserCreatePage } from '@pages/yves'; +import { CustomerLoginScenario, ImpersonateCustomerScenario } from '@scenarios/yves'; + +describe( + 'company structure creation', + { + tags: [ + '@yves', + '@company-account', + 'company-account', + 'customer-account-management', + 'spryker-core', + 'agent-assist', + 'acl', + ], + }, + (): void => { + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because company accounts exist only in suite, b2b and b2b-mp', () => {}); + return; + } + + const customerLoginScenario = container.get(CustomerLoginScenario); + const impersonateCustomerScenario = container.get(ImpersonateCustomerScenario); + const companyBusinessUnitCreatePage = container.get(CompanyBusinessUnitCreatePage); + const companyUserCreatePage = container.get(CompanyUserCreatePage); + + let staticFixtures: CompanyStructureCreationStaticFixtures; + let dynamicFixtures: CompanyStructureCreationDynamicFixtures; + + let businessUnitName: string; + let newCompanyUserEmail: string; + + before((): void => { + ({ dynamicFixtures, staticFixtures } = Cypress.env()); + + const unique = Date.now(); + businessUnitName = `BusinessUnit${unique}`; + newCompanyUserEmail = `company.user.${unique}@spryker.local`; + }); + + it('company administrator should be able to create a business unit and a company user in it', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.adminCustomer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + companyBusinessUnitCreatePage.visit(); + companyBusinessUnitCreatePage.create({ + name: businessUnitName, + email: `business.unit.${businessUnitName}@spryker.local`, + }); + + companyUserCreatePage.visit(); + companyUserCreatePage.create({ + businessUnitName: businessUnitName, + roleName: staticFixtures.restrictedRoleName, + email: newCompanyUserEmail, + firstName: 'Company', + lastName: 'User', + }); + + // Assert + companyUserCreatePage.getUserRow(businessUnitName).should('contain.text', staticFixtures.restrictedRoleName); + }); + + it('created company user should reach only what its role allows', (): void => { + // Arrange + // Nothing knows the new company user's password, so the agent switches into their session. + impersonateCustomerScenario.execute({ + agentUsername: dynamicFixtures.agentUser.username, + agentPassword: staticFixtures.defaultPassword, + customerEmail: newCompanyUserEmail, + }); + + // Act + cy.visit(staticFixtures.companyUserPagePath, { failOnStatusCode: false }); + + // Assert + cy.url().should('include', staticFixtures.companyUserPagePath); + + // Act + cy.visit(staticFixtures.companyRolePagePath, { failOnStatusCode: false }); + + // Assert + cy.url().should('include', '403'); + }); + } +); diff --git a/cypress/e2e/yves/customer-account-management/customer-address-management.cy.ts b/cypress/e2e/yves/customer-account-management/customer-address-management.cy.ts index 94c9c9676..d8257bb5d 100644 --- a/cypress/e2e/yves/customer-account-management/customer-address-management.cy.ts +++ b/cypress/e2e/yves/customer-account-management/customer-address-management.cy.ts @@ -40,5 +40,27 @@ describe( cy.url().should('include', '/customer/address/new'); }); + + it('customer should be able to delete an address', (): void => { + // Arrange + // A street unique to this run, so that asserting the address is gone cannot match another + // address left behind by an earlier test in this file. + const street = `${staticFixtures.newAddress.address1} ${Date.now()}`; + const address = { ...staticFixtures.newAddress, address1: street }; + + customerAddressPage.visitNewAddressPage(); + customerAddressPage.fillAndSubmitNewAddress(address); + customerAddressPage.getAddressAddedMessage().should('be.visible'); + + customerAddressPage.visit(); + customerAddressPage.getAddressListEntry(street).should('exist'); + + // Act + customerAddressPage.deleteAddress(street); + + // Assert + customerAddressPage.visit(); + customerAddressPage.getBody().should('not.contain.text', street); + }); } ); diff --git a/cypress/e2e/yves/customer-account-management/customer-overview.cy.ts b/cypress/e2e/yves/customer-account-management/customer-overview.cy.ts index af1628668..1aea1e457 100644 --- a/cypress/e2e/yves/customer-account-management/customer-overview.cy.ts +++ b/cypress/e2e/yves/customer-account-management/customer-overview.cy.ts @@ -1,6 +1,6 @@ import { container } from '@utils'; import { CustomerLoginScenario } from '@scenarios/yves'; -import { CustomerOverviewPage } from '@pages/yves'; +import { CustomerOverviewPage, ReturnListPage } from '@pages/yves'; import { CustomerOverviewDynamicFixtures, CustomerOverviewStaticFixtures } from '@interfaces/yves'; describe( @@ -11,6 +11,7 @@ describe( (): void => { const customerLoginScenario = container.get(CustomerLoginScenario); const customerOverviewPage = container.get(CustomerOverviewPage); + const returnListPage = container.get(ReturnListPage); let dynamicFixtures: CustomerOverviewDynamicFixtures; let staticFixtures: CustomerOverviewStaticFixtures; @@ -71,5 +72,13 @@ describe( cy.url().should('include', '/customer/newsletter'); }); + + it('customer should be able to open the returns page', (): void => { + // Act + returnListPage.visit(); + + // Assert + returnListPage.assertPageLocation(); + }); } ); diff --git a/cypress/e2e/yves/discount/discounts-and-promotions.cy.ts b/cypress/e2e/yves/discount/discounts-and-promotions.cy.ts new file mode 100644 index 000000000..45c579e9f --- /dev/null +++ b/cypress/e2e/yves/discount/discounts-and-promotions.cy.ts @@ -0,0 +1,67 @@ +import { container } from '@utils'; +import { DiscountsAndPromotionsDynamicFixtures, DiscountsAndPromotionsStaticFixtures } from '@interfaces/yves'; +import { CartPage, CustomerOverviewPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'discounts and promotions', + { + tags: ['@yves', '@discount', 'discount', 'promotions-discounts', 'cart', 'checkout', 'spryker-discount'], + }, + (): void => { + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: DiscountsAndPromotionsStaticFixtures; + let dynamicFixtures: DiscountsAndPromotionsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a cart rule, a voucher and a promotional product discount when both codes are redeemed and the promotional product is added then all three are applied and the order is placed', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + cartPage.visit(); + + // Assert + // A cart rule needs no redeeming: it collects on its own as soon as the cart qualifies. + cartPage.getCartDiscountSummary().should('contain', dynamicFixtures.cartRuleDiscount.display_name); + + // Act + cartPage.applyVoucherCode(dynamicFixtures.voucherCode.code); + + // Assert + cartPage.getCartDiscountSummary().should('contain', dynamicFixtures.voucherDiscount.display_name); + + // Act + // The promotion is redeemed by a code of its own, so it is offered to this cart only and never + // to a cart of another run carrying the same fixture product brand. + cartPage.applyVoucherCode(dynamicFixtures.promotionVoucherCode.code); + cartPage.addPromotionalProduct(dynamicFixtures.promotionalProduct.sku); + + // Assert + cartPage.getCartDiscountSummary().should('contain', dynamicFixtures.promotionDiscount.display_name); + cartPage.getCartItems({ sku: dynamicFixtures.promotionalProduct.sku }).should('have.length', 1); + + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: staticFixtures.paymentMethod, + shouldTriggerOmsInCli: true, + }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + }); + } +); diff --git a/cypress/e2e/yves/merchandising/product-relations.cy.ts b/cypress/e2e/yves/merchandising/product-relations.cy.ts new file mode 100644 index 000000000..a2464eb11 --- /dev/null +++ b/cypress/e2e/yves/merchandising/product-relations.cy.ts @@ -0,0 +1,45 @@ +import { container } from '@utils'; +import { ProductRelationsDynamicFixtures, ProductRelationsStaticFixtures } from '@interfaces/yves'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'product relations', + { tags: ['@yves', '@merchandising', 'product-relations', 'product', 'spryker-core'] }, + (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ProductRelationsStaticFixtures; + let dynamicFixtures: ProductRelationsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + // The up-selling half of the source journey stays where it already lives, in + // cart-up-selling-products.cy.ts; this spec carries the product detail page half. + it('given one product carries a related-products relation and another carries none when both detail pages are opened then only the first shows the related products carousel', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.productWithRelatedProduct.sku }); + + // Assert + productPage.getRelatedProductsCarousel().should('be.visible'); + + // Act + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.productWithoutRelatedProduct.sku }); + + // Assert + productPage.getRelatedProductsSection().should('not.exist'); + }); + } +); diff --git a/cypress/e2e/yves/merchandising/product-sets.cy.ts b/cypress/e2e/yves/merchandising/product-sets.cy.ts new file mode 100644 index 000000000..4581a0229 --- /dev/null +++ b/cypress/e2e/yves/merchandising/product-sets.cy.ts @@ -0,0 +1,76 @@ +import { container } from '@utils'; +import { ProductSetsDynamicFixtures, ProductSetsStaticFixtures } from '@interfaces/yves'; +import { CartPage, ProductSetsPage } from '@pages/yves'; +import { ProductSetCreatePage } from '@pages/backoffice'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'product sets', + { tags: ['@yves', '@merchandising', 'product-sets', 'product', 'cart', 'spryker-core'] }, + (): void => { + const cartPage = container.get(CartPage); + const productSetsPage = container.get(ProductSetsPage); + const productSetCreatePage = container.get(ProductSetCreatePage); + const userLoginScenario = container.get(UserLoginScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ProductSetsStaticFixtures; + let dynamicFixtures: ProductSetsDynamicFixtures; + + // The run marker keeps the set unique per run, so the overview lists exactly the set this run built. + const runMarker = Cypress._.uniqueId(`${Date.now()}`); + const productSetName = `Product Set ${runMarker}`; + + // The set is built through the Back Office because haveProductSet is not reachable from the + // dynamic-fixtures endpoint; building it is not what this spec tests. + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + productSetCreatePage.create({ + name: productSetName, + urlKey: `product-set-${runMarker}`, + setKey: `product-set-key-${runMarker}`, + productAbstractSkus: [dynamicFixtures.variantProduct.abstract_sku, dynamicFixtures.simpleProduct.abstract_sku], + }); + }); + + it('given a product set holding a variant product and a simple one when the set is opened from the overview and the variant is picked then the whole set reaches the cart with the picked variant', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + productSetsPage.waitUntilProductSetIsListed(productSetName); + productSetsPage.openProductSet(productSetName); + + // Assert + productSetsPage.getProductSetProductItems().should('have.length', 2); + productSetsPage + .getProductSetDetails() + .should('contain', dynamicFixtures.variantProduct.localized_attributes[0].name); + productSetsPage + .getProductSetDetails() + .should('contain', dynamicFixtures.simpleProduct.localized_attributes[0].name); + + // Act + productSetsPage.selectProductVariant({ + productName: dynamicFixtures.variantProduct.localized_attributes[0].name, + attributeKey: staticFixtures.variantAttributeKey, + attributeValue: staticFixtures.variantAttributeValue, + }); + productSetsPage.addAllProductsToCart(); + cartPage.visit(); + + // Assert + cartPage.findCartItem({ sku: dynamicFixtures.secondVariantProduct.sku }).should('exist'); + cartPage.findCartItem({ sku: dynamicFixtures.simpleProduct.sku }).should('exist'); + }); + } +); 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 facdcc32b..75968cc47 100644 --- a/cypress/e2e/yves/order-amendment/order-amendment-start.cy.ts +++ b/cypress/e2e/yves/order-amendment/order-amendment-start.cy.ts @@ -243,8 +243,9 @@ describe( // button (it is gated on `product.available` and `idProductConcrete`), so clicking it // times out intermittently under CI load. Reload the product page until the button is // published before interacting with it — same publish-wait approach as CatalogPage.search. + // Only the visible button counts: the B2C mini cart's hidden remove buttons carry the same data-qa. cy.url().then((productUrl) => { - cy.reloadUntilFound(productUrl, '[data-qa="add-to-cart-button"]', 'body', 20, 3000); + cy.reloadUntilFound(productUrl, '[data-qa="add-to-cart-button"]:visible', 'body', 20, 3000); }); productPage.addToCart({ quantity: quantity ?? 1 }); diff --git a/cypress/e2e/yves/order-management/order-cancellation.cy.ts b/cypress/e2e/yves/order-management/order-cancellation.cy.ts new file mode 100644 index 000000000..071adf027 --- /dev/null +++ b/cypress/e2e/yves/order-management/order-cancellation.cy.ts @@ -0,0 +1,106 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { OrderCancellationDynamicFixtures, OrderCancellationStaticFixtures } from '@interfaces/yves'; +import { CustomerOverviewPage, OrderDetailsPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +const ORDER_CANCELLED_MESSAGE = 'Order was canceled successfully.'; + +const CANCELLED_ITEM_STATE = 'Canceled'; + +// The back office labels an item's manual events with ucfirst() of the event name. +const CANCEL_ITEM_EVENT = 'Cancel'; + +describe( + 'order cancellation', + { + tags: [ + '@yves', + '@order-management', + 'order-management', + 'marketplace-order-management', + 'state-machine', + 'spryker-core-back-office', + 'spryker-core', + 'cart', + 'checkout', + ], + }, + (): void => { + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: OrderCancellationStaticFixtures; + let dynamicFixtures: OrderCancellationDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given every item of an order is cancellable when the customer cancels it then the order is cancelled', (): void => { + // Arrange + placeCustomerOrder(dynamicFixtures.wholeOrderCustomer.email, dynamicFixtures.wholeOrderAddress); + customerOverviewPage.viewLastPlacedOrder(); + + // Act + orderDetailsPage.cancelOrder(); + + // Assert + orderDetailsPage.assertBodyContainsText(ORDER_CANCELLED_MESSAGE); + orderDetailsPage.getOrderDetailTableBlock().contains(CANCELLED_ITEM_STATE).should('exist'); + orderDetailsPage.getCancelOrderButton().should('not.exist'); + }); + + it('given one item of an order left the cancellable states when the customer opens it then cancelling is not offered', (): void => { + // Arrange + placeCustomerOrder(dynamicFixtures.mixedStateCustomer.email, dynamicFixtures.mixedStateAddress); + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage.getCancelOrderButton().should('exist'); + + // Act + orderDetailsPage.getOrderReferenceBlock().then((orderReference: string) => { + moveOrderItemOutOfCancellableStates(orderReference.trim(), dynamicFixtures.advancedItemProduct.sku); + + customerLoginScenario.execute({ + email: dynamicFixtures.mixedStateCustomer.email, + password: staticFixtures.defaultPassword, + }); + customerOverviewPage.viewLastPlacedOrder(); + + // Assert + orderDetailsPage.getCancelOrderButton().should('not.exist'); + }); + }); + + function placeCustomerOrder(email: string, address: { id_customer_address: number }): void { + customerLoginScenario.execute({ email: email, password: staticFixtures.defaultPassword }); + + checkoutScenario.execute({ + idCustomerAddress: address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }); + } + + // Cancelling one item from the back office is the one way out of the cancellable states every + // shop's process offers: the B2B dummy process still flags a paid item cancellable. Driving it on + // one item alone is what leaves the order's other item cancellable. + function moveOrderItemOutOfCancellableStates(orderReference: string, sku: string): void { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference); + + salesDetailPage.triggerOmsForOrderItem({ sku: sku, state: CANCEL_ITEM_EVENT }); + } + } +); diff --git a/cypress/e2e/yves/product-bundle/configurable-bundle-checkout.cy.ts b/cypress/e2e/yves/product-bundle/configurable-bundle-checkout.cy.ts new file mode 100644 index 000000000..697fdb437 --- /dev/null +++ b/cypress/e2e/yves/product-bundle/configurable-bundle-checkout.cy.ts @@ -0,0 +1,70 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { ConfigurableBundleCheckoutDynamicFixtures, ConfigurableBundleCheckoutStaticFixtures } from '@interfaces/yves'; +import { CartPage, CustomerOverviewPage, OrderDetailsPage } from '@pages/yves'; +import { CheckoutScenario, ConfigureBundleScenario, CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'configurable bundle checkout', + { + tags: ['@yves', '@merchandising', 'configurable-bundle', 'product', 'cart', 'checkout', 'spryker-core'], + }, + (): void => { + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + const configureBundleScenario = container.get(ConfigureBundleScenario); + + let staticFixtures: ConfigurableBundleCheckoutStaticFixtures; + let dynamicFixtures: ConfigurableBundleCheckoutDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + // The bundle templates and the products their slots offer are demo data, and only the suite, + // b2b and b2c shops ship them - the two marketplace shops carry no clone of this journey either. + // The b2b id also runs against the marketplace B2B shop, the only one built with SSP enabled, + // whose demo data deactivates this template. + (['suite', 'b2b', 'b2c'].includes(Cypress.env('repositoryId')) && + !(Cypress.env('repositoryId') === 'b2b' && Cypress.env('ENV_IS_SSP_ENABLED')) + ? it + : it.skip)( + 'given two configurations of one bundle template when one of them is doubled in the cart and the order is placed then the order carries three bundles', + (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + configureBundleScenario.execute({ + templateName: staticFixtures.templateName, + slotSelections: staticFixtures.firstConfiguration, + }); + configureBundleScenario.execute({ + templateName: staticFixtures.templateName, + slotSelections: staticFixtures.secondConfiguration, + }); + cartPage.visit(); + cartPage.changeConfiguredBundleQuantity({ bundleName: staticFixtures.templateName, quantity: 2 }); + + // Assert + cartPage.getConfiguredBundles().should('have.length', 2); + + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.customer.addresses.addresses[0].id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }); + customerOverviewPage.viewLastPlacedOrder(); + + // Assert + orderDetailsPage.getConfiguredBundles(staticFixtures.templateName).should('have.length', 3); + } + ); + } +); diff --git a/cypress/e2e/yves/product-configurator/configurable-product-checkout.cy.ts b/cypress/e2e/yves/product-configurator/configurable-product-checkout.cy.ts new file mode 100644 index 000000000..3fe274756 --- /dev/null +++ b/cypress/e2e/yves/product-configurator/configurable-product-checkout.cy.ts @@ -0,0 +1,135 @@ +import { container, skipWhenFeatureAbsent } from '@utils'; +import { + ConfigurableProductCheckoutDynamicFixtures, + ConfigurableProductCheckoutStaticFixtures, +} from '@interfaces/yves'; +import { CartPage, CatalogPage, CustomerOverviewPage, ProductConfiguratorPage, ProductPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; + +// Option one of each group is preselected, so picking the second is what makes a saved configuration +// differ from the default — and going back to the first is what makes a re-configuration differ from +// the one already saved. +const CONFIGURED_GROUP_NUMBER = 1; + +const FIRST_CHOICE_OPTION_NUMBER = 2; + +const SECOND_CHOICE_OPTION_NUMBER = 1; + +describe( + 'configurable product checkout', + { + tags: ['@yves', 'configurable-product', 'product', 'cart', 'checkout', 'spryker-core'], + }, + (): void => { + skipWhenFeatureAbsent('dateTimeConfigurator', ['b2b']); + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const productConfiguratorPage = container.get(ProductConfiguratorPage); + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ConfigurableProductCheckoutStaticFixtures; + let dynamicFixtures: ConfigurableProductCheckoutDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + }); + + it('given a configurable product when it is configured on its detail page then the configuration completes and the chosen option reaches the cart', (): void => { + // Arrange + let chosenOptionTitle = ''; + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.reloadUntilConfigurable(); + productPage.getProductConfigurationStatus().should('contain', staticFixtures.configurationNotCompleteStatus); + + // Act + productPage.configure(); + productConfiguratorPage + .getOptionTitle(CONFIGURED_GROUP_NUMBER, FIRST_CHOICE_OPTION_NUMBER) + .then((title: string): void => { + chosenOptionTitle = title; + }); + productConfiguratorPage.chooseOption({ + groupNumber: CONFIGURED_GROUP_NUMBER, + optionNumber: FIRST_CHOICE_OPTION_NUMBER, + }); + + // Assert + productPage.getProductConfigurationStatus().should('contain', staticFixtures.configurationCompleteStatus); + + // Act + productPage.addToCart(); + cartPage.visit(); + + // Assert + cartPage.getProductCartItems().should((items: JQuery): void => { + expect(items.text()).to.contain(chosenOptionTitle); + }); + }); + + it('given a configured product in the cart when it is configured again from the cart then the cart carries the new configuration through checkout', (): void => { + // Arrange + let replacedOptionTitle = ''; + let reconfiguredOptionTitle = ''; + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.reloadUntilConfigurable(); + productPage.configure(); + productConfiguratorPage + .getOptionTitle(CONFIGURED_GROUP_NUMBER, FIRST_CHOICE_OPTION_NUMBER) + .then((title: string): void => { + replacedOptionTitle = title; + }); + productConfiguratorPage.chooseOption({ + groupNumber: CONFIGURED_GROUP_NUMBER, + optionNumber: FIRST_CHOICE_OPTION_NUMBER, + }); + productPage.addToCart(); + cartPage.visit(); + + // Act + // The cart line carries the same configuration form as the detail page, so the configurator is + // reachable from here without going back to the product. + cartPage.configureProduct({ sku: dynamicFixtures.product.sku }); + productConfiguratorPage + .getOptionTitle(CONFIGURED_GROUP_NUMBER, SECOND_CHOICE_OPTION_NUMBER) + .then((title: string): void => { + reconfiguredOptionTitle = title; + }); + productConfiguratorPage.chooseOption({ + groupNumber: CONFIGURED_GROUP_NUMBER, + optionNumber: SECOND_CHOICE_OPTION_NUMBER, + }); + + // Assert + cartPage.getProductCartItems().should((items: JQuery): void => { + expect(items.text()).to.contain(reconfiguredOptionTitle); + expect(items.text()).to.not.contain(replacedOptionTitle); + }); + + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: staticFixtures.paymentMethod, + }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + } +); diff --git a/cypress/e2e/yves/product-configurator/configurable-product-shopping-list.cy.ts b/cypress/e2e/yves/product-configurator/configurable-product-shopping-list.cy.ts new file mode 100644 index 000000000..3dee7ac2a --- /dev/null +++ b/cypress/e2e/yves/product-configurator/configurable-product-shopping-list.cy.ts @@ -0,0 +1,157 @@ +import { container, skipWhenFeatureAbsent } from '@utils'; +import { + ConfigurableProductShoppingListDynamicFixtures, + ConfigurableProductShoppingListStaticFixtures, +} from '@interfaces/yves'; +import { CartPage, CatalogPage, ProductConfiguratorPage, ProductPage, ShoppingListPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +// Option one of each group is preselected, so picking the second is what makes a saved configuration +// differ from the default — and going back to the first is what makes a re-configuration differ from +// the one already saved. +const CONFIGURED_GROUP_NUMBER = 1; + +const FIRST_CHOICE_OPTION_NUMBER = 2; + +const SECOND_CHOICE_OPTION_NUMBER = 1; + +describe( + 'configurable product shopping list', + { + tags: [ + '@yves', + 'configurable-product', + 'configurable-product-shopping-lists', + 'shopping-lists', + 'product', + 'cart', + 'spryker-core', + ], + }, + (): void => { + // The B2C shops do not install the shopping list module. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no shopping lists', () => {}); + + return; + } + + skipWhenFeatureAbsent('dateTimeConfigurator', ['b2b']); + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const productConfiguratorPage = container.get(ProductConfiguratorPage); + const shoppingListPage = container.get(ShoppingListPage); + const cartPage = container.get(CartPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ConfigurableProductShoppingListStaticFixtures; + let dynamicFixtures: ConfigurableProductShoppingListDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + }); + + it('given a configurable product when it is added to the cart without being configured then the cart states that it cannot be processed', (): void => { + // Arrange + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.reloadUntilConfigurable(); + productPage.getProductConfigurationStatus().should('contain', staticFixtures.configurationNotCompleteStatus); + + // Act + productPage.addToCart(); + cartPage.visit(); + + // Assert + // The cart says so on the cart page rather than waiting for a checkout attempt — the checkout + // itself is still entered, so the message is what carries the refusal at this point. + cartPage.assertBodyContainsText(staticFixtures.unconfiguredCheckoutBlockedMessage); + }); + + it('given a configured product stocked with a limited number of items when more than that is added then the cart refuses the excess', (): void => { + // Arrange + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.reloadUntilConfigurable(); + productPage.configure(); + productConfiguratorPage.chooseOption({ + groupNumber: CONFIGURED_GROUP_NUMBER, + optionNumber: FIRST_CHOICE_OPTION_NUMBER, + }); + productPage.getProductConfigurationStatus().should('contain', staticFixtures.configurationCompleteStatus); + + // Act + productPage.setQuantity({ quantity: staticFixtures.availableStock + 1 }); + productPage.addToCart(); + + // Assert + cartPage.assertBodyContainsText(`only has availability of ${staticFixtures.availableStock}`); + }); + + it('given a configured product in a shopping list when it is configured again from the list then the list and the cart both carry the newer configuration', (): void => { + // Arrange + let replacedOptionTitle = ''; + let reconfiguredOptionTitle = ''; + + shoppingListPage.visit(); + const shoppingListName = shoppingListPage.createShoppingList(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.reloadUntilConfigurable(); + productPage.configure(); + productConfiguratorPage + .getOptionTitle(CONFIGURED_GROUP_NUMBER, FIRST_CHOICE_OPTION_NUMBER) + .then((title: string): void => { + replacedOptionTitle = title; + }); + productConfiguratorPage.chooseOption({ + groupNumber: CONFIGURED_GROUP_NUMBER, + optionNumber: FIRST_CHOICE_OPTION_NUMBER, + }); + shoppingListPage.addDisplayedProductToShoppingList(shoppingListName); + + shoppingListPage.visit(); + shoppingListPage.openShoppingList(shoppingListName); + + // Act + shoppingListPage.configureProduct({ sku: dynamicFixtures.product.sku }); + productConfiguratorPage + .getOptionTitle(CONFIGURED_GROUP_NUMBER, SECOND_CHOICE_OPTION_NUMBER) + .then((title: string): void => { + reconfiguredOptionTitle = title; + }); + productConfiguratorPage.chooseOption({ + groupNumber: CONFIGURED_GROUP_NUMBER, + optionNumber: SECOND_CHOICE_OPTION_NUMBER, + }); + + // Assert + shoppingListPage.getShoppingListItemsTable().should((table: JQuery): void => { + expect(table.text()).to.contain(reconfiguredOptionTitle); + expect(table.text()).to.not.contain(replacedOptionTitle); + }); + + // Act + shoppingListPage.addAllAvailableProductsToCart(); + + // Assert + cartPage.visit(); + cartPage.getProductCartItems().should((items: JQuery): void => { + expect(items.text()).to.contain(dynamicFixtures.product.sku); + expect(items.text()).to.contain(reconfiguredOptionTitle); + }); + }); + } +); diff --git a/cypress/e2e/yves/product-measurement-unit/measurement-unit-checkout.cy.ts b/cypress/e2e/yves/product-measurement-unit/measurement-unit-checkout.cy.ts new file mode 100644 index 000000000..0c3d22f20 --- /dev/null +++ b/cypress/e2e/yves/product-measurement-unit/measurement-unit-checkout.cy.ts @@ -0,0 +1,73 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { MeasurementUnitCheckoutDynamicFixtures, MeasurementUnitCheckoutStaticFixtures } from '@interfaces/yves'; +import { CartPage, CatalogPage, CustomerOverviewPage, ProductPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'measurement unit checkout', + { tags: ['@yves', 'measurement-units', 'product', 'cart', 'checkout', 'spryker-core'] }, + (): void => { + // The B2C shops do not install the measurement unit module. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no measurement units', () => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: MeasurementUnitCheckoutStaticFixtures; + let dynamicFixtures: MeasurementUnitCheckoutDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + }); + + it('given a measurement unit product when the quantity falls between two base units then the storefront says so rather than accepting it', (): void => { + // Arrange + productPage.selectSalesUnit({ salesUnitName: staticFixtures.fractionalSalesUnit.name }); + + // Act + productPage.setQuantity({ quantity: staticFixtures.fractionalSalesUnit.quantity }); + + // Assert + // The block sits in the markup from the start and is only revealed by the widget, so its + // presence proves nothing — visibility is the assertion. + productPage.getMeasurementUnitChoice().should('be.visible'); + }); + + it('given a measurement unit product ordered in whole base units when it is added to the cart then it checks out', (): void => { + // Arrange + productPage.selectSalesUnit({ salesUnitName: staticFixtures.wholeSalesUnit.name }); + productPage.setQuantity({ quantity: staticFixtures.wholeSalesUnit.quantity }); + productPage.getMeasurementUnitChoice().should('not.be.visible'); + + // Act + productPage.addToCart(); + cartPage.visit(); + cartPage.getProductCartItems().should('contain.text', dynamicFixtures.product.sku); + checkoutScenario.execute({ paymentMethod: getPaymentMethodBasedOnEnv() }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + } +); diff --git a/cypress/e2e/yves/product-measurement-unit/packaging-unit-checkout.cy.ts b/cypress/e2e/yves/product-measurement-unit/packaging-unit-checkout.cy.ts new file mode 100644 index 000000000..12c334167 --- /dev/null +++ b/cypress/e2e/yves/product-measurement-unit/packaging-unit-checkout.cy.ts @@ -0,0 +1,77 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { PackagingUnitCheckoutDynamicFixtures, PackagingUnitCheckoutStaticFixtures } from '@interfaces/yves'; +import { CartPage, CatalogPage, CustomerOverviewPage, ProductPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'packaging unit checkout', + { tags: ['@yves', 'packaging-units', 'measurement-units', 'product', 'cart', 'checkout', 'spryker-core'] }, + (): void => { + // The B2C shops do not install the packaging unit module. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no packaging units', () => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: PackagingUnitCheckoutStaticFixtures; + let dynamicFixtures: PackagingUnitCheckoutDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + }); + + it('given a packaging unit product when an amount outside its rules is entered then the storefront says so rather than accepting it', (): void => { + // Arrange + productPage.getPackagingUnitChoice().should('not.be.visible'); + + // Act + productPage.setAmount({ amount: staticFixtures.rejectedAmount }); + + // Assert + // The block is in the markup from the start and only revealed by the widget, so its presence + // proves nothing — visibility is the assertion. + productPage.getPackagingUnitChoice().should('be.visible'); + }); + + it('given a packaging unit product when an amount satisfying its rules is added to the cart then it checks out', (): void => { + // Arrange + productPage.setAmount({ amount: staticFixtures.acceptedAmount }); + productPage.getPackagingUnitChoice().should('not.be.visible'); + + // Act + productPage.addToCart(); + cartPage.visit(); + cartPage.getProductCartItems().should('contain.text', dynamicFixtures.product.sku); + // A saved address is picked rather than a new one typed: the B2B address forms keep their + // fields hidden until a saved address is ruled out. + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + } +); diff --git a/cypress/e2e/yves/product-offer/multistore-product-offer.cy.ts b/cypress/e2e/yves/product-offer/multistore-product-offer.cy.ts new file mode 100644 index 000000000..a7b05107c --- /dev/null +++ b/cypress/e2e/yves/product-offer/multistore-product-offer.cy.ts @@ -0,0 +1,142 @@ +import { container } from '@utils'; +import { ProductPage } from '@pages/yves'; +import { ProductManagementEditPage } from '@pages/backoffice'; +import { MultistoreProductOfferDynamicFixtures, MultistoreProductOfferStaticFixtures } from '@interfaces/yves'; +import { KeepProductOfferStoresScenario, UserLoginScenario } from '@scenarios/backoffice'; +import { OpenProductDetailPageOnStoreScenario } from '@scenarios/yves'; + +describe( + 'multistore product offer', + { + tags: [ + '@yves', + '@product-offer', + 'product', + 'prices', + 'catalog', + 'marketplace-product-offer', + 'marketplace-product-offer-prices', + 'marketplace-merchantportal-core', + 'spryker-core', + ], + }, + (): void => { + if (['b2b', 'b2c'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because product offers exist only in marketplace repositories', () => {}); + + return; + } + + const productPage = container.get(ProductPage); + const productManagementEditPage = container.get(ProductManagementEditPage); + const userLoginScenario = container.get(UserLoginScenario); + const openProductDetailPageOnStoreScenario = container.get(OpenProductDetailPageOnStoreScenario); + const keepProductOfferStoresScenario = container.get(KeepProductOfferStoresScenario); + + let staticFixtures: MultistoreProductOfferStaticFixtures; + let dynamicFixtures: MultistoreProductOfferDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // The offers hang off one product, and that product only reaches a store once it carries a + // price there. What the detail page then quotes is the offer price, not this one, so these + // values are setup rather than something the spec asserts on. + productManagementEditPage.visitProduct(String(dynamicFixtures.product.fk_product_abstract)); + productManagementEditPage.setDummyDEName(); // Gap in dynamic fixtures + productManagementEditPage.setStorePrice({ + storeName: staticFixtures.primaryStoreName, + price: staticFixtures.primaryStorePrice, + }); + productManagementEditPage.setStorePrice({ + storeName: staticFixtures.secondaryStoreName, + price: staticFixtures.secondaryStorePrice, + }); + productManagementEditPage.save(); + cy.runQueueWorker(); + + // A retry re-runs the test but not this hook, and by then the offer is already off the store, + // so the test can no longer establish that it was ever there. That precondition is checked + // here instead, while it still holds. + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.secondaryStoreName, + abstractSku: dynamicFixtures.product.abstract_sku, + sku: dynamicFixtures.product.sku, + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + productPage + .getProductOfferRadio({ productOfferReference: dynamicFixtures.productOfferToUnassign.product_offer_reference }) + .should('have.length', 1); + }); + + it('given a product offer is assigned to both stores when a shopper opens the detail page on each store then the offer is listed', (): void => { + // Act + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.primaryStoreName, + abstractSku: dynamicFixtures.product.abstract_sku, + sku: dynamicFixtures.product.sku, + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + + // Assert + productPage + .getProductOfferRadio({ productOfferReference: dynamicFixtures.productOffer.product_offer_reference }) + .should('have.length', 1); + + // Act + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.secondaryStoreName, + abstractSku: dynamicFixtures.product.abstract_sku, + sku: dynamicFixtures.product.sku, + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + + // Assert + productPage + .getProductOfferRadio({ productOfferReference: dynamicFixtures.productOffer.product_offer_reference }) + .should('have.length', 1); + }); + + it('given a store is unassigned from a product offer when a shopper opens the detail page then only the remaining store still lists that offer', (): void => { + // Act + keepProductOfferStoresScenario.execute({ + backofficeUsername: dynamicFixtures.rootUser.username, + merchantUsername: dynamicFixtures.merchantToUnassignUser?.username, + password: staticFixtures.defaultPassword, + idProductOffer: dynamicFixtures.productOfferToUnassign.id_product_offer, + productOfferReference: dynamicFixtures.productOfferToUnassign.product_offer_reference, + storeNamesToKeep: [staticFixtures.primaryStoreName], + storeNamesToRemove: [staticFixtures.secondaryStoreName], + }); + + // Assert + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.secondaryStoreName, + abstractSku: dynamicFixtures.product.abstract_sku, + sku: dynamicFixtures.product.sku, + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + productPage + .getProductOfferRadio({ productOfferReference: dynamicFixtures.productOffer.product_offer_reference }) + .should('have.length', 1); + productPage + .getProductOfferRadio({ productOfferReference: dynamicFixtures.productOfferToUnassign.product_offer_reference }) + .should('have.length', 0); + + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.primaryStoreName, + abstractSku: dynamicFixtures.product.abstract_sku, + sku: dynamicFixtures.product.sku, + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + productPage + .getProductOfferRadio({ productOfferReference: dynamicFixtures.productOfferToUnassign.product_offer_reference }) + .should('have.length', 1); + }); + } +); diff --git a/cypress/e2e/yves/product-offer/offer-availability.cy.ts b/cypress/e2e/yves/product-offer/offer-availability.cy.ts new file mode 100644 index 000000000..4b4052272 --- /dev/null +++ b/cypress/e2e/yves/product-offer/offer-availability.cy.ts @@ -0,0 +1,120 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { OfferAvailabilityDynamicFixtures, OfferAvailabilityStaticFixtures } from '@interfaces/yves'; +import { CartPage, CustomerOverviewPage, OrderDetailsPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +// `cancel` is a manual event on every cancellable state, so nothing fires it on its own — the back +// office has to trigger it. `grace period started`, where a fresh order sits, is reserved, which is +// what takes the ordered quantity out of the offer's availability until the order leaves that state. +const CANCEL_OMS_STATE = 'Cancel'; + +// The fixture puts a single item of the offer in the second customer's cart, and a refused quantity +// change leaves the line on it. +const QUANTITY_IN_CART = 1; + +describe( + 'offer availability', + { + tags: [ + '@yves', + '@product-offer', + 'availability', + 'cart', + 'checkout', + 'state-machine', + 'marketplace-product-offer', + 'product-offer-shipment-availability', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because product offers exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let staticFixtures: OfferAvailabilityStaticFixtures; + let dynamicFixtures: OfferAvailabilityDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given an offer with a limited stock when part of it is ordered and that order is then cancelled then the offer availability falls and is restored with it', (): void => { + // Arrange + const remainingAfterOrder = staticFixtures.initialStock - staticFixtures.orderedQuantity; + + customerLoginScenario.execute({ + email: dynamicFixtures.orderingCustomer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }); + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + + // Assert + // The order reserves what it took from the offer's own stock, so raising the second customer's + // line to the full stock is refused and the line keeps the quantity it already had. Read through + // the cart's quantity field: the detail page caps an over-availability quantity silently. + customerLoginScenario.execute({ + email: dynamicFixtures.cartCustomer.email, + password: staticFixtures.defaultPassword, + }); + cartPage.visit(); + cartPage.changeQuantity({ sku: dynamicFixtures.merchantProduct.sku, quantity: staticFixtures.initialStock }); + cartPage.assertBodyContainsText(`only has availability of ${remainingAfterOrder}`, { timeout: 15000 }); + cartPage + .getCartItemChangeQuantityField(dynamicFixtures.merchantProduct.sku) + .should('have.value', String(QUANTITY_IN_CART)); + + // Act + customerLoginScenario.execute({ + email: dynamicFixtures.orderingCustomer.email, + password: staticFixtures.defaultPassword, + }); + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage.getOrderReferenceBlock().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference.trim()); + salesDetailPage.triggerOms({ state: CANCEL_OMS_STATE, shouldTriggerOmsInCli: true }); + }); + + // Assert + // Cancelled is not a reserved state, so the offer's whole stock is available again and the + // quantity that was just capped now holds. + customerLoginScenario.execute({ + email: dynamicFixtures.cartCustomer.email, + password: staticFixtures.defaultPassword, + }); + cartPage.visit(); + cartPage.changeQuantity({ sku: dynamicFixtures.merchantProduct.sku, quantity: staticFixtures.initialStock }); + cartPage + .getCartItemChangeQuantityField(dynamicFixtures.merchantProduct.sku) + .should('have.value', String(staticFixtures.initialStock)); + }); + } +); diff --git a/cypress/e2e/yves/product/availability-calculation.cy.ts b/cypress/e2e/yves/product/availability-calculation.cy.ts new file mode 100644 index 000000000..1152d96a6 --- /dev/null +++ b/cypress/e2e/yves/product/availability-calculation.cy.ts @@ -0,0 +1,104 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { AvailabilityCalculationDynamicFixtures, AvailabilityCalculationStaticFixtures } from '@interfaces/yves'; +import { CartPage, CustomerOverviewPage, OrderDetailsPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +// `cancel` is a manual event on every cancellable state, so nothing fires it on its own — the back +// office has to trigger it. `grace period started`, where a fresh order sits, is reserved, which is +// what takes the ordered quantity out of availability until the order leaves that state. +const CANCEL_OMS_STATE = 'Cancel'; + +// The fixture puts a single item in the second customer's cart, and a refused quantity change +// leaves the line on it. +const QUANTITY_IN_CART = 1; + +describe( + 'availability calculation', + { + tags: ['@yves', 'availability', 'product', 'cart', 'checkout', 'state-machine', 'spryker-core'], + }, + (): void => { + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let staticFixtures: AvailabilityCalculationStaticFixtures; + let dynamicFixtures: AvailabilityCalculationDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a product with a limited stock when part of it is ordered and that order is then cancelled then availability falls and is restored with it', (): void => { + // Arrange + const remainingAfterOrder = staticFixtures.initialStock - staticFixtures.orderedQuantity; + + customerLoginScenario.execute({ + email: dynamicFixtures.orderingCustomer.email, + password: staticFixtures.defaultPassword, + }); + + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }); + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + + // Assert + // The order reserves what it took, so raising the second customer's line to the full stock is + // refused and the line keeps the quantity it already had. Read through the cart's own quantity + // field: the detail page caps an over-availability quantity silently. + customerLoginScenario.execute({ + email: dynamicFixtures.cartCustomer.email, + password: staticFixtures.defaultPassword, + }); + cartPage.visit(); + cartPage.changeQuantity({ sku: dynamicFixtures.product.sku, quantity: staticFixtures.initialStock }); + cartPage.assertBodyContainsText(`only has availability of ${remainingAfterOrder}`, { timeout: 15000 }); + cartPage + .getCartItemChangeQuantityField(dynamicFixtures.product.sku) + .should('have.value', String(QUANTITY_IN_CART)); + + // Act + customerLoginScenario.execute({ + email: dynamicFixtures.orderingCustomer.email, + password: staticFixtures.defaultPassword, + }); + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage.getOrderReferenceBlock().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference.trim()); + salesDetailPage.triggerOms({ state: CANCEL_OMS_STATE, shouldTriggerOmsInCli: true }); + }); + + // Assert + // Cancelled is not a reserved state, so the whole stock is available again and the quantity + // that was just capped now holds. + customerLoginScenario.execute({ + email: dynamicFixtures.cartCustomer.email, + password: staticFixtures.defaultPassword, + }); + cartPage.visit(); + cartPage.changeQuantity({ sku: dynamicFixtures.product.sku, quantity: staticFixtures.initialStock }); + cartPage + .getCartItemChangeQuantityField(dynamicFixtures.product.sku) + .should('have.value', String(staticFixtures.initialStock)); + }); + } +); diff --git a/cypress/e2e/yves/product/back-in-stock-notification.cy.ts b/cypress/e2e/yves/product/back-in-stock-notification.cy.ts new file mode 100644 index 000000000..4925cb883 --- /dev/null +++ b/cypress/e2e/yves/product/back-in-stock-notification.cy.ts @@ -0,0 +1,71 @@ +import { container } from '@utils'; +import { BackInStockNotificationDynamicFixtures, BackInStockNotificationStaticFixtures } from '@interfaces/yves'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'back in stock notification', + { tags: ['@yves', 'availability-notification', 'availability', 'product', 'spryker-core'] }, + (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: BackInStockNotificationStaticFixtures; + let dynamicFixtures: BackInStockNotificationDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a product with no stock left when its detail page is opened then it reads as out of stock and offers a back in stock notification', (): void => { + // Act + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.outOfStockProduct.sku }); + + // Assert + productPage.getOutOfStockNotice().should('be.visible'); + productPage.getAvailabilityNotificationEmailField().should('be.visible'); + }); + + it('given a product with no stock left when a back in stock notification is subscribed to and then cancelled then each step is confirmed', (): void => { + // Arrange + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.outOfStockProduct.sku }); + + // Act + productPage.subscribeToAvailabilityNotification({ email: dynamicFixtures.customer.email }); + + // Assert + // The subscription is what turns the form into its opposite, so the unsubscribe form appearing + // is the confirmation that it took effect rather than only that a message was rendered. + productPage.getFlashMessages().should('contain.text', staticFixtures.subscribedMessage); + productPage.getAvailabilityNotificationUnsubscribeForm().should('exist'); + + // Act + productPage.unsubscribeFromAvailabilityNotification(); + + // Assert + productPage.getFlashMessages().should('contain.text', staticFixtures.unsubscribedMessage); + productPage.getAvailabilityNotificationEmailField().should('be.visible'); + }); + + it('given a product that is in stock when its detail page is opened then no back in stock notification is offered', (): void => { + // Act + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.inStockProduct.sku }); + + // Assert + productPage.getOutOfStockNotice().should('not.exist'); + productPage.getAvailabilityNotificationEmailField().should('not.exist'); + productPage.getAddToCartButton().should('be.enabled'); + }); + } +); diff --git a/cypress/e2e/yves/product/customer-specific-prices.cy.ts b/cypress/e2e/yves/product/customer-specific-prices.cy.ts new file mode 100644 index 000000000..e6af8e246 --- /dev/null +++ b/cypress/e2e/yves/product/customer-specific-prices.cy.ts @@ -0,0 +1,120 @@ +import { container } from '@utils'; +import { + CustomerSpecificPricesCustomer, + CustomerSpecificPricesDynamicFixtures, + CustomerSpecificPricesProduct, + CustomerSpecificPricesStaticFixtures, +} from '@interfaces/yves'; +import { CartPage, CatalogPage, ProductPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { retryableBefore } from '../../../support/e2e'; + +describe( + 'customer specific prices', + { tags: ['@yves', 'prices', 'merchant-custom-prices', 'catalog', 'search', 'cart', 'spryker-core'] }, + (): void => { + // A merchant relationship price is a B2B concept: the B2C repositories have neither the company + // structure it hangs off nor demo data for it. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchant relationship prices only exist in the B2B repositories', () => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: CustomerSpecificPricesStaticFixtures; + let dynamicFixtures: CustomerSpecificPricesDynamicFixtures; + let defaultPriceCustomer: CustomerSpecificPricesCustomer; + let merchantPriceCustomer: CustomerSpecificPricesCustomer; + let product: CustomerSpecificPricesProduct; + + retryableBefore((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + if ('product' in staticFixtures) { + ({ defaultPriceCustomer, merchantPriceCustomer, product } = staticFixtures); + + return; + } + + ({ defaultPriceCustomer, merchantPriceCustomer } = dynamicFixtures); + product = { + abstractSku: dynamicFixtures.product.abstract_sku, + concreteSku: dynamicFixtures.product.sku, + name: dynamicFixtures.product.localized_attributes[0].name, + cartItemName: dynamicFixtures.product.localized_attributes[0].name, + }; + }); + + it('given a customer whose company has no merchant specific price when the product is browsed then the default price is shown in the catalog and on the product detail page', (): void => { + // Arrange + customerLoginScenario.execute({ + email: defaultPriceCustomer.email, + alternativeEmails: defaultPriceCustomer.alternativeEmails, + password: staticFixtures.defaultPassword, + }); + + // Act + // cy.session() restores cookies onto about:blank, so the header search form only exists once a + // page has actually been loaded. + catalogPage.visit(); + catalogPage.searchForProducts({ query: product.abstractSku }); + + // Assert + catalogPage + .getProductItemBlocks() + .filter(`:contains("${product.name}")`) + .first() + .should('contain', staticFixtures.prices.defaultPrice); + + // Act + catalogPage.openProductDetailPageFromResults({ productName: product.name }); + + // Assert + productPage.getProductDetailPrice().should('contain', staticFixtures.prices.defaultPrice); + }); + + it('given a customer whose company has a merchant specific price when the product is browsed and added to the cart then that price replaces the default one on every surface', (): void => { + // Arrange + customerLoginScenario.execute({ + email: merchantPriceCustomer.email, + alternativeEmails: merchantPriceCustomer.alternativeEmails, + password: staticFixtures.defaultPassword, + }); + + // Act + catalogPage.visit(); + catalogPage.searchForProducts({ query: product.abstractSku }); + + // Assert + catalogPage + .getProductItemBlocks() + .filter(`:contains("${product.name}")`) + .first() + .should('contain', staticFixtures.prices.merchantPrice); + + // Act + catalogPage.openProductDetailPageFromResults({ productName: product.name }); + + // Assert + productPage.getProductDetailPrice().should('contain', staticFixtures.prices.merchantPrice); + + // Act + productPage.addToCart(); + cartPage.visit(); + + // Assert + // Filtered by sku rather than cleared beforehand, so a cart left behind by an earlier run or a + // retry cannot change what this reads. + cartPage + .getCartItems({ sku: product.concreteSku }) + .should('have.length', 1) + .and('contain', product.cartItemName) + .and('contain', staticFixtures.prices.merchantPrice); + }); + } +); diff --git a/cypress/e2e/yves/product/discontinued-alternative-products.cy.ts b/cypress/e2e/yves/product/discontinued-alternative-products.cy.ts new file mode 100644 index 000000000..3d5c812d1 --- /dev/null +++ b/cypress/e2e/yves/product/discontinued-alternative-products.cy.ts @@ -0,0 +1,108 @@ +import { container } from '@utils'; +import { + DiscontinuedAlternativeProductsDynamicFixtures, + DiscontinuedAlternativeProductsStaticFixtures, +} from '@interfaces/yves'; +import { CatalogPage, ProductPage, WishlistPage } from '@pages/yves'; +import { ProductDiscontinuedPage } from '@pages/backoffice'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; + +describe( + 'discontinued and alternative products', + { + tags: ['@yves', 'product', 'discontinued-products', 'alternative-products', 'wishlist', 'spryker-core'], + }, + (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const wishlistPage = container.get(WishlistPage); + const productDiscontinuedPage = container.get(ProductDiscontinuedPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + + let staticFixtures: DiscontinuedAlternativeProductsStaticFixtures; + let dynamicFixtures: DiscontinuedAlternativeProductsDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + productDiscontinuedPage.discontinueProduct({ + idProductConcrete: dynamicFixtures.discontinuedProduct.id_product_concrete, + }); + cy.runQueueWorker(); + }); + + it('given a discontinued product carrying an alternative when its product detail page is opened then the alternative is offered there', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + catalogPage.visit(); + + // Act + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.discontinuedProduct.sku }); + + // Assert + productPage + .getAlternativeProductsSlider() + .should('contain.text', dynamicFixtures.substituteProduct.localized_attributes[0].name); + }); + + // The B2B storefronts ship without the wishlist feature. + (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? it.skip : it)( + 'given a wishlisted product that is then discontinued when the wishlist is opened then the item is flagged discontinued and its alternative is listed beside it', + (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + wishlistPage.visit(); + const wishlistName = wishlistPage.createWishlist(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.wishlistProduct.sku }); + + // The picker is filled in by an ajax call after page load, so reading it waits for the widget + // to be able to route the add. + wishlistPage.getWishlistPicker().should('exist'); + wishlistPage.addDisplayedProductToWishlist(wishlistName); + + // Act + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + productDiscontinuedPage.discontinueProduct({ + idProductConcrete: dynamicFixtures.wishlistProduct.id_product_concrete, + }); + + // The wishlist row reads the discontinued flag and the alternatives out of storage, not out of + // the database the back office just wrote to. + cy.runQueueWorker(); + + // Assert + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + wishlistPage.visit(); + wishlistPage.openWishlist(wishlistName); + + wishlistPage + .getWishlistItemsTable() + .should('contain.text', dynamicFixtures.wishlistProduct.sku) + .and('contain.text', staticFixtures.discontinuedLabel) + .and('contain.text', staticFixtures.alternativeLabel) + .and('contain.text', dynamicFixtures.wishlistSubstituteProduct.sku); + } + ); + } +); diff --git a/cypress/e2e/yves/product/merchant-product-original-price.cy.ts b/cypress/e2e/yves/product/merchant-product-original-price.cy.ts new file mode 100644 index 000000000..9d2053871 --- /dev/null +++ b/cypress/e2e/yves/product/merchant-product-original-price.cy.ts @@ -0,0 +1,66 @@ +import { container } from '@utils'; +import { + MerchantProductOriginalPriceDynamicFixtures, + MerchantProductOriginalPriceStaticFixtures, +} from '@interfaces/yves'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { retryableBefore } from '../../../support/e2e'; + +describe( + 'merchant product original price', + { + tags: [ + '@yves', + 'prices', + 'product', + 'catalog', + 'search', + 'marketplace-product', + 'marketplace-merchant-custom-prices', + 'spryker-core', + ], + }, + (): void => { + if (!['suite', 'b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because merchant products exist only in suite, b2b-mp and b2c-mp', () => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: MerchantProductOriginalPriceStaticFixtures; + let dynamicFixtures: MerchantProductOriginalPriceDynamicFixtures; + + retryableBefore((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + }); + + it('given a merchant product priced below its original price when the catalog is searched then the card and the detail page both show the two prices', (): void => { + // Arrange + catalogPage.visit(); + + // Act + catalogPage.searchForProducts({ query: dynamicFixtures.merchantProduct.abstract_sku }); + + // Assert + catalogPage.getFirstProductItemDefaultPrice().should('contain', staticFixtures.abstractPrice.default); + catalogPage.getFirstProductItemOriginalPrice().should('contain', staticFixtures.abstractPrice.original); + + // Act + catalogPage.openFirstProductDetailPageFromResults(); + + // Assert + productPage.getProductDetailPrice().should('contain', staticFixtures.abstractPrice.default); + productPage.getProductDetailOriginalPrice().should('contain', staticFixtures.abstractPrice.original); + }); + } +); diff --git a/cypress/e2e/yves/product/multistore-product.cy.ts b/cypress/e2e/yves/product/multistore-product.cy.ts new file mode 100644 index 000000000..1e5adad33 --- /dev/null +++ b/cypress/e2e/yves/product/multistore-product.cy.ts @@ -0,0 +1,129 @@ +import { container } from '@utils'; +import { ProductPage } from '@pages/yves'; +import { ProductManagementEditPage } from '@pages/backoffice'; +import { MultistoreProductDynamicFixtures, MultistoreProductStaticFixtures } from '@interfaces/yves'; +import { AssignStoreToProductScenario, UserLoginScenario } from '@scenarios/backoffice'; +import { + CustomerLoginScenario, + OpenProductDetailPageOnStoreScenario, + WaitForStorefrontUrlScenario, +} from '@scenarios/yves'; + +describe( + 'multistore product', + { + tags: ['@yves', '@product', 'product', 'prices', 'catalog', 'search', 'spryker-core', 'spryker-core-back-office'], + }, + (): void => { + const productPage = container.get(ProductPage); + const productManagementEditPage = container.get(ProductManagementEditPage); + const userLoginScenario = container.get(UserLoginScenario); + const openProductDetailPageOnStoreScenario = container.get(OpenProductDetailPageOnStoreScenario); + const waitForStorefrontUrlScenario = container.get(WaitForStorefrontUrlScenario); + const assignStoreToProductScenario = container.get(AssignStoreToProductScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: MultistoreProductStaticFixtures; + let dynamicFixtures: MultistoreProductDynamicFixtures; + + let productDetailPageUrl: string; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // One product priced differently per store, so the storefront assertions can only pass if the + // price really is store-scoped and not a single global value. + productManagementEditPage.visitProduct(String(dynamicFixtures.product.fk_product_abstract)); + productManagementEditPage.setDummyDEName(); // Gap in dynamic fixtures + productManagementEditPage.setStorePrice({ + storeName: staticFixtures.primaryStoreName, + price: staticFixtures.primaryStorePrice, + }); + productManagementEditPage.setStorePrice({ + storeName: staticFixtures.secondaryStoreName, + price: staticFixtures.secondaryStorePrice, + }); + productManagementEditPage.save(); + + // A second product, priced the same everywhere, is the one the unassign test takes away — so + // neither test depends on what the other did to the catalogue. + assignStoreToProductScenario.execute({ + abstractProductSku: dynamicFixtures.productToUnassign.abstract_sku, + bulkProductPrice: staticFixtures.unassignedStoreProductPrice, + shouldTriggerPublishAndSync: true, + }); + + // A retry re-runs the test but not this hook, and by then the product is off the store — its + // detail page could no longer be opened to read the url off. So it is read here, while the + // product is still there, and the test only has to unassign and re-request it. + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.secondaryStoreName, + abstractSku: dynamicFixtures.productToUnassign.abstract_sku, + sku: dynamicFixtures.productToUnassign.sku, + productName: dynamicFixtures.productToUnassign.localized_attributes[0].name, + }); + cy.url().then((detailPageUrl: string) => { + productDetailPageUrl = detailPageUrl; + }); + }); + + it('given a product is priced per store when a shopper opens its detail page on each store then each store shows its own price', (): void => { + // Arrange + const primaryStorePrice = `${staticFixtures.currencySymbol}${staticFixtures.primaryStorePrice}.00`; + const secondaryStorePrice = `${staticFixtures.currencySymbol}${staticFixtures.secondaryStorePrice}.00`; + + // The B2B storefronts show prices to logged-in customers only. + if (['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + } + + // Act + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.primaryStoreName, + abstractSku: dynamicFixtures.product.abstract_sku, + sku: dynamicFixtures.product.sku, + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + + // Assert + productPage.getProductConfigurator().should('contain', primaryStorePrice); + + // Act + openProductDetailPageOnStoreScenario.execute({ + storeName: staticFixtures.secondaryStoreName, + abstractSku: dynamicFixtures.product.abstract_sku, + sku: dynamicFixtures.product.sku, + productName: dynamicFixtures.product.localized_attributes[0].name, + }); + + // Assert + productPage.getProductConfigurator().should('contain', secondaryStorePrice); + }); + + it('given a product is unassigned from a store when a shopper opens its detail page on that store then the page is not found', (): void => { + // Arrange + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + // Act + productManagementEditPage.visitProduct(String(dynamicFixtures.productToUnassign.fk_product_abstract)); + productManagementEditPage.setDummyDEName(); // Gap in dynamic fixtures + productManagementEditPage.unassignStore(staticFixtures.secondaryStoreName); + productManagementEditPage.save(); + cy.runQueueWorker(); + + // Assert + waitForStorefrontUrlScenario.execute({ url: productDetailPageUrl, shouldBeServed: false }); + }); + } +); diff --git a/cypress/e2e/yves/product/original-price.cy.ts b/cypress/e2e/yves/product/original-price.cy.ts new file mode 100644 index 000000000..734fa38dc --- /dev/null +++ b/cypress/e2e/yves/product/original-price.cy.ts @@ -0,0 +1,58 @@ +import { container } from '@utils'; +import { OriginalPriceDynamicFixtures, OriginalPriceStaticFixtures } from '@interfaces/yves'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { retryableBefore } from '../../../support/e2e'; + +describe('original price', { tags: ['@yves', 'prices', 'product', 'catalog', 'search', 'spryker-core'] }, (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: OriginalPriceStaticFixtures; + let dynamicFixtures: OriginalPriceDynamicFixtures; + + retryableBefore((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + }); + + it('given an abstract product priced above its default price when the catalog is searched then the card shows the default and the original price side by side', (): void => { + // Arrange + catalogPage.visit(); + + // Act + catalogPage.searchForProducts({ query: dynamicFixtures.product.abstract_sku }); + + // Assert + catalogPage.getFirstProductItemDefaultPrice().should('contain', staticFixtures.abstractPrice.default); + catalogPage.getFirstProductItemOriginalPrice().should('contain', staticFixtures.abstractPrice.original); + }); + + it('given a variant carrying prices of its own when it is selected on the product detail page then its default and original price replace the abstract ones', (): void => { + // Arrange + catalogPage.visit(); + catalogPage.searchForProducts({ query: dynamicFixtures.product.abstract_sku }); + catalogPage.openFirstProductDetailPageFromResults(); + + // Assert + // Before a variant is resolved the detail page prices the abstract, even though one variant is + // cheaper than it. + productPage.getProductDetailPrice().should('contain', staticFixtures.abstractPrice.default); + productPage.getProductDetailOriginalPrice().should('contain', staticFixtures.abstractPrice.original); + + // Act + productPage.selectVariantAttribute({ + attributeKey: staticFixtures.variant.attributeKey, + attributeValue: staticFixtures.variant.attributeValue, + }); + + // Assert + productPage.getProductDetailPrice().should('contain', staticFixtures.variant.default); + productPage.getProductDetailOriginalPrice().should('contain', staticFixtures.variant.original); + }); +}); diff --git a/cypress/e2e/yves/product/product-attachment-storefront.cy.ts b/cypress/e2e/yves/product/product-attachment-storefront.cy.ts index 6bfe86a72..a32e86ca1 100644 --- a/cypress/e2e/yves/product/product-attachment-storefront.cy.ts +++ b/cypress/e2e/yves/product/product-attachment-storefront.cy.ts @@ -1,4 +1,4 @@ -import { container } from '@utils'; +import { container, skipWhenFeatureAbsent } from '@utils'; import { ProductManagementListPage, ProductManagementEditPage, @@ -15,6 +15,15 @@ describe( 'product attachment storefront', { tags: ['@yves', '@product-attachment', 'product', 'spryker-core'] }, (): void => { + // The B2C shops carry the product attachment tables but wire neither the Back Office form nor the storefront. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C shops have no product attachments', () => {}); + + return; + } + + skipWhenFeatureAbsent('productAttachments', ['b2b']); + const productManagementListPage = container.get(ProductManagementListPage); const productManagementEditPage = container.get(ProductManagementEditPage); const backofficeProductPage = container.get(BackofficeProductPage); diff --git a/cypress/e2e/yves/product/product-bundle-checkout.cy.ts b/cypress/e2e/yves/product/product-bundle-checkout.cy.ts new file mode 100644 index 000000000..14fb88dd5 --- /dev/null +++ b/cypress/e2e/yves/product/product-bundle-checkout.cy.ts @@ -0,0 +1,65 @@ +import { container } from '@utils'; +import { ProductBundleCheckoutDynamicFixtures, ProductBundleCheckoutStaticFixtures } from '@interfaces/yves'; +import { CartPage, CatalogPage, CustomerOverviewPage, ProductPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; + +describe( + 'product bundle checkout', + { tags: ['@yves', 'product-bundles', 'product', 'cart', 'checkout', 'spryker-core'] }, + (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const checkoutScenario = container.get(CheckoutScenario); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: ProductBundleCheckoutStaticFixtures; + let dynamicFixtures: ProductBundleCheckoutDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.bundleProduct.sku }); + }); + + it('given a bundle product when its product detail page is opened then the products it bundles are listed on it', (): void => { + // Act + const bundleItems = productPage.getBundleItems(); + + // Assert + // The widget lists what the bundle contains by product name, not by sku. + bundleItems + .should('be.visible') + .and('contain.text', dynamicFixtures.bundledProductOne.localized_attributes[0].name) + .and('contain.text', dynamicFixtures.bundledProductTwo.localized_attributes[0].name); + }); + + it('given a bundle product when it is added to the cart then it checks out as a single item', (): void => { + // Act + productPage.addToCart(); + cartPage.visit(); + cartPage.getCartItems({ sku: dynamicFixtures.bundleProduct.sku }).should('have.length', 1); + // A saved address is picked rather than a new one typed: the B2B address forms keep their + // fields hidden until a saved address is ruled out. + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: staticFixtures.paymentMethod, + }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage()); + }); + } +); diff --git a/cypress/e2e/yves/product/publish-and-synchronize-dms.cy.ts b/cypress/e2e/yves/product/publish-and-synchronize-dms.cy.ts index 67b9fd3c4..dbe9da524 100644 --- a/cypress/e2e/yves/product/publish-and-synchronize-dms.cy.ts +++ b/cypress/e2e/yves/product/publish-and-synchronize-dms.cy.ts @@ -79,11 +79,7 @@ describe( catalogPage.assertBodyContainsText(productAbstract.name); catalogPage.assertBodyContainsText(productAbstract.sku); catalogPage.assertBodyContainsText(productAbstract.description); - catalogPage.getBody().should('satisfy', ($body) => { - const text = $body.text(); - // Number of in stock items or Available (never out of stock) - return text.includes('Available') || /\d+(\.\d+)?\s+in stock/.test(text); - }); + productPage.getBody().should('satisfy', productPage.isShownAsAvailable); if (!['b2b', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { catalogPage.assertBodyContainsText(productAbstract.price); @@ -107,11 +103,7 @@ describe( catalogPage.assertBodyContainsText(productAbstract.name); catalogPage.assertBodyContainsText(productAbstract.sku); catalogPage.assertBodyContainsText(productAbstract.description); - catalogPage.getBody().should('satisfy', ($body) => { - const text = $body.text(); - // Number of in stock items or Available (never out of stock) - return text.includes('Available') || /\d+(\.\d+)?\s+in stock/.test(text); - }); + productPage.getBody().should('satisfy', productPage.isShownAsAvailable); catalogPage.assertBodyContainsText(productAbstract.price); productPage.addToCart(); diff --git a/cypress/e2e/yves/product/volume-prices.cy.ts b/cypress/e2e/yves/product/volume-prices.cy.ts new file mode 100644 index 000000000..f01efc242 --- /dev/null +++ b/cypress/e2e/yves/product/volume-prices.cy.ts @@ -0,0 +1,90 @@ +import { container } from '@utils'; +import { VolumePricesDynamicFixtures, VolumePricesStaticFixtures } from '@interfaces/yves'; +import { CartPage, CatalogPage, ProductPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; + +describe('volume prices', { tags: ['@yves', 'prices', 'product', 'cart', 'spryker-core'] }, (): void => { + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const cartPage = container.get(CartPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let staticFixtures: VolumePricesStaticFixtures; + let dynamicFixtures: VolumePricesDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + beforeEach((): void => { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + cartPage.visit(); + cartPage.clearCartIfNotEmpty(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + }); + + it('given a product priced in volume tiers when the quantity on the detail page reaches a tier then the tier price replaces the unit price', (): void => { + // Arrange + productPage.getProductDetailPrice().should('contain', staticFixtures.unitPrice); + + // Act + productPage.setQuantity({ quantity: staticFixtures.volumeTier.quantity }); + + // Assert + productPage.getProductDetailPrice().should('contain', staticFixtures.volumeTier.price); + }); + + it('given a tier quantity of a product priced in volume tiers when it is added to the cart then the cart charges the tier price', (): void => { + // Arrange + productPage.setQuantity({ quantity: staticFixtures.volumeTier.quantity }); + + // Act + // The quantity is already on the tier, and addToCart's own quantity write sets the value + // without the change event the volume-price component listens to. + productPage.addToCart(); + cartPage.visit(); + + // Assert + cartPage + .getCartItemsChargingUnitPrice({ + sku: dynamicFixtures.product.sku, + unitPrice: staticFixtures.volumeTier.price, + quantity: staticFixtures.volumeTier.quantity, + }) + .should('have.length', 1); + }); + + it('given a product added to the cart below its volume tier when its cart line is raised to the tier then the cart charges the tier price', (): void => { + // Arrange + productPage.setQuantity({ quantity: staticFixtures.belowTierQuantity }); + productPage.addToCart(); + cartPage.visit(); + cartPage + .getCartItemsChargingUnitPrice({ + sku: dynamicFixtures.product.sku, + unitPrice: staticFixtures.unitPrice, + quantity: staticFixtures.belowTierQuantity, + }) + .should('have.length', 1); + + // Act + // A second add of the same product is not guaranteed to join the first line - b2b-demo-shop keys the line + // it creates the cart with apart from later adds - so the tier is reached on the line itself. + cartPage.changeQuantity({ sku: dynamicFixtures.product.sku, quantity: staticFixtures.volumeTier.quantity }); + + // Assert + cartPage + .getCartItemsChargingUnitPrice({ + sku: dynamicFixtures.product.sku, + unitPrice: staticFixtures.volumeTier.price, + quantity: staticFixtures.volumeTier.quantity, + }) + .should('have.length', 1); + }); +}); diff --git a/cypress/e2e/yves/quick-order/quick-order-to-checkout.cy.ts b/cypress/e2e/yves/quick-order/quick-order-to-checkout.cy.ts new file mode 100644 index 000000000..bbb5dbf09 --- /dev/null +++ b/cypress/e2e/yves/quick-order/quick-order-to-checkout.cy.ts @@ -0,0 +1,116 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { CartPage, CustomerOverviewPage, OrderDetailsPage, QuickOrderPage, ShoppingListPage } from '@pages/yves'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { QuickOrderToCheckoutDynamicFixtures, QuickOrderToCheckoutStaticFixtures } from '@interfaces/yves'; + +describe( + 'quick order to checkout', + { + tags: ['@yves', '@quick-order', 'cart', 'checkout', 'reorder', 'order-management', 'marketplace-product-offer'], + }, + (): void => { + if (Cypress.env('repositoryId') !== 'suite') { + it.skip('runs only where quick order can reach products sold by competing merchants', (): void => {}); + + return; + } + + const quickOrderPage = container.get(QuickOrderPage); + const cartPage = container.get(CartPage); + const shoppingListPage = container.get(ShoppingListPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let dynamicFixtures: QuickOrderToCheckoutDynamicFixtures; + let staticFixtures: QuickOrderToCheckoutStaticFixtures; + let pastedOrder: string; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + // Each product is sold by a merchant of its own, so every destination has to carry both + // merchants for the quick order to have kept the relation. + pastedOrder = [ + `${dynamicFixtures.product1.sku},${staticFixtures.firstProductQuantity}`, + `${dynamicFixtures.product2.sku},${staticFixtures.secondProductQuantity}`, + ].join('\n'); + }); + + it('given a pasted quick order of two products sold by different merchants when it is added to the cart then the cart keeps both merchants', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + quickOrderPage.visit(); + quickOrderPage.verifyPastedOrder(pastedOrder); + + // Act + quickOrderPage.addRowsToCart(); + + // Assert + cartPage.visit(); + cartPage + .getProductCartItems() + .should('contain.text', dynamicFixtures.product1.sku) + .and('contain.text', dynamicFixtures.product2.sku) + .and('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant1.name}`) + .and('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant2.name}`); + }); + + it('given a pasted quick order of two products sold by different merchants when it is added to a shopping list then the list keeps both merchants', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + quickOrderPage.visit(); + quickOrderPage.verifyPastedOrder(pastedOrder); + + // Act + quickOrderPage.addRowsToShoppingList(dynamicFixtures.shoppingList.name); + + // Assert + shoppingListPage + .getShoppingListItemsTable() + .should('contain.text', dynamicFixtures.product1.sku) + .and('contain.text', dynamicFixtures.product2.sku) + .and('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant1.name}`) + .and('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant2.name}`); + }); + + it('given an order of offers from two merchants when it is reordered then the cart keeps both merchants', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.reorderCustomer.email, + password: staticFixtures.defaultPassword, + }); + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.reorderAddress.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // The placed order lists products by name rather than by sku, so the merchant line is what + // carries the relation through this step. + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage + .getOrderDetailTableBlock() + .should('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant1.name}`) + .and('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant2.name}`); + + // Act + orderDetailsPage.reorderAll(); + + // Assert + cartPage.visit(); + cartPage + .getProductCartItems() + .should('contain.text', dynamicFixtures.product1.sku) + .and('contain.text', dynamicFixtures.product2.sku) + .and('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant1.name}`) + .and('contain.text', `${staticFixtures.soldByText} ${dynamicFixtures.merchant2.name}`); + }); + } +); diff --git a/cypress/e2e/yves/quote-request/configurable-product-rfq.cy.ts b/cypress/e2e/yves/quote-request/configurable-product-rfq.cy.ts new file mode 100644 index 000000000..fe6eadf5b --- /dev/null +++ b/cypress/e2e/yves/quote-request/configurable-product-rfq.cy.ts @@ -0,0 +1,134 @@ +import { container, skipWhenFeatureAbsent } from '@utils'; +import { ConfigurableProductRfqDynamicFixtures, ConfigurableProductRfqStaticFixtures } from '@interfaces/yves'; +import { + CartPage, + CatalogPage, + CompanyUserSelectPage, + ProductConfiguratorPage, + ProductPage, + QuoteRequestPage, +} from '@pages/yves'; +import { AgentLoginScenario, CustomerLoginScenario } from '@scenarios/yves'; + +// Option one of each group is preselected, so picking the second is what makes the saved +// configuration differ from the default. +const CONFIGURED_GROUP_NUMBER = 1; + +const CONFIGURED_OPTION_NUMBER = 2; + +describe( + 'configurable product request for quote', + { + tags: ['@yves', 'configurable-product', 'quotation-process', 'agent-assist', 'cart', 'product', 'spryker-core'], + }, + (): void => { + // Quote requests are a company-account feature, which the B2C storefronts do not have. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no quote requests', () => {}); + + return; + } + + skipWhenFeatureAbsent('dateTimeConfigurator', ['b2b']); + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const productConfiguratorPage = container.get(ProductConfiguratorPage); + const cartPage = container.get(CartPage); + const companyUserSelectPage = container.get(CompanyUserSelectPage); + const quoteRequestPage = container.get(QuoteRequestPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const agentLoginScenario = container.get(AgentLoginScenario); + + let staticFixtures: ConfigurableProductRfqStaticFixtures; + let dynamicFixtures: ConfigurableProductRfqDynamicFixtures; + + let configuredOptionTitle = ''; + + // The configured product is put in the cart through the storefront: its configuration comes from + // the configurator application, which the dynamic-fixtures endpoint cannot drive. + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: dynamicFixtures.companyUser.id_company_user }); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.reloadUntilConfigurable(); + productPage.configure(); + productConfiguratorPage + .getOptionTitle(CONFIGURED_GROUP_NUMBER, CONFIGURED_OPTION_NUMBER) + .then((title: string) => { + configuredOptionTitle = title; + }); + productConfiguratorPage.chooseOption({ + groupNumber: CONFIGURED_GROUP_NUMBER, + optionNumber: CONFIGURED_OPTION_NUMBER, + }); + productPage.getProductConfigurationStatus().should('contain', staticFixtures.configurationCompleteStatus); + + productPage.addToCart(); + cartPage.visit(); + // /quote-request/create reads the cart server-side, so the item has to be on it before the + // request is created or the request comes out empty. + cartPage.assertBodyContainsText(dynamicFixtures.product.sku); + }); + + it('given a configured product submitted as a quote request when an agent returns it and the customer converts it then the cart still carries the configuration', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: dynamicFixtures.companyUser.id_company_user }); + + // Act + quoteRequestPage.createFromCart(); + + quoteRequestPage.getReference().then((reference: string) => { + quoteRequestPage.sendToAgent(); + + // The agent is a Zed user with storefront agent rights, so this is a different login + // surface; the customer's cookies have to go first or /agent/login redirects away. + cy.resetYvesCookies(); + agentLoginScenario.execute({ + username: dynamicFixtures.agentUser.username, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + quoteRequestPage.visitAgentRevise(reference); + quoteRequestPage.sendToCustomer(); + + cy.resetYvesCookies(); + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: dynamicFixtures.companyUser.id_company_user }); + quoteRequestPage.visitDetails(reference); + quoteRequestPage.convertToCart(reference); + + // Assert + // The configuration was made before the request existed and has survived the agent + // round-trip, so the converted cart holds the option the customer chose rather than an + // unconfigured line. + cartPage.visit(); + cartPage.getProductCartItems().should((items: JQuery): void => { + expect(items.text()).to.contain(configuredOptionTitle); + expect(items.text()).to.not.contain(staticFixtures.configurationNotCompleteStatus); + }); + }); + }); + } +); diff --git a/cypress/e2e/yves/quote-request/quote-request-lifecycle.cy.ts b/cypress/e2e/yves/quote-request/quote-request-lifecycle.cy.ts new file mode 100644 index 000000000..10305641f --- /dev/null +++ b/cypress/e2e/yves/quote-request/quote-request-lifecycle.cy.ts @@ -0,0 +1,121 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { QuoteRequestLifecycleDynamicFixtures, QuoteRequestLifecycleStaticFixtures } from '@interfaces/yves'; +import { CartPage, CompanyUserSelectPage, CustomerOverviewPage, QuoteRequestPage } from '@pages/yves'; +import { AgentLoginScenario, CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; + +// The tests walk one quote request through its lifecycle, each picking it up where the previous one +// left it: the dynamic-fixtures endpoint cannot create a quote request in a given state. +describe( + 'quote request lifecycle', + { tags: ['@yves', '@checkout', 'checkout', 'cart', 'quotation-process', 'agent-assist', 'spryker-core'] }, + (): void => { + // Quote requests are a company-account feature, which the B2C storefronts do not have. + if (['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the B2C storefronts have no quote requests', () => {}); + + return; + } + + const cartPage = container.get(CartPage); + const companyUserSelectPage = container.get(CompanyUserSelectPage); + const customerOverviewPage = container.get(CustomerOverviewPage); + const quoteRequestPage = container.get(QuoteRequestPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const agentLoginScenario = container.get(AgentLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let staticFixtures: QuoteRequestLifecycleStaticFixtures; + let dynamicFixtures: QuoteRequestLifecycleDynamicFixtures; + let quoteRequestReference: string; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a cart holding a product when the customer requests a quote for it and sends the request to an agent then the request leaves the customer', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: dynamicFixtures.companyUser.id_company_user }); + + // Act + quoteRequestPage.createFromCart(); + quoteRequestPage.getReference().then((reference: string) => { + quoteRequestReference = reference; + }); + quoteRequestPage.sendToAgent(); + + // Assert + // A request that is with the agent can no longer be sent by the customer. + cy.then(() => quoteRequestPage.visitDetails(quoteRequestReference)); + quoteRequestPage.getSendToAgentLink().should('not.exist'); + }); + + it('given a quote request sent to an agent when the agent revises the item price and sends it back then the customer sees the revised price', (): void => { + // Arrange + // The agent is a Zed user with storefront agent rights, so this is a different login surface; + // the customer's cookies have to go first or /agent/login redirects away. + cy.resetYvesCookies(); + agentLoginScenario.execute({ + username: dynamicFixtures.agentUser.username, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + + // Act + quoteRequestPage.visitAgentRevise(quoteRequestReference); + quoteRequestPage.reviseFirstItemPrice(staticFixtures.revisedItemPrice); + quoteRequestPage.sendToCustomer(); + + // Assert + cy.resetYvesCookies(); + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: dynamicFixtures.companyUser.id_company_user }); + quoteRequestPage.visitDetails(quoteRequestReference); + quoteRequestPage.assertBodyContainsText(staticFixtures.revisedItemPriceFormatted); + }); + + it('given a quote request revised by an agent when the customer converts it to a cart and checks out then the order is placed at the revised price', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + withoutSession: true, + }); + companyUserSelectPage.visit(); + companyUserSelectPage.selectBusinessUnit({ idCompanyUser: dynamicFixtures.companyUser.id_company_user }); + quoteRequestPage.visitDetails(quoteRequestReference); + + // Act + quoteRequestPage.convertToCart(quoteRequestReference); + + // Assert + // Scoped to the cart summary, not the whole page: the cart prints the original price alongside + // the revised one, so a body-wide check would pass either way. With a single item at quantity + // one the summary total is the revised price. + cartPage.visit(); + cartPage.getCartSummary().should('contain', staticFixtures.revisedItemPriceFormatted); + cartPage.getCartSummary().should('not.contain', staticFixtures.originalItemPriceFormatted); + + // Act + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + }); + + // Assert + customerOverviewPage.assertBodyContainsText(customerOverviewPage.getPlacedOrderSuccessMessage(), { + timeout: 15000, + }); + }); + } +); diff --git a/cypress/e2e/yves/return-management/return-creation-storefront.cy.ts b/cypress/e2e/yves/return-management/return-creation-storefront.cy.ts new file mode 100644 index 000000000..69e68574c --- /dev/null +++ b/cypress/e2e/yves/return-management/return-creation-storefront.cy.ts @@ -0,0 +1,128 @@ +import { container, getPaymentMethodBasedOnEnv } from '@utils'; +import { ReturnCreationStorefrontDynamicFixtures, ReturnCreationStorefrontStaticFixtures } from '@interfaces/yves'; +import { CustomerOverviewPage, OrderDetailsPage, ReturnCreatePage, ReturnViewPage } from '@pages/yves'; +import { SalesDetailPage, SalesIndexPage } from '@pages/backoffice'; +import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves'; +import { UserLoginScenario } from '@scenarios/backoffice'; +import { ActionEnum, SalesOrdersPage } from '@pages/mp'; +import { MerchantUserLoginScenario } from '@scenarios/mp'; + +describe( + 'return creation storefront', + { + tags: [ + '@yves', + '@return-management', + 'return-management', + 'marketplace-return-management', + 'order-management', + 'state-machine', + 'spryker-core', + ], + }, + (): void => { + // The marketplace payment process ships by merchant, so the back office offers no manual Ship + // event to bring the order to a returnable state. + if (['b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because the marketplace payment process has no manual ship event', () => {}); + + return; + } + + const customerOverviewPage = container.get(CustomerOverviewPage); + const orderDetailsPage = container.get(OrderDetailsPage); + const returnCreatePage = container.get(ReturnCreatePage); + const returnViewPage = container.get(ReturnViewPage); + const salesIndexPage = container.get(SalesIndexPage); + const salesDetailPage = container.get(SalesDetailPage); + const salesOrdersPage = container.get(SalesOrdersPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + const userLoginScenario = container.get(UserLoginScenario); + const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); + const checkoutScenario = container.get(CheckoutScenario); + + let staticFixtures: ReturnCreationStorefrontStaticFixtures; + let dynamicFixtures: ReturnCreationStorefrontDynamicFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a shipped order of three items when the customer returns two of them then only those move to waiting for return', (): void => { + // Arrange + placeCustomerOrder(); + driveOrderToShipped(); + + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + customerOverviewPage.viewLastPlacedOrder(); + + // Act + orderDetailsPage.createReturn(); + returnCreatePage.assertPageLocation(); + returnCreatePage.selectItem(dynamicFixtures.firstReturnedProduct.sku); + returnCreatePage.selectItem(dynamicFixtures.secondReturnedProduct.sku); + returnCreatePage.submit(); + + // Assert + returnViewPage.assertPageLocation(); + returnViewPage.assertBodyContainsText(staticFixtures.returnDetailsTitle); + returnViewPage.getBody().should('contain', dynamicFixtures.firstReturnedProduct.sku); + returnViewPage.getBody().should('contain', dynamicFixtures.secondReturnedProduct.sku); + returnViewPage.getBody().should('not.contain', dynamicFixtures.keptProduct.sku); + + // Creating the return fires `start-return`, which is not a manual event: the returned items + // leave `shipped` on their own, and the item left out of the return stays where it was. + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage.getOrderDetailTableBlock().should('contain', staticFixtures.waitingForReturnState); + orderDetailsPage.getOrderDetailTableBlock().should('contain', staticFixtures.shippedState); + }); + + function placeCustomerOrder(): void { + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + checkoutScenario.execute({ + idCustomerAddress: dynamicFixtures.address.id_customer_address, + paymentMethod: getPaymentMethodBasedOnEnv(), + shouldTriggerOmsInCli: true, + }); + } + + // `start-return` is offered from the shipped and delivered states only, so the order has to walk + // the happy path first; every event on the way is manual. The marketplace process hands the order to + // its merchant once it is paid and picking is skipped, and `start-return` also needs the merchant's own item shipped, so there the + // merchant ships it from the Merchant Portal. Each shop lists its own events. + function driveOrderToShipped(): void { + customerOverviewPage.viewLastPlacedOrder(); + orderDetailsPage.getOrderReferenceBlock().then((orderReference: string) => { + userLoginScenario.execute({ + username: dynamicFixtures.rootUser.username, + password: staticFixtures.defaultPassword, + }); + + salesIndexPage.visit(); + salesIndexPage.viewByReference(orderReference.trim()); + + staticFixtures.orderShippingEvents.forEach((event) => salesDetailPage.triggerOms(event)); + + if (!staticFixtures.merchantOrderShippingActions || !dynamicFixtures.merchantUser) { + return; + } + + merchantUserLoginScenario.execute({ + username: dynamicFixtures.merchantUser.username, + password: staticFixtures.defaultPassword, + }); + staticFixtures.merchantOrderShippingActions.forEach((action) => { + salesOrdersPage.visit(); + salesOrdersPage.update({ query: orderReference.trim(), action: ActionEnum[action] }); + }); + }); + } + } +); diff --git a/cypress/e2e/yves/shopping-list/shopping-list-product-offers.cy.ts b/cypress/e2e/yves/shopping-list/shopping-list-product-offers.cy.ts new file mode 100644 index 000000000..02740ac13 --- /dev/null +++ b/cypress/e2e/yves/shopping-list/shopping-list-product-offers.cy.ts @@ -0,0 +1,85 @@ +import { container } from '@utils'; +import { CartPage, CatalogPage, ProductPage, ShoppingListPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { ShoppingListProductOffersDynamicFixtures, ShoppingListProductOffersStaticFixtures } from '@interfaces/yves'; + +describe( + 'shopping list product offers', + { + tags: [ + '@yves', + '@shopping-list', + 'shopping-lists', + 'marketplace-shopping-lists', + 'cart', + 'product', + 'marketplace-product', + 'marketplace-product-offer', + ], + }, + (): void => { + if (Cypress.env('repositoryId') !== 'suite') { + it.skip('runs only where a product can carry competing merchant offers on a shopping list', (): void => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const productPage = container.get(ProductPage); + const shoppingListPage = container.get(ShoppingListPage); + const cartPage = container.get(CartPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let dynamicFixtures: ShoppingListProductOffersDynamicFixtures; + let staticFixtures: ShoppingListProductOffersStaticFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a product sold by two merchants when both offers are added to one shopping list then the list and the cart keep a line per merchant', (): void => { + // Arrange + customerLoginScenario.execute({ + email: dynamicFixtures.customer.email, + password: staticFixtures.defaultPassword, + }); + + shoppingListPage.visit(); + const shoppingListName = shoppingListPage.createShoppingList(); + + // The same product is on sale from two merchants, so every step below has to stay tied to the + // offer it started from rather than to the product. + const competingOffers = [ + { offer: dynamicFixtures.productOffer1, merchant: dynamicFixtures.merchant1 }, + { offer: dynamicFixtures.productOffer2, merchant: dynamicFixtures.merchant2 }, + ]; + + // Act + competingOffers.forEach(({ offer }): void => { + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + productPage.selectSoldByProductOffer({ productOfferReference: offer.product_offer_reference }); + shoppingListPage.getAddToShoppingListProductOfferInput().should('have.value', offer.product_offer_reference); + + shoppingListPage.addDisplayedProductToShoppingList(shoppingListName); + }); + + // Assert + shoppingListPage.visit(); + shoppingListPage.openShoppingList(shoppingListName); + + competingOffers.forEach(({ merchant }): void => { + shoppingListPage + .getShoppingListItemsTable() + .should('contain.text', `${staticFixtures.soldByText} ${merchant.name}`); + }); + + shoppingListPage.addAllAvailableProductsToCart(); + cartPage.visit(); + + competingOffers.forEach(({ merchant }): void => { + cartPage.getProductCartItems().should('contain.text', `${staticFixtures.soldByText} ${merchant.name}`); + }); + }); + } +); diff --git a/cypress/e2e/yves/shopping-list/shopping-list-sharing.cy.ts b/cypress/e2e/yves/shopping-list/shopping-list-sharing.cy.ts new file mode 100644 index 000000000..5921bc793 --- /dev/null +++ b/cypress/e2e/yves/shopping-list/shopping-list-sharing.cy.ts @@ -0,0 +1,76 @@ +import { container } from '@utils'; +import { CartPage, CatalogPage, ShoppingListPage } from '@pages/yves'; +import { CustomerLoginScenario } from '@scenarios/yves'; +import { ShoppingListSharingDynamicFixtures, ShoppingListSharingStaticFixtures } from '@interfaces/yves'; + +describe( + 'shopping list sharing', + { + tags: ['@yves', '@shopping-list', 'shopping-lists', 'cart', 'spryker-core'], + }, + (): void => { + if (!['suite', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('runs only where customers act as company users', (): void => {}); + + return; + } + + const catalogPage = container.get(CatalogPage); + const shoppingListPage = container.get(ShoppingListPage); + const cartPage = container.get(CartPage); + const customerLoginScenario = container.get(CustomerLoginScenario); + + let dynamicFixtures: ShoppingListSharingDynamicFixtures; + let staticFixtures: ShoppingListSharingStaticFixtures; + + before((): void => { + ({ staticFixtures, dynamicFixtures } = Cypress.env()); + }); + + it('given a shopping list shared with a colleague at full access when the colleague opens it then it is on their overview and its products reach their cart', (): void => { + // Arrange + const ownerName = `${dynamicFixtures.ownerCustomer.first_name} ${dynamicFixtures.ownerCustomer.last_name}`; + const receiverName = `${dynamicFixtures.receiverCustomer.first_name} ${dynamicFixtures.receiverCustomer.last_name}`; + const productName = dynamicFixtures.product.localized_attributes[0].name; + + customerLoginScenario.execute({ + email: dynamicFixtures.ownerCustomer.email, + password: staticFixtures.defaultPassword, + }); + + shoppingListPage.visit(); + const shoppingListName = shoppingListPage.createShoppingList(); + + catalogPage.visit(); + catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product.sku }); + shoppingListPage.addDisplayedProductToShoppingList(shoppingListName); + + // Act + shoppingListPage.visit(); + shoppingListPage.openShoppingList(shoppingListName); + shoppingListPage.openSharePage(); + shoppingListPage.shareWithCompanyUser({ name: receiverName, accessLevel: staticFixtures.fullAccessText }); + + // Assert + customerLoginScenario.execute({ + email: dynamicFixtures.receiverCustomer.email, + password: staticFixtures.defaultPassword, + }); + + shoppingListPage.visit(); + + // What the colleague's own overview has to say about a list somebody else owns. + [ownerName, staticFixtures.fullAccessText].forEach((expectedText): void => { + shoppingListPage.getShoppingListOverviewRow(shoppingListName).should('contain.text', expectedText); + }); + + shoppingListPage.openShoppingList(shoppingListName); + shoppingListPage.getShoppingListItemsTable().should('contain.text', productName); + + // Full access is only real if the colleague can act on the list, not merely read it. + shoppingListPage.addAllAvailableProductsToCart(); + cartPage.visit(); + cartPage.getProductCartItems().should('contain.text', productName); + }); + } +); diff --git a/cypress/fixtures/b2b-mp/backoffice/administration/dynamic-glossary-management.json b/cypress/fixtures/b2b-mp/backoffice/administration/dynamic-glossary-management.json new file mode 100644 index 000000000..756947edb --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/administration/dynamic-glossary-management.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/backoffice/administration/static-glossary-management.json b/cypress/fixtures/b2b-mp/backoffice/administration/static-glossary-management.json new file mode 100644 index 000000000..98d4d81e6 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/administration/static-glossary-management.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "glossaryKeyPrefix": "cart.price.test", + "translation": "This is a sample translation", + "updatedTranslation": "This is an updated translation" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/company-account/dynamic-company-structure-creation.json b/cypress/fixtures/b2b-mp/backoffice/company-account/dynamic-company-structure-creation.json new file mode 100644 index 000000000..f0834d3a1 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/company-account/dynamic-company-structure-creation.json @@ -0,0 +1,43 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": false, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/company-account/static-company-structure-creation.json b/cypress/fixtures/b2b-mp/backoffice/company-account/static-company-structure-creation.json new file mode 100644 index 000000000..12d06561a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/company-account/static-company-structure-creation.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "companyUserRolePermissionNames": ["View company users", "See Company Menu"], + "companyUserPagePath": "/company/user", + "companyRolePagePath": "/company/company-role" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/core/dynamic-dynamic-store-creation.json b/cypress/fixtures/b2b-mp/backoffice/core/dynamic-dynamic-store-creation.json new file mode 100644 index 000000000..361b3dd28 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/core/dynamic-dynamic-store-creation.json @@ -0,0 +1,39 @@ +{ + "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": "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/backoffice/core/static-dynamic-store-creation.json b/cypress/fixtures/b2b-mp/backoffice/core/static-dynamic-store-creation.json new file mode 100644 index 000000000..d669ec35d --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/core/static-dynamic-store-creation.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "DYNAMIC_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "175", + "cmsPageName": "dynamic-store-page", + "registrationCmsBlockNames": ["customer-registration_token--html", "customer-registration_token--text"] +} diff --git a/cypress/fixtures/b2b-mp/backoffice/data-exchange/dynamic-api-specification-download.json b/cypress/fixtures/b2b-mp/backoffice/data-exchange/dynamic-api-specification-download.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/data-exchange/dynamic-api-specification-download.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json b/cypress/fixtures/b2b-mp/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/data-exchange/static-api-specification-download.json b/cypress/fixtures/b2b-mp/backoffice/data-exchange/static-api-specification-download.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/data-exchange/static-api-specification-download.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/data-exchange/static-dynamic-entity-configuration.json b/cypress/fixtures/b2b-mp/backoffice/data-exchange/static-dynamic-entity-configuration.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/data-exchange/static-dynamic-entity-configuration.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchandising/dynamic-product-set-management.json b/cypress/fixtures/b2b-mp/backoffice/merchandising/dynamic-product-set-management.json new file mode 100644 index 000000000..8b78caf7d --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchandising/dynamic-product-set-management.json @@ -0,0 +1,318 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "skuProduct": "#firstProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "skuProduct": "#secondProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "skuProduct": "#thirdProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdProduct.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": "#firstProduct.id_product_concrete", + "idProductAbstract": "#firstProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondProduct.id_product_concrete", + "idProductAbstract": "#secondProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdProduct.id_product_concrete", + "idProductAbstract": "#thirdProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchandising/static-product-set-management.json b/cypress/fixtures/b2b-mp/backoffice/merchandising/static-product-set-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchandising/static-product-set-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-crud.json b/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-crud.json new file mode 100644 index 000000000..f250741b6 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-crud.json @@ -0,0 +1,81 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchantWaitingForApproval", + "arguments": [ + { + "status": "waiting-for-approval", + "isActive": false + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "renamedMerchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "renamedMerchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#renamedMerchant.id_merchant", + "urlPrefix": "/en/merchant/crud-rename-en-", + "url": "#renamedMerchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "unassignedMerchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "unassignedMerchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#unassignedMerchant.id_merchant", + "urlPrefix": "/en/merchant/crud-unassign-en-", + "url": "#unassignedMerchant.name" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-deactivation.json b/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-deactivation.json new file mode 100644 index 000000000..b4853e68c --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-deactivation.json @@ -0,0 +1,191 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123", + "fkLocale": 66 + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/deactivation-en-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/deactivation-de-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-user-management.json b/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-user-management.json new file mode 100644 index 000000000..90d39a543 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchant-management/dynamic-merchant-user-management.json @@ -0,0 +1,30 @@ +{ + "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": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-crud.json b/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-crud.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-crud.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-deactivation.json b/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-deactivation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-deactivation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-user-management.json b/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-user-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/merchant-management/static-merchant-user-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/navigation/dynamic-navigation-smoke.json b/cypress/fixtures/b2b-mp/backoffice/navigation/dynamic-navigation-smoke.json new file mode 100644 index 000000000..36e857a32 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/navigation/dynamic-navigation-smoke.json @@ -0,0 +1,24 @@ +{ + "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/backoffice/navigation/static-navigation-smoke.json b/cypress/fixtures/b2b-mp/backoffice/navigation/static-navigation-smoke.json new file mode 100644 index 000000000..fb68dba5f --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/navigation/static-navigation-smoke.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "accessDeniedUrlPart": "/acl/index/denied" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-configurable-product-oms.json b/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-configurable-product-oms.json new file mode 100644 index 000000000..168eb2677 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-configurable-product-oms.json @@ -0,0 +1,228 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "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": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "WATER_TREATMENT_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-order-refund.json b/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-order-refund.json new file mode 100644 index 000000000..1cac372ef --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-order-refund.json @@ -0,0 +1,417 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "helper", + "name": "haveFullProduct", + "key": "firstRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstRefundedProduct.abstract_sku", + "skuProduct": "#firstRefundedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstRefundedProduct.id_product_concrete", + "idProductAbstract": "#firstRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#firstRefundedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondRefundedProduct.abstract_sku", + "skuProduct": "#secondRefundedProduct.sku", + "moneyValue": { + "netAmount": 45000, + "grossAmount": 45000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondRefundedProduct.id_product_concrete", + "idProductAbstract": "#secondRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#secondRefundedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdRefundedProduct.abstract_sku", + "skuProduct": "#thirdRefundedProduct.sku", + "moneyValue": { + "netAmount": 60000, + "grossAmount": 60000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdRefundedProduct.id_product_concrete", + "idProductAbstract": "#thirdRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#thirdRefundedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-shipment-management.json b/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-shipment-management.json new file mode 100644 index 000000000..c2e16abe8 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/order-management/dynamic-shipment-management.json @@ -0,0 +1,417 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#keptProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "movedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#movedProduct.abstract_sku", + "skuProduct": "#movedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#movedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#movedProduct.id_product_concrete", + "idProductAbstract": "#movedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#movedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "reassignedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#reassignedProduct.abstract_sku", + "skuProduct": "#reassignedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#reassignedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#reassignedProduct.id_product_concrete", + "idProductAbstract": "#reassignedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#reassignedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/order-management/static-configurable-product-oms.json b/cypress/fixtures/b2b-mp/backoffice/order-management/static-configurable-product-oms.json new file mode 100644 index 000000000..e96ce7a69 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/order-management/static-configurable-product-oms.json @@ -0,0 +1,15 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + } + ] +} diff --git a/cypress/fixtures/b2b-mp/backoffice/order-management/static-order-refund.json b/cypress/fixtures/b2b-mp/backoffice/order-management/static-order-refund.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/order-management/static-order-refund.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/order-management/static-shipment-management.json b/cypress/fixtures/b2b-mp/backoffice/order-management/static-shipment-management.json new file mode 100644 index 000000000..731f30ebb --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/order-management/static-shipment-management.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "newShipmentAddress": { + "salutation": "Mr", + "firstName": "Split", + "lastName": "Receiver", + "email": "split.receiver@spryker.local", + "country": "Austria", + "address1": "Hartmanngasse", + "address2": "1", + "city": "Vienna", + "zipCode": "1050" + }, + "editedShipmentAddress": { + "salutation": "Mr", + "firstName": "Corrected", + "lastName": "Receiver", + "email": "corrected.receiver@spryker.local", + "country": "Germany", + "address1": "Julie-Wolfthorn-Strasse", + "address2": "1", + "city": "Berlin", + "zipCode": "10115" + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/product-management/dynamic-product-lifecycle-management.json b/cypress/fixtures/b2b-mp/backoffice/product-management/dynamic-product-lifecycle-management.json new file mode 100644 index 000000000..1d0637815 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/product-management/dynamic-product-lifecycle-management.json @@ -0,0 +1,124 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "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/backoffice/product-management/static-product-lifecycle-management.json b/cypress/fixtures/b2b-mp/backoffice/product-management/static-product-lifecycle-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/product-management/static-product-lifecycle-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/product-offer/dynamic-offer-approval.json b/cypress/fixtures/b2b-mp/backoffice/product-offer/dynamic-offer-approval.json new file mode 100644 index 000000000..3529d1299 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/product-offer/dynamic-offer-approval.json @@ -0,0 +1,165 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/product-offer/dynamic-offer-view-and-filter.json b/cypress/fixtures/b2b-mp/backoffice/product-offer/dynamic-offer-view-and-filter.json new file mode 100644 index 000000000..458fac5c2 --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/product-offer/dynamic-offer-view-and-filter.json @@ -0,0 +1,293 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute1" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser1", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant1", "#merchantUser1"] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage1", + "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": "merchantProduct1", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute1.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute1.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct1.id_product_concrete", + "idProductAbstract": "#merchantProduct1.fk_product_abstract", + "productImages": ["#productImage1"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct1.abstract_sku", + "skuProduct": "#merchantProduct1.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant1.id_merchant", + "idProductAbstract": "#merchantProduct1.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct1.id_product_concrete", + "concreteSku": "#merchantProduct1.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute2" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser2", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant2", "#merchantUser2"] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage2", + "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": "merchantProduct2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct2.id_product_concrete", + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "productImages": ["#productImage2"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct2.abstract_sku", + "skuProduct": "#merchantProduct2.sku", + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant2.id_merchant", + "idProductAbstract": "#merchantProduct2.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct2.id_product_concrete", + "concreteSku": "#merchantProduct2.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/product-offer/static-offer-approval.json b/cypress/fixtures/b2b-mp/backoffice/product-offer/static-offer-approval.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/product-offer/static-offer-approval.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/backoffice/product-offer/static-offer-view-and-filter.json b/cypress/fixtures/b2b-mp/backoffice/product-offer/static-offer-view-and-filter.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/product-offer/static-offer-view-and-filter.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/mp/marketplace-order-management/dynamic-order-fulfilment.json b/cypress/fixtures/b2b-mp/mp/marketplace-order-management/dynamic-order-fulfilment.json new file mode 100644 index 000000000..fe8ad9657 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/marketplace-order-management/dynamic-order-fulfilment.json @@ -0,0 +1,367 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "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": "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": "localizedAttribute" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrl1", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 50000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute2" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage2", + "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": "merchantProduct2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct2.id_product_concrete", + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "productImages": ["#productImage2"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct2.abstract_sku", + "skuProduct": "#merchantProduct2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#merchantProduct2.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/mp/marketplace-order-management/static-order-fulfilment.json b/cypress/fixtures/b2b-mp/mp/marketplace-order-management/static-order-fulfilment.json new file mode 100644 index 000000000..b05aab1ff --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/marketplace-order-management/static-order-fulfilment.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "orderItemStates": { + "shipped": "shipped", + "delivered": "delivered" + } +} diff --git a/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/dynamic-merchant-product-management.json b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/dynamic-merchant-product-management.json new file mode 100644 index 000000000..8b50ce861 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/dynamic-merchant-product-management.json @@ -0,0 +1,171 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "variantAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "variantImage", + "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": "variantProduct", + "arguments": [ + { + "attributes": { + "farbe": "white" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#variantAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#variantAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "farbe": "white" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#variantAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#variantAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#variantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#variantImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "skuProduct": "#variantProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json index 34bd2734e..89238406f 100644 --- a/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json +++ b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json @@ -4,23 +4,48 @@ "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": "localeEN", - "arguments": { "id_locale": 66, "locale_name": "en_US" } + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } }, { "type": "transfer", "name": "LocaleTransfer", "key": "localeDE", - "arguments": { "id_locale": 46, "locale_name": "de_DE" } + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } }, { "type": "helper", "name": "haveUser", "key": "merchantUser", - "arguments": [{ "password": "change123" }] + "arguments": [ + { + "password": "change123" + } + ] }, { "type": "helper", @@ -50,8 +75,14 @@ { "idTaxSet": 1, "localizedAttributes": [ - { "locale": "#localeEN", "name": "#localizedAttribute1.name" }, - { "locale": "#localeDE", "name": "#localizedAttribute1.name" } + { + "locale": "#localeEN", + "name": "#localizedAttribute1.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute1.name" + } ] } ] @@ -64,8 +95,14 @@ { "idTaxSet": 1, "localizedAttributes": [ - { "locale": "#localeEN", "name": "#localizedAttribute2.name" }, - { "locale": "#localeDE", "name": "#localizedAttribute2.name" } + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } ] } ] @@ -119,7 +156,10 @@ { "skuProductAbstract": "#concreteProduct1.abstract_sku", "skuProduct": "#concreteProduct1.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, @@ -130,7 +170,10 @@ { "skuProductAbstract": "#concreteProduct2.abstract_sku", "skuProduct": "#concreteProduct2.sku", - "moneyValue": { "netAmount": 20000, "grossAmount": 20000 } + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } } ] }, @@ -153,6 +196,213 @@ "idProductAbstract": "#concreteProduct2.fk_product_abstract" } ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "approvalMerchant" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "pendingLocalizedAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "pendingProductImage", + "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": "pendingProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#pendingLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#pendingLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "approvalStatus": "waiting_for_approval", + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#pendingLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#pendingLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#approvalMerchant.id_merchant", + "idProductAbstract": "#pendingProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#pendingProduct.id_product_concrete", + "idProductAbstract": "#pendingProduct.fk_product_abstract", + "productImages": ["#pendingProductImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#pendingProduct.abstract_sku", + "skuProduct": "#pendingProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#pendingProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] } ] } diff --git a/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/static-merchant-product-management.json b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/static-merchant-product-management.json new file mode 100644 index 000000000..51c6439d9 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/static-merchant-product-management.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "farbe", + "addedConcrete": { + "attributeValue": "Grey", + "stockQuantity": 5, + "searchableLocales": ["en_US", "de_DE"] + } +} diff --git a/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/static-product-concrete-management.json b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/static-product-concrete-management.json index ba4339e8a..5aae2eece 100644 --- a/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/static-product-concrete-management.json +++ b/cypress/fixtures/b2b-mp/mp/marketplace-product-concretes/static-product-concrete-management.json @@ -1,3 +1,8 @@ { - "defaultPassword": "change123" + "defaultPassword": "change123", + "createdProduct": { + "attributeName": "farbe", + "attributeValues": ["white", "black"] + }, + "pendingProductPrice": "€100.00" } diff --git a/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-customer-specific-prices.json b/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-customer-specific-prices.json new file mode 100644 index 000000000..38f84e439 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-customer-specific-prices.json @@ -0,0 +1,311 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "haveConfirmedCustomer", + "key": "companyCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#companyCustomer", + "fkCustomer": "#companyCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "customerCompany", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "customerBusinessUnit", + "arguments": [ + { + "fkCompany": "#customerCompany.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#customerCompany.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#customerCompany.id_company", + "fkCompanyBusinessUnit": "#customerBusinessUnit.id_company_business_unit" + } + ] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 45000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-merchant-profile-update.json b/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-merchant-profile-update.json new file mode 100644 index 000000000..76e0bb8f4 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-merchant-profile-update.json @@ -0,0 +1,74 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123", + "fkLocale": 66 + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/profile-update-en-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/profile-update-de-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-product-volume-prices.json b/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-product-volume-prices.json new file mode 100644 index 000000000..0530381a2 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/merchant-portal/dynamic-product-volume-prices.json @@ -0,0 +1,313 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "editableLocalizedAttribute" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "editableProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#editableProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#editableProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + }, + "idProduct": null, + "skuProduct": "" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/mp/merchant-portal/static-customer-specific-prices.json b/cypress/fixtures/b2b-mp/mp/merchant-portal/static-customer-specific-prices.json new file mode 100644 index 000000000..aa02f8e99 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/merchant-portal/static-customer-specific-prices.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "storeName": "DE", + "currency": "EUR", + "defaultPrice": "€500.00", + "customerPrice": { + "netAmount": 90, + "grossAmount": 100, + "displayed": "€100.00" + } +} diff --git a/cypress/fixtures/b2b-mp/mp/merchant-portal/static-merchant-profile-update.json b/cypress/fixtures/b2b-mp/mp/merchant-portal/static-merchant-profile-update.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/merchant-portal/static-merchant-profile-update.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/mp/merchant-portal/static-product-volume-prices.json b/cypress/fixtures/b2b-mp/mp/merchant-portal/static-product-volume-prices.json new file mode 100644 index 000000000..924f30129 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/merchant-portal/static-product-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "threshold": 2, + "quantity": 4, + "price": "€10.00" + } +} diff --git a/cypress/fixtures/b2b-mp/mp/product-offer/dynamic-offer-creation.json b/cypress/fixtures/b2b-mp/mp/product-offer/dynamic-offer-creation.json new file mode 100644 index 000000000..11308ba53 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/product-offer/dynamic-offer-creation.json @@ -0,0 +1,425 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "productMerchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "productMerchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#productMerchant", "#productMerchantUser"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "offerMerchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "offerMerchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#offerMerchant", "#offerMerchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#productMerchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "offeredLocalizedAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "offeredProductImage", + "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": "offeredProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#offeredLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#offeredLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#offeredLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#offeredLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#productMerchant.id_merchant", + "idProductAbstract": "#offeredProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#offeredProduct.id_product_concrete", + "idProductAbstract": "#offeredProduct.fk_product_abstract", + "productImages": ["#offeredProductImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#offeredProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#offeredProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#offeredProduct.id_product_concrete", + "concreteSku": "#offeredProduct.sku", + "merchantReference": "#offerMerchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "arguments": [ + { + "fkProductOffer": "#productOffer.id_product_offer", + "skuProductAbstract": "#offeredProduct.abstract_sku", + "skuProduct": "#offeredProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#offerMerchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/mp/product-offer/dynamic-offer-volume-prices.json b/cypress/fixtures/b2b-mp/mp/product-offer/dynamic-offer-volume-prices.json new file mode 100644 index 000000000..6909e5f87 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/product-offer/dynamic-offer-volume-prices.json @@ -0,0 +1,358 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "key": "productOfferPrice", + "arguments": [ + { + "fkProductOffer": "#productOffer.id_product_offer", + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "editableLocalizedAttribute" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "editableProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "editableProductOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#editableProduct.id_product_concrete", + "concreteSku": "#editableProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "arguments": [ + { + "fkProductOffer": "#editableProductOffer.id_product_offer", + "skuProductAbstract": "#editableProduct.abstract_sku", + "skuProduct": "#editableProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#editableProductOffer.id_product_offer", + "productOfferReference": "#editableProductOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/mp/product-offer/static-offer-creation.json b/cypress/fixtures/b2b-mp/mp/product-offer/static-offer-creation.json new file mode 100644 index 000000000..64ac4d7f4 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/product-offer/static-offer-creation.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "storeName": "DE", + "currency": "EUR", + "offer": { + "netAmount": 180, + "grossAmount": 200, + "displayedPrice": "€200.00", + "stockQuantity": 10 + } +} diff --git a/cypress/fixtures/b2b-mp/mp/product-offer/static-offer-volume-prices.json b/cypress/fixtures/b2b-mp/mp/product-offer/static-offer-volume-prices.json new file mode 100644 index 000000000..b770896d8 --- /dev/null +++ b/cypress/fixtures/b2b-mp/mp/product-offer/static-offer-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "offerPrice": "€200.00", + "volumeTier": { + "threshold": 2, + "quantity": 4, + "price": "€10.00" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/agent-assist/dynamic-customer-impersonation.json b/cypress/fixtures/b2b-mp/yves/agent-assist/dynamic-customer-impersonation.json new file mode 100644 index 000000000..60855a281 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/agent-assist/dynamic-customer-impersonation.json @@ -0,0 +1,217 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/agent-assist/static-customer-impersonation.json b/cypress/fixtures/b2b-mp/yves/agent-assist/static-customer-impersonation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/agent-assist/static-customer-impersonation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/yves/cart/dynamic-shared-cart.json b/cypress/fixtures/b2b-mp/yves/cart/dynamic-shared-cart.json new file mode 100644 index 000000000..806ec055d --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cart/dynamic-shared-cart.json @@ -0,0 +1,295 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "ownerCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "ownerAddress", + "arguments": [ + { + "fkCustomer": "#ownerCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "ownerCompanyUser", + "arguments": [ + { + "customer": "#ownerCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#ownerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "receiverCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "receiverAddress", + "arguments": [ + { + "fkCustomer": "#receiverCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "receiverCompanyUser", + "arguments": [ + { + "customer": "#receiverCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#receiverCompanyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "colleagueSharedQuote", + "arguments": [ + { + "customer": "#ownerCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "idProductAbstract": "#product.fk_product_abstract", + "productOfferReference": "#productOffer.product_offer_reference", + "merchantReference": "#productOffer.merchant_reference", + "quantity": 1 + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "linkSharedQuote", + "arguments": [ + { + "customer": "#ownerCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/cart/static-shared-cart.json b/cypress/fixtures/b2b-mp/yves/cart/static-shared-cart.json new file mode 100644 index 000000000..ca6cb8d04 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cart/static-shared-cart.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "soldByText": "Sold by:", + "fullAccessText": "Full access", + "cartPreviewTitlePrefix": "Preview:" +} diff --git a/cypress/fixtures/b2b-mp/yves/catalog/dynamic-catalog-filters.json b/cypress/fixtures/b2b-mp/yves/catalog/dynamic-catalog-filters.json new file mode 100644 index 000000000..332ebf1b6 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/catalog/dynamic-catalog-filters.json @@ -0,0 +1,365 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + }, + { + "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": "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant1" + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant1.id_merchant", + "urlPrefix": "/en/merchant/search-one-en-", + "url": "#merchant1.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant1.id_merchant", + "urlPrefix": "/de/merchant/search-one-de-", + "url": "#merchant1.name" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant1.id_merchant", + "idProductAbstract": "#product1.fk_product_abstract" + } + ] + }, + { + "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": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2" + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant2.id_merchant", + "urlPrefix": "/en/merchant/search-two-en-", + "url": "#merchant2.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant2.id_merchant", + "urlPrefix": "/de/merchant/search-two-de-", + "url": "#merchant2.name" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant2.id_merchant", + "idProductAbstract": "#product2.fk_product_abstract" + } + ] + }, + { + "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": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/catalog/static-catalog-filters.json b/cypress/fixtures/b2b-mp/yves/catalog/static-catalog-filters.json new file mode 100644 index 000000000..59047c4c1 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/catalog/static-catalog-filters.json @@ -0,0 +1,12 @@ +{ + "defaultPassword": "change123", + "searchTerm": "cabinet", + "attributeFilter": { + "name": "material", + "value": "sheet steel" + }, + "filterTitles": ["Brand", "Material", "Merchant"], + "ascendingPriceSortLabel": "Sort by price ascending", + "descendingPriceSortLabel": "Sort by price descending", + "merchantFilterName": "merchant_name" +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/dynamic-cart-approval-process.json b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-cart-approval-process.json new file mode 100644 index 000000000..783178f1a --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-cart-approval-process.json @@ -0,0 +1,262 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "requestQuoteApprovalPermission", + "arguments": ["RequestQuoteApprovalPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "approveQuotePermission", + "arguments": ["ApproveQuotePermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "transfer", + "name": "PermissionTransfer", + "key": "limitedPlaceOrderPermission", + "arguments": { + "idPermission": "#placeOrderPermission.id_permission", + "key": "PlaceOrderPermissionPlugin", + "configuration": { + "store_multi_currency": { + "DE": { + "EUR": 10000 + } + } + } + } + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#limitedPlaceOrderPermission", "#requestQuoteApprovalPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "approverRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#placeOrderPermission", "#approveQuotePermission"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "buyer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "approver", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "buyerAddress", + "arguments": [ + { + "fkCustomer": "#buyer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "approverRoleCollection", + "arguments": { + "roles": ["#approverRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "buyerCompanyUser", + "arguments": [ + { + "customer": "#buyer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#buyerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "approverCompanyUser", + "arguments": [ + { + "customer": "#approver", + "fk_company": "#company.id_company", + "company_role_collection": ["#approverRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#approverCompanyUser", ["#approverRole"]] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "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": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#buyer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/dynamic-checkout-authentication.json b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-checkout-authentication.json new file mode 100644 index 000000000..07002da83 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-checkout-authentication.json @@ -0,0 +1,81 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/dynamic-click-and-collect.json b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-click-and-collect.json new file mode 100644 index 000000000..5f10531ab --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-click-and-collect.json @@ -0,0 +1,342 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "helper", + "name": "haveShipmentType", + "key": "pickupShipmentType", + "arguments": [ + { + "key": "pickup" + } + ] + }, + { + "type": "helper", + "name": "haveShipmentMethod", + "key": "pickupShipmentMethod", + "arguments": [ + {}, + {}, + { + "DE": { + "EUR": {} + } + }, + ["#store.id_store"] + ] + }, + { + "type": "helper", + "name": "haveShipmentMethodShipmentTypeRelation", + "arguments": ["#pickupShipmentMethod.id_shipment_method", "#pickupShipmentType.id_shipment_type"] + }, + { + "type": "helper", + "name": "haveServiceType", + "key": "pickupServiceType", + "arguments": [ + { + "key": "pickup" + } + ] + }, + { + "type": "helper", + "name": "haveServicePoint", + "key": "servicePoint", + "arguments": [ + { + "storeRelation": { + "stores": [ + { + "idStore": "#store.id_store" + } + ] + } + } + ] + }, + { + "type": "helper", + "name": "haveServicePointAddress", + "key": "servicePointAddress", + "arguments": [ + { + "servicePoint": "#servicePoint", + "country": "#country" + } + ] + }, + { + "type": "helper", + "name": "haveService", + "key": "pickupService", + "arguments": [ + { + "servicePoint": { + "id_service_point": "#servicePoint.id_service_point" + }, + "serviceType": { + "id_service_type": "#pickupServiceType.id_service_type" + } + } + ] + }, + { + "type": "helper", + "name": "haveShipmentTypeServiceTypeRelation", + "arguments": ["#pickupShipmentType", "#pickupServiceType"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "pickupOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#pickupOffer.id_product_offer", + "productOfferReference": "#pickupOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#pickupOffer", "#store"] + }, + { + "type": "helper", + "name": "haveProductOfferShipmentType", + "arguments": ["#pickupOffer", "#pickupShipmentType"] + }, + { + "type": "helper", + "name": "haveProductOfferService", + "arguments": [ + { + "idProductOffer": "#pickupOffer.id_product_offer", + "idService": "#pickupService.id_service" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "idProductAbstract": "#product1.fk_product_abstract", + "productOfferReference": "#pickupOffer.product_offer_reference", + "merchantReference": "#pickupOffer.merchant_reference", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/dynamic-multi-merchant-order.json b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-multi-merchant-order.json new file mode 100644 index 000000000..3d508ebf0 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-multi-merchant-order.json @@ -0,0 +1,425 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "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": "haveActiveMerchantWithStore", + "key": "mainMerchant" + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#mainMerchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant1.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer1", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product3.abstract_sku", + "skuProduct": "#product3.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product3.id_product_concrete", + "idProductAbstract": "#product3.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product3.id_product_concrete", + "concreteSku": "#product3.sku", + "merchantReference": "#merchant2.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer2", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "idProductAbstract": "#product1.fk_product_abstract", + "quantity": 1, + "merchantReference": "#mainMerchant.merchant_reference" + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "idProductAbstract": "#product2.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer1.product_offer_reference", + "merchantReference": "#productOffer1.merchant_reference" + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "idProductAbstract": "#product3.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer2.product_offer_reference", + "merchantReference": "#productOffer2.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/dynamic-split-delivery.json b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-split-delivery.json new file mode 100644 index 000000000..92b5638d2 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/dynamic-split-delivery.json @@ -0,0 +1,366 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "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": "product1WithStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product2.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "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": "product2WithStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product3.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "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": "product3WithStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/static-cart-approval-process.json b/cypress/fixtures/b2b-mp/yves/checkout/static-cart-approval-process.json new file mode 100644 index 000000000..3d27ad5a3 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/static-cart-approval-process.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "waitingStatus": "Waiting", + "approvedStatus": "Approved" +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/static-checkout-authentication.json b/cypress/fixtures/b2b-mp/yves/checkout/static-checkout-authentication.json new file mode 100644 index 000000000..1e6919487 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/static-checkout-authentication.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "registrationPassword": "Cypress!Secure1", + "salutation": "Mr" +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/static-click-and-collect.json b/cypress/fixtures/b2b-mp/yves/checkout/static-click-and-collect.json new file mode 100644 index 000000000..8f332a594 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/static-click-and-collect.json @@ -0,0 +1,15 @@ +{ + "defaultPassword": "change123", + "pickupShipmentTypeKey": "pickup", + "expectedShipmentCount": 1, + "billingAddress": { + "firstName": "Pickup", + "lastName": "Buyer", + "address1": "Billing Street", + "address2": "123", + "zipCode": "10247", + "city": "Berlin", + "company": "Spryker", + "phone": "987654321" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/static-multi-merchant-order.json b/cypress/fixtures/b2b-mp/yves/checkout/static-multi-merchant-order.json new file mode 100644 index 000000000..70c5874b1 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/static-multi-merchant-order.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3, + "soldByText": "Sold by:" +} diff --git a/cypress/fixtures/b2b-mp/yves/checkout/static-split-delivery.json b/cypress/fixtures/b2b-mp/yves/checkout/static-split-delivery.json new file mode 100644 index 000000000..0d6857073 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/checkout/static-split-delivery.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3 +} diff --git a/cypress/fixtures/b2b-mp/yves/cms/dynamic-cms-page-publish.json b/cypress/fixtures/b2b-mp/yves/cms/dynamic-cms-page-publish.json new file mode 100644 index 000000000..0704e54cd --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cms/dynamic-cms-page-publish.json @@ -0,0 +1,25 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/cms/dynamic-multistore-cms-page.json b/cypress/fixtures/b2b-mp/yves/cms/dynamic-multistore-cms-page.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cms/dynamic-multistore-cms-page.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/cms/static-cms-page-publish.json b/cypress/fixtures/b2b-mp/yves/cms/static-cms-page-publish.json new file mode 100644 index 000000000..66c3d5c9c --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cms/static-cms-page-publish.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "defaultLocaleName": "en_US", + "cmsPageName": "test-cms-page-publish" +} diff --git a/cypress/fixtures/b2b-mp/yves/cms/static-multistore-cms-page.json b/cypress/fixtures/b2b-mp/yves/cms/static-multistore-cms-page.json new file mode 100644 index 000000000..2bac107fd --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/cms/static-multistore-cms-page.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "multistore-cms-page", + "storeName": "AT", + "localeName": "en_US" +} diff --git a/cypress/fixtures/b2b-mp/yves/comments/dynamic-cart-comments.json b/cypress/fixtures/b2b-mp/yves/comments/dynamic-cart-comments.json index 95940a5d2..417c2ae45 100644 --- a/cypress/fixtures/b2b-mp/yves/comments/dynamic-cart-comments.json +++ b/cypress/fixtures/b2b-mp/yves/comments/dynamic-cart-comments.json @@ -4,17 +4,58 @@ "attributes": { "synchronize": true, "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, { "type": "helper", "name": "haveConfirmedCustomer", "key": "customer", - "arguments": [{ "locale_name": "en_US", "password": "change123" }] + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] }, { "type": "helper", "name": "haveCompany", "key": "company", - "arguments": [{ "isActive": true, "status": "approved" }] + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] }, { "type": "helper", @@ -22,16 +63,38 @@ "key": "permission", "arguments": ["AddCartItemPermissionPlugin"] }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, { "type": "helper", "name": "haveCompanyRoleWithPermissions", - "arguments": [{ "isDefault": true, "fkCompany": "#company.id_company" }, ["#permission"]] + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#permission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] }, { "type": "helper", "name": "haveCompanyBusinessUnit", "key": "businessUnitFromCompany", - "arguments": [{ "fkCompany": "#company.id_company" }] + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] }, { "type": "helper", @@ -50,19 +113,56 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { "id_store": 1 } + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" }, { "type": "helper", "name": "haveFullProduct", "key": "product1", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] }, { "type": "helper", "name": "haveFullProduct", "key": "product2", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product2.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] }, { "type": "helper", @@ -71,7 +171,10 @@ { "skuProductAbstract": "#product1.abstract_sku", "skuProduct": "#product1.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, @@ -82,19 +185,34 @@ { "skuProductAbstract": "#product2.abstract_sku", "skuProduct": "#product2.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "transfer", @@ -140,12 +258,14 @@ { "sku": "#product1.sku", "abstractSku": "#product1.abstract_sku", - "quantity": 1 + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" }, { "sku": "#product2.sku", "abstractSku": "#product2.abstract_sku", - "quantity": 2 + "quantity": 2, + "merchantReference": "#merchant.merchant_reference" } ] } @@ -155,7 +275,11 @@ "type": "helper", "name": "havePersistentQuote", "key": "emptyQuote", - "arguments": [{ "customer": "#customer" }] + "arguments": [ + { + "customer": "#customer" + } + ] } ] } diff --git a/cypress/fixtures/b2b-mp/yves/comments/dynamic-order-comments.json b/cypress/fixtures/b2b-mp/yves/comments/dynamic-order-comments.json new file mode 100644 index 000000000..b78c72d7c --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/comments/dynamic-order-comments.json @@ -0,0 +1,255 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "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, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/comments/static-cart-comments.json b/cypress/fixtures/b2b-mp/yves/comments/static-cart-comments.json index 05511e655..42332182f 100644 --- a/cypress/fixtures/b2b-mp/yves/comments/static-cart-comments.json +++ b/cypress/fixtures/b2b-mp/yves/comments/static-cart-comments.json @@ -6,5 +6,6 @@ ], "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." + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "commentToKeepThroughCheckout": "Please leave the parcel with the building concierge." } diff --git a/cypress/fixtures/b2b-mp/yves/comments/static-order-comments.json b/cypress/fixtures/b2b-mp/yves/comments/static-order-comments.json new file mode 100644 index 000000000..b85b30324 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/comments/static-order-comments.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "commentOnOrder": "Please call the site office before delivering this order." +} diff --git a/cypress/fixtures/b2b-mp/yves/company-account/dynamic-business-on-behalf.json b/cypress/fixtures/b2b-mp/yves/company-account/dynamic-business-on-behalf.json new file mode 100644 index 000000000..c95a3ddee --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/company-account/dynamic-business-on-behalf.json @@ -0,0 +1,122 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "firstBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "secondBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "firstCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#firstBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#firstCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "secondCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#secondBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#secondCompanyUser", ["#buyerRole"]] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/company-account/dynamic-business-unit-address-checkout.json b/cypress/fixtures/b2b-mp/yves/company-account/dynamic-business-unit-address-checkout.json new file mode 100644 index 000000000..21371e5f5 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/company-account/dynamic-business-unit-address-checkout.json @@ -0,0 +1,196 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission", "#placeOrderWithAmountUpToPermission", "#addCartItemPermission"] + ] + }, + { + "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": "haveCompanyUnitAddress", + "key": "businessUnitAddress", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCountry": "#country.id_country", + "address1": "Business Unit Street", + "address2": "23", + "zipCode": "8002", + "city": "Barcelona", + "phone": "3490284322" + } + ] + }, + { + "type": "transfer", + "name": "CompanyBusinessUnitTransfer", + "key": "businessUnitWithAddress", + "arguments": { + "idCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "fkCompany": "#company.id_company", + "addressCollection": { + "companyUnitAddresses": ["#businessUnitAddress"] + } + } + }, + { + "type": "helper", + "name": "haveCompanyUnitAddressToCompanyBusinessUnitRelation", + "arguments": ["#businessUnitWithAddress"] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/company-account/dynamic-company-structure-creation.json b/cypress/fixtures/b2b-mp/yves/company-account/dynamic-company-structure-creation.json new file mode 100644 index 000000000..dbb821032 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/company-account/dynamic-company-structure-creation.json @@ -0,0 +1,137 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": false, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "companyBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyRoles", + "arguments": ["SeeCompanyRolesPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "createCompanyRoles", + "arguments": ["CreateCompanyRolesPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyUsers", + "arguments": ["SeeCompanyUsersPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCompanyUser", + "arguments": ["AddCompanyUserPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyMenu", + "arguments": ["SeeCompanyMenuPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "adminRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#seeCompanyRoles", "#createCompanyRoles", "#seeCompanyUsers", "#addCompanyUser", "#seeCompanyMenu"] + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "restrictedRole", + "arguments": [ + { + "fk_company": "#company.id_company", + "name": "ViewCompanyUsersOnly" + }, + ["#seeCompanyUsers", "#seeCompanyMenu"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "adminCustomer", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "adminRoleCollection", + "arguments": { + "roles": ["#adminRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "adminCompanyUser", + "arguments": [ + { + "customer": "#adminCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#adminRoleCollection"], + "fk_company_business_unit": "#companyBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#adminCompanyUser", ["#adminRole"]] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/company-account/static-business-on-behalf.json b/cypress/fixtures/b2b-mp/yves/company-account/static-business-on-behalf.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/company-account/static-business-on-behalf.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/yves/company-account/static-business-unit-address-checkout.json b/cypress/fixtures/b2b-mp/yves/company-account/static-business-unit-address-checkout.json new file mode 100644 index 000000000..c4bd9efd7 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/company-account/static-business-unit-address-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "businessUnitAddressStreet": "Business Unit Street" +} diff --git a/cypress/fixtures/b2b-mp/yves/company-account/static-company-structure-creation.json b/cypress/fixtures/b2b-mp/yves/company-account/static-company-structure-creation.json new file mode 100644 index 000000000..d36a178a0 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/company-account/static-company-structure-creation.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "restrictedRoleName": "ViewCompanyUsersOnly", + "companyUserPagePath": "/company/user", + "companyRolePagePath": "/company/company-role" +} diff --git a/cypress/fixtures/b2b-mp/yves/discount/dynamic-discounts-and-promotions.json b/cypress/fixtures/b2b-mp/yves/discount/dynamic-discounts-and-promotions.json new file mode 100644 index 000000000..cc7ec6359 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/discount/dynamic-discounts-and-promotions.json @@ -0,0 +1,363 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "requestQuoteApprovalPermission", + "arguments": ["RequestQuoteApprovalPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [ + "#placeOrderPermission", + "#placeOrderWithAmountUpToPermission", + "#requestQuoteApprovalPermission", + "#changeCartItemPermission", + "#addCartItemPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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", + "defaultCurrencyIsoCode": "EUR" + } + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + { + "attributes": { + "brand": "Discounts and promotions fixture" + } + }, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "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": "haveFullProduct", + "key": "promotionalProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#promotionalProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#promotionalProduct.abstract_sku", + "skuProduct": "#promotionalProduct.sku", + "moneyValue": { + "netAmount": 7500, + "grossAmount": 7500 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#promotionalProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "voucherDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 500, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "voucherCode", + "arguments": [ + { + "idDiscount": "#voucherDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "cartRuleDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "cart_rule", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 1000, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "promotionDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 10000, + "collectorStrategyType": "promotion", + "discountPromotion": { + "abstractSkus": ["#promotionalProduct.abstract_sku"], + "abstractSku": "#promotionalProduct.abstract_sku", + "quantity": 2 + } + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "promotionVoucherCode", + "arguments": [ + { + "idDiscount": "#promotionDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/discount/static-discounts-and-promotions.json b/cypress/fixtures/b2b-mp/yves/discount/static-discounts-and-promotions.json new file mode 100644 index 000000000..b6fdce266 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/discount/static-discounts-and-promotions.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyMarketplacePaymentInvoice" +} diff --git a/cypress/fixtures/b2b-mp/yves/merchandising/dynamic-product-relations.json b/cypress/fixtures/b2b-mp/yves/merchandising/dynamic-product-relations.json new file mode 100644 index 000000000..7108237ad --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/merchandising/dynamic-product-relations.json @@ -0,0 +1,242 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "relatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithoutRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithRelatedProduct.abstract_sku", + "skuProduct": "#productWithRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#relatedProduct.abstract_sku", + "skuProduct": "#relatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithoutRelatedProduct.abstract_sku", + "skuProduct": "#productWithoutRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithRelatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#relatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithoutRelatedProduct.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": "#productWithRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#relatedProduct.id_product_concrete", + "idProductAbstract": "#relatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productWithoutRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithoutRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "transfer", + "name": "StoreRelationTransfer", + "key": "storeRelation", + "arguments": { + "id_stores": [1], + "stores": [ + { + "id_store": 1, + "name": "DE" + } + ] + } + }, + { + "type": "helper", + "name": "haveProductRelation", + "arguments": [ + "#relatedProduct.abstract_sku", + "#productWithRelatedProduct.fk_product_abstract", + "#relatedProduct.abstract_sku", + "related-products", + "#storeRelation" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/merchandising/dynamic-product-sets.json b/cypress/fixtures/b2b-mp/yves/merchandising/dynamic-product-sets.json new file mode 100644 index 000000000..9df5a1a25 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/merchandising/dynamic-product-sets.json @@ -0,0 +1,283 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#changeCartItemPermission", "#removeCartItemPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "variantProduct", + "arguments": [ + { + "attributes": { + "material": "steel" + } + }, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "secondVariantProduct", + "arguments": [ + { + "fkProductAbstract": "#variantProduct.fk_product_abstract", + "abstractSku": "#variantProduct.abstract_sku", + "attributes": { + "material": "aluminium" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "simpleProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#variantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 40000, + "grossAmount": 40000 + }, + "skuProduct": "#secondVariantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#simpleProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondVariantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#simpleProduct.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": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#simpleProduct.id_product_concrete", + "idProductAbstract": "#simpleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/merchandising/static-product-relations.json b/cypress/fixtures/b2b-mp/yves/merchandising/static-product-relations.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/merchandising/static-product-relations.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/yves/merchandising/static-product-sets.json b/cypress/fixtures/b2b-mp/yves/merchandising/static-product-sets.json new file mode 100644 index 000000000..8d9527347 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/merchandising/static-product-sets.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "material", + "variantAttributeValue": "aluminium" +} diff --git a/cypress/fixtures/b2b-mp/yves/order-management/dynamic-order-cancellation.json b/cypress/fixtures/b2b-mp/yves/order-management/dynamic-order-cancellation.json new file mode 100644 index 000000000..29e250a4b --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/order-management/dynamic-order-cancellation.json @@ -0,0 +1,485 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "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": "haveConfirmedCustomer", + "key": "wholeOrderCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "wholeOrderAddress", + "arguments": [ + { + "fkCustomer": "#wholeOrderCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "wholeOrderCustomerCompanyUser", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "fkCustomer": "#wholeOrderCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "mixedStateCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "mixedStateAddress", + "arguments": [ + { + "fkCustomer": "#mixedStateCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "mixedStateCustomerCompanyUser", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "fkCustomer": "#mixedStateCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wholeOrderProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wholeOrderProduct.abstract_sku", + "skuProduct": "#wholeOrderProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wholeOrderProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wholeOrderProduct.id_product_concrete", + "idProductAbstract": "#wholeOrderProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#wholeOrderProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "advancedItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#advancedItemProduct.abstract_sku", + "skuProduct": "#advancedItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#advancedItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#advancedItemProduct.id_product_concrete", + "idProductAbstract": "#advancedItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#advancedItemProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "cancellableItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#cancellableItemProduct.abstract_sku", + "skuProduct": "#cancellableItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#cancellableItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#cancellableItemProduct.id_product_concrete", + "idProductAbstract": "#cancellableItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#cancellableItemProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/order-management/static-order-cancellation.json b/cypress/fixtures/b2b-mp/yves/order-management/static-order-cancellation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/order-management/static-order-cancellation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b-mp/yves/product-bundle/dynamic-configurable-bundle-checkout.json b/cypress/fixtures/b2b-mp/yves/product-bundle/dynamic-configurable-bundle-checkout.json new file mode 100644 index 000000000..e8dd3a8fd --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-bundle/dynamic-configurable-bundle-checkout.json @@ -0,0 +1,55 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomerWithAddress", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-bundle/static-configurable-bundle-checkout.json b/cypress/fixtures/b2b-mp/yves/product-bundle/static-configurable-bundle-checkout.json new file mode 100644 index 000000000..d0212246c --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-bundle/static-configurable-bundle-checkout.json @@ -0,0 +1,24 @@ +{ + "defaultPassword": "change123", + "templateName": "Presentation bundle", + "firstConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "408104" + }, + { + "slotName": "Slot 6", + "productIdentifier": "423172" + } + ], + "secondConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "421539" + }, + { + "slotName": "Slot 6", + "productIdentifier": "424551" + } + ] +} diff --git a/cypress/fixtures/b2b-mp/yves/product-configurator/dynamic-configurable-product-checkout.json b/cypress/fixtures/b2b-mp/yves/product-configurator/dynamic-configurable-product-checkout.json new file mode 100644 index 000000000..7f1eec1bc --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-configurator/dynamic-configurable-product-checkout.json @@ -0,0 +1,213 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#addCartItemPermission", + "#placeOrderPermission", + "#changeCartItemPermission", + "#removeCartItemPermission", + "#placeOrderWithAmountUpToPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "WATER_TREATMENT_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-configurator/dynamic-configurable-product-shopping-list.json b/cypress/fixtures/b2b-mp/yves/product-configurator/dynamic-configurable-product-shopping-list.json new file mode 100644 index 000000000..01018fc48 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-configurator/dynamic-configurable-product-shopping-list.json @@ -0,0 +1,195 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [ + "#readShoppingListPermission", + "#writeShoppingListPermission", + "#addCartItemPermission", + "#changeCartItemPermission", + "#removeCartItemPermission" + ] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 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": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "0", + "quantity": 5 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "WATER_TREATMENT_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-configurator/static-configurable-product-checkout.json b/cypress/fixtures/b2b-mp/yves/product-configurator/static-configurable-product-checkout.json new file mode 100644 index 000000000..468fa3fe7 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-configurator/static-configurable-product-checkout.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "paymentMethod": "dummyMarketplacePaymentInvoice" +} diff --git a/cypress/fixtures/b2b-mp/yves/product-configurator/static-configurable-product-shopping-list.json b/cypress/fixtures/b2b-mp/yves/product-configurator/static-configurable-product-shopping-list.json new file mode 100644 index 000000000..a99d48b63 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-configurator/static-configurable-product-shopping-list.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "unconfiguredCheckoutBlockedMessage": "Please configure items inside the cart.", + "availableStock": 5 +} diff --git a/cypress/fixtures/b2b-mp/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json new file mode 100644 index 000000000..0c94f4b2f --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json @@ -0,0 +1,253 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "productName" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductMeasurementBaseUnit", + "key": "baseUnit", + "arguments": ["#product.fk_product_abstract", 13] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 13, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 1, + "precision": 100, + "isDefault": true, + "isDisplayed": true + } + ] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 19, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 0.3048, + "precision": 100, + "isDefault": false, + "isDisplayed": true + } + ] + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_concrete_measurement_unit" + }, + { + "type": "cli-command", + "name": "console queue:worker:start --stop-when-empty" + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json new file mode 100644 index 000000000..8a23a7fc2 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json @@ -0,0 +1,286 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "productName" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductMeasurementBaseUnit", + "key": "baseUnit", + "arguments": ["#product.fk_product_abstract", 1] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 1, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 1, + "precision": 1, + "isDefault": true, + "isDisplayed": true + } + ] + }, + { + "type": "helper", + "name": "haveProductPackagingUnitType", + "key": "packagingUnitType", + "arguments": [ + { + "name": "Giftbox" + } + ] + }, + { + "type": "helper", + "name": "haveProductPackagingUnit", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "fkProductPackagingUnitType": "#packagingUnitType.id_product_packaging_unit_type", + "fkLeadProduct": "#product.id_product_concrete" + }, + { + "defaultAmount": 100, + "isAmountVariable": true, + "amountMin": 100, + "amountMax": 1000, + "amountInterval": 10 + } + ] + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_concrete_measurement_unit" + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_packaging_unit" + }, + { + "type": "cli-command", + "name": "console queue:worker:start --stop-when-empty" + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-measurement-unit/static-measurement-unit-checkout.json b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/static-measurement-unit-checkout.json new file mode 100644 index 000000000..45ef4e651 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/static-measurement-unit-checkout.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "wholeSalesUnit": { + "name": "Meter", + "quantity": 10 + }, + "fractionalSalesUnit": { + "name": "Foot", + "quantity": 3 + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-measurement-unit/static-packaging-unit-checkout.json b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/static-packaging-unit-checkout.json new file mode 100644 index 000000000..073fda332 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-measurement-unit/static-packaging-unit-checkout.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "rejectedAmount": 51, + "acceptedAmount": 1000 +} diff --git a/cypress/fixtures/b2b-mp/yves/product-offer/dynamic-multistore-product-offer.json b/cypress/fixtures/b2b-mp/yves/product-offer/dynamic-multistore-product-offer.json new file mode 100644 index 000000000..d50efbbff --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-offer/dynamic-multistore-product-offer.json @@ -0,0 +1,184 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "storePrimary", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "storeSecondary", + "arguments": { + "id_store": 2, + "name": "AT" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#storePrimary", "#storeSecondary"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "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" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "storeRelation": { + "id_stores": [1, 2] + } + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchantToUnassign", + "arguments": [ + { + "storeRelation": { + "id_stores": [1, 2] + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOfferToUnassign", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchantToUnassign.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOfferToUnassign.id_product_offer", + "productOfferReference": "#productOfferToUnassign.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchantToUnassign.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-offer/dynamic-offer-availability.json b/cypress/fixtures/b2b-mp/yves/product-offer/dynamic-offer-availability.json new file mode 100644 index 000000000..5c0736445 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-offer/dynamic-offer-availability.json @@ -0,0 +1,356 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute" + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "orderingCustomerCompanyUser", + "arguments": [ + { + "customer": "#orderingCustomer", + "fkCustomer": "#orderingCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "cartCustomerCompanyUser", + "arguments": [ + { + "customer": "#cartCustomer", + "fkCustomer": "#cartCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "quantity": 3, + "isNeverOutOfStock": false + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#merchantProduct.sku", + "abstractSku": "#merchantProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference", + "productOfferReference": "#productOffer.product_offer_reference" + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#merchantProduct.sku", + "abstractSku": "#merchantProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference", + "productOfferReference": "#productOffer.product_offer_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product-offer/static-multistore-product-offer.json b/cypress/fixtures/b2b-mp/yves/product-offer/static-multistore-product-offer.json new file mode 100644 index 000000000..292da643d --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-offer/static-multistore-product-offer.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "160", + "secondaryStorePrice": "260" +} diff --git a/cypress/fixtures/b2b-mp/yves/product-offer/static-offer-availability.json b/cypress/fixtures/b2b-mp/yves/product-offer/static-offer-availability.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product-offer/static-offer-availability.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-availability-calculation.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-availability-calculation.json new file mode 100644 index 000000000..cc4e1a603 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-availability-calculation.json @@ -0,0 +1,283 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "orderingCustomerCompanyUser", + "arguments": [ + { + "customer": "#orderingCustomer", + "fkCustomer": "#orderingCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "cartCustomerCompanyUser", + "arguments": [ + { + "customer": "#cartCustomer", + "fkCustomer": "#cartCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "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": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "quantity": 3, + "isNeverOutOfStock": false + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-back-in-stock-notification.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-back-in-stock-notification.json new file mode 100644 index 000000000..eb77c8327 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-back-in-stock-notification.json @@ -0,0 +1,258 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "outOfStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "outOfStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#outOfStockProduct.abstract_sku", + "skuProduct": "#outOfStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#outOfStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 0 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#outOfStockProduct.id_product_concrete", + "idProductAbstract": "#outOfStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "inStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "inStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#inStockProduct.abstract_sku", + "skuProduct": "#inStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#inStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 20 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#inStockProduct.id_product_concrete", + "idProductAbstract": "#inStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-customer-specific-prices.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-customer-specific-prices.json new file mode 100644 index 000000000..20e8af688 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-customer-specific-prices.json @@ -0,0 +1,277 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "getCurrencyByIsoCode", + "key": "currency", + "arguments": ["EUR"] + }, + { + "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": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#changeCartItemPermission", "#removeCartItemPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "defaultPriceBusinessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "merchantPriceBusinessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "defaultPriceCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "arguments": [ + { + "customer": "#defaultPriceCustomer", + "fkCustomer": "#defaultPriceCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#defaultPriceBusinessUnit.id_company_business_unit", + "isActive": true, + "isDefault": true + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "merchantPriceCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "arguments": [ + { + "customer": "#merchantPriceCustomer", + "fkCustomer": "#merchantPriceCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#merchantPriceBusinessUnit.id_company_business_unit", + "isActive": true, + "isDefault": true + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantRelationship", + "key": "merchantRelationship", + "arguments": [ + { + "fkMerchant": "#merchant.id_merchant", + "fkCompanyBusinessUnit": "#merchantPriceBusinessUnit.id_company_business_unit", + "assigneeCompanyBusinessUnits": { + "companyBusinessUnits": [ + { + "idCompanyBusinessUnit": "#merchantPriceBusinessUnit.id_company_business_unit" + } + ] + } + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ], + "prices": [ + { + "priceTypeName": "DEFAULT", + "priceType": { + "name": "DEFAULT" + }, + "priceDimension": { + "type": "PRICE_DIMENSION_DEFAULT" + }, + "moneyValue": { + "fkStore": "#store.id_store", + "fkCurrency": "#currency.id_currency", + "netAmount": 9000, + "grossAmount": 10000 + } + }, + { + "priceTypeName": "DEFAULT", + "priceType": { + "name": "DEFAULT" + }, + "priceDimension": { + "type": "PRICE_DIMENSION_MERCHANT_RELATIONSHIP", + "idMerchantRelationship": "#merchantRelationship.id_merchant_relationship" + }, + "moneyValue": { + "fkStore": "#store.id_store", + "fkCurrency": "#currency.id_currency", + "netAmount": 7000, + "grossAmount": 8000 + } + } + ] + } + ] + }, + { + "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"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-discontinued-alternative-products.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-discontinued-alternative-products.json new file mode 100644 index 000000000..ce122ec9d --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-discontinued-alternative-products.json @@ -0,0 +1,429 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "discontinuedProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "substituteProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistSubstituteProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "discontinuedProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#discontinuedProduct.abstract_sku", + "skuProduct": "#discontinuedProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discontinuedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#discontinuedProduct.id_product_concrete", + "idProductAbstract": "#discontinuedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "substituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#substituteProduct.abstract_sku", + "skuProduct": "#substituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#substituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#substituteProduct.id_product_concrete", + "idProductAbstract": "#substituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistProduct.abstract_sku", + "skuProduct": "#wishlistProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistProduct.id_product_concrete", + "idProductAbstract": "#wishlistProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistSubstituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistSubstituteProduct.abstract_sku", + "skuProduct": "#wishlistSubstituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistSubstituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistSubstituteProduct.id_product_concrete", + "idProductAbstract": "#wishlistSubstituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#discontinuedProduct", "#substituteProduct.sku"] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#wishlistProduct", "#wishlistSubstituteProduct.sku"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-merchant-product-original-price.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-merchant-product-original-price.json new file mode 100644 index 000000000..7b58c5eea --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-merchant-product-original-price.json @@ -0,0 +1,305 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 12000, + "grossAmount": 15000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#merchantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 12000, + "grossAmount": 15000 + }, + "skuProduct": "#merchantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-multistore-product.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-multistore-product.json new file mode 100644 index 000000000..8f498dd06 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-multistore-product.json @@ -0,0 +1,170 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "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": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#product.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productToUnassign", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#productToUnassign.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-original-price.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-original-price.json new file mode 100644 index 000000000..2e2383994 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-original-price.json @@ -0,0 +1,312 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "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": [ + { + "attributes": { + "size": "S" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "size": "S" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "discountedVariant", + "arguments": [ + { + "fkProductAbstract": "#product.fk_product_abstract", + "abstractSku": "#product.abstract_sku", + "attributes": { + "size": "L" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 1200, + "grossAmount": 1500 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discountedVariant.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-product-bundle-checkout.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-product-bundle-checkout.json new file mode 100644 index 000000000..f8079a62b --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-product-bundle-checkout.json @@ -0,0 +1,417 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundleProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductOneName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductTwoName" + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundleProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#bundleProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductOne", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#bundledProductOne.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductTwo", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#bundledProductTwo.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductOne.abstract_sku", + "skuProduct": "#bundledProductOne.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductOne.id_product_concrete", + "idProductAbstract": "#bundledProductOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductTwo.abstract_sku", + "skuProduct": "#bundledProductTwo.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductTwo.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductTwo.id_product_concrete", + "idProductAbstract": "#bundledProductTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductBundle", + "key": "productBundle", + "arguments": [ + "#bundleProduct", + { + "bundledProducts": [ + { + "idProductConcrete": "#bundledProductOne.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 2, + "sku": "#bundledProductOne.sku" + }, + { + "idProductConcrete": "#bundledProductTwo.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 3, + "sku": "#bundledProductTwo.sku" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundleProduct.abstract_sku", + "skuProduct": "#bundleProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundleProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundleProduct.id_product_concrete", + "idProductAbstract": "#bundleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/dynamic-volume-prices.json b/cypress/fixtures/b2b-mp/yves/product/dynamic-volume-prices.json new file mode 100644 index 000000000..3cb044a7a --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/dynamic-volume-prices.json @@ -0,0 +1,195 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#permission", "#changeCartItemPermission", "#removeCartItemPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\":[{\"quantity\":3,\"net_price\":7000,\"gross_price\":8000}]}" + } + } + ] + }, + { + "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"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-availability-calculation.json b/cypress/fixtures/b2b-mp/yves/product/static-availability-calculation.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-availability-calculation.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-back-in-stock-notification.json b/cypress/fixtures/b2b-mp/yves/product/static-back-in-stock-notification.json new file mode 100644 index 000000000..1d4bf4a33 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-back-in-stock-notification.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "subscribedMessage": "Successfully subscribed", + "unsubscribedMessage": "Successfully unsubscribed" +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-customer-specific-prices.json b/cypress/fixtures/b2b-mp/yves/product/static-customer-specific-prices.json new file mode 100644 index 000000000..efdc09b22 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-customer-specific-prices.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "prices": { + "defaultPrice": "€100.00", + "merchantPrice": "€80.00" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-discontinued-alternative-products.json b/cypress/fixtures/b2b-mp/yves/product/static-discontinued-alternative-products.json new file mode 100644 index 000000000..e995b82d1 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-discontinued-alternative-products.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "discontinuedLabel": "Discontinued", + "alternativeLabel": "Alternative for" +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-merchant-product-original-price.json b/cypress/fixtures/b2b-mp/yves/product/static-merchant-product-original-price.json new file mode 100644 index 000000000..b77e06b7b --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-merchant-product-original-price.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€150.00" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-multistore-product.json b/cypress/fixtures/b2b-mp/yves/product/static-multistore-product.json new file mode 100644 index 000000000..55ec7b509 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-multistore-product.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "150", + "secondaryStorePrice": "250", + "unassignedStoreProductPrice": "180", + "currencySymbol": "€" +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-original-price.json b/cypress/fixtures/b2b-mp/yves/product/static-original-price.json new file mode 100644 index 000000000..3d9e21367 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-original-price.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€200.00" + }, + "variant": { + "attributeKey": "size", + "attributeValue": "L", + "default": "€15.00", + "original": "€50.00" + } +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-product-bundle-checkout.json b/cypress/fixtures/b2b-mp/yves/product/static-product-bundle-checkout.json new file mode 100644 index 000000000..b6fdce266 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-product-bundle-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyMarketplacePaymentInvoice" +} diff --git a/cypress/fixtures/b2b-mp/yves/product/static-volume-prices.json b/cypress/fixtures/b2b-mp/yves/product/static-volume-prices.json new file mode 100644 index 000000000..9ae301f7b --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/product/static-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "quantity": 3, + "price": "€80.00" + }, + "belowTierQuantity": 2 +} diff --git a/cypress/fixtures/b2b-mp/yves/quote-request/dynamic-configurable-product-rfq.json b/cypress/fixtures/b2b-mp/yves/quote-request/dynamic-configurable-product-rfq.json new file mode 100644 index 000000000..352b4281c --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/quote-request/dynamic-configurable-product-rfq.json @@ -0,0 +1,199 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#placeOrderPermission", + "#addCartItemPermission", + "#changeCartItemPermission", + "#removeCartItemPermission", + "#placeOrderWithAmountUpToPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "WATER_TREATMENT_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/quote-request/dynamic-quote-request-lifecycle.json b/cypress/fixtures/b2b-mp/yves/quote-request/dynamic-quote-request-lifecycle.json new file mode 100644 index 000000000..0957c8123 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/quote-request/dynamic-quote-request-lifecycle.json @@ -0,0 +1,219 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#placeOrderPermission", + "#addCartItemPermission", + "#changeCartItemPermission", + "#removeCartItemPermission", + "#placeOrderWithAmountUpToPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/quote-request/static-configurable-product-rfq.json b/cypress/fixtures/b2b-mp/yves/quote-request/static-configurable-product-rfq.json new file mode 100644 index 000000000..e6fb16c16 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/quote-request/static-configurable-product-rfq.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!" +} diff --git a/cypress/fixtures/b2b-mp/yves/quote-request/static-quote-request-lifecycle.json b/cypress/fixtures/b2b-mp/yves/quote-request/static-quote-request-lifecycle.json new file mode 100644 index 000000000..21d25fa34 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/quote-request/static-quote-request-lifecycle.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "revisedItemPrice": "250", + "revisedItemPriceFormatted": "\u20ac250.00", + "originalItemPriceFormatted": "\u20ac300.00" +} diff --git a/cypress/fixtures/b2b-mp/yves/return-management/dynamic-return-creation-storefront.json b/cypress/fixtures/b2b-mp/yves/return-management/dynamic-return-creation-storefront.json new file mode 100644 index 000000000..e4cd6dff0 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/return-management/dynamic-return-creation-storefront.json @@ -0,0 +1,417 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "helper", + "name": "haveFullProduct", + "key": "firstReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstReturnedProduct.abstract_sku", + "skuProduct": "#firstReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstReturnedProduct.id_product_concrete", + "idProductAbstract": "#firstReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#firstReturnedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondReturnedProduct.abstract_sku", + "skuProduct": "#secondReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondReturnedProduct.id_product_concrete", + "idProductAbstract": "#secondReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#secondReturnedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#keptProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/return-management/static-return-creation-storefront.json b/cypress/fixtures/b2b-mp/yves/return-management/static-return-creation-storefront.json new file mode 100644 index 000000000..dd4836d2a --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/return-management/static-return-creation-storefront.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "returnDetailsTitle": "Return Details", + "waitingForReturnState": "Waiting for return", + "shippedState": "Shipped" +} diff --git a/cypress/fixtures/b2b-mp/yves/shopping-list/dynamic-shopping-list-sharing.json b/cypress/fixtures/b2b-mp/yves/shopping-list/dynamic-shopping-list-sharing.json new file mode 100644 index 000000000..9a8761a2d --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/shopping-list/dynamic-shopping-list-sharing.json @@ -0,0 +1,218 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#readShoppingListPermission", "#writeShoppingListPermission"] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "ownerCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "ownerCompanyUser", + "arguments": [ + { + "customer": "#ownerCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#ownerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "receiverCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "receiverCompanyUser", + "arguments": [ + { + "customer": "#receiverCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#receiverCompanyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/yves/shopping-list/static-shopping-list-sharing.json b/cypress/fixtures/b2b-mp/yves/shopping-list/static-shopping-list-sharing.json new file mode 100644 index 000000000..161c7beb0 --- /dev/null +++ b/cypress/fixtures/b2b-mp/yves/shopping-list/static-shopping-list-sharing.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "fullAccessText": "Full access" +} diff --git a/cypress/fixtures/b2b/backoffice/administration/dynamic-glossary-management.json b/cypress/fixtures/b2b/backoffice/administration/dynamic-glossary-management.json new file mode 100644 index 000000000..756947edb --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/administration/dynamic-glossary-management.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/backoffice/administration/static-glossary-management.json b/cypress/fixtures/b2b/backoffice/administration/static-glossary-management.json new file mode 100644 index 000000000..98d4d81e6 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/administration/static-glossary-management.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "glossaryKeyPrefix": "cart.price.test", + "translation": "This is a sample translation", + "updatedTranslation": "This is an updated translation" +} diff --git a/cypress/fixtures/b2b/backoffice/company-account/dynamic-company-structure-creation.json b/cypress/fixtures/b2b/backoffice/company-account/dynamic-company-structure-creation.json new file mode 100644 index 000000000..f0834d3a1 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/company-account/dynamic-company-structure-creation.json @@ -0,0 +1,43 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": false, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/backoffice/company-account/static-company-structure-creation.json b/cypress/fixtures/b2b/backoffice/company-account/static-company-structure-creation.json new file mode 100644 index 000000000..12d06561a --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/company-account/static-company-structure-creation.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "companyUserRolePermissionNames": ["View company users", "See Company Menu"], + "companyUserPagePath": "/company/user", + "companyRolePagePath": "/company/company-role" +} diff --git a/cypress/fixtures/b2b/backoffice/core/dynamic-dynamic-store-creation.json b/cypress/fixtures/b2b/backoffice/core/dynamic-dynamic-store-creation.json new file mode 100644 index 000000000..361b3dd28 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/core/dynamic-dynamic-store-creation.json @@ -0,0 +1,39 @@ +{ + "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": "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/backoffice/core/static-dynamic-store-creation.json b/cypress/fixtures/b2b/backoffice/core/static-dynamic-store-creation.json new file mode 100644 index 000000000..d669ec35d --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/core/static-dynamic-store-creation.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "DYNAMIC_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "175", + "cmsPageName": "dynamic-store-page", + "registrationCmsBlockNames": ["customer-registration_token--html", "customer-registration_token--text"] +} diff --git a/cypress/fixtures/b2b/backoffice/data-exchange/dynamic-api-specification-download.json b/cypress/fixtures/b2b/backoffice/data-exchange/dynamic-api-specification-download.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/data-exchange/dynamic-api-specification-download.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json b/cypress/fixtures/b2b/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/backoffice/data-exchange/static-api-specification-download.json b/cypress/fixtures/b2b/backoffice/data-exchange/static-api-specification-download.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/data-exchange/static-api-specification-download.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/backoffice/data-exchange/static-dynamic-entity-configuration.json b/cypress/fixtures/b2b/backoffice/data-exchange/static-dynamic-entity-configuration.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/data-exchange/static-dynamic-entity-configuration.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/backoffice/merchandising/dynamic-product-set-management.json b/cypress/fixtures/b2b/backoffice/merchandising/dynamic-product-set-management.json new file mode 100644 index 000000000..8b78caf7d --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/merchandising/dynamic-product-set-management.json @@ -0,0 +1,318 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "skuProduct": "#firstProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "skuProduct": "#secondProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "skuProduct": "#thirdProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdProduct.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": "#firstProduct.id_product_concrete", + "idProductAbstract": "#firstProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondProduct.id_product_concrete", + "idProductAbstract": "#secondProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdProduct.id_product_concrete", + "idProductAbstract": "#thirdProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/backoffice/merchandising/static-product-set-management.json b/cypress/fixtures/b2b/backoffice/merchandising/static-product-set-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/merchandising/static-product-set-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/backoffice/navigation/dynamic-navigation-smoke.json b/cypress/fixtures/b2b/backoffice/navigation/dynamic-navigation-smoke.json new file mode 100644 index 000000000..36e857a32 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/navigation/dynamic-navigation-smoke.json @@ -0,0 +1,24 @@ +{ + "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/backoffice/navigation/static-navigation-smoke.json b/cypress/fixtures/b2b/backoffice/navigation/static-navigation-smoke.json new file mode 100644 index 000000000..fb68dba5f --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/navigation/static-navigation-smoke.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "accessDeniedUrlPart": "/acl/index/denied" +} diff --git a/cypress/fixtures/b2b/backoffice/order-management/dynamic-configurable-product-oms.json b/cypress/fixtures/b2b/backoffice/order-management/dynamic-configurable-product-oms.json new file mode 100644 index 000000000..de0a9681e --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/order-management/dynamic-configurable-product-oms.json @@ -0,0 +1,213 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/backoffice/order-management/dynamic-order-refund.json b/cypress/fixtures/b2b/backoffice/order-management/dynamic-order-refund.json new file mode 100644 index 000000000..b44c1ff10 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/order-management/dynamic-order-refund.json @@ -0,0 +1,373 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "helper", + "name": "haveFullProduct", + "key": "firstRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstRefundedProduct.abstract_sku", + "skuProduct": "#firstRefundedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstRefundedProduct.id_product_concrete", + "idProductAbstract": "#firstRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondRefundedProduct.abstract_sku", + "skuProduct": "#secondRefundedProduct.sku", + "moneyValue": { + "netAmount": 45000, + "grossAmount": 45000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondRefundedProduct.id_product_concrete", + "idProductAbstract": "#secondRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdRefundedProduct.abstract_sku", + "skuProduct": "#thirdRefundedProduct.sku", + "moneyValue": { + "netAmount": 60000, + "grossAmount": 60000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdRefundedProduct.id_product_concrete", + "idProductAbstract": "#thirdRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/backoffice/order-management/dynamic-shipment-management.json b/cypress/fixtures/b2b/backoffice/order-management/dynamic-shipment-management.json new file mode 100644 index 000000000..58eeac6d4 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/order-management/dynamic-shipment-management.json @@ -0,0 +1,373 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "movedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#movedProduct.abstract_sku", + "skuProduct": "#movedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#movedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#movedProduct.id_product_concrete", + "idProductAbstract": "#movedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "reassignedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#reassignedProduct.abstract_sku", + "skuProduct": "#reassignedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#reassignedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#reassignedProduct.id_product_concrete", + "idProductAbstract": "#reassignedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/backoffice/order-management/static-configurable-product-oms.json b/cypress/fixtures/b2b/backoffice/order-management/static-configurable-product-oms.json new file mode 100644 index 000000000..908fc558f --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/order-management/static-configurable-product-oms.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "Skip timeout", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking" + }, + { + "state": "Ship" + } + ] +} diff --git a/cypress/fixtures/b2b/backoffice/order-management/static-order-refund.json b/cypress/fixtures/b2b/backoffice/order-management/static-order-refund.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/order-management/static-order-refund.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/backoffice/order-management/static-shipment-management.json b/cypress/fixtures/b2b/backoffice/order-management/static-shipment-management.json new file mode 100644 index 000000000..731f30ebb --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/order-management/static-shipment-management.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "newShipmentAddress": { + "salutation": "Mr", + "firstName": "Split", + "lastName": "Receiver", + "email": "split.receiver@spryker.local", + "country": "Austria", + "address1": "Hartmanngasse", + "address2": "1", + "city": "Vienna", + "zipCode": "1050" + }, + "editedShipmentAddress": { + "salutation": "Mr", + "firstName": "Corrected", + "lastName": "Receiver", + "email": "corrected.receiver@spryker.local", + "country": "Germany", + "address1": "Julie-Wolfthorn-Strasse", + "address2": "1", + "city": "Berlin", + "zipCode": "10115" + } +} diff --git a/cypress/fixtures/b2b/backoffice/product-management/dynamic-product-lifecycle-management.json b/cypress/fixtures/b2b/backoffice/product-management/dynamic-product-lifecycle-management.json new file mode 100644 index 000000000..1d0637815 --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/product-management/dynamic-product-lifecycle-management.json @@ -0,0 +1,124 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "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/backoffice/product-management/static-product-lifecycle-management.json b/cypress/fixtures/b2b/backoffice/product-management/static-product-lifecycle-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/backoffice/product-management/static-product-lifecycle-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/yves/agent-assist/dynamic-customer-impersonation.json b/cypress/fixtures/b2b/yves/agent-assist/dynamic-customer-impersonation.json new file mode 100644 index 000000000..a151c0d3a --- /dev/null +++ b/cypress/fixtures/b2b/yves/agent-assist/dynamic-customer-impersonation.json @@ -0,0 +1,201 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/agent-assist/static-customer-impersonation.json b/cypress/fixtures/b2b/yves/agent-assist/static-customer-impersonation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/yves/agent-assist/static-customer-impersonation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/yves/cart/dynamic-shared-cart.json b/cypress/fixtures/b2b/yves/cart/dynamic-shared-cart.json new file mode 100644 index 000000000..d93e39880 --- /dev/null +++ b/cypress/fixtures/b2b/yves/cart/dynamic-shared-cart.json @@ -0,0 +1,283 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "ownerCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "ownerAddress", + "arguments": [ + { + "fkCustomer": "#ownerCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "ownerCompanyUser", + "arguments": [ + { + "customer": "#ownerCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#ownerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "receiverCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "receiverAddress", + "arguments": [ + { + "fkCustomer": "#receiverCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "receiverCompanyUser", + "arguments": [ + { + "customer": "#receiverCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#receiverCompanyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "colleagueSharedQuote", + "arguments": [ + { + "customer": "#ownerCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "idProductAbstract": "#product.fk_product_abstract", + "productOfferReference": "#productOffer.product_offer_reference", + "merchantReference": "#productOffer.merchant_reference", + "quantity": 1 + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "linkSharedQuote", + "arguments": [ + { + "customer": "#ownerCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/cart/static-shared-cart.json b/cypress/fixtures/b2b/yves/cart/static-shared-cart.json new file mode 100644 index 000000000..ca6cb8d04 --- /dev/null +++ b/cypress/fixtures/b2b/yves/cart/static-shared-cart.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "soldByText": "Sold by:", + "fullAccessText": "Full access", + "cartPreviewTitlePrefix": "Preview:" +} diff --git a/cypress/fixtures/b2b/yves/catalog/dynamic-catalog-filters.json b/cypress/fixtures/b2b/yves/catalog/dynamic-catalog-filters.json new file mode 100644 index 000000000..e824c149e --- /dev/null +++ b/cypress/fixtures/b2b/yves/catalog/dynamic-catalog-filters.json @@ -0,0 +1,41 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/catalog/dynamic-quick-add-to-cart.json b/cypress/fixtures/b2b/yves/catalog/dynamic-quick-add-to-cart.json new file mode 100644 index 000000000..1fe85cdb0 --- /dev/null +++ b/cypress/fixtures/b2b/yves/catalog/dynamic-quick-add-to-cart.json @@ -0,0 +1,109 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/catalog/static-catalog-filters.json b/cypress/fixtures/b2b/yves/catalog/static-catalog-filters.json new file mode 100644 index 000000000..51f1d1c68 --- /dev/null +++ b/cypress/fixtures/b2b/yves/catalog/static-catalog-filters.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "searchTerm": "cabinet", + "attributeFilter": { + "name": "material", + "value": "sheet steel" + }, + "filterTitles": ["Brand", "Material"], + "ascendingPriceSortLabel": "Sort by price ascending", + "descendingPriceSortLabel": "Sort by price descending" +} diff --git a/cypress/fixtures/b2b/yves/catalog/static-quick-add-to-cart.json b/cypress/fixtures/b2b/yves/catalog/static-quick-add-to-cart.json new file mode 100644 index 000000000..78e610659 --- /dev/null +++ b/cypress/fixtures/b2b/yves/catalog/static-quick-add-to-cart.json @@ -0,0 +1,15 @@ +{ + "defaultPassword": "change123", + "buyableProduct": { + "searchQuery": "Verbatim USB stick OTG", + "cartEntry": "420573" + }, + "unbuyableProduct": { + "searchQuery": "New Clairefontaine Collegeblock 8272C DIN A5, 90 sheets" + }, + "productGroup": { + "searchQuery": "M12655", + "swatchIdentifier": "Blue", + "cartEntry": "107255" + } +} diff --git a/cypress/fixtures/b2b/yves/checkout/dynamic-cart-approval-process.json b/cypress/fixtures/b2b/yves/checkout/dynamic-cart-approval-process.json new file mode 100644 index 000000000..33cf5d474 --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/dynamic-cart-approval-process.json @@ -0,0 +1,246 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "requestQuoteApprovalPermission", + "arguments": ["RequestQuoteApprovalPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "approveQuotePermission", + "arguments": ["ApproveQuotePermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "transfer", + "name": "PermissionTransfer", + "key": "limitedPlaceOrderPermission", + "arguments": { + "idPermission": "#placeOrderPermission.id_permission", + "key": "PlaceOrderPermissionPlugin", + "configuration": { + "store_multi_currency": { + "DE": { + "EUR": 10000 + } + } + } + } + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#limitedPlaceOrderPermission", "#requestQuoteApprovalPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "approverRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#placeOrderPermission", "#approveQuotePermission"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "buyer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "approver", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "buyerAddress", + "arguments": [ + { + "fkCustomer": "#buyer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "approverRoleCollection", + "arguments": { + "roles": ["#approverRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "buyerCompanyUser", + "arguments": [ + { + "customer": "#buyer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#buyerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "approverCompanyUser", + "arguments": [ + { + "customer": "#approver", + "fk_company": "#company.id_company", + "company_role_collection": ["#approverRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#approverCompanyUser", ["#approverRole"]] + }, + { + "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": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#buyer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/checkout/dynamic-checkout-authentication.json b/cypress/fixtures/b2b/yves/checkout/dynamic-checkout-authentication.json new file mode 100644 index 000000000..07002da83 --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/dynamic-checkout-authentication.json @@ -0,0 +1,81 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/checkout/dynamic-multi-merchant-order.json b/cypress/fixtures/b2b/yves/checkout/dynamic-multi-merchant-order.json new file mode 100644 index 000000000..f4df8d5af --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/dynamic-multi-merchant-order.json @@ -0,0 +1,328 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "product1", + "arguments": [ + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant1.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer1", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product3.abstract_sku", + "skuProduct": "#product3.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product3.id_product_concrete", + "idProductAbstract": "#product3.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product3.id_product_concrete", + "concreteSku": "#product3.sku", + "merchantReference": "#merchant2.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer2", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "idProductAbstract": "#product1.fk_product_abstract", + "quantity": 1 + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "idProductAbstract": "#product2.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer1.product_offer_reference", + "merchantReference": "#productOffer1.merchant_reference" + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "idProductAbstract": "#product3.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer2.product_offer_reference", + "merchantReference": "#productOffer2.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/checkout/dynamic-split-delivery.json b/cypress/fixtures/b2b/yves/checkout/dynamic-split-delivery.json new file mode 100644 index 000000000..39c73520b --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/dynamic-split-delivery.json @@ -0,0 +1,328 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product1WithStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": "havePriceProduct", + "key": "product2WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product2WithStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product3WithStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": 1 + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/checkout/static-cart-approval-process.json b/cypress/fixtures/b2b/yves/checkout/static-cart-approval-process.json new file mode 100644 index 000000000..3d27ad5a3 --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/static-cart-approval-process.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "waitingStatus": "Waiting", + "approvedStatus": "Approved" +} diff --git a/cypress/fixtures/b2b/yves/checkout/static-checkout-authentication.json b/cypress/fixtures/b2b/yves/checkout/static-checkout-authentication.json new file mode 100644 index 000000000..1e6919487 --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/static-checkout-authentication.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "registrationPassword": "Cypress!Secure1", + "salutation": "Mr" +} diff --git a/cypress/fixtures/b2b/yves/checkout/static-multi-merchant-order.json b/cypress/fixtures/b2b/yves/checkout/static-multi-merchant-order.json new file mode 100644 index 000000000..d3c54ca5b --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/static-multi-merchant-order.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3, + "soldByText": "Sold by" +} diff --git a/cypress/fixtures/b2b/yves/checkout/static-split-delivery.json b/cypress/fixtures/b2b/yves/checkout/static-split-delivery.json new file mode 100644 index 000000000..0d6857073 --- /dev/null +++ b/cypress/fixtures/b2b/yves/checkout/static-split-delivery.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3 +} diff --git a/cypress/fixtures/b2b/yves/cms/dynamic-cms-page-publish.json b/cypress/fixtures/b2b/yves/cms/dynamic-cms-page-publish.json new file mode 100644 index 000000000..0704e54cd --- /dev/null +++ b/cypress/fixtures/b2b/yves/cms/dynamic-cms-page-publish.json @@ -0,0 +1,25 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/cms/dynamic-multistore-cms-page.json b/cypress/fixtures/b2b/yves/cms/dynamic-multistore-cms-page.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2b/yves/cms/dynamic-multistore-cms-page.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/cms/static-cms-page-publish.json b/cypress/fixtures/b2b/yves/cms/static-cms-page-publish.json new file mode 100644 index 000000000..66c3d5c9c --- /dev/null +++ b/cypress/fixtures/b2b/yves/cms/static-cms-page-publish.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "defaultLocaleName": "en_US", + "cmsPageName": "test-cms-page-publish" +} diff --git a/cypress/fixtures/b2b/yves/cms/static-multistore-cms-page.json b/cypress/fixtures/b2b/yves/cms/static-multistore-cms-page.json new file mode 100644 index 000000000..2bac107fd --- /dev/null +++ b/cypress/fixtures/b2b/yves/cms/static-multistore-cms-page.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "multistore-cms-page", + "storeName": "AT", + "localeName": "en_US" +} diff --git a/cypress/fixtures/b2b/yves/comments/dynamic-cart-comments.json b/cypress/fixtures/b2b/yves/comments/dynamic-cart-comments.json index 95940a5d2..db1c1e980 100644 --- a/cypress/fixtures/b2b/yves/comments/dynamic-cart-comments.json +++ b/cypress/fixtures/b2b/yves/comments/dynamic-cart-comments.json @@ -4,17 +4,58 @@ "attributes": { "synchronize": true, "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, { "type": "helper", "name": "haveConfirmedCustomer", "key": "customer", - "arguments": [{ "locale_name": "en_US", "password": "change123" }] + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] }, { "type": "helper", "name": "haveCompany", "key": "company", - "arguments": [{ "isActive": true, "status": "approved" }] + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] }, { "type": "helper", @@ -22,16 +63,38 @@ "key": "permission", "arguments": ["AddCartItemPermissionPlugin"] }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, { "type": "helper", "name": "haveCompanyRoleWithPermissions", - "arguments": [{ "isDefault": true, "fkCompany": "#company.id_company" }, ["#permission"]] + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#permission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] }, { "type": "helper", "name": "haveCompanyBusinessUnit", "key": "businessUnitFromCompany", - "arguments": [{ "fkCompany": "#company.id_company" }] + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] }, { "type": "helper", @@ -50,19 +113,31 @@ "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { "id_store": 1 } + "arguments": { + "id_store": 1 + } }, { "type": "helper", "name": "haveFullProduct", "key": "product1", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] }, { "type": "helper", "name": "haveFullProduct", "key": "product2", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] }, { "type": "helper", @@ -71,7 +146,10 @@ { "skuProductAbstract": "#product1.abstract_sku", "skuProduct": "#product1.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, @@ -82,19 +160,34 @@ { "skuProductAbstract": "#product2.abstract_sku", "skuProduct": "#product2.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "transfer", @@ -155,7 +248,11 @@ "type": "helper", "name": "havePersistentQuote", "key": "emptyQuote", - "arguments": [{ "customer": "#customer" }] + "arguments": [ + { + "customer": "#customer" + } + ] } ] } diff --git a/cypress/fixtures/b2b/yves/comments/dynamic-order-comments.json b/cypress/fixtures/b2b/yves/comments/dynamic-order-comments.json new file mode 100644 index 000000000..b7e750900 --- /dev/null +++ b/cypress/fixtures/b2b/yves/comments/dynamic-order-comments.json @@ -0,0 +1,247 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "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 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/comments/static-cart-comments.json b/cypress/fixtures/b2b/yves/comments/static-cart-comments.json index 05511e655..42332182f 100644 --- a/cypress/fixtures/b2b/yves/comments/static-cart-comments.json +++ b/cypress/fixtures/b2b/yves/comments/static-cart-comments.json @@ -6,5 +6,6 @@ ], "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." + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "commentToKeepThroughCheckout": "Please leave the parcel with the building concierge." } diff --git a/cypress/fixtures/b2b/yves/comments/static-order-comments.json b/cypress/fixtures/b2b/yves/comments/static-order-comments.json new file mode 100644 index 000000000..b85b30324 --- /dev/null +++ b/cypress/fixtures/b2b/yves/comments/static-order-comments.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "commentOnOrder": "Please call the site office before delivering this order." +} diff --git a/cypress/fixtures/b2b/yves/company-account/dynamic-business-on-behalf.json b/cypress/fixtures/b2b/yves/company-account/dynamic-business-on-behalf.json new file mode 100644 index 000000000..c95a3ddee --- /dev/null +++ b/cypress/fixtures/b2b/yves/company-account/dynamic-business-on-behalf.json @@ -0,0 +1,122 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "firstBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "secondBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "firstCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#firstBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#firstCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "secondCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#secondBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#secondCompanyUser", ["#buyerRole"]] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/company-account/dynamic-business-unit-address-checkout.json b/cypress/fixtures/b2b/yves/company-account/dynamic-business-unit-address-checkout.json new file mode 100644 index 000000000..6defbf297 --- /dev/null +++ b/cypress/fixtures/b2b/yves/company-account/dynamic-business-unit-address-checkout.json @@ -0,0 +1,181 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission", "#placeOrderWithAmountUpToPermission", "#addCartItemPermission"] + ] + }, + { + "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": "haveCompanyUnitAddress", + "key": "businessUnitAddress", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCountry": "#country.id_country", + "address1": "Business Unit Street", + "address2": "23", + "zipCode": "8002", + "city": "Barcelona", + "phone": "3490284322" + } + ] + }, + { + "type": "transfer", + "name": "CompanyBusinessUnitTransfer", + "key": "businessUnitWithAddress", + "arguments": { + "idCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "fkCompany": "#company.id_company", + "addressCollection": { + "companyUnitAddresses": ["#businessUnitAddress"] + } + } + }, + { + "type": "helper", + "name": "haveCompanyUnitAddressToCompanyBusinessUnitRelation", + "arguments": ["#businessUnitWithAddress"] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/company-account/dynamic-company-structure-creation.json b/cypress/fixtures/b2b/yves/company-account/dynamic-company-structure-creation.json new file mode 100644 index 000000000..dbb821032 --- /dev/null +++ b/cypress/fixtures/b2b/yves/company-account/dynamic-company-structure-creation.json @@ -0,0 +1,137 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": false, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "companyBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyRoles", + "arguments": ["SeeCompanyRolesPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "createCompanyRoles", + "arguments": ["CreateCompanyRolesPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyUsers", + "arguments": ["SeeCompanyUsersPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCompanyUser", + "arguments": ["AddCompanyUserPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyMenu", + "arguments": ["SeeCompanyMenuPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "adminRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#seeCompanyRoles", "#createCompanyRoles", "#seeCompanyUsers", "#addCompanyUser", "#seeCompanyMenu"] + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "restrictedRole", + "arguments": [ + { + "fk_company": "#company.id_company", + "name": "ViewCompanyUsersOnly" + }, + ["#seeCompanyUsers", "#seeCompanyMenu"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "adminCustomer", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "adminRoleCollection", + "arguments": { + "roles": ["#adminRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "adminCompanyUser", + "arguments": [ + { + "customer": "#adminCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#adminRoleCollection"], + "fk_company_business_unit": "#companyBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#adminCompanyUser", ["#adminRole"]] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/company-account/static-business-on-behalf.json b/cypress/fixtures/b2b/yves/company-account/static-business-on-behalf.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/yves/company-account/static-business-on-behalf.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/yves/company-account/static-business-unit-address-checkout.json b/cypress/fixtures/b2b/yves/company-account/static-business-unit-address-checkout.json new file mode 100644 index 000000000..c4bd9efd7 --- /dev/null +++ b/cypress/fixtures/b2b/yves/company-account/static-business-unit-address-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "businessUnitAddressStreet": "Business Unit Street" +} diff --git a/cypress/fixtures/b2b/yves/company-account/static-company-structure-creation.json b/cypress/fixtures/b2b/yves/company-account/static-company-structure-creation.json new file mode 100644 index 000000000..d36a178a0 --- /dev/null +++ b/cypress/fixtures/b2b/yves/company-account/static-company-structure-creation.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "restrictedRoleName": "ViewCompanyUsersOnly", + "companyUserPagePath": "/company/user", + "companyRolePagePath": "/company/company-role" +} diff --git a/cypress/fixtures/b2b/yves/discount/dynamic-discounts-and-promotions.json b/cypress/fixtures/b2b/yves/discount/dynamic-discounts-and-promotions.json new file mode 100644 index 000000000..3aca90e72 --- /dev/null +++ b/cypress/fixtures/b2b/yves/discount/dynamic-discounts-and-promotions.json @@ -0,0 +1,337 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "requestQuoteApprovalPermission", + "arguments": ["RequestQuoteApprovalPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [ + "#placeOrderPermission", + "#placeOrderWithAmountUpToPermission", + "#requestQuoteApprovalPermission", + "#changeCartItemPermission", + "#addCartItemPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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", + "defaultCurrencyIsoCode": "EUR" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + { + "attributes": { + "brand": "Discounts and promotions fixture" + } + }, + { + "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": "haveFullProduct", + "key": "promotionalProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#promotionalProduct.abstract_sku", + "skuProduct": "#promotionalProduct.sku", + "moneyValue": { + "netAmount": 7500, + "grossAmount": 7500 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#promotionalProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "voucherDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 500, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "voucherCode", + "arguments": [ + { + "idDiscount": "#voucherDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "cartRuleDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "cart_rule", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 1000, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "promotionDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 10000, + "collectorStrategyType": "promotion", + "discountPromotion": { + "abstractSkus": ["#promotionalProduct.abstract_sku"], + "abstractSku": "#promotionalProduct.abstract_sku", + "quantity": 2 + } + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "promotionVoucherCode", + "arguments": [ + { + "idDiscount": "#promotionDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/discount/static-discounts-and-promotions.json b/cypress/fixtures/b2b/yves/discount/static-discounts-and-promotions.json new file mode 100644 index 000000000..09e05a7d0 --- /dev/null +++ b/cypress/fixtures/b2b/yves/discount/static-discounts-and-promotions.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/b2b/yves/merchandising/dynamic-product-relations.json b/cypress/fixtures/b2b/yves/merchandising/dynamic-product-relations.json new file mode 100644 index 000000000..7108237ad --- /dev/null +++ b/cypress/fixtures/b2b/yves/merchandising/dynamic-product-relations.json @@ -0,0 +1,242 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "relatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithoutRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithRelatedProduct.abstract_sku", + "skuProduct": "#productWithRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#relatedProduct.abstract_sku", + "skuProduct": "#relatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithoutRelatedProduct.abstract_sku", + "skuProduct": "#productWithoutRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithRelatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#relatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithoutRelatedProduct.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": "#productWithRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#relatedProduct.id_product_concrete", + "idProductAbstract": "#relatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productWithoutRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithoutRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "transfer", + "name": "StoreRelationTransfer", + "key": "storeRelation", + "arguments": { + "id_stores": [1], + "stores": [ + { + "id_store": 1, + "name": "DE" + } + ] + } + }, + { + "type": "helper", + "name": "haveProductRelation", + "arguments": [ + "#relatedProduct.abstract_sku", + "#productWithRelatedProduct.fk_product_abstract", + "#relatedProduct.abstract_sku", + "related-products", + "#storeRelation" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/merchandising/dynamic-product-sets.json b/cypress/fixtures/b2b/yves/merchandising/dynamic-product-sets.json new file mode 100644 index 000000000..9df5a1a25 --- /dev/null +++ b/cypress/fixtures/b2b/yves/merchandising/dynamic-product-sets.json @@ -0,0 +1,283 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#changeCartItemPermission", "#removeCartItemPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fkCustomer": "#customer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "variantProduct", + "arguments": [ + { + "attributes": { + "material": "steel" + } + }, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "secondVariantProduct", + "arguments": [ + { + "fkProductAbstract": "#variantProduct.fk_product_abstract", + "abstractSku": "#variantProduct.abstract_sku", + "attributes": { + "material": "aluminium" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "simpleProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#variantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 40000, + "grossAmount": 40000 + }, + "skuProduct": "#secondVariantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#simpleProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondVariantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#simpleProduct.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": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#simpleProduct.id_product_concrete", + "idProductAbstract": "#simpleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/merchandising/static-product-relations.json b/cypress/fixtures/b2b/yves/merchandising/static-product-relations.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/yves/merchandising/static-product-relations.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/yves/merchandising/static-product-sets.json b/cypress/fixtures/b2b/yves/merchandising/static-product-sets.json new file mode 100644 index 000000000..8d9527347 --- /dev/null +++ b/cypress/fixtures/b2b/yves/merchandising/static-product-sets.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "material", + "variantAttributeValue": "aluminium" +} diff --git a/cypress/fixtures/b2b/yves/merchant-b2b-contract-requests/dynamic-request-creation.json b/cypress/fixtures/b2b/yves/merchant-b2b-contract-requests/dynamic-request-creation.json index 472fc3fb4..6cef4d436 100644 --- a/cypress/fixtures/b2b/yves/merchant-b2b-contract-requests/dynamic-request-creation.json +++ b/cypress/fixtures/b2b/yves/merchant-b2b-contract-requests/dynamic-request-creation.json @@ -10,7 +10,10 @@ "key": "merchant1", "arguments": [ { - "isOpenForRelationRequest": true + "isOpenForRelationRequest": true, + "storeRelation": { + "idStores": [1] + } } ] }, diff --git a/cypress/fixtures/b2b/yves/order-management/dynamic-order-cancellation.json b/cypress/fixtures/b2b/yves/order-management/dynamic-order-cancellation.json new file mode 100644 index 000000000..ced337505 --- /dev/null +++ b/cypress/fixtures/b2b/yves/order-management/dynamic-order-cancellation.json @@ -0,0 +1,441 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "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": "haveConfirmedCustomer", + "key": "wholeOrderCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "wholeOrderAddress", + "arguments": [ + { + "fkCustomer": "#wholeOrderCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "wholeOrderCustomerCompanyUser", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "fkCustomer": "#wholeOrderCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "mixedStateCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "mixedStateAddress", + "arguments": [ + { + "fkCustomer": "#mixedStateCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "mixedStateCustomerCompanyUser", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "fkCustomer": "#mixedStateCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wholeOrderProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wholeOrderProduct.abstract_sku", + "skuProduct": "#wholeOrderProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wholeOrderProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wholeOrderProduct.id_product_concrete", + "idProductAbstract": "#wholeOrderProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "advancedItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#advancedItemProduct.abstract_sku", + "skuProduct": "#advancedItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#advancedItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#advancedItemProduct.id_product_concrete", + "idProductAbstract": "#advancedItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "cancellableItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#cancellableItemProduct.abstract_sku", + "skuProduct": "#cancellableItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#cancellableItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#cancellableItemProduct.id_product_concrete", + "idProductAbstract": "#cancellableItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/order-management/static-order-cancellation.json b/cypress/fixtures/b2b/yves/order-management/static-order-cancellation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b/yves/order-management/static-order-cancellation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2b/yves/product-bundle/dynamic-configurable-bundle-checkout.json b/cypress/fixtures/b2b/yves/product-bundle/dynamic-configurable-bundle-checkout.json new file mode 100644 index 000000000..9b2b039ab --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-bundle/dynamic-configurable-bundle-checkout.json @@ -0,0 +1,102 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomerWithAddress", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "bundleBuyerPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "bundleBuyerPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "bundleBuyerPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "bundleBuyerPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "bundleBuyerPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#bundleBuyerPermission1", + "#bundleBuyerPermission2", + "#bundleBuyerPermission3", + "#bundleBuyerPermission4", + "#bundleBuyerPermission5" + ] + ] + }, + { + "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/product-bundle/static-configurable-bundle-checkout.json b/cypress/fixtures/b2b/yves/product-bundle/static-configurable-bundle-checkout.json new file mode 100644 index 000000000..a52ff8de0 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-bundle/static-configurable-bundle-checkout.json @@ -0,0 +1,24 @@ +{ + "defaultPassword": "change123", + "templateName": "Presentation bundle", + "firstConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "408104" + }, + { + "slotName": "Slot 6", + "productIdentifier": "423172" + } + ], + "secondConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "421539" + }, + { + "slotName": "Slot 6", + "productIdentifier": "423173" + } + ] +} diff --git a/cypress/fixtures/b2b/yves/product-configurator/dynamic-configurable-product-checkout.json b/cypress/fixtures/b2b/yves/product-configurator/dynamic-configurable-product-checkout.json new file mode 100644 index 000000000..d26a8c287 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-configurator/dynamic-configurable-product-checkout.json @@ -0,0 +1,198 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#addCartItemPermission", + "#placeOrderPermission", + "#changeCartItemPermission", + "#removeCartItemPermission", + "#placeOrderWithAmountUpToPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product-configurator/dynamic-configurable-product-shopping-list.json b/cypress/fixtures/b2b/yves/product-configurator/dynamic-configurable-product-shopping-list.json new file mode 100644 index 000000000..747153b78 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-configurator/dynamic-configurable-product-shopping-list.json @@ -0,0 +1,195 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [ + "#readShoppingListPermission", + "#writeShoppingListPermission", + "#addCartItemPermission", + "#changeCartItemPermission", + "#removeCartItemPermission" + ] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 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": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "0", + "quantity": 5 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product-configurator/static-configurable-product-checkout.json b/cypress/fixtures/b2b/yves/product-configurator/static-configurable-product-checkout.json new file mode 100644 index 000000000..64482fe0b --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-configurator/static-configurable-product-checkout.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/b2b/yves/product-configurator/static-configurable-product-shopping-list.json b/cypress/fixtures/b2b/yves/product-configurator/static-configurable-product-shopping-list.json new file mode 100644 index 000000000..a99d48b63 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-configurator/static-configurable-product-shopping-list.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "unconfiguredCheckoutBlockedMessage": "Please configure items inside the cart.", + "availableStock": 5 +} diff --git a/cypress/fixtures/b2b/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json b/cypress/fixtures/b2b/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json new file mode 100644 index 000000000..bd5ae8ff7 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json @@ -0,0 +1,238 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductMeasurementBaseUnit", + "key": "baseUnit", + "arguments": ["#product.fk_product_abstract", 13] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 13, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 1, + "precision": 100, + "isDefault": true, + "isDisplayed": true + } + ] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 19, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 0.3048, + "precision": 100, + "isDefault": false, + "isDisplayed": true + } + ] + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_concrete_measurement_unit" + }, + { + "type": "cli-command", + "name": "console queue:worker:start --stop-when-empty" + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json b/cypress/fixtures/b2b/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json new file mode 100644 index 000000000..5259a892f --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json @@ -0,0 +1,271 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductMeasurementBaseUnit", + "key": "baseUnit", + "arguments": ["#product.fk_product_abstract", 1] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 1, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 1, + "precision": 1, + "isDefault": true, + "isDisplayed": true + } + ] + }, + { + "type": "helper", + "name": "haveProductPackagingUnitType", + "key": "packagingUnitType", + "arguments": [ + { + "name": "Giftbox" + } + ] + }, + { + "type": "helper", + "name": "haveProductPackagingUnit", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "fkProductPackagingUnitType": "#packagingUnitType.id_product_packaging_unit_type", + "fkLeadProduct": "#product.id_product_concrete" + }, + { + "defaultAmount": 100, + "isAmountVariable": true, + "amountMin": 100, + "amountMax": 1000, + "amountInterval": 10 + } + ] + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_concrete_measurement_unit" + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_packaging_unit" + }, + { + "type": "cli-command", + "name": "console queue:worker:start --stop-when-empty" + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product-measurement-unit/static-measurement-unit-checkout.json b/cypress/fixtures/b2b/yves/product-measurement-unit/static-measurement-unit-checkout.json new file mode 100644 index 000000000..45ef4e651 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-measurement-unit/static-measurement-unit-checkout.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "wholeSalesUnit": { + "name": "Meter", + "quantity": 10 + }, + "fractionalSalesUnit": { + "name": "Foot", + "quantity": 3 + } +} diff --git a/cypress/fixtures/b2b/yves/product-measurement-unit/static-packaging-unit-checkout.json b/cypress/fixtures/b2b/yves/product-measurement-unit/static-packaging-unit-checkout.json new file mode 100644 index 000000000..073fda332 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product-measurement-unit/static-packaging-unit-checkout.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "rejectedAmount": 51, + "acceptedAmount": 1000 +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-availability-calculation.json b/cypress/fixtures/b2b/yves/product/dynamic-availability-calculation.json new file mode 100644 index 000000000..a11ac61a3 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-availability-calculation.json @@ -0,0 +1,266 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "orderingCustomerCompanyUser", + "arguments": [ + { + "customer": "#orderingCustomer", + "fkCustomer": "#orderingCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "cartCustomerCompanyUser", + "arguments": [ + { + "customer": "#cartCustomer", + "fkCustomer": "#cartCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "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": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "quantity": 3, + "isNeverOutOfStock": false + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-back-in-stock-notification.json b/cypress/fixtures/b2b/yves/product/dynamic-back-in-stock-notification.json new file mode 100644 index 000000000..eb77c8327 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-back-in-stock-notification.json @@ -0,0 +1,258 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "outOfStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "outOfStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#outOfStockProduct.abstract_sku", + "skuProduct": "#outOfStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#outOfStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 0 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#outOfStockProduct.id_product_concrete", + "idProductAbstract": "#outOfStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "inStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "inStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#inStockProduct.abstract_sku", + "skuProduct": "#inStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#inStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 20 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#inStockProduct.id_product_concrete", + "idProductAbstract": "#inStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-discontinued-alternative-products.json b/cypress/fixtures/b2b/yves/product/dynamic-discontinued-alternative-products.json new file mode 100644 index 000000000..ce122ec9d --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-discontinued-alternative-products.json @@ -0,0 +1,429 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "discontinuedProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "substituteProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistSubstituteProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "discontinuedProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#discontinuedProduct.abstract_sku", + "skuProduct": "#discontinuedProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discontinuedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#discontinuedProduct.id_product_concrete", + "idProductAbstract": "#discontinuedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "substituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#substituteProduct.abstract_sku", + "skuProduct": "#substituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#substituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#substituteProduct.id_product_concrete", + "idProductAbstract": "#substituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistProduct.abstract_sku", + "skuProduct": "#wishlistProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistProduct.id_product_concrete", + "idProductAbstract": "#wishlistProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistSubstituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistSubstituteProduct.abstract_sku", + "skuProduct": "#wishlistSubstituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistSubstituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistSubstituteProduct.id_product_concrete", + "idProductAbstract": "#wishlistSubstituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#discontinuedProduct", "#substituteProduct.sku"] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#wishlistProduct", "#wishlistSubstituteProduct.sku"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-multistore-product.json b/cypress/fixtures/b2b/yves/product/dynamic-multistore-product.json new file mode 100644 index 000000000..8f498dd06 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-multistore-product.json @@ -0,0 +1,170 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "companyPermission1", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission2", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission3", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission4", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission5", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "companyPermission6", + "arguments": ["SeeBusinessUnitOrdersPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#companyPermission1", + "#companyPermission2", + "#companyPermission3", + "#companyPermission4", + "#companyPermission5", + "#companyPermission6" + ] + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "customerCompanyUser", + "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": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#product.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productToUnassign", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#productToUnassign.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-original-price.json b/cypress/fixtures/b2b/yves/product/dynamic-original-price.json new file mode 100644 index 000000000..2e2383994 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-original-price.json @@ -0,0 +1,312 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "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": [ + { + "attributes": { + "size": "S" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "size": "S" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "discountedVariant", + "arguments": [ + { + "fkProductAbstract": "#product.fk_product_abstract", + "abstractSku": "#product.abstract_sku", + "attributes": { + "size": "L" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 1200, + "grossAmount": 1500 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discountedVariant.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-product-bundle-checkout.json b/cypress/fixtures/b2b/yves/product/dynamic-product-bundle-checkout.json new file mode 100644 index 000000000..95478a251 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-product-bundle-checkout.json @@ -0,0 +1,382 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#addCartItemPermission", "#placeOrderPermission", "#placeOrderWithAmountUpToPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundleProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductOneName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductTwoName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundleProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductOne", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductTwo", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductOne.abstract_sku", + "skuProduct": "#bundledProductOne.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductOne.id_product_concrete", + "idProductAbstract": "#bundledProductOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductTwo.abstract_sku", + "skuProduct": "#bundledProductTwo.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductTwo.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductTwo.id_product_concrete", + "idProductAbstract": "#bundledProductTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductBundle", + "key": "productBundle", + "arguments": [ + "#bundleProduct", + { + "bundledProducts": [ + { + "idProductConcrete": "#bundledProductOne.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 2, + "sku": "#bundledProductOne.sku" + }, + { + "idProductConcrete": "#bundledProductTwo.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 3, + "sku": "#bundledProductTwo.sku" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundleProduct.abstract_sku", + "skuProduct": "#bundleProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundleProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundleProduct.id_product_concrete", + "idProductAbstract": "#bundleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/dynamic-volume-prices.json b/cypress/fixtures/b2b/yves/product/dynamic-volume-prices.json new file mode 100644 index 000000000..3cb044a7a --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/dynamic-volume-prices.json @@ -0,0 +1,195 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "isActive": true, + "status": "approved" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "permission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#permission", "#changeCartItemPermission", "#removeCartItemPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fkCompany": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "customer": "#customer", + "isActive": true, + "isDefault": true + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\":[{\"quantity\":3,\"net_price\":7000,\"gross_price\":8000}]}" + } + } + ] + }, + { + "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"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/product/static-availability-calculation.json b/cypress/fixtures/b2b/yves/product/static-availability-calculation.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-availability-calculation.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/b2b/yves/product/static-back-in-stock-notification.json b/cypress/fixtures/b2b/yves/product/static-back-in-stock-notification.json new file mode 100644 index 000000000..1d4bf4a33 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-back-in-stock-notification.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "subscribedMessage": "Successfully subscribed", + "unsubscribedMessage": "Successfully unsubscribed" +} diff --git a/cypress/fixtures/b2b/yves/product/static-customer-specific-prices.json b/cypress/fixtures/b2b/yves/product/static-customer-specific-prices.json new file mode 100644 index 000000000..4eb80079f --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-customer-specific-prices.json @@ -0,0 +1,21 @@ +{ + "defaultPassword": "change123", + "defaultPriceCustomer": { + "email": "Richi@acme.com", + "alternativeEmails": ["Richi@spryker.com"] + }, + "merchantPriceCustomer": { + "email": "Elizabet@acme.com", + "alternativeEmails": ["Elizabet@spryker.com"] + }, + "product": { + "abstractSku": "M70208", + "concreteSku": "403125", + "name": "EUROKRAFT trolley - with open shovel", + "cartItemName": "EUROKRAFT hand truck - with open shovel - load capacity 400 kg" + }, + "prices": { + "defaultPrice": "€235.43", + "merchantPrice": "€188.34" + } +} diff --git a/cypress/fixtures/b2b/yves/product/static-discontinued-alternative-products.json b/cypress/fixtures/b2b/yves/product/static-discontinued-alternative-products.json new file mode 100644 index 000000000..e995b82d1 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-discontinued-alternative-products.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "discontinuedLabel": "Discontinued", + "alternativeLabel": "Alternative for" +} diff --git a/cypress/fixtures/b2b/yves/product/static-multistore-product.json b/cypress/fixtures/b2b/yves/product/static-multistore-product.json new file mode 100644 index 000000000..55ec7b509 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-multistore-product.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "150", + "secondaryStorePrice": "250", + "unassignedStoreProductPrice": "180", + "currencySymbol": "€" +} diff --git a/cypress/fixtures/b2b/yves/product/static-original-price.json b/cypress/fixtures/b2b/yves/product/static-original-price.json new file mode 100644 index 000000000..3d9e21367 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-original-price.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€200.00" + }, + "variant": { + "attributeKey": "size", + "attributeValue": "L", + "default": "€15.00", + "original": "€50.00" + } +} diff --git a/cypress/fixtures/b2b/yves/product/static-product-bundle-checkout.json b/cypress/fixtures/b2b/yves/product/static-product-bundle-checkout.json new file mode 100644 index 000000000..09e05a7d0 --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-product-bundle-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/b2b/yves/product/static-volume-prices.json b/cypress/fixtures/b2b/yves/product/static-volume-prices.json new file mode 100644 index 000000000..9ae301f7b --- /dev/null +++ b/cypress/fixtures/b2b/yves/product/static-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "quantity": 3, + "price": "€80.00" + }, + "belowTierQuantity": 2 +} diff --git a/cypress/fixtures/b2b/yves/quote-request/dynamic-configurable-product-rfq.json b/cypress/fixtures/b2b/yves/quote-request/dynamic-configurable-product-rfq.json new file mode 100644 index 000000000..9af084075 --- /dev/null +++ b/cypress/fixtures/b2b/yves/quote-request/dynamic-configurable-product-rfq.json @@ -0,0 +1,199 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#placeOrderPermission", + "#addCartItemPermission", + "#changeCartItemPermission", + "#removeCartItemPermission", + "#placeOrderWithAmountUpToPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/quote-request/dynamic-quote-request-lifecycle.json b/cypress/fixtures/b2b/yves/quote-request/dynamic-quote-request-lifecycle.json new file mode 100644 index 000000000..ff489e80e --- /dev/null +++ b/cypress/fixtures/b2b/yves/quote-request/dynamic-quote-request-lifecycle.json @@ -0,0 +1,203 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCartItemPermission", + "arguments": ["AddCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "changeCartItemPermission", + "arguments": ["ChangeCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "removeCartItemPermission", + "arguments": ["RemoveCartItemPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderWithAmountUpToPermission", + "arguments": ["PlaceOrderWithAmountUpToPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + [ + "#placeOrderPermission", + "#addCartItemPermission", + "#changeCartItemPermission", + "#removeCartItemPermission", + "#placeOrderWithAmountUpToPermission" + ] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/quote-request/static-configurable-product-rfq.json b/cypress/fixtures/b2b/yves/quote-request/static-configurable-product-rfq.json new file mode 100644 index 000000000..e6fb16c16 --- /dev/null +++ b/cypress/fixtures/b2b/yves/quote-request/static-configurable-product-rfq.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!" +} diff --git a/cypress/fixtures/b2b/yves/quote-request/static-quote-request-lifecycle.json b/cypress/fixtures/b2b/yves/quote-request/static-quote-request-lifecycle.json new file mode 100644 index 000000000..21d25fa34 --- /dev/null +++ b/cypress/fixtures/b2b/yves/quote-request/static-quote-request-lifecycle.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "revisedItemPrice": "250", + "revisedItemPriceFormatted": "\u20ac250.00", + "originalItemPriceFormatted": "\u20ac300.00" +} diff --git a/cypress/fixtures/b2b/yves/return-management/dynamic-return-creation-storefront.json b/cypress/fixtures/b2b/yves/return-management/dynamic-return-creation-storefront.json new file mode 100644 index 000000000..e803c92eb --- /dev/null +++ b/cypress/fixtures/b2b/yves/return-management/dynamic-return-creation-storefront.json @@ -0,0 +1,373 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "helper", + "name": "haveFullProduct", + "key": "firstReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstReturnedProduct.abstract_sku", + "skuProduct": "#firstReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstReturnedProduct.id_product_concrete", + "idProductAbstract": "#firstReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondReturnedProduct.abstract_sku", + "skuProduct": "#secondReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondReturnedProduct.id_product_concrete", + "idProductAbstract": "#secondReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/return-management/static-return-creation-storefront.json b/cypress/fixtures/b2b/yves/return-management/static-return-creation-storefront.json new file mode 100644 index 000000000..8cd4ad6ce --- /dev/null +++ b/cypress/fixtures/b2b/yves/return-management/static-return-creation-storefront.json @@ -0,0 +1,26 @@ +{ + "defaultPassword": "change123", + "returnDetailsTitle": "Return Details", + "waitingForReturnState": "Waiting for return", + "shippedState": "Shipped", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "Skip timeout", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking" + }, + { + "state": "Ship" + } + ] +} diff --git a/cypress/fixtures/b2b/yves/shopping-list/dynamic-shopping-list-sharing.json b/cypress/fixtures/b2b/yves/shopping-list/dynamic-shopping-list-sharing.json new file mode 100644 index 000000000..82c94eefd --- /dev/null +++ b/cypress/fixtures/b2b/yves/shopping-list/dynamic-shopping-list-sharing.json @@ -0,0 +1,192 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#readShoppingListPermission", "#writeShoppingListPermission"] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "ownerCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "ownerCompanyUser", + "arguments": [ + { + "customer": "#ownerCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#ownerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "receiverCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "receiverCompanyUser", + "arguments": [ + { + "customer": "#receiverCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#receiverCompanyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2b/yves/shopping-list/static-shopping-list-sharing.json b/cypress/fixtures/b2b/yves/shopping-list/static-shopping-list-sharing.json new file mode 100644 index 000000000..161c7beb0 --- /dev/null +++ b/cypress/fixtures/b2b/yves/shopping-list/static-shopping-list-sharing.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "fullAccessText": "Full access" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/administration/dynamic-glossary-management.json b/cypress/fixtures/b2c-mp/backoffice/administration/dynamic-glossary-management.json new file mode 100644 index 000000000..756947edb --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/administration/dynamic-glossary-management.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/backoffice/administration/static-glossary-management.json b/cypress/fixtures/b2c-mp/backoffice/administration/static-glossary-management.json new file mode 100644 index 000000000..98d4d81e6 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/administration/static-glossary-management.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "glossaryKeyPrefix": "cart.price.test", + "translation": "This is a sample translation", + "updatedTranslation": "This is an updated translation" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/core/dynamic-dynamic-store-creation.json b/cypress/fixtures/b2c-mp/backoffice/core/dynamic-dynamic-store-creation.json new file mode 100644 index 000000000..361b3dd28 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/core/dynamic-dynamic-store-creation.json @@ -0,0 +1,39 @@ +{ + "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": "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/backoffice/core/static-dynamic-store-creation.json b/cypress/fixtures/b2c-mp/backoffice/core/static-dynamic-store-creation.json new file mode 100644 index 000000000..d669ec35d --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/core/static-dynamic-store-creation.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "DYNAMIC_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "175", + "cmsPageName": "dynamic-store-page", + "registrationCmsBlockNames": ["customer-registration_token--html", "customer-registration_token--text"] +} diff --git a/cypress/fixtures/b2c-mp/backoffice/data-exchange/dynamic-api-specification-download.json b/cypress/fixtures/b2c-mp/backoffice/data-exchange/dynamic-api-specification-download.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/data-exchange/dynamic-api-specification-download.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json b/cypress/fixtures/b2c-mp/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/data-exchange/static-api-specification-download.json b/cypress/fixtures/b2c-mp/backoffice/data-exchange/static-api-specification-download.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/data-exchange/static-api-specification-download.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/data-exchange/static-dynamic-entity-configuration.json b/cypress/fixtures/b2c-mp/backoffice/data-exchange/static-dynamic-entity-configuration.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/data-exchange/static-dynamic-entity-configuration.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchandising/dynamic-product-set-management.json b/cypress/fixtures/b2c-mp/backoffice/merchandising/dynamic-product-set-management.json new file mode 100644 index 000000000..1d7e4476a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchandising/dynamic-product-set-management.json @@ -0,0 +1,237 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "skuProduct": "#firstProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "skuProduct": "#secondProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "skuProduct": "#thirdProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdProduct.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": "#firstProduct.id_product_concrete", + "idProductAbstract": "#firstProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondProduct.id_product_concrete", + "idProductAbstract": "#secondProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdProduct.id_product_concrete", + "idProductAbstract": "#thirdProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchandising/static-product-set-management.json b/cypress/fixtures/b2c-mp/backoffice/merchandising/static-product-set-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchandising/static-product-set-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-crud.json b/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-crud.json new file mode 100644 index 000000000..b6ec9a2f6 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-crud.json @@ -0,0 +1,116 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchantWaitingForApproval", + "arguments": [ + { + "status": "waiting-for-approval", + "isActive": false + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "renamedMerchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "renamedMerchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#renamedMerchant.id_merchant", + "urlPrefix": "/en/merchant/crud-rename-en-", + "url": "#renamedMerchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "key": "renamedMerchantUrlDE", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#renamedMerchant.id_merchant", + "urlPrefix": "/de/merchant/crud-rename-de-", + "url": "#renamedMerchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "unassignedMerchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "unassignedMerchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#unassignedMerchant.id_merchant", + "urlPrefix": "/en/merchant/crud-unassign-en-", + "url": "#unassignedMerchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "key": "unassignedMerchantUrlDE", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#unassignedMerchant.id_merchant", + "urlPrefix": "/de/merchant/crud-unassign-de-", + "url": "#unassignedMerchant.name" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-deactivation.json b/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-deactivation.json new file mode 100644 index 000000000..b4853e68c --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-deactivation.json @@ -0,0 +1,191 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123", + "fkLocale": 66 + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/deactivation-en-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/deactivation-de-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-user-management.json b/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-user-management.json new file mode 100644 index 000000000..90d39a543 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchant-management/dynamic-merchant-user-management.json @@ -0,0 +1,30 @@ +{ + "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": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-crud.json b/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-crud.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-crud.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-deactivation.json b/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-deactivation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-deactivation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-user-management.json b/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-user-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/merchant-management/static-merchant-user-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/navigation/dynamic-navigation-smoke.json b/cypress/fixtures/b2c-mp/backoffice/navigation/dynamic-navigation-smoke.json new file mode 100644 index 000000000..36e857a32 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/navigation/dynamic-navigation-smoke.json @@ -0,0 +1,24 @@ +{ + "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/backoffice/navigation/static-navigation-smoke.json b/cypress/fixtures/b2c-mp/backoffice/navigation/static-navigation-smoke.json new file mode 100644 index 000000000..fb68dba5f --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/navigation/static-navigation-smoke.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "accessDeniedUrlPart": "/acl/index/denied" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/navigation/static-navigation-tree-management.json b/cypress/fixtures/b2c-mp/backoffice/navigation/static-navigation-tree-management.json index 7ff82aaff..888f695a1 100644 --- a/cypress/fixtures/b2c-mp/backoffice/navigation/static-navigation-tree-management.json +++ b/cypress/fixtures/b2c-mp/backoffice/navigation/static-navigation-tree-management.json @@ -2,6 +2,6 @@ "defaultPassword": "change123", "cmsPageUrlEn": "/en/imprint", "cmsPageUrlDe": "/de/impressum", - "categoryUrlEn": "/en/computer", + "categoryUrlEn": "/en/computers", "categoryUrlDe": "/de/computer" } diff --git a/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-configurable-product-oms.json b/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-configurable-product-oms.json new file mode 100644 index 000000000..4988a08b5 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-configurable-product-oms.json @@ -0,0 +1,147 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-order-refund.json b/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-order-refund.json new file mode 100644 index 000000000..fa4fc7e6c --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-order-refund.json @@ -0,0 +1,336 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstRefundedProduct.abstract_sku", + "skuProduct": "#firstRefundedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstRefundedProduct.id_product_concrete", + "idProductAbstract": "#firstRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#firstRefundedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondRefundedProduct.abstract_sku", + "skuProduct": "#secondRefundedProduct.sku", + "moneyValue": { + "netAmount": 45000, + "grossAmount": 45000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondRefundedProduct.id_product_concrete", + "idProductAbstract": "#secondRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#secondRefundedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdRefundedProduct.abstract_sku", + "skuProduct": "#thirdRefundedProduct.sku", + "moneyValue": { + "netAmount": 60000, + "grossAmount": 60000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdRefundedProduct.id_product_concrete", + "idProductAbstract": "#thirdRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#thirdRefundedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-shipment-management.json b/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-shipment-management.json new file mode 100644 index 000000000..5a7d12ead --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/order-management/dynamic-shipment-management.json @@ -0,0 +1,336 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#keptProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "movedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#movedProduct.abstract_sku", + "skuProduct": "#movedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#movedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#movedProduct.id_product_concrete", + "idProductAbstract": "#movedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#movedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "reassignedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#reassignedProduct.abstract_sku", + "skuProduct": "#reassignedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#reassignedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#reassignedProduct.id_product_concrete", + "idProductAbstract": "#reassignedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#reassignedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/order-management/static-configurable-product-oms.json b/cypress/fixtures/b2c-mp/backoffice/order-management/static-configurable-product-oms.json new file mode 100644 index 000000000..a21f9a429 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/order-management/static-configurable-product-oms.json @@ -0,0 +1,19 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking", + "shouldTriggerOmsInCli": true + } + ] +} diff --git a/cypress/fixtures/b2c-mp/backoffice/order-management/static-order-refund.json b/cypress/fixtures/b2c-mp/backoffice/order-management/static-order-refund.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/order-management/static-order-refund.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/order-management/static-shipment-management.json b/cypress/fixtures/b2c-mp/backoffice/order-management/static-shipment-management.json new file mode 100644 index 000000000..731f30ebb --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/order-management/static-shipment-management.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "newShipmentAddress": { + "salutation": "Mr", + "firstName": "Split", + "lastName": "Receiver", + "email": "split.receiver@spryker.local", + "country": "Austria", + "address1": "Hartmanngasse", + "address2": "1", + "city": "Vienna", + "zipCode": "1050" + }, + "editedShipmentAddress": { + "salutation": "Mr", + "firstName": "Corrected", + "lastName": "Receiver", + "email": "corrected.receiver@spryker.local", + "country": "Germany", + "address1": "Julie-Wolfthorn-Strasse", + "address2": "1", + "city": "Berlin", + "zipCode": "10115" + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/product-management/dynamic-product-lifecycle-management.json b/cypress/fixtures/b2c-mp/backoffice/product-management/dynamic-product-lifecycle-management.json new file mode 100644 index 000000000..9c914ced6 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/product-management/dynamic-product-lifecycle-management.json @@ -0,0 +1,36 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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/backoffice/product-management/dynamic-product-table-filters.json b/cypress/fixtures/b2c-mp/backoffice/product-management/dynamic-product-table-filters.json index 163738786..4ad8f0da3 100644 --- a/cypress/fixtures/b2c-mp/backoffice/product-management/dynamic-product-table-filters.json +++ b/cypress/fixtures/b2c-mp/backoffice/product-management/dynamic-product-table-filters.json @@ -51,6 +51,9 @@ {}, { "idTaxSet": 1, + "storeRelation": { + "idStores": ["#storeDE.id_store"] + }, "localizedAttributes": [{ "locale": "#locale", "name": "#localizedAttribute.name" }] } ] diff --git a/cypress/fixtures/b2c-mp/backoffice/product-management/static-product-lifecycle-management.json b/cypress/fixtures/b2c-mp/backoffice/product-management/static-product-lifecycle-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/product-management/static-product-lifecycle-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/product-offer/dynamic-offer-approval.json b/cypress/fixtures/b2c-mp/backoffice/product-offer/dynamic-offer-approval.json new file mode 100644 index 000000000..3529d1299 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/product-offer/dynamic-offer-approval.json @@ -0,0 +1,165 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/product-offer/dynamic-offer-view-and-filter.json b/cypress/fixtures/b2c-mp/backoffice/product-offer/dynamic-offer-view-and-filter.json new file mode 100644 index 000000000..458fac5c2 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/product-offer/dynamic-offer-view-and-filter.json @@ -0,0 +1,293 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute1" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser1", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant1", "#merchantUser1"] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage1", + "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": "merchantProduct1", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute1.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute1.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct1.id_product_concrete", + "idProductAbstract": "#merchantProduct1.fk_product_abstract", + "productImages": ["#productImage1"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct1.abstract_sku", + "skuProduct": "#merchantProduct1.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant1.id_merchant", + "idProductAbstract": "#merchantProduct1.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct1.id_product_concrete", + "concreteSku": "#merchantProduct1.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute2" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser2", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant2", "#merchantUser2"] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage2", + "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": "merchantProduct2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct2.id_product_concrete", + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "productImages": ["#productImage2"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct2.abstract_sku", + "skuProduct": "#merchantProduct2.sku", + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant2.id_merchant", + "idProductAbstract": "#merchantProduct2.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct2.id_product_concrete", + "concreteSku": "#merchantProduct2.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/product-offer/static-offer-approval.json b/cypress/fixtures/b2c-mp/backoffice/product-offer/static-offer-approval.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/product-offer/static-offer-approval.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/product-offer/static-offer-view-and-filter.json b/cypress/fixtures/b2c-mp/backoffice/product-offer/static-offer-view-and-filter.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/product-offer/static-offer-view-and-filter.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/backoffice/warehouse/dynamic-warehouse-picking-oms.json b/cypress/fixtures/b2c-mp/backoffice/warehouse/dynamic-warehouse-picking-oms.json new file mode 100644 index 000000000..948ca7ce7 --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/warehouse/dynamic-warehouse-picking-oms.json @@ -0,0 +1,32 @@ +{ + "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": "helper", + "name": "haveUser", + "key": "warehouseUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#warehouseUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/backoffice/warehouse/static-warehouse-picking-oms.json b/cypress/fixtures/b2c-mp/backoffice/warehouse/static-warehouse-picking-oms.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/backoffice/warehouse/static-warehouse-picking-oms.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/mp/marketplace-order-management/dynamic-order-fulfilment.json b/cypress/fixtures/b2c-mp/mp/marketplace-order-management/dynamic-order-fulfilment.json new file mode 100644 index 000000000..32ef1d595 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/marketplace-order-management/dynamic-order-fulfilment.json @@ -0,0 +1,300 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#localeEN", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrl1", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 50000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute2" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage2", + "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": "merchantProduct2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct2.id_product_concrete", + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "productImages": ["#productImage2"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct2.abstract_sku", + "skuProduct": "#merchantProduct2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#merchantProduct2.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/mp/marketplace-order-management/static-order-fulfilment.json b/cypress/fixtures/b2c-mp/mp/marketplace-order-management/static-order-fulfilment.json new file mode 100644 index 000000000..b05aab1ff --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/marketplace-order-management/static-order-fulfilment.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "orderItemStates": { + "shipped": "shipped", + "delivered": "delivered" + } +} diff --git a/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/dynamic-merchant-product-management.json b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/dynamic-merchant-product-management.json new file mode 100644 index 000000000..490c81ae5 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/dynamic-merchant-product-management.json @@ -0,0 +1,171 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "variantAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "variantImage", + "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": "variantProduct", + "arguments": [ + { + "attributes": { + "color": "white" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#variantAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#variantAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "color": "white" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#variantAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#variantAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#variantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#variantImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "skuProduct": "#variantProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json index 34bd2734e..f54fa44a8 100644 --- a/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json +++ b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/dynamic-product-concrete-management.json @@ -4,23 +4,48 @@ "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": "localeEN", - "arguments": { "id_locale": 66, "locale_name": "en_US" } + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } }, { "type": "transfer", "name": "LocaleTransfer", "key": "localeDE", - "arguments": { "id_locale": 46, "locale_name": "de_DE" } + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } }, { "type": "helper", "name": "haveUser", "key": "merchantUser", - "arguments": [{ "password": "change123" }] + "arguments": [ + { + "password": "change123" + } + ] }, { "type": "helper", @@ -50,8 +75,14 @@ { "idTaxSet": 1, "localizedAttributes": [ - { "locale": "#localeEN", "name": "#localizedAttribute1.name" }, - { "locale": "#localeDE", "name": "#localizedAttribute1.name" } + { + "locale": "#localeEN", + "name": "#localizedAttribute1.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute1.name" + } ] } ] @@ -64,8 +95,14 @@ { "idTaxSet": 1, "localizedAttributes": [ - { "locale": "#localeEN", "name": "#localizedAttribute2.name" }, - { "locale": "#localeDE", "name": "#localizedAttribute2.name" } + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } ] } ] @@ -119,7 +156,10 @@ { "skuProductAbstract": "#concreteProduct1.abstract_sku", "skuProduct": "#concreteProduct1.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, @@ -130,7 +170,10 @@ { "skuProductAbstract": "#concreteProduct2.abstract_sku", "skuProduct": "#concreteProduct2.sku", - "moneyValue": { "netAmount": 20000, "grossAmount": 20000 } + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } } ] }, @@ -153,6 +196,114 @@ "idProductAbstract": "#concreteProduct2.fk_product_abstract" } ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "approvalMerchant" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "pendingLocalizedAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "pendingProductImage", + "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": "pendingProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#pendingLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#pendingLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "approvalStatus": "waiting_for_approval", + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#pendingLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#pendingLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#approvalMerchant.id_merchant", + "idProductAbstract": "#pendingProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#pendingProduct.id_product_concrete", + "idProductAbstract": "#pendingProduct.fk_product_abstract", + "productImages": ["#pendingProductImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#pendingProduct.abstract_sku", + "skuProduct": "#pendingProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#pendingProduct.sku", + "isNeverOutOfStock": "1" + } + ] } ] } diff --git a/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/static-merchant-product-management.json b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/static-merchant-product-management.json new file mode 100644 index 000000000..0f3ef46e5 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/static-merchant-product-management.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "color", + "addedConcrete": { + "attributeValue": "Grey", + "stockQuantity": 5, + "searchableLocales": ["en_US", "de_DE"] + } +} diff --git a/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/static-product-concrete-management.json b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/static-product-concrete-management.json index ba4339e8a..bdf2530b4 100644 --- a/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/static-product-concrete-management.json +++ b/cypress/fixtures/b2c-mp/mp/marketplace-product-concretes/static-product-concrete-management.json @@ -1,3 +1,8 @@ { - "defaultPassword": "change123" + "defaultPassword": "change123", + "createdProduct": { + "attributeName": "color", + "attributeValues": ["white", "black"] + }, + "pendingProductPrice": "€100.00" } diff --git a/cypress/fixtures/b2c-mp/mp/merchant-portal/dynamic-merchant-profile-update.json b/cypress/fixtures/b2c-mp/mp/merchant-portal/dynamic-merchant-profile-update.json new file mode 100644 index 000000000..76e0bb8f4 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/merchant-portal/dynamic-merchant-profile-update.json @@ -0,0 +1,74 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123", + "fkLocale": 66 + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/profile-update-en-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/profile-update-de-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/mp/merchant-portal/dynamic-product-volume-prices.json b/cypress/fixtures/b2c-mp/mp/merchant-portal/dynamic-product-volume-prices.json new file mode 100644 index 000000000..537a7226c --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/merchant-portal/dynamic-product-volume-prices.json @@ -0,0 +1,225 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "editableLocalizedAttribute" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "editableProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#editableProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#editableProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + }, + "idProduct": null, + "skuProduct": "" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/mp/merchant-portal/static-merchant-profile-update.json b/cypress/fixtures/b2c-mp/mp/merchant-portal/static-merchant-profile-update.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/merchant-portal/static-merchant-profile-update.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/mp/merchant-portal/static-product-volume-prices.json b/cypress/fixtures/b2c-mp/mp/merchant-portal/static-product-volume-prices.json new file mode 100644 index 000000000..924f30129 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/merchant-portal/static-product-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "threshold": 2, + "quantity": 4, + "price": "€10.00" + } +} diff --git a/cypress/fixtures/b2c-mp/mp/product-offer/dynamic-offer-creation.json b/cypress/fixtures/b2c-mp/mp/product-offer/dynamic-offer-creation.json new file mode 100644 index 000000000..d65a0fe0a --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/product-offer/dynamic-offer-creation.json @@ -0,0 +1,337 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "productMerchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "productMerchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#productMerchant", "#productMerchantUser"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "offerMerchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "offerMerchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#offerMerchant", "#offerMerchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#productMerchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "offeredLocalizedAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "offeredProductImage", + "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": "offeredProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#offeredLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#offeredLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#offeredLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#offeredLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#productMerchant.id_merchant", + "idProductAbstract": "#offeredProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#offeredProduct.id_product_concrete", + "idProductAbstract": "#offeredProduct.fk_product_abstract", + "productImages": ["#offeredProductImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#offeredProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#offeredProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#offeredProduct.id_product_concrete", + "concreteSku": "#offeredProduct.sku", + "merchantReference": "#offerMerchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "arguments": [ + { + "fkProductOffer": "#productOffer.id_product_offer", + "skuProductAbstract": "#offeredProduct.abstract_sku", + "skuProduct": "#offeredProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#offerMerchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/mp/product-offer/dynamic-offer-volume-prices.json b/cypress/fixtures/b2c-mp/mp/product-offer/dynamic-offer-volume-prices.json new file mode 100644 index 000000000..55aaa3f95 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/product-offer/dynamic-offer-volume-prices.json @@ -0,0 +1,270 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "key": "productOfferPrice", + "arguments": [ + { + "fkProductOffer": "#productOffer.id_product_offer", + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "editableLocalizedAttribute" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "editableProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "editableProductOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#editableProduct.id_product_concrete", + "concreteSku": "#editableProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "arguments": [ + { + "fkProductOffer": "#editableProductOffer.id_product_offer", + "skuProductAbstract": "#editableProduct.abstract_sku", + "skuProduct": "#editableProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#editableProductOffer.id_product_offer", + "productOfferReference": "#editableProductOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/mp/product-offer/static-offer-creation.json b/cypress/fixtures/b2c-mp/mp/product-offer/static-offer-creation.json new file mode 100644 index 000000000..64ac4d7f4 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/product-offer/static-offer-creation.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "storeName": "DE", + "currency": "EUR", + "offer": { + "netAmount": 180, + "grossAmount": 200, + "displayedPrice": "€200.00", + "stockQuantity": 10 + } +} diff --git a/cypress/fixtures/b2c-mp/mp/product-offer/static-offer-volume-prices.json b/cypress/fixtures/b2c-mp/mp/product-offer/static-offer-volume-prices.json new file mode 100644 index 000000000..b770896d8 --- /dev/null +++ b/cypress/fixtures/b2c-mp/mp/product-offer/static-offer-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "offerPrice": "€200.00", + "volumeTier": { + "threshold": 2, + "quantity": 4, + "price": "€10.00" + } +} diff --git a/cypress/fixtures/b2c-mp/yves/agent-assist/dynamic-customer-impersonation.json b/cypress/fixtures/b2c-mp/yves/agent-assist/dynamic-customer-impersonation.json new file mode 100644 index 000000000..09bc7181e --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/agent-assist/dynamic-customer-impersonation.json @@ -0,0 +1,154 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage", + "arguments": { + "externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", + "externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" + } + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/agent-assist/static-customer-impersonation.json b/cypress/fixtures/b2c-mp/yves/agent-assist/static-customer-impersonation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/agent-assist/static-customer-impersonation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/yves/catalog/dynamic-catalog-filters.json b/cypress/fixtures/b2c-mp/yves/catalog/dynamic-catalog-filters.json new file mode 100644 index 000000000..cb94f9064 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/catalog/dynamic-catalog-filters.json @@ -0,0 +1,340 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant1" + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant1.id_merchant", + "urlPrefix": "/en/merchant/search-one-en-", + "url": "#merchant1.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant1.id_merchant", + "urlPrefix": "/de/merchant/search-one-de-", + "url": "#merchant1.name" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant1.id_merchant", + "idProductAbstract": "#product1.fk_product_abstract" + } + ] + }, + { + "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": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2" + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant2.id_merchant", + "urlPrefix": "/en/merchant/search-two-en-", + "url": "#merchant2.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant2.id_merchant", + "urlPrefix": "/de/merchant/search-two-de-", + "url": "#merchant2.name" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant2.id_merchant", + "idProductAbstract": "#product2.fk_product_abstract" + } + ] + }, + { + "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": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/catalog/static-catalog-filters.json b/cypress/fixtures/b2c-mp/yves/catalog/static-catalog-filters.json new file mode 100644 index 000000000..b0d085ba8 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/catalog/static-catalog-filters.json @@ -0,0 +1,12 @@ +{ + "defaultPassword": "change123", + "searchTerm": "canon", + "attributeFilter": { + "name": "color", + "value": "blue" + }, + "filterTitles": ["Price", "Rating", "Label", "Brand", "Color", "Merchant"], + "ascendingPriceSortLabel": "Sort by price ascending", + "descendingPriceSortLabel": "Sort by price descending", + "merchantFilterName": "merchant_name" +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/dynamic-checkout-authentication.json b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-checkout-authentication.json new file mode 100644 index 000000000..93acd0bd2 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-checkout-authentication.json @@ -0,0 +1,96 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "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": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/dynamic-multi-merchant-order.json b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-multi-merchant-order.json new file mode 100644 index 000000000..68ba69daf --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-multi-merchant-order.json @@ -0,0 +1,344 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "productMerchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#productMerchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant1.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer1", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product3.abstract_sku", + "skuProduct": "#product3.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product3.id_product_concrete", + "idProductAbstract": "#product3.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product3.id_product_concrete", + "concreteSku": "#product3.sku", + "merchantReference": "#merchant2.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer2", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "idProductAbstract": "#product1.fk_product_abstract", + "quantity": 1, + "merchantReference": "#productMerchant.merchant_reference" + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "idProductAbstract": "#product2.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer1.product_offer_reference", + "merchantReference": "#productOffer1.merchant_reference" + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "idProductAbstract": "#product3.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer2.product_offer_reference", + "merchantReference": "#productOffer2.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/dynamic-split-delivery.json b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-split-delivery.json new file mode 100644 index 000000000..df23239bd --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/dynamic-split-delivery.json @@ -0,0 +1,285 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product1WithStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product1.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "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": "havePriceProduct", + "key": "product2WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product2WithStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product2.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product3WithStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product3.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/static-checkout-authentication.json b/cypress/fixtures/b2c-mp/yves/checkout/static-checkout-authentication.json new file mode 100644 index 000000000..1e6919487 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/static-checkout-authentication.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "registrationPassword": "Cypress!Secure1", + "salutation": "Mr" +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/static-multi-merchant-order.json b/cypress/fixtures/b2c-mp/yves/checkout/static-multi-merchant-order.json new file mode 100644 index 000000000..70c5874b1 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/static-multi-merchant-order.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3, + "soldByText": "Sold by:" +} diff --git a/cypress/fixtures/b2c-mp/yves/checkout/static-split-delivery.json b/cypress/fixtures/b2c-mp/yves/checkout/static-split-delivery.json new file mode 100644 index 000000000..0d6857073 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/checkout/static-split-delivery.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3 +} diff --git a/cypress/fixtures/b2c-mp/yves/cms/dynamic-cms-page-publish.json b/cypress/fixtures/b2c-mp/yves/cms/dynamic-cms-page-publish.json new file mode 100644 index 000000000..0704e54cd --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/cms/dynamic-cms-page-publish.json @@ -0,0 +1,25 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/cms/dynamic-multistore-cms-page.json b/cypress/fixtures/b2c-mp/yves/cms/dynamic-multistore-cms-page.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/cms/dynamic-multistore-cms-page.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/cms/static-cms-page-publish.json b/cypress/fixtures/b2c-mp/yves/cms/static-cms-page-publish.json new file mode 100644 index 000000000..66c3d5c9c --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/cms/static-cms-page-publish.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "defaultLocaleName": "en_US", + "cmsPageName": "test-cms-page-publish" +} diff --git a/cypress/fixtures/b2c-mp/yves/cms/static-multistore-cms-page.json b/cypress/fixtures/b2c-mp/yves/cms/static-multistore-cms-page.json new file mode 100644 index 000000000..2bac107fd --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/cms/static-multistore-cms-page.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "multistore-cms-page", + "storeName": "AT", + "localeName": "en_US" +} diff --git a/cypress/fixtures/b2c-mp/yves/comments/dynamic-order-comments.json b/cypress/fixtures/b2c-mp/yves/comments/dynamic-order-comments.json new file mode 100644 index 000000000..94f4dbc83 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/comments/dynamic-order-comments.json @@ -0,0 +1,166 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/comments/static-order-comments.json b/cypress/fixtures/b2c-mp/yves/comments/static-order-comments.json new file mode 100644 index 000000000..b85b30324 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/comments/static-order-comments.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "commentOnOrder": "Please call the site office before delivering this order." +} diff --git a/cypress/fixtures/b2c-mp/yves/discount/dynamic-discounts-and-promotions.json b/cypress/fixtures/b2c-mp/yves/discount/dynamic-discounts-and-promotions.json new file mode 100644 index 000000000..e7d9efa04 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/discount/dynamic-discounts-and-promotions.json @@ -0,0 +1,243 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "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", + "defaultCurrencyIsoCode": "EUR" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + { + "attributes": { + "brand": "Discounts and promotions fixture" + } + }, + { + "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": "haveFullProduct", + "key": "promotionalProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#promotionalProduct.abstract_sku", + "skuProduct": "#promotionalProduct.sku", + "moneyValue": { + "netAmount": 7500, + "grossAmount": 7500 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#promotionalProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "voucherDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 500, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "voucherCode", + "arguments": [ + { + "idDiscount": "#voucherDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "cartRuleDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "cart_rule", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 1000, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "promotionDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 10000, + "collectorStrategyType": "promotion", + "discountPromotion": { + "abstractSkus": ["#promotionalProduct.abstract_sku"], + "abstractSku": "#promotionalProduct.abstract_sku", + "quantity": 2 + } + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "promotionVoucherCode", + "arguments": [ + { + "idDiscount": "#promotionDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/discount/static-discounts-and-promotions.json b/cypress/fixtures/b2c-mp/yves/discount/static-discounts-and-promotions.json new file mode 100644 index 000000000..117f37d04 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/discount/static-discounts-and-promotions.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentCreditCard" +} diff --git a/cypress/fixtures/b2c-mp/yves/merchandising/dynamic-product-relations.json b/cypress/fixtures/b2c-mp/yves/merchandising/dynamic-product-relations.json new file mode 100644 index 000000000..49711fc7f --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/merchandising/dynamic-product-relations.json @@ -0,0 +1,208 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "relatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithoutRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithRelatedProduct.abstract_sku", + "skuProduct": "#productWithRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#relatedProduct.abstract_sku", + "skuProduct": "#relatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithoutRelatedProduct.abstract_sku", + "skuProduct": "#productWithoutRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithRelatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#relatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithoutRelatedProduct.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": "#productWithRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#relatedProduct.id_product_concrete", + "idProductAbstract": "#relatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productWithoutRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithoutRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "transfer", + "name": "StoreRelationTransfer", + "key": "storeRelation", + "arguments": { + "id_stores": [1], + "stores": [ + { + "id_store": 1, + "name": "DE" + } + ] + } + }, + { + "type": "helper", + "name": "haveProductRelation", + "arguments": [ + "#relatedProduct.abstract_sku", + "#productWithRelatedProduct.fk_product_abstract", + "#relatedProduct.abstract_sku", + "related-products", + "#storeRelation" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/merchandising/dynamic-product-sets.json b/cypress/fixtures/b2c-mp/yves/merchandising/dynamic-product-sets.json new file mode 100644 index 000000000..a99ad822f --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/merchandising/dynamic-product-sets.json @@ -0,0 +1,220 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "variantProduct", + "arguments": [ + { + "attributes": { + "storage_capacity": "32 GB" + } + }, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "secondVariantProduct", + "arguments": [ + { + "fkProductAbstract": "#variantProduct.fk_product_abstract", + "abstractSku": "#variantProduct.abstract_sku", + "attributes": { + "storage_capacity": "128 GB" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "simpleProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#variantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 40000, + "grossAmount": 40000 + }, + "skuProduct": "#secondVariantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#simpleProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondVariantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#simpleProduct.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": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#simpleProduct.id_product_concrete", + "idProductAbstract": "#simpleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/merchandising/static-product-relations.json b/cypress/fixtures/b2c-mp/yves/merchandising/static-product-relations.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/merchandising/static-product-relations.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/yves/merchandising/static-product-sets.json b/cypress/fixtures/b2c-mp/yves/merchandising/static-product-sets.json new file mode 100644 index 000000000..4c544c4a3 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/merchandising/static-product-sets.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "storage_capacity", + "variantAttributeValue": "128 GB" +} diff --git a/cypress/fixtures/b2c-mp/yves/order-management/dynamic-order-cancellation.json b/cypress/fixtures/b2c-mp/yves/order-management/dynamic-order-cancellation.json new file mode 100644 index 000000000..0fa1af709 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/order-management/dynamic-order-cancellation.json @@ -0,0 +1,391 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "wholeOrderCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "wholeOrderAddress", + "arguments": [ + { + "fkCustomer": "#wholeOrderCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "mixedStateCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "mixedStateAddress", + "arguments": [ + { + "fkCustomer": "#mixedStateCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wholeOrderProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wholeOrderProduct.abstract_sku", + "skuProduct": "#wholeOrderProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wholeOrderProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wholeOrderProduct.id_product_concrete", + "idProductAbstract": "#wholeOrderProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#wholeOrderProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "advancedItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#advancedItemProduct.abstract_sku", + "skuProduct": "#advancedItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#advancedItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#advancedItemProduct.id_product_concrete", + "idProductAbstract": "#advancedItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#advancedItemProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "cancellableItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#cancellableItemProduct.abstract_sku", + "skuProduct": "#cancellableItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#cancellableItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#cancellableItemProduct.id_product_concrete", + "idProductAbstract": "#cancellableItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#cancellableItemProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/order-management/static-order-cancellation.json b/cypress/fixtures/b2c-mp/yves/order-management/static-order-cancellation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/order-management/static-order-cancellation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c-mp/yves/product-bundle/dynamic-configurable-bundle-checkout.json b/cypress/fixtures/b2c-mp/yves/product-bundle/dynamic-configurable-bundle-checkout.json new file mode 100644 index 000000000..261431278 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-bundle/dynamic-configurable-bundle-checkout.json @@ -0,0 +1,21 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomerWithAddress", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product-bundle/static-configurable-bundle-checkout.json b/cypress/fixtures/b2c-mp/yves/product-bundle/static-configurable-bundle-checkout.json new file mode 100644 index 000000000..d8b593148 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-bundle/static-configurable-bundle-checkout.json @@ -0,0 +1,24 @@ +{ + "defaultPassword": "change123", + "templateName": "Smartstation Kit", + "firstConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "Sony Cyber-shot DSC-W830" + }, + { + "slotName": "Slot 6", + "productIdentifier": "Sony NEX-VG30E" + } + ], + "secondConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "Canon IXUS 165" + }, + { + "slotName": "Slot 6", + "productIdentifier": "Sony HDR-MV1" + } + ] +} diff --git a/cypress/fixtures/b2c-mp/yves/product-configurator/dynamic-configurable-product-checkout.json b/cypress/fixtures/b2c-mp/yves/product-configurator/dynamic-configurable-product-checkout.json new file mode 100644 index 000000000..31b31f3a4 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-configurator/dynamic-configurable-product-checkout.json @@ -0,0 +1,116 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product-configurator/static-configurable-product-checkout.json b/cypress/fixtures/b2c-mp/yves/product-configurator/static-configurable-product-checkout.json new file mode 100644 index 000000000..6a8a01225 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-configurator/static-configurable-product-checkout.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "paymentMethod": "dummyPaymentCreditCard" +} diff --git a/cypress/fixtures/b2c-mp/yves/product-offer/dynamic-multistore-product-offer.json b/cypress/fixtures/b2c-mp/yves/product-offer/dynamic-multistore-product-offer.json new file mode 100644 index 000000000..6d5cc7394 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-offer/dynamic-multistore-product-offer.json @@ -0,0 +1,199 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "storePrimary", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "storeSecondary", + "arguments": { + "id_store": 2, + "name": "AT" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#storePrimary", "#storeSecondary"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "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" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "storeRelation": { + "id_stores": [1, 2] + } + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchantToUnassign", + "arguments": [ + { + "storeRelation": { + "id_stores": [1, 2] + } + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantToUnassignUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchantToUnassign", "#merchantToUnassignUser"] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOfferToUnassign", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchantToUnassign.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOfferToUnassign.id_product_offer", + "productOfferReference": "#productOfferToUnassign.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchantToUnassign.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product-offer/dynamic-offer-availability.json b/cypress/fixtures/b2c-mp/yves/product-offer/dynamic-offer-availability.json new file mode 100644 index 000000000..cc8256988 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-offer/dynamic-offer-availability.json @@ -0,0 +1,255 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute" + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "quantity": 3, + "isNeverOutOfStock": false + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#merchantProduct.sku", + "abstractSku": "#merchantProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference", + "productOfferReference": "#productOffer.product_offer_reference" + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#merchantProduct.sku", + "abstractSku": "#merchantProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference", + "productOfferReference": "#productOffer.product_offer_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product-offer/static-multistore-product-offer.json b/cypress/fixtures/b2c-mp/yves/product-offer/static-multistore-product-offer.json new file mode 100644 index 000000000..292da643d --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-offer/static-multistore-product-offer.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "160", + "secondaryStorePrice": "260" +} diff --git a/cypress/fixtures/b2c-mp/yves/product-offer/static-offer-availability.json b/cypress/fixtures/b2c-mp/yves/product-offer/static-offer-availability.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product-offer/static-offer-availability.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-availability-calculation.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-availability-calculation.json new file mode 100644 index 000000000..35a1b8047 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-availability-calculation.json @@ -0,0 +1,182 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "quantity": 3, + "isNeverOutOfStock": false + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#product.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-back-in-stock-notification.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-back-in-stock-notification.json new file mode 100644 index 000000000..83e1d8daf --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-back-in-stock-notification.json @@ -0,0 +1,206 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "outOfStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "outOfStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#outOfStockProduct.abstract_sku", + "skuProduct": "#outOfStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#outOfStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 0 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#outOfStockProduct.id_product_concrete", + "idProductAbstract": "#outOfStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "inStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "inStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#inStockProduct.abstract_sku", + "skuProduct": "#inStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#inStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 20 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#inStockProduct.id_product_concrete", + "idProductAbstract": "#inStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-discontinued-alternative-products.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-discontinued-alternative-products.json new file mode 100644 index 000000000..c68f05312 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-discontinued-alternative-products.json @@ -0,0 +1,377 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "discontinuedProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "substituteProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistSubstituteProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "discontinuedProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#discontinuedProduct.abstract_sku", + "skuProduct": "#discontinuedProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discontinuedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#discontinuedProduct.id_product_concrete", + "idProductAbstract": "#discontinuedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "substituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#substituteProduct.abstract_sku", + "skuProduct": "#substituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#substituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#substituteProduct.id_product_concrete", + "idProductAbstract": "#substituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistProduct.abstract_sku", + "skuProduct": "#wishlistProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistProduct.id_product_concrete", + "idProductAbstract": "#wishlistProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistSubstituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistSubstituteProduct.abstract_sku", + "skuProduct": "#wishlistSubstituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistSubstituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistSubstituteProduct.id_product_concrete", + "idProductAbstract": "#wishlistSubstituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#discontinuedProduct", "#substituteProduct.sku"] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#wishlistProduct", "#wishlistSubstituteProduct.sku"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-merchant-product-original-price.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-merchant-product-original-price.json new file mode 100644 index 000000000..bf5899ff0 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-merchant-product-original-price.json @@ -0,0 +1,217 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 12000, + "grossAmount": 15000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#merchantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 12000, + "grossAmount": 15000 + }, + "skuProduct": "#merchantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-multistore-product.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-multistore-product.json new file mode 100644 index 000000000..78fd7fba2 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-multistore-product.json @@ -0,0 +1,45 @@ +{ + "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": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productToUnassign", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { "sku": "#productToUnassign.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-original-price.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-original-price.json new file mode 100644 index 000000000..e7d6638bd --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-original-price.json @@ -0,0 +1,260 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "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": [ + { + "attributes": { + "storage_capacity": "32 GB" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "storage_capacity": "32 GB" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "discountedVariant", + "arguments": [ + { + "fkProductAbstract": "#product.fk_product_abstract", + "abstractSku": "#product.abstract_sku", + "attributes": { + "storage_capacity": "128 GB" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 1200, + "grossAmount": 1500 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discountedVariant.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-product-bundle-checkout.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-product-bundle-checkout.json new file mode 100644 index 000000000..615108049 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-product-bundle-checkout.json @@ -0,0 +1,318 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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 + } + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundleProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductOneName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductTwoName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundleProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductOne", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductTwo", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductOne.abstract_sku", + "skuProduct": "#bundledProductOne.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductOne.id_product_concrete", + "idProductAbstract": "#bundledProductOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductTwo.abstract_sku", + "skuProduct": "#bundledProductTwo.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductTwo.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductTwo.id_product_concrete", + "idProductAbstract": "#bundledProductTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductBundle", + "key": "productBundle", + "arguments": [ + "#bundleProduct", + { + "bundledProducts": [ + { + "idProductConcrete": "#bundledProductOne.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 2, + "sku": "#bundledProductOne.sku" + }, + { + "idProductConcrete": "#bundledProductTwo.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 3, + "sku": "#bundledProductTwo.sku" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundleProduct.abstract_sku", + "skuProduct": "#bundleProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundleProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundleProduct.id_product_concrete", + "idProductAbstract": "#bundleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/dynamic-volume-prices.json b/cypress/fixtures/b2c-mp/yves/product/dynamic-volume-prices.json new file mode 100644 index 000000000..edf1e9aa6 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/dynamic-volume-prices.json @@ -0,0 +1,131 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\":[{\"quantity\":3,\"net_price\":7000,\"gross_price\":8000}]}" + } + } + ] + }, + { + "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"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-availability-calculation.json b/cypress/fixtures/b2c-mp/yves/product/static-availability-calculation.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-availability-calculation.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-back-in-stock-notification.json b/cypress/fixtures/b2c-mp/yves/product/static-back-in-stock-notification.json new file mode 100644 index 000000000..1d4bf4a33 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-back-in-stock-notification.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "subscribedMessage": "Successfully subscribed", + "unsubscribedMessage": "Successfully unsubscribed" +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-discontinued-alternative-products.json b/cypress/fixtures/b2c-mp/yves/product/static-discontinued-alternative-products.json new file mode 100644 index 000000000..e995b82d1 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-discontinued-alternative-products.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "discontinuedLabel": "Discontinued", + "alternativeLabel": "Alternative for" +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-merchant-product-original-price.json b/cypress/fixtures/b2c-mp/yves/product/static-merchant-product-original-price.json new file mode 100644 index 000000000..b77e06b7b --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-merchant-product-original-price.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€150.00" + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-multistore-product.json b/cypress/fixtures/b2c-mp/yves/product/static-multistore-product.json new file mode 100644 index 000000000..55ec7b509 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-multistore-product.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "150", + "secondaryStorePrice": "250", + "unassignedStoreProductPrice": "180", + "currencySymbol": "€" +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-original-price.json b/cypress/fixtures/b2c-mp/yves/product/static-original-price.json new file mode 100644 index 000000000..82050fa07 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-original-price.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€200.00" + }, + "variant": { + "attributeKey": "storage_capacity", + "attributeValue": "128 GB", + "default": "€15.00", + "original": "€50.00" + } +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-product-bundle-checkout.json b/cypress/fixtures/b2c-mp/yves/product/static-product-bundle-checkout.json new file mode 100644 index 000000000..117f37d04 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-product-bundle-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentCreditCard" +} diff --git a/cypress/fixtures/b2c-mp/yves/product/static-volume-prices.json b/cypress/fixtures/b2c-mp/yves/product/static-volume-prices.json new file mode 100644 index 000000000..9ae301f7b --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/product/static-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "quantity": 3, + "price": "€80.00" + }, + "belowTierQuantity": 2 +} diff --git a/cypress/fixtures/b2c-mp/yves/return-management/dynamic-return-creation-storefront.json b/cypress/fixtures/b2c-mp/yves/return-management/dynamic-return-creation-storefront.json new file mode 100644 index 000000000..2ea93d04c --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/return-management/dynamic-return-creation-storefront.json @@ -0,0 +1,351 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstReturnedProduct.abstract_sku", + "skuProduct": "#firstReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstReturnedProduct.id_product_concrete", + "idProductAbstract": "#firstReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#firstReturnedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondReturnedProduct.abstract_sku", + "skuProduct": "#secondReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondReturnedProduct.id_product_concrete", + "idProductAbstract": "#secondReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#secondReturnedProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#keptProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference" + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c-mp/yves/return-management/static-return-creation-storefront.json b/cypress/fixtures/b2c-mp/yves/return-management/static-return-creation-storefront.json new file mode 100644 index 000000000..1bf278f38 --- /dev/null +++ b/cypress/fixtures/b2c-mp/yves/return-management/static-return-creation-storefront.json @@ -0,0 +1,21 @@ +{ + "defaultPassword": "change123", + "returnDetailsTitle": "Return Details", + "waitingForReturnState": "Waiting for return", + "shippedState": "Shipped", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking", + "shouldTriggerOmsInCli": true + } + ], + "merchantOrderShippingActions": ["ship"] +} diff --git a/cypress/fixtures/b2c/backoffice/administration/dynamic-glossary-management.json b/cypress/fixtures/b2c/backoffice/administration/dynamic-glossary-management.json new file mode 100644 index 000000000..756947edb --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/administration/dynamic-glossary-management.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/backoffice/administration/static-glossary-management.json b/cypress/fixtures/b2c/backoffice/administration/static-glossary-management.json new file mode 100644 index 000000000..98d4d81e6 --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/administration/static-glossary-management.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "glossaryKeyPrefix": "cart.price.test", + "translation": "This is a sample translation", + "updatedTranslation": "This is an updated translation" +} diff --git a/cypress/fixtures/b2c/backoffice/core/dynamic-dynamic-store-creation.json b/cypress/fixtures/b2c/backoffice/core/dynamic-dynamic-store-creation.json new file mode 100644 index 000000000..361b3dd28 --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/core/dynamic-dynamic-store-creation.json @@ -0,0 +1,39 @@ +{ + "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": "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/backoffice/core/static-dynamic-store-creation.json b/cypress/fixtures/b2c/backoffice/core/static-dynamic-store-creation.json new file mode 100644 index 000000000..d669ec35d --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/core/static-dynamic-store-creation.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "DYNAMIC_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "175", + "cmsPageName": "dynamic-store-page", + "registrationCmsBlockNames": ["customer-registration_token--html", "customer-registration_token--text"] +} diff --git a/cypress/fixtures/b2c/backoffice/data-exchange/dynamic-api-specification-download.json b/cypress/fixtures/b2c/backoffice/data-exchange/dynamic-api-specification-download.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/data-exchange/dynamic-api-specification-download.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json b/cypress/fixtures/b2c/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/data-exchange/static-api-specification-download.json b/cypress/fixtures/b2c/backoffice/data-exchange/static-api-specification-download.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/data-exchange/static-api-specification-download.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/backoffice/data-exchange/static-dynamic-entity-configuration.json b/cypress/fixtures/b2c/backoffice/data-exchange/static-dynamic-entity-configuration.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/data-exchange/static-dynamic-entity-configuration.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/backoffice/merchandising/dynamic-product-set-management.json b/cypress/fixtures/b2c/backoffice/merchandising/dynamic-product-set-management.json new file mode 100644 index 000000000..1d7e4476a --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/merchandising/dynamic-product-set-management.json @@ -0,0 +1,237 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "skuProduct": "#firstProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "skuProduct": "#secondProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "skuProduct": "#thirdProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdProduct.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": "#firstProduct.id_product_concrete", + "idProductAbstract": "#firstProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondProduct.id_product_concrete", + "idProductAbstract": "#secondProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdProduct.id_product_concrete", + "idProductAbstract": "#thirdProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/merchandising/static-product-set-management.json b/cypress/fixtures/b2c/backoffice/merchandising/static-product-set-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/merchandising/static-product-set-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/backoffice/navigation/dynamic-navigation-smoke.json b/cypress/fixtures/b2c/backoffice/navigation/dynamic-navigation-smoke.json new file mode 100644 index 000000000..36e857a32 --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/navigation/dynamic-navigation-smoke.json @@ -0,0 +1,24 @@ +{ + "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/backoffice/navigation/static-navigation-smoke.json b/cypress/fixtures/b2c/backoffice/navigation/static-navigation-smoke.json new file mode 100644 index 000000000..fb68dba5f --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/navigation/static-navigation-smoke.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "accessDeniedUrlPart": "/acl/index/denied" +} diff --git a/cypress/fixtures/b2c/backoffice/navigation/static-navigation-tree-management.json b/cypress/fixtures/b2c/backoffice/navigation/static-navigation-tree-management.json index 7ff82aaff..888f695a1 100644 --- a/cypress/fixtures/b2c/backoffice/navigation/static-navigation-tree-management.json +++ b/cypress/fixtures/b2c/backoffice/navigation/static-navigation-tree-management.json @@ -2,6 +2,6 @@ "defaultPassword": "change123", "cmsPageUrlEn": "/en/imprint", "cmsPageUrlDe": "/de/impressum", - "categoryUrlEn": "/en/computer", + "categoryUrlEn": "/en/computers", "categoryUrlDe": "/de/computer" } diff --git a/cypress/fixtures/b2c/backoffice/order-management/dynamic-configurable-product-oms.json b/cypress/fixtures/b2c/backoffice/order-management/dynamic-configurable-product-oms.json new file mode 100644 index 000000000..c294efb8e --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/order-management/dynamic-configurable-product-oms.json @@ -0,0 +1,132 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/order-management/dynamic-order-refund.json b/cypress/fixtures/b2c/backoffice/order-management/dynamic-order-refund.json new file mode 100644 index 000000000..a9da5d82d --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/order-management/dynamic-order-refund.json @@ -0,0 +1,292 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstRefundedProduct.abstract_sku", + "skuProduct": "#firstRefundedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstRefundedProduct.id_product_concrete", + "idProductAbstract": "#firstRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondRefundedProduct.abstract_sku", + "skuProduct": "#secondRefundedProduct.sku", + "moneyValue": { + "netAmount": 45000, + "grossAmount": 45000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondRefundedProduct.id_product_concrete", + "idProductAbstract": "#secondRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdRefundedProduct.abstract_sku", + "skuProduct": "#thirdRefundedProduct.sku", + "moneyValue": { + "netAmount": 60000, + "grossAmount": 60000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdRefundedProduct.id_product_concrete", + "idProductAbstract": "#thirdRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/order-management/dynamic-shipment-management.json b/cypress/fixtures/b2c/backoffice/order-management/dynamic-shipment-management.json new file mode 100644 index 000000000..4c5fff984 --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/order-management/dynamic-shipment-management.json @@ -0,0 +1,292 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "movedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#movedProduct.abstract_sku", + "skuProduct": "#movedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#movedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#movedProduct.id_product_concrete", + "idProductAbstract": "#movedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "reassignedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#reassignedProduct.abstract_sku", + "skuProduct": "#reassignedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#reassignedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#reassignedProduct.id_product_concrete", + "idProductAbstract": "#reassignedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/order-management/static-configurable-product-oms.json b/cypress/fixtures/b2c/backoffice/order-management/static-configurable-product-oms.json new file mode 100644 index 000000000..908fc558f --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/order-management/static-configurable-product-oms.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "Skip timeout", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking" + }, + { + "state": "Ship" + } + ] +} diff --git a/cypress/fixtures/b2c/backoffice/order-management/static-order-refund.json b/cypress/fixtures/b2c/backoffice/order-management/static-order-refund.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/order-management/static-order-refund.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/backoffice/order-management/static-shipment-management.json b/cypress/fixtures/b2c/backoffice/order-management/static-shipment-management.json new file mode 100644 index 000000000..731f30ebb --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/order-management/static-shipment-management.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "newShipmentAddress": { + "salutation": "Mr", + "firstName": "Split", + "lastName": "Receiver", + "email": "split.receiver@spryker.local", + "country": "Austria", + "address1": "Hartmanngasse", + "address2": "1", + "city": "Vienna", + "zipCode": "1050" + }, + "editedShipmentAddress": { + "salutation": "Mr", + "firstName": "Corrected", + "lastName": "Receiver", + "email": "corrected.receiver@spryker.local", + "country": "Germany", + "address1": "Julie-Wolfthorn-Strasse", + "address2": "1", + "city": "Berlin", + "zipCode": "10115" + } +} diff --git a/cypress/fixtures/b2c/backoffice/product-management/dynamic-product-lifecycle-management.json b/cypress/fixtures/b2c/backoffice/product-management/dynamic-product-lifecycle-management.json new file mode 100644 index 000000000..9c914ced6 --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/product-management/dynamic-product-lifecycle-management.json @@ -0,0 +1,36 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/product-management/dynamic-product-table-filters.json b/cypress/fixtures/b2c/backoffice/product-management/dynamic-product-table-filters.json index 163738786..4ad8f0da3 100644 --- a/cypress/fixtures/b2c/backoffice/product-management/dynamic-product-table-filters.json +++ b/cypress/fixtures/b2c/backoffice/product-management/dynamic-product-table-filters.json @@ -51,6 +51,9 @@ {}, { "idTaxSet": 1, + "storeRelation": { + "idStores": ["#storeDE.id_store"] + }, "localizedAttributes": [{ "locale": "#locale", "name": "#localizedAttribute.name" }] } ] diff --git a/cypress/fixtures/b2c/backoffice/product-management/static-product-lifecycle-management.json b/cypress/fixtures/b2c/backoffice/product-management/static-product-lifecycle-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/product-management/static-product-lifecycle-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/backoffice/warehouse/dynamic-warehouse-picking-oms.json b/cypress/fixtures/b2c/backoffice/warehouse/dynamic-warehouse-picking-oms.json new file mode 100644 index 000000000..948ca7ce7 --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/warehouse/dynamic-warehouse-picking-oms.json @@ -0,0 +1,32 @@ +{ + "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": "helper", + "name": "haveUser", + "key": "warehouseUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#warehouseUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/backoffice/warehouse/static-warehouse-picking-oms.json b/cypress/fixtures/b2c/backoffice/warehouse/static-warehouse-picking-oms.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/backoffice/warehouse/static-warehouse-picking-oms.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/yves/agent-assist/dynamic-customer-impersonation.json b/cypress/fixtures/b2c/yves/agent-assist/dynamic-customer-impersonation.json new file mode 100644 index 000000000..50abdf653 --- /dev/null +++ b/cypress/fixtures/b2c/yves/agent-assist/dynamic-customer-impersonation.json @@ -0,0 +1,138 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/agent-assist/static-customer-impersonation.json b/cypress/fixtures/b2c/yves/agent-assist/static-customer-impersonation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/yves/agent-assist/static-customer-impersonation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/yves/catalog/dynamic-catalog-filters.json b/cypress/fixtures/b2c/yves/catalog/dynamic-catalog-filters.json new file mode 100644 index 000000000..38fa4e3bf --- /dev/null +++ b/cypress/fixtures/b2c/yves/catalog/dynamic-catalog-filters.json @@ -0,0 +1,16 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/catalog/dynamic-quick-add-to-cart.json b/cypress/fixtures/b2c/yves/catalog/dynamic-quick-add-to-cart.json new file mode 100644 index 000000000..38fa4e3bf --- /dev/null +++ b/cypress/fixtures/b2c/yves/catalog/dynamic-quick-add-to-cart.json @@ -0,0 +1,16 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/catalog/static-catalog-filters.json b/cypress/fixtures/b2c/yves/catalog/static-catalog-filters.json new file mode 100644 index 000000000..6950f894f --- /dev/null +++ b/cypress/fixtures/b2c/yves/catalog/static-catalog-filters.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "searchTerm": "canon", + "attributeFilter": { + "name": "color", + "value": "blue" + }, + "filterTitles": ["Price", "Rating", "Label", "Brand", "Color"], + "ascendingPriceSortLabel": "Sort by price ascending", + "descendingPriceSortLabel": "Sort by price descending" +} diff --git a/cypress/fixtures/b2c/yves/catalog/static-quick-add-to-cart.json b/cypress/fixtures/b2c/yves/catalog/static-quick-add-to-cart.json new file mode 100644 index 000000000..db9d434ca --- /dev/null +++ b/cypress/fixtures/b2c/yves/catalog/static-quick-add-to-cart.json @@ -0,0 +1,15 @@ +{ + "defaultPassword": "change123", + "buyableProduct": { + "searchQuery": "NEX-VG20EH", + "cartEntry": "NEX-VG20EH" + }, + "unbuyableProduct": { + "searchQuery": "115_26408656" + }, + "productGroup": { + "searchQuery": "002_25904004", + "swatchIdentifier": "silver", + "cartEntry": "Canon IXUS 160" + } +} diff --git a/cypress/fixtures/b2c/yves/checkout/dynamic-checkout-authentication.json b/cypress/fixtures/b2c/yves/checkout/dynamic-checkout-authentication.json new file mode 100644 index 000000000..07002da83 --- /dev/null +++ b/cypress/fixtures/b2c/yves/checkout/dynamic-checkout-authentication.json @@ -0,0 +1,81 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/checkout/dynamic-split-delivery.json b/cypress/fixtures/b2c/yves/checkout/dynamic-split-delivery.json new file mode 100644 index 000000000..05d366fc7 --- /dev/null +++ b/cypress/fixtures/b2c/yves/checkout/dynamic-split-delivery.json @@ -0,0 +1,247 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product1WithStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": "havePriceProduct", + "key": "product2WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product2WithStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product3WithStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": 1 + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/checkout/static-checkout-authentication.json b/cypress/fixtures/b2c/yves/checkout/static-checkout-authentication.json new file mode 100644 index 000000000..1e6919487 --- /dev/null +++ b/cypress/fixtures/b2c/yves/checkout/static-checkout-authentication.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "registrationPassword": "Cypress!Secure1", + "salutation": "Mr" +} diff --git a/cypress/fixtures/b2c/yves/checkout/static-split-delivery.json b/cypress/fixtures/b2c/yves/checkout/static-split-delivery.json new file mode 100644 index 000000000..0d6857073 --- /dev/null +++ b/cypress/fixtures/b2c/yves/checkout/static-split-delivery.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3 +} diff --git a/cypress/fixtures/b2c/yves/cms/dynamic-cms-page-publish.json b/cypress/fixtures/b2c/yves/cms/dynamic-cms-page-publish.json new file mode 100644 index 000000000..0704e54cd --- /dev/null +++ b/cypress/fixtures/b2c/yves/cms/dynamic-cms-page-publish.json @@ -0,0 +1,25 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/cms/dynamic-multistore-cms-page.json b/cypress/fixtures/b2c/yves/cms/dynamic-multistore-cms-page.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/b2c/yves/cms/dynamic-multistore-cms-page.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/cms/static-cms-page-publish.json b/cypress/fixtures/b2c/yves/cms/static-cms-page-publish.json new file mode 100644 index 000000000..66c3d5c9c --- /dev/null +++ b/cypress/fixtures/b2c/yves/cms/static-cms-page-publish.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "defaultLocaleName": "en_US", + "cmsPageName": "test-cms-page-publish" +} diff --git a/cypress/fixtures/b2c/yves/cms/static-multistore-cms-page.json b/cypress/fixtures/b2c/yves/cms/static-multistore-cms-page.json new file mode 100644 index 000000000..2bac107fd --- /dev/null +++ b/cypress/fixtures/b2c/yves/cms/static-multistore-cms-page.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "multistore-cms-page", + "storeName": "AT", + "localeName": "en_US" +} diff --git a/cypress/fixtures/b2c/yves/comments/dynamic-cart-comments.json b/cypress/fixtures/b2c/yves/comments/dynamic-cart-comments.json index 8f00f9af0..d5d5fd4c6 100644 --- a/cypress/fixtures/b2c/yves/comments/dynamic-cart-comments.json +++ b/cypress/fixtures/b2c/yves/comments/dynamic-cart-comments.json @@ -4,29 +4,61 @@ "attributes": { "synchronize": true, "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, { "type": "helper", "name": "haveConfirmedCustomer", "key": "customer", - "arguments": [{ "locale_name": "en_US", "password": "change123" }] + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] }, { "type": "transfer", "name": "StoreTransfer", "key": "store", - "arguments": { "id_store": 1 } + "arguments": { + "id_store": 1 + } }, { "type": "helper", "name": "haveFullProduct", "key": "product1", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] }, { "type": "helper", "name": "haveFullProduct", "key": "product2", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] }, { "type": "helper", @@ -35,7 +67,10 @@ { "skuProductAbstract": "#product1.abstract_sku", "skuProduct": "#product1.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, @@ -46,19 +81,34 @@ { "skuProductAbstract": "#product2.abstract_sku", "skuProduct": "#product2.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "transfer", @@ -119,7 +169,11 @@ "type": "helper", "name": "havePersistentQuote", "key": "emptyQuote", - "arguments": [{ "customer": "#customer" }] + "arguments": [ + { + "customer": "#customer" + } + ] } ] } diff --git a/cypress/fixtures/b2c/yves/comments/dynamic-order-comments.json b/cypress/fixtures/b2c/yves/comments/dynamic-order-comments.json new file mode 100644 index 000000000..94f4dbc83 --- /dev/null +++ b/cypress/fixtures/b2c/yves/comments/dynamic-order-comments.json @@ -0,0 +1,166 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/comments/static-cart-comments.json b/cypress/fixtures/b2c/yves/comments/static-cart-comments.json index 05511e655..42332182f 100644 --- a/cypress/fixtures/b2c/yves/comments/static-cart-comments.json +++ b/cypress/fixtures/b2c/yves/comments/static-cart-comments.json @@ -6,5 +6,6 @@ ], "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." + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "commentToKeepThroughCheckout": "Please leave the parcel with the building concierge." } diff --git a/cypress/fixtures/b2c/yves/comments/static-order-comments.json b/cypress/fixtures/b2c/yves/comments/static-order-comments.json new file mode 100644 index 000000000..b85b30324 --- /dev/null +++ b/cypress/fixtures/b2c/yves/comments/static-order-comments.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "commentOnOrder": "Please call the site office before delivering this order." +} diff --git a/cypress/fixtures/b2c/yves/discount/dynamic-discounts-and-promotions.json b/cypress/fixtures/b2c/yves/discount/dynamic-discounts-and-promotions.json new file mode 100644 index 000000000..e7d9efa04 --- /dev/null +++ b/cypress/fixtures/b2c/yves/discount/dynamic-discounts-and-promotions.json @@ -0,0 +1,243 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "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", + "defaultCurrencyIsoCode": "EUR" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + { + "attributes": { + "brand": "Discounts and promotions fixture" + } + }, + { + "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": "haveFullProduct", + "key": "promotionalProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#promotionalProduct.abstract_sku", + "skuProduct": "#promotionalProduct.sku", + "moneyValue": { + "netAmount": 7500, + "grossAmount": 7500 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#promotionalProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "voucherDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 500, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "voucherCode", + "arguments": [ + { + "idDiscount": "#voucherDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "cartRuleDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "cart_rule", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 1000, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "promotionDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 10000, + "collectorStrategyType": "promotion", + "discountPromotion": { + "abstractSkus": ["#promotionalProduct.abstract_sku"], + "abstractSku": "#promotionalProduct.abstract_sku", + "quantity": 2 + } + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "promotionVoucherCode", + "arguments": [ + { + "idDiscount": "#promotionDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/discount/static-discounts-and-promotions.json b/cypress/fixtures/b2c/yves/discount/static-discounts-and-promotions.json new file mode 100644 index 000000000..09e05a7d0 --- /dev/null +++ b/cypress/fixtures/b2c/yves/discount/static-discounts-and-promotions.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/b2c/yves/merchandising/dynamic-product-relations.json b/cypress/fixtures/b2c/yves/merchandising/dynamic-product-relations.json new file mode 100644 index 000000000..49711fc7f --- /dev/null +++ b/cypress/fixtures/b2c/yves/merchandising/dynamic-product-relations.json @@ -0,0 +1,208 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "relatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithoutRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithRelatedProduct.abstract_sku", + "skuProduct": "#productWithRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#relatedProduct.abstract_sku", + "skuProduct": "#relatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithoutRelatedProduct.abstract_sku", + "skuProduct": "#productWithoutRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithRelatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#relatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithoutRelatedProduct.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": "#productWithRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#relatedProduct.id_product_concrete", + "idProductAbstract": "#relatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productWithoutRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithoutRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "transfer", + "name": "StoreRelationTransfer", + "key": "storeRelation", + "arguments": { + "id_stores": [1], + "stores": [ + { + "id_store": 1, + "name": "DE" + } + ] + } + }, + { + "type": "helper", + "name": "haveProductRelation", + "arguments": [ + "#relatedProduct.abstract_sku", + "#productWithRelatedProduct.fk_product_abstract", + "#relatedProduct.abstract_sku", + "related-products", + "#storeRelation" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/merchandising/dynamic-product-sets.json b/cypress/fixtures/b2c/yves/merchandising/dynamic-product-sets.json new file mode 100644 index 000000000..a99ad822f --- /dev/null +++ b/cypress/fixtures/b2c/yves/merchandising/dynamic-product-sets.json @@ -0,0 +1,220 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "variantProduct", + "arguments": [ + { + "attributes": { + "storage_capacity": "32 GB" + } + }, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "secondVariantProduct", + "arguments": [ + { + "fkProductAbstract": "#variantProduct.fk_product_abstract", + "abstractSku": "#variantProduct.abstract_sku", + "attributes": { + "storage_capacity": "128 GB" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "simpleProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#variantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 40000, + "grossAmount": 40000 + }, + "skuProduct": "#secondVariantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#simpleProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondVariantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#simpleProduct.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": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#simpleProduct.id_product_concrete", + "idProductAbstract": "#simpleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/merchandising/static-product-relations.json b/cypress/fixtures/b2c/yves/merchandising/static-product-relations.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/yves/merchandising/static-product-relations.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/yves/merchandising/static-product-sets.json b/cypress/fixtures/b2c/yves/merchandising/static-product-sets.json new file mode 100644 index 000000000..4c544c4a3 --- /dev/null +++ b/cypress/fixtures/b2c/yves/merchandising/static-product-sets.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "storage_capacity", + "variantAttributeValue": "128 GB" +} diff --git a/cypress/fixtures/b2c/yves/order-management/dynamic-order-cancellation.json b/cypress/fixtures/b2c/yves/order-management/dynamic-order-cancellation.json new file mode 100644 index 000000000..fa0561ef6 --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-management/dynamic-order-cancellation.json @@ -0,0 +1,347 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "wholeOrderCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "wholeOrderAddress", + "arguments": [ + { + "fkCustomer": "#wholeOrderCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "mixedStateCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "mixedStateAddress", + "arguments": [ + { + "fkCustomer": "#mixedStateCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wholeOrderProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wholeOrderProduct.abstract_sku", + "skuProduct": "#wholeOrderProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wholeOrderProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wholeOrderProduct.id_product_concrete", + "idProductAbstract": "#wholeOrderProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "advancedItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#advancedItemProduct.abstract_sku", + "skuProduct": "#advancedItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#advancedItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#advancedItemProduct.id_product_concrete", + "idProductAbstract": "#advancedItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "cancellableItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#cancellableItemProduct.abstract_sku", + "skuProduct": "#cancellableItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#cancellableItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#cancellableItemProduct.id_product_concrete", + "idProductAbstract": "#cancellableItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/order-management/static-order-cancellation.json b/cypress/fixtures/b2c/yves/order-management/static-order-cancellation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2c/yves/order-management/static-order-cancellation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/b2c/yves/product-bundle/dynamic-configurable-bundle-checkout.json b/cypress/fixtures/b2c/yves/product-bundle/dynamic-configurable-bundle-checkout.json new file mode 100644 index 000000000..261431278 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product-bundle/dynamic-configurable-bundle-checkout.json @@ -0,0 +1,21 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomerWithAddress", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product-bundle/static-configurable-bundle-checkout.json b/cypress/fixtures/b2c/yves/product-bundle/static-configurable-bundle-checkout.json new file mode 100644 index 000000000..bb5f1cec9 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product-bundle/static-configurable-bundle-checkout.json @@ -0,0 +1,24 @@ +{ + "defaultPassword": "change123", + "templateName": "Smartstation Kit", + "firstConfiguration": [ + { + "slotName": "Slot 5", + "productPosition": 0 + }, + { + "slotName": "Slot 6", + "productIdentifier": "Canon LEGRIA HF R606" + } + ], + "secondConfiguration": [ + { + "slotName": "Slot 5", + "productPosition": 1 + }, + { + "slotName": "Slot 6", + "productIdentifier": "Canon LEGRIA HF R606" + } + ] +} diff --git a/cypress/fixtures/b2c/yves/product-configurator/dynamic-configurable-product-checkout.json b/cypress/fixtures/b2c/yves/product-configurator/dynamic-configurable-product-checkout.json new file mode 100644 index 000000000..31b31f3a4 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product-configurator/dynamic-configurable-product-checkout.json @@ -0,0 +1,116 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product-configurator/static-configurable-product-checkout.json b/cypress/fixtures/b2c/yves/product-configurator/static-configurable-product-checkout.json new file mode 100644 index 000000000..64482fe0b --- /dev/null +++ b/cypress/fixtures/b2c/yves/product-configurator/static-configurable-product-checkout.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-availability-calculation.json b/cypress/fixtures/b2c/yves/product/dynamic-availability-calculation.json new file mode 100644 index 000000000..0cbabfeb6 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-availability-calculation.json @@ -0,0 +1,165 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "quantity": 3, + "isNeverOutOfStock": false + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-back-in-stock-notification.json b/cypress/fixtures/b2c/yves/product/dynamic-back-in-stock-notification.json new file mode 100644 index 000000000..83e1d8daf --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-back-in-stock-notification.json @@ -0,0 +1,206 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "outOfStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "outOfStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#outOfStockProduct.abstract_sku", + "skuProduct": "#outOfStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#outOfStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 0 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#outOfStockProduct.id_product_concrete", + "idProductAbstract": "#outOfStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "inStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "inStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#inStockProduct.abstract_sku", + "skuProduct": "#inStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#inStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 20 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#inStockProduct.id_product_concrete", + "idProductAbstract": "#inStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-discontinued-alternative-products.json b/cypress/fixtures/b2c/yves/product/dynamic-discontinued-alternative-products.json new file mode 100644 index 000000000..c68f05312 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-discontinued-alternative-products.json @@ -0,0 +1,377 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "discontinuedProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "substituteProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistSubstituteProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "discontinuedProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#discontinuedProduct.abstract_sku", + "skuProduct": "#discontinuedProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discontinuedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#discontinuedProduct.id_product_concrete", + "idProductAbstract": "#discontinuedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "substituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#substituteProduct.abstract_sku", + "skuProduct": "#substituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#substituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#substituteProduct.id_product_concrete", + "idProductAbstract": "#substituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistProduct.abstract_sku", + "skuProduct": "#wishlistProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistProduct.id_product_concrete", + "idProductAbstract": "#wishlistProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistSubstituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistSubstituteProduct.abstract_sku", + "skuProduct": "#wishlistSubstituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistSubstituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistSubstituteProduct.id_product_concrete", + "idProductAbstract": "#wishlistSubstituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#discontinuedProduct", "#substituteProduct.sku"] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#wishlistProduct", "#wishlistSubstituteProduct.sku"] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-multistore-product.json b/cypress/fixtures/b2c/yves/product/dynamic-multistore-product.json new file mode 100644 index 000000000..78fd7fba2 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-multistore-product.json @@ -0,0 +1,45 @@ +{ + "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": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productToUnassign", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { "sku": "#productToUnassign.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-original-price.json b/cypress/fixtures/b2c/yves/product/dynamic-original-price.json new file mode 100644 index 000000000..e7d6638bd --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-original-price.json @@ -0,0 +1,260 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "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": [ + { + "attributes": { + "storage_capacity": "32 GB" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "storage_capacity": "32 GB" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "discountedVariant", + "arguments": [ + { + "fkProductAbstract": "#product.fk_product_abstract", + "abstractSku": "#product.abstract_sku", + "attributes": { + "storage_capacity": "128 GB" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 1200, + "grossAmount": 1500 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discountedVariant.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-product-bundle-checkout.json b/cypress/fixtures/b2c/yves/product/dynamic-product-bundle-checkout.json new file mode 100644 index 000000000..615108049 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-product-bundle-checkout.json @@ -0,0 +1,318 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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 + } + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundleProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductOneName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductTwoName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundleProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductOne", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductTwo", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductOne.abstract_sku", + "skuProduct": "#bundledProductOne.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductOne.id_product_concrete", + "idProductAbstract": "#bundledProductOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductTwo.abstract_sku", + "skuProduct": "#bundledProductTwo.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductTwo.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductTwo.id_product_concrete", + "idProductAbstract": "#bundledProductTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductBundle", + "key": "productBundle", + "arguments": [ + "#bundleProduct", + { + "bundledProducts": [ + { + "idProductConcrete": "#bundledProductOne.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 2, + "sku": "#bundledProductOne.sku" + }, + { + "idProductConcrete": "#bundledProductTwo.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 3, + "sku": "#bundledProductTwo.sku" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundleProduct.abstract_sku", + "skuProduct": "#bundleProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundleProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundleProduct.id_product_concrete", + "idProductAbstract": "#bundleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/dynamic-volume-prices.json b/cypress/fixtures/b2c/yves/product/dynamic-volume-prices.json new file mode 100644 index 000000000..edf1e9aa6 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/dynamic-volume-prices.json @@ -0,0 +1,131 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\":[{\"quantity\":3,\"net_price\":7000,\"gross_price\":8000}]}" + } + } + ] + }, + { + "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"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/product/static-availability-calculation.json b/cypress/fixtures/b2c/yves/product/static-availability-calculation.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-availability-calculation.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/b2c/yves/product/static-back-in-stock-notification.json b/cypress/fixtures/b2c/yves/product/static-back-in-stock-notification.json new file mode 100644 index 000000000..1d4bf4a33 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-back-in-stock-notification.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "subscribedMessage": "Successfully subscribed", + "unsubscribedMessage": "Successfully unsubscribed" +} diff --git a/cypress/fixtures/b2c/yves/product/static-discontinued-alternative-products.json b/cypress/fixtures/b2c/yves/product/static-discontinued-alternative-products.json new file mode 100644 index 000000000..e995b82d1 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-discontinued-alternative-products.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "discontinuedLabel": "Discontinued", + "alternativeLabel": "Alternative for" +} diff --git a/cypress/fixtures/b2c/yves/product/static-multistore-product.json b/cypress/fixtures/b2c/yves/product/static-multistore-product.json new file mode 100644 index 000000000..55ec7b509 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-multistore-product.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "150", + "secondaryStorePrice": "250", + "unassignedStoreProductPrice": "180", + "currencySymbol": "€" +} diff --git a/cypress/fixtures/b2c/yves/product/static-original-price.json b/cypress/fixtures/b2c/yves/product/static-original-price.json new file mode 100644 index 000000000..82050fa07 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-original-price.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€200.00" + }, + "variant": { + "attributeKey": "storage_capacity", + "attributeValue": "128 GB", + "default": "€15.00", + "original": "€50.00" + } +} diff --git a/cypress/fixtures/b2c/yves/product/static-product-bundle-checkout.json b/cypress/fixtures/b2c/yves/product/static-product-bundle-checkout.json new file mode 100644 index 000000000..09e05a7d0 --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-product-bundle-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/b2c/yves/product/static-volume-prices.json b/cypress/fixtures/b2c/yves/product/static-volume-prices.json new file mode 100644 index 000000000..9ae301f7b --- /dev/null +++ b/cypress/fixtures/b2c/yves/product/static-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "quantity": 3, + "price": "€80.00" + }, + "belowTierQuantity": 2 +} diff --git a/cypress/fixtures/b2c/yves/return-management/dynamic-return-creation-storefront.json b/cypress/fixtures/b2c/yves/return-management/dynamic-return-creation-storefront.json new file mode 100644 index 000000000..7902ec161 --- /dev/null +++ b/cypress/fixtures/b2c/yves/return-management/dynamic-return-creation-storefront.json @@ -0,0 +1,292 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstReturnedProduct.abstract_sku", + "skuProduct": "#firstReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstReturnedProduct.id_product_concrete", + "idProductAbstract": "#firstReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondReturnedProduct.abstract_sku", + "skuProduct": "#secondReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondReturnedProduct.id_product_concrete", + "idProductAbstract": "#secondReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/b2c/yves/return-management/static-return-creation-storefront.json b/cypress/fixtures/b2c/yves/return-management/static-return-creation-storefront.json new file mode 100644 index 000000000..8cd4ad6ce --- /dev/null +++ b/cypress/fixtures/b2c/yves/return-management/static-return-creation-storefront.json @@ -0,0 +1,26 @@ +{ + "defaultPassword": "change123", + "returnDetailsTitle": "Return Details", + "waitingForReturnState": "Waiting for return", + "shippedState": "Shipped", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "Skip timeout", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking" + }, + { + "state": "Ship" + } + ] +} diff --git a/cypress/fixtures/suite/backoffice/acl/dynamic-acl-navigation-access.json b/cypress/fixtures/suite/backoffice/acl/dynamic-acl-navigation-access.json index b6ea829c9..7e3eaf0fa 100644 --- a/cypress/fixtures/suite/backoffice/acl/dynamic-acl-navigation-access.json +++ b/cypress/fixtures/suite/backoffice/acl/dynamic-acl-navigation-access.json @@ -138,6 +138,64 @@ "type": "helper", "name": "addUserToGroup", "arguments": ["#combinedUser.id_user", "#customerGroup.id_acl_group"] + }, + + { "type": "helper", "name": "haveRole", "key": "globalAllowRole" }, + { + "type": "helper", + "name": "haveRule", + "arguments": [ + { + "bundle": "*", + "controller": "*", + "action": "*", + "type": "allow", + "fk_acl_role": "#globalAllowRole.id_acl_role" + } + ] + }, + { "type": "helper", "name": "haveRole", "key": "attributeCreateDenyRole" }, + { + "type": "helper", + "name": "haveRule", + "arguments": [ + { + "bundle": "product-attribute-gui", + "controller": "attribute", + "action": "create", + "type": "deny", + "fk_acl_role": "#attributeCreateDenyRole.id_acl_role" + } + ] + }, + { "type": "helper", "name": "haveGroup", "key": "attributeCreateDenyGroup" }, + { + "type": "helper", + "name": "addRoleToGroup", + "arguments": ["#globalAllowRole.id_acl_role", "#attributeCreateDenyGroup.id_acl_group"] + }, + { + "type": "helper", + "name": "addRoleToGroup", + "arguments": ["#attributeCreateDenyRole.id_acl_role", "#attributeCreateDenyGroup.id_acl_group"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "deniedActionUser", + "arguments": [{ "password": "Change123@_!" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#deniedActionUser.id_user", "#attributeCreateDenyGroup.id_acl_group"] + }, + + { + "type": "helper", + "name": "haveUser", + "key": "blockedUser", + "arguments": [{ "password": "Change123@_!", "status": "blocked" }] } ] } diff --git a/cypress/fixtures/suite/backoffice/administration/dynamic-glossary-management.json b/cypress/fixtures/suite/backoffice/administration/dynamic-glossary-management.json new file mode 100644 index 000000000..756947edb --- /dev/null +++ b/cypress/fixtures/suite/backoffice/administration/dynamic-glossary-management.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/backoffice/administration/static-glossary-management.json b/cypress/fixtures/suite/backoffice/administration/static-glossary-management.json new file mode 100644 index 000000000..98d4d81e6 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/administration/static-glossary-management.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "glossaryKeyPrefix": "cart.price.test", + "translation": "This is a sample translation", + "updatedTranslation": "This is an updated translation" +} diff --git a/cypress/fixtures/suite/backoffice/company-account/dynamic-company-structure-creation.json b/cypress/fixtures/suite/backoffice/company-account/dynamic-company-structure-creation.json new file mode 100644 index 000000000..f0834d3a1 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/company-account/dynamic-company-structure-creation.json @@ -0,0 +1,43 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": false, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/company-account/static-company-structure-creation.json b/cypress/fixtures/suite/backoffice/company-account/static-company-structure-creation.json new file mode 100644 index 000000000..2aebe46e3 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/company-account/static-company-structure-creation.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "companyUserRolePermissionNames": ["View company users"], + "companyUserPagePath": "/company/user", + "companyRolePagePath": "/company/company-role" +} diff --git a/cypress/fixtures/suite/backoffice/core/dynamic-dynamic-store-creation.json b/cypress/fixtures/suite/backoffice/core/dynamic-dynamic-store-creation.json new file mode 100644 index 000000000..361b3dd28 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/core/dynamic-dynamic-store-creation.json @@ -0,0 +1,39 @@ +{ + "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": "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/backoffice/core/static-dynamic-store-creation.json b/cypress/fixtures/suite/backoffice/core/static-dynamic-store-creation.json new file mode 100644 index 000000000..d669ec35d --- /dev/null +++ b/cypress/fixtures/suite/backoffice/core/static-dynamic-store-creation.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "store": { + "name": "DYNAMIC_STORE", + "currency": "EUR", + "locale": "en_US", + "country": "DE", + "timezone": "Europe/Berlin" + }, + "productPrice": "175", + "cmsPageName": "dynamic-store-page", + "registrationCmsBlockNames": ["customer-registration_token--html", "customer-registration_token--text"] +} diff --git a/cypress/fixtures/suite/backoffice/data-exchange/dynamic-api-specification-download.json b/cypress/fixtures/suite/backoffice/data-exchange/dynamic-api-specification-download.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/suite/backoffice/data-exchange/dynamic-api-specification-download.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json b/cypress/fixtures/suite/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/suite/backoffice/data-exchange/dynamic-dynamic-entity-configuration.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/data-exchange/static-api-specification-download.json b/cypress/fixtures/suite/backoffice/data-exchange/static-api-specification-download.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/data-exchange/static-api-specification-download.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/data-exchange/static-dynamic-entity-configuration.json b/cypress/fixtures/suite/backoffice/data-exchange/static-dynamic-entity-configuration.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/data-exchange/static-dynamic-entity-configuration.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/merchandising/dynamic-product-set-management.json b/cypress/fixtures/suite/backoffice/merchandising/dynamic-product-set-management.json new file mode 100644 index 000000000..1d7e4476a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchandising/dynamic-product-set-management.json @@ -0,0 +1,237 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstProduct.abstract_sku", + "skuProduct": "#firstProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondProduct.abstract_sku", + "skuProduct": "#secondProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdProduct.abstract_sku", + "skuProduct": "#thirdProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdProduct.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": "#firstProduct.id_product_concrete", + "idProductAbstract": "#firstProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondProduct.id_product_concrete", + "idProductAbstract": "#secondProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdProduct.id_product_concrete", + "idProductAbstract": "#thirdProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/merchandising/static-product-set-management.json b/cypress/fixtures/suite/backoffice/merchandising/static-product-set-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchandising/static-product-set-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-crud.json b/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-crud.json new file mode 100644 index 000000000..f250741b6 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-crud.json @@ -0,0 +1,81 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchantWaitingForApproval", + "arguments": [ + { + "status": "waiting-for-approval", + "isActive": false + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "renamedMerchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "renamedMerchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#renamedMerchant.id_merchant", + "urlPrefix": "/en/merchant/crud-rename-en-", + "url": "#renamedMerchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "unassignedMerchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "unassignedMerchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#unassignedMerchant.id_merchant", + "urlPrefix": "/en/merchant/crud-unassign-en-", + "url": "#unassignedMerchant.name" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-deactivation.json b/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-deactivation.json new file mode 100644 index 000000000..b4853e68c --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-deactivation.json @@ -0,0 +1,191 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123", + "fkLocale": 66 + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/deactivation-en-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/deactivation-de-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-user-management.json b/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-user-management.json new file mode 100644 index 000000000..90d39a543 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchant-management/dynamic-merchant-user-management.json @@ -0,0 +1,30 @@ +{ + "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": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-crud.json b/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-crud.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-crud.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-deactivation.json b/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-deactivation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-deactivation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-user-management.json b/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-user-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/merchant-management/static-merchant-user-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/navigation/dynamic-navigation-smoke.json b/cypress/fixtures/suite/backoffice/navigation/dynamic-navigation-smoke.json new file mode 100644 index 000000000..36e857a32 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/navigation/dynamic-navigation-smoke.json @@ -0,0 +1,24 @@ +{ + "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/backoffice/navigation/static-navigation-smoke.json b/cypress/fixtures/suite/backoffice/navigation/static-navigation-smoke.json new file mode 100644 index 000000000..fb68dba5f --- /dev/null +++ b/cypress/fixtures/suite/backoffice/navigation/static-navigation-smoke.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "accessDeniedUrlPart": "/acl/index/denied" +} diff --git a/cypress/fixtures/suite/backoffice/order-management/dynamic-configurable-product-oms.json b/cypress/fixtures/suite/backoffice/order-management/dynamic-configurable-product-oms.json new file mode 100644 index 000000000..c294efb8e --- /dev/null +++ b/cypress/fixtures/suite/backoffice/order-management/dynamic-configurable-product-oms.json @@ -0,0 +1,132 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/order-management/dynamic-order-refund.json b/cypress/fixtures/suite/backoffice/order-management/dynamic-order-refund.json new file mode 100644 index 000000000..a9da5d82d --- /dev/null +++ b/cypress/fixtures/suite/backoffice/order-management/dynamic-order-refund.json @@ -0,0 +1,292 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstRefundedProduct.abstract_sku", + "skuProduct": "#firstRefundedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstRefundedProduct.id_product_concrete", + "idProductAbstract": "#firstRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondRefundedProduct.abstract_sku", + "skuProduct": "#secondRefundedProduct.sku", + "moneyValue": { + "netAmount": 45000, + "grossAmount": 45000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondRefundedProduct.id_product_concrete", + "idProductAbstract": "#secondRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "thirdRefundedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#thirdRefundedProduct.abstract_sku", + "skuProduct": "#thirdRefundedProduct.sku", + "moneyValue": { + "netAmount": 60000, + "grossAmount": 60000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#thirdRefundedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#thirdRefundedProduct.id_product_concrete", + "idProductAbstract": "#thirdRefundedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstRefundedProduct.sku", + "abstractSku": "#firstRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondRefundedProduct.sku", + "abstractSku": "#secondRefundedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#thirdRefundedProduct.sku", + "abstractSku": "#thirdRefundedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/order-management/dynamic-shipment-management.json b/cypress/fixtures/suite/backoffice/order-management/dynamic-shipment-management.json new file mode 100644 index 000000000..4c5fff984 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/order-management/dynamic-shipment-management.json @@ -0,0 +1,292 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "movedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#movedProduct.abstract_sku", + "skuProduct": "#movedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#movedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#movedProduct.id_product_concrete", + "idProductAbstract": "#movedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "reassignedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#reassignedProduct.abstract_sku", + "skuProduct": "#reassignedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#reassignedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#reassignedProduct.id_product_concrete", + "idProductAbstract": "#reassignedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#movedProduct.sku", + "abstractSku": "#movedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#reassignedProduct.sku", + "abstractSku": "#reassignedProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/order-management/static-configurable-product-oms.json b/cypress/fixtures/suite/backoffice/order-management/static-configurable-product-oms.json new file mode 100644 index 000000000..908fc558f --- /dev/null +++ b/cypress/fixtures/suite/backoffice/order-management/static-configurable-product-oms.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "Skip timeout", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking" + }, + { + "state": "Ship" + } + ] +} diff --git a/cypress/fixtures/suite/backoffice/order-management/static-order-refund.json b/cypress/fixtures/suite/backoffice/order-management/static-order-refund.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/order-management/static-order-refund.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/order-management/static-shipment-management.json b/cypress/fixtures/suite/backoffice/order-management/static-shipment-management.json new file mode 100644 index 000000000..731f30ebb --- /dev/null +++ b/cypress/fixtures/suite/backoffice/order-management/static-shipment-management.json @@ -0,0 +1,25 @@ +{ + "defaultPassword": "change123", + "newShipmentAddress": { + "salutation": "Mr", + "firstName": "Split", + "lastName": "Receiver", + "email": "split.receiver@spryker.local", + "country": "Austria", + "address1": "Hartmanngasse", + "address2": "1", + "city": "Vienna", + "zipCode": "1050" + }, + "editedShipmentAddress": { + "salutation": "Mr", + "firstName": "Corrected", + "lastName": "Receiver", + "email": "corrected.receiver@spryker.local", + "country": "Germany", + "address1": "Julie-Wolfthorn-Strasse", + "address2": "1", + "city": "Berlin", + "zipCode": "10115" + } +} diff --git a/cypress/fixtures/suite/backoffice/product-management/dynamic-product-lifecycle-management.json b/cypress/fixtures/suite/backoffice/product-management/dynamic-product-lifecycle-management.json new file mode 100644 index 000000000..9c914ced6 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/product-management/dynamic-product-lifecycle-management.json @@ -0,0 +1,36 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/product-management/static-product-lifecycle-management.json b/cypress/fixtures/suite/backoffice/product-management/static-product-lifecycle-management.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/product-management/static-product-lifecycle-management.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/product-offer/dynamic-offer-approval.json b/cypress/fixtures/suite/backoffice/product-offer/dynamic-offer-approval.json new file mode 100644 index 000000000..3529d1299 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/product-offer/dynamic-offer-approval.json @@ -0,0 +1,165 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/product-offer/dynamic-offer-view-and-filter.json b/cypress/fixtures/suite/backoffice/product-offer/dynamic-offer-view-and-filter.json new file mode 100644 index 000000000..458fac5c2 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/product-offer/dynamic-offer-view-and-filter.json @@ -0,0 +1,293 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute1" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser1", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant1", "#merchantUser1"] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage1", + "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": "merchantProduct1", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute1.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute1.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct1.id_product_concrete", + "idProductAbstract": "#merchantProduct1.fk_product_abstract", + "productImages": ["#productImage1"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct1.abstract_sku", + "skuProduct": "#merchantProduct1.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant1.id_merchant", + "idProductAbstract": "#merchantProduct1.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct1.id_product_concrete", + "concreteSku": "#merchantProduct1.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute2" + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser2", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant2", "#merchantUser2"] + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage2", + "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": "merchantProduct2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct2.id_product_concrete", + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "productImages": ["#productImage2"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct2.abstract_sku", + "skuProduct": "#merchantProduct2.sku", + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant2.id_merchant", + "idProductAbstract": "#merchantProduct2.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct2.id_product_concrete", + "concreteSku": "#merchantProduct2.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/product-offer/static-offer-approval.json b/cypress/fixtures/suite/backoffice/product-offer/static-offer-approval.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/product-offer/static-offer-approval.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/product-offer/static-offer-view-and-filter.json b/cypress/fixtures/suite/backoffice/product-offer/static-offer-view-and-filter.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/product-offer/static-offer-view-and-filter.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/backoffice/warehouse/dynamic-warehouse-picking-oms.json b/cypress/fixtures/suite/backoffice/warehouse/dynamic-warehouse-picking-oms.json new file mode 100644 index 000000000..fa8f08143 --- /dev/null +++ b/cypress/fixtures/suite/backoffice/warehouse/dynamic-warehouse-picking-oms.json @@ -0,0 +1,132 @@ +{ + "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": "helper", + "name": "haveUser", + "key": "warehouseUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#warehouseUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveStore", + "key": "store", + "arguments": [{ "id_store": 1, "name": "DE" }] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [{ "fkCustomer": "#customer.id_customer", "fkCountry": "#country.id_country" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { "netAmount": 50000, "grossAmount": 50000 } + } + ] + }, + { + "type": "helper", + "name": "haveStock", + "key": "warehouse", + "arguments": [{ "name": "Warehouse1", "store_relation": { "id_stores": ["#store.id_store"] } }] + }, + { + "type": "helper", + "name": "haveStockProduct", + "arguments": [ + { + "fk_stock": "#warehouse.id_stock", + "stock_type": "#warehouse.name", + "sku": "#product.sku", + "quantity": 100, + "isNeverOutOfStock": "0" + } + ] + }, + { + "type": "helper", + "name": "haveShipmentType", + "key": "shipmentType", + "arguments": [{ "key": "delivery" }] + }, + { + "type": "helper", + "name": "haveShipmentMethod", + "key": "shipmentMethod", + "arguments": [{ "key": "spryker_dummy_shipment-standard" }] + }, + { + "type": "transfer", + "name": "ShipmentTransfer", + "key": "shipment", + "arguments": { + "shipmentTypeUuid": "#shipmentType.uuid", + "idShipmentMethod": "#shipmentMethod.id_shipment_method", + "method": "#shipmentMethod", + "shippingAddress": "#address" + } + }, + { + "type": "helper", + "name": "haveFullOrder", + "key": "salesOrder", + "arguments": [ + { + "priceMode": "GROSS_MODE", + "store": "#store", + "item": { + "sku": "#product.sku", + "shipment": "#shipment" + }, + "customerReference": "#customer.customer_reference", + "shipment": "#shipment" + }, + "DummyPayment01" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/backoffice/warehouse/static-warehouse-picking-oms.json b/cypress/fixtures/suite/backoffice/warehouse/static-warehouse-picking-oms.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/backoffice/warehouse/static-warehouse-picking-oms.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/mp/marketplace-order-management/dynamic-order-fulfilment.json b/cypress/fixtures/suite/mp/marketplace-order-management/dynamic-order-fulfilment.json new file mode 100644 index 000000000..32ef1d595 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-order-management/dynamic-order-fulfilment.json @@ -0,0 +1,300 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale": "#localeEN", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute" + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrl1", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/dummy-en-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/dummy-de-prefix-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 50000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute2" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "productImage2", + "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": "merchantProduct2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct2.id_product_concrete", + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "productImages": ["#productImage2"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct2.abstract_sku", + "skuProduct": "#merchantProduct2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { + "sku": "#merchantProduct2.sku", + "isNeverOutOfStock": "1", + "fkStock": 1, + "stockType": "Warehouse1" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idProductAbstract": "#merchantProduct2.fk_product_abstract", + "idMerchant": "#merchant.id_merchant" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-order-management/static-order-fulfilment.json b/cypress/fixtures/suite/mp/marketplace-order-management/static-order-fulfilment.json new file mode 100644 index 000000000..b05aab1ff --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-order-management/static-order-fulfilment.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "orderItemStates": { + "shipped": "shipped", + "delivered": "delivered" + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-product-concretes/dynamic-merchant-product-management.json b/cypress/fixtures/suite/mp/marketplace-product-concretes/dynamic-merchant-product-management.json new file mode 100644 index 000000000..490c81ae5 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-product-concretes/dynamic-merchant-product-management.json @@ -0,0 +1,171 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "variantAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "variantImage", + "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": "variantProduct", + "arguments": [ + { + "attributes": { + "color": "white" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#variantAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#variantAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "color": "white" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#variantAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#variantAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#variantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#variantImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "skuProduct": "#variantProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-product-concretes/dynamic-product-concrete-management.json b/cypress/fixtures/suite/mp/marketplace-product-concretes/dynamic-product-concrete-management.json index 34bd2734e..f54fa44a8 100644 --- a/cypress/fixtures/suite/mp/marketplace-product-concretes/dynamic-product-concrete-management.json +++ b/cypress/fixtures/suite/mp/marketplace-product-concretes/dynamic-product-concrete-management.json @@ -4,23 +4,48 @@ "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": "localeEN", - "arguments": { "id_locale": 66, "locale_name": "en_US" } + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } }, { "type": "transfer", "name": "LocaleTransfer", "key": "localeDE", - "arguments": { "id_locale": 46, "locale_name": "de_DE" } + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } }, { "type": "helper", "name": "haveUser", "key": "merchantUser", - "arguments": [{ "password": "change123" }] + "arguments": [ + { + "password": "change123" + } + ] }, { "type": "helper", @@ -50,8 +75,14 @@ { "idTaxSet": 1, "localizedAttributes": [ - { "locale": "#localeEN", "name": "#localizedAttribute1.name" }, - { "locale": "#localeDE", "name": "#localizedAttribute1.name" } + { + "locale": "#localeEN", + "name": "#localizedAttribute1.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute1.name" + } ] } ] @@ -64,8 +95,14 @@ { "idTaxSet": 1, "localizedAttributes": [ - { "locale": "#localeEN", "name": "#localizedAttribute2.name" }, - { "locale": "#localeDE", "name": "#localizedAttribute2.name" } + { + "locale": "#localeEN", + "name": "#localizedAttribute2.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute2.name" + } ] } ] @@ -119,7 +156,10 @@ { "skuProductAbstract": "#concreteProduct1.abstract_sku", "skuProduct": "#concreteProduct1.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, @@ -130,7 +170,10 @@ { "skuProductAbstract": "#concreteProduct2.abstract_sku", "skuProduct": "#concreteProduct2.sku", - "moneyValue": { "netAmount": 20000, "grossAmount": 20000 } + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } } ] }, @@ -153,6 +196,114 @@ "idProductAbstract": "#concreteProduct2.fk_product_abstract" } ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "approvalMerchant" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "pendingLocalizedAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "pendingProductImage", + "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": "pendingProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#pendingLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#pendingLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "approvalStatus": "waiting_for_approval", + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#pendingLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#pendingLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#approvalMerchant.id_merchant", + "idProductAbstract": "#pendingProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#pendingProduct.id_product_concrete", + "idProductAbstract": "#pendingProduct.fk_product_abstract", + "productImages": ["#pendingProductImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#pendingProduct.abstract_sku", + "skuProduct": "#pendingProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#pendingProduct.sku", + "isNeverOutOfStock": "1" + } + ] } ] } diff --git a/cypress/fixtures/suite/mp/marketplace-product-concretes/static-merchant-product-management.json b/cypress/fixtures/suite/mp/marketplace-product-concretes/static-merchant-product-management.json new file mode 100644 index 000000000..0f3ef46e5 --- /dev/null +++ b/cypress/fixtures/suite/mp/marketplace-product-concretes/static-merchant-product-management.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "color", + "addedConcrete": { + "attributeValue": "Grey", + "stockQuantity": 5, + "searchableLocales": ["en_US", "de_DE"] + } +} diff --git a/cypress/fixtures/suite/mp/marketplace-product-concretes/static-product-concrete-management.json b/cypress/fixtures/suite/mp/marketplace-product-concretes/static-product-concrete-management.json index ba4339e8a..bdf2530b4 100644 --- a/cypress/fixtures/suite/mp/marketplace-product-concretes/static-product-concrete-management.json +++ b/cypress/fixtures/suite/mp/marketplace-product-concretes/static-product-concrete-management.json @@ -1,3 +1,8 @@ { - "defaultPassword": "change123" + "defaultPassword": "change123", + "createdProduct": { + "attributeName": "color", + "attributeValues": ["white", "black"] + }, + "pendingProductPrice": "€100.00" } diff --git a/cypress/fixtures/suite/mp/merchant-portal/dynamic-customer-specific-prices.json b/cypress/fixtures/suite/mp/merchant-portal/dynamic-customer-specific-prices.json new file mode 100644 index 000000000..68a8308a9 --- /dev/null +++ b/cypress/fixtures/suite/mp/merchant-portal/dynamic-customer-specific-prices.json @@ -0,0 +1,223 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "haveConfirmedCustomer", + "key": "companyCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#companyCustomer", + "fkCustomer": "#companyCustomer.id_customer", + "fkCompany": "#company.id_company", + "fkCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 45000, + "grossAmount": 50000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/merchant-portal/dynamic-merchant-profile-update.json b/cypress/fixtures/suite/mp/merchant-portal/dynamic-merchant-profile-update.json new file mode 100644 index 000000000..76e0bb8f4 --- /dev/null +++ b/cypress/fixtures/suite/mp/merchant-portal/dynamic-merchant-profile-update.json @@ -0,0 +1,74 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "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": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123", + "fkLocale": 66 + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveUrl", + "key": "merchantUrlEN", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/en/merchant/profile-update-en-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant.id_merchant", + "urlPrefix": "/de/merchant/profile-update-de-", + "url": "#merchant.name" + } + ] + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/merchant-portal/dynamic-product-volume-prices.json b/cypress/fixtures/suite/mp/merchant-portal/dynamic-product-volume-prices.json new file mode 100644 index 000000000..537a7226c --- /dev/null +++ b/cypress/fixtures/suite/mp/merchant-portal/dynamic-product-volume-prices.json @@ -0,0 +1,225 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "editableLocalizedAttribute" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "editableProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#editableProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#editableProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + }, + "idProduct": null, + "skuProduct": "" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/merchant-portal/static-customer-specific-prices.json b/cypress/fixtures/suite/mp/merchant-portal/static-customer-specific-prices.json new file mode 100644 index 000000000..aa02f8e99 --- /dev/null +++ b/cypress/fixtures/suite/mp/merchant-portal/static-customer-specific-prices.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "storeName": "DE", + "currency": "EUR", + "defaultPrice": "€500.00", + "customerPrice": { + "netAmount": 90, + "grossAmount": 100, + "displayed": "€100.00" + } +} diff --git a/cypress/fixtures/suite/mp/merchant-portal/static-merchant-profile-update.json b/cypress/fixtures/suite/mp/merchant-portal/static-merchant-profile-update.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/mp/merchant-portal/static-merchant-profile-update.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/mp/merchant-portal/static-product-volume-prices.json b/cypress/fixtures/suite/mp/merchant-portal/static-product-volume-prices.json new file mode 100644 index 000000000..924f30129 --- /dev/null +++ b/cypress/fixtures/suite/mp/merchant-portal/static-product-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "threshold": 2, + "quantity": 4, + "price": "€10.00" + } +} diff --git a/cypress/fixtures/suite/mp/product-offer/dynamic-offer-creation.json b/cypress/fixtures/suite/mp/product-offer/dynamic-offer-creation.json new file mode 100644 index 000000000..d65a0fe0a --- /dev/null +++ b/cypress/fixtures/suite/mp/product-offer/dynamic-offer-creation.json @@ -0,0 +1,337 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "productMerchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "productMerchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#productMerchant", "#productMerchantUser"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "offerMerchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "offerMerchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#offerMerchant", "#offerMerchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#productMerchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "offeredLocalizedAttribute" + }, + { + "type": "transfer", + "name": "ProductImageTransfer", + "key": "offeredProductImage", + "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": "offeredProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#offeredLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#offeredLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#offeredLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#offeredLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#productMerchant.id_merchant", + "idProductAbstract": "#offeredProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#offeredProduct.id_product_concrete", + "idProductAbstract": "#offeredProduct.fk_product_abstract", + "productImages": ["#offeredProductImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#offeredProduct.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#offeredProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#offeredProduct.id_product_concrete", + "concreteSku": "#offeredProduct.sku", + "merchantReference": "#offerMerchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "arguments": [ + { + "fkProductOffer": "#productOffer.id_product_offer", + "skuProductAbstract": "#offeredProduct.abstract_sku", + "skuProduct": "#offeredProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#offerMerchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/product-offer/dynamic-offer-volume-prices.json b/cypress/fixtures/suite/mp/product-offer/dynamic-offer-volume-prices.json new file mode 100644 index 000000000..55aaa3f95 --- /dev/null +++ b/cypress/fixtures/suite/mp/product-offer/dynamic-offer-volume-prices.json @@ -0,0 +1,270 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "key": "productOfferPrice", + "arguments": [ + { + "fkProductOffer": "#productOffer.id_product_offer", + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "editableLocalizedAttribute" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "editableProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#editableLocalizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#editableLocalizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "editableProductOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#editableProduct.id_product_concrete", + "concreteSku": "#editableProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "havePriceProductOffer", + "arguments": [ + { + "fkProductOffer": "#editableProductOffer.id_product_offer", + "skuProductAbstract": "#editableProduct.abstract_sku", + "skuProduct": "#editableProduct.sku", + "moneyValue": { + "netAmount": 18000, + "grossAmount": 20000, + "priceData": "{\"volume_prices\": [{\"quantity\": 2, \"net_price\": 800, \"gross_price\": 1000}]}" + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#editableProductOffer.id_product_offer", + "productOfferReference": "#editableProductOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/mp/product-offer/static-offer-creation.json b/cypress/fixtures/suite/mp/product-offer/static-offer-creation.json new file mode 100644 index 000000000..64ac4d7f4 --- /dev/null +++ b/cypress/fixtures/suite/mp/product-offer/static-offer-creation.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "storeName": "DE", + "currency": "EUR", + "offer": { + "netAmount": 180, + "grossAmount": 200, + "displayedPrice": "€200.00", + "stockQuantity": 10 + } +} diff --git a/cypress/fixtures/suite/mp/product-offer/static-offer-volume-prices.json b/cypress/fixtures/suite/mp/product-offer/static-offer-volume-prices.json new file mode 100644 index 000000000..b770896d8 --- /dev/null +++ b/cypress/fixtures/suite/mp/product-offer/static-offer-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "offerPrice": "€200.00", + "volumeTier": { + "threshold": 2, + "quantity": 4, + "price": "€10.00" + } +} diff --git a/cypress/fixtures/suite/yves/agent-assist/dynamic-customer-impersonation.json b/cypress/fixtures/suite/yves/agent-assist/dynamic-customer-impersonation.json new file mode 100644 index 000000000..8d64b178d --- /dev/null +++ b/cypress/fixtures/suite/yves/agent-assist/dynamic-customer-impersonation.json @@ -0,0 +1,195 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission"] + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "havePriceProduct", + "key": "productWithPrice", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "productWithPriceAndStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/agent-assist/static-customer-impersonation.json b/cypress/fixtures/suite/yves/agent-assist/static-customer-impersonation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/yves/agent-assist/static-customer-impersonation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/yves/cart/dynamic-shared-cart.json b/cypress/fixtures/suite/yves/cart/dynamic-shared-cart.json new file mode 100644 index 000000000..d93e39880 --- /dev/null +++ b/cypress/fixtures/suite/yves/cart/dynamic-shared-cart.json @@ -0,0 +1,283 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "ownerCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "ownerAddress", + "arguments": [ + { + "fkCustomer": "#ownerCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "ownerCompanyUser", + "arguments": [ + { + "customer": "#ownerCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#ownerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "receiverCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "receiverAddress", + "arguments": [ + { + "fkCustomer": "#receiverCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "receiverCompanyUser", + "arguments": [ + { + "customer": "#receiverCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#receiverCompanyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "colleagueSharedQuote", + "arguments": [ + { + "customer": "#ownerCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "idProductAbstract": "#product.fk_product_abstract", + "productOfferReference": "#productOffer.product_offer_reference", + "merchantReference": "#productOffer.merchant_reference", + "quantity": 1 + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "linkSharedQuote", + "arguments": [ + { + "customer": "#ownerCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/cart/static-shared-cart.json b/cypress/fixtures/suite/yves/cart/static-shared-cart.json new file mode 100644 index 000000000..7b5c6fedb --- /dev/null +++ b/cypress/fixtures/suite/yves/cart/static-shared-cart.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "soldByText": "Sold by", + "fullAccessText": "Full access", + "cartPreviewTitlePrefix": "Preview:" +} diff --git a/cypress/fixtures/suite/yves/catalog/dynamic-catalog-filters.json b/cypress/fixtures/suite/yves/catalog/dynamic-catalog-filters.json new file mode 100644 index 000000000..cb94f9064 --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/dynamic-catalog-filters.json @@ -0,0 +1,340 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + }, + { + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveActiveMerchantWithStore", + "key": "merchant1" + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant1.id_merchant", + "urlPrefix": "/en/merchant/search-one-en-", + "url": "#merchant1.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant1.id_merchant", + "urlPrefix": "/de/merchant/search-one-de-", + "url": "#merchant1.name" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant1.id_merchant", + "idProductAbstract": "#product1.fk_product_abstract" + } + ] + }, + { + "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": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2" + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeEN.id_locale", + "fkResourceMerchant": "#merchant2.id_merchant", + "urlPrefix": "/en/merchant/search-two-en-", + "url": "#merchant2.name" + } + ] + }, + { + "type": "helper", + "name": "haveUrl", + "arguments": [ + { + "fkLocale": "#localeDE.id_locale", + "fkResourceMerchant": "#merchant2.id_merchant", + "urlPrefix": "/de/merchant/search-two-de-", + "url": "#merchant2.name" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product2", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant2.id_merchant", + "idProductAbstract": "#product2.fk_product_abstract" + } + ] + }, + { + "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": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "idProduct": null, + "skuProduct": "", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 10000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/catalog/dynamic-product-restrictions.json b/cypress/fixtures/suite/yves/catalog/dynamic-product-restrictions.json new file mode 100644 index 000000000..e8fe70aab --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/dynamic-product-restrictions.json @@ -0,0 +1,177 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 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": "haveFullProduct", + "key": "allowedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#allowedProduct.abstract_sku", + "skuProduct": "#allowedProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#allowedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#allowedProduct.id_product_concrete", + "idProductAbstract": "#allowedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "hiddenProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#hiddenProduct.abstract_sku", + "skuProduct": "#hiddenProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#hiddenProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#hiddenProduct.id_product_concrete", + "idProductAbstract": "#hiddenProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "whitelistedCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "whitelistedCompanyUser", + "arguments": [ + { + "customer": "#whitelistedCustomer", + "fkCustomer": "#whitelistedCustomer.id_customer", + "fkCompany": 1, + "fkCompanyBusinessUnit": 2, + "isActive": true, + "isDefault": true + } + ] + }, + { + "type": "helper", + "name": "haveProductList", + "key": "whitelist", + "arguments": [ + { + "fkMerchantRelationship": 1, + "type": "whitelist", + "productListProductConcreteRelation": { + "productIds": ["#allowedProduct.id_product_concrete"] + } + } + ] + }, + { + "type": "helper", + "name": "haveProductList", + "key": "blacklist", + "arguments": [ + { + "fkMerchantRelationship": 9, + "type": "blacklist", + "productListProductConcreteRelation": { + "productIds": ["#hiddenProduct.id_product_concrete"] + } + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/catalog/dynamic-quick-add-to-cart.json b/cypress/fixtures/suite/yves/catalog/dynamic-quick-add-to-cart.json new file mode 100644 index 000000000..38fa4e3bf --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/dynamic-quick-add-to-cart.json @@ -0,0 +1,16 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [{ "locale_name": "en_US", "password": "change123" }] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/catalog/static-catalog-filters.json b/cypress/fixtures/suite/yves/catalog/static-catalog-filters.json new file mode 100644 index 000000000..89b06a34b --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/static-catalog-filters.json @@ -0,0 +1,12 @@ +{ + "defaultPassword": "change123", + "searchTerm": "canon", + "attributeFilter": { + "name": "color", + "value": "Blue" + }, + "filterTitles": ["Price", "Rating", "Label", "Brand", "Color", "Merchant"], + "ascendingPriceSortLabel": "Sort by price ascending", + "descendingPriceSortLabel": "Sort by price descending", + "merchantFilterName": "merchant_name" +} diff --git a/cypress/fixtures/suite/yves/catalog/static-product-restrictions.json b/cypress/fixtures/suite/yves/catalog/static-product-restrictions.json new file mode 100644 index 000000000..6de9f46c9 --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/static-product-restrictions.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "blacklistedCustomer": { + "email": "Richi@acme.com" + }, + "unrestrictedCustomer": { + "email": "george.freeman@acme.com" + } +} diff --git a/cypress/fixtures/suite/yves/catalog/static-quick-add-to-cart.json b/cypress/fixtures/suite/yves/catalog/static-quick-add-to-cart.json new file mode 100644 index 000000000..d166c50d8 --- /dev/null +++ b/cypress/fixtures/suite/yves/catalog/static-quick-add-to-cart.json @@ -0,0 +1,15 @@ +{ + "defaultPassword": "change123", + "buyableProduct": { + "searchQuery": "150_29554292", + "cartEntry": "150_29554292" + }, + "unbuyableProduct": { + "searchQuery": "115_26408656" + }, + "productGroup": { + "searchQuery": "002_25904004", + "swatchIdentifier": "#D3D3D3", + "cartEntry": "003_26138343" + } +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic-cart-approval-process.json b/cypress/fixtures/suite/yves/checkout/dynamic-cart-approval-process.json new file mode 100644 index 000000000..b51e2b351 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic-cart-approval-process.json @@ -0,0 +1,240 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "requestQuoteApprovalPermission", + "arguments": ["RequestQuoteApprovalPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "approveQuotePermission", + "arguments": ["ApproveQuotePermissionPlugin"] + }, + { + "type": "transfer", + "name": "PermissionTransfer", + "key": "limitedPlaceOrderPermission", + "arguments": { + "idPermission": "#placeOrderPermission.id_permission", + "key": "PlaceOrderPermissionPlugin", + "configuration": { + "store_multi_currency": { + "DE": { + "EUR": 10000 + } + } + } + } + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#limitedPlaceOrderPermission", "#requestQuoteApprovalPermission"] + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "approverRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#placeOrderPermission", "#approveQuotePermission"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "buyer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "approver", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "buyerAddress", + "arguments": [ + { + "fkCustomer": "#buyer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "approverRoleCollection", + "arguments": { + "roles": ["#approverRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "buyerCompanyUser", + "arguments": [ + { + "customer": "#buyer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#buyerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "approverCompanyUser", + "arguments": [ + { + "customer": "#approver", + "fk_company": "#company.id_company", + "company_role_collection": ["#approverRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#approverCompanyUser", ["#approverRole"]] + }, + { + "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": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#buyer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic-checkout-authentication.json b/cypress/fixtures/suite/yves/checkout/dynamic-checkout-authentication.json new file mode 100644 index 000000000..07002da83 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic-checkout-authentication.json @@ -0,0 +1,81 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic-click-and-collect.json b/cypress/fixtures/suite/yves/checkout/dynamic-click-and-collect.json new file mode 100644 index 000000000..eb4e71d37 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic-click-and-collect.json @@ -0,0 +1,261 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveShipmentType", + "key": "pickupShipmentType", + "arguments": [ + { + "key": "pickup" + } + ] + }, + { + "type": "helper", + "name": "haveShipmentMethod", + "key": "pickupShipmentMethod", + "arguments": [ + {}, + {}, + { + "DE": { + "EUR": {} + } + }, + ["#store.id_store"] + ] + }, + { + "type": "helper", + "name": "haveShipmentMethodShipmentTypeRelation", + "arguments": ["#pickupShipmentMethod.id_shipment_method", "#pickupShipmentType.id_shipment_type"] + }, + { + "type": "helper", + "name": "haveServiceType", + "key": "pickupServiceType", + "arguments": [ + { + "key": "pickup" + } + ] + }, + { + "type": "helper", + "name": "haveServicePoint", + "key": "servicePoint", + "arguments": [ + { + "storeRelation": { + "stores": [ + { + "idStore": "#store.id_store" + } + ] + } + } + ] + }, + { + "type": "helper", + "name": "haveServicePointAddress", + "key": "servicePointAddress", + "arguments": [ + { + "servicePoint": "#servicePoint", + "country": "#country" + } + ] + }, + { + "type": "helper", + "name": "haveService", + "key": "pickupService", + "arguments": [ + { + "servicePoint": { + "id_service_point": "#servicePoint.id_service_point" + }, + "serviceType": { + "id_service_type": "#pickupServiceType.id_service_type" + } + } + ] + }, + { + "type": "helper", + "name": "haveShipmentTypeServiceTypeRelation", + "arguments": ["#pickupShipmentType", "#pickupServiceType"] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 20000, + "grossAmount": 20000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "pickupOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#pickupOffer.id_product_offer", + "productOfferReference": "#pickupOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#pickupOffer", "#store"] + }, + { + "type": "helper", + "name": "haveProductOfferShipmentType", + "arguments": ["#pickupOffer", "#pickupShipmentType"] + }, + { + "type": "helper", + "name": "haveProductOfferService", + "arguments": [ + { + "idProductOffer": "#pickupOffer.id_product_offer", + "idService": "#pickupService.id_service" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "idProductAbstract": "#product1.fk_product_abstract", + "productOfferReference": "#pickupOffer.product_offer_reference", + "merchantReference": "#pickupOffer.merchant_reference", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic-multi-merchant-order.json b/cypress/fixtures/suite/yves/checkout/dynamic-multi-merchant-order.json new file mode 100644 index 000000000..f4df8d5af --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic-multi-merchant-order.json @@ -0,0 +1,328 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "product1", + "arguments": [ + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product1.abstract_sku", + "skuProduct": "#product1.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant1.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer1", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product3.abstract_sku", + "skuProduct": "#product3.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product3.id_product_concrete", + "idProductAbstract": "#product3.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product3.id_product_concrete", + "concreteSku": "#product3.sku", + "merchantReference": "#merchant2.merchant_reference" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOfferStore", + "arguments": ["#productOffer2", "#store"] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "idProductAbstract": "#product1.fk_product_abstract", + "quantity": 1 + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "idProductAbstract": "#product2.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer1.product_offer_reference", + "merchantReference": "#productOffer1.merchant_reference" + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "idProductAbstract": "#product3.fk_product_abstract", + "quantity": 1, + "productOfferReference": "#productOffer2.product_offer_reference", + "merchantReference": "#productOffer2.merchant_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/checkout/dynamic-split-delivery.json b/cypress/fixtures/suite/yves/checkout/dynamic-split-delivery.json new file mode 100644 index 000000000..05d366fc7 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/dynamic-split-delivery.json @@ -0,0 +1,247 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product1", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product1WithStore", + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": "havePriceProduct", + "key": "product2WithPrice", + "arguments": [ + { + "skuProductAbstract": "#product2.abstract_sku", + "skuProduct": "#product2.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "key": "product2WithStore", + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product3", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "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": "product3WithStore", + "arguments": [ + "#store", + { + "sku": "#product3.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "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": 1 + }, + { + "sku": "#product3.sku", + "abstractSku": "#product3.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/checkout/static-cart-approval-process.json b/cypress/fixtures/suite/yves/checkout/static-cart-approval-process.json new file mode 100644 index 000000000..3d27ad5a3 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/static-cart-approval-process.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "waitingStatus": "Waiting", + "approvedStatus": "Approved" +} diff --git a/cypress/fixtures/suite/yves/checkout/static-checkout-authentication.json b/cypress/fixtures/suite/yves/checkout/static-checkout-authentication.json new file mode 100644 index 000000000..1e6919487 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/static-checkout-authentication.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "registrationPassword": "Cypress!Secure1", + "salutation": "Mr" +} diff --git a/cypress/fixtures/suite/yves/checkout/static-click-and-collect.json b/cypress/fixtures/suite/yves/checkout/static-click-and-collect.json new file mode 100644 index 000000000..8f332a594 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/static-click-and-collect.json @@ -0,0 +1,15 @@ +{ + "defaultPassword": "change123", + "pickupShipmentTypeKey": "pickup", + "expectedShipmentCount": 1, + "billingAddress": { + "firstName": "Pickup", + "lastName": "Buyer", + "address1": "Billing Street", + "address2": "123", + "zipCode": "10247", + "city": "Berlin", + "company": "Spryker", + "phone": "987654321" + } +} diff --git a/cypress/fixtures/suite/yves/checkout/static-multi-merchant-order.json b/cypress/fixtures/suite/yves/checkout/static-multi-merchant-order.json new file mode 100644 index 000000000..d3c54ca5b --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/static-multi-merchant-order.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3, + "soldByText": "Sold by" +} diff --git a/cypress/fixtures/suite/yves/checkout/static-split-delivery.json b/cypress/fixtures/suite/yves/checkout/static-split-delivery.json new file mode 100644 index 000000000..0d6857073 --- /dev/null +++ b/cypress/fixtures/suite/yves/checkout/static-split-delivery.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "expectedShipmentCount": 3 +} diff --git a/cypress/fixtures/suite/yves/cms/dynamic-cms-page-publish.json b/cypress/fixtures/suite/yves/cms/dynamic-cms-page-publish.json new file mode 100644 index 000000000..0704e54cd --- /dev/null +++ b/cypress/fixtures/suite/yves/cms/dynamic-cms-page-publish.json @@ -0,0 +1,25 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/cms/dynamic-multistore-cms-page.json b/cypress/fixtures/suite/yves/cms/dynamic-multistore-cms-page.json new file mode 100644 index 000000000..9a420a75c --- /dev/null +++ b/cypress/fixtures/suite/yves/cms/dynamic-multistore-cms-page.json @@ -0,0 +1,21 @@ +{ + "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] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/cms/static-cms-page-publish.json b/cypress/fixtures/suite/yves/cms/static-cms-page-publish.json new file mode 100644 index 000000000..66c3d5c9c --- /dev/null +++ b/cypress/fixtures/suite/yves/cms/static-cms-page-publish.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "defaultLocaleName": "en_US", + "cmsPageName": "test-cms-page-publish" +} diff --git a/cypress/fixtures/suite/yves/cms/static-multistore-cms-page.json b/cypress/fixtures/suite/yves/cms/static-multistore-cms-page.json new file mode 100644 index 000000000..2bac107fd --- /dev/null +++ b/cypress/fixtures/suite/yves/cms/static-multistore-cms-page.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "cmsPageName": "multistore-cms-page", + "storeName": "AT", + "localeName": "en_US" +} diff --git a/cypress/fixtures/suite/yves/comments/dynamic-cart-comments.json b/cypress/fixtures/suite/yves/comments/dynamic-cart-comments.json index 8f00f9af0..0222dfb89 100644 --- a/cypress/fixtures/suite/yves/comments/dynamic-cart-comments.json +++ b/cypress/fixtures/suite/yves/comments/dynamic-cart-comments.json @@ -4,29 +4,77 @@ "attributes": { "synchronize": true, "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, { "type": "helper", "name": "haveConfirmedCustomer", "key": "customer", - "arguments": [{ "locale_name": "en_US", "password": "change123" }] + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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 } + "arguments": { + "id_store": 1 + } }, { "type": "helper", "name": "haveFullProduct", "key": "product1", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] }, { "type": "helper", "name": "haveFullProduct", "key": "product2", - "arguments": [{}, { "idTaxSet": 1 }] + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] }, { "type": "helper", @@ -35,7 +83,10 @@ { "skuProductAbstract": "#product1.abstract_sku", "skuProduct": "#product1.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, @@ -46,19 +97,34 @@ { "skuProductAbstract": "#product2.abstract_sku", "skuProduct": "#product2.sku", - "moneyValue": { "netAmount": 30000, "grossAmount": 30000 } + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } } ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product1.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product1.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "helper", "name": "haveProductInStockForStore", - "arguments": ["#store", { "sku": "#product2.sku", "isNeverOutOfStock": "1" }] + "arguments": [ + "#store", + { + "sku": "#product2.sku", + "isNeverOutOfStock": "1" + } + ] }, { "type": "transfer", @@ -119,7 +185,11 @@ "type": "helper", "name": "havePersistentQuote", "key": "emptyQuote", - "arguments": [{ "customer": "#customer" }] + "arguments": [ + { + "customer": "#customer" + } + ] } ] } diff --git a/cypress/fixtures/suite/yves/comments/dynamic-order-comments.json b/cypress/fixtures/suite/yves/comments/dynamic-order-comments.json new file mode 100644 index 000000000..94f4dbc83 --- /dev/null +++ b/cypress/fixtures/suite/yves/comments/dynamic-order-comments.json @@ -0,0 +1,166 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/comments/static-cart-comments.json b/cypress/fixtures/suite/yves/comments/static-cart-comments.json index 05511e655..42332182f 100644 --- a/cypress/fixtures/suite/yves/comments/static-cart-comments.json +++ b/cypress/fixtures/suite/yves/comments/static-cart-comments.json @@ -6,5 +6,6 @@ ], "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." + "commentsToRemove": "The app is so slow. It takes forever to load the product images.", + "commentToKeepThroughCheckout": "Please leave the parcel with the building concierge." } diff --git a/cypress/fixtures/suite/yves/comments/static-order-comments.json b/cypress/fixtures/suite/yves/comments/static-order-comments.json new file mode 100644 index 000000000..b85b30324 --- /dev/null +++ b/cypress/fixtures/suite/yves/comments/static-order-comments.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "commentOnOrder": "Please call the site office before delivering this order." +} diff --git a/cypress/fixtures/suite/yves/company-account/dynamic-business-on-behalf.json b/cypress/fixtures/suite/yves/company-account/dynamic-business-on-behalf.json new file mode 100644 index 000000000..c95a3ddee --- /dev/null +++ b/cypress/fixtures/suite/yves/company-account/dynamic-business-on-behalf.json @@ -0,0 +1,122 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "firstBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "secondBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + [] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "firstCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#firstBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#firstCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "secondCompanyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#secondBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#secondCompanyUser", ["#buyerRole"]] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/company-account/dynamic-business-unit-address-checkout.json b/cypress/fixtures/suite/yves/company-account/dynamic-business-unit-address-checkout.json new file mode 100644 index 000000000..ec671b64d --- /dev/null +++ b/cypress/fixtures/suite/yves/company-account/dynamic-business-unit-address-checkout.json @@ -0,0 +1,169 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission"] + ] + }, + { + "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": "haveCompanyUnitAddress", + "key": "businessUnitAddress", + "arguments": [ + { + "fkCompany": "#company.id_company", + "fkCountry": "#country.id_country", + "address1": "Business Unit Street", + "address2": "23", + "zipCode": "8002", + "city": "Barcelona", + "phone": "3490284322" + } + ] + }, + { + "type": "transfer", + "name": "CompanyBusinessUnitTransfer", + "key": "businessUnitWithAddress", + "arguments": { + "idCompanyBusinessUnit": "#businessUnit.id_company_business_unit", + "fkCompany": "#company.id_company", + "addressCollection": { + "companyUnitAddresses": ["#businessUnitAddress"] + } + } + }, + { + "type": "helper", + "name": "haveCompanyUnitAddressToCompanyBusinessUnitRelation", + "arguments": ["#businessUnitWithAddress"] + }, + { + "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" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/company-account/dynamic-company-structure-creation.json b/cypress/fixtures/suite/yves/company-account/dynamic-company-structure-creation.json new file mode 100644 index 000000000..fcb2ed372 --- /dev/null +++ b/cypress/fixtures/suite/yves/company-account/dynamic-company-structure-creation.json @@ -0,0 +1,131 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": false, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "companyBusinessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyRoles", + "arguments": ["SeeCompanyRolesPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "createCompanyRoles", + "arguments": ["CreateCompanyRolesPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "seeCompanyUsers", + "arguments": ["SeeCompanyUsersPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "addCompanyUser", + "arguments": ["AddCompanyUserPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "adminRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#seeCompanyRoles", "#createCompanyRoles", "#seeCompanyUsers", "#addCompanyUser"] + ] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "restrictedRole", + "arguments": [ + { + "fk_company": "#company.id_company", + "name": "ViewCompanyUsersOnly" + }, + ["#seeCompanyUsers"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "adminCustomer", + "arguments": [ + { + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "adminRoleCollection", + "arguments": { + "roles": ["#adminRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "adminCompanyUser", + "arguments": [ + { + "customer": "#adminCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#adminRoleCollection"], + "fk_company_business_unit": "#companyBusinessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#adminCompanyUser", ["#adminRole"]] + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/company-account/static-business-on-behalf.json b/cypress/fixtures/suite/yves/company-account/static-business-on-behalf.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/yves/company-account/static-business-on-behalf.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/yves/company-account/static-business-unit-address-checkout.json b/cypress/fixtures/suite/yves/company-account/static-business-unit-address-checkout.json new file mode 100644 index 000000000..c4bd9efd7 --- /dev/null +++ b/cypress/fixtures/suite/yves/company-account/static-business-unit-address-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "businessUnitAddressStreet": "Business Unit Street" +} diff --git a/cypress/fixtures/suite/yves/company-account/static-company-structure-creation.json b/cypress/fixtures/suite/yves/company-account/static-company-structure-creation.json new file mode 100644 index 000000000..d36a178a0 --- /dev/null +++ b/cypress/fixtures/suite/yves/company-account/static-company-structure-creation.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "restrictedRoleName": "ViewCompanyUsersOnly", + "companyUserPagePath": "/company/user", + "companyRolePagePath": "/company/company-role" +} diff --git a/cypress/fixtures/suite/yves/discount/dynamic-discounts-and-promotions.json b/cypress/fixtures/suite/yves/discount/dynamic-discounts-and-promotions.json new file mode 100644 index 000000000..3cc18e320 --- /dev/null +++ b/cypress/fixtures/suite/yves/discount/dynamic-discounts-and-promotions.json @@ -0,0 +1,313 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "requestQuoteApprovalPermission", + "arguments": ["RequestQuoteApprovalPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#placeOrderPermission", "#requestQuoteApprovalPermission"] + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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", + "defaultCurrencyIsoCode": "EUR" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + { + "attributes": { + "brand": "Discounts and promotions fixture" + } + }, + { + "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": "haveFullProduct", + "key": "promotionalProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#promotionalProduct.abstract_sku", + "skuProduct": "#promotionalProduct.sku", + "moneyValue": { + "netAmount": 7500, + "grossAmount": 7500 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#promotionalProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "voucherDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 500, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "voucherCode", + "arguments": [ + { + "idDiscount": "#voucherDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "cartRuleDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "cart_rule", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 1000, + "collectorQueryString": "attribute.brand = 'Discounts and promotions fixture'" + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveDiscount", + "key": "promotionDiscount", + "arguments": [ + { + "discountGeneral": { + "discountType": "voucher", + "isActive": true, + "storeRelation": { + "idStores": [1] + } + }, + "discountCalculator": { + "calculatorPlugin": "PLUGIN_CALCULATOR_PERCENTAGE", + "amount": 10000, + "collectorStrategyType": "promotion", + "discountPromotion": { + "abstractSkus": ["#promotionalProduct.abstract_sku"], + "abstractSku": "#promotionalProduct.abstract_sku", + "quantity": 2 + } + }, + "discountCondition": { + "decisionRuleQueryString": "attribute.brand = 'Discounts and promotions fixture'" + } + } + ] + }, + { + "type": "helper", + "name": "haveGeneratedVoucherCodes", + "key": "promotionVoucherCode", + "arguments": [ + { + "idDiscount": "#promotionDiscount.id_discount", + "quantity": 1, + "randomGeneratedCodeLength": 10 + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/discount/static-discounts-and-promotions.json b/cypress/fixtures/suite/yves/discount/static-discounts-and-promotions.json new file mode 100644 index 000000000..09e05a7d0 --- /dev/null +++ b/cypress/fixtures/suite/yves/discount/static-discounts-and-promotions.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/suite/yves/merchandising/dynamic-product-relations.json b/cypress/fixtures/suite/yves/merchandising/dynamic-product-relations.json new file mode 100644 index 000000000..49711fc7f --- /dev/null +++ b/cypress/fixtures/suite/yves/merchandising/dynamic-product-relations.json @@ -0,0 +1,208 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "relatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productWithoutRelatedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithRelatedProduct.abstract_sku", + "skuProduct": "#productWithRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#relatedProduct.abstract_sku", + "skuProduct": "#relatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#productWithoutRelatedProduct.abstract_sku", + "skuProduct": "#productWithoutRelatedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithRelatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#relatedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#productWithoutRelatedProduct.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": "#productWithRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#relatedProduct.id_product_concrete", + "idProductAbstract": "#relatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#productWithoutRelatedProduct.id_product_concrete", + "idProductAbstract": "#productWithoutRelatedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "transfer", + "name": "StoreRelationTransfer", + "key": "storeRelation", + "arguments": { + "id_stores": [1], + "stores": [ + { + "id_store": 1, + "name": "DE" + } + ] + } + }, + { + "type": "helper", + "name": "haveProductRelation", + "arguments": [ + "#relatedProduct.abstract_sku", + "#productWithRelatedProduct.fk_product_abstract", + "#relatedProduct.abstract_sku", + "related-products", + "#storeRelation" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/merchandising/dynamic-product-sets.json b/cypress/fixtures/suite/yves/merchandising/dynamic-product-sets.json new file mode 100644 index 000000000..a99ad822f --- /dev/null +++ b/cypress/fixtures/suite/yves/merchandising/dynamic-product-sets.json @@ -0,0 +1,220 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "variantProduct", + "arguments": [ + { + "attributes": { + "storage_capacity": "32 GB" + } + }, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "secondVariantProduct", + "arguments": [ + { + "fkProductAbstract": "#variantProduct.fk_product_abstract", + "abstractSku": "#variantProduct.abstract_sku", + "attributes": { + "storage_capacity": "128 GB" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "simpleProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#variantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#variantProduct.abstract_sku", + "moneyValue": { + "netAmount": 40000, + "grossAmount": 40000 + }, + "skuProduct": "#secondVariantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#simpleProduct.abstract_sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + }, + "skuProduct": "#simpleProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#variantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondVariantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#simpleProduct.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": "#variantProduct.id_product_concrete", + "idProductAbstract": "#variantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#simpleProduct.id_product_concrete", + "idProductAbstract": "#simpleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/merchandising/static-product-relations.json b/cypress/fixtures/suite/yves/merchandising/static-product-relations.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/yves/merchandising/static-product-relations.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/yves/merchandising/static-product-sets.json b/cypress/fixtures/suite/yves/merchandising/static-product-sets.json new file mode 100644 index 000000000..4c544c4a3 --- /dev/null +++ b/cypress/fixtures/suite/yves/merchandising/static-product-sets.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "variantAttributeKey": "storage_capacity", + "variantAttributeValue": "128 GB" +} diff --git a/cypress/fixtures/suite/yves/order-management/dynamic-order-cancellation.json b/cypress/fixtures/suite/yves/order-management/dynamic-order-cancellation.json new file mode 100644 index 000000000..fa0561ef6 --- /dev/null +++ b/cypress/fixtures/suite/yves/order-management/dynamic-order-cancellation.json @@ -0,0 +1,347 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "wholeOrderCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "wholeOrderAddress", + "arguments": [ + { + "fkCustomer": "#wholeOrderCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "mixedStateCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "mixedStateAddress", + "arguments": [ + { + "fkCustomer": "#mixedStateCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wholeOrderProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wholeOrderProduct.abstract_sku", + "skuProduct": "#wholeOrderProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wholeOrderProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wholeOrderProduct.id_product_concrete", + "idProductAbstract": "#wholeOrderProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "advancedItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#advancedItemProduct.abstract_sku", + "skuProduct": "#advancedItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#advancedItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#advancedItemProduct.id_product_concrete", + "idProductAbstract": "#advancedItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "cancellableItemProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#cancellableItemProduct.abstract_sku", + "skuProduct": "#cancellableItemProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#cancellableItemProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#cancellableItemProduct.id_product_concrete", + "idProductAbstract": "#cancellableItemProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#wholeOrderCustomer", + "items": [ + { + "sku": "#wholeOrderProduct.sku", + "abstractSku": "#wholeOrderProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#mixedStateCustomer", + "items": [ + { + "sku": "#advancedItemProduct.sku", + "abstractSku": "#advancedItemProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#cancellableItemProduct.sku", + "abstractSku": "#cancellableItemProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/order-management/static-order-cancellation.json b/cypress/fixtures/suite/yves/order-management/static-order-cancellation.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/suite/yves/order-management/static-order-cancellation.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/fixtures/suite/yves/product-bundle/dynamic-configurable-bundle-checkout.json b/cypress/fixtures/suite/yves/product-bundle/dynamic-configurable-bundle-checkout.json new file mode 100644 index 000000000..261431278 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-bundle/dynamic-configurable-bundle-checkout.json @@ -0,0 +1,21 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomerWithAddress", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product-bundle/static-configurable-bundle-checkout.json b/cypress/fixtures/suite/yves/product-bundle/static-configurable-bundle-checkout.json new file mode 100644 index 000000000..c19c270d7 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-bundle/static-configurable-bundle-checkout.json @@ -0,0 +1,24 @@ +{ + "defaultPassword": "change123", + "templateName": "Smartstation Kit", + "firstConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "130_24725761" + }, + { + "slotName": "Slot 6", + "productIdentifier": "042_31040075" + } + ], + "secondConfiguration": [ + { + "slotName": "Slot 5", + "productIdentifier": "121_29406823" + }, + { + "slotName": "Slot 6", + "productIdentifier": "043_31040074" + } + ] +} diff --git a/cypress/fixtures/suite/yves/product-configurator/dynamic-configurable-product-checkout.json b/cypress/fixtures/suite/yves/product-configurator/dynamic-configurable-product-checkout.json new file mode 100644 index 000000000..31b31f3a4 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-configurator/dynamic-configurable-product-checkout.json @@ -0,0 +1,116 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product-configurator/dynamic-configurable-product-shopping-list.json b/cypress/fixtures/suite/yves/product-configurator/dynamic-configurable-product-shopping-list.json new file mode 100644 index 000000000..fe4796832 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-configurator/dynamic-configurable-product-shopping-list.json @@ -0,0 +1,171 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#readShoppingListPermission", "#writeShoppingListPermission"] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 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": "haveFullProduct", + "key": "product", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "0", + "quantity": 5 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product-configurator/static-configurable-product-checkout.json b/cypress/fixtures/suite/yves/product-configurator/static-configurable-product-checkout.json new file mode 100644 index 000000000..64482fe0b --- /dev/null +++ b/cypress/fixtures/suite/yves/product-configurator/static-configurable-product-checkout.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/suite/yves/product-configurator/static-configurable-product-shopping-list.json b/cypress/fixtures/suite/yves/product-configurator/static-configurable-product-shopping-list.json new file mode 100644 index 000000000..a99d48b63 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-configurator/static-configurable-product-shopping-list.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!", + "unconfiguredCheckoutBlockedMessage": "Please configure items inside the cart.", + "availableStock": 5 +} diff --git a/cypress/fixtures/suite/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json b/cypress/fixtures/suite/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json new file mode 100644 index 000000000..99bcbde5a --- /dev/null +++ b/cypress/fixtures/suite/yves/product-measurement-unit/dynamic-measurement-unit-checkout.json @@ -0,0 +1,174 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductMeasurementBaseUnit", + "key": "baseUnit", + "arguments": ["#product.fk_product_abstract", 13] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 13, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 1, + "precision": 100, + "isDefault": true, + "isDisplayed": true + } + ] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 19, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 0.3048, + "precision": 100, + "isDefault": false, + "isDisplayed": true + } + ] + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_concrete_measurement_unit" + }, + { + "type": "cli-command", + "name": "console queue:worker:start --stop-when-empty" + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json b/cypress/fixtures/suite/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json new file mode 100644 index 000000000..dcc2e23e5 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-measurement-unit/dynamic-packaging-unit-checkout.json @@ -0,0 +1,207 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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 + } + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "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": "haveProductMeasurementBaseUnit", + "key": "baseUnit", + "arguments": ["#product.fk_product_abstract", 1] + }, + { + "type": "helper", + "name": "haveProductMeasurementSalesUnit", + "arguments": [ + "#product.id_product_concrete", + 1, + "#baseUnit.id_product_measurement_base_unit", + { + "conversion": 1, + "precision": 1, + "isDefault": true, + "isDisplayed": true + } + ] + }, + { + "type": "helper", + "name": "haveProductPackagingUnitType", + "key": "packagingUnitType", + "arguments": [ + { + "name": "Giftbox" + } + ] + }, + { + "type": "helper", + "name": "haveProductPackagingUnit", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "fkProductPackagingUnitType": "#packagingUnitType.id_product_packaging_unit_type", + "fkLeadProduct": "#product.id_product_concrete" + }, + { + "defaultAmount": 100, + "isAmountVariable": true, + "amountMin": 100, + "amountMax": 1000, + "amountInterval": 10 + } + ] + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_concrete_measurement_unit" + }, + { + "type": "cli-command", + "name": "console publish:trigger-events -r product_packaging_unit" + }, + { + "type": "cli-command", + "name": "console queue:worker:start --stop-when-empty" + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product-measurement-unit/static-measurement-unit-checkout.json b/cypress/fixtures/suite/yves/product-measurement-unit/static-measurement-unit-checkout.json new file mode 100644 index 000000000..45ef4e651 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-measurement-unit/static-measurement-unit-checkout.json @@ -0,0 +1,11 @@ +{ + "defaultPassword": "change123", + "wholeSalesUnit": { + "name": "Meter", + "quantity": 10 + }, + "fractionalSalesUnit": { + "name": "Foot", + "quantity": 3 + } +} diff --git a/cypress/fixtures/suite/yves/product-measurement-unit/static-packaging-unit-checkout.json b/cypress/fixtures/suite/yves/product-measurement-unit/static-packaging-unit-checkout.json new file mode 100644 index 000000000..073fda332 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-measurement-unit/static-packaging-unit-checkout.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "rejectedAmount": 51, + "acceptedAmount": 1000 +} diff --git a/cypress/fixtures/suite/yves/product-offer/dynamic-multistore-product-offer.json b/cypress/fixtures/suite/yves/product-offer/dynamic-multistore-product-offer.json new file mode 100644 index 000000000..d50efbbff --- /dev/null +++ b/cypress/fixtures/suite/yves/product-offer/dynamic-multistore-product-offer.json @@ -0,0 +1,184 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "storePrimary", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "storeSecondary", + "arguments": { + "id_store": 2, + "name": "AT" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#storePrimary", "#storeSecondary"] + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "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" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "storeRelation": { + "id_stores": [1, 2] + } + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchantToUnassign", + "arguments": [ + { + "storeRelation": { + "id_stores": [1, 2] + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOfferToUnassign", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchantToUnassign.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOfferToUnassign.id_product_offer", + "productOfferReference": "#productOfferToUnassign.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchantToUnassign.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product-offer/dynamic-offer-availability.json b/cypress/fixtures/suite/yves/product-offer/dynamic-offer-availability.json new file mode 100644 index 000000000..cc8256988 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-offer/dynamic-offer-availability.json @@ -0,0 +1,255 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeEN", + "arguments": { + "id_locale": 66, + "locale_name": "en_US" + } + }, + { + "type": "transfer", + "name": "LocaleTransfer", + "key": "localeDE", + "arguments": { + "id_locale": 46, + "locale_name": "de_DE" + } + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "localizedAttribute" + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "skuProduct": "#merchantProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#merchantProduct.id_product_concrete", + "concreteSku": "#merchantProduct.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "quantity": 3, + "isNeverOutOfStock": false + }, + "#merchant.stocks" + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#merchantProduct.sku", + "abstractSku": "#merchantProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference", + "productOfferReference": "#productOffer.product_offer_reference" + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#merchantProduct.sku", + "abstractSku": "#merchantProduct.abstract_sku", + "quantity": 1, + "merchantReference": "#merchant.merchant_reference", + "productOfferReference": "#productOffer.product_offer_reference" + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product-offer/static-multistore-product-offer.json b/cypress/fixtures/suite/yves/product-offer/static-multistore-product-offer.json new file mode 100644 index 000000000..292da643d --- /dev/null +++ b/cypress/fixtures/suite/yves/product-offer/static-multistore-product-offer.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "160", + "secondaryStorePrice": "260" +} diff --git a/cypress/fixtures/suite/yves/product-offer/static-offer-availability.json b/cypress/fixtures/suite/yves/product-offer/static-offer-availability.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/suite/yves/product-offer/static-offer-availability.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-availability-calculation.json b/cypress/fixtures/suite/yves/product/dynamic-availability-calculation.json new file mode 100644 index 000000000..0cbabfeb6 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-availability-calculation.json @@ -0,0 +1,165 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1 + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "orderingCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#orderingCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "cartCustomer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "quantity": 3, + "isNeverOutOfStock": false + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "orderingCustomerQuote", + "arguments": [ + { + "customer": "#orderingCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "cartCustomerQuote", + "arguments": [ + { + "customer": "#cartCustomer", + "items": [ + { + "sku": "#product.sku", + "abstractSku": "#product.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-back-in-stock-notification.json b/cypress/fixtures/suite/yves/product/dynamic-back-in-stock-notification.json new file mode 100644 index 000000000..83e1d8daf --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-back-in-stock-notification.json @@ -0,0 +1,206 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "outOfStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "outOfStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#outOfStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#outOfStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#outOfStockProduct.abstract_sku", + "skuProduct": "#outOfStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#outOfStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 0 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#outOfStockProduct.id_product_concrete", + "idProductAbstract": "#outOfStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "inStockProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "inStockProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#inStockProductName.name" + }, + { + "locale": "#localeDE", + "name": "#inStockProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#inStockProduct.abstract_sku", + "skuProduct": "#inStockProduct.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#inStockProduct.sku", + "isNeverOutOfStock": "0", + "quantity": 20 + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#inStockProduct.id_product_concrete", + "idProductAbstract": "#inStockProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-discontinued-alternative-products.json b/cypress/fixtures/suite/yves/product/dynamic-discontinued-alternative-products.json new file mode 100644 index 000000000..c68f05312 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-discontinued-alternative-products.json @@ -0,0 +1,377 @@ +{ + "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": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "discontinuedProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "substituteProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "wishlistSubstituteProductName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "discontinuedProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#discontinuedProductName.name" + }, + { + "locale": "#localeDE", + "name": "#discontinuedProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#discontinuedProduct.abstract_sku", + "skuProduct": "#discontinuedProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discontinuedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#discontinuedProduct.id_product_concrete", + "idProductAbstract": "#discontinuedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "substituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#substituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#substituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#substituteProduct.abstract_sku", + "skuProduct": "#substituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#substituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#substituteProduct.id_product_concrete", + "idProductAbstract": "#substituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistProduct.abstract_sku", + "skuProduct": "#wishlistProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistProduct.id_product_concrete", + "idProductAbstract": "#wishlistProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "wishlistSubstituteProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#wishlistSubstituteProductName.name" + }, + { + "locale": "#localeDE", + "name": "#wishlistSubstituteProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#wishlistSubstituteProduct.abstract_sku", + "skuProduct": "#wishlistSubstituteProduct.sku", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#wishlistSubstituteProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#wishlistSubstituteProduct.id_product_concrete", + "idProductAbstract": "#wishlistSubstituteProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#discontinuedProduct", "#substituteProduct.sku"] + }, + { + "type": "helper", + "name": "haveProductAlternative", + "arguments": ["#wishlistProduct", "#wishlistSubstituteProduct.sku"] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-merchant-product-original-price.json b/cypress/fixtures/suite/yves/product/dynamic-merchant-product-original-price.json new file mode 100644 index 000000000..bf5899ff0 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-merchant-product-original-price.json @@ -0,0 +1,217 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "type": "helper", + "name": "haveUser", + "key": "merchantUser", + "arguments": [ + { + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant" + }, + { + "type": "helper", + "name": "haveMerchantUserWithAclEntities", + "arguments": ["#merchant", "#merchantUser"] + }, + { + "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": "merchantProduct", + "arguments": [ + {}, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveMerchantProduct", + "arguments": [ + { + "idMerchant": "#merchant.id_merchant", + "idProductAbstract": "#merchantProduct.fk_product_abstract" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 12000, + "grossAmount": 15000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#merchantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#merchantProduct.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 12000, + "grossAmount": 15000 + }, + "skuProduct": "#merchantProduct.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#merchantProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#merchantProduct.id_product_concrete", + "idProductAbstract": "#merchantProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-multistore-product.json b/cypress/fixtures/suite/yves/product/dynamic-multistore-product.json new file mode 100644 index 000000000..78fd7fba2 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-multistore-product.json @@ -0,0 +1,45 @@ +{ + "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": "helper", + "name": "haveFullProduct", + "key": "product", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [{ "sku": "#product.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" }] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "productToUnassign", + "arguments": [{}, { "idTaxSet": 1 }] + }, + { + "type": "helper", + "name": "haveProductInStock", + "arguments": [ + { "sku": "#productToUnassign.sku", "isNeverOutOfStock": "1", "fkStock": 1, "stockType": "Warehouse1" } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-original-price.json b/cypress/fixtures/suite/yves/product/dynamic-original-price.json new file mode 100644 index 000000000..e7d6638bd --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-original-price.json @@ -0,0 +1,260 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "helper", + "name": "havePriceType", + "key": "defaultPriceType", + "arguments": [ + { + "name": "DEFAULT" + } + ] + }, + { + "type": "helper", + "name": "havePriceType", + "key": "originalPriceType", + "arguments": [ + { + "name": "ORIGINAL" + } + ] + }, + { + "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": [ + { + "attributes": { + "storage_capacity": "32 GB" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + }, + { + "idTaxSet": 1, + "attributes": { + "storage_capacity": "32 GB" + }, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#localizedAttribute.name" + }, + { + "locale": "#localeDE", + "name": "#localizedAttribute.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveProductConcreteWithLocalizedAttributes", + "key": "discountedVariant", + "arguments": [ + { + "fkProductAbstract": "#product.fk_product_abstract", + "abstractSku": "#product.abstract_sku", + "attributes": { + "storage_capacity": "128 GB" + }, + "isActive": true + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "idProduct": null, + "skuProduct": "" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 8000, + "grossAmount": 10000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 16000, + "grossAmount": 20000 + }, + "skuProduct": "#product.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#defaultPriceType", + "moneyValue": { + "netAmount": 1200, + "grossAmount": 1500 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "priceType": "#originalPriceType", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + }, + "skuProduct": "#discountedVariant.sku" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#product.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#discountedVariant.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-product-bundle-checkout.json b/cypress/fixtures/suite/yves/product/dynamic-product-bundle-checkout.json new file mode 100644 index 000000000..615108049 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-product-bundle-checkout.json @@ -0,0 +1,318 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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 + } + }, + { + "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": "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": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundleProductName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductOneName" + }, + { + "type": "builder", + "name": "LocalizedAttributesBuilder", + "key": "bundledProductTwoName" + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundleProduct", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundleProductName.name" + }, + { + "locale": "#localeDE", + "name": "#bundleProductName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductOne", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductOneName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductOneName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "bundledProductTwo", + "arguments": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#bundledProductTwoName.name" + }, + { + "locale": "#localeDE", + "name": "#bundledProductTwoName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductOne.abstract_sku", + "skuProduct": "#bundledProductOne.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductOne.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductOne.id_product_concrete", + "idProductAbstract": "#bundledProductOne.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundledProductTwo.abstract_sku", + "skuProduct": "#bundledProductTwo.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundledProductTwo.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundledProductTwo.id_product_concrete", + "idProductAbstract": "#bundledProductTwo.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveProductBundle", + "key": "productBundle", + "arguments": [ + "#bundleProduct", + { + "bundledProducts": [ + { + "idProductConcrete": "#bundledProductOne.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 2, + "sku": "#bundledProductOne.sku" + }, + { + "idProductConcrete": "#bundledProductTwo.id_product_concrete", + "idProductBundle": "#bundleProduct.id_product_concrete", + "quantity": 3, + "sku": "#bundledProductTwo.sku" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#bundleProduct.abstract_sku", + "skuProduct": "#bundleProduct.sku", + "moneyValue": { + "netAmount": 4000, + "grossAmount": 5000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#bundleProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#bundleProduct.id_product_concrete", + "idProductAbstract": "#bundleProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/dynamic-volume-prices.json b/cypress/fixtures/suite/yves/product/dynamic-volume-prices.json new file mode 100644 index 000000000..edf1e9aa6 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/dynamic-volume-prices.json @@ -0,0 +1,131 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "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": "productName" + }, + { + "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": [ + { + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + }, + { + "idTaxSet": 1, + "localizedAttributes": [ + { + "locale": "#localeEN", + "name": "#productName.name" + }, + { + "locale": "#localeDE", + "name": "#productName.name" + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#product.abstract_sku", + "skuProduct": "#product.sku", + "moneyValue": { + "netAmount": 9000, + "grossAmount": 10000, + "priceData": "{\"volume_prices\":[{\"quantity\":3,\"net_price\":7000,\"gross_price\":8000}]}" + } + } + ] + }, + { + "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"] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/product/static-availability-calculation.json b/cypress/fixtures/suite/yves/product/static-availability-calculation.json new file mode 100644 index 000000000..6f9ba57f0 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-availability-calculation.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "initialStock": 3, + "orderedQuantity": 1 +} diff --git a/cypress/fixtures/suite/yves/product/static-back-in-stock-notification.json b/cypress/fixtures/suite/yves/product/static-back-in-stock-notification.json new file mode 100644 index 000000000..1d4bf4a33 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-back-in-stock-notification.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "subscribedMessage": "Successfully subscribed", + "unsubscribedMessage": "Successfully unsubscribed" +} diff --git a/cypress/fixtures/suite/yves/product/static-customer-specific-prices.json b/cypress/fixtures/suite/yves/product/static-customer-specific-prices.json new file mode 100644 index 000000000..7379458df --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-customer-specific-prices.json @@ -0,0 +1,19 @@ +{ + "defaultPassword": "change123", + "defaultPriceCustomer": { + "email": "george.freeman@acme.com" + }, + "merchantPriceCustomer": { + "email": "spencor.hopkin@acme.com" + }, + "product": { + "abstractSku": "205", + "concreteSku": "205_6350138", + "name": "Toshiba CAMILEO S30", + "cartItemName": "Toshiba CAMILEO S30" + }, + "prices": { + "defaultPrice": "€116.11", + "merchantPrice": "€100.22" + } +} diff --git a/cypress/fixtures/suite/yves/product/static-discontinued-alternative-products.json b/cypress/fixtures/suite/yves/product/static-discontinued-alternative-products.json new file mode 100644 index 000000000..e995b82d1 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-discontinued-alternative-products.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "discontinuedLabel": "Discontinued", + "alternativeLabel": "Alternative for" +} diff --git a/cypress/fixtures/suite/yves/product/static-merchant-product-original-price.json b/cypress/fixtures/suite/yves/product/static-merchant-product-original-price.json new file mode 100644 index 000000000..b77e06b7b --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-merchant-product-original-price.json @@ -0,0 +1,7 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€150.00" + } +} diff --git a/cypress/fixtures/suite/yves/product/static-multistore-product.json b/cypress/fixtures/suite/yves/product/static-multistore-product.json new file mode 100644 index 000000000..55ec7b509 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-multistore-product.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "primaryStoreName": "DE", + "secondaryStoreName": "AT", + "primaryStorePrice": "150", + "secondaryStorePrice": "250", + "unassignedStoreProductPrice": "180", + "currencySymbol": "€" +} diff --git a/cypress/fixtures/suite/yves/product/static-original-price.json b/cypress/fixtures/suite/yves/product/static-original-price.json new file mode 100644 index 000000000..82050fa07 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-original-price.json @@ -0,0 +1,13 @@ +{ + "defaultPassword": "change123", + "abstractPrice": { + "default": "€100.00", + "original": "€200.00" + }, + "variant": { + "attributeKey": "storage_capacity", + "attributeValue": "128 GB", + "default": "€15.00", + "original": "€50.00" + } +} diff --git a/cypress/fixtures/suite/yves/product/static-product-bundle-checkout.json b/cypress/fixtures/suite/yves/product/static-product-bundle-checkout.json new file mode 100644 index 000000000..09e05a7d0 --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-product-bundle-checkout.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "paymentMethod": "dummyPaymentInvoice" +} diff --git a/cypress/fixtures/suite/yves/product/static-volume-prices.json b/cypress/fixtures/suite/yves/product/static-volume-prices.json new file mode 100644 index 000000000..9ae301f7b --- /dev/null +++ b/cypress/fixtures/suite/yves/product/static-volume-prices.json @@ -0,0 +1,9 @@ +{ + "defaultPassword": "change123", + "unitPrice": "€100.00", + "volumeTier": { + "quantity": 3, + "price": "€80.00" + }, + "belowTierQuantity": 2 +} diff --git a/cypress/fixtures/suite/yves/quick-order/dynamic-quick-order-to-checkout.json b/cypress/fixtures/suite/yves/quick-order/dynamic-quick-order-to-checkout.json new file mode 100644 index 000000000..4dbc3f30e --- /dev/null +++ b/cypress/fixtures/suite/yves/quick-order/dynamic-quick-order-to-checkout.json @@ -0,0 +1,358 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#readShoppingListPermission", "#writeShoppingListPermission"] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "reorderCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "reorderAddress", + "arguments": [ + { + "fkCustomer": "#reorderCustomer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "reorderCompanyUser", + "arguments": [ + { + "customer": "#reorderCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#reorderCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product1.id_product_concrete", + "idProductAbstract": "#product1.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product1.id_product_concrete", + "concreteSku": "#product1.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product2.id_product_concrete", + "idProductAbstract": "#product2.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product2.id_product_concrete", + "concreteSku": "#product2.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + }, + { + "type": "helper", + "name": "haveShoppingList", + "key": "shoppingList", + "arguments": [ + { + "customerReference": "#customer.customer_reference", + "idCompanyUser": "#companyUser.id_company_user" + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "key": "reorderQuote", + "arguments": [ + { + "customer": "#reorderCustomer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "idProductAbstract": "#product1.fk_product_abstract", + "productOfferReference": "#productOffer1.product_offer_reference", + "merchantReference": "#productOffer1.merchant_reference", + "quantity": 1 + }, + { + "sku": "#product2.sku", + "abstractSku": "#product2.abstract_sku", + "idProductAbstract": "#product2.fk_product_abstract", + "productOfferReference": "#productOffer2.product_offer_reference", + "merchantReference": "#productOffer2.merchant_reference", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/quick-order/static-quick-order-to-checkout.json b/cypress/fixtures/suite/yves/quick-order/static-quick-order-to-checkout.json new file mode 100644 index 000000000..c347d7e6d --- /dev/null +++ b/cypress/fixtures/suite/yves/quick-order/static-quick-order-to-checkout.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "soldByText": "Sold by", + "firstProductQuantity": 1, + "secondProductQuantity": 3 +} diff --git a/cypress/fixtures/suite/yves/quote-request/dynamic-configurable-product-rfq.json b/cypress/fixtures/suite/yves/quote-request/dynamic-configurable-product-rfq.json new file mode 100644 index 000000000..d3100bb03 --- /dev/null +++ b/cypress/fixtures/suite/yves/quote-request/dynamic-configurable-product-rfq.json @@ -0,0 +1,169 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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": "haveProductConfigurationTransferPersisted", + "key": "productConfiguration", + "arguments": [ + { + "fkProduct": "#product.id_product_concrete", + "configuratorKey": "DATE_TIME_CONFIGURATOR", + "defaultDisplayData": "", + "defaultConfiguration": "", + "isComplete": false + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/quote-request/dynamic-quote-request-lifecycle.json b/cypress/fixtures/suite/yves/quote-request/dynamic-quote-request-lifecycle.json new file mode 100644 index 000000000..85371c287 --- /dev/null +++ b/cypress/fixtures/suite/yves/quote-request/dynamic-quote-request-lifecycle.json @@ -0,0 +1,173 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "type": "helper", + "name": "haveUser", + "key": "agentUser", + "arguments": [ + { + "password": "change123", + "is_agent": true + } + ] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#agentUser.id_user", 1] + }, + { + "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": "placeOrderPermission", + "arguments": ["PlaceOrderPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "isDefault": true, + "fkCompany": "#company.id_company" + }, + ["#placeOrderPermission"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "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": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "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": "havePersistentQuote", + "key": "quote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#product1.sku", + "abstractSku": "#product1.abstract_sku", + "quantity": 1 + } + ] + }, + true + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/quote-request/static-configurable-product-rfq.json b/cypress/fixtures/suite/yves/quote-request/static-configurable-product-rfq.json new file mode 100644 index 000000000..e6fb16c16 --- /dev/null +++ b/cypress/fixtures/suite/yves/quote-request/static-configurable-product-rfq.json @@ -0,0 +1,5 @@ +{ + "defaultPassword": "change123", + "configurationNotCompleteStatus": "Configuration is not complete.", + "configurationCompleteStatus": "Configuration complete!" +} diff --git a/cypress/fixtures/suite/yves/quote-request/static-quote-request-lifecycle.json b/cypress/fixtures/suite/yves/quote-request/static-quote-request-lifecycle.json new file mode 100644 index 000000000..21d25fa34 --- /dev/null +++ b/cypress/fixtures/suite/yves/quote-request/static-quote-request-lifecycle.json @@ -0,0 +1,6 @@ +{ + "defaultPassword": "change123", + "revisedItemPrice": "250", + "revisedItemPriceFormatted": "\u20ac250.00", + "originalItemPriceFormatted": "\u20ac300.00" +} diff --git a/cypress/fixtures/suite/yves/return-management/dynamic-return-creation-storefront.json b/cypress/fixtures/suite/yves/return-management/dynamic-return-creation-storefront.json new file mode 100644 index 000000000..7902ec161 --- /dev/null +++ b/cypress/fixtures/suite/yves/return-management/dynamic-return-creation-storefront.json @@ -0,0 +1,292 @@ +{ + "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": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "helper", + "name": "haveCountry", + "key": "country" + }, + { + "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": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "locale_name": "en_US", + "password": "change123" + } + ] + }, + { + "type": "helper", + "name": "haveCustomerAddress", + "key": "address", + "arguments": [ + { + "fkCustomer": "#customer.id_customer", + "fkCountry": "#country.id_country" + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "firstReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#firstReturnedProduct.abstract_sku", + "skuProduct": "#firstReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#firstReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#firstReturnedProduct.id_product_concrete", + "idProductAbstract": "#firstReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "secondReturnedProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#secondReturnedProduct.abstract_sku", + "skuProduct": "#secondReturnedProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#secondReturnedProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#secondReturnedProduct.id_product_concrete", + "idProductAbstract": "#secondReturnedProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveFullProduct", + "key": "keptProduct", + "arguments": [ + {}, + { + "idTaxSet": 1 + } + ] + }, + { + "type": "helper", + "name": "havePriceProduct", + "arguments": [ + { + "skuProductAbstract": "#keptProduct.abstract_sku", + "skuProduct": "#keptProduct.sku", + "moneyValue": { + "netAmount": 30000, + "grossAmount": 30000 + } + } + ] + }, + { + "type": "helper", + "name": "haveProductInStockForStore", + "arguments": [ + "#store", + { + "sku": "#keptProduct.sku", + "isNeverOutOfStock": "1" + } + ] + }, + { + "type": "helper", + "name": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#keptProduct.id_product_concrete", + "idProductAbstract": "#keptProduct.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + }, + { + "type": "helper", + "name": "havePersistentQuote", + "arguments": [ + { + "customer": "#customer", + "items": [ + { + "sku": "#firstReturnedProduct.sku", + "abstractSku": "#firstReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#secondReturnedProduct.sku", + "abstractSku": "#secondReturnedProduct.abstract_sku", + "quantity": 1 + }, + { + "sku": "#keptProduct.sku", + "abstractSku": "#keptProduct.abstract_sku", + "quantity": 1 + } + ] + } + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/return-management/static-return-creation-storefront.json b/cypress/fixtures/suite/yves/return-management/static-return-creation-storefront.json new file mode 100644 index 000000000..8cd4ad6ce --- /dev/null +++ b/cypress/fixtures/suite/yves/return-management/static-return-creation-storefront.json @@ -0,0 +1,26 @@ +{ + "defaultPassword": "change123", + "returnDetailsTitle": "Return Details", + "waitingForReturnState": "Waiting for return", + "shippedState": "Shipped", + "orderShippingEvents": [ + { + "state": "skip grace period", + "shouldTriggerOmsInCli": true + }, + { + "state": "Pay", + "shouldTriggerOmsInCli": true + }, + { + "state": "Skip timeout", + "shouldTriggerOmsInCli": true + }, + { + "state": "skip picking" + }, + { + "state": "Ship" + } + ] +} diff --git a/cypress/fixtures/suite/yves/shopping-list/dynamic-shopping-list-product-offers.json b/cypress/fixtures/suite/yves/shopping-list/dynamic-shopping-list-product-offers.json new file mode 100644 index 000000000..502acf937 --- /dev/null +++ b/cypress/fixtures/suite/yves/shopping-list/dynamic-shopping-list-product-offers.json @@ -0,0 +1,225 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#readShoppingListPermission", "#writeShoppingListPermission"] + ] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "customer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "companyUser", + "arguments": [ + { + "customer": "#customer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#companyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant1", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer1", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant1.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer1.id_product_offer", + "productOfferReference": "#productOffer1.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant1.stocks" + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant2", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer2", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant2.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer2.id_product_offer", + "productOfferReference": "#productOffer2.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant2.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/shopping-list/dynamic-shopping-list-sharing.json b/cypress/fixtures/suite/yves/shopping-list/dynamic-shopping-list-sharing.json new file mode 100644 index 000000000..9a8761a2d --- /dev/null +++ b/cypress/fixtures/suite/yves/shopping-list/dynamic-shopping-list-sharing.json @@ -0,0 +1,218 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": true, + "operations": [ + { + "type": "helper", + "name": "haveCompany", + "key": "company", + "arguments": [ + { + "status": "approved", + "is_active": true + } + ] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnit", + "arguments": [ + { + "fk_company": "#company.id_company" + } + ] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "readShoppingListPermission", + "arguments": ["ReadShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "havePermissionByKey", + "key": "writeShoppingListPermission", + "arguments": ["WriteShoppingListPermissionPlugin"] + }, + { + "type": "helper", + "name": "haveCompanyRoleWithPermissions", + "key": "buyerRole", + "arguments": [ + { + "fk_company": "#company.id_company" + }, + ["#readShoppingListPermission", "#writeShoppingListPermission"] + ] + }, + { + "type": "builder", + "name": "CompanyRoleCollectionBuilder", + "key": "buyerRoleCollection", + "arguments": { + "roles": ["#buyerRole"] + } + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "ownerCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "ownerCompanyUser", + "arguments": [ + { + "customer": "#ownerCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#ownerCompanyUser", ["#buyerRole"]] + }, + { + "type": "helper", + "name": "haveConfirmedCustomer", + "key": "receiverCustomer", + "arguments": [ + { + "registered": "2025-01-01", + "password": "change123", + "locale_name": "en_US" + } + ] + }, + { + "type": "helper", + "name": "haveCompanyUser", + "key": "receiverCompanyUser", + "arguments": [ + { + "customer": "#receiverCustomer", + "fk_company": "#company.id_company", + "company_role_collection": ["#buyerRoleCollection"], + "fk_company_business_unit": "#businessUnit.id_company_business_unit" + } + ] + }, + { + "type": "helper", + "name": "assignCompanyRoles", + "arguments": ["#receiverCompanyUser", ["#buyerRole"]] + }, + { + "type": "transfer", + "name": "StoreTransfer", + "key": "store", + "arguments": { + "id_store": 1, + "name": "DE" + } + }, + { + "type": "array-object", + "key": "stores", + "arguments": ["#store"] + }, + { + "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": "haveProductImageSet", + "arguments": [ + { + "name": "default", + "idProduct": "#product.id_product_concrete", + "idProductAbstract": "#product.fk_product_abstract", + "productImages": ["#productImage"] + } + ] + }, + { + "type": "helper", + "name": "haveActiveMerchantWithStore", + "key": "merchant", + "arguments": [ + { + "isOpenForRelationRequest": true + } + ] + }, + { + "type": "helper", + "name": "haveProductOffer", + "key": "productOffer", + "arguments": [ + { + "isActive": true, + "status": "approved", + "idProductConcrete": "#product.id_product_concrete", + "concreteSku": "#product.sku", + "merchantReference": "#merchant.merchant_reference", + "stores": "#stores" + } + ] + }, + { + "type": "helper", + "name": "haveProductOfferStock", + "arguments": [ + { + "idProductOffer": "#productOffer.id_product_offer", + "productOfferReference": "#productOffer.product_offer_reference", + "isNeverOutOfStock": true + }, + "#merchant.stocks" + ] + } + ] + } + } +} diff --git a/cypress/fixtures/suite/yves/shopping-list/static-shopping-list-product-offers.json b/cypress/fixtures/suite/yves/shopping-list/static-shopping-list-product-offers.json new file mode 100644 index 000000000..b040cca3e --- /dev/null +++ b/cypress/fixtures/suite/yves/shopping-list/static-shopping-list-product-offers.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "soldByText": "Sold by" +} diff --git a/cypress/fixtures/suite/yves/shopping-list/static-shopping-list-sharing.json b/cypress/fixtures/suite/yves/shopping-list/static-shopping-list-sharing.json new file mode 100644 index 000000000..161c7beb0 --- /dev/null +++ b/cypress/fixtures/suite/yves/shopping-list/static-shopping-list-sharing.json @@ -0,0 +1,4 @@ +{ + "defaultPassword": "change123", + "fullAccessText": "Full access" +} diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 24bd554ab..bd9b08bd5 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -8,6 +8,9 @@ // https://on.cypress.io/custom-commands // *********************************************** +// The queue worker that publishes a newly created store runs past 100 seconds on the B2B marketplace. +const CLI_COMMANDS_TIMEOUT_MS = 200000; + Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe) => { return new Cypress.Promise((resolve) => { $iframe.on('load', () => { @@ -176,7 +179,7 @@ Cypress.Commands.add('runCliCommands', (commands) => { }, }, }, - timeout: 100000, + timeout: CLI_COMMANDS_TIMEOUT_MS, }); }); @@ -413,6 +416,23 @@ Cypress.Commands.add('createCart', (accessToken, attributes) => { .then((response) => response.body.data.id); }); +Cypress.Commands.add('addCartItem', (accessToken, cartId, attributes) => { + return cy.request({ + method: 'POST', + url: `${Cypress.env().glueUrl}/carts/${cartId}/items`, + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }, + body: { + data: { + type: 'items', + attributes, + }, + }, + }); +}); + Cypress.Commands.add('createShoppingList', (accessToken, name) => { return cy .request({ diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index af5b63836..33d78fd6f 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -15,6 +15,7 @@ import { dirname, parse, relative } from 'path'; import './commands'; +import { whenRequiredFeaturePresent } from './utils/feature'; // @see error 2306 https://github.com/microsoft/TypeScript/blob/3fcd1b51a1e6b16d007b368229af03455c7d5794/src/compiler/diagnosticMessages.json#L1635 // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -27,7 +28,7 @@ before(() => { cy.runQueueWorker(); } - loadFixture(); + whenRequiredFeaturePresent(loadFixture); }); // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-function-return-type diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index f711a9a79..8201dbcd6 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -140,6 +140,18 @@ declare namespace Cypress { */ createCart(accessToken: string, attributes: Record): Chainable; + /** + * Adds an item to a cart through the storefront API. Unlike the storefront UI, this can put a + * specific merchant's offer on the item, which is what a per-merchant order split needs. + * + * @example cy.addCartItem(token, cartId, { sku: 'X', quantity: 1, productOfferReference: 'OF--1' }) + */ + addCartItem( + accessToken: string, + cartId: string, + attributes: Record + ): Chainable>; + /** * Creates a shopping list for an authenticated customer and returns its id. * @example cy.createShoppingList(token, 'My list') diff --git a/cypress/support/pages/backoffice/acl/denied/acl-denied-page.ts b/cypress/support/pages/backoffice/acl/denied/acl-denied-page.ts new file mode 100644 index 000000000..45bb805bb --- /dev/null +++ b/cypress/support/pages/backoffice/acl/denied/acl-denied-page.ts @@ -0,0 +1,14 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { AclDeniedRepository } from './acl-denied-repository'; + +@injectable() +@autoWired +export class AclDeniedPage extends BackofficePage { + @inject(AclDeniedRepository) private repository: AclDeniedRepository; + + protected PAGE_URL = '/acl/index/denied'; + + getAccessDeniedTitle = (): Cypress.Chainable => this.repository.getAccessDeniedTitle(); +} diff --git a/cypress/support/pages/backoffice/acl/denied/acl-denied-repository.ts b/cypress/support/pages/backoffice/acl/denied/acl-denied-repository.ts new file mode 100644 index 000000000..e8fc4ec58 --- /dev/null +++ b/cypress/support/pages/backoffice/acl/denied/acl-denied-repository.ts @@ -0,0 +1,8 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class AclDeniedRepository { + getAccessDeniedTitle = (): Cypress.Chainable => cy.get('[data-qa="access-denied-title"]'); +} diff --git a/cypress/support/pages/backoffice/backoffice-page.ts b/cypress/support/pages/backoffice/backoffice-page.ts index 30905edf3..ae77008f8 100644 --- a/cypress/support/pages/backoffice/backoffice-page.ts +++ b/cypress/support/pages/backoffice/backoffice-page.ts @@ -132,8 +132,15 @@ export class BackofficePage extends AbstractPage { } if (rows.length > 0) { - const rowIndex = Array.from($rows).indexOf(rows.first()[0]); - const getRow: TableRowGetter = () => cy.get('tbody > tr:visible').eq(rowIndex); + // The row filters are applied again when the row is used: an index taken here can point + // past the end of the table once a late search redraw has narrowed it. + const getRow: TableRowGetter = () => + cy + .get('tbody > tr:visible') + .filter((_index: number, row: HTMLElement): boolean => + (params.rowFilter ?? []).every((filterFn) => filterFn(Cypress.$(row))) + ) + .first(); return getRow; } else { 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 index 990ba23cd..8078e301c 100644 --- a/cypress/support/pages/backoffice/cms/block/list/block-list-page.ts +++ b/cypress/support/pages/backoffice/cms/block/list/block-list-page.ts @@ -27,9 +27,11 @@ export class BlockListPage extends BackofficePage { }); }; - clickEditAction = (row: JQuery): void => { - cy.wrap(row).find(this.repository.getEditButtonSelector()).as('editBtn'); - cy.get('@editBtn').click(); + // The row is looked up again by name, because the table can redraw between reading the row and the click. + clickEditActionOfBlock = (cmsBlockName: string): void => { + cy.contains(this.repository.getVisibleRowSelector(), cmsBlockName) + .find(this.repository.getEditButtonSelector()) + .click(); }; rowIsAssignedToStore = (params: IsAssignedParams): boolean => { 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 index da66cb780..00e340aec 100644 --- a/cypress/support/pages/backoffice/cms/block/list/block-list-repository.ts +++ b/cypress/support/pages/backoffice/cms/block/list/block-list-repository.ts @@ -6,6 +6,7 @@ import { injectable } from 'inversify'; export class BlockListRepository { getEditButtonSelector = (): string => 'a:contains("Edit Block")'; getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); + getVisibleRowSelector = (): string => 'tbody > tr:visible'; getSearchSelector = (): string => '[type="search"]'; getStoreCellSelector = (): string => '.column-Store'; } 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 index 27bdeaace..4eb4ceb53 100644 --- 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 @@ -11,25 +11,41 @@ export class CmsPlaceholderEditPage extends BackofficePage { protected PAGE_URL = '/cms-gui/create-glossary/index'; update = (params: UpdateParams): void => { - this.repository - .getTitleBlock() + this.fillLocalizedPlaceholder(() => this.repository.getTitleBlock(), params.cmsPageName); + this.saveAndPublish(); + }; + + updateTitleAndContent = (params: UpdateTitleAndContentParams): void => { + this.fillLocalizedPlaceholder(() => this.repository.getTitleBlock(), params.title); + + // The content placeholder sits on a second tab whose fields stay inert until it is opened. + this.repository.getTabLink('content-content').click(); + this.fillLocalizedPlaceholder(() => this.repository.getContentBlock(), params.content); + + this.saveAndPublish(); + }; + + // Each placeholder tab holds one collapsed ibox per locale, so every locale gets the same value. + private fillLocalizedPlaceholder = (getBlock: () => Cypress.Chainable, value: string): void => { + getBlock() .find(this.repository.getAllCollapsedIboxButtonsSelector()) .each(($button) => { cy.wrap($button).click(); }); - this.repository - .getTitleBlock() + getBlock() .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 }); + cy.wrap($input).type(value, { force: true }); }); }); + }; + private saveAndPublish = (): void => { this.repository.getUpdatePlaceholderButton().click(); this.repository.getPublishPageButton().click({ force: true }); @@ -39,3 +55,8 @@ export class CmsPlaceholderEditPage extends BackofficePage { interface UpdateParams { cmsPageName: string; } + +interface UpdateTitleAndContentParams { + title: string; + content: 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 index fad0114cb..361b5afc5 100644 --- 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 @@ -5,6 +5,8 @@ import { injectable } from 'inversify'; @autoWired export class CmsPlaceholderEditRepository { getTitleBlock = (): Cypress.Chainable => cy.get('#tab-content-title'); + getContentBlock = (): Cypress.Chainable => cy.get('#tab-content-content'); + getTabLink = (hrefFragment: string): Cypress.Chainable => cy.get(`a[href*="${hrefFragment}"]`); getAllIboxesSelector = (): string => '.placeholder-translation-container > .ibox.nested'; getAllCollapsedIboxButtonsSelector = (): string => '.placeholder-translation-container > .collapsed .collapse-link'; getLocalizedTextareaSelector = (): string => '.note-editor .note-editable'; diff --git a/cypress/support/pages/backoffice/cms/page/update/cms-page-update-page.ts b/cypress/support/pages/backoffice/cms/page/update/cms-page-update-page.ts new file mode 100644 index 000000000..fed3f3075 --- /dev/null +++ b/cypress/support/pages/backoffice/cms/page/update/cms-page-update-page.ts @@ -0,0 +1,27 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { CmsPageUpdateRepository } from './cms-page-update-repository'; + +@injectable() +@autoWired +export class CmsPageUpdatePage extends BackofficePage { + @inject(CmsPageUpdateRepository) private repository: CmsPageUpdateRepository; + + protected PAGE_URL = '/cms-gui/edit-page'; + + visitPage = (idCmsPage: string): void => { + cy.visitBackoffice(`${this.PAGE_URL}?id-cms-page=${idCmsPage}`); + }; + + unassignStore = (storeName: string): void => { + this.repository.getStoreCheckbox(storeName).uncheck(); + }; + + // Saving only writes a new draft version; the storefront keeps serving the published one + // until the draft is published too, which is why both clicks belong to one method. + saveAndPublish = (): void => { + this.repository.getSaveButton().click(); + this.repository.getPublishButton().click({ force: true }); + }; +} diff --git a/cypress/support/pages/backoffice/cms/page/update/cms-page-update-repository.ts b/cypress/support/pages/backoffice/cms/page/update/cms-page-update-repository.ts new file mode 100644 index 000000000..ba212cccd --- /dev/null +++ b/cypress/support/pages/backoffice/cms/page/update/cms-page-update-repository.ts @@ -0,0 +1,19 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CmsPageUpdateRepository { + // The store relation renders one checkbox per store, all checked by default, with the + // store name as the label text — so a store is addressed by its name, not by an index + // that shifts as soon as another spec creates a store. + getStoreCheckbox = (storeName: string): Cypress.Chainable => + cy + .get('#cms_page_storeRelation_id_stores label') + .contains(new RegExp(`^\\s*${storeName}\\s*$`)) + .find('input[type="checkbox"]'); + + getSaveButton = (): Cypress.Chainable => cy.get('#submit-cms'); + + getPublishButton = (): Cypress.Chainable => cy.get('[name="publish_version_page_form"]').find('.safe-submit'); +} diff --git a/cypress/support/pages/backoffice/company-business-unit/create/company-business-unit-create-page.ts b/cypress/support/pages/backoffice/company-business-unit/create/company-business-unit-create-page.ts new file mode 100644 index 000000000..5004ce1cd --- /dev/null +++ b/cypress/support/pages/backoffice/company-business-unit/create/company-business-unit-create-page.ts @@ -0,0 +1,45 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { CompanyBusinessUnitCreateRepository } from './company-business-unit-create-repository'; + +@injectable() +@autoWired +export class CompanyBusinessUnitCreatePage extends BackofficePage { + @inject(CompanyBusinessUnitCreateRepository) private repository: CompanyBusinessUnitCreateRepository; + + protected PAGE_URL = '/company-business-unit-gui/add-company-business-unit'; + + create = (params: CreateParams): void => { + this.selectCompany(params.companyName); + this.repository.getNameInput().clear().type(params.name); + this.repository.getSubmitButton().click(); + }; + + /** + * Suite picks the company through its select2 search. The B2B shops render a plain select whose options + * are labelled " (ID: )", so there the option carrying the name is picked by its value. + */ + private selectCompany = (companyName: string): void => { + if (this.isRepository('b2b', 'b2b-mp')) { + this.repository + .getCompanySelect() + .find('option') + .contains(companyName) + .then(($option) => { + this.repository.getCompanySelect().select($option.val() as string); + }); + + return; + } + + this.repository.getCompanySelect().siblings('.select2-container').find('.select2-selection').click(); + cy.get('.select2-dropdown .select2-search__field').type(companyName); + cy.contains('.select2-dropdown .select2-results__option', companyName).click(); + }; +} + +interface CreateParams { + companyName: string; + name: string; +} diff --git a/cypress/support/pages/backoffice/company-business-unit/create/company-business-unit-create-repository.ts b/cypress/support/pages/backoffice/company-business-unit/create/company-business-unit-create-repository.ts new file mode 100644 index 000000000..4af93763e --- /dev/null +++ b/cypress/support/pages/backoffice/company-business-unit/create/company-business-unit-create-repository.ts @@ -0,0 +1,10 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CompanyBusinessUnitCreateRepository { + getCompanySelect = (): Cypress.Chainable => cy.get('#company-business-unit_fk_company'); + getNameInput = (): Cypress.Chainable => cy.get('#company-business-unit_name'); + getSubmitButton = (): Cypress.Chainable => cy.get('input[type="submit"].safe-submit'); +} diff --git a/cypress/support/pages/backoffice/company-role/create/company-role-create-page.ts b/cypress/support/pages/backoffice/company-role/create/company-role-create-page.ts index 9696dd1e6..227e15fd5 100644 --- a/cypress/support/pages/backoffice/company-role/create/company-role-create-page.ts +++ b/cypress/support/pages/backoffice/company-role/create/company-role-create-page.ts @@ -13,4 +13,43 @@ export class CompanyRoleCreatePage extends BackofficePage { getCompanyRoleCreateForm = (): Cypress.Chainable => { return this.repository.getCompanyRoleCreateForm(); }; + + create = (params: CreateParams): void => { + this.selectCompany(params.companyName); + this.repository.getNameInput().clear().type(params.name); + params.permissionNames.forEach((permissionName) => { + this.repository.getPermissionCheckbox(permissionName).check({ force: true }); + }); + this.repository.getSubmitButton().click(); + }; + + // A shop wiring the company form expander searches companies through an autocomplete select2 box; + // without it the field is a plain select listing every company. + private selectCompany = (companyName: string): void => { + cy.intercept('GET', '**/company-gui/suggest*').as('companySuggest'); + + this.repository.getCompanySelect().then(($companySelect) => { + // Without autocomplete the options are labelled " (ID: )", so the name alone is no exact match. + if (!$companySelect.is('[data-autocomplete-url]')) { + cy.wrap($companySelect) + .contains('option', companyName) + .then(($option) => { + cy.wrap($companySelect).select(String($option.val()), { force: true }); + }); + + return; + } + + cy.wrap($companySelect).siblings('.select2-container').find('.select2-selection').click(); + cy.get('.select2-dropdown .select2-search__field').type(companyName); + cy.wait('@companySuggest'); + cy.contains('.select2-dropdown .select2-results__option', companyName).click(); + }); + }; +} + +interface CreateParams { + companyName: string; + name: string; + permissionNames: string[]; } diff --git a/cypress/support/pages/backoffice/company-role/create/company-role-create-repository.ts b/cypress/support/pages/backoffice/company-role/create/company-role-create-repository.ts index abf4020ac..fba159dfc 100644 --- a/cypress/support/pages/backoffice/company-role/create/company-role-create-repository.ts +++ b/cypress/support/pages/backoffice/company-role/create/company-role-create-repository.ts @@ -5,4 +5,11 @@ import { injectable } from 'inversify'; @autoWired export class CompanyRoleCreateRepository { getCompanyRoleCreateForm = (): Cypress.Chainable => cy.get('form[name=company_role_create_form]'); + getCompanySelect = (): Cypress.Chainable => cy.get('#company_role_create_form_fkCompany'); + getNameInput = (): Cypress.Chainable => cy.get('#company_role_create_form_name'); + getSubmitButton = (): Cypress.Chainable => cy.get('input[type="submit"].safe-submit'); + + // Permissions render as checkboxes labelled with their translated name, e.g. "View company users". + getPermissionCheckbox = (permissionName: string): Cypress.Chainable => + cy.contains('#company-role_permission_collection label', permissionName).find('input[type="checkbox"]'); } diff --git a/cypress/support/pages/backoffice/company-user/create/company-user-create-page.ts b/cypress/support/pages/backoffice/company-user/create/company-user-create-page.ts new file mode 100644 index 000000000..0b1d1b12a --- /dev/null +++ b/cypress/support/pages/backoffice/company-user/create/company-user-create-page.ts @@ -0,0 +1,63 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { CompanyUserCreateRepository } from './company-user-create-repository'; + +@injectable() +@autoWired +export class CompanyUserCreatePage extends BackofficePage { + @inject(CompanyUserCreateRepository) private repository: CompanyUserCreateRepository; + + protected PAGE_URL = '/company-user-gui/create-company-user'; + + /** + * The company has to be picked first and on its own: anything already filled into the business unit + * or role fields is thrown away when it changes. + */ + create = (params: CreateParams): void => { + this.selectCompany(params.companyName); + this.selectBusinessUnit(params.businessUnitName); + + this.repository.getEmailInput().clear().type(params.email); + this.repository.getSalutationSelect().select(params.salutation, { force: true }); + this.repository.getFirstNameInput().clear().type(params.firstName); + this.repository.getLastNameInput().clear().type(params.lastName); + this.repository.getGenderSelect().select(params.gender, { force: true }); + this.repository.getRoleCheckbox(params.roleName).check({ force: true }); + + this.repository.getSubmitButton().click(); + }; + + private selectCompany = (companyName: string): void => { + cy.intercept('GET', '**/company-gui/suggest*').as('companySuggest'); + cy.intercept('GET', '**/company-role-gui/suggest*').as('companyRoleSuggest'); + + this.repository.getCompanySelect().siblings('.select2-container').find('.select2-selection').click(); + cy.get('.select2-dropdown .select2-search__field').type(companyName); + cy.wait('@companySuggest'); + cy.contains('.select2-dropdown .select2-results__option', companyName).click(); + + // Selecting the company is what triggers the role re-fetch; the checkboxes do not exist before it. + cy.wait('@companyRoleSuggest'); + }; + + private selectBusinessUnit = (businessUnitName: string): void => { + cy.intercept('GET', '**/company-business-unit-gui/suggest*').as('businessUnitSuggest'); + + this.repository.getBusinessUnitSelect().siblings('.select2-container').find('.select2-selection').click(); + cy.get('.select2-dropdown .select2-search__field').type(businessUnitName); + cy.wait('@businessUnitSuggest'); + cy.contains('.select2-dropdown .select2-results__option', businessUnitName).click(); + }; +} + +interface CreateParams { + companyName: string; + businessUnitName: string; + roleName: string; + email: string; + salutation: string; + firstName: string; + lastName: string; + gender: string; +} diff --git a/cypress/support/pages/backoffice/company-user/create/company-user-create-repository.ts b/cypress/support/pages/backoffice/company-user/create/company-user-create-repository.ts new file mode 100644 index 000000000..5cfd76050 --- /dev/null +++ b/cypress/support/pages/backoffice/company-user/create/company-user-create-repository.ts @@ -0,0 +1,19 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CompanyUserCreateRepository { + getEmailInput = (): Cypress.Chainable => cy.get('#company-user_customer_email'); + getSalutationSelect = (): Cypress.Chainable => cy.get('#company-user_customer_salutation'); + getFirstNameInput = (): Cypress.Chainable => cy.get('#company-user_customer_first_name'); + getLastNameInput = (): Cypress.Chainable => cy.get('#company-user_customer_last_name'); + getGenderSelect = (): Cypress.Chainable => cy.get('#company-user_customer_gender'); + getCompanySelect = (): Cypress.Chainable => cy.get('select#company-user_fk_company'); + getBusinessUnitSelect = (): Cypress.Chainable => cy.get('select#company-user_fk_company_business_unit'); + getSubmitButton = (): Cypress.Chainable => cy.get('input[type="submit"].safe-submit'); + + // Each role is labelled " (id: )", so the label text is the only handle a spec can predict. + getRoleCheckbox = (roleName: string): Cypress.Chainable => + cy.contains('#company-user_company_role_collection label', roleName).find('input[type="checkbox"]'); +} diff --git a/cypress/support/pages/backoffice/company-user/list/company-user-list-page.ts b/cypress/support/pages/backoffice/company-user/list/company-user-list-page.ts new file mode 100644 index 000000000..bff965928 --- /dev/null +++ b/cypress/support/pages/backoffice/company-user/list/company-user-list-page.ts @@ -0,0 +1,23 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { CompanyUserListRepository } from './company-user-list-repository'; + +@injectable() +@autoWired +export class CompanyUserListPage extends BackofficePage { + @inject(CompanyUserListRepository) private repository: CompanyUserListRepository; + + protected PAGE_URL = '/company-user-gui/list-company-user'; + + /** + * The table lists user id, company name and the customer's full name but never the email, so a + * company user is looked up by the company it belongs to. + */ + findByCompanyName = (companyName: string): Cypress.Chainable => { + return this.find({ + interceptTableUrl: '**/company-user-gui/list-company-user/table**', + searchQuery: companyName, + }).then((getRow) => (getRow ? getRow().find(this.repository.getCompanyUserNameCellSelector()) : cy.wrap(null))); + }; +} diff --git a/cypress/support/pages/backoffice/company-user/list/company-user-list-repository.ts b/cypress/support/pages/backoffice/company-user/list/company-user-list-repository.ts new file mode 100644 index 000000000..f7894ea00 --- /dev/null +++ b/cypress/support/pages/backoffice/company-user/list/company-user-list-repository.ts @@ -0,0 +1,8 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CompanyUserListRepository { + getCompanyUserNameCellSelector = (): string => 'td:nth-child(3)'; +} diff --git a/cypress/support/pages/backoffice/company/create/company-create-page.ts b/cypress/support/pages/backoffice/company/create/company-create-page.ts new file mode 100644 index 000000000..dc75e41b0 --- /dev/null +++ b/cypress/support/pages/backoffice/company/create/company-create-page.ts @@ -0,0 +1,17 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { CompanyCreateRepository } from './company-create-repository'; + +@injectable() +@autoWired +export class CompanyCreatePage extends BackofficePage { + @inject(CompanyCreateRepository) private repository: CompanyCreateRepository; + + protected PAGE_URL = '/company-gui/add-company'; + + create = (name: string): void => { + this.repository.getNameInput().clear().type(name); + this.repository.getSubmitButton().click(); + }; +} diff --git a/cypress/support/pages/backoffice/company/create/company-create-repository.ts b/cypress/support/pages/backoffice/company/create/company-create-repository.ts new file mode 100644 index 000000000..0df8173d0 --- /dev/null +++ b/cypress/support/pages/backoffice/company/create/company-create-repository.ts @@ -0,0 +1,9 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CompanyCreateRepository { + getNameInput = (): Cypress.Chainable => cy.get('#company_name'); + getSubmitButton = (): Cypress.Chainable => cy.get('input[type="submit"].safe-submit'); +} diff --git a/cypress/support/pages/backoffice/company/list/company-list-page.ts b/cypress/support/pages/backoffice/company/list/company-list-page.ts new file mode 100644 index 000000000..f1ec7dd2c --- /dev/null +++ b/cypress/support/pages/backoffice/company/list/company-list-page.ts @@ -0,0 +1,38 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { ActionEnum, BackofficePage } from '@pages/backoffice'; +import { CompanyListRepository } from './company-list-repository'; + +@injectable() +@autoWired +export class CompanyListPage extends BackofficePage { + @inject(CompanyListRepository) private repository: CompanyListRepository; + + protected PAGE_URL = '/company-gui/list-company'; + + update = (params: UpdateParams): void => { + this.find({ + interceptTableUrl: '**/company-gui/list-company/table**', + searchQuery: params.query, + }).then((getRow) => { + if (!getRow) { + return; + } + + getRow().then(($companyRow: JQuery) => { + if (params.action === ActionEnum.activate) { + cy.wrap($companyRow).find(this.repository.getActivateButtonSelector()).click({ force: true }); + } + + if (params.action === ActionEnum.approve) { + cy.wrap($companyRow).find(this.repository.getApproveButtonSelector()).click({ force: true }); + } + }); + }); + }; +} + +interface UpdateParams { + action: ActionEnum; + query: string; +} diff --git a/cypress/support/pages/backoffice/company/list/company-list-repository.ts b/cypress/support/pages/backoffice/company/list/company-list-repository.ts new file mode 100644 index 000000000..e0bc283ac --- /dev/null +++ b/cypress/support/pages/backoffice/company/list/company-list-repository.ts @@ -0,0 +1,10 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CompanyListRepository { + // The row actions are CSRF-protected forms, so their action URL is a steadier handle than the button label. + getActivateButtonSelector = (): string => 'form[action*="/company-gui/edit-company/activate"] button[type="submit"]'; + getApproveButtonSelector = (): string => 'form[action*="/company-gui/edit-company/approve"] button[type="submit"]'; +} diff --git a/cypress/support/pages/backoffice/customer/index/customer-index-page.ts b/cypress/support/pages/backoffice/customer/index/customer-index-page.ts index 89869c018..391734082 100644 --- a/cypress/support/pages/backoffice/customer/index/customer-index-page.ts +++ b/cypress/support/pages/backoffice/customer/index/customer-index-page.ts @@ -23,6 +23,14 @@ export class CustomerIndexPage extends BackofficePage { if (params.action === ActionEnum.removeMultiFactorAuthentication) { getRow().find(this.getRemoveMultiFactorAuthenticationButtonSelector()).click({ force: true }); } + + if (params.action === ActionEnum.edit) { + getRow().find(this.repository.getEditButtonSelector()).click({ force: true }); + } + + if (params.action === ActionEnum.view) { + getRow().find(this.repository.getViewButtonSelector()).click({ force: true }); + } }); }; diff --git a/cypress/support/pages/backoffice/customer/index/customer-index-repository.ts b/cypress/support/pages/backoffice/customer/index/customer-index-repository.ts index 8b6e10ef8..e91e9d074 100644 --- a/cypress/support/pages/backoffice/customer/index/customer-index-repository.ts +++ b/cypress/support/pages/backoffice/customer/index/customer-index-repository.ts @@ -5,4 +5,6 @@ import { injectable } from 'inversify'; @autoWired export class CustomerIndexRepository { getRemoveMultiFactorAuthenticationButtonSelector = (): string => 'a[data-qa="remove-mfa-button"]'; + getEditButtonSelector = (): string => 'a:contains("Edit")'; + getViewButtonSelector = (): string => 'a:contains("View")'; } diff --git a/cypress/support/pages/backoffice/data-exchange/data-exchange-page.ts b/cypress/support/pages/backoffice/data-exchange/data-exchange-page.ts new file mode 100644 index 000000000..70c418f87 --- /dev/null +++ b/cypress/support/pages/backoffice/data-exchange/data-exchange-page.ts @@ -0,0 +1,139 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '../backoffice-page'; +import { DataExchangeRepository, FieldControl } from './data-exchange-repository'; + +// Regenerates the Backend API schema the configuration list offers for download. Without the +// interval option the voter is skipped and the schema is rebuilt unconditionally, which is what +// a test needs — the scheduled job passes an interval so it can no-op between runs. +const GENERATE_SPECIFICATION_COMMAND = 'glue api:generate:documentation'; + +const CONFIGURATION_CREATE_URL = '/dynamic-entity-gui/configuration-create'; +const CONFIGURATION_EDIT_URL = '/dynamic-entity-gui/configuration-edit'; +const DOWNLOAD_FILE_NAME = 'schema.yml'; + +@injectable() +@autoWired +export class DataExchangePage extends BackofficePage { + @inject(DataExchangeRepository) private repository: DataExchangeRepository; + + protected PAGE_URL = '/dynamic-entity-gui/configuration-list'; + + // The schema is only offered for download while it is newer than every configuration row, and + // generation and the save that invalidated it can land in the same second. Regenerating on every + // reload is the same loop the source test used to converge on a downloadable schema. + waitForApiSpecificationToBeCurrent = (): void => { + cy.reloadUntilGone( + Cypress.env('backofficeUrl') + this.PAGE_URL, + this.repository.getSpecificationOutdatedAlertSelector(), + 'body', + 10, + 2000, + [GENERATE_SPECIFICATION_COMMAND] + ); + }; + + // A configuration for the table may already exist from an earlier run: the source test dropped it + // from the database in teardown, which Cypress has no route to. The create form offers only + // tables that have no configuration yet, so its option list is the discriminator — and the only + // safe one, because the edit URL answers 500 rather than redirecting for a table that exists but + // is unconfigured. + openConfiguration = (tableName: string): void => { + cy.visitBackoffice(CONFIGURATION_CREATE_URL); + + this.repository.getTableNameSelect().then(($select) => { + if ($select.find(`option[value="${tableName}"]`).length) { + this.createConfiguration(tableName); + + return; + } + + cy.visitBackoffice(`${CONFIGURATION_EDIT_URL}?table-name=${tableName}`); + }); + }; + + setConfigurationEnabled = (isEnabled: boolean): void => { + if (isEnabled) { + this.repository.getIsEnabledCheckbox().check(); + + return; + } + + this.repository.getIsEnabledCheckbox().uncheck(); + }; + + // The resource name is the path segment the Backend API serves the table under, so a name drawn per + // run exposes a resource no earlier run can have left in the specification. + setResourceName = (resourceName: string): void => { + this.repository.getResourceNameInput().clear(); + this.repository.getResourceNameInput().type(resourceName); + }; + + getResourceNameInput = (): Cypress.Chainable => this.repository.getResourceNameInput(); + + configureField = (field: FieldDefinition): void => { + const selectorOf = (control: FieldControl): string => this.repository.getFieldControlSelector(control); + + this.repository.getFieldDefinitionRow(field.name).within(() => { + cy.get(selectorOf('enabled')).check(); + cy.get(selectorOf('visibleName')).clear(); + cy.get(selectorOf('visibleName')).type(field.visibleName ?? field.name); + cy.get(selectorOf('type')).select(field.type, { force: true }); + + DataExchangePage.toggle(selectorOf('creatable'), field.isCreatable); + DataExchangePage.toggle(selectorOf('editable'), field.isEditable); + DataExchangePage.toggle(selectorOf('required'), field.isRequired); + }); + }; + + saveConfiguration = (): void => { + this.repository.getSubmitButton().click(); + }; + + downloadApiSpecification = (): void => { + this.visit(); + this.repository.getDownloadSpecificationButton().click(); + }; + + discardDownloadedApiSpecification = (): void => { + cy.task('deleteFile', `${Cypress.config('downloadsFolder')}/${DOWNLOAD_FILE_NAME}`); + }; + + getDownloadedApiSpecification = (): Cypress.Chainable => + cy.readFile(`${Cypress.config('downloadsFolder')}/${DOWNLOAD_FILE_NAME}`); + + getDownloadSpecificationButton = (): Cypress.Chainable => this.repository.getDownloadSpecificationButton(); + + getErrorMessage = (): Cypress.Chainable => this.repository.getErrorMessage(); + + getConfigurationSavedMessage = (): Cypress.Chainable => cy.contains(this.repository.getConfigurationSavedMessage()); + + getIsEnabledCheckbox = (): Cypress.Chainable => this.repository.getIsEnabledCheckbox(); + + getFieldControl = (fieldName: string, control: FieldControl): Cypress.Chainable => + this.repository.getFieldDefinitionControl(fieldName, control); + + private createConfiguration = (tableName: string): void => { + this.repository.getTableNameSelect().select(tableName, { force: true }); + this.repository.getSubmitButton().click(); + }; + + private static toggle(selector: string, isChecked: boolean): void { + if (isChecked) { + cy.get(selector).check(); + + return; + } + + cy.get(selector).uncheck(); + } +} + +export interface FieldDefinition { + name: string; + type: string; + isCreatable: boolean; + isEditable: boolean; + isRequired: boolean; + visibleName?: string; +} diff --git a/cypress/support/pages/backoffice/data-exchange/data-exchange-repository.ts b/cypress/support/pages/backoffice/data-exchange/data-exchange-repository.ts new file mode 100644 index 000000000..4257eb26f --- /dev/null +++ b/cypress/support/pages/backoffice/data-exchange/data-exchange-repository.ts @@ -0,0 +1,45 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +// The field-definition table renders one row per column of the configured table, each row a +// Symfony collection entry, so every control is addressed by the suffix of its generated name. +const FIELD_CONTROL_SELECTORS: Record = { + enabled: 'input[name$="[is_enabled]"]', + visibleName: 'input[name$="[field_visible_name]"]', + type: 'select[name$="[type]"]', + creatable: 'input[name$="[is_creatable]"]', + editable: 'input[name$="[is_editable]"]', + required: 'input[name$="[is_required]"]', +}; + +@injectable() +@autoWired +export class DataExchangeRepository { + getTableNameSelect = (): Cypress.Chainable => cy.get('#dynamic-entity_table_name'); + + getIsEnabledCheckbox = (): Cypress.Chainable => cy.get('#dynamic-entity_is_active'); + + getResourceNameInput = (): Cypress.Chainable => cy.get('#dynamic-entity_table_alias'); + + getSubmitButton = (): Cypress.Chainable => cy.get('button.safe-submit'); + + getFieldDefinitionRow = (fieldName: string): Cypress.Chainable => + cy.get(`input[id^="dynamic-entity_field_definitions"][value="${fieldName}"]`).closest('tr'); + + getFieldDefinitionControl = (fieldName: string, control: FieldControl): Cypress.Chainable => + this.getFieldDefinitionRow(fieldName).find(FIELD_CONTROL_SELECTORS[control]); + + getFieldControlSelector = (control: FieldControl): string => FIELD_CONTROL_SELECTORS[control]; + + getDownloadSpecificationButtonSelector = (): string => 'a[href*="documentation/download"]'; + + getDownloadSpecificationButton = (): Cypress.Chainable => cy.get(this.getDownloadSpecificationButtonSelector()); + + getSpecificationOutdatedAlertSelector = (): string => '[data-qa="alert-documentation-generation-in-progress"]'; + + getErrorMessage = (): Cypress.Chainable => cy.get('.alert-danger'); + + getConfigurationSavedMessage = (): string => 'Configuration is updated successfully'; +} + +export type FieldControl = 'enabled' | 'visibleName' | 'type' | 'creatable' | 'editable' | 'required'; diff --git a/cypress/support/pages/backoffice/glossary/form/glossary-form-page.ts b/cypress/support/pages/backoffice/glossary/form/glossary-form-page.ts new file mode 100644 index 000000000..30b72b676 --- /dev/null +++ b/cypress/support/pages/backoffice/glossary/form/glossary-form-page.ts @@ -0,0 +1,47 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { GlossaryFormRepository } from './glossary-form-repository'; + +@injectable() +@autoWired +export class GlossaryFormPage extends BackofficePage { + @inject(GlossaryFormRepository) private repository: GlossaryFormRepository; + + protected PAGE_URL = '/glossary/add'; + + create = (params: CreateParams): void => { + this.repository.getGlossaryKeyInput().clear().type(params.glossaryKey); + this.fillEveryLocale(params.translation); + this.save(); + }; + + // The edit form renders the same locale fields; only the key is fixed. + update = (translation: string): void => { + this.fillEveryLocale(translation); + this.save(); + }; + + getLocaleTextareas = (): Cypress.Chainable => this.repository.getLocaleTextareas(); + + private fillEveryLocale = (translation: string): void => { + // Every locale is filled because the collection is NotBlank and which locales exist + // depends on the store the repository is running against. + this.repository.getLocaleTextareas().each(($textarea) => { + cy.wrap($textarea).clear(); + cy.wrap($textarea).type(translation); + }); + }; + + // Waits for the form post, so a following login or visit cannot leave the page before the key is stored. + private save = (): void => { + cy.intercept('POST', '**/glossary/**').as('glossarySave'); + this.repository.getSaveButton().click(); + cy.wait('@glossarySave'); + }; +} + +interface CreateParams { + glossaryKey: string; + translation: string; +} diff --git a/cypress/support/pages/backoffice/glossary/form/glossary-form-repository.ts b/cypress/support/pages/backoffice/glossary/form/glossary-form-repository.ts new file mode 100644 index 000000000..f5fa0de3c --- /dev/null +++ b/cypress/support/pages/backoffice/glossary/form/glossary-form-repository.ts @@ -0,0 +1,13 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class GlossaryFormRepository { + getGlossaryKeyInput = (): Cypress.Chainable => cy.get('#translation_glossary_key'); + + // One textarea per locale the store has, so the locales are never named here. + getLocaleTextareas = (): Cypress.Chainable => cy.get('textarea[id^="translation_locales_"]'); + + getSaveButton = (): Cypress.Chainable => cy.get('input.safe-submit'); +} diff --git a/cypress/support/pages/backoffice/glossary/list/glossary-list-page.ts b/cypress/support/pages/backoffice/glossary/list/glossary-list-page.ts new file mode 100644 index 000000000..fbc5a889f --- /dev/null +++ b/cypress/support/pages/backoffice/glossary/list/glossary-list-page.ts @@ -0,0 +1,44 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { GlossaryListRepository } from './glossary-list-repository'; +import Chainable = Cypress.Chainable; + +@injectable() +@autoWired +export class GlossaryListPage extends BackofficePage { + @inject(GlossaryListRepository) private repository: GlossaryListRepository; + + protected PAGE_URL = '/glossary'; + private readonly TABLE_URL = '**/glossary/index/table**'; + + clickCreateTranslation = (): void => { + this.repository.getCreateTranslationButton().click(); + }; + + findTranslation = (glossaryKey: string): Chainable => { + return this.find({ + searchQuery: glossaryKey, + interceptTableUrl: this.TABLE_URL, + expectedToSeeInTable: glossaryKey, + expectedCount: 1, + }).then((getRow) => (getRow ? getRow() : null)); + }; + + edit = (glossaryKey: string): void => { + // expectedCount settles the row count too: the key assertion alone passes on the filtered + // render, which a late unfiltered response can replace before the click picks a row. + this.find({ + searchQuery: glossaryKey, + interceptTableUrl: this.TABLE_URL, + expectedToSeeInTable: glossaryKey, + expectedCount: 1, + }).then((getRow) => { + if (!getRow) { + return; + } + + getRow().find(this.repository.getEditButtonSelector()).click({ force: true }); + }); + }; +} diff --git a/cypress/support/pages/backoffice/glossary/list/glossary-list-repository.ts b/cypress/support/pages/backoffice/glossary/list/glossary-list-repository.ts new file mode 100644 index 000000000..01ca1c638 --- /dev/null +++ b/cypress/support/pages/backoffice/glossary/list/glossary-list-repository.ts @@ -0,0 +1,10 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class GlossaryListRepository { + getCreateTranslationButton = (): Cypress.Chainable => + cy.get('[data-qa="title-action"]').find('a:contains("Create Translation")'); + getEditButtonSelector = (): string => 'a[href*="/glossary/edit"]'; +} diff --git a/cypress/support/pages/backoffice/index.ts b/cypress/support/pages/backoffice/index.ts index 6ce611e35..6ef3370dd 100644 --- a/cypress/support/pages/backoffice/index.ts +++ b/cypress/support/pages/backoffice/index.ts @@ -15,10 +15,12 @@ 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/page/list/cms-page-list-page'; +export * from './cms/page/update/cms-page-update-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'; +export * from './sales-shipment/form/sales-shipment-form-page'; export * from './user/create/user-create-page'; export * from './user/delete/user-delete-page'; export * from './user/index/user-index-page'; @@ -26,15 +28,18 @@ export * from './user/update/user-update-page'; export * from './merchant-relation-request/list/merchant-relation-request-list-page'; export * from './merchant-relation-request/edit/merchant-relation-request-edit-page'; export * from './merchant-relationship/list/merchant-relationship-list-page'; +export * from './merchant-relationship/create/merchant-relationship-create-page'; export * from './product-management/add/product-management-add-page'; export * from './product-management/edit/product-management-edit-page'; export * from './product-management/list/product-management-list-page'; +export * from './product-management/view/product-management-view-page'; export * from './product-management/edit/variant/product-management-edit-variant-page'; 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 './store/edit/store-edit-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'; @@ -51,6 +56,11 @@ export * from './ssp-file-management/detach/ssp-file-management-detach-page'; export * from './ssp-file-management/attach/ssp-file-management-attach-page'; export * from './company-role/list/company-role-list-page'; export * from './company-role/create/company-role-create-page'; +export * from './company/list/company-list-page'; +export * from './company/create/company-create-page'; +export * from './company-business-unit/create/company-business-unit-create-page'; +export * from './company-user/create/company-user-create-page'; +export * from './company-user/list/company-user-list-page'; export * from './ssp-service-management/product/product-page'; export * from './ssp-service-management/service-list/service-list-page'; export * from './multi-factor-auth/multi-factor-auth-page'; @@ -65,6 +75,7 @@ export * from './ssp-model-management/list/ssp-model-list-page'; export * from './ssp-model-management/add/ssp-model-add-page'; export * from './product-offer/list/product-offer-list-page'; export * from './product-offer/create/product-offer-create-page'; +export * from './product-offer/edit/product-offer-edit-page'; export * from './product-offer/view/product-offer-view-page'; export * from './ssp-model-management/update/ssp-model-update-page'; export * from './ssp-model-management/view/ssp-model-view-page'; @@ -77,6 +88,7 @@ export * from './merchant-registrations/merchant-registration-view-page'; export * from './product-attribute-visibility/list/product-attribute-visibility-list-page'; export * from './product-attribute-visibility/create/product-attribute-visibility-create-page'; export * from './product-attribute-visibility/edit/product-attribute-visibility-edit-page'; +export * from './product-discontinued/product-discontinued-page'; export * from './configuration/configuration-page'; export * from './import/create/create-job-page'; export * from './import/create/create-run-page'; @@ -96,9 +108,15 @@ export * from './product-option/product-option-page'; export * from './refund/refund-page'; export * from './product-search/product-search-preferences-page'; export * from './product-relation/product-relation-page'; +export * from './product-set/create/product-set-create-page'; +export * from './product-set/list/product-set-list-page'; export * from './workflow/workflow-management-page'; export * from './workflow/workflow-instance-lifecycle-page'; export * from './order-experience-management/list/recurring-schedule-list-page'; export * from './order-experience-management/view/recurring-schedule-view-page'; +export * from './acl/denied/acl-denied-page'; +export * from './glossary/list/glossary-list-page'; +export * from './glossary/form/glossary-form-page'; +export * from './data-exchange/data-exchange-page'; export * from './service-point/list/service-point-list-page'; export * from './service-point/view/service-point-view-page'; diff --git a/cypress/support/pages/backoffice/login/login-page.ts b/cypress/support/pages/backoffice/login/login-page.ts index bf374097a..5fd2f2c45 100644 --- a/cypress/support/pages/backoffice/login/login-page.ts +++ b/cypress/support/pages/backoffice/login/login-page.ts @@ -16,6 +16,8 @@ export class LoginPage extends BackofficePage { this.repository.getSubmitButton().click(); }; + + getErrorMessage = (): Cypress.Chainable => this.repository.getErrorMessage(); } interface LoginParams { diff --git a/cypress/support/pages/backoffice/login/login-repository.ts b/cypress/support/pages/backoffice/login/login-repository.ts index 78b2644d6..2b8a3714d 100644 --- a/cypress/support/pages/backoffice/login/login-repository.ts +++ b/cypress/support/pages/backoffice/login/login-repository.ts @@ -7,4 +7,5 @@ export class LoginRepository { getEmailInput = (): Cypress.Chainable => cy.get('#auth_username'); getPasswordInput = (): Cypress.Chainable => cy.get('#auth_password'); getSubmitButton = (): Cypress.Chainable => cy.get('form[name=auth]:visible').find('[type="submit"]'); + getErrorMessage = (): Cypress.Chainable => cy.get('[data-qa="error-message"]'); } diff --git a/cypress/support/pages/backoffice/merchant-relationship/create/merchant-relationship-create-page.ts b/cypress/support/pages/backoffice/merchant-relationship/create/merchant-relationship-create-page.ts new file mode 100644 index 000000000..3675be5ba --- /dev/null +++ b/cypress/support/pages/backoffice/merchant-relationship/create/merchant-relationship-create-page.ts @@ -0,0 +1,29 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { BackofficePage } from '@pages/backoffice'; +import { MerchantRelationshipCreateRepository } from './merchant-relationship-create-repository'; + +@injectable() +@autoWired +export class MerchantRelationshipCreatePage extends BackofficePage { + @inject(MerchantRelationshipCreateRepository) private repository: MerchantRelationshipCreateRepository; + + protected PAGE_URL = '/merchant-relationship-gui/create-merchant-relationship'; + + create = (params: CreateParams): void => { + this.repository.getMerchantSelect().select(String(params.idMerchant), { force: true }); + this.repository.getCompanySelect().select(String(params.idCompany), { force: true }); + this.repository.getConfirmButton().click(); + + this.repository.getOwnerBusinessUnitSelect().select(String(params.idCompanyBusinessUnit), { force: true }); + this.repository.getAssignedBusinessUnitsSelect().select([String(params.idCompanyBusinessUnit)], { force: true }); + this.repository.getSaveButton().click(); + }; +} + +interface CreateParams { + idMerchant: number; + idCompany: number; + idCompanyBusinessUnit: number; +} diff --git a/cypress/support/pages/backoffice/merchant-relationship/create/merchant-relationship-create-repository.ts b/cypress/support/pages/backoffice/merchant-relationship/create/merchant-relationship-create-repository.ts new file mode 100644 index 000000000..c8d8f928e --- /dev/null +++ b/cypress/support/pages/backoffice/merchant-relationship/create/merchant-relationship-create-repository.ts @@ -0,0 +1,21 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class MerchantRelationshipCreateRepository { + getMerchantSelect = (): Cypress.Chainable => cy.get('#merchant-relationship_fk_merchant'); + + getCompanySelect = (): Cypress.Chainable => cy.get('#merchant-relationship_fk_company'); + + // The merchant and the company have to be confirmed before the form offers the business units + // that belong to that company. + getConfirmButton = (): Cypress.Chainable => cy.get('input[name="submit-confirm"]'); + + getOwnerBusinessUnitSelect = (): Cypress.Chainable => cy.get('#merchant-relationship_fk_company_business_unit'); + + getAssignedBusinessUnitsSelect = (): Cypress.Chainable => + cy.get('#merchant-relationship_assigneeCompanyBusinessUnits'); + + getSaveButton = (): Cypress.Chainable => cy.get('input[name="submit-persist"]'); +} diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts index 1463903b4..eb2f1792d 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-page.ts @@ -23,10 +23,20 @@ export class MerchantUserCreatePage extends BackofficePage { this.repository.getFirstNameInput().clear().type(merchantUser.firstName); this.repository.getLastNameInput().clear().type(merchantUser.lastName); - this.repository.getCreateButton().click(); + this.repository.getSubmitButton().click(); return merchantUser; }; + + rename = (params: RenameParams): void => { + this.repository.getFirstNameInput().clear().type(params.firstName); + + this.repository.getSubmitButton().click(); + }; +} + +interface RenameParams { + firstName: string; } interface User { diff --git a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts index 07fb0fbc1..9adeea153 100644 --- a/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant-user/create/merchant-user-create-repository.ts @@ -7,5 +7,5 @@ export class MerchantUserCreateRepository { getEmailInput = (): Cypress.Chainable => cy.get('#merchant-user_username'); getFirstNameInput = (): Cypress.Chainable => cy.get('#merchant-user_firstName'); getLastNameInput = (): Cypress.Chainable => cy.get('#merchant-user_lastName'); - getCreateButton = (): Cypress.Chainable => cy.get('form[name=merchant-user]').find('[type="submit"]'); + getSubmitButton = (): Cypress.Chainable => cy.get('form[name=merchant-user]').find('[type="submit"]'); } diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts index b08322dd9..6aa3a46b7 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-page.ts @@ -10,7 +10,7 @@ export class MerchantCreatePage extends BackofficePage { protected PAGE_URL = '/merchant-gui/create-merchant'; - create = (): Merchant => { + create = (params?: CreateParams): Merchant => { const identifier = this.faker.string.uuid(); const merchant = { @@ -23,9 +23,17 @@ export class MerchantCreatePage extends BackofficePage { this.repository.getNameInput().clear().type(merchant.name); this.repository.getReferenceInput().clear().type(merchant.reference); this.repository.getEmailInput().clear().type(merchant.email); - this.repository.getActiveCheckbox().check(); - this.repository.getDEUrlInput().clear().type(merchant.url); - this.repository.getENUrlInput().clear().type(merchant.url); + + if (params?.isActive ?? true) { + this.repository.getActiveCheckbox().check(); + } + + if (params?.storeName) { + this.repository.getStoreCheckbox(params.storeName).check({ force: true }); + } + + this.repository.getDEUrlInput().clear().type(`/de/merchant/${merchant.url}`); + this.repository.getENUrlInput().clear().type(`/en/merchant/${merchant.url}`); this.repository.getSaveButton().click(); @@ -33,6 +41,11 @@ export class MerchantCreatePage extends BackofficePage { }; } +interface CreateParams { + isActive?: boolean; + storeName?: string; +} + interface Merchant { name: string; reference: string; diff --git a/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts index 60719200b..e5c707d64 100644 --- a/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts +++ b/cypress/support/pages/backoffice/merchant/create/merchant-create-repository.ts @@ -11,4 +11,8 @@ export class MerchantCreateRepository { getDEUrlInput = (): Cypress.Chainable => cy.get('#merchant_urlCollection_0_url'); getENUrlInput = (): Cypress.Chainable => cy.get('#merchant_urlCollection_1_url'); getSaveButton = (): Cypress.Chainable => cy.get('form[name=merchant]').find('[type="submit"]'); + + // Store checkboxes are only distinguishable by their label, their ids being positional. + getStoreCheckbox = (storeName: string): Cypress.Chainable => + cy.contains('label', storeName).parent().find('input[name="merchant[storeRelation][id_stores][]"]'); } 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 854ee2b18..fd52e8e6f 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-page.ts @@ -24,25 +24,39 @@ export class MerchantListPage extends BackofficePage { this.clickEditAction($merchantRow); } - if (params.action === ActionEnum.activate) { - cy.wrap($merchantRow).find(this.repository.getActivateButtonSelector()).click({ force: true }); - } - - if (params.action === ActionEnum.deactivate) { - cy.wrap($merchantRow).find(this.repository.getDeactivateButtonSelector()).click({ force: true }); - } - - if (params.action === ActionEnum.approveAccess) { - cy.wrap($merchantRow).find(this.repository.getApproveAccessButtonSelector()).click({ force: true }); - } + const statusButtonSelectors: Partial> = { + [ActionEnum.activate]: this.repository.getActivateButtonSelector(), + [ActionEnum.deactivate]: this.repository.getDeactivateButtonSelector(), + [ActionEnum.approveAccess]: this.repository.getApproveAccessButtonSelector(), + [ActionEnum.denyAccess]: this.repository.getDenyAccessButtonSelector(), + }; + const statusButtonSelector = statusButtonSelectors[params.action]; - if (params.action === ActionEnum.denyAccess) { - cy.wrap($merchantRow).find(this.repository.getDenyAccessButtonSelector()).click({ force: true }); + if (statusButtonSelector) { + this.submitStatusForm($merchantRow, statusButtonSelector); } }); }); }; + findRow = (params: FindRowParams): Cypress.Chainable => { + return this.find({ + interceptTableUrl: `**/merchant-gui/list-merchant/table**`, + searchQuery: params.query, + }).then((getRow) => (getRow ? getRow() : cy.wrap(null))); + }; + + // Every status form saves the whole merchant as it read it, so a form posted before the previous one is + // saved writes the previous change back; each post is therefore awaited. + private submitStatusForm = ($row: JQuery, buttonSelector: string): void => { + const statusFormAlias = this.faker.string.uuid(); + cy.intercept({ method: 'POST', pathname: this.repository.getStatusFormPathPattern() }).as(statusFormAlias); + + cy.wrap($row).find(buttonSelector).click({ force: true }); + + cy.wait(`@${statusFormAlias}`); + }; + clickEditAction = ($row: JQuery): void => { cy.wrap($row).find(this.repository.getEditButtonSelector()).click(); }; @@ -61,6 +75,10 @@ interface UpdateParams { query: string; } +interface FindRowParams { + query: string; +} + 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 b457ed79b..ed277e0d8 100644 --- a/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts +++ b/cypress/support/pages/backoffice/merchant/list/merchant-list-repository.ts @@ -12,4 +12,5 @@ export class MerchantListRepository { getApproveAccessButtonSelector = (): string => 'button:contains("Approve Access")'; getDenyAccessButtonSelector = (): string => 'button:contains("Deny Access")'; getStoreCellSelector = (): string => 'td[class*="column-spy_merchant_store"]'; + getStatusFormPathPattern = (): RegExp => /\/merchant-gui\/(edit-merchant\/(de)?activate|merchant-status)$/; } 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 e1d2ab839..194976637 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-page.ts @@ -1,6 +1,6 @@ import { autoWired } from '@utils'; import { inject, injectable } from 'inversify'; -import { BackofficePage } from '@pages/backoffice'; +import { ActionEnum, BackofficePage } from '@pages/backoffice'; import { MerchantUpdateRepository } from './merchant-update-repository'; @injectable() @@ -11,12 +11,72 @@ export class MerchantUpdatePage extends BackofficePage { protected PAGE_URL = '/merchant-gui/edit-merchant'; create = (): void => { - this.repository.getUsersTab().click(); + this.openUsersTab(); this.repository.getAddMerchantUserButton().click(); }; + openUsersTab = (): void => { + this.repository.getUsersTab().click(); + }; + + visitUsersTab = (idMerchant: number): void => { + this.visit({ qs: { 'id-merchant': idMerchant } }); + this.openUsersTab(); + }; + + // The merchant-user table declares every column non-searchable, so its rows are matched on the + // e-mail text rather than through the table search. + findMerchantUserRow = (params: FindMerchantUserRowParams): Cypress.Chainable => + this.repository.getMerchantUserTableRows().filter(`:contains("${params.email}")`, { timeout: 20000 }); + + // Some shops keep a deleted merchant user listed, labelled Deleted and without a delete action. + findDeletableMerchantUserRow = (params: FindMerchantUserRowParams): Cypress.Chainable => + this.findMerchantUserRow(params).filter(`:has(${this.repository.getMerchantUserDeleteButtonSelector()})`); + + updateMerchantUser = (params: UpdateMerchantUserParams): void => { + const selectors = { + [ActionEnum.edit]: this.repository.getMerchantUserEditButtonSelector(), + [ActionEnum.activate]: this.repository.getMerchantUserActivateButtonSelector(), + [ActionEnum.deactivate]: this.repository.getMerchantUserDeactivateButtonSelector(), + [ActionEnum.delete]: this.repository.getMerchantUserDeleteButtonSelector(), + }; + + // DataTables re-renders the row when its ajax settles, so the action is clicked through an + // alias, which Cypress re-queries instead of holding a detached element. + this.findMerchantUserRow({ email: params.email }).find(selectors[params.action]).as('merchantUserAction'); + cy.get('@merchantUserAction').click(); + + if (params.action === ActionEnum.delete) { + this.repository.getConfirmDeleteButton().click(); + } + }; + + rename = (params: RenameParams): void => { + this.repository.getNameInput().clear().type(params.name); + this.repository.getSaveButton().click(); + }; + + // Taking every store off the relation is what retires the merchant's storefront page. + unassignAllStores = (): void => { + this.repository.getAllAvailableStoresInputs().uncheck({ force: true }); + this.repository.getSaveButton().click(); + }; + assignAllAvailableStore = (): void => { this.repository.getAllAvailableStoresInputs().check(); this.repository.getSaveButton().click(); }; } + +interface RenameParams { + name: string; +} + +interface FindMerchantUserRowParams { + email: string; +} + +interface UpdateMerchantUserParams { + email: string; + action: ActionEnum.edit | ActionEnum.activate | ActionEnum.deactivate | ActionEnum.delete; +} 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 c9ae064ff..5ce210059 100644 --- a/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts +++ b/cypress/support/pages/backoffice/merchant/update/merchant-update-repository.ts @@ -4,10 +4,25 @@ import { injectable } from 'inversify'; @injectable() @autoWired export class MerchantUpdateRepository { + getNameInput = (): Cypress.Chainable => cy.get('#merchant_name'); getUsersTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-merchant-user"]'); getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); getSearchSelector = (): string => '.dt-search input[type="search"]'; getAddMerchantUserButton = (): Cypress.Chainable => cy.get('body').find('a:contains("Add Merchant User")'); + + getMerchantUserTableRows = (): Cypress.Chainable => + cy.get('#tab-content-merchant-user table tbody tr', { timeout: 20000 }); + + getMerchantUserEditButtonSelector = (): string => 'a[href*="/merchant-user-gui/edit-merchant-user"]'; + + getMerchantUserActivateButtonSelector = (): string => 'a[href*="status=active"]'; + + // Deactivating a merchant user sets it to the blocked status; the table then labels it Deactivated. + getMerchantUserDeactivateButtonSelector = (): string => 'a[href*="status=blocked"]'; + + getMerchantUserDeleteButtonSelector = (): string => '[data-qa="delete-button"]'; + + getConfirmDeleteButton = (): Cypress.Chainable => cy.get('form [type="submit"]'); 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/navigation/navigation-menu-page.ts b/cypress/support/pages/backoffice/navigation/navigation-menu-page.ts index 4394f7c03..694bfa3fe 100644 --- a/cypress/support/pages/backoffice/navigation/navigation-menu-page.ts +++ b/cypress/support/pages/backoffice/navigation/navigation-menu-page.ts @@ -63,6 +63,31 @@ export class NavigationMenuPage extends BackofficePage { }); }; + getUserNavigationToggler = (): Cypress.Chainable => cy.get(this.repository.getUserNavigationTogglerSelector()); + + /** + * Every navigable node in the side menu, both levels. The collapsed second level is present in + * the DOM already — the parent only toggles a CSS class — so nothing has to be expanded first. + * Parent nodes are excluded because their href is an in-page collapse anchor, not a page. + */ + getMenuItemPaths = (): Cypress.Chainable => { + return cy + .get(`${this.repository.getNavigationMenuSelector()} ${this.repository.getMenuItemLinkSelector()}`) + .then(($links): string[] => { + const paths = $links + .map((index: number, element: HTMLElement) => Cypress.$(element).attr('href')) + .get() + .filter((href): href is string => typeof href === 'string' && href.startsWith('/')); + + return Array.from(new Set(paths)); + }); + }; + + getTopLevelIcons = (): Cypress.Chainable => + cy + .get(this.repository.getNavigationMenuSelector()) + .find(`> ${this.repository.getMenuItemSelector()} > a i, > ${this.repository.getMenuParentItemSelector()} > a i`); + hasMenuItem = (itemLabel: string): Cypress.Chainable => { return cy.get(this.repository.getNavigationMenuSelector()).then(($menu) => { return $menu.find(`${this.repository.getMenuItemLabelSelector()}:contains("${itemLabel}")`).length > 0; diff --git a/cypress/support/pages/backoffice/navigation/navigation-menu-repository.ts b/cypress/support/pages/backoffice/navigation/navigation-menu-repository.ts index dec4e8a5a..323a44e74 100644 --- a/cypress/support/pages/backoffice/navigation/navigation-menu-repository.ts +++ b/cypress/support/pages/backoffice/navigation/navigation-menu-repository.ts @@ -16,4 +16,6 @@ export class NavigationMenuRepository { '[data-qa="navigation-menu"] [data-qa="menu-item"]:not(:visible), [data-qa="navigation-menu"] [data-qa="menu-parent-item"]:not(:visible)'; getVisibleMenuItemsSelector = (): string => '[data-qa="menu-item"]:visible, [data-qa="menu-parent-item"]:visible'; getFilteredMenuSelector = (): string => '[data-qa="navigation-menu"].filtered'; + getMenuItemLinkSelector = (): string => '[data-qa="menu-item-link"]'; + getUserNavigationTogglerSelector = (): string => '[data-qa="backoffice-user-navigation"]'; } diff --git a/cypress/support/pages/backoffice/product-discontinued/product-discontinued-page.ts b/cypress/support/pages/backoffice/product-discontinued/product-discontinued-page.ts new file mode 100644 index 000000000..b2717786f --- /dev/null +++ b/cypress/support/pages/backoffice/product-discontinued/product-discontinued-page.ts @@ -0,0 +1,27 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; + +@injectable() +@autoWired +export class ProductDiscontinuedPage extends BackofficePage { + protected PAGE_URL = '/product-discontinued-gui/index'; + + // Driven by url rather than through the product table. The controller action is the whole of what + // the back office does here, and a product created by a fixture is not reachable from the table + // without paging through it, which is state this journey does not own. + // + // The action redirects by concatenating the Referer header, so without one it answers 500 *after* + // having discontinued the product — a passing write behind a failing response. + discontinueProduct = (params: DiscontinueProductParams): void => { + const productListUrl = `${Cypress.env('backofficeUrl')}/product-management`; + + cy.visitBackoffice(`${this.PAGE_URL}/discontinue?id-product-concrete=${params.idProductConcrete}`, { + headers: { referer: productListUrl }, + }); + }; +} + +interface DiscontinueProductParams { + idProductConcrete: number; +} 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 b61ee1f60..b654b3633 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 @@ -21,11 +21,12 @@ export class ProductManagementEditPage extends BackofficePage { const variantTableUrl = '**/product-management/edit/variant-table**'; cy.intercept('GET', variantTableUrl).as('variantTable'); this.repository.getVariantsTab().click(); - cy.wait('@variantTable', { timeout: 1000 }); - this.repository.getVariantFirstTableRow().then(($productVariantRow) => { - cy.wrap($productVariantRow).find(this.repository.getVariantEditButtonSelector()).as('editVariantButton'); - cy.get('@editVariantButton').click({ force: true }); - }); + cy.wait('@variantTable'); + // One query chain, so a table redraw re-queries the row instead of leaving a detached one behind. + this.repository + .getVariantFirstTableRow() + .find(this.repository.getVariantEditButtonSelector()) + .click({ force: true }); }; assignAllPossibleStores = (): void => { @@ -37,6 +38,31 @@ export class ProductManagementEditPage extends BackofficePage { return this.repository.getGeneralTab(); } + visitProduct = (idProductAbstract: string): void => { + cy.visitBackoffice(`${this.PAGE_URL}?id-product-abstract=${idProductAbstract}`); + }; + + unassignStore = (storeName: string): void => { + this.repository.getGeneralTab().click({ force: true }); + this.repository.getStoreRelationCheckbox(storeName).uncheck(); + }; + + // The price rows are keyed by store id, which is only readable from the store checkbox on the + // general tab — hence the tab switch in the middle. + setStorePrice = (params: SetStorePriceParams): void => { + this.repository.getGeneralTab().click({ force: true }); + this.repository + .getStoreRelationCheckbox(params.storeName) + .invoke('val') + .then((idStore) => { + this.repository.getPriceTaxTab().click(); + this.repository.getStorePriceInputs(String(idStore)).each(($priceInput) => { + cy.wrap($priceInput).clear({ force: true }); + cy.wrap($priceInput).type(params.price, { force: true, delay: 0 }); + }); + }); + }; + bulkPriceUpdate = (productPrice: string): void => { this.repository.getPriceTaxTab().click(); this.repository.getAllPriceInputs().each(($el) => { @@ -125,6 +151,11 @@ export class ProductManagementEditPage extends BackofficePage { getFirstAttachmentFormAddButton = (): Cypress.Chainable => this.repository.getFirstAttachmentFormAddButton(); } +interface SetStorePriceParams { + storeName: string; + price: string; +} + interface AttachmentParams { label: string; url: string; 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 554b4c924..131d799b7 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 @@ -12,8 +12,22 @@ export class ProductManagementEditRepository { 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"]'); + + // The store checkbox carries the store id the price rows are keyed by, so reading it is how a + // caller turns a store name into the id without hard-coding an environment-specific number. + getStoreRelationCheckbox = (storeName: string): Cypress.Chainable => + cy + .get('#tab-content-general label') + .contains(new RegExp(`^\\s*${storeName}\\s*$`)) + .find('input[name="product_form_edit[store_relation][id_stores][]"]'); + + // Every money field of one store, across currencies and across gross/net, so the store carries + // that price whichever mode the shop runs in. + getStorePriceInputs = (idStore: string): Cypress.Chainable => + cy.get(`#price-table-collection [data-decimal-rounding="2"][id^="product_form_edit_prices_${idStore}-"]`); getSaveButton = (): Cypress.Chainable => cy.get('[name="product_form_edit"] [value="Save"]'); getProductNameDEInput = (): Cypress.Chainable => cy.get('#product_form_edit_general_de_DE_name'); + getCollapsedBlock = (): Cypress.Chainable => cy.get('#tab-content-general > .panel-body > .collapsed > .ibox-title > .collapse-link > .ibox-tools > .fas'); getMediaTab = (): Cypress.Chainable => cy.get('[data-tab-content-id="tab-content-image"]'); 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 afbe36f0a..fbea38f59 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 @@ -48,6 +48,15 @@ export class ProductManagementListPage extends BackofficePage { this.repository.getFilterButton().click(); }; + // The merchant switcher is a plain select that reloads the table through its own GET form. + filterByMerchant = (params: FilterByMerchantParams): void => { + this.repository.getMerchantFilterSelect().select(String(params.idMerchant)); + }; + + clickViewButton = (): void => { + this.getTableRows().first().find(this.repository.getViewButtonSelector()).click(); + }; + applySearchQuery = (query: string, callback: () => void): void => { this.repository .getFilterSearchInput() @@ -96,6 +105,10 @@ interface UpdateParams { query: string; } +interface FilterByMerchantParams { + idMerchant: number; +} + interface ApplyFiltersParams { status?: string; query?: 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 ad2ea4997..ca41401c8 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 @@ -21,5 +21,8 @@ export class ProductManagementListRepository { getFilterSearchInput = (): Cypress.Chainable => cy.get('.dt-search [type=search]'); getResetButton = (): Cypress.Chainable => cy.get('#product-management-filter-form a[href="/product-management"]'); + getMerchantFilterSelect = (): Cypress.Chainable => cy.get('select[name="id-merchant"]'); + getViewButtonSelector = (): string => 'a:contains("View")'; + getNoTableRecordsText = (): string => 'No matching records found'; } diff --git a/cypress/support/pages/backoffice/product-management/view/product-management-view-page.ts b/cypress/support/pages/backoffice/product-management/view/product-management-view-page.ts new file mode 100644 index 000000000..3b57837aa --- /dev/null +++ b/cypress/support/pages/backoffice/product-management/view/product-management-view-page.ts @@ -0,0 +1,23 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { BackofficePage } from '@pages/backoffice'; +import { ProductManagementViewRepository } from './product-management-view-repository'; + +@injectable() +@autoWired +export class ProductManagementViewPage extends BackofficePage { + @inject(ProductManagementViewRepository) private repository: ProductManagementViewRepository; + + protected PAGE_URL = '/product-management/view'; + + getGeneralInformation = (): Cypress.Chainable => this.repository.getGeneralInformation(); + + getMerchantName = (): Cypress.Chainable => this.repository.getGeneralInformationValue('Merchant'); + + getApprovalStatus = (): Cypress.Chainable => this.repository.getGeneralInformationValue('Approval status'); + + getStoreRelation = (): Cypress.Chainable => this.repository.getGeneralInformationValue('Store relation'); + + getSku = (): Cypress.Chainable => this.repository.getGeneralInformationValue('Sku'); +} diff --git a/cypress/support/pages/backoffice/product-management/view/product-management-view-repository.ts b/cypress/support/pages/backoffice/product-management/view/product-management-view-repository.ts new file mode 100644 index 000000000..66be5a273 --- /dev/null +++ b/cypress/support/pages/backoffice/product-management/view/product-management-view-repository.ts @@ -0,0 +1,28 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ProductManagementViewRepository { + private readonly GENERAL_INFORMATION_HEADING = 'General Information'; + + getGeneralInformation = (): Cypress.Chainable => { + return cy + .get('.ibox-title h5') + .contains(this.GENERAL_INFORMATION_HEADING) + .parents('.ibox') + .first() + .find('.ibox-content') + .first(); + }; + + // Zed renders the block as label/value column pairs with no data attribute, so the label text is the anchor. + // Its case depends on the shop's Zed translations (Sku on suite, SKU on the B2C marketplace). + getGeneralInformationValue = (label: string): Cypress.Chainable => { + return this.getGeneralInformation() + .find('> .row') + .filter((_index, row) => Cypress.$(row).children().first().text().trim().toLowerCase() === label.toLowerCase()) + .children() + .last(); + }; +} diff --git a/cypress/support/pages/backoffice/product-offer/edit/product-offer-edit-page.ts b/cypress/support/pages/backoffice/product-offer/edit/product-offer-edit-page.ts new file mode 100644 index 000000000..e9f1d71ee --- /dev/null +++ b/cypress/support/pages/backoffice/product-offer/edit/product-offer-edit-page.ts @@ -0,0 +1,27 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { BackofficePage } from '@pages/backoffice'; +import { ProductOfferEditRepository } from './product-offer-edit-repository'; + +@injectable() +@autoWired +export class ProductOfferEditPage extends BackofficePage { + @inject(ProductOfferEditRepository) private repository: ProductOfferEditRepository; + + protected PAGE_URL = '/self-service-portal/edit-offer'; + + visitOffer = (idProductOffer: number): void => { + cy.visitBackoffice(`${this.PAGE_URL}?id_product_offer=${idProductOffer}`); + }; + + // The stores field is a multi-select, so the way to take a store away is to re-select the ones + // that stay rather than to look for a per-store control. + keepOnlyStores = (storeNames: string[]): void => { + this.repository.getStoresField().select(storeNames, { force: true }); + }; + + save = (): void => { + this.repository.getSaveButton().click(); + }; +} diff --git a/cypress/support/pages/backoffice/product-offer/edit/product-offer-edit-repository.ts b/cypress/support/pages/backoffice/product-offer/edit/product-offer-edit-repository.ts new file mode 100644 index 000000000..439358316 --- /dev/null +++ b/cypress/support/pages/backoffice/product-offer/edit/product-offer-edit-repository.ts @@ -0,0 +1,13 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ProductOfferEditRepository { + // Rendered as a Select2 combo box, so the native multi-select behind it is hidden and every + // interaction with it has to be forced. + getStoresField = (): Cypress.Chainable => cy.get('[name="edit_offer_form[stores][]"]'); + + // The submit control carries no type attribute; it is the form's default submit button. + getSaveButton = (): Cypress.Chainable => cy.get('[name="edit_offer_form"]').find('button.safe-submit'); +} diff --git a/cypress/support/pages/backoffice/product-offer/list/product-offer-list-page.ts b/cypress/support/pages/backoffice/product-offer/list/product-offer-list-page.ts index ac064b4bf..0b954158c 100644 --- a/cypress/support/pages/backoffice/product-offer/list/product-offer-list-page.ts +++ b/cypress/support/pages/backoffice/product-offer/list/product-offer-list-page.ts @@ -37,7 +37,31 @@ export class ProductOfferListPage extends BackofficePage { return this.getTableRows().eq(rowIndex).find(this.repository.getApproveButtonSelector()).click(); }; + clickDenyButton = (rowIndex = 0): Cypress.Chainable => { + return this.getTableRows().eq(rowIndex).find(this.repository.getDenyButtonSelector()).click(); + }; + + // The merchant switcher is a plain select that reloads the table through its own GET form. + filterByMerchant = (params: FilterByMerchantParams): void => { + this.repository.getMerchantFilterSelect().select(String(params.idMerchant)); + }; + + findOffer = (params: FindOfferParams): Cypress.Chainable => { + return this.find({ + interceptTableUrl: `**${this.POST_URL}**`, + searchQuery: params.query, + }).then((getRow) => (getRow ? getRow() : cy.wrap(null))); + }; + getReference = (rowIndex = 0): Cypress.Chainable => { return this.getTableRows().eq(rowIndex).find(this.repository.getReferenceColumnSelector()).invoke('text'); }; } + +interface FilterByMerchantParams { + idMerchant: number; +} + +interface FindOfferParams { + query: string; +} diff --git a/cypress/support/pages/backoffice/product-offer/list/product-offer-list-repository.ts b/cypress/support/pages/backoffice/product-offer/list/product-offer-list-repository.ts index b6d73a1b4..807200664 100644 --- a/cypress/support/pages/backoffice/product-offer/list/product-offer-list-repository.ts +++ b/cypress/support/pages/backoffice/product-offer/list/product-offer-list-repository.ts @@ -19,4 +19,8 @@ export class ProductOfferListRepository { getSkuColumnSelector = (): string => 'td:nth-child(2)'; getApproveButtonSelector = (): string => 'form[action*="approval-status=approved"] button'; + + getDenyButtonSelector = (): string => 'form[action*="approval-status=denied"] button'; + + getMerchantFilterSelect = (): Cypress.Chainable => cy.get('select[name="id-merchant"]'); } diff --git a/cypress/support/pages/backoffice/product-offer/view/product-offer-view-page.ts b/cypress/support/pages/backoffice/product-offer/view/product-offer-view-page.ts index f99487b3c..1511bf900 100644 --- a/cypress/support/pages/backoffice/product-offer/view/product-offer-view-page.ts +++ b/cypress/support/pages/backoffice/product-offer/view/product-offer-view-page.ts @@ -21,6 +21,8 @@ export class ProductOfferViewPage extends BackofficePage { getStoreContainer = (): Cypress.Chainable => this.repository.getStoreContainer(); + getMerchantSkuContainer = (): Cypress.Chainable => this.repository.getMerchantSkuContainer(); + getValidFromContainer = (): Cypress.Chainable => this.repository.getValidFromContainer(); getValidToContainer = (): Cypress.Chainable => this.repository.getValidToContainer(); diff --git a/cypress/support/pages/backoffice/product-offer/view/product-offer-view-repository.ts b/cypress/support/pages/backoffice/product-offer/view/product-offer-view-repository.ts index 9aaf61f61..977da86c9 100644 --- a/cypress/support/pages/backoffice/product-offer/view/product-offer-view-repository.ts +++ b/cypress/support/pages/backoffice/product-offer/view/product-offer-view-repository.ts @@ -13,6 +13,14 @@ export class ProductOfferViewRepository { getValidToContainer = (): Cypress.Chainable => cy.get('[data-qa="product-offer-valid-to"]'); getProductOfferServicePointContainer = (): Cypress.Chainable => cy.get('[data-qa="product-offer-service-point"]'); + // Zed renders the merchant SKU as a label/value column pair with no data attribute. + getMerchantSkuContainer = (): Cypress.Chainable => + cy + .get('.ibox-content > .row') + .filter((_index, row) => Cypress.$(row).children().first().text().trim() === 'Merchant SKU') + .children() + .last(); + getStockTable = (): Cypress.Chainable => cy.get('.table.table--expand'); getStockTableRows = (): Cypress.Chainable => this.getStockTable().find('tbody > tr'); getStockNameCell = (row: number): Cypress.Chainable => this.getStockTableRows().eq(row).find('td').eq(0); diff --git a/cypress/support/pages/backoffice/product-set/create/product-set-create-page.ts b/cypress/support/pages/backoffice/product-set/create/product-set-create-page.ts new file mode 100644 index 000000000..325f5001b --- /dev/null +++ b/cypress/support/pages/backoffice/product-set/create/product-set-create-page.ts @@ -0,0 +1,82 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { ProductSetCreateRepository } from './product-set-create-repository'; + +@injectable() +@autoWired +export class ProductSetCreatePage extends BackofficePage { + @inject(ProductSetCreateRepository) private repository: ProductSetCreateRepository; + + protected PAGE_URL = '/product-set-gui/create'; + + create = (params: CreateParams): void => { + this.visit(); + + // Whether the second locale opens collapsed depends on how many locales the shop has, and a + // collapsed block's fields are not typeable, so each block is opened if it is not open already. + this.repository + .getGeneralBlock() + .find(this.repository.getLocalizedBlockSelector()) + .each(($block) => { + if (!$block.find(this.repository.getIboxContentSelector()).is(':visible')) { + cy.wrap($block).find(this.repository.getCollapseLinkSelector()).click({ force: true }); + } + }); + + // The same name and url key in every locale: each locale prefixes the key with its own + // language segment, so one key still yields one distinct storefront url per locale. + this.repository + .getGeneralBlock() + .find(this.repository.getLocalizedBlockSelector()) + .each(($block) => { + cy.wrap($block).find(this.repository.getLocalizedNameSelector()).clear(); + cy.wrap($block).find(this.repository.getLocalizedNameSelector()).type(params.name); + cy.wrap($block).find(this.repository.getLocalizedUrlSelector()).clear(); + cy.wrap($block).find(this.repository.getLocalizedUrlSelector()).type(params.urlKey); + }); + + this.repository.getProductSetKeyInput().clear(); + this.repository.getProductSetKeyInput().type(params.setKey); + this.repository.getIsActiveCheckbox().check(); + + this.repository.getProductsTab().click(); + params.productAbstractSkus.forEach((sku, index) => this.assignProduct(sku, index + 1)); + + this.repository.getSaveButton().click(); + + // A rejected form silently re-renders itself, so the redirect to the view page is the only + // proof that the set was stored rather than that the click happened. + cy.url().should('include', '/product-set-gui/view'); + }; + + private assignProduct(abstractSku: string, expectedAssignedCount: number): void { + this.repository.getProductSearchInput().clear(); + this.repository.getProductSearchInput().type(abstractSku); + + // The picker is server-side, so the click has to wait for the redraw that narrows the four + // hundred demo products down to this one - otherwise it ticks whatever row was already there. + this.repository.getProductTableInfo().should('contain', 'filtered from'); + this.repository.getProductTableProcessing().should('not.be.visible'); + this.repository.getProductRows().should('have.length', 1); + this.repository.getProductRows().should('contain', abstractSku); + + this.repository.getProductRowCheckboxes().first().check(); + + // Ticking a row is what appends its id to the hidden field the form posts, and the form rejects + // a set of fewer than two products, so each pick is counted rather than only the last one. + this.repository + .getAssignedProductsField() + .invoke('val') + .should((value) => { + expect(String(value).split(',').filter(Boolean)).to.have.length(expectedAssignedCount); + }); + } +} + +interface CreateParams { + name: string; + urlKey: string; + setKey: string; + productAbstractSkus: string[]; +} diff --git a/cypress/support/pages/backoffice/product-set/create/product-set-create-repository.ts b/cypress/support/pages/backoffice/product-set/create/product-set-create-repository.ts new file mode 100644 index 000000000..fcd9ee4cd --- /dev/null +++ b/cypress/support/pages/backoffice/product-set/create/product-set-create-repository.ts @@ -0,0 +1,26 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ProductSetCreateRepository { + getGeneralBlock = (): Cypress.Chainable => cy.get('#tab-content-general'); + getCollapseLinkSelector = (): string => '.collapse-link'; + getIboxContentSelector = (): string => '.ibox-content'; + getLocalizedBlockSelector = (): string => '.ibox.nested'; + // The two hidden siblings in the same block are the url prefix and the original url, so the + // visible text input is what distinguishes the field the form actually reads. + getLocalizedNameSelector = (): string => 'input[type="text"][id$="_name"]'; + getLocalizedUrlSelector = (): string => 'input[type="text"][id$="_url"]'; + getProductSetKeyInput = (): Cypress.Chainable => cy.get('#product_set_form_general_form_product_set_key'); + getIsActiveCheckbox = (): Cypress.Chainable => cy.get('#product_set_form_general_form_is_active'); + getProductsTab = (): Cypress.Chainable => cy.get('[data-qa="tab-products"]'); + getProductSearchInput = (): Cypress.Chainable => cy.get('input[aria-controls="product-table"]'); + getProductTableInfo = (): Cypress.Chainable => cy.get('#product-table_info'); + getProductTableProcessing = (): Cypress.Chainable => cy.get('#product-table_processing'); + getProductRows = (): Cypress.Chainable => cy.get('#product-table tbody tr'); + getProductRowCheckboxes = (): Cypress.Chainable => cy.get('#product-table tbody input.all-products-checkbox'); + getAssignedProductsField = (): Cypress.Chainable => + cy.get('#product_set_form_products_form_assign_id_product_abstracts'); + getSaveButton = (): Cypress.Chainable => cy.get('form[name="product_set_form"] input[type="submit"]'); +} diff --git a/cypress/support/pages/backoffice/product-set/list/product-set-list-page.ts b/cypress/support/pages/backoffice/product-set/list/product-set-list-page.ts new file mode 100644 index 000000000..9c11c96c3 --- /dev/null +++ b/cypress/support/pages/backoffice/product-set/list/product-set-list-page.ts @@ -0,0 +1,27 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { ProductSetListRepository } from './product-set-list-repository'; + +@injectable() +@autoWired +export class ProductSetListPage extends BackofficePage { + @inject(ProductSetListRepository) private repository: ProductSetListRepository; + + protected PAGE_URL = '/product-set-gui'; + + delete = (name: string): void => { + this.visit(); + + this.repository.getSearchInput().clear(); + this.repository.getSearchInput().type(name); + + this.repository.getTableInfo().should('contain', 'filtered from'); + this.repository.getTableProcessing().should('not.be.visible'); + this.repository.getTableRows().should('have.length', 1); + + this.repository.getTableRows().first().find(this.repository.getDeleteButtonSelector()).click(); + }; + + getTableRows = (): Cypress.Chainable => this.repository.getTableRows(); +} diff --git a/cypress/support/pages/backoffice/product-set/list/product-set-list-repository.ts b/cypress/support/pages/backoffice/product-set/list/product-set-list-repository.ts new file mode 100644 index 000000000..3a247c757 --- /dev/null +++ b/cypress/support/pages/backoffice/product-set/list/product-set-list-repository.ts @@ -0,0 +1,12 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ProductSetListRepository { + getSearchInput = (): Cypress.Chainable => cy.get('input[aria-controls="product-set-table"]'); + getTableInfo = (): Cypress.Chainable => cy.get('#product-set-table_info'); + getTableProcessing = (): Cypress.Chainable => cy.get('#product-set-table_processing'); + getTableRows = (): Cypress.Chainable => cy.get('#product-set-table tbody tr'); + getDeleteButtonSelector = (): string => 'button[data-qa="delete-button"]'; +} diff --git a/cypress/support/pages/backoffice/refund/refund-page.ts b/cypress/support/pages/backoffice/refund/refund-page.ts index dff568f53..f82ddc9ea 100644 --- a/cypress/support/pages/backoffice/refund/refund-page.ts +++ b/cypress/support/pages/backoffice/refund/refund-page.ts @@ -22,6 +22,12 @@ export class RefundPage extends BackofficePage { // Sum of the order's item totals (`sumPriceToPayAggregation`), the figure a full refund must match. getTotalItemAmount = (): Cypress.Chainable => this.sumRawAmounts(this.repository.getItemTotalAmountCells()); + // One item's own total, for comparing a single-item refund against the item it refunded. Read it + // before triggering the refund: the recalculation that follows writes the item's canceled amount + // and the row then reports what is left to pay, not what was ordered. + getItemTotalAmount = (sku: string): Cypress.Chainable => + this.sumRawAmounts(this.repository.getItemTotalAmountCellsBySku(sku)); + private sumRawAmounts = (cells: Cypress.Chainable): Cypress.Chainable => cells.then(($cells) => { const rawAmountAttribute = this.repository.getRawAmountAttribute(); diff --git a/cypress/support/pages/backoffice/refund/refund-repository.ts b/cypress/support/pages/backoffice/refund/refund-repository.ts index e6f13a83b..14c8eeab1 100644 --- a/cypress/support/pages/backoffice/refund/refund-repository.ts +++ b/cypress/support/pages/backoffice/refund/refund-repository.ts @@ -3,5 +3,6 @@ export interface RefundRepository { getRefundRows(): Cypress.Chainable; getRefundAmountCells(): Cypress.Chainable; getItemTotalAmountCells(): Cypress.Chainable; + getItemTotalAmountCellsBySku(sku: string): Cypress.Chainable; getRawAmountAttribute(): string; } diff --git a/cypress/support/pages/backoffice/refund/repositories/b2b-mp-refund-repository.ts b/cypress/support/pages/backoffice/refund/repositories/b2b-mp-refund-repository.ts index 242e62210..14f7656a5 100644 --- a/cypress/support/pages/backoffice/refund/repositories/b2b-mp-refund-repository.ts +++ b/cypress/support/pages/backoffice/refund/repositories/b2b-mp-refund-repository.ts @@ -26,6 +26,12 @@ export class B2bMpRefundRepository implements RefundRepository { return cy.get('table[data-qa="order-item-list"] tbody td[data-qa="item-total-amount"]'); } + getItemTotalAmountCellsBySku(sku: string): Cypress.Chainable { + return cy.get( + `table[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) td[data-qa="item-total-amount"]` + ); + } + getRawAmountAttribute(): string { return this.RAW_AMOUNT_ATTRIBUTE; } diff --git a/cypress/support/pages/backoffice/refund/repositories/b2b-refund-repository.ts b/cypress/support/pages/backoffice/refund/repositories/b2b-refund-repository.ts index 77c9365de..af7f32add 100644 --- a/cypress/support/pages/backoffice/refund/repositories/b2b-refund-repository.ts +++ b/cypress/support/pages/backoffice/refund/repositories/b2b-refund-repository.ts @@ -26,6 +26,12 @@ export class B2bRefundRepository implements RefundRepository { return cy.get('table[data-qa="order-item-list"] tbody td[data-qa="item-total-amount"]'); } + getItemTotalAmountCellsBySku(sku: string): Cypress.Chainable { + return cy.get( + `table[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) td[data-qa="item-total-amount"]` + ); + } + getRawAmountAttribute(): string { return this.RAW_AMOUNT_ATTRIBUTE; } diff --git a/cypress/support/pages/backoffice/refund/repositories/b2c-mp-refund-repository.ts b/cypress/support/pages/backoffice/refund/repositories/b2c-mp-refund-repository.ts index 87c5aa5e6..f71a193fb 100644 --- a/cypress/support/pages/backoffice/refund/repositories/b2c-mp-refund-repository.ts +++ b/cypress/support/pages/backoffice/refund/repositories/b2c-mp-refund-repository.ts @@ -26,6 +26,12 @@ export class B2cMpRefundRepository implements RefundRepository { return cy.get('table[data-qa="order-item-list"] tbody td[data-qa="item-total-amount"]'); } + getItemTotalAmountCellsBySku(sku: string): Cypress.Chainable { + return cy.get( + `table[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) td[data-qa="item-total-amount"]` + ); + } + getRawAmountAttribute(): string { return this.RAW_AMOUNT_ATTRIBUTE; } diff --git a/cypress/support/pages/backoffice/refund/repositories/b2c-refund-repository.ts b/cypress/support/pages/backoffice/refund/repositories/b2c-refund-repository.ts index 5577fa5ff..8ed6e6b52 100644 --- a/cypress/support/pages/backoffice/refund/repositories/b2c-refund-repository.ts +++ b/cypress/support/pages/backoffice/refund/repositories/b2c-refund-repository.ts @@ -26,6 +26,12 @@ export class B2cRefundRepository implements RefundRepository { return cy.get('table[data-qa="order-item-list"] tbody td[data-qa="item-total-amount"]'); } + getItemTotalAmountCellsBySku(sku: string): Cypress.Chainable { + return cy.get( + `table[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) td[data-qa="item-total-amount"]` + ); + } + getRawAmountAttribute(): string { return this.RAW_AMOUNT_ATTRIBUTE; } diff --git a/cypress/support/pages/backoffice/refund/repositories/suite-refund-repository.ts b/cypress/support/pages/backoffice/refund/repositories/suite-refund-repository.ts index 170d69968..8c6c9a07c 100644 --- a/cypress/support/pages/backoffice/refund/repositories/suite-refund-repository.ts +++ b/cypress/support/pages/backoffice/refund/repositories/suite-refund-repository.ts @@ -26,6 +26,12 @@ export class SuiteRefundRepository implements RefundRepository { return cy.get('table[data-qa="order-item-list"] tbody td[data-qa="item-total-amount"]'); } + getItemTotalAmountCellsBySku(sku: string): Cypress.Chainable { + return cy.get( + `table[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) td[data-qa="item-total-amount"]` + ); + } + getRawAmountAttribute(): string { return this.RAW_AMOUNT_ATTRIBUTE; } diff --git a/cypress/support/pages/backoffice/sales-shipment/form/sales-shipment-form-page.ts b/cypress/support/pages/backoffice/sales-shipment/form/sales-shipment-form-page.ts new file mode 100644 index 000000000..3d404c2d4 --- /dev/null +++ b/cypress/support/pages/backoffice/sales-shipment/form/sales-shipment-form-page.ts @@ -0,0 +1,70 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BackofficePage } from '@pages/backoffice'; +import { SalesShipmentFormRepository } from './sales-shipment-form-repository'; + +// The choice the address dropdown offers when the shipment should not reuse one of the customer's +// stored addresses; picking it is what reveals the address fields below. +const NEW_ADDRESS_CHOICE = 'New address'; + +const SHIPMENT_METHOD_OPTION_SEPARATOR = ' - '; + +@injectable() +@autoWired +export class SalesShipmentFormPage extends BackofficePage { + @inject(SalesShipmentFormRepository) private repository: SalesShipmentFormRepository; + + // Create and edit render the same form block, so one page object drives both. + protected PAGE_URL = '/shipment-gui'; + + fillNewDeliveryAddress = (address: ShipmentAddress): void => { + this.repository.getDeliveryAddressSelect().select(NEW_ADDRESS_CHOICE); + this.repository.getSalutationSelect().select(address.salutation); + this.repository.getFirstNameField().clear().type(address.firstName); + this.repository.getLastNameField().clear().type(address.lastName); + this.repository.getEmailField().clear().type(address.email); + this.repository.getCountrySelect().select(address.country); + this.repository.getAddress1Field().clear().type(address.address1); + this.repository.getAddress2Field().clear().type(address.address2); + this.repository.getCityField().clear().type(address.city); + this.repository.getZipCodeField().clear().type(address.zipCode); + }; + + // Every option reads " - ", and the order detail page prints the two halves on + // separate lines, so only the method half is yielded for checking the Shipping Method line. The + // select also carries an empty placeholder option, which is never picked. + selectShipmentMethod = (position: ShipmentMethodPosition): Cypress.Chainable => + this.repository + .getShipmentMethodSelect() + .find('option') + .then(($options: JQuery): Cypress.Chainable => { + const selectableOptions = $options.filter((_index: number, option: HTMLOptionElement) => option.value !== ''); + const option = position === 'first' ? selectableOptions.first() : selectableOptions.last(); + + this.repository.getShipmentMethodSelect().select(option.val() as string); + + return cy.wrap(option.text().trim().split(SHIPMENT_METHOD_OPTION_SEPARATOR).pop() as string); + }); + + assignOrderItem = (sku: string): void => { + this.repository.getOrderItemCheckbox(sku).check(); + }; + + save = (): void => { + this.repository.getSaveButton().click(); + }; +} + +export type ShipmentMethodPosition = 'first' | 'last'; + +export interface ShipmentAddress { + salutation: string; + firstName: string; + lastName: string; + email: string; + country: string; + address1: string; + address2: string; + city: string; + zipCode: string; +} diff --git a/cypress/support/pages/backoffice/sales-shipment/form/sales-shipment-form-repository.ts b/cypress/support/pages/backoffice/sales-shipment/form/sales-shipment-form-repository.ts new file mode 100644 index 000000000..1b20ab913 --- /dev/null +++ b/cypress/support/pages/backoffice/sales-shipment/form/sales-shipment-form-repository.ts @@ -0,0 +1,27 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +const FIELD_ID_PREFIX = 'shipment_group_form_shipment'; + +@injectable() +@autoWired +export class SalesShipmentFormRepository { + getDeliveryAddressSelect = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_idCustomerAddress`); + getSalutationSelect = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_salutation`); + getFirstNameField = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_firstName`); + getLastNameField = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_lastName`); + getEmailField = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_email`); + getCountrySelect = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_iso2Code`); + getAddress1Field = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_address1`); + getAddress2Field = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_address2`); + getCityField = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_city`); + getZipCodeField = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_shippingAddress_zipCode`); + getShipmentMethodSelect = (): Cypress.Chainable => cy.get(`#${FIELD_ID_PREFIX}_method_idShipmentMethod`); + + // The form lists every item of the order with a checkbox, so an item joins the shipment being + // saved by having its own row's box checked. + getOrderItemCheckbox = (sku: string): Cypress.Chainable => + cy.get(`table[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) td.item-checker input`); + + getSaveButton = (): Cypress.Chainable => cy.get('input[type="submit"][value="Save"]'); +} diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts index 6be9102e6..dd4949543 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-page.ts @@ -3,6 +3,12 @@ import { inject, injectable } from 'inversify'; import { BackofficePage } from '@pages/backoffice'; import { SalesDetailRepository } from './sales-detail-repository'; +const OMS_CONSOLE_COMMANDS = ['console oms:check-condition', 'console oms:check-timeout']; + +const OMS_RELOAD_ATTEMPTS = 25; + +const OMS_RELOAD_INTERVAL_MS = 5000; + @injectable() @autoWired export class SalesDetailPage extends BackofficePage { @@ -19,26 +25,17 @@ export class SalesDetailPage extends BackofficePage { } if (params.shouldTriggerOmsInCli) { - cy.runCliCommands(['console oms:check-condition', 'console oms:check-timeout']); + cy.runCliCommands(OMS_CONSOLE_COMMANDS); } cy.url().then((url) => { - // a workaround for running tests on envs with basic auth (e.g. smoke tests on SE envs) - // because basic auth should be included into the url but the current url returned by cy.url() does not have basic auth credentials - const currentUrl = new URL(url); - const targetUrl = new URL(Cypress.env('backofficeUrl')); - - targetUrl.pathname = currentUrl.pathname; - targetUrl.search = currentUrl.search; - const normalizedUrl = targetUrl.toString(); - cy.reloadUntilFound( - normalizedUrl, + this.buildBackofficeUrl(url), this.repository.getOmsButtonSelector(params.state), this.repository.getTriggerOmsDivSelector(), - 25, - 5000, - params.shouldTriggerOmsInCli ? ['console oms:check-condition', 'console oms:check-timeout'] : [] + OMS_RELOAD_ATTEMPTS, + OMS_RELOAD_INTERVAL_MS, + params.shouldTriggerOmsInCli ? OMS_CONSOLE_COMMANDS : [] ); cy.get(this.repository.getTriggerOmsDivSelector()) @@ -47,6 +44,23 @@ export class SalesDetailPage extends BackofficePage { }); }; + triggerOmsForOrderItem = (params: TriggerOmsForOrderItemParams): void => { + const buttonSelector = this.repository.getOrderItemOmsButtonSelector(params.sku, params.state); + + cy.url().then((url) => { + cy.reloadUntilFound( + this.buildBackofficeUrl(url), + buttonSelector, + 'body', + OMS_RELOAD_ATTEMPTS, + OMS_RELOAD_INTERVAL_MS, + OMS_CONSOLE_COMMANDS + ); + + cy.get(buttonSelector).click(); + }); + }; + create = (): void => { this.repository.getReturnButton().click(); }; @@ -58,9 +72,77 @@ export class SalesDetailPage extends BackofficePage { getTotalRefundedCommissionBlock = (): Cypress.Chainable> => { return cy.contains('Total Refunded Commission').parent().parent().parent(); }; + + // Returned in the same minor units the item and refund amounts publish on their raw attributes, + // so the three are directly comparable. The back office formats money for its own locale, which + // is en_US here, so the group separator is the one character dropped besides the currency symbol. + getGrandTotal = (): Cypress.Chainable => + this.repository + .getGrandTotalValue() + .invoke('text') + .then((text: string) => Math.round(Number(text.replace(/[^0-9.]/g, '')) * 100)); + + createShipment = (): void => { + this.repository.getCreateShipmentLink().first().click(); + }; + + editShipment = (shipmentNumber: number): void => { + this.repository + .getEditShipmentLinks() + .eq(shipmentNumber - 1) + .click(); + }; + + getShipmentShippingMethods = (): Cypress.Chainable => this.repository.getShipmentShippingMethods(); + + // One shipment's own item table. ShipmentGui renders them in the order the shipments are numbered + // on the page, so the nth table is the nth shipment. + getShipmentItemTable = (shipmentNumber: number): Cypress.Chainable => + this.repository.getOrderItemTables().eq(shipmentNumber - 1); + + getOrderItemTables = (): Cypress.Chainable => this.repository.getOrderItemTables(); + + getShipmentDeliveryAddresses = (): Cypress.Chainable => this.repository.getShipmentDeliveryAddresses(); + + getOrderComments = (): Cypress.Chainable => this.repository.getOrderComments(); + + waitForOrderItemState = (params: WaitForOrderItemStateParams): void => { + cy.url().then((url) => { + cy.reloadUntilFound( + this.buildBackofficeUrl(url), + this.repository.getOrderItemStateSelector(params.state, params.sku), + 'body', + OMS_RELOAD_ATTEMPTS, + OMS_RELOAD_INTERVAL_MS, + OMS_CONSOLE_COMMANDS + ); + }); + }; + + // cy.url() drops the basic-auth credentials that SE envs need, so the path is re-hung on the + // configured back-office base url rather than reloaded as-is. + private buildBackofficeUrl = (url: string): string => { + const currentUrl = new URL(url); + const targetUrl = new URL(Cypress.env('backofficeUrl')); + + targetUrl.pathname = currentUrl.pathname; + targetUrl.search = currentUrl.search; + + return targetUrl.toString(); + }; } interface TriggerOmsParams { state: string; shouldTriggerOmsInCli?: boolean; } + +interface TriggerOmsForOrderItemParams { + sku: string; + state: string; +} + +interface WaitForOrderItemStateParams { + state: string; + sku: string; +} diff --git a/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts index 524e75288..4cccca0c8 100644 --- a/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts +++ b/cypress/support/pages/backoffice/sales/detail/sales-detail-repository.ts @@ -7,4 +7,47 @@ export class SalesDetailRepository { getTriggerOmsDivSelector = (): string => '.col-md-12 > .row > .col-lg-12 > .ibox > .ibox-content'; getOmsButtonSelector = (action: string): string => `button:contains("${action}")`; getReturnButton = (): Cypress.Chainable => cy.get('.title-action').find('a:contains("Return")'); + + // ShipmentGui renders one of these tables per shipment on the order detail page, so the count + // of them is the order's shipment count. + getOrderItemTables = (): Cypress.Chainable => cy.get('[data-qa="order-item-list"]'); + + // Unlike the item and refund amounts, Sales renders the order's totals money-formatted with no + // raw attribute. The grand total is the second bold figure of the first row in .grandTotal-row, + // the first being its label. + getGrandTotalValue = (): Cypress.Chainable => cy.get('.grandTotal-row .row').first().find('b').last(); + + // ShipmentGui hangs the create link off the Order Items box and one edit link off each shipment, + // both routed to its own controller, so the href is what identifies them. + getCreateShipmentLink = (): Cypress.Chainable => cy.get('a[href*="/shipment-gui/create"]'); + getEditShipmentLinks = (): Cypress.Chainable => cy.get('a[href*="/shipment-gui/edit"]'); + + // ShipmentGui prints a shipment's method as a plain

led by a bold "Shipping Method:" label, + // the carrier separately under "Delivery Method:", neither with a data-qa of its own. + getShipmentShippingMethods = (): Cypress.Chainable => cy.get('p:has(b:contains("Shipping Method"))'); + + // ShipmentGui prints the shipment's address as a plain

led by a bold "Delivery Address:" + // label, with no data-qa of its own, so the label is what identifies it. + getShipmentDeliveryAddresses = (): Cypress.Chainable => cy.get('p:has(b:contains("Delivery Address"))'); + + // The comments a customer wrote on the cart reach the back office through CommentSalesConnector, + // which renders them in .comment-wrapper. Not to be confused with Sales' own .order-details-chat: + // that box reads spy_sales_order_comment, a separate system a storefront comment never lands in. + getOrderComments = (): Cypress.Chainable => cy.get('.comment-wrapper'); + + // The non-marketplace shops render each item's manual events in a .oms-trigger-form, the + // marketplace ones in a named event_item_trigger_form, so a row's event button is looked up + // under both. Triggering per item is what leaves the order's other items where they were. + getOrderItemOmsButtonSelector = (sku: string, state: string): string => + ['form.oms-trigger-form', 'form[name="event_item_trigger_form"]'] + .map( + (form) => + `[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) ${form} button:contains("${state}")` + ) + .join(', '); + + // The state cell renders the current state as a link to the state-machine drawing and the + // superseded states as plain divs below it, so the link text is the state the item is in now. + getOrderItemStateSelector = (state: string, sku: string): string => + `[data-qa="order-item-list"] tbody tr:has(div.sku:contains("${sku}")) td.state-history a:contains("${state}")`; } diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts index c706a16aa..293b67a48 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-page.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-page.ts @@ -14,6 +14,20 @@ export class SalesIndexPage extends BackofficePage { this.repository.getViewButtons().first().click(); }; + /** + * Opens a named order rather than the newest one. The shards run concurrently against one + * application, so the first row of the sales table is not reliably this test's order. + */ + viewByReference = (orderReference: string): void => { + this.find({ searchQuery: orderReference, interceptTableUrl: '**/sales/index/table**' }).then((getRow) => { + if (!getRow) { + return; + } + + getRow().find(this.repository.getViewButtonSelector()).first().click({ force: true }); + }); + }; + getOrderReference = (): Cypress.Chainable => { cy.get('dt').contains('Order Reference').next('dd').invoke('text').as('orderReference'); diff --git a/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts index 921f5cc39..65c0759fb 100644 --- a/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts +++ b/cypress/support/pages/backoffice/sales/index/sales-index-repository.ts @@ -5,4 +5,5 @@ import { injectable } from 'inversify'; @autoWired export class SalesIndexRepository { getViewButtons = (): Cypress.Chainable => cy.get('.btn-view'); + getViewButtonSelector = (): string => '.btn-view'; } diff --git a/cypress/support/pages/backoffice/store/edit/store-edit-page.ts b/cypress/support/pages/backoffice/store/edit/store-edit-page.ts new file mode 100644 index 000000000..d968f2bad --- /dev/null +++ b/cypress/support/pages/backoffice/store/edit/store-edit-page.ts @@ -0,0 +1,21 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; + +import { BackofficePage } from '@pages/backoffice'; +import { StoreEditRepository } from './store-edit-repository'; + +@injectable() +@autoWired +export class StoreEditPage extends BackofficePage { + @inject(StoreEditRepository) private repository: StoreEditRepository; + + protected PAGE_URL = '/store-gui/edit'; + + getDefaultLocaleSelect = (): Cypress.Chainable => this.repository.getDefaultLocaleSelect(); + + getDefaultCurrencySelect = (): Cypress.Chainable => this.repository.getDefaultCurrencySelect(); + + // The checkbox is added by a store form expander that only renders while the store table carries + // the visibility column, which is opt-in per project. + getVisibleToCustomerCheckbox = (): Cypress.Chainable => this.repository.getVisibleToCustomerCheckbox(); +} diff --git a/cypress/support/pages/backoffice/store/edit/store-edit-repository.ts b/cypress/support/pages/backoffice/store/edit/store-edit-repository.ts new file mode 100644 index 000000000..82d6c0c10 --- /dev/null +++ b/cypress/support/pages/backoffice/store/edit/store-edit-repository.ts @@ -0,0 +1,10 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class StoreEditRepository { + getDefaultLocaleSelect = (): Cypress.Chainable => cy.get('[name="store[defaultLocaleIsoCode]"]'); + getDefaultCurrencySelect = (): Cypress.Chainable => cy.get('[name="store[defaultCurrencyIsoCode]"]'); + getVisibleToCustomerCheckbox = (): Cypress.Chainable => cy.get('[name="store[isVisibleToCustomer]"]'); +} diff --git a/cypress/support/pages/backoffice/store/list/store-list-page.ts b/cypress/support/pages/backoffice/store/list/store-list-page.ts index b30099b83..c589ef6a6 100644 --- a/cypress/support/pages/backoffice/store/list/store-list-page.ts +++ b/cypress/support/pages/backoffice/store/list/store-list-page.ts @@ -32,6 +32,12 @@ export class StoreListPage extends BackofficePage { ); }; + // Opens a store from the rows the table shows now, so it follows hasStore(), which leaves the table + // filtered down to that store. + editListedStore = (storeName: string): void => { + cy.contains(this.repository.getTableRowSelector(), storeName).find(this.repository.getEditButtonSelector()).click(); + }; + hasStore = (storeName: string): Cypress.Chainable => { // Existence check only — read the real row count, never assert a band on a precondition. diff --git a/cypress/support/pages/backoffice/store/list/store-list-repository.ts b/cypress/support/pages/backoffice/store/list/store-list-repository.ts index ce903ab8b..3ea06f6cb 100644 --- a/cypress/support/pages/backoffice/store/list/store-list-repository.ts +++ b/cypress/support/pages/backoffice/store/list/store-list-repository.ts @@ -9,4 +9,5 @@ export class StoreListRepository { getViewButtonSelector = (): string => 'a:contains("View Store")'; getFirstTableRow = (): Cypress.Chainable => cy.get('tbody > :nth-child(1):visible'); getSearchSelector = (): string => '[data-qa="table-search"]'; + getTableRowSelector = (): string => 'tbody > tr'; } diff --git a/cypress/support/pages/backoffice/user/update/user-update-page.ts b/cypress/support/pages/backoffice/user/update/user-update-page.ts index da52523bf..0bb1daef0 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-page.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-page.ts @@ -29,6 +29,11 @@ export class UserUpdatePage extends BackofficePage { return this.repository.getAgentCustomerCheckbox(); }; + checkWarehouseUserCheckbox = (): void => { + this.repository.getWarehouseUserCheckbox().check(); + this.repository.getUpdateUserButton().click(); + }; + setDefaultPassword = (): void => { this.repository.getPasswordInput().clear().type(this.DEFAULT_PASSWORD); this.repository.getRepeatPasswordInput().clear().type(this.DEFAULT_PASSWORD); diff --git a/cypress/support/pages/backoffice/user/update/user-update-repository.ts b/cypress/support/pages/backoffice/user/update/user-update-repository.ts index f1f0de3ad..7e593cfa3 100644 --- a/cypress/support/pages/backoffice/user/update/user-update-repository.ts +++ b/cypress/support/pages/backoffice/user/update/user-update-repository.ts @@ -6,6 +6,7 @@ import { injectable } from 'inversify'; export class UserUpdateRepository { getAgentMerchantCheckbox = (): Cypress.Chainable => cy.get('#user_is_merchant_agent'); getAgentCustomerCheckbox = (): Cypress.Chainable => cy.get('#user_is_agent'); + getWarehouseUserCheckbox = (): Cypress.Chainable => cy.get('#user_is_warehouse_user'); getUpdateUserButton = (): Cypress.Chainable => cy.get('form[name=user]').find('[type="submit"]'); getPasswordInput = (): Cypress.Chainable => cy.get('#user_password_first'); getRepeatPasswordInput = (): Cypress.Chainable => cy.get('#user_password_second'); diff --git a/cypress/support/pages/mp/account/account-page.ts b/cypress/support/pages/mp/account/account-page.ts index 069c3bca5..26ee51181 100644 --- a/cypress/support/pages/mp/account/account-page.ts +++ b/cypress/support/pages/mp/account/account-page.ts @@ -11,6 +11,15 @@ export class AccountPage extends MpPage { protected PAGE_URL = '/user-merchant-portal-gui/my-account'; + // The portal renders this page from its Angular bundle after the server response, and the form + // fields appear only once that has parsed. There is no request to wait on, so this settles first. + visitAccount = (): void => { + this.visit(); + + // eslint-disable-next-line cypress/no-unnecessary-waiting, spryker-cypress/no-numeric-wait + cy.wait(6000); + }; + openChangePasswordForm = (): void => { this.repository.getChangePasswordButton().click(); }; diff --git a/cypress/support/pages/mp/account/account-repository.ts b/cypress/support/pages/mp/account/account-repository.ts index 5b69c31a7..d64111d62 100644 --- a/cypress/support/pages/mp/account/account-repository.ts +++ b/cypress/support/pages/mp/account/account-repository.ts @@ -4,19 +4,20 @@ import { injectable } from 'inversify'; @injectable() @autoWired export class AccountRepository { - getChangePasswordButton = (): Cypress.Chainable => cy.get('web-spy-button-action[action*="change-password"] button'); + getChangePasswordButton = (): Cypress.Chainable => + cy.get('web-spy-button-action[action*="change-password"] button', { timeout: 20000 }); getDefaultPasswordInput = (): Cypress.Chainable => - cy.get('input[name="security-merchant-portal-gui_change-password[current_password]"]'); + cy.get('input[name="security-merchant-portal-gui_change-password[current_password]"]', { timeout: 20000 }); getNewPasswordInput = (): Cypress.Chainable => - cy.get('input[name="security-merchant-portal-gui_change-password[new_password][first]"]'); + cy.get('input[name="security-merchant-portal-gui_change-password[new_password][first]"]', { timeout: 20000 }); getConfirmPasswordInput = (): Cypress.Chainable => - cy.get('input[name="security-merchant-portal-gui_change-password[new_password][second]"]'); + cy.get('input[name="security-merchant-portal-gui_change-password[new_password][second]"]', { timeout: 20000 }); getSubmitButton = (): Cypress.Chainable => - cy.get('[name="security-merchant-portal-gui_change-password[save]"] button[type="submit"]'); + cy.get('[name="security-merchant-portal-gui_change-password[save]"] button[type="submit"]', { timeout: 20000 }); getPasswordChangedMessage = (): string => 'Success! The Password is updated.'; } diff --git a/cypress/support/pages/mp/mp-page.ts b/cypress/support/pages/mp/mp-page.ts index 7640a80c3..9d24ee1c3 100644 --- a/cypress/support/pages/mp/mp-page.ts +++ b/cypress/support/pages/mp/mp-page.ts @@ -31,6 +31,86 @@ export class MpPage extends AbstractPage { assert.isTrue(total === expectedCount || total >= valueToBeAtMost); }); }; + + /** + * ng-zorro renders an open dropdown into the page-level overlay container, and an option only + * reaches the Angular form when it is picked there — writing the native mirror select leaves the + * control empty on save. + */ + protected getSelectOption = (optionText: string): Cypress.Chainable => + cy.get('.ant-select-dropdown:visible .ant-select-item-option').contains(optionText); + + protected selectOption = (select: Cypress.Chainable, optionText: string): void => { + select.click(); + this.getSelectOption(optionText).click(); + }; + + // A multiple select keeps its dropdown open between picks, so it is opened once and dismissed + // afterwards rather than re-opened per value. + protected selectOptions = (select: Cypress.Chainable, optionTexts: string[]): void => { + select.click(); + + optionTexts.forEach((optionText) => { + this.getSelectOption(optionText).click(); + }); + + cy.get('body').type('{esc}'); + }; + + /** + * The Merchant Portal renders abstract-product prices and offer prices with the same editable + * table, so the deletion mechanics are shared and only the selectors and the endpoint differ. + */ + protected deletePriceTableRow = (params: DeletePriceTableRowParams): void => { + cy.intercept('GET', params.deleteUrlPattern).as('priceRowDeleted'); + + // The price columns are configured server-side, so the quantity column is located by its + // heading rather than by a position that a configuration change would silently move. + params.getMatchColumnHeaderCell().then(($headerCell: JQuery) => { + const columnIndex = $headerCell.index(); + + params + .getRows() + .filter((_rowIndex, row) => params.isMatchingCell(Cypress.$(row).find('td').eq(columnIndex).text().trim()), { + timeout: PRICE_TABLE_TIMEOUT, + }) + .find(params.rowActionTriggerSelector, { timeout: PRICE_TABLE_TIMEOUT }) + .click(); + }); + + params.getActionItem(DELETE_ACTION_TITLE).click(); + + cy.wait('@priceRowDeleted'); + }; + + protected getPriceTableRowsByCell = (params: FindPriceTableRowsParams): Cypress.Chainable => + params.getMatchColumnHeaderCell().then(($headerCell: JQuery) => { + const columnIndex = $headerCell.index(); + + return params + .getRows() + .filter((_rowIndex, row) => params.isMatchingCell(Cypress.$(row).find('td').eq(columnIndex).text().trim())); + }); +} + +// The Angular bundle paints the table well after page load, and re-renders it once more when the +// row actions arrive. +const PRICE_TABLE_TIMEOUT = 20000; +const DELETE_ACTION_TITLE = 'Delete'; + +interface DeletePriceTableRowParams { + getMatchColumnHeaderCell: () => Cypress.Chainable; + getRows: () => Cypress.Chainable; + getActionItem: (title: string) => Cypress.Chainable; + isMatchingCell: (cellText: string) => boolean; + rowActionTriggerSelector: string; + deleteUrlPattern: string; +} + +interface FindPriceTableRowsParams { + getMatchColumnHeaderCell: () => Cypress.Chainable; + getRows: () => Cypress.Chainable; + isMatchingCell: (cellText: string) => boolean; } export enum ActionEnum { diff --git a/cypress/support/pages/mp/offers/offers-page.ts b/cypress/support/pages/mp/offers/offers-page.ts index fb9e8e457..0ada1c6ab 100644 --- a/cypress/support/pages/mp/offers/offers-page.ts +++ b/cypress/support/pages/mp/offers/offers-page.ts @@ -25,6 +25,11 @@ export class OffersPage extends MpPage { return this.repository.getFirstTableRow(); }; + openOffer = (params: FindParams): void => { + this.visit(); + this.find(params).click({ force: true }); + }; + getDrawer = (): Cypress.Chainable => { return this.repository.getDrawer(); }; @@ -32,6 +37,105 @@ export class OffersPage extends MpPage { getSaveButtonSelector = (): string => { return this.repository.getSaveButtonSelector(); }; + + // Picking a chosen value again deselects it. Not every Merchant Portal renders the chosen stores as removable + // tags (B2C marketplace shows them as one comma-joined label), so the dropdown is what both share. + removeStores = (storeNames: string[]): void => { + this.selectOptions(this.repository.getStoresSelect(), storeNames); + }; + + saveOffer = (): void => { + cy.intercept('POST', this.repository.getUpdateOfferUrlPattern()).as('offerUpdated'); + this.repository.getDrawer().find(this.repository.getSaveButtonSelector()).click(); + cy.wait('@offerUpdated'); + }; + + // Creating an offer runs in two steps: choosing the product it is offered on, then filling the + // offer's own form, whose price table is the same editable table the offer drawer uses. + createOffer = (params: CreateOfferParams): void => { + cy.intercept('POST', '**/product-offer-merchant-portal-gui/create-product-offer**').as('offerCreated'); + + this.repository.getAddOfferButton().click(); + + // The product table has to have narrowed to the searched sku before a row is picked, or the + // offer is created on whichever product the unfiltered list happened to list first. The table + // can still show the unfiltered rows when the response has arrived, so the row is picked by its sku. + this.interceptTable({ url: '/product-offer-merchant-portal-gui/product-list/table-data**', expectedCount: 1 }, () => + this.repository.getProductSearchInput().type(`${params.concreteSku}{enter}`) + ); + this.repository.getProductRows().filter(`:contains("${params.concreteSku}")`).first().click(); + + this.repository.getMerchantSkuInput().type(params.merchantSku); + this.repository.getIsActiveLabel().click(); + this.selectOptions(this.repository.getStoresSelect(), [params.storeName]); + this.repository.getStockQuantityInput().clear().type(String(params.stockQuantity)); + + this.repository.getPriceTableAddButton().click(); + this.repository.getPriceTableHeaderCells().then(($headerCells: JQuery) => { + const columnIndexOf = (title: string): number => + Array.from($headerCells).findIndex((headerCell) => Cypress.$(headerCell).text().trim() === title); + + this.selectInEditableRow(columnIndexOf(STORE_COLUMN_TITLE), params.storeName); + this.selectInEditableRow(columnIndexOf(CURRENCY_COLUMN_TITLE), params.currency); + this.typeInEditableRow(columnIndexOf(NET_DEFAULT_COLUMN_TITLE), params.netAmount); + this.typeInEditableRow(columnIndexOf(GROSS_DEFAULT_COLUMN_TITLE), params.grossAmount); + }); + + this.repository.getCreateOfferButton().click(); + + cy.wait('@offerCreated'); + }; + + private selectInEditableRow = (columnIndex: number, optionText: string): void => { + this.selectOption( + this.repository.getEditableRowCell(columnIndex).find(this.repository.getEditableSelectSelector()), + optionText + ); + }; + + private typeInEditableRow = (columnIndex: number, amount: number): void => { + this.repository + .getEditableRowCell(columnIndex) + .find(this.repository.getNumberInputSelector()) + .type(String(amount), { force: true }); + }; + + getPriceRowsByQuantity = (params: PriceRowParams): Cypress.Chainable => + this.getPriceTableRowsByCell({ + getMatchColumnHeaderCell: this.repository.getPriceTableQuantityHeaderCell, + getRows: this.repository.getPriceTableRows, + isMatchingCell: (cellText) => cellText === String(params.quantity), + }); + + deletePriceRowByQuantity = (params: PriceRowParams): void => { + this.deletePriceTableRow({ + getMatchColumnHeaderCell: this.repository.getPriceTableQuantityHeaderCell, + getRows: this.repository.getPriceTableRows, + getActionItem: this.repository.getRowActionItem, + isMatchingCell: (cellText) => cellText === String(params.quantity), + rowActionTriggerSelector: this.repository.getRowActionTriggerSelector(), + deleteUrlPattern: this.repository.getDeletePriceUrlPattern(), + }); + }; +} + +const STORE_COLUMN_TITLE = 'Store'; +const CURRENCY_COLUMN_TITLE = 'Currency'; +const NET_DEFAULT_COLUMN_TITLE = 'Net Default'; +const GROSS_DEFAULT_COLUMN_TITLE = 'Gross Default'; + +interface CreateOfferParams { + concreteSku: string; + merchantSku: string; + storeName: string; + currency: string; + netAmount: number; + grossAmount: number; + stockQuantity: number; +} + +interface PriceRowParams { + quantity: number; } interface FindParams { diff --git a/cypress/support/pages/mp/offers/offers-repository.ts b/cypress/support/pages/mp/offers/offers-repository.ts index eb6d2fc0b..b73c03b84 100644 --- a/cypress/support/pages/mp/offers/offers-repository.ts +++ b/cypress/support/pages/mp/offers/offers-repository.ts @@ -8,4 +8,54 @@ export class OffersRepository { getSearchSelector = (): string => '.spy-table-search-feature input[type="text"]'; getSaveButtonSelector = (): string => 'button:contains("Save")'; getDrawer = (): Cypress.Chainable => cy.get('.spy-drawer-wrapper'); + + // Waiting on the heading itself is what proves the price table has finished rendering; the + // Angular bundle paints a skeleton header first. + getPriceTableQuantityHeaderCell = (): Cypress.Chainable => + cy.contains('web-mp-offer-prices-table thead th', 'Volume Quantity', { timeout: 20000 }); + + getPriceTableRows = (): Cypress.Chainable => + cy.get('web-mp-offer-prices-table tbody.ant-table-tbody tr.ant-table-row', { timeout: 20000 }); + + getRowActionTriggerSelector = (): string => '.ant-table-row-actions-feature .ant-dropdown-trigger'; + + // The row-action menu is rendered into the page-level overlay container, not inside the row. + getRowActionItem = (title: string): Cypress.Chainable => + cy.get('.ant-dropdown-menu:visible li.ant-dropdown-menu-item').contains(title); + + getDeletePriceUrlPattern = (): string => '**/product-offer-merchant-portal-gui/delete-price-product-offer**'; + + getAddOfferButton = (): Cypress.Chainable => cy.contains('a, button', 'Add Offer'); + + getProductSearchInput = (): Cypress.Chainable => + cy.get('input[placeholder="Search by SKU, Name"]', { timeout: 20000 }); + + getProductRows = (): Cypress.Chainable => cy.get('tbody.ant-table-tbody tr.ant-table-row', { timeout: 20000 }); + + getMerchantSkuInput = (): Cypress.Chainable => cy.get('input[name="productOffer[merchantSku]"]', { timeout: 20000 }); + + // The checkbox only reaches the Angular form when its own label is clicked. + getIsActiveLabel = (): Cypress.Chainable => + cy.get('web-spy-checkbox[name="productOffer[isActive]"] label.ant-checkbox-wrapper'); + + getStoresSelect = (): Cypress.Chainable => + cy.get('web-spy-select[name="productOffer[stores][]"] nz-select-top-control'); + + getUpdateOfferUrlPattern = (): string => '**/product-offer-merchant-portal-gui/update-product-offer**'; + + getStockQuantityInput = (): Cypress.Chainable => cy.get('input[name="productOffer[productOfferStocks][quantity]"]'); + + getPriceTableAddButton = (): Cypress.Chainable => cy.get('web-mp-offer-prices-table button:contains("Add")'); + + getPriceTableHeaderCells = (): Cypress.Chainable => cy.get('web-mp-offer-prices-table thead th', { timeout: 20000 }); + + // A row being added or edited is inserted at the top of the price table. + getEditableRowCell = (columnIndex: number): Cypress.Chainable => + this.getPriceTableRows().first().find('td').eq(columnIndex); + + getEditableSelectSelector = (): string => 'nz-select-top-control'; + + getNumberInputSelector = (): string => 'input[type="number"]'; + + getCreateOfferButton = (): Cypress.Chainable => cy.contains('web-mp-edit-offer button', 'Create'); } diff --git a/cypress/support/pages/mp/products/products-page.ts b/cypress/support/pages/mp/products/products-page.ts index 4da2b81c9..1ff079eff 100644 --- a/cypress/support/pages/mp/products/products-page.ts +++ b/cypress/support/pages/mp/products/products-page.ts @@ -11,20 +11,34 @@ export class ProductsPage extends MpPage { protected PAGE_URL = '/product-merchant-portal-gui/products'; + // The search request fires on enter, so the intercept is registered before the key is pressed — + // pressing first races the response and the wait then never sees a request at all. find = (params: FindParams): Cypress.Chainable => { const searchSelector = this.repository.getSearchSelector(); cy.get(searchSelector).clear(); cy.get(searchSelector).type(params.query, { delay: 0 }); - cy.get(searchSelector).type('{enter}'); - this.interceptTable({ - url: '/product-merchant-portal-gui/products/table-data**', - expectedCount: params.expectedCount, - }); + this.interceptTable( + { + url: '/product-merchant-portal-gui/products/table-data**', + expectedCount: params.expectedCount, + }, + () => { + cy.get(searchSelector).type('{enter}'); + } + ); return this.repository.getFirstTableRow(); }; + // Saving an abstract product closes its drawer, so every stage of a journey opens it again. The + // search is typed only once the unfiltered table has rendered, or the input is not there yet. + openProduct = (params: FindParams): void => { + this.visit(); + this.repository.getFirstTableRow(); + this.find(params).click(); + }; + getFirstTableRow = (): Cypress.Chainable => { return this.repository.getFirstTableRow(); }; @@ -80,6 +94,183 @@ export class ProductsPage extends MpPage { selectTaxIdSetOption = (value: string | number | string[]): Cypress.Chainable => cy.get(this.repository.getTaxIdSelector()).select(value, { force: true }); + + // The create wizard runs in two steps: naming the abstract product, then choosing the super + // attribute whose values become its concrete products. + createMultiConcreteProduct = (params: CreateMultiConcreteProductParams): void => { + cy.intercept('POST', '**/product-merchant-portal-gui/create-product-abstract**').as('abstractProductCreated'); + + this.repository.getCreateProductButton().click(); + this.repository.getCreateProductSkuInput().type(params.sku); + this.repository.getCreateProductNameInput().type(params.name); + this.repository.getMultipleConcretesRadioLabel().click(); + this.repository.getWizardNextButton().click(); + + this.selectOption(this.repository.getSuperAttributeSelect(), params.attributeName); + this.selectOptions(this.repository.getSuperAttributeValuesSelect(), params.attributeValues); + + this.repository.getAddConcretesButton().click(); + this.repository.getWizardCreateButton().click(); + + cy.wait('@abstractProductCreated'); + }; + + openConcreteProductsTab = (): void => { + this.repository.getConcreteProductsTab().click(); + }; + + // The overlay offers the attribute values that have no concrete product yet, and creates one per + // value that is picked. + addConcreteProducts = (params: AddConcreteProductsParams): void => { + cy.intercept('POST', '**/product-merchant-portal-gui/add-product-concrete**').as('concreteProductsAdded'); + + this.repository.getAddConcreteProductsButton().click(); + this.selectOptions(this.repository.getConcreteAttributeValuesSelect(), params.attributeValues); + this.repository.getCreateConcreteProductsButton().click(); + + cy.wait('@concreteProductsAdded'); + }; + + // A concrete added through the overlay gets an autogenerated sku, so its row is found by the + // super-attribute value that distinguishes it. + openConcreteProduct = (params: OpenConcreteProductParams): void => { + this.repository.getVariantRows().filter(`:contains("${params.rowText}")`).first().click(); + }; + + // A concrete product has to be named in every locale before it can be saved, and taking the + // abstract product's name is what the merchant does rather than retyping it per locale. Without a + // searchable locale the product never reaches the storefront catalog. + activateConcreteProduct = (params: ActivateConcreteProductParams): void => { + this.repository.getConcreteIsActiveLabel().click(); + this.repository.getConcreteStockQuantityInput().clear().type(String(params.stockQuantity)); + this.repository.getUseAbstractProductNameLabel().click(); + this.selectOptions(this.repository.getSearchabilitySelect(), params.searchableLocales); + }; + + sendForApproval = (): void => { + this.repository.getSendForApprovalButton().click(); + }; + + // A row added to the price table is submitted with the abstract product form, not on its own. + addPriceRow = (params: AddPriceRowParams): void => { + cy.intercept('POST', '**/product-merchant-portal-gui/update-product-abstract**').as('abstractProductSaved'); + + this.repository.getPriceTableAddButton().click(); + + this.repository.getPriceTableHeaderCells().then(($headerCells: JQuery) => { + const columnIndexOf = (title: string): number => + Array.from($headerCells).findIndex((headerCell) => Cypress.$(headerCell).text().trim() === title); + + // The customer options are labelled ' - ', and the + // id is only known once the relation has been created. + if (params.customerBusinessUnitName) { + this.selectInEditableRow(columnIndexOf(CUSTOMER_COLUMN_TITLE), params.customerBusinessUnitName); + } + + this.selectInEditableRow(columnIndexOf(STORE_COLUMN_TITLE), params.storeName); + this.selectInEditableRow(columnIndexOf(CURRENCY_COLUMN_TITLE), params.currency); + this.typeInEditableRow(columnIndexOf(NET_DEFAULT_COLUMN_TITLE), params.netAmount); + this.typeInEditableRow(columnIndexOf(GROSS_DEFAULT_COLUMN_TITLE), params.grossAmount); + }); + + this.save(); + + cy.wait('@abstractProductSaved'); + }; + + // The cell renders an Angular select whose options only reach the form when they are picked from + // its own dropdown; writing the native mirror select leaves the row empty on save. + private selectInEditableRow = (columnIndex: number, optionText: string): void => { + this.selectOption( + this.repository.getEditableRowCell(columnIndex).find(this.repository.getEditableSelectSelector()), + optionText + ); + }; + + private typeInEditableRow = (columnIndex: number, amount: number): void => { + this.repository + .getEditableRowCell(columnIndex) + .find(this.repository.getNumberInputSelector()) + .type(String(amount), { force: true }); + }; + + deletePriceRowByQuantity = (params: PriceRowParams): void => { + this.deletePriceTableRow({ + getMatchColumnHeaderCell: this.repository.getPriceTableQuantityHeaderCell, + getRows: this.repository.getPriceTableRows, + getActionItem: this.repository.getRowActionItem, + isMatchingCell: (cellText) => cellText === String(params.quantity), + rowActionTriggerSelector: this.repository.getRowActionTriggerSelector(), + deleteUrlPattern: this.repository.getDeletePriceUrlPattern(), + }); + }; + + getPriceRowsByQuantity = (params: PriceRowParams): Cypress.Chainable => + this.getPriceTableRowsByCell({ + getMatchColumnHeaderCell: this.repository.getPriceTableQuantityHeaderCell, + getRows: this.repository.getPriceTableRows, + isMatchingCell: (cellText) => cellText === String(params.quantity), + }); + + deletePriceRowByCustomer = (params: CustomerPriceRowParams): void => { + this.deletePriceTableRow({ + getMatchColumnHeaderCell: this.repository.getPriceTableCustomerHeaderCell, + getRows: this.repository.getPriceTableRows, + getActionItem: this.repository.getRowActionItem, + // The customer cell reads ' - '. + isMatchingCell: (cellText) => cellText.includes(params.customerBusinessUnitName), + rowActionTriggerSelector: this.repository.getRowActionTriggerSelector(), + deleteUrlPattern: this.repository.getDeletePriceUrlPattern(), + }); + }; + + // A concrete drawer opens on top of the abstract one, so the last Save in the DOM is the one + // belonging to the drawer in front. + save = (): void => { + cy.get(this.repository.getSaveButtonSelector()).last().click(); + }; +} + +const CUSTOMER_COLUMN_TITLE = 'Customer'; +const STORE_COLUMN_TITLE = 'Store'; +const CURRENCY_COLUMN_TITLE = 'Currency'; +const NET_DEFAULT_COLUMN_TITLE = 'Net Default'; +const GROSS_DEFAULT_COLUMN_TITLE = 'Gross Default'; + +interface AddConcreteProductsParams { + attributeValues: string[]; +} + +interface OpenConcreteProductParams { + rowText: string; +} + +interface ActivateConcreteProductParams { + stockQuantity: number; + searchableLocales: string[]; +} + +interface AddPriceRowParams { + customerBusinessUnitName?: string; + storeName: string; + currency: string; + netAmount: number; + grossAmount: number; +} + +interface CreateMultiConcreteProductParams { + sku: string; + name: string; + attributeName: string; + attributeValues: string[]; +} + +interface CustomerPriceRowParams { + customerBusinessUnitName: string; +} + +interface PriceRowParams { + quantity: number; } interface FindParams { diff --git a/cypress/support/pages/mp/products/products-repository.ts b/cypress/support/pages/mp/products/products-repository.ts index 9d17f68dc..eb1616a8e 100644 --- a/cypress/support/pages/mp/products/products-repository.ts +++ b/cypress/support/pages/mp/products/products-repository.ts @@ -12,4 +12,98 @@ export class ProductsRepository { getDrawer = (): Cypress.Chainable => cy.get('.spy-drawer-wrapper'); getAddAttributeButton = (): Cypress.Chainable => cy.get('.product-attributes-table button:contains("Add")'); getAttributesTableSelector = (): string => '.product-attributes-table'; + + getCreateProductButton = (): Cypress.Chainable => cy.contains('a, button', 'Create Product'); + + getConcreteProductsTab = (): Cypress.Chainable => cy.contains('.ant-tabs-tab-btn', 'Concrete Products'); + + // The table renders a hidden measuring copy of every row beside the one on screen. + getVariantRows = (): Cypress.Chainable => + cy + .get('web-mp-edit-abstract-product-variants tbody.ant-table-tbody tr.ant-table-row', { timeout: 20000 }) + .filter(':visible'); + + // The checkbox only reaches the Angular form when its own label is clicked. + getConcreteIsActiveLabel = (): Cypress.Chainable => + cy.get('web-spy-checkbox[spy-id="productConcreteEdit_productConcrete_isActive"] label.ant-checkbox-wrapper', { + timeout: 20000, + }); + + getUseAbstractProductNameLabel = (): Cypress.Chainable => + cy.get('web-mp-content-toggle[name="productConcreteEdit[useAbstractProductName]"] label.ant-checkbox-wrapper', { + timeout: 20000, + }); + + getConcreteStockQuantityInput = (): Cypress.Chainable => + cy.get('input[name="productConcreteEdit[productConcrete][stocks][quantity]"]', { timeout: 20000 }); + + // Rendered as a link rather than a button, and only once the abstract product is complete. + getAddConcreteProductsButton = (): Cypress.Chainable => + cy.contains('.spy-drawer-wrapper button', 'Add Concrete Products'); + + getConcreteAttributeValuesSelect = (): Cypress.Chainable => + cy.get('.mp-concrete-product-attributes-selector nz-select-top-control', { timeout: 20000 }); + + getCreateConcreteProductsButton = (): Cypress.Chainable => + cy.get('web-mp-create-concrete-products-overlay').contains('button', 'Create'); + + getSearchabilitySelect = (): Cypress.Chainable => + cy.get('web-spy-select[spy-id="productConcreteEdit_searchability"] nz-select-top-control', { timeout: 20000 }); + + getSendForApprovalButton = (): Cypress.Chainable => + cy.get('a[href*="product-abstract-approval"][href*="waiting_for_approval"]', { timeout: 20000 }); + + getCreateProductSkuInput = (): Cypress.Chainable => + cy.get('input[name="create_product_abstract_form[sku]"]', { timeout: 20000 }); + + getCreateProductNameInput = (): Cypress.Chainable => cy.get('input[name="create_product_abstract_form[name]"]'); + + // The radio only reaches the Angular form when its own label is clicked. + getMultipleConcretesRadioLabel = (): Cypress.Chainable => + cy.contains('label.ant-radio-wrapper', 'multiple concrete products'); + + getSuperAttributeSelect = (): Cypress.Chainable => + cy.get('.mp-product-attributes-selector__content-row-name nz-select-top-control', { timeout: 20000 }); + + getSuperAttributeValuesSelect = (): Cypress.Chainable => + cy.get('.mp-product-attributes-selector__content-row-values-name-select nz-select-top-control'); + + getAddConcretesButton = (): Cypress.Chainable => cy.get('.mp-product-attributes-selector__button-add button'); + + getWizardNextButton = (): Cypress.Chainable => cy.contains('.spy-drawer-wrapper button', 'Next'); + + getWizardCreateButton = (): Cypress.Chainable => cy.contains('.spy-drawer-wrapper button', 'Create'); + + // Waiting on the heading itself is what proves the price table has finished rendering; the + // Angular bundle paints a skeleton header first. + getPriceTableQuantityHeaderCell = (): Cypress.Chainable => + cy.contains('web-mp-edit-abstract-product-prices thead th', 'Quantity', { timeout: 20000 }); + + getPriceTableCustomerHeaderCell = (): Cypress.Chainable => + cy.contains('web-mp-edit-abstract-product-prices thead th', 'Customer', { timeout: 20000 }); + + getPriceTableHeaderCells = (): Cypress.Chainable => + cy.get('web-mp-edit-abstract-product-prices thead th', { timeout: 20000 }); + + getPriceTableAddButton = (): Cypress.Chainable => + cy.get('web-mp-edit-abstract-product-prices button:contains("Add")'); + + // A row being added or edited is inserted at the top of the price table. + getEditableRowCell = (columnIndex: number): Cypress.Chainable => + this.getPriceTableRows().first().find('td').eq(columnIndex); + + getEditableSelectSelector = (): string => 'nz-select-top-control'; + + getNumberInputSelector = (): string => 'input[type="number"]'; + + getPriceTableRows = (): Cypress.Chainable => + cy.get('web-mp-edit-abstract-product-prices tbody.ant-table-tbody tr.ant-table-row', { timeout: 20000 }); + + getRowActionTriggerSelector = (): string => '.ant-table-row-actions-feature .ant-dropdown-trigger'; + + getDeletePriceUrlPattern = (): string => '**/product-merchant-portal-gui/delete-price-product-abstract**'; + + // The row-action menu is rendered into the page-level overlay container, not inside the row. + getRowActionItem = (title: string): Cypress.Chainable => + cy.get('.ant-dropdown-menu:visible li.ant-dropdown-menu-item').contains(title); } diff --git a/cypress/support/pages/mp/profile/profile-page.ts b/cypress/support/pages/mp/profile/profile-page.ts index 6718bac54..f4b81f06c 100644 --- a/cypress/support/pages/mp/profile/profile-page.ts +++ b/cypress/support/pages/mp/profile/profile-page.ts @@ -19,8 +19,54 @@ export class ProfilePage extends MpPage { this.repository.getProfileForm().submit(); }; + + openOnlineProfileTab = (): void => { + this.assertPageLocation(); + this.repository.getOnlineProfileTab().click(); + }; + + // The glossary fields repeat per locale, so every locale gets the same value and the + // storefront renders the right one whichever locale it is read in. + updateOnlineProfile = (params: UpdateOnlineProfileParams): void => { + this.repository.getPublicEmailInput().clear().type(params.publicEmail); + this.repository.getPublicPhoneInput().clear().type(params.publicPhone); + + this.repository.getLocalizedFieldsetCount().each((_element, localeIndex) => { + this.repository.getDeliveryTimeInput(localeIndex).clear().type(params.deliveryTime); + this.repository.getDataPrivacyTextarea(localeIndex).clear().type(params.dataPrivacy); + }); + }; + + setStoreStatus = (params: SetStoreStatusParams): void => { + const checkbox = this.repository.getStoreStatusCheckbox(); + + if (params.isOnline) { + checkbox.check({ force: true }); + + return; + } + + checkbox.uncheck({ force: true }); + }; + + save = (): void => { + cy.intercept('POST', '**/merchant-profile-merchant-portal-gui/profile**').as('profileSaved'); + this.repository.getSaveButton().click(); + cy.wait('@profileSaved'); + }; } interface UpdatePhoneParams { phone: string; } + +interface UpdateOnlineProfileParams { + publicEmail: string; + publicPhone: string; + deliveryTime: string; + dataPrivacy: string; +} + +interface SetStoreStatusParams { + isOnline: boolean; +} diff --git a/cypress/support/pages/mp/profile/profile-repository.ts b/cypress/support/pages/mp/profile/profile-repository.ts index fb6284754..eac2e41b5 100644 --- a/cypress/support/pages/mp/profile/profile-repository.ts +++ b/cypress/support/pages/mp/profile/profile-repository.ts @@ -8,4 +8,31 @@ export class ProfileRepository { cy.get('#merchantProfile_businessInfoMerchantProfile_contact_person_phone'); getProfileForm = (): Cypress.Chainable => cy.get('form[name=merchantProfile]'); + + getOnlineProfileTabLabel = (): string => 'Online Profile'; + + getOnlineProfileTab = (): Cypress.Chainable => + cy.contains('.ant-tabs-tab-btn', this.getOnlineProfileTabLabel(), { timeout: 20000 }); + + getPublicEmailInput = (): Cypress.Chainable => cy.get('#merchantProfile_onlineProfileMerchantProfile_public_email'); + + getPublicPhoneInput = (): Cypress.Chainable => cy.get('#merchantProfile_onlineProfileMerchantProfile_public_phone'); + + // The glossary attributes render one fieldset per locale; index 0 is the first configured locale. + getDeliveryTimeInput = (localeIndex: number): Cypress.Chainable => + cy.get( + `#merchantProfile_onlineProfileMerchantProfile_merchantProfileLocalizedGlossaryAttributes_${localeIndex}_merchantProfileGlossaryAttributeValues_deliveryTimeGlossaryKey` + ); + + getDataPrivacyTextarea = (localeIndex: number): Cypress.Chainable => + cy.get( + `#merchantProfile_onlineProfileMerchantProfile_merchantProfileLocalizedGlossaryAttributes_${localeIndex}_merchantProfileGlossaryAttributeValues_dataPrivacyGlossaryKey` + ); + + getStoreStatusCheckbox = (): Cypress.Chainable => cy.get('#merchantProfile_onlineProfileMerchantProfile_is_active'); + + getSaveButton = (): Cypress.Chainable => cy.contains('button', 'Save'); + + getLocalizedFieldsetCount = (): Cypress.Chainable => + cy.get('[id*="merchantProfileLocalizedGlossaryAttributes"][id$="deliveryTimeGlossaryKey"]'); } diff --git a/cypress/support/pages/mp/sales/sales-orders-page.ts b/cypress/support/pages/mp/sales/sales-orders-page.ts index 766585118..63474de85 100644 --- a/cypress/support/pages/mp/sales/sales-orders-page.ts +++ b/cypress/support/pages/mp/sales/sales-orders-page.ts @@ -57,6 +57,27 @@ export class SalesOrdersPage extends MpPage { return actionButtonSelectors[action]; }; + openOrder = (params: OpenOrderParams): void => { + this.find({ query: params.query }).click({ force: true }); + }; + + openItemsTab = (): void => { + this.repository.getItemsTab().click(); + }; + + getOrderItemState = (params: OrderItemParams): Cypress.Chainable => + this.repository + .getOrderItemHeaderCell(STATE_COLUMN_TITLE) + .then(($headerCell: JQuery) => this.getOrderItemRow(params.sku).find('td').eq($headerCell.index())); + + changeOrderItemState = (params: ChangeOrderItemStateParams): void => { + this.getOrderItemRow(params.sku).find(this.repository.getRowActionTriggerSelector()).click(); + this.repository.getRowActionItem(params.state).click(); + }; + + private getOrderItemRow = (sku: string): Cypress.Chainable => + this.repository.getOrderItemRows().filter(`:contains("${sku}")`).first(); + hasOrderByOrderReference = (query: string): Cypress.Chainable => { return cy.get('tbody').then((body) => { if (body.find(`tr:contains("${query}")`).length > 0) { @@ -76,6 +97,21 @@ export class SalesOrdersPage extends MpPage { }; } +const STATE_COLUMN_TITLE = 'State'; + +interface OpenOrderParams { + query: string; +} + +interface OrderItemParams { + sku: string; +} + +interface ChangeOrderItemStateParams { + sku: string; + state: string; +} + interface FindParams { query: string; expectedCount?: number; diff --git a/cypress/support/pages/mp/sales/sales-orders-repository.ts b/cypress/support/pages/mp/sales/sales-orders-repository.ts index 4bdf5d0c5..3474ae707 100644 --- a/cypress/support/pages/mp/sales/sales-orders-repository.ts +++ b/cypress/support/pages/mp/sales/sales-orders-repository.ts @@ -15,4 +15,18 @@ export class SalesOrdersRepository { getDeliverButtonSelector = (): string => 'button:contains("Deliver")'; getRefundButtonSelector = (): string => 'button:contains("Refund")'; getDrawer = (): Cypress.Chainable => cy.get('.spy-drawer-wrapper'); + + getItemsTab = (): Cypress.Chainable => cy.contains('.ant-tabs-tab-btn', 'Items', { timeout: 20000 }); + + getOrderItemHeaderCell = (title: string): Cypress.Chainable => + cy.contains('web-mp-order-items-table thead th', title, { timeout: 20000 }); + + getOrderItemRows = (): Cypress.Chainable => + cy.get('web-mp-order-items-table tbody.ant-table-tbody tr.ant-table-row', { timeout: 20000 }); + + getRowActionTriggerSelector = (): string => '.ant-table-row-actions-feature .ant-dropdown-trigger'; + + // The row-action menu is rendered into the page-level overlay container, not inside the row. + getRowActionItem = (title: string): Cypress.Chainable => + cy.get('.ant-dropdown-menu:visible li.ant-dropdown-menu-item').contains(title); } diff --git a/cypress/support/pages/yves/agent-control-bar/agent-control-bar-page.ts b/cypress/support/pages/yves/agent-control-bar/agent-control-bar-page.ts new file mode 100644 index 000000000..d1606c59c --- /dev/null +++ b/cypress/support/pages/yves/agent-control-bar/agent-control-bar-page.ts @@ -0,0 +1,66 @@ +import { REPOSITORIES, autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; +import { AgentControlBarRepository } from './agent-control-bar-repository'; + +@injectable() +@autoWired +export class AgentControlBarPage extends YvesPage { + @inject(REPOSITORIES.AgentControlBarRepository) private repository: AgentControlBarRepository; + + protected PAGE_URL = '/'; + + /** + * Forced, because some agent controls keep their search in a popover that only opens on hover, + * which Cypress cannot produce. Waits until the storefront shows the assistance as running. + */ + impersonate = (email: string): void => { + const alias = 'customerAutocomplete'; + + cy.intercept('GET', this.repository.getCustomerAutocompleteUrl()).as(alias); + this.repository.getCustomerSearchInput().clear({ force: true }); + this.repository.getCustomerSearchInput().type(email, { force: true }); + + // The suggestion list is rendered from this response, so waiting on it removes the race + // between typing and the list appearing. + cy.wait(`@${alias}`); + + this.repository.getSuggestion(email).click({ force: true }); + this.confirmSelection(); + this.repository.getActiveAssistanceIndicator(); + }; + + endAssistance = (): void => { + this.repository.getEndAssistanceLink().click(); + }; + + getActiveAssistanceIndicator = (): Cypress.Chainable => this.repository.getActiveAssistanceIndicator(); + + getEndAssistanceLink = (): Cypress.Chainable => this.repository.getEndAssistanceLink(); + + getCustomerSearchInput = (): Cypress.Chainable => this.repository.getCustomerSearchInput(); + + /** + * The b2b-mp agent control submits the switch as soon as a suggestion is picked. The b2b id runs on + * that theme and on the classic bar, which asks for a confirmation, so there the button is looked for. + */ + private confirmSelection = (): void => { + const confirmButtonSelector = this.repository.getConfirmButtonSelector(); + + if (this.isRepository('b2b-mp')) { + return; + } + + if (this.isRepository('b2b')) { + cy.get('body').then(($body) => { + if ($body.find(confirmButtonSelector).length) { + cy.get(confirmButtonSelector).click(); + } + }); + + return; + } + + cy.get(confirmButtonSelector).click(); + }; +} diff --git a/cypress/support/pages/yves/agent-control-bar/agent-control-bar-repository.ts b/cypress/support/pages/yves/agent-control-bar/agent-control-bar-repository.ts new file mode 100644 index 000000000..21ca97a2f --- /dev/null +++ b/cypress/support/pages/yves/agent-control-bar/agent-control-bar-repository.ts @@ -0,0 +1,8 @@ +export interface AgentControlBarRepository { + getCustomerSearchInput(): Cypress.Chainable; + getSuggestion(email: string): Cypress.Chainable; + getConfirmButtonSelector(): string; + getActiveAssistanceIndicator(): Cypress.Chainable; + getEndAssistanceLink(): Cypress.Chainable; + getCustomerAutocompleteUrl(): string; +} diff --git a/cypress/support/pages/yves/agent-control-bar/repositories/b2b-agent-control-bar-repository.ts b/cypress/support/pages/yves/agent-control-bar/repositories/b2b-agent-control-bar-repository.ts new file mode 100644 index 000000000..c8670683f --- /dev/null +++ b/cypress/support/pages/yves/agent-control-bar/repositories/b2b-agent-control-bar-repository.ts @@ -0,0 +1,32 @@ +import { injectable } from 'inversify'; +import { AgentControlBarRepository } from '../agent-control-bar-repository'; + +/** + * The b2b id runs on two storefront themes: the classic agent control bar of the B2B shop and the + * header agent control of the B2B marketplace shop. Every selector matches exactly one of them. + */ +@injectable() +export class B2bAgentControlBarRepository implements AgentControlBarRepository { + getCustomerSearchInput = (): Cypress.Chainable => + cy.get( + 'agent-control-bar .js-autocomplete-form__input, .header__agent-pill-desktop agent-control .js-autocomplete-form__input' + ); + + getSuggestion = (email: string): Cypress.Chainable => + cy.get( + [ + `agent-control-bar li.customer-list__container-item[data-value="${email}"]`, + `.header__agent-pill-desktop agent-control li.customer-list__container-item[data-value="${email}"]`, + ].join(', ') + ); + + // Only the classic bar asks for a confirmation; the header agent control submits on the pick. + getConfirmButtonSelector = (): string => 'agent-control-bar button.button--success'; + + getActiveAssistanceIndicator = (): Cypress.Chainable => + cy.get('agent-control-bar a[href*="_switch_user=_exit"], .header__agent-pill-desktop .agent-control__chip--active'); + + getEndAssistanceLink = (): Cypress.Chainable => cy.get('agent-control-bar a[href*="_switch_user=_exit"]'); + + getCustomerAutocompleteUrl = (): string => '**/agent-widget/customer-autocomplete**'; +} diff --git a/cypress/support/pages/yves/agent-control-bar/repositories/b2b-mp-agent-control-bar-repository.ts b/cypress/support/pages/yves/agent-control-bar/repositories/b2b-mp-agent-control-bar-repository.ts new file mode 100644 index 000000000..31dba139d --- /dev/null +++ b/cypress/support/pages/yves/agent-control-bar/repositories/b2b-mp-agent-control-bar-repository.ts @@ -0,0 +1,24 @@ +import { injectable } from 'inversify'; +import { AgentControlBarRepository } from '../agent-control-bar-repository'; + +@injectable() +export class B2bMpAgentControlBarRepository implements AgentControlBarRepository { + // The agent control sits in the header pill and again in the side drawer; the header one is the + // desktop copy. Its search lives in a popover that only opens on hover or focus. + getCustomerSearchInput = (): Cypress.Chainable => + cy.get('.header__agent-pill-desktop agent-control .js-autocomplete-form__input'); + + getSuggestion = (email: string): Cypress.Chainable => + cy.get(`.header__agent-pill-desktop agent-control li.customer-list__container-item[data-value="${email}"]`); + + // Picking a suggestion submits the switch on its own; there is no confirm button. + getConfirmButtonSelector = (): string => ''; + + getActiveAssistanceIndicator = (): Cypress.Chainable => + cy.get('.header__agent-pill-desktop .agent-control__chip--active'); + + // The agent control only offers to end the whole agent session, never to step back out of the customer's. + getEndAssistanceLink = (): Cypress.Chainable => cy.get('agent-control a[href*="_switch_user=_exit"]'); + + getCustomerAutocompleteUrl = (): string => '**/agent-widget/customer-autocomplete**'; +} diff --git a/cypress/support/pages/yves/agent-control-bar/repositories/b2c-agent-control-bar-repository.ts b/cypress/support/pages/yves/agent-control-bar/repositories/b2c-agent-control-bar-repository.ts new file mode 100644 index 000000000..4d982beb9 --- /dev/null +++ b/cypress/support/pages/yves/agent-control-bar/repositories/b2c-agent-control-bar-repository.ts @@ -0,0 +1,20 @@ +import { injectable } from 'inversify'; +import { AgentControlBarRepository } from '../agent-control-bar-repository'; + +@injectable() +export class B2cAgentControlBarRepository implements AgentControlBarRepository { + // The B2C theme overrides the autocomplete field (ShopUi autocomplete-form.twig): the visible input is named + // query and the form submits the hidden _switch_user input the autocomplete fills when a suggestion is chosen. + getCustomerSearchInput = (): Cypress.Chainable => cy.get('agent-control-bar .js-autocomplete-form__input'); + + getSuggestion = (email: string): Cypress.Chainable => + cy.get(`agent-control-bar li.customer-list__container-item[data-value="${email}"]`); + + getConfirmButtonSelector = (): string => 'agent-control-bar button.button--success'; + + getActiveAssistanceIndicator = (): Cypress.Chainable => this.getEndAssistanceLink(); + + getEndAssistanceLink = (): Cypress.Chainable => cy.get('agent-control-bar a[href*="_switch_user=_exit"]'); + + getCustomerAutocompleteUrl = (): string => '**/agent-widget/customer-autocomplete**'; +} diff --git a/cypress/support/pages/yves/agent-control-bar/repositories/b2c-mp-agent-control-bar-repository.ts b/cypress/support/pages/yves/agent-control-bar/repositories/b2c-mp-agent-control-bar-repository.ts new file mode 100644 index 000000000..7c3296dea --- /dev/null +++ b/cypress/support/pages/yves/agent-control-bar/repositories/b2c-mp-agent-control-bar-repository.ts @@ -0,0 +1,20 @@ +import { injectable } from 'inversify'; +import { AgentControlBarRepository } from '../agent-control-bar-repository'; + +@injectable() +export class B2cMpAgentControlBarRepository implements AgentControlBarRepository { + // The B2C theme overrides the autocomplete field (ShopUi autocomplete-form.twig): the visible input is named + // query and the form submits the hidden _switch_user input the autocomplete fills when a suggestion is chosen. + getCustomerSearchInput = (): Cypress.Chainable => cy.get('agent-control-bar .js-autocomplete-form__input'); + + getSuggestion = (email: string): Cypress.Chainable => + cy.get(`agent-control-bar li.customer-list__container-item[data-value="${email}"]`); + + getConfirmButtonSelector = (): string => 'agent-control-bar button.button--success'; + + getActiveAssistanceIndicator = (): Cypress.Chainable => this.getEndAssistanceLink(); + + getEndAssistanceLink = (): Cypress.Chainable => cy.get('agent-control-bar a[href*="_switch_user=_exit"]'); + + getCustomerAutocompleteUrl = (): string => '**/agent-widget/customer-autocomplete**'; +} diff --git a/cypress/support/pages/yves/agent-control-bar/repositories/suite-agent-control-bar-repository.ts b/cypress/support/pages/yves/agent-control-bar/repositories/suite-agent-control-bar-repository.ts new file mode 100644 index 000000000..710456a8f --- /dev/null +++ b/cypress/support/pages/yves/agent-control-bar/repositories/suite-agent-control-bar-repository.ts @@ -0,0 +1,20 @@ +import { injectable } from 'inversify'; +import { AgentControlBarRepository } from '../agent-control-bar-repository'; + +@injectable() +export class SuiteAgentControlBarRepository implements AgentControlBarRepository { + // The visible field carries no name; the form submits a hidden _switch_user input that the + // autocomplete fills when a suggestion is chosen, which is why the suggestion has to be clicked. + getCustomerSearchInput = (): Cypress.Chainable => cy.get('agent-control-bar .js-autocomplete-form__text-input'); + + getSuggestion = (email: string): Cypress.Chainable => + cy.get(`agent-control-bar li.customer-list__container-item[data-value="${email}"]`); + + getConfirmButtonSelector = (): string => 'agent-control-bar button.button--success'; + + getActiveAssistanceIndicator = (): Cypress.Chainable => this.getEndAssistanceLink(); + + getEndAssistanceLink = (): Cypress.Chainable => cy.get('agent-control-bar a[href*="_switch_user=_exit"]'); + + getCustomerAutocompleteUrl = (): string => '**/agent-widget/customer-autocomplete**'; +} diff --git a/cypress/support/pages/yves/cart/cart-page.ts b/cypress/support/pages/yves/cart/cart-page.ts index 952c7b3cb..f83d8bf24 100644 --- a/cypress/support/pages/yves/cart/cart-page.ts +++ b/cypress/support/pages/yves/cart/cart-page.ts @@ -24,6 +24,44 @@ export class CartPage extends YvesPage { this.repository.getQuickAddToCartSubmitButton().click(); }; + // The code field belongs to CartCodeWidget's form, not the DiscountWidget voucher form, and takes + // gift-card codes as well as vouchers. Its id is the one the Robot source used for every shop, so + // it is addressed here rather than per repository. The field sits inside a collapsible section, so + // the interaction is forced rather than expanding it first. The code is redeemed asynchronously and + // the cart re-renders behind a loader afterwards, so this waits for both before the cart is read. + applyVoucherCode = (code: string): void => { + cy.intercept({ method: 'POST', pathname: '**/cart-code/code-async/add' }).as('voucherCodeAdd'); + cy.intercept({ method: 'GET', pathname: '**/cart/async/view' }).as('cartAsyncView'); + + cy.get('#cartCodeForm_code').clear({ force: true }); + cy.get('#cartCodeForm_code').type(code, { force: true }); + cy.get('form[name="cartCodeForm"]').find('button[data-qa="submit-button"]').click({ force: true }); + + cy.wait('@voucherCodeAdd'); + cy.wait('@cartAsyncView'); + }; + + // Added asynchronously like a redeemed code, so this waits for the add and the cart re-render. + addPromotionalProduct = (sku: string): void => { + cy.intercept({ method: 'POST', pathname: `**/cart/async/add/${sku}` }).as('promotionalProductAdd'); + cy.intercept({ method: 'GET', pathname: '**/cart/async/view' }).as('cartAsyncView'); + + this.repository.getPromotionalProductAddToCartButton(sku).click(); + + cy.wait('@promotionalProductAdd'); + cy.wait('@cartAsyncView'); + }; + + getExternalCartShareLink = (): Cypress.Chainable => { + this.repository.getExternalCartShareToggle().click({ force: true }); + + return this.repository.getExternalCartShareLinkInput().invoke('val'); + }; + + getLockedCartResetForm = (): Cypress.Chainable => this.repository.getLockedCartResetForm(); + + getApprovalStatus = (): Cypress.Chainable => this.repository.getApprovalStatus(); + startCheckout = (): void => { this.repository.getCheckoutButton().click({ force: true }); }; @@ -49,6 +87,63 @@ export class CartPage extends YvesPage { this.repository.submitCartItemChangeQuantity(params.sku); }; + configureProduct = (params: ConfigureProductParams): void => { + this.getCartItems({ sku: params.sku }).first().find(this.repository.getConfigureButtonSelector()).click(); + }; + + // The B2C cart lines print no sku, so a line is also recognised by the quantity or removal form it posts to, + // which every shop keys by sku; a promotional line has no quantity form. + getCartItems = (params: GetCartItemsParams): Cypress.Chainable => { + return this.repository + .getProductCartItems() + .filter( + `:contains("${params.sku}"), :has([action$="change-quantity/${params.sku}"]), :has([action*="/remove/${params.sku}/"])` + ); + }; + + // The redesigned B2B cart line prints only its total, the other themes the unit price, so a line charging + // a unit price is recognised by either. + getCartItemsChargingUnitPrice = (params: GetCartItemsChargingUnitPriceParams): Cypress.Chainable => { + const lineTotal = params.unitPrice.replace(/[\d.,]+/, (amount: string): string => + (parseFloat(amount.replace(/,/g, '')) * params.quantity).toFixed(2) + ); + + return this.getCartItems({ sku: params.sku }).filter( + (_index: number, cartItem: HTMLElement): boolean => + cartItem.innerText.includes(params.unitPrice) || cartItem.innerText.includes(lineTotal) + ); + }; + + // cy.get() on the clear form fails outright on an empty cart, so a spec that only needs a known + // starting point has to look before it clears. The B2C shops have no clear-cart form, so their lines + // are removed one by one through the removal form each line carries. + clearCartIfNotEmpty = (): void => { + this.getBody().then(($body) => { + if ($body.find(this.repository.getClearCartFormSelector()).length) { + this.clearCart(); + + return; + } + + // The header's mini cart repeats each line with its removal form, so each line is posted once. + const removalRequests = new Map(); + + $body.find(this.repository.getCartItemRemovalFormSelector()).each((index: number, form: HTMLElement): void => { + removalRequests.set((form as HTMLFormElement).action, Cypress.$(form).serialize()); + }); + + if (!removalRequests.size) { + return; + } + + removalRequests.forEach((body: string, url: string): void => { + cy.request({ method: 'POST', url, form: true, body }); + }); + + this.visit(); + }); + }; + clearCart = (): void => { const form = this.repository.findClearCartForm(); @@ -85,6 +180,11 @@ export class CartPage extends YvesPage { return this.repository.getCartItemChangeQuantityField(sku); }; + // The B2C cart lines print no sku, so a line is found by the quantity form it posts to, which every shop keys by sku. + findCartItem = (params: FindCartItemParams): Cypress.Chainable => { + return this.repository.findCartItemChangeQuantityForm(params.sku); + }; + addCustomOrderReferenceInput = (reference: string): void => { this.repository.getCustomOrderReferenceInput().type(reference); this.repository.getCustomOrderReferenceSubmitButton().click(); @@ -110,6 +210,14 @@ export class CartPage extends YvesPage { } }; + changeConfiguredBundleQuantity = (params: ChangeConfiguredBundleQuantityParams): void => { + this.repository.changeConfiguredBundleQuantity(params.bundleName, params.quantity); + }; + + getConfiguredBundles = (): Cypress.Chainable => { + return this.repository.getConfiguredBundles(); + }; + getProductCartItems = (): Cypress.Chainable => { return this.repository.getProductCartItems(); }; @@ -127,6 +235,24 @@ export class CartPage extends YvesPage { }; } +interface GetCartItemsParams { + sku: string; +} + +interface GetCartItemsChargingUnitPriceParams { + sku: string; + unitPrice: string; + quantity: number; +} + +interface FindCartItemParams { + sku: string; +} + +interface ConfigureProductParams { + sku: string; +} + interface QuickAddToCartParams { sku: string; quantity?: number; @@ -144,3 +270,8 @@ interface ChangeQuantityParams { interface CartItemNoteAddParams { message: string; } + +interface ChangeConfiguredBundleQuantityParams { + bundleName: string; + quantity: number; +} diff --git a/cypress/support/pages/yves/cart/cart-repository.ts b/cypress/support/pages/yves/cart/cart-repository.ts index 09d3aed5c..3e0f69095 100644 --- a/cypress/support/pages/yves/cart/cart-repository.ts +++ b/cypress/support/pages/yves/cart/cart-repository.ts @@ -1,4 +1,8 @@ export interface CartRepository { + getLockedCartResetForm(): Cypress.Chainable; + getApprovalStatus(): Cypress.Chainable; + getExternalCartShareToggle(): Cypress.Chainable; + getExternalCartShareLinkInput(): Cypress.Chainable; getQuickAddToCartSkuField(): Cypress.Chainable; getQuickAddToCartProductListField(): Cypress.Chainable; getFirstCartItemNoteField(): Cypress.Chainable; @@ -11,9 +15,16 @@ export interface CartRepository { getCartItemChangeQuantityField(sku: string): Cypress.Chainable; getCartItemChangeQuantitySubmit(sku: string): Cypress.Chainable; findClearCartForm(): Cypress.Chainable; + getClearCartFormSelector(): string; + getCartItemRemovalFormSelector(): string; + + // The cart line's own configure form. It is a different component from the detail page's, so the + // detail-page selector does not find it. + getConfigureButtonSelector(): string; getCheckoutButton(): Cypress.Chainable; getCartSummary(): Cypress.Chainable; getCartDiscountSummary(): Cypress.Chainable; + getPromotionalProductAddToCartButton(sku: string): Cypress.Chainable; getCustomOrderReferenceInput(): Cypress.Chainable; getCustomOrderReferenceSubmitButton(): Cypress.Chainable; addFirstCartItemNote(message: string): void; @@ -24,4 +35,6 @@ export interface CartRepository { getProductCartItems(): Cypress.Chainable; getCartItemsListTitles(): Cypress.Chainable; getCartItemAvailabilityLabel(): Cypress.Chainable; + getConfiguredBundles(): Cypress.Chainable; + changeConfiguredBundleQuantity(bundleName: string, quantity: number): void; } diff --git a/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts index aa2cf763f..14459d1ff 100644 --- a/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2b-cart-repository.ts @@ -3,7 +3,33 @@ import { CartRepository } from '../cart-repository'; @injectable() export class B2bCartRepository implements CartRepository { - getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component autocomplete-form"] .input'); + // The approver's actions live on the cart page, not the summary, and put the approval's id at + // the end of the path - /quote-approval/approve/8 - the opposite way round to the requester's + // cancel form. A cart waiting for approval is also locked, which the reset-lock form marks. + getLockedCartResetForm = (): Cypress.Chainable => cy.get('form[action$="/cart/reset-lock"]'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); + // The share widget renders one url-mask-generator per share option group. Clicking the group's + // toggler fires the cart/create-link AJAX, which renders the generated link into an input whose + // id is the share option - PREVIEW for the external group. + getExternalCartShareToggle = (): Cypress.Chainable => + cy.get('url-mask-generator[shareoptiongroup="external"]').find('.js-toggler-radio__trigger'); + getExternalCartShareLinkInput = (): Cypress.Chainable => cy.get('#PREVIEW'); + // The SKU field is ProductSearchWidget's own product-search-autocomplete-form, not the generic + // autocomplete-form the other shops render. An empty cart shows the form in the page body; a cart + // with items moves it into a collapsed sidebar accordion item, which is opened first. + getQuickAddToCartSkuField = (): Cypress.Chainable => { + const skuFieldSelector = '[data-qa="component product-search-autocomplete-form"] .input'; + + cy.get(skuFieldSelector) + .first() + .then(($skuField) => { + if (!$skuField.is(':visible')) { + cy.get('[data-toggle-target=".js-cart-sidebar-item__content-quick-add-widget"]').click(); + } + }); + + return cy.get(skuFieldSelector); + }; getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); getFirstCartItemNoteField = (): Cypress.Chainable => { cy.get('[data-qa="component cart-item-note"]') @@ -11,12 +37,29 @@ export class B2bCartRepository implements CartRepository { .find('textarea') .first() .then(($textarea) => { - if (!$textarea.is(':visible')) { - cy.get('[data-qa="component product-cart-item"]') - .first() - .find('.product-cart-item__context-item[data-trigger-target*="cart-item-note"]') - .click(); + if ($textarea.is(':visible')) { + return; } + + // The redesigned theme opens the note from the item's context menu. The classic theme has no + // such menu: an empty note opens from its accordion title, a saved one from its edit link. + cy.get('[data-qa="component product-cart-item"]') + .first() + .then(($cartItem) => { + const $contextItem = $cartItem.find( + '.product-cart-item__context-item[data-trigger-target*="cart-item-note"]' + ); + + if ($contextItem.length) { + cy.wrap($contextItem).click(); + + return; + } + + cy.wrap($cartItem.find('.js-cart-item-note__trigger, .js-cart-item-note__edit').filter(':visible')) + .first() + .click(); + }); }); return cy.get('[data-qa="component cart-item-note"]').last().find('textarea').first(); @@ -65,6 +108,11 @@ export class B2bCartRepository implements CartRepository { getCheckoutButton = (): Cypress.Chainable => cy.get('[data-qa="cart-go-to-checkout"]', { timeout: 10000 }); getCartSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-summary"]'); getCartDiscountSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-code-summary"]'); + // The B2B promotion tiles show the product name only and carry the sku in their add-to-cart form, + // which also keeps the tile apart from those of any other active promotion discount; the quantity + // counter beside the add button brings its own +/- buttons. + getPromotionalProductAddToCartButton = (sku: string): Cypress.Chainable => + cy.get(`[data-qa="component product-item"] form[action$="/cart/async/add/${sku}"] button[data-init-single-click]`); getCustomOrderReferenceInput = (): Cypress.Chainable => { cy.get('[data-qa="component order-custom-reference-form"]').parent().parent().parent().click(); @@ -81,12 +129,7 @@ export class B2bCartRepository implements CartRepository { getCartItemSummaryBlock = (itemIndex: number): Cypress.Chainable => cy.get('[data-qa="cart-item-summary"]').eq(itemIndex); getCancelOrderAmendmentButton = (): Cypress.Chainable => cy.get('[data-qa="cancel-order-amendment-button"]'); - getProductCartItems = (): Cypress.Chainable => { - if (Cypress.env('ENV_IS_SSP_ENABLED')) { - return cy.get('[data-qa="component product-cart-item"]'); - } - return cy.get('[data-qa="component product-card-item"]'); - }; + getProductCartItems = (): Cypress.Chainable => cy.get('[data-qa="component product-cart-item"]'); getCartItemsListTitles = (): Cypress.Chainable => { if (Cypress.env('ENV_IS_SSP_ENABLED')) { return cy.get('[data-qa="cart-item-title"]'); @@ -95,4 +138,31 @@ export class B2bCartRepository implements CartRepository { }; getCartItemAvailabilityLabel = (): Cypress.Chainable => cy.get('[data-qa="component product-cart-item"] [data-qa="component availability-product"]'); + // The bundle's products render as configured-bundle-product articles inside it. + getConfiguredBundles = (): Cypress.Chainable => + cy.get('article[data-qa*="configured-bundle"]:not([data-qa*="configured-bundle-product"])'); + getConfiguredBundle = (bundleName: string): Cypress.Chainable => + cy + .contains('article[data-qa*="configured-bundle"]:not([data-qa*="configured-bundle-product"])', bundleName) + .first(); + // The bundle's quantity counter has no submit button. Its +/- buttons are the one path that posts the new + // quantity exactly once, after a short delay that collects consecutive clicks. + changeConfiguredBundleQuantity = (bundleName: string, quantity: number): void => { + cy.intercept('POST', '**/configured-bundle/**').as('configuredBundleQuantityChange'); + + this.getConfiguredBundle(bundleName) + .find('input.formatted-number-input__input') + .first() + .invoke('val') + .then((currentQuantity): void => { + Cypress._.times(quantity - Number(currentQuantity), (): void => { + this.getConfiguredBundle(bundleName).find('.quantity-counter__button--increment').first().click(); + }); + }); + cy.wait('@configuredBundleQuantityChange'); + }; + getClearCartFormSelector = (): string => 'form[name=multi_cart_clear_form]'; + + getConfigureButtonSelector = (): string => '[data-qa="component configuration-cart-form"] button'; + getCartItemRemovalFormSelector = (): string => 'form[name^="removeFromCartForm_"]'; } diff --git a/cypress/support/pages/yves/cart/repositories/b2b-cart-up-selling-products-repository.ts b/cypress/support/pages/yves/cart/repositories/b2b-cart-up-selling-products-repository.ts index ababb32e3..3ccf31ad4 100644 --- a/cypress/support/pages/yves/cart/repositories/b2b-cart-up-selling-products-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2b-cart-up-selling-products-repository.ts @@ -3,8 +3,8 @@ import { CartUpSellingProductsRepository } from '../cart-up-selling-products-rep @injectable() export class B2bCartUpSellingProductsRepository implements CartUpSellingProductsRepository { - // Both B2B shops override the similar-products template to use the slick carousel; the simple - // carousel is what the other storefronts render. + // The demoshops override the similar-products template to use the slick carousel; suite renders the + // simple carousel. getUpSellingCarousel(): Cypress.Chainable { return cy.get('.slick-carousel__container'); } diff --git a/cypress/support/pages/yves/cart/repositories/b2b-mp-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/b2b-mp-cart-repository.ts index 246ac9bc5..f576a0ffe 100644 --- a/cypress/support/pages/yves/cart/repositories/b2b-mp-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2b-mp-cart-repository.ts @@ -3,7 +3,33 @@ import { CartRepository } from '../cart-repository'; @injectable() export class B2bMpCartRepository implements CartRepository { - getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component autocomplete-form"] .input'); + // The approver's actions live on the cart page, not the summary, and put the approval's id at + // the end of the path - /quote-approval/approve/8 - the opposite way round to the requester's + // cancel form. A cart waiting for approval is also locked, which the reset-lock form marks. + getLockedCartResetForm = (): Cypress.Chainable => cy.get('form[action$="/cart/reset-lock"]'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); + // The share widget renders one url-mask-generator per share option group. Clicking the group's + // toggler fires the cart/create-link AJAX, which renders the generated link into an input whose + // id is the share option - PREVIEW for the external group. + getExternalCartShareToggle = (): Cypress.Chainable => + cy.get('url-mask-generator[shareoptiongroup="external"]').find('.js-toggler-radio__trigger'); + getExternalCartShareLinkInput = (): Cypress.Chainable => cy.get('#PREVIEW'); + // The SKU field is ProductSearchWidget's own product-search-autocomplete-form, not the generic + // autocomplete-form the other shops render. An empty cart shows the form in the page body; a cart + // with items moves it into a collapsed sidebar accordion item, which is opened first. + getQuickAddToCartSkuField = (): Cypress.Chainable => { + const skuFieldSelector = '[data-qa="component product-search-autocomplete-form"] .input'; + + cy.get(skuFieldSelector) + .first() + .then(($skuField) => { + if (!$skuField.is(':visible')) { + cy.get('[data-toggle-target=".js-cart-sidebar-item__content-quick-add-widget"]').click(); + } + }); + + return cy.get(skuFieldSelector); + }; getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); getFirstCartItemNoteField = (): Cypress.Chainable => { cy.get('[data-qa="component cart-item-note"]') @@ -65,6 +91,11 @@ export class B2bMpCartRepository implements CartRepository { getCheckoutButton = (): Cypress.Chainable => cy.get('[data-qa="cart-go-to-checkout"]'); getCartSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-summary"]'); getCartDiscountSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-code-summary"]'); + // The B2B promotion tiles show the product name only and carry the sku in their add-to-cart form, + // which also keeps the tile apart from those of any other active promotion discount; the quantity + // counter beside the add button brings its own +/- buttons. + getPromotionalProductAddToCartButton = (sku: string): Cypress.Chainable => + cy.get(`[data-qa="component product-item"] form[action$="/cart/async/add/${sku}"] button[data-init-single-click]`); getCustomOrderReferenceInput = (): Cypress.Chainable => { cy.get('[data-qa="component order-custom-reference-form"]').parent().parent().parent().click(); @@ -95,4 +126,31 @@ export class B2bMpCartRepository implements CartRepository { }; getCartItemAvailabilityLabel = (): Cypress.Chainable => cy.get('[data-qa="component product-cart-item"] [data-qa="component status"]'); + // The bundle's products render as configured-bundle-product articles inside it. + getConfiguredBundles = (): Cypress.Chainable => + cy.get('article[data-qa*="configured-bundle"]:not([data-qa*="configured-bundle-product"])'); + getConfiguredBundle = (bundleName: string): Cypress.Chainable => + cy + .contains('article[data-qa*="configured-bundle"]:not([data-qa*="configured-bundle-product"])', bundleName) + .first(); + // The bundle's quantity counter has no submit button. Its +/- buttons are the one path that posts the new + // quantity exactly once, after a short delay that collects consecutive clicks. + changeConfiguredBundleQuantity = (bundleName: string, quantity: number): void => { + cy.intercept('POST', '**/configured-bundle/**').as('configuredBundleQuantityChange'); + + this.getConfiguredBundle(bundleName) + .find('input.formatted-number-input__input') + .first() + .invoke('val') + .then((currentQuantity): void => { + Cypress._.times(quantity - Number(currentQuantity), (): void => { + this.getConfiguredBundle(bundleName).find('.quantity-counter__button--increment').first().click(); + }); + }); + cy.wait('@configuredBundleQuantityChange'); + }; + getClearCartFormSelector = (): string => 'form[name=multi_cart_clear_form]'; + + getConfigureButtonSelector = (): string => '[data-qa="component configuration-cart-form"] button'; + getCartItemRemovalFormSelector = (): string => 'form[name^="removeFromCartForm_"]'; } diff --git a/cypress/support/pages/yves/cart/repositories/b2c-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/b2c-cart-repository.ts index 239fe8549..f70bb0710 100644 --- a/cypress/support/pages/yves/cart/repositories/b2c-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2c-cart-repository.ts @@ -3,6 +3,17 @@ import { CartRepository } from '../cart-repository'; @injectable() export class B2cCartRepository implements CartRepository { + // The approver's actions live on the cart page, not the summary, and put the approval's id at + // the end of the path - /quote-approval/approve/8 - the opposite way round to the requester's + // cancel form. A cart waiting for approval is also locked, which the reset-lock form marks. + getLockedCartResetForm = (): Cypress.Chainable => cy.get('form[action$="/cart/reset-lock"]'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); + // The share widget renders one url-mask-generator per share option group. Clicking the group's + // toggler fires the cart/create-link AJAX, which renders the generated link into an input whose + // id is the share option - PREVIEW for the external group. + getExternalCartShareToggle = (): Cypress.Chainable => + cy.get('url-mask-generator[shareoptiongroup="external"]').find('.js-toggler-radio__trigger'); + getExternalCartShareLinkInput = (): Cypress.Chainable => cy.get('#PREVIEW'); getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component product-quick-add-form"] input').first(); getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); @@ -36,6 +47,12 @@ export class B2cCartRepository implements CartRepository { getCheckoutButton = (): Cypress.Chainable => cy.get('[data-qa="cart-go-to-checkout"]:visible'); findCartItemRemovalSubmit = (sku: string): Cypress.Chainable => this.findCartItemRemovalForm(sku).find('button'); getCartDiscountSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-discount-summary"]'); + // Scoped to one tile by sku, because any other active promotion discount offers its own product + // in the same carousel. The tile shows the product name only; the sku is in its group key input. + getPromotionalProductAddToCartButton = (sku: string): Cypress.Chainable => + cy.get( + `[data-qa="component product-item"]:has(input[name="groupKey"][value="${sku}"]) [data-qa="add-to-cart-button"]` + ); getCartItemChangeQuantitySubmit = (sku: string): Cypress.Chainable => this.findCartItemChangeQuantityForm(sku).find('[data-qa="quantity-input-submit"]'); getCartSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-summary"]'); @@ -59,9 +76,27 @@ export class B2cCartRepository implements CartRepository { getCartItemSummaryBlock = (itemIndex: number): Cypress.Chainable => cy.get('[data-qa="component product-card-item"]').eq(itemIndex); getCancelOrderAmendmentButton = (): Cypress.Chainable => cy.get('[data-qa="cancel-order-amendment-button"]'); - getProductCartItems = (): Cypress.Chainable => cy.get('[data-qa="component product-card-item"]'); + // The header's mini cart renders the same component for every line, marked with its mini-cart modifier. + getProductCartItems = (): Cypress.Chainable => + cy.get('[data-qa="component product-card-item"]:not(.product-card-item--mini-cart)'); getCartItemsListTitles = (): Cypress.Chainable => cy.get('[data-qa="component product-card-item"] [data-qa="product-title"]'); getCartItemAvailabilityLabel = (): Cypress.Chainable => cy.get('[data-qa="component product-cart-item"] [data-qa="component availability-product"]'); + getConfiguredBundles = (): Cypress.Chainable => cy.get('article[data-qa*="configured-bundle-secondary"]'); + getConfiguredBundle = (bundleName: string): Cypress.Chainable => + cy.contains('article[data-qa*="configured-bundle-secondary"]', bundleName).first(); + // The bundle's quantity counter has no submit button: it submits its form itself a moment after the value + // changes, so the form is submitted directly instead of waiting on that timer. + changeConfiguredBundleQuantity = (bundleName: string, quantity: number): void => { + const input = this.getConfiguredBundle(bundleName).find('input.formatted-number-input__input').first(); + + input.type('{selectall}', { force: true }); + input.type(String(quantity), { force: true }); + this.getConfiguredBundle(bundleName).find('form[action*="configured-bundle/change"]').first().submit(); + }; + getClearCartFormSelector = (): string => '[data-qa="multi-cart-clear-form"]'; + + getConfigureButtonSelector = (): string => '[data-qa="component configuration-cart-form"] button'; + getCartItemRemovalFormSelector = (): string => 'form[name^="removeFromCartForm_"]'; } diff --git a/cypress/support/pages/yves/cart/repositories/b2c-cart-up-selling-products-repository.ts b/cypress/support/pages/yves/cart/repositories/b2c-cart-up-selling-products-repository.ts index 3cc9e29b6..176d11ffb 100644 --- a/cypress/support/pages/yves/cart/repositories/b2c-cart-up-selling-products-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2c-cart-up-selling-products-repository.ts @@ -4,10 +4,10 @@ import { CartUpSellingProductsRepository } from '../cart-up-selling-products-rep @injectable() export class B2cCartUpSellingProductsRepository implements CartUpSellingProductsRepository { getUpSellingCarousel(): Cypress.Chainable { - return cy.get('.simple-carousel__container'); + return cy.get('.slick-carousel__container'); } getUpSellingProductItems(): Cypress.Chainable { - return cy.get('.simple-carousel__container [data-qa="component product-item"]'); + return cy.get('.slick-carousel__container [data-qa="component product-item"]'); } } diff --git a/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-repository.ts index b0848b17a..1183b6ded 100644 --- a/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-repository.ts @@ -3,6 +3,17 @@ import { CartRepository } from '../cart-repository'; @injectable() export class B2cMpCartRepository implements CartRepository { + // The approver's actions live on the cart page, not the summary, and put the approval's id at + // the end of the path - /quote-approval/approve/8 - the opposite way round to the requester's + // cancel form. A cart waiting for approval is also locked, which the reset-lock form marks. + getLockedCartResetForm = (): Cypress.Chainable => cy.get('form[action$="/cart/reset-lock"]'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); + // The share widget renders one url-mask-generator per share option group. Clicking the group's + // toggler fires the cart/create-link AJAX, which renders the generated link into an input whose + // id is the share option - PREVIEW for the external group. + getExternalCartShareToggle = (): Cypress.Chainable => + cy.get('url-mask-generator[shareoptiongroup="external"]').find('.js-toggler-radio__trigger'); + getExternalCartShareLinkInput = (): Cypress.Chainable => cy.get('#PREVIEW'); getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component product-quick-add-form"] input').first(); getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); @@ -49,6 +60,12 @@ export class B2cMpCartRepository implements CartRepository { getCheckoutButton = (): Cypress.Chainable => cy.get('[data-qa="cart-go-to-checkout"]:visible'); getCartSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-summary"]'); getCartDiscountSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-discount-summary"]'); + // Scoped to one tile by sku, because any other active promotion discount offers its own product + // in the same carousel. The tile shows the product name only; the sku is in its group key input. + getPromotionalProductAddToCartButton = (sku: string): Cypress.Chainable => + cy.get( + `[data-qa="component product-item"]:has(input[name="groupKey"][value="${sku}"]) [data-qa="add-to-cart-button"]` + ); getCustomOrderReferenceInput = (): Cypress.Chainable => cy.get('[data-qa="component order-custom-reference-form"] input[type=text]'); getCustomOrderReferenceSubmitButton = (): Cypress.Chainable => @@ -59,9 +76,25 @@ export class B2cMpCartRepository implements CartRepository { getCartItemSummaryBlock = (itemIndex: number): Cypress.Chainable => cy.get('[data-qa="component product-card-item"]').eq(itemIndex); getCancelOrderAmendmentButton = (): Cypress.Chainable => cy.get('[data-qa="cancel-order-amendment-button"]'); - getProductCartItems = (): Cypress.Chainable => cy.get('[data-qa="component product-card-item"]'); + // The header's mini cart renders the same component for every line, marked with its mini-cart modifier. + getProductCartItems = (): Cypress.Chainable => + cy.get('[data-qa="component product-card-item"]:not(.product-card-item--mini-cart)'); getCartItemsListTitles = (): Cypress.Chainable => cy.get('[data-qa="component product-card-item"] [data-qa="product-title"]'); getCartItemAvailabilityLabel = (): Cypress.Chainable => cy.get('[data-qa="component product-cart-item"] [data-qa="component availability-product"]'); + getConfiguredBundles = (): Cypress.Chainable => cy.get('article[data-qa*="configured-bundle-secondary"]'); + getConfiguredBundle = (bundleName: string): Cypress.Chainable => + cy.contains('article[data-qa*="configured-bundle-secondary"]', bundleName).first(); + changeConfiguredBundleQuantity = (bundleName: string, quantity: number): void => { + const input = this.getConfiguredBundle(bundleName).find('input.formatted-number-input__input').first(); + + input.type('{selectall}', { force: true }); + input.type(String(quantity), { force: true }); + this.getConfiguredBundle(bundleName).find('[data-qa="quantity-input-submit"]').first().click({ timeout: 10000 }); + }; + getClearCartFormSelector = (): string => '[data-qa="multi-cart-clear-form"]'; + + getConfigureButtonSelector = (): string => '[data-qa="component configuration-cart-form"] button'; + getCartItemRemovalFormSelector = (): string => 'form[name^="removeFromCartForm_"]'; } diff --git a/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-up-selling-products-repository.ts b/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-up-selling-products-repository.ts index 29ee1fb63..5c1832b5e 100644 --- a/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-up-selling-products-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/b2c-mp-cart-up-selling-products-repository.ts @@ -4,10 +4,10 @@ import { CartUpSellingProductsRepository } from '../cart-up-selling-products-rep @injectable() export class B2cMpCartUpSellingProductsRepository implements CartUpSellingProductsRepository { getUpSellingCarousel(): Cypress.Chainable { - return cy.get('.simple-carousel__container'); + return cy.get('.slick-carousel__container'); } getUpSellingProductItems(): Cypress.Chainable { - return cy.get('.simple-carousel__container [data-qa="component product-item"]'); + return cy.get('.slick-carousel__container [data-qa="component product-item"]'); } } diff --git a/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts index a3cf86bc3..1e2bda005 100644 --- a/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts +++ b/cypress/support/pages/yves/cart/repositories/suite-cart-repository.ts @@ -3,6 +3,17 @@ import { CartRepository } from '../cart-repository'; @injectable() export class SuiteCartRepository implements CartRepository { + // The approver's actions live on the cart page, not the summary, and put the approval's id at + // the end of the path - /quote-approval/approve/8 - the opposite way round to the requester's + // cancel form. A cart waiting for approval is also locked, which the reset-lock form marks. + getLockedCartResetForm = (): Cypress.Chainable => cy.get('form[action$="/cart/reset-lock"]'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); + // The share widget renders one url-mask-generator per share option group. Clicking the group's + // toggler fires the cart/create-link AJAX, which renders the generated link into an input whose + // id is the share option - PREVIEW for the external group. + getExternalCartShareToggle = (): Cypress.Chainable => + cy.get('url-mask-generator[shareoptiongroup="external"]').find('.js-toggler-radio__trigger'); + getExternalCartShareLinkInput = (): Cypress.Chainable => cy.get('#PREVIEW'); getQuickAddToCartSkuField = (): Cypress.Chainable => cy.get('[data-qa="component product-quick-add-form"] input').first(); getQuickAddToCartProductListField = (): Cypress.Chainable => cy.get('[data-qa="component products-list"]'); @@ -49,6 +60,10 @@ export class SuiteCartRepository implements CartRepository { getCheckoutButton = (): Cypress.Chainable => cy.get('[data-qa="cart-go-to-checkout"]'); getCartSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-summary"]'); getCartDiscountSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-discount-summary"]'); + // Scoped to one tile by sku, because any other active promotion discount offers its own product + // in the same carousel. + getPromotionalProductAddToCartButton = (sku: string): Cypress.Chainable => + cy.contains('[data-qa="component product-item"]', sku).find('[data-qa="add-to-cart-button"]'); getCustomOrderReferenceInput = (): Cypress.Chainable => cy.get('[data-qa="component order-custom-reference-form"] input[type=text]'); getCustomOrderReferenceSubmitButton = (): Cypress.Chainable => @@ -63,4 +78,18 @@ export class SuiteCartRepository implements CartRepository { getCartItemsListTitles = (): Cypress.Chainable => cy.get('[data-qa="component product-cart-items-list"] .title--h4'); getCartItemAvailabilityLabel = (): Cypress.Chainable => cy.get('[data-qa="component product-cart-item"] [data-qa="component status"]'); + getConfiguredBundles = (): Cypress.Chainable => cy.get('article[data-qa*="configured-bundle"]'); + getConfiguredBundle = (bundleName: string): Cypress.Chainable => + cy.contains('article[data-qa*="configured-bundle"]', bundleName).first(); + changeConfiguredBundleQuantity = (bundleName: string, quantity: number): void => { + const input = this.getConfiguredBundle(bundleName).find('input.formatted-number-input__input').first(); + + input.type('{selectall}', { force: true }); + input.type(String(quantity), { force: true }); + this.getConfiguredBundle(bundleName).find('[data-qa="quantity-input-submit"]').first().click({ timeout: 10000 }); + }; + getClearCartFormSelector = (): string => '[data-qa="multi-cart-clear-form"]'; + + getConfigureButtonSelector = (): string => '[data-qa="component configuration-cart-form"] button'; + getCartItemRemovalFormSelector = (): string => 'form[name^="removeFromCartForm_"]'; } diff --git a/cypress/support/pages/yves/catalog/catalog-page.ts b/cypress/support/pages/yves/catalog/catalog-page.ts index 99cfcc5e1..d23a32555 100644 --- a/cypress/support/pages/yves/catalog/catalog-page.ts +++ b/cypress/support/pages/yves/catalog/catalog-page.ts @@ -4,6 +4,12 @@ import { inject, injectable } from 'inversify'; import { YvesPage } from '@pages/yves'; import { CatalogRepository } from './catalog-repository'; +const SEARCH_INDEX_RELOAD_ATTEMPTS = 25; + +const SEARCH_INDEX_RELOAD_INTERVAL_MS = 5000; + +const SEARCH_INDEX_SYNC_COMMANDS = ['console queue:worker:start --stop-when-empty']; + @injectable() @autoWired export class CatalogPage extends YvesPage { @@ -23,6 +29,21 @@ export class CatalogPage extends YvesPage { }); }; + // Types the query and waits for the suggestion response without following it, so a spec can assert + // whether a product is offered at all. The results page is not usable for that: it does not list a + // freshly created product even when the suggestion endpoint already does. + searchSuggestionsFor = (params: SearchParams): void => { + if (this.isRepository('b2c', 'b2c-mp')) { + cy.get('.header__search-open').click(); + } + + this.repository.getSearchInput().clear().invoke('val', params.query); + cy.intercept('**/search/suggestion**').as('searchSuggestion'); + cy.wait('@searchSuggestion'); + }; + + getSuggestedProducts = (): Cypress.Chainable => cy.get(this.repository.getSuggestedProductSelector()); + search = (params: SearchParams): void => { if (this.isRepository('b2c', 'b2c-mp')) { cy.get('.header__search-open').click(); @@ -43,8 +64,145 @@ export class CatalogPage extends YvesPage { }); }; + searchForProducts = (params: SearchParams): void => { + if (this.isRepository('b2c', 'b2c-mp')) { + cy.get('.header__search-open').click(); + } + + this.repository.getSearchInput().clear().type(`${params.query}{enter}`); + + cy.url().then((url) => { + cy.reloadUntilFound(url, this.repository.getFirstProductItemBlockSelector(), 'body', 25, 5000); + }); + }; + + // The suggestion dropdown ranks by completion rather than by exact sku, so a sku query can put a + // different product first. Opening the detail page from the result blocks keeps it exact. + openProductDetailPageFromResults = (params: OpenProductDetailPageFromResultsParams): void => { + // Resolved in one query. Chaining find() off a block reference breaks with a detached subject + // when the results page is still settling, which it is right after a reload-until-found loop. + cy.get( + `${this.repository.getProductItemBlockSelector()}:contains("${params.productName}") ${this.repository.getViewButtonSelector()}` + ) + .first() + .click(); + }; + getProductItemBlocks = (): Cypress.Chainable => this.repository.getProductItemBlocks(); + // A sku query returns a single card, which is why the first block is the product under test — the + // same narrowing the Robot suite used before this spec existed. + getFirstProductItemDefaultPrice = (): Cypress.Chainable => + this.repository.getProductItemBlocks().first().find(this.repository.getProductItemDefaultPriceSelector()); + + getFirstProductItemOriginalPrice = (): Cypress.Chainable => + this.repository.getProductItemBlocks().first().find(this.repository.getProductItemOriginalPriceSelector()); + + getFirstProductItemEnabledAddToCartButton = (): Cypress.Chainable => + this.repository.getProductItemBlocks().first().find(this.repository.getEnabledAddToCartButtonSelector()); + + // The quick-add button has no form behind it. It does nothing until its webcomponent attaches the + // click handler in init(), and a click that lands before that is swallowed — no request, no error, + // no cart change. isMounted is what the component sets once the handler is on, and waiting for the + // add-ajax response is what proves the click was not lost. + quickAddFirstProductItemToCart = (): void => { + cy.intercept('**/cart/add-ajax/**').as('quickAddToCart'); + + this.getFirstProductItemEnabledAddToCartButton() + .closest('ajax-add-to-cart') + .should(($component) => { + expect($component[0]).to.have.property('isMounted', true); + }); + + this.getFirstProductItemEnabledAddToCartButton().click(); + cy.wait('@quickAddToCart').its('response.statusCode').should('eq', 200); + }; + + selectFirstProductItemColor = (params: SelectFirstProductItemColorParams): void => { + this.repository.selectColorSwatch(params.swatchIdentifier); + }; + + getFoundItemsCounter = (): Cypress.Chainable => cy.get(this.repository.getFoundItemsCounterSelector()); + + getFoundItemsCount = (): Cypress.Chainable => + this.getFoundItemsCounter() + .invoke('text') + .then((text: string) => Number(text.replace(/\D/g, ''))); + + getFirstProductItemDefaultPriceAmount = (): Cypress.Chainable => + this.getFirstProductItemDefaultPrice() + .invoke('text') + .then((text: string) => Number(text.replace(/[^\d.]/g, ''))); + + getFirstProductItemText = (): Cypress.Chainable => + this.repository.getProductItemBlocks().first().invoke('text'); + + getFilterTitles = (): Cypress.Chainable => cy.get(this.repository.getFilterTitlesSelector()); + + applyFilterValue = (params: ApplyFilterValueParams): void => { + cy.get(this.repository.getFilterValueCheckboxSelector(params.filterName, params.filterValue)).check({ + force: true, + }); + + this.submitCatalogChange(); + }; + + sortBy = (params: SortByParams): void => { + cy.get(this.repository.getSortSelectSelector()).select(params.sortLabel, { force: true }); + + this.submitCatalogChange(); + }; + + openCatalogPage = (params: OpenCatalogPageParams): void => { + cy.contains(this.repository.getPaginationStepSelector(), String(params.pageNumber)).first().click(); + }; + + // Some themes apply a facet or sort change on the control itself, others only once the catalog + // trigger is pressed. Clicking it when it is there covers both without waiting on one that is not. + private submitCatalogChange = (): void => { + this.getBody().then(($body) => { + if ($body.find(this.repository.getApplyFiltersButtonSelector()).length) { + cy.get(this.repository.getApplyFiltersButtonSelector()).first().click(); + } + }); + }; + + openFirstProductDetailPageFromResults = (): void => { + cy.get(`${this.repository.getFirstProductItemBlockSelector()} ${this.repository.getViewButtonSelector()}`) + .first() + .click(); + }; + + // The search results are read from the search index, which a back office change reaches only + // through publish and sync, so the queue is drained and the results page reloaded until the card + // shows up. + waitUntilProductIsListed = (productName: string): void => { + cy.reloadUntilFound( + this.getSearchUrl(productName), + this.getProductItemBlockSelectorFor(productName), + 'body', + SEARCH_INDEX_RELOAD_ATTEMPTS, + SEARCH_INDEX_RELOAD_INTERVAL_MS, + SEARCH_INDEX_SYNC_COMMANDS + ); + }; + + waitUntilProductIsNotListed = (productName: string): void => { + cy.reloadUntilGone( + this.getSearchUrl(productName), + this.getProductItemBlockSelectorFor(productName), + 'body', + SEARCH_INDEX_RELOAD_ATTEMPTS, + SEARCH_INDEX_RELOAD_INTERVAL_MS, + SEARCH_INDEX_SYNC_COMMANDS + ); + }; + + private getSearchUrl = (query: string): string => `${this.PAGE_URL}?q=${encodeURIComponent(query)}`; + + private getProductItemBlockSelectorFor = (productName: string): string => + `${this.repository.getProductItemBlockSelector()}:contains("${productName}")`; + getSspAssetSelectorBlock = (): Cypress.Chainable => this.repository.getSspAssetSelectorBlock(); getSspAssetNameBlock = (): Cypress.Chainable => this.repository.getSspAssetNameBlock(); @@ -59,6 +217,27 @@ export class CatalogPage extends YvesPage { }; } +interface ApplyFilterValueParams { + filterName: string; + filterValue: string; +} + +interface SortByParams { + sortLabel: string; +} + +interface OpenCatalogPageParams { + pageNumber: number; +} + +interface SelectFirstProductItemColorParams { + swatchIdentifier: string; +} + +interface OpenProductDetailPageFromResultsParams { + productName: string; +} + interface SearchParams { query: string; } diff --git a/cypress/support/pages/yves/catalog/catalog-repository.ts b/cypress/support/pages/yves/catalog/catalog-repository.ts index d26fc1577..f156e5e82 100644 --- a/cypress/support/pages/yves/catalog/catalog-repository.ts +++ b/cypress/support/pages/yves/catalog/catalog-repository.ts @@ -1,11 +1,40 @@ export interface CatalogRepository { getSearchInput(): Cypress.Chainable; getFirstSuggestedProduct(): Cypress.Chainable; + + // The suggestion dropdown's product entries, as a selector so a spec can assert their absence — + // a restricted product is simply not offered, so there is nothing to query for. + getSuggestedProductSelector(): string; getSearchButton(): Cypress.Chainable; getProductItemBlocks(): Cypress.Chainable; getFirstProductItemBlockSelector(): string; + getProductItemBlockSelector(): string; getViewButtonSelector(): string; getItemBlockSearchQuery(query: string): string; + + // A card prints the default price always and the original price only when one is set above it, so + // the two need distinct selectors — the classes are the same in every storefront theme. + getProductItemDefaultPriceSelector(): string; + getProductItemOriginalPriceSelector(): string; + + // The "N items found" counter. This is the one catalog selector the themes genuinely disagree on. + getFoundItemsCounterSelector(): string; + + // Facet headings, and the checkbox a facet value is applied through. The checkbox name and value + // come from the search request builder rather than from the theme, so they are shared. + getFilterTitlesSelector(): string; + getFilterValueCheckboxSelector(filterName: string, filterValue: string): string; + getApplyFiltersButtonSelector(): string; + getSortSelectSelector(): string; + getPaginationStepSelector(): string; + + // The quick-add button, narrowed to the interactive one: an unbuyable card still renders the + // button, only disabled, so matching it unconditionally would report an offer that is not there. + getEnabledAddToCartButtonSelector(): string; + + // Picking a group sibling's colour is a click in some themes and a hover in others, so the + // interaction belongs with the selector rather than in the page object. + selectColorSwatch(swatchIdentifier: string): void; getSspAssetSelectorBlock(): Cypress.Chainable; getSspAssetNameBlock(): Cypress.Chainable; getSspAssetSelectorTriggerButton(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/catalog/repositories/b2b-catalog-repository.ts b/cypress/support/pages/yves/catalog/repositories/b2b-catalog-repository.ts index f5a0c9c3a..e2c1fb2a8 100644 --- a/cypress/support/pages/yves/catalog/repositories/b2b-catalog-repository.ts +++ b/cypress/support/pages/yves/catalog/repositories/b2b-catalog-repository.ts @@ -6,9 +6,11 @@ import * as Cypress from 'cypress'; export class B2bCatalogRepository implements CatalogRepository { getSearchInput = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] input:visible').first(); getFirstSuggestedProduct = (): Cypress.Chainable => cy.get('[data-qa="component suggestion-product"] a').first(); + getSuggestedProductSelector = (): string => '[data-qa="component suggestion-product"]'; getSearchButton = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] [type="submit"]:visible'); getProductItemBlocks = (): Cypress.Chainable => cy.get('[data-qa="component product-item"]'); getFirstProductItemBlockSelector = (): string => '[data-qa="component product-item"]:first'; + getProductItemBlockSelector = (): string => '[data-qa="component product-item"]'; getViewButtonSelector = (): string => 'a:contains("View")'; getItemBlockSearchQuery = (query: string): string => `a:contains("${query}")`; getSspAssetSelectorBlock = (): Cypress.Chainable => cy.get('[data-qa="component asset-selector"]'); @@ -17,4 +19,29 @@ export class B2bCatalogRepository implements CatalogRepository { getSspAssetOption = (name: string): Cypress.Chainable => cy.get('[data-qa="component asset-option"]').filter(`:contains("${name}")`); getSspAssetOptionTriggerButtonSelector = (): string => '[data-qa="asset-option-trigger"]'; + + getProductItemDefaultPriceSelector = (): string => 'span[class*="default-price"]'; + getProductItemOriginalPriceSelector = (): string => 'span[class*="original-price"]'; + + getEnabledAddToCartButtonSelector = (): string => 'ajax-add-to-cart button:not([disabled])'; + selectColorSwatch = (swatchIdentifier: string): void => { + cy.get('[data-qa="component product-item"] product-item-color-selector') + .first() + .contains('[class*="tooltip"]', swatchIdentifier) + .parents('button') + .first() + .trigger('mouseenter', { force: true }); + }; + + // The classic theme counts the results in its sort bar, the redesigned one in its catalog header. + getFoundItemsCounterSelector = (): string => '[class*="col--counter"], [class*="catalog-header__count"]'; + getFilterTitlesSelector = (): string => '[class*="filter"] [class*="title"]'; + getFilterValueCheckboxSelector = (filterName: string, filterValue: string): string => + `input[type="checkbox"][name="${filterName}[]"][value="${filterValue}"]`; + // The redesigned theme's apply button is a small one; the classic theme renders a big one at the + // foot of its filter section. + getApplyFiltersButtonSelector = (): string => + 'button.js-catalog__trigger.button--small, button.js-catalog__trigger.filter-section__button'; + getSortSelectSelector = (): string => 'select[name="sort"]'; + getPaginationStepSelector = (): string => 'a[class*="pagination__step"]'; } diff --git a/cypress/support/pages/yves/catalog/repositories/b2b-mp-catalog-repository.ts b/cypress/support/pages/yves/catalog/repositories/b2b-mp-catalog-repository.ts index 6f4f30d09..707be57d7 100644 --- a/cypress/support/pages/yves/catalog/repositories/b2b-mp-catalog-repository.ts +++ b/cypress/support/pages/yves/catalog/repositories/b2b-mp-catalog-repository.ts @@ -6,9 +6,11 @@ import * as Cypress from 'cypress'; export class B2bMpCatalogRepository implements CatalogRepository { getSearchInput = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] input:visible').first(); getFirstSuggestedProduct = (): Cypress.Chainable => cy.get('[data-qa="component suggestion-product"] a').first(); + getSuggestedProductSelector = (): string => '[data-qa="component suggestion-product"]'; getSearchButton = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] [type="submit"]:visible'); getProductItemBlocks = (): Cypress.Chainable => cy.get('[data-qa="component product-item"]'); getFirstProductItemBlockSelector = (): string => '[data-qa="component product-item"]:first'; + getProductItemBlockSelector = (): string => '[data-qa="component product-item"]'; getViewButtonSelector = (): string => 'a:contains("View")'; getItemBlockSearchQuery = (query: string): string => `a:contains("${query}")`; getSspAssetSelectorBlock = (): Cypress.Chainable => cy.get('[data-qa="component asset-selector"]'); @@ -18,4 +20,25 @@ export class B2bMpCatalogRepository implements CatalogRepository { getSspAssetOption = (name: string): Cypress.Chainable => cy.get('[data-qa="component asset-option"]').filter(':visible').filter(`:contains("${name}")`); getSspAssetOptionTriggerButtonSelector = (): string => '[data-qa="asset-option-trigger"]'; + + getProductItemDefaultPriceSelector = (): string => 'span[class*="default-price"]'; + getProductItemOriginalPriceSelector = (): string => 'span[class*="original-price"]'; + + getEnabledAddToCartButtonSelector = (): string => 'ajax-add-to-cart button:not([disabled])'; + selectColorSwatch = (swatchIdentifier: string): void => { + cy.get('[data-qa="component product-item"] product-item-color-selector') + .first() + .contains('[class*="tooltip"]', swatchIdentifier) + .parents('button') + .first() + .trigger('mouseover'); + }; + + getFoundItemsCounterSelector = (): string => '[class*="catalog-header__count"]'; + getFilterTitlesSelector = (): string => 'filter-section [class*="filter-section__item-title"]'; + getFilterValueCheckboxSelector = (filterName: string, filterValue: string): string => + `input[type="checkbox"][name="${filterName}[]"][value="${filterValue}"]`; + getApplyFiltersButtonSelector = (): string => 'button.js-catalog__trigger.button--small'; + getSortSelectSelector = (): string => 'select[name="sort"]'; + getPaginationStepSelector = (): string => 'a[class*="pagination__step"]'; } diff --git a/cypress/support/pages/yves/catalog/repositories/b2c-catalog-repository.ts b/cypress/support/pages/yves/catalog/repositories/b2c-catalog-repository.ts index 775940ea0..325f124cc 100644 --- a/cypress/support/pages/yves/catalog/repositories/b2c-catalog-repository.ts +++ b/cypress/support/pages/yves/catalog/repositories/b2c-catalog-repository.ts @@ -6,9 +6,11 @@ import * as Cypress from 'cypress'; export class B2cCatalogRepository implements CatalogRepository { getSearchInput = (): Cypress.Chainable => cy.get('[name="q"]'); getFirstSuggestedProduct = (): Cypress.Chainable => cy.get('[data-qa="component suggestion-product"] a').first(); + getSuggestedProductSelector = (): string => '[data-qa="component suggestion-product"]'; getSearchButton = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] [type="submit"]:visible'); getProductItemBlocks = (): Cypress.Chainable => cy.get('[data-qa="component product-item"]'); getFirstProductItemBlockSelector = (): string => '[data-qa="component product-item"]:first'; + getProductItemBlockSelector = (): string => '[data-qa="component product-item"]'; getViewButtonSelector = (): string => 'a:first'; getItemBlockSearchQuery = (query: string): string => `span:contains("${query}")`; getSspAssetSelectorBlock = (): Cypress.Chainable => cy.get('[data-qa="component asset-selector"]'); @@ -17,4 +19,25 @@ export class B2cCatalogRepository implements CatalogRepository { getSspAssetOption = (name: string): Cypress.Chainable => cy.get('[data-qa="component asset-option"]').filter(`:contains("${name}")`); getSspAssetOptionTriggerButtonSelector = (): string => '[data-qa="asset-option-trigger"]'; + + getProductItemDefaultPriceSelector = (): string => 'span[class*="default-price"]'; + getProductItemOriginalPriceSelector = (): string => 'span[class*="original-price"]'; + + getEnabledAddToCartButtonSelector = (): string => 'ajax-add-to-cart button:not([disabled])'; + selectColorSwatch = (swatchIdentifier: string): void => { + cy.get('[data-qa="component product-item"] product-item-color-selector') + .first() + .contains('[class*="tooltip"]', swatchIdentifier) + .parents('button') + .first() + .trigger('mouseover'); + }; + + getFoundItemsCounterSelector = (): string => '[class*="sort__results"]'; + getFilterTitlesSelector = (): string => '[class*="filter"] [class*="title"]'; + getFilterValueCheckboxSelector = (filterName: string, filterValue: string): string => + `input[type="checkbox"][name="${filterName}[]"][value="${filterValue}"]`; + getApplyFiltersButtonSelector = (): string => 'button.js-catalog__trigger.button--large'; + getSortSelectSelector = (): string => 'select[name="sort"]'; + getPaginationStepSelector = (): string => 'a[class*="pagination__step"]'; } diff --git a/cypress/support/pages/yves/catalog/repositories/b2c-mp-catalog-repository.ts b/cypress/support/pages/yves/catalog/repositories/b2c-mp-catalog-repository.ts index 895441fb1..47601dfc5 100644 --- a/cypress/support/pages/yves/catalog/repositories/b2c-mp-catalog-repository.ts +++ b/cypress/support/pages/yves/catalog/repositories/b2c-mp-catalog-repository.ts @@ -6,9 +6,11 @@ import * as Cypress from 'cypress'; export class B2cMpCatalogRepository implements CatalogRepository { getSearchInput = (): Cypress.Chainable => cy.get('[name="q"]'); getFirstSuggestedProduct = (): Cypress.Chainable => cy.get('[data-qa="component suggestion-product"] a').first(); + getSuggestedProductSelector = (): string => '[data-qa="component suggestion-product"]'; getSearchButton = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] [type="submit"]:visible'); getProductItemBlocks = (): Cypress.Chainable => cy.get('[data-qa="component product-item"]'); getFirstProductItemBlockSelector = (): string => '[data-qa="component product-item"]:first'; + getProductItemBlockSelector = (): string => '[data-qa="component product-item"]'; getViewButtonSelector = (): string => 'a:first'; getItemBlockSearchQuery = (query: string): string => `span:contains("${query}")`; getSspAssetSelectorBlock = (): Cypress.Chainable => cy.get('[data-qa="component asset-selector"]'); @@ -17,4 +19,25 @@ export class B2cMpCatalogRepository implements CatalogRepository { getSspAssetOption = (name: string): Cypress.Chainable => cy.get('[data-qa="component asset-option"]').filter(`:contains("${name}")`); getSspAssetOptionTriggerButtonSelector = (): string => '[data-qa="asset-option-trigger"]'; + + getProductItemDefaultPriceSelector = (): string => 'span[class*="default-price"]'; + getProductItemOriginalPriceSelector = (): string => 'span[class*="original-price"]'; + + getEnabledAddToCartButtonSelector = (): string => 'ajax-add-to-cart button:not([disabled])'; + selectColorSwatch = (swatchIdentifier: string): void => { + cy.get('[data-qa="component product-item"] product-item-color-selector') + .first() + .contains('[class*="tooltip"]', swatchIdentifier) + .parents('button') + .first() + .trigger('mouseover'); + }; + + getFoundItemsCounterSelector = (): string => '[class*="sort__results"]'; + getFilterTitlesSelector = (): string => '[class*="filter"] [class*="title"]'; + getFilterValueCheckboxSelector = (filterName: string, filterValue: string): string => + `input[type="checkbox"][name="${filterName}[]"][value="${filterValue}"]`; + getApplyFiltersButtonSelector = (): string => 'button.js-catalog__trigger.button--large'; + getSortSelectSelector = (): string => 'select[name="sort"]'; + getPaginationStepSelector = (): string => 'a[class*="pagination__step"]'; } diff --git a/cypress/support/pages/yves/catalog/repositories/suite-catalog-repository.ts b/cypress/support/pages/yves/catalog/repositories/suite-catalog-repository.ts index de4641eb1..f3c2a992c 100644 --- a/cypress/support/pages/yves/catalog/repositories/suite-catalog-repository.ts +++ b/cypress/support/pages/yves/catalog/repositories/suite-catalog-repository.ts @@ -6,9 +6,11 @@ import * as Cypress from 'cypress'; export class SuiteCatalogRepository implements CatalogRepository { getSearchInput = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] input').first(); getFirstSuggestedProduct = (): Cypress.Chainable => cy.get('[data-qa="component suggestion-product"] a').first(); + getSuggestedProductSelector = (): string => '[data-qa="component suggestion-product"]'; getSearchButton = (): Cypress.Chainable => cy.get('[data-qa="component search-form"] [type="submit"]:visible'); getProductItemBlocks = (): Cypress.Chainable => cy.get('[data-qa="component product-item"]'); getFirstProductItemBlockSelector = (): string => '[data-qa="component product-item"]:first'; + getProductItemBlockSelector = (): string => '[data-qa="component product-item"]'; getViewButtonSelector = (): string => 'a:contains("View")'; getItemBlockSearchQuery = (query: string): string => `span:contains("${query}")`; getSspAssetSelectorBlock = (): Cypress.Chainable => cy.get('[data-qa="component asset-selector"]'); @@ -17,4 +19,22 @@ export class SuiteCatalogRepository implements CatalogRepository { getSspAssetOption = (name: string): Cypress.Chainable => cy.get('[data-qa="component asset-option"]').filter(`:contains("${name}")`); getSspAssetOptionTriggerButtonSelector = (): string => '[data-qa="asset-option-trigger"]'; + + getProductItemDefaultPriceSelector = (): string => 'span[class*="default-price"]'; + getProductItemOriginalPriceSelector = (): string => 'span[class*="original-price"]'; + + getEnabledAddToCartButtonSelector = (): string => 'ajax-add-to-cart button:not([disabled])'; + selectColorSwatch = (swatchIdentifier: string): void => { + cy.get(`[data-qa="component product-item"] product-item-color-selector button[style*="${swatchIdentifier}"]`) + .first() + .click(); + }; + + getFoundItemsCounterSelector = (): string => '[data-qa="component sort"] strong'; + getFilterTitlesSelector = (): string => 'section[data-qa="component filter-section"] [class*="title"]'; + getFilterValueCheckboxSelector = (filterName: string, filterValue: string): string => + `input[type="checkbox"][name="${filterName}[]"][value="${filterValue}"]`; + getApplyFiltersButtonSelector = (): string => 'button.js-catalog__trigger.button--small'; + getSortSelectSelector = (): string => 'select[name="sort"]'; + getPaginationStepSelector = (): string => 'a[class*="pagination__step"]'; } 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 1387be37d..4f41ea202 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-page.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-page.ts @@ -45,89 +45,111 @@ export class CheckoutAddressPage extends YvesPage { this.repository.getMultiShipmentTriggerButton().click(); } - this.repository - .getMultiShipmentAddressItemElement() - .children() - .each(($addressItem, index) => { - const hasServicePointUuid = Boolean( - this.repository.getMultiShipmentAddressItemServicePointUuidValue?.($addressItem, index) - ); - - if ( - params?.servicePointSelection && - (hasServicePointUuid || $addressItem.text().includes(params.servicePointSelection.productName)) - ) { - this.selectServicePointForAddressItem($addressItem, index, params.servicePointSelection); - - return; - } + if (params?.hasOwnAddressPerItem) { + this.uncheckSameAddressForAllItems(); + } - if (params?.skipServicePointAddressOverride && hasServicePointUuid) { - // Pre-checked from the quote — assert instead of re-checking, so a hidden radio cannot mask it - if (params.shipmentType) { - this.repository - .getMultiShipmentAddressItemShipmentTypeRadio?.(index, params.shipmentType) - .should('be.checked'); - } + const addressItems = + params?.hasOwnAddressPerItem && this.repository.getMultiShipmentAddressItemsWithOwnAddress + ? this.repository.getMultiShipmentAddressItemsWithOwnAddress() + : this.repository.getMultiShipmentAddressItemElement().children(); - return; - } + addressItems.each(($addressItem, index) => { + const hasServicePointUuid = Boolean( + this.repository.getMultiShipmentAddressItemServicePointUuidValue?.($addressItem, index) + ); - const checkoutAddress = this.createDummyCheckoutAddress(); + if ( + params?.servicePointSelection && + (hasServicePointUuid || $addressItem.text().includes(params.servicePointSelection.productName)) + ) { + this.selectServicePointForAddressItem($addressItem, index, params.servicePointSelection); - if (!this.isRepository('b2c', 'b2b', 'b2b-mp')) { - this.repository.getMultiShipmentAddressItemDeliveryRadio($addressItem, index).click({ force: true }); - } + return; + } - if (params?.idCustomerAddress) { + if (params?.skipServicePointAddressOverride && hasServicePointUuid) { + // Pre-checked from the quote — assert instead of re-checking, so a hidden radio cannot mask it + if (params.shipmentType) { this.repository - .getMultiShipmentAddressItemAddressField($addressItem, index) - .select(params.idCustomerAddress.toString(), { force: true }); - - return; + .getMultiShipmentAddressItemShipmentTypeRadio?.(index, params.shipmentType) + .should('be.checked'); } - this.repository.getMultiShipmentAddressItemAddressField($addressItem, index).select('0', { force: true }); + return; + } - // Setting mandatory fields - this.repository - .getMultiShipmentAddressItemAddressFirstNameField($addressItem, index) - .clear() - .type(checkoutAddress.firstName, { delay: 0 }); - this.repository - .getMultiShipmentAddressItemAddressLastNameField($addressItem, index) - .clear() - .type(checkoutAddress.lastName, { delay: 0 }); - this.repository - .getMultiShipmentAddressItemAddressAddress1Field($addressItem, index) - .clear() - .type(checkoutAddress.address1, { delay: 0 }); - this.repository - .getMultiShipmentAddressItemAddressAddress2Field($addressItem, index) - .clear() - .type(checkoutAddress.address2, { delay: 0 }); - this.repository - .getMultiShipmentAddressItemAddressZipCodeField($addressItem, index) - .clear() - .type(checkoutAddress.zipCode, { delay: 0 }); - this.repository - .getMultiShipmentAddressItemAddressCityField($addressItem, index) - .clear() - .type(checkoutAddress.city, { delay: 0 }); + const checkoutAddress = this.createDummyCheckoutAddress(); + if (!this.isRepository('b2c', 'b2b', 'b2b-mp')) { + this.repository.getMultiShipmentAddressItemDeliveryRadio($addressItem, index).click({ force: true }); + } + + if (params?.idCustomerAddress) { this.repository - .getMultiShipmentAddressItemAddressCompanyField($addressItem, index) - .clear() - .type(checkoutAddress.company, { delay: 0 }); - this.repository - .getMultiShipmentAddressItemAddressPhoneField($addressItem, index) - .clear() - .type(checkoutAddress.phone, { delay: 0 }); - }); + .getMultiShipmentAddressItemAddressField($addressItem, index) + .select(params.idCustomerAddress.toString(), { force: true }); + + return; + } + + this.repository.getMultiShipmentAddressItemAddressField($addressItem, index).select('0', { force: true }); + + // Setting mandatory fields + this.repository + .getMultiShipmentAddressItemAddressFirstNameField($addressItem, index) + .clear() + .type(checkoutAddress.firstName, { delay: 0 }); + this.repository + .getMultiShipmentAddressItemAddressLastNameField($addressItem, index) + .clear() + .type(checkoutAddress.lastName, { delay: 0 }); + this.repository + .getMultiShipmentAddressItemAddressAddress1Field($addressItem, index) + .clear() + .type(checkoutAddress.address1, { delay: 0 }); + this.repository + .getMultiShipmentAddressItemAddressAddress2Field($addressItem, index) + .clear() + .type(checkoutAddress.address2, { delay: 0 }); + this.repository + .getMultiShipmentAddressItemAddressZipCodeField($addressItem, index) + .clear() + .type(checkoutAddress.zipCode, { delay: 0 }); + this.repository + .getMultiShipmentAddressItemAddressCityField($addressItem, index) + .clear() + .type(checkoutAddress.city, { delay: 0 }); + + this.repository + .getMultiShipmentAddressItemAddressCompanyField($addressItem, index) + .clear() + .type(checkoutAddress.company, { delay: 0 }); + this.repository + .getMultiShipmentAddressItemAddressPhoneField($addressItem, index) + .clear() + .type(checkoutAddress.phone, { delay: 0 }); + }); this.fillBillingAddress(); }; + // The self-service portal checks "same address for all items" per shipment type group by default and hides + // every other item's address form behind it; a shop without the portal has no such checkbox. + uncheckSameAddressForAllItems = (): void => { + const checkboxSelector = this.repository.getSameAddressForAllItemsCheckboxSelector?.(); + + if (!checkboxSelector) { + return; + } + + cy.get('body').then(($body) => { + if ($body.find(`${checkboxSelector}:checked`).length) { + cy.get(`${checkboxSelector}:checked`).uncheck({ force: true }); + } + }); + }; + fillSingleCheckoutAddress = (params?: FillShippingAddressParams): void => { const checkoutAddress = this.createDummyCheckoutAddress(); @@ -251,10 +273,77 @@ export class CheckoutAddressPage extends YvesPage { phone: this.faker.phone.number(), }; }; + + // Collecting at a service point on a single-shipment cart: choose the shipment type, then the + // location. Picking a service point is what replaces the item's delivery address with the + // store's, so no shipping address is filled here. + selectPickupAtServicePoint = (params: SelectPickupAtServicePointParams): void => { + this.repository.getShipmentTypeRadio(params.shipmentTypeKey).click({ force: true }); + this.repository.getSelectServicePointButton().first().click({ force: true }); + this.repository.getServicePointFinderInput?.().clear().type(params.servicePointName); + this.repository.getServicePointFinderListItem?.(params.servicePointName).first().click(); + }; + + setBillingSameAsShipping = (isSame: boolean): void => { + const checkbox = this.repository.getShippingAddressBillingSameAsShippingCheckbox(); + + if (isSame) { + checkbox.check({ force: true }); + + return; + } + + checkbox.uncheck({ force: true }); + }; + + // A business unit address is offered in the same select as the customer's own addresses, but + // its option value is not an id_customer_address, so it is chosen by its visible label. + selectShippingAddressByText = (addressText: string): void => { + this.repository + .getShippingAddressSelectElement() + .contains('option', addressText) + .then(($option: JQuery) => { + this.repository.getShippingAddressSelectElement().select($option.val() as string, { force: true }); + }); + }; + + typeBillingAddress = (address: CheckoutAddressInput): void => { + this.repository.getSelectBillingAddressField().select('0', { force: true }); + + this.repository.getBillingAddressFirstNameField().clear().type(address.firstName, { delay: 0 }); + this.repository.getBillingAddressLastNameField().clear().type(address.lastName, { delay: 0 }); + this.repository.getBillingAddressAddress1Field().clear().type(address.address1, { delay: 0 }); + this.repository.getBillingAddressAddress2Field().clear().type(address.address2, { delay: 0 }); + this.repository.getBillingAddressZipCodeField().clear().type(address.zipCode, { delay: 0 }); + this.repository.getBillingAddressCityField().clear().type(address.city, { delay: 0 }); + this.repository.getBillingAddressCompanyField().clear().type(address.company, { delay: 0 }); + this.repository.getBillingAddressPhoneField().clear().type(address.phone, { delay: 0 }); + }; + + submitAddressStep = (): void => { + this.repository.getNextButton().click(); + }; +} + +interface SelectPickupAtServicePointParams { + shipmentTypeKey: string; + servicePointName: string; +} + +export interface CheckoutAddressInput { + firstName: string; + lastName: string; + address1: string; + address2: string; + zipCode: string; + city: string; + company: string; + phone: string; } interface FillShippingAddressParams { idCustomerAddress?: number; + hasOwnAddressPerItem?: boolean; shipmentType?: string; skipServicePointAddressOverride?: boolean; servicePointSelection?: ServicePointSelection; diff --git a/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts index 4cdb1899d..b3efa81b7 100644 --- a/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/checkout-address-repository.ts @@ -1,4 +1,6 @@ export interface CheckoutAddressRepository { + getSelectServicePointButton(): Cypress.Chainable; + getShippingAddressSelectElement(): Cypress.Chainable; getSelectShippingAddressField(): Cypress.Chainable; getShippingAddressFirstNameField(): Cypress.Chainable; getShippingAddressLastNameField(): Cypress.Chainable; @@ -40,6 +42,8 @@ export interface CheckoutAddressRepository { getMultiShipmentAddressItemShipmentTypeRadio?(index: number, shipmentTypeKey: string): Cypress.Chainable; getMultiShipmentAddressItemSelectServicePointButton?($addressItem: JQuery): Cypress.Chainable; getServicePointFinderInput?(): Cypress.Chainable; + getSameAddressForAllItemsCheckboxSelector?(): string; + getMultiShipmentAddressItemsWithOwnAddress?(): Cypress.Chainable; getServicePointFinderListItem?(servicePointName: string): Cypress.Chainable; getMultiShipmentAddressItemServicePointUuidInput?(index: number): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/checkout/address/repositories/b2b-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/b2b-checkout-address-repository.ts index acfe61b3e..2956c457d 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/b2b-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/b2b-checkout-address-repository.ts @@ -4,6 +4,14 @@ import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() export class B2bCheckoutAddressRepository implements CheckoutAddressRepository { + // The single-shipment address form offers the service point through its own selector component; + // the multi-shipment getters above are per address item and do not match here. + getSelectServicePointButton = (): Cypress.Chainable => + cy.get('[data-qa="component service-point-selector"]').find('button'); + // With an active company user the shipping select is rendered with no id and named + // checkout-full-addresses, so an id-based getter finds nothing. This class sits on the select + // in both layouts, and is what a business unit address has to be picked through. + getShippingAddressSelectElement = (): Cypress.Chainable => cy.get('.js-address__form-select-shippingAddress'); getSelectShippingAddressField = (): Cypress.Chainable => { return cy.get('body').then((body) => { if (body.find('#addressesForm_shippingAddress_id_customer_address').length === 1) { @@ -13,14 +21,19 @@ export class B2bCheckoutAddressRepository implements CheckoutAddressRepository { return cy.get('[name="checkout-full-addresses"]').first(); }); }; - getShippingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_first_name'); - getShippingAddressLastNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_last_name'); - getShippingAddressAddress1Field = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_address1'); - getShippingAddressAddress2Field = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_address2'); - getShippingAddressZipCodeField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_zip_code'); - getShippingAddressCityField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_city'); - getShippingAddressCompanyField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_company'); - getShippingAddressPhoneField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_phone'); + getShippingAddressFirstNameField = (): Cypress.Chainable => + this.revealAndGet('#addressesForm_shippingAddress_first_name'); + getShippingAddressLastNameField = (): Cypress.Chainable => + this.revealAndGet('#addressesForm_shippingAddress_last_name'); + getShippingAddressAddress1Field = (): Cypress.Chainable => + this.revealAndGet('#addressesForm_shippingAddress_address1'); + getShippingAddressAddress2Field = (): Cypress.Chainable => + this.revealAndGet('#addressesForm_shippingAddress_address2'); + getShippingAddressZipCodeField = (): Cypress.Chainable => + this.revealAndGet('#addressesForm_shippingAddress_zip_code'); + getShippingAddressCityField = (): Cypress.Chainable => this.revealAndGet('#addressesForm_shippingAddress_city'); + getShippingAddressCompanyField = (): Cypress.Chainable => this.revealAndGet('#addressesForm_shippingAddress_company'); + getShippingAddressPhoneField = (): Cypress.Chainable => this.revealAndGet('#addressesForm_shippingAddress_phone'); getShippingAddressBillingSameAsShippingCheckbox = (): Cypress.Chainable => cy.get('#addressesForm_billingSameAsShipping input'); getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); @@ -109,4 +122,18 @@ export class B2bCheckoutAddressRepository implements CheckoutAddressRepository { const servicePointUuid = $addressItem.find(`input[name*="[servicePoint][uuid]"]`).val() as string | undefined; return servicePointUuid || undefined; }; + getSameAddressForAllItemsCheckboxSelector = (): string => 'input[name$="[isSingleAddressPerShipmentType]"]'; + // The self-service portal nests the item forms in one block per shipment type, so the list's children are those + // blocks; every theme wraps each item form in its own wrapper. + getMultiShipmentAddressItemsWithOwnAddress = (): Cypress.Chainable => + cy.get('[data-qa="component address-item-form-field-list"] .address-item-form-field-list__wrapper'); + + // The b2b-demo-marketplace build of this theme hides the new-address fields of the single shipping form until + // its self-service portal address toggle is used; the classic theme shows them, so this is a no-op there. + private revealAndGet = (selector: string): Cypress.Chainable => + cy.get(selector).then(($el) => { + $el.parents('.is-hidden').removeClass('is-hidden'); + + return $el; + }); } diff --git a/cypress/support/pages/yves/checkout/address/repositories/b2b-mp-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/b2b-mp-checkout-address-repository.ts index fec186cc2..b8bdd3e5a 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/b2b-mp-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/b2b-mp-checkout-address-repository.ts @@ -4,6 +4,14 @@ import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() export class B2bMpCheckoutAddressRepository implements CheckoutAddressRepository { + // The single-shipment address form offers the service point through its own selector component; + // the multi-shipment getters above are per address item and do not match here. + getSelectServicePointButton = (): Cypress.Chainable => + cy.get('[data-qa="component service-point-selector"]').find('button'); + // With an active company user the shipping select is rendered with no id and named + // checkout-full-addresses, so an id-based getter finds nothing. This class sits on the select + // in both layouts, and is what a business unit address has to be picked through. + getShippingAddressSelectElement = (): Cypress.Chainable => cy.get('.js-address__form-select-shippingAddress'); getSelectShippingAddressField = (): Cypress.Chainable => { return cy.get('body').then((body) => { if (body.find('#addressesForm_shippingAddress_id_customer_address').length === 1) { @@ -139,4 +147,9 @@ export class B2bMpCheckoutAddressRepository implements CheckoutAddressRepository return $el; }); + getSameAddressForAllItemsCheckboxSelector = (): string => 'input[name$="[isSingleAddressPerShipmentType]"]'; + // The self-service portal nests the item forms in one block per shipment type, so the list's children are those + // blocks; every theme wraps each item form in its own wrapper. + getMultiShipmentAddressItemsWithOwnAddress = (): Cypress.Chainable => + cy.get('[data-qa="component address-item-form-field-list"] .address-item-form-field-list__wrapper'); } diff --git a/cypress/support/pages/yves/checkout/address/repositories/b2c-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/b2c-checkout-address-repository.ts index b1fbe2268..32878a8c2 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/b2c-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/b2c-checkout-address-repository.ts @@ -4,6 +4,14 @@ import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() export class B2cCheckoutAddressRepository implements CheckoutAddressRepository { + // The single-shipment address form offers the service point through its own selector component; + // the multi-shipment getters above are per address item and do not match here. + getSelectServicePointButton = (): Cypress.Chainable => + cy.get('[data-qa="component service-point-selector"]').find('button'); + // With an active company user the shipping select is rendered with no id and named + // checkout-full-addresses, so an id-based getter finds nothing. This class sits on the select + // in both layouts, and is what a business unit address has to be picked through. + getShippingAddressSelectElement = (): Cypress.Chainable => cy.get('.js-address__form-select-shippingAddress'); getSelectShippingAddressField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_id_customer_address'); getShippingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_first_name'); getShippingAddressLastNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_last_name'); diff --git a/cypress/support/pages/yves/checkout/address/repositories/b2c-mp-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/b2c-mp-checkout-address-repository.ts index 2afdbdfe8..88f2d16cf 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/b2c-mp-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/b2c-mp-checkout-address-repository.ts @@ -4,6 +4,14 @@ import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() export class B2cMpCheckoutAddressRepository implements CheckoutAddressRepository { + // The single-shipment address form offers the service point through its own selector component; + // the multi-shipment getters above are per address item and do not match here. + getSelectServicePointButton = (): Cypress.Chainable => + cy.get('[data-qa="component service-point-selector"]').find('button'); + // With an active company user the shipping select is rendered with no id and named + // checkout-full-addresses, so an id-based getter finds nothing. This class sits on the select + // in both layouts, and is what a business unit address has to be picked through. + getShippingAddressSelectElement = (): Cypress.Chainable => cy.get('.js-address__form-select-shippingAddress'); getSelectShippingAddressField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_id_customer_address'); getShippingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_first_name'); getShippingAddressLastNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_last_name'); diff --git a/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts index 4522e3e5c..83c4abf08 100644 --- a/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts +++ b/cypress/support/pages/yves/checkout/address/repositories/suite-checkout-address-repository.ts @@ -4,6 +4,14 @@ import { CheckoutAddressRepository } from '../checkout-address-repository'; @injectable() export class SuiteCheckoutAddressRepository implements CheckoutAddressRepository { + // The single-shipment address form offers the service point through its own selector component; + // the multi-shipment getters above are per address item and do not match here. + getSelectServicePointButton = (): Cypress.Chainable => + cy.get('[data-qa="component service-point-selector"]').find('button'); + // With an active company user the shipping select is rendered with no id and named + // checkout-full-addresses, so an id-based getter finds nothing. This class sits on the select + // in both layouts, and is what a business unit address has to be picked through. + getShippingAddressSelectElement = (): Cypress.Chainable => cy.get('.js-address__form-select-shippingAddress'); getSelectShippingAddressField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_id_customer_address'); getShippingAddressFirstNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_first_name'); getShippingAddressLastNameField = (): Cypress.Chainable => cy.get('#addressesForm_shippingAddress_last_name'); diff --git a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts index 29caff8eb..2859ff7e6 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-page.ts @@ -29,4 +29,40 @@ export class CheckoutCustomerPage extends YvesPage { return guest.email; }; + + loginDuringCheckout = (params: LoginDuringCheckoutParams): void => { + this.repository.getLoginRadioButton().click({ force: true }); + + this.repository.getLoginEmailField().clear().type(params.email); + this.repository.getLoginPasswordField().clear().type(params.password, { log: false }); + + this.repository.getLoginSubmitButton().click(); + }; + + registerDuringCheckout = (params: RegisterDuringCheckoutParams): void => { + this.repository.getRegisterRadioButton().click({ force: true }); + + this.repository.getRegisterSalutationField().select(params.salutation, { force: true }); + this.repository.getRegisterFirstNameField().clear().type(params.firstName); + this.repository.getRegisterLastNameField().clear().type(params.lastName); + this.repository.getRegisterEmailField().clear().type(params.email); + this.repository.getRegisterPasswordField().clear().type(params.password, { log: false }); + this.repository.getRegisterConfirmPasswordField().clear().type(params.password, { log: false }); + this.repository.getRegisterTermsCheckbox().check({ force: true }); + + this.repository.getRegisterSubmitButton().click(); + }; +} + +interface LoginDuringCheckoutParams { + email: string; + password: string; +} + +interface RegisterDuringCheckoutParams { + salutation: string; + firstName: string; + lastName: string; + email: string; + password: string; } diff --git a/cypress/support/pages/yves/checkout/customer/checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/checkout-customer-repository.ts index ea791ed4c..022608b76 100644 --- a/cypress/support/pages/yves/checkout/customer/checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/checkout-customer-repository.ts @@ -5,4 +5,17 @@ export interface CheckoutCustomerRepository { getGuestEmailField(): Cypress.Chainable; getGuestTermsCheckbox(): Cypress.Chainable; getGuestSubmitButton(): Cypress.Chainable; + getLoginRadioButton(): Cypress.Chainable; + getRegisterRadioButton(): Cypress.Chainable; + getLoginEmailField(): Cypress.Chainable; + getLoginPasswordField(): Cypress.Chainable; + getLoginSubmitButton(): Cypress.Chainable; + getRegisterSalutationField(): Cypress.Chainable; + getRegisterFirstNameField(): Cypress.Chainable; + getRegisterLastNameField(): Cypress.Chainable; + getRegisterEmailField(): Cypress.Chainable; + getRegisterPasswordField(): Cypress.Chainable; + getRegisterConfirmPasswordField(): Cypress.Chainable; + getRegisterTermsCheckbox(): Cypress.Chainable; + getRegisterSubmitButton(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/checkout/customer/repositories/b2b-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/b2b-checkout-customer-repository.ts index 929274e45..be4fc92d7 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/b2b-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/b2b-checkout-customer-repository.ts @@ -11,4 +11,19 @@ export class B2bCheckoutCustomerRepository implements CheckoutCustomerRepository getGuestTermsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="component checkbox guestForm[customer][accept_terms] guestForm_customer_accept_terms"]'); getGuestSubmitButton = (): Cypress.Chainable => cy.get('[data-qa="guest-form-submit-button"]'); + getLoginRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"]'); + getRegisterRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"]'); + getLoginEmailField = (): Cypress.Chainable => cy.get('#loginForm_email'); + getLoginPasswordField = (): Cypress.Chainable => cy.get('#loginForm_password'); + getLoginSubmitButton = (): Cypress.Chainable => cy.get('form[name="loginForm"]').find('button[type="submit"]'); + getRegisterSalutationField = (): Cypress.Chainable => cy.get('#registerForm_customer_salutation'); + getRegisterFirstNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_first_name'); + getRegisterLastNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_last_name'); + getRegisterEmailField = (): Cypress.Chainable => cy.get('#registerForm_customer_email'); + getRegisterPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_pass'); + getRegisterConfirmPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_confirm'); + getRegisterTermsCheckbox = (): Cypress.Chainable => cy.get('#registerForm_customer_accept_terms'); + getRegisterSubmitButton = (): Cypress.Chainable => cy.get('[data-qa*="register-form"]').find('button[type="submit"]'); } diff --git a/cypress/support/pages/yves/checkout/customer/repositories/b2b-mp-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/b2b-mp-checkout-customer-repository.ts index f3cb6a355..1b09f98d8 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/b2b-mp-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/b2b-mp-checkout-customer-repository.ts @@ -11,4 +11,19 @@ export class B2bMpCheckoutCustomerRepository implements CheckoutCustomerReposito getGuestTermsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="component checkbox guestForm[customer][accept_terms] guestForm_customer_accept_terms"]'); getGuestSubmitButton = (): Cypress.Chainable => cy.get('[data-qa="guest-form-submit-button"]'); + getLoginRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"]'); + getRegisterRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"]'); + getLoginEmailField = (): Cypress.Chainable => cy.get('#loginForm_email'); + getLoginPasswordField = (): Cypress.Chainable => cy.get('#loginForm_password'); + getLoginSubmitButton = (): Cypress.Chainable => cy.get('form[name="loginForm"]').find('button[type="submit"]'); + getRegisterSalutationField = (): Cypress.Chainable => cy.get('#registerForm_customer_salutation'); + getRegisterFirstNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_first_name'); + getRegisterLastNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_last_name'); + getRegisterEmailField = (): Cypress.Chainable => cy.get('#registerForm_customer_email'); + getRegisterPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_pass'); + getRegisterConfirmPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_confirm'); + getRegisterTermsCheckbox = (): Cypress.Chainable => cy.get('#registerForm_customer_accept_terms'); + getRegisterSubmitButton = (): Cypress.Chainable => cy.get('[data-qa*="register-form"]').find('button[type="submit"]'); } diff --git a/cypress/support/pages/yves/checkout/customer/repositories/b2c-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/b2c-checkout-customer-repository.ts index e7f1fd02a..a6c737946 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/b2c-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/b2c-checkout-customer-repository.ts @@ -11,4 +11,19 @@ export class B2cCheckoutCustomerRepository implements CheckoutCustomerRepository getGuestTermsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="component checkbox guestForm[customer][accept_terms] guestForm_customer_accept_terms"]'); getGuestSubmitButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]:visible'); + getLoginRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs login"] input'); + getRegisterRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"] input'); + getLoginEmailField = (): Cypress.Chainable => cy.get('#loginForm_email'); + getLoginPasswordField = (): Cypress.Chainable => cy.get('#loginForm_password'); + getLoginSubmitButton = (): Cypress.Chainable => cy.get('form[name="loginForm"]').find('button[type="submit"]'); + getRegisterSalutationField = (): Cypress.Chainable => cy.get('#registerForm_customer_salutation'); + getRegisterFirstNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_first_name'); + getRegisterLastNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_last_name'); + getRegisterEmailField = (): Cypress.Chainable => cy.get('#registerForm_customer_email'); + getRegisterPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_pass'); + getRegisterConfirmPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_confirm'); + getRegisterTermsCheckbox = (): Cypress.Chainable => cy.get('#registerForm_customer_accept_terms'); + getRegisterSubmitButton = (): Cypress.Chainable => cy.get('[data-qa*="register-form"]').find('button[type="submit"]'); } diff --git a/cypress/support/pages/yves/checkout/customer/repositories/b2c-mp-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/b2c-mp-checkout-customer-repository.ts index 3e0ef431d..8910cf5d1 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/b2c-mp-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/b2c-mp-checkout-customer-repository.ts @@ -11,4 +11,19 @@ export class B2cMpCheckoutCustomerRepository implements CheckoutCustomerReposito getGuestTermsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="component checkbox guestForm[customer][accept_terms] guestForm_customer_accept_terms"]'); getGuestSubmitButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]:visible'); + getLoginRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs login"] input'); + getRegisterRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"] input'); + getLoginEmailField = (): Cypress.Chainable => cy.get('#loginForm_email'); + getLoginPasswordField = (): Cypress.Chainable => cy.get('#loginForm_password'); + getLoginSubmitButton = (): Cypress.Chainable => cy.get('form[name="loginForm"]').find('button[type="submit"]'); + getRegisterSalutationField = (): Cypress.Chainable => cy.get('#registerForm_customer_salutation'); + getRegisterFirstNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_first_name'); + getRegisterLastNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_last_name'); + getRegisterEmailField = (): Cypress.Chainable => cy.get('#registerForm_customer_email'); + getRegisterPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_pass'); + getRegisterConfirmPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_confirm'); + getRegisterTermsCheckbox = (): Cypress.Chainable => cy.get('#registerForm_customer_accept_terms'); + getRegisterSubmitButton = (): Cypress.Chainable => cy.get('[data-qa*="register-form"]').find('button[type="submit"]'); } diff --git a/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts b/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts index c7d0ea866..ac405dce7 100644 --- a/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts +++ b/cypress/support/pages/yves/checkout/customer/repositories/suite-checkout-customer-repository.ts @@ -11,4 +11,19 @@ export class SuiteCheckoutCustomerRepository implements CheckoutCustomerReposito getGuestTermsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="component checkbox guestForm[customer][accept_terms] guestForm_customer_accept_terms"]'); getGuestSubmitButton = (): Cypress.Chainable => cy.get('[data-qa="guest-form-submit-button"]'); + getLoginRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"]'); + getRegisterRadioButton = (): Cypress.Chainable => + cy.get('[data-qa="component toggler-radio checkoutProceedAs register"]'); + getLoginEmailField = (): Cypress.Chainable => cy.get('#loginForm_email'); + getLoginPasswordField = (): Cypress.Chainable => cy.get('#loginForm_password'); + getLoginSubmitButton = (): Cypress.Chainable => cy.get('form[name="loginForm"]').find('button[type="submit"]'); + getRegisterSalutationField = (): Cypress.Chainable => cy.get('#registerForm_customer_salutation'); + getRegisterFirstNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_first_name'); + getRegisterLastNameField = (): Cypress.Chainable => cy.get('#registerForm_customer_last_name'); + getRegisterEmailField = (): Cypress.Chainable => cy.get('#registerForm_customer_email'); + getRegisterPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_pass'); + getRegisterConfirmPasswordField = (): Cypress.Chainable => cy.get('#registerForm_customer_password_confirm'); + getRegisterTermsCheckbox = (): Cypress.Chainable => cy.get('#registerForm_customer_accept_terms'); + getRegisterSubmitButton = (): Cypress.Chainable => cy.get('[data-qa*="register-form"]').find('button[type="submit"]'); } diff --git a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts index 54debc285..49705ed1b 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-page.ts @@ -11,6 +11,18 @@ export class CheckoutPaymentPage extends YvesPage { protected PAGE_URL = '/checkout/payment'; + // Mirrors the dispatch CheckoutScenario does internally, for specs that drive the checkout + // steps themselves instead of going through the scenario. + setPaymentMethod = (paymentMethod: string): void => { + const paymentMethods: Record void> = { + dummyPaymentInvoice: () => this.setDummyPaymentMethod(), + dummyPaymentCreditCard: () => this.setDummyPaymentCreditCardMethod(), + dummyMarketplacePaymentInvoice: () => this.setDummyMarketplacePaymentMethod(), + }; + + paymentMethods[paymentMethod](); + }; + // Marketplace repositories ship only the marketplace invoice method, the others only the dummy invoice one. setDefaultPaymentMethod = (): void => { if (getPaymentMethodBasedOnEnv() === 'dummyMarketplacePaymentInvoice') { @@ -24,10 +36,10 @@ export class CheckoutPaymentPage extends YvesPage { setDummyPaymentMethod = (): void => { this.repository.getDummyPaymentInvoiceRadio().click({ force: true }); - - if (!this.isRepository('suite', 'b2b-mp', 'b2b')) { - this.repository.getDummyPaymentInvoiceDateField().clear().type('12.12.1999'); - } + this.typeDateOfBirthWhenAsked( + this.repository.getDummyPaymentInvoiceDateFieldSelector(), + this.repository.getDummyPaymentInvoiceDateField + ); this.repository.getGoToSummaryButton().click(); }; @@ -43,11 +55,24 @@ export class CheckoutPaymentPage extends YvesPage { setDummyMarketplacePaymentMethod = (): void => { this.repository.getDummyMarketplacePaymentInvoiceRadio().click({ force: true }); - - if (!this.isRepository('suite', 'b2b-mp', 'b2b')) { - this.repository.getDummyMarketplacePaymentInvoiceDateField().clear().type('12.12.1999'); - } + this.typeDateOfBirthWhenAsked( + this.repository.getDummyMarketplacePaymentInvoiceDateFieldSelector(), + this.repository.getDummyMarketplacePaymentInvoiceDateField + ); this.repository.getGoToSummaryButton().click(); }; + + // Whether the invoice asks for a date of birth is up to the shop's payment form, not the repository id: + // b2b-demo-shop requires it while the b2b lane of b2b-demo-marketplace renders no such field. + private typeDateOfBirthWhenAsked = (dateFieldSelector: string, getDateField: () => Cypress.Chainable): void => { + this.getBody().then(($body: JQuery): void => { + if ($body.find(`${dateFieldSelector}:visible`).length === 0) { + return; + } + + getDateField().clear(); + getDateField().type('12.12.1999'); + }); + }; } diff --git a/cypress/support/pages/yves/checkout/payment/checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/checkout-payment-repository.ts index 3f05b29ac..c31df5dc0 100644 --- a/cypress/support/pages/yves/checkout/payment/checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/checkout-payment-repository.ts @@ -1,8 +1,10 @@ export interface CheckoutPaymentRepository { getDummyPaymentInvoiceRadio(): Cypress.Chainable; + getDummyPaymentInvoiceDateFieldSelector(): string; getDummyPaymentInvoiceDateField(): Cypress.Chainable; getGoToSummaryButton(): Cypress.Chainable; getDummyMarketplacePaymentInvoiceRadio(): Cypress.Chainable; + getDummyMarketplacePaymentInvoiceDateFieldSelector(): string; getDummyMarketplacePaymentInvoiceDateField(): Cypress.Chainable; getDummyPaymentCreditCardRadio(): Cypress.Chainable; getDummyPaymentCreditCardNumberInput(): Cypress.Chainable; diff --git a/cypress/support/pages/yves/checkout/payment/repositories/b2b-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/b2b-checkout-payment-repository.ts index 5966d8dde..32a54f910 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/b2b-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/b2b-checkout-payment-repository.ts @@ -6,12 +6,15 @@ import { CheckoutPaymentRepository } from '../checkout-payment-repository'; export class B2bCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice input'); - getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); + getDummyPaymentInvoiceDateFieldSelector = (): string => '#paymentForm_dummyPaymentInvoice_date_of_birth'; + getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get(this.getDummyPaymentInvoiceDateFieldSelector()); getGoToSummaryButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getDummyMarketplacePaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyMarketplacePaymentInvoice input'); + getDummyMarketplacePaymentInvoiceDateFieldSelector = (): string => + '#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'; getDummyMarketplacePaymentInvoiceDateField = (): Cypress.Chainable => - cy.get('#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'); + cy.get(this.getDummyMarketplacePaymentInvoiceDateFieldSelector()); getDummyPaymentCreditCardRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentCreditCard input'); getDummyPaymentCreditCardNumberInput = (): Cypress.Chainable => diff --git a/cypress/support/pages/yves/checkout/payment/repositories/b2b-mp-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/b2b-mp-checkout-payment-repository.ts index 89a3b6e23..95d93d7ba 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/b2b-mp-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/b2b-mp-checkout-payment-repository.ts @@ -6,12 +6,15 @@ import { CheckoutPaymentRepository } from '../checkout-payment-repository'; export class B2bMpCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice input'); - getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); + getDummyPaymentInvoiceDateFieldSelector = (): string => '#paymentForm_dummyPaymentInvoice_date_of_birth'; + getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get(this.getDummyPaymentInvoiceDateFieldSelector()); getGoToSummaryButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getDummyMarketplacePaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyMarketplacePaymentInvoice input'); + getDummyMarketplacePaymentInvoiceDateFieldSelector = (): string => + '#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'; getDummyMarketplacePaymentInvoiceDateField = (): Cypress.Chainable => - cy.get('#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'); + cy.get(this.getDummyMarketplacePaymentInvoiceDateFieldSelector()); getDummyPaymentCreditCardRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentCreditCard input'); getDummyPaymentCreditCardNumberInput = (): Cypress.Chainable => diff --git a/cypress/support/pages/yves/checkout/payment/repositories/b2c-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/b2c-checkout-payment-repository.ts index 67f07ca8d..b1e6bad11 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/b2c-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/b2c-checkout-payment-repository.ts @@ -5,12 +5,15 @@ import { CheckoutPaymentRepository } from '../checkout-payment-repository'; @injectable() export class B2cCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice'); - getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); + getDummyPaymentInvoiceDateFieldSelector = (): string => '#paymentForm_dummyPaymentInvoice_date_of_birth'; + getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get(this.getDummyPaymentInvoiceDateFieldSelector()); getGoToSummaryButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getDummyMarketplacePaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyMarketplacePaymentInvoice'); + getDummyMarketplacePaymentInvoiceDateFieldSelector = (): string => + '#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'; getDummyMarketplacePaymentInvoiceDateField = (): Cypress.Chainable => - cy.get('#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'); + cy.get(this.getDummyMarketplacePaymentInvoiceDateFieldSelector()); getDummyPaymentCreditCardRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentCreditCard'); getDummyPaymentCreditCardNumberInput = (): Cypress.Chainable => diff --git a/cypress/support/pages/yves/checkout/payment/repositories/b2c-mp-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/b2c-mp-checkout-payment-repository.ts index b76796d26..eb995471f 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/b2c-mp-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/b2c-mp-checkout-payment-repository.ts @@ -5,12 +5,15 @@ import { CheckoutPaymentRepository } from '../checkout-payment-repository'; @injectable() export class B2cMpCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice'); - getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); + getDummyPaymentInvoiceDateFieldSelector = (): string => '#paymentForm_dummyPaymentInvoice_date_of_birth'; + getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get(this.getDummyPaymentInvoiceDateFieldSelector()); getGoToSummaryButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getDummyMarketplacePaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyMarketplacePaymentInvoice'); + getDummyMarketplacePaymentInvoiceDateFieldSelector = (): string => + '#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'; getDummyMarketplacePaymentInvoiceDateField = (): Cypress.Chainable => - cy.get('#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'); + cy.get(this.getDummyMarketplacePaymentInvoiceDateFieldSelector()); getDummyPaymentCreditCardRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentCreditCard'); getDummyPaymentCreditCardNumberInput = (): Cypress.Chainable => diff --git a/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts b/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts index 0299820a6..a24284cdb 100644 --- a/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts +++ b/cypress/support/pages/yves/checkout/payment/repositories/suite-checkout-payment-repository.ts @@ -5,12 +5,15 @@ import { CheckoutPaymentRepository } from '../checkout-payment-repository'; @injectable() export class SuiteCheckoutPaymentRepository implements CheckoutPaymentRepository { getDummyPaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentInvoice'); - getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get('#paymentForm_dummyPaymentInvoice_date_of_birth'); + getDummyPaymentInvoiceDateFieldSelector = (): string => '#paymentForm_dummyPaymentInvoice_date_of_birth'; + getDummyPaymentInvoiceDateField = (): Cypress.Chainable => cy.get(this.getDummyPaymentInvoiceDateFieldSelector()); getGoToSummaryButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getDummyMarketplacePaymentInvoiceRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyMarketplacePaymentInvoice'); + getDummyMarketplacePaymentInvoiceDateFieldSelector = (): string => + '#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'; getDummyMarketplacePaymentInvoiceDateField = (): Cypress.Chainable => - cy.get('#paymentForm_dummyMarketplacePaymentInvoice_dateOfBirth'); + cy.get(this.getDummyMarketplacePaymentInvoiceDateFieldSelector()); getDummyPaymentCreditCardRadio = (): Cypress.Chainable => cy.get('#paymentForm_paymentSelection_dummyPaymentCreditCard'); getDummyPaymentCreditCardNumberInput = (): Cypress.Chainable => diff --git a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-page.ts index 2d702cdb5..95cfdf074 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,16 @@ export class CheckoutShipmentPage extends YvesPage { this.repository.getStandardShipmentRadio($shipmentItem, index).click({ force: true }); }); + this.submitWithRequestedDeliveryDate(); + }; + + setShippingMethod = (methodName: string): void => { + this.repository.getShipmentMethodLabel(methodName).click({ force: true }); + + this.submitWithRequestedDeliveryDate(); + }; + + private submitWithRequestedDeliveryDate = (): void => { this.repository .getShipmentDateInput() .clear({ force: true }) 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 041d8b3e6..1bb53ef83 100644 --- a/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts +++ b/cypress/support/pages/yves/checkout/shipment/checkout-shipment-repository.ts @@ -3,4 +3,5 @@ export interface CheckoutShipmentRepository { getStandardShipmentRadio($shipmentItem: JQuery, index: number): Cypress.Chainable; getNextButton(): Cypress.Chainable; getShipmentDateInput(): Cypress.Chainable; + getShipmentMethodLabel(methodName: string): 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 22168765c..3f0c5e802 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 @@ -10,4 +10,6 @@ export class B2bCheckoutShipmentRepository implements CheckoutShipmentRepository getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getShipmentDateInput = (): Cypress.Chainable => cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); + getShipmentMethodLabel = (methodName: string): Cypress.Chainable => + cy.contains('[data-qa="multi-shipment-group"] label', methodName); } 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 4c7c41864..f1b9a343c 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 @@ -10,4 +10,6 @@ export class B2bMpCheckoutShipmentRepository implements CheckoutShipmentReposito getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getShipmentDateInput = (): Cypress.Chainable => cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); + getShipmentMethodLabel = (methodName: string): Cypress.Chainable => + cy.contains('[data-qa="multi-shipment-group"] label', methodName); } 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 df179e9a2..4917f63ad 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 @@ -10,4 +10,6 @@ export class B2cCheckoutShipmentRepository implements CheckoutShipmentRepository getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getShipmentDateInput = (): Cypress.Chainable => cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); + getShipmentMethodLabel = (methodName: string): Cypress.Chainable => + cy.contains('[data-qa="multi-shipment-group"] label', methodName); } 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 8c8114bf6..4f32ecfcc 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 @@ -10,4 +10,6 @@ export class B2cMpCheckoutShipmentRepository implements CheckoutShipmentReposito getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getShipmentDateInput = (): Cypress.Chainable => cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); + getShipmentMethodLabel = (methodName: string): Cypress.Chainable => + cy.contains('[data-qa="multi-shipment-group"] label', methodName); } 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 c61258640..be1740f31 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 @@ -10,4 +10,6 @@ export class SuiteCheckoutShipmentRepository implements CheckoutShipmentReposito getNextButton = (): Cypress.Chainable => cy.get('[data-qa="submit-button"]'); getShipmentDateInput = (): Cypress.Chainable => cy.get('#shipmentCollectionForm_shipmentGroups_0_shipment_requestedDeliveryDate'); + getShipmentMethodLabel = (methodName: string): Cypress.Chainable => + cy.contains('[data-qa="multi-shipment-group"] label', methodName); } diff --git a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts index fb528334b..1490073b6 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-page.ts @@ -11,8 +11,29 @@ export class CheckoutSummaryPage extends YvesPage { protected PAGE_URL = '/checkout/summary'; + // The order-success page carries the reference only as schema.org metadata, which is the sole + // handle a guest has on the order it just placed: there is no order history to read it back from. + getPlacedOrderReference = (): Cypress.Chainable => + cy.get('meta[itemprop="identifier"]', { timeout: 15000 }).invoke('attr', 'content'); + + requestApproval = (idCompanyUser: number): void => { + this.repository.getApproverSelect().select(idCompanyUser.toString(), { force: true }); + this.repository.getSendApprovalRequestButton().click(); + }; + + // The approver decides on the checkout summary, the one page every theme renders the approval widget on. + approve = (): void => { + this.repository.getApproveButton().click(); + }; + + getApprovalStatus = (): Cypress.Chainable => this.repository.getApprovalStatus(); + + getCancelApprovalRequestButton = (): Cypress.Chainable => this.repository.getCancelApprovalRequestButton(); + placeOrder = (): void => { - this.repository.getaAcceptTermsAndConditionsCheckbox().should('be.visible', { timeout: 1000 }); + // The b2c themes render a styled checkbox over a transparent native input, which Cypress never reports + // as visible; presence is what every theme shares. + this.repository.getaAcceptTermsAndConditionsCheckbox().should('exist'); this.repository.getaAcceptTermsAndConditionsCheckbox().check({ force: true }); this.repository.getSummaryForm().submit(); }; diff --git a/cypress/support/pages/yves/checkout/summary/checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/checkout-summary-repository.ts index 9f3c8fba3..3200c2e2f 100644 --- a/cypress/support/pages/yves/checkout/summary/checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/checkout-summary-repository.ts @@ -1,4 +1,9 @@ export interface CheckoutSummaryRepository { + getApproverSelect(): Cypress.Chainable; + getSendApprovalRequestButton(): Cypress.Chainable; + getCancelApprovalRequestButton(): Cypress.Chainable; + getApproveButton(): Cypress.Chainable; + getApprovalStatus(): Cypress.Chainable; getaAcceptTermsAndConditionsCheckbox(): Cypress.Chainable; getSummaryForm(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/checkout/summary/repositories/b2b-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/b2b-checkout-summary-repository.ts index 9095c6c54..0dab0f3bf 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/b2b-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/b2b-checkout-summary-repository.ts @@ -4,6 +4,17 @@ import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() export class B2bCheckoutSummaryRepository implements CheckoutSummaryRepository { + // The approval widget's three actions are plain POST forms distinguished only by the path they + // post to, and none carries a data-qa. The paths are locale-prefixed, and approve and remove + // carry the approval's id between the segments - /DE/en/quote-approval/2/remove - so they are + // matched on the trailing action rather than on a single contiguous substring. + getApproverSelect = (): Cypress.Chainable => cy.get('form[action$="/quote-approval/create"]').find('select'); + getSendApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action$="/quote-approval/create"]').find('button[type="submit"]'); + getCancelApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action*="/quote-approval/"][action$="/remove"]').find('button'); + getApproveButton = (): Cypress.Chainable => cy.get('form[action*="/quote-approval/approve/"]').find('button'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="accept-terms-and-conditions-input"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); diff --git a/cypress/support/pages/yves/checkout/summary/repositories/b2b-mp-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/b2b-mp-checkout-summary-repository.ts index 0242d4a1f..dda5c62fa 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/b2b-mp-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/b2b-mp-checkout-summary-repository.ts @@ -4,6 +4,17 @@ import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() export class B2bMpCheckoutSummaryRepository implements CheckoutSummaryRepository { + // The approval widget's three actions are plain POST forms distinguished only by the path they + // post to, and none carries a data-qa. The paths are locale-prefixed, and approve and remove + // carry the approval's id between the segments - /DE/en/quote-approval/2/remove - so they are + // matched on the trailing action rather than on a single contiguous substring. + getApproverSelect = (): Cypress.Chainable => cy.get('form[action$="/quote-approval/create"]').find('select'); + getSendApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action$="/quote-approval/create"]').find('button[type="submit"]'); + getCancelApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action*="/quote-approval/"][action$="/remove"]').find('button'); + getApproveButton = (): Cypress.Chainable => cy.get('form[action*="/quote-approval/approve/"]').find('button'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="accept-terms-and-conditions-input"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); diff --git a/cypress/support/pages/yves/checkout/summary/repositories/b2c-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/b2c-checkout-summary-repository.ts index 48dc7c496..a847fdf77 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/b2c-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/b2c-checkout-summary-repository.ts @@ -4,6 +4,17 @@ import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() export class B2cCheckoutSummaryRepository implements CheckoutSummaryRepository { + // The approval widget's three actions are plain POST forms distinguished only by the path they + // post to, and none carries a data-qa. The paths are locale-prefixed, and approve and remove + // carry the approval's id between the segments - /DE/en/quote-approval/2/remove - so they are + // matched on the trailing action rather than on a single contiguous substring. + getApproverSelect = (): Cypress.Chainable => cy.get('form[action$="/quote-approval/create"]').find('select'); + getSendApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action$="/quote-approval/create"]').find('button[type="submit"]'); + getCancelApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action*="/quote-approval/"][action$="/remove"]').find('button'); + getApproveButton = (): Cypress.Chainable => cy.get('form[action*="/quote-approval/approve/"]').find('button'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="accept-terms-and-conditions-input"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); diff --git a/cypress/support/pages/yves/checkout/summary/repositories/b2c-mp-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/b2c-mp-checkout-summary-repository.ts index 2f95d7c1b..242c71d2d 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/b2c-mp-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/b2c-mp-checkout-summary-repository.ts @@ -4,6 +4,17 @@ import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() export class B2cMpCheckoutSummaryRepository implements CheckoutSummaryRepository { + // The approval widget's three actions are plain POST forms distinguished only by the path they + // post to, and none carries a data-qa. The paths are locale-prefixed, and approve and remove + // carry the approval's id between the segments - /DE/en/quote-approval/2/remove - so they are + // matched on the trailing action rather than on a single contiguous substring. + getApproverSelect = (): Cypress.Chainable => cy.get('form[action$="/quote-approval/create"]').find('select'); + getSendApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action$="/quote-approval/create"]').find('button[type="submit"]'); + getCancelApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action*="/quote-approval/"][action$="/remove"]').find('button'); + getApproveButton = (): Cypress.Chainable => cy.get('form[action*="/quote-approval/approve/"]').find('button'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="accept-terms-and-conditions-input"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); diff --git a/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts b/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts index 795490eaa..aba86b4a3 100644 --- a/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts +++ b/cypress/support/pages/yves/checkout/summary/repositories/suite-checkout-summary-repository.ts @@ -4,6 +4,17 @@ import { CheckoutSummaryRepository } from '../checkout-summary-repository'; @injectable() export class SuiteCheckoutSummaryRepository implements CheckoutSummaryRepository { + // The approval widget's three actions are plain POST forms distinguished only by the path they + // post to, and none carries a data-qa. The paths are locale-prefixed, and approve and remove + // carry the approval's id between the segments - /DE/en/quote-approval/2/remove - so they are + // matched on the trailing action rather than on a single contiguous substring. + getApproverSelect = (): Cypress.Chainable => cy.get('form[action$="/quote-approval/create"]').find('select'); + getSendApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action$="/quote-approval/create"]').find('button[type="submit"]'); + getCancelApprovalRequestButton = (): Cypress.Chainable => + cy.get('form[action*="/quote-approval/"][action$="/remove"]').find('button'); + getApproveButton = (): Cypress.Chainable => cy.get('form[action*="/quote-approval/approve/"]').find('button'); + getApprovalStatus = (): Cypress.Chainable => cy.get('.quote-status'); getaAcceptTermsAndConditionsCheckbox = (): Cypress.Chainable => cy.get('[data-qa="accept-terms-and-conditions-input"]'); getSummaryForm = (): Cypress.Chainable => cy.get('form[name=summaryForm]'); diff --git a/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts index 816f8be33..7e36d0a73 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/b2b-comment-cart-repository.ts @@ -4,8 +4,9 @@ import { CommentCartRepository } from '../comment-cart-repository'; @injectable() export class B2bCommentCartRepository implements CommentCartRepository { getAddCommentForm = (): Cypress.Chainable => cy.get('[data-qa="component add-comment-form"]'); - getCommentThreadListSection = (): Cypress.Chainable => - cy.get('[data-qa="component cart-sidebar-item"]').find('[data-qa="component add-comment-form"]').parent(); + // The thread sits in a cart sidebar item on the cart page but in a plain box on the order + // details page, so it is found through its own add form rather than the sidebar. + getCommentThreadListSection = (): Cypress.Chainable => cy.get('[data-qa="component add-comment-form"]').parent(); getAddCommentButtonSelector = (): string => '[data-qa="component icon"]'; getRemoveCommentButtonSelector = (): string => { if (Cypress.env('isDynamicStoreEnabled')) { diff --git a/cypress/support/pages/yves/comment/cart/repositories/b2b-mp-comment-cart-repository.ts b/cypress/support/pages/yves/comment/cart/repositories/b2b-mp-comment-cart-repository.ts index 3ef8fe889..0d002740e 100644 --- a/cypress/support/pages/yves/comment/cart/repositories/b2b-mp-comment-cart-repository.ts +++ b/cypress/support/pages/yves/comment/cart/repositories/b2b-mp-comment-cart-repository.ts @@ -4,8 +4,9 @@ import { CommentCartRepository } from '../comment-cart-repository'; @injectable() export class B2bMpCommentCartRepository implements CommentCartRepository { getAddCommentForm = (): Cypress.Chainable => cy.get('[data-qa="component add-comment-form"]'); - getCommentThreadListSection = (): Cypress.Chainable => - cy.get('[data-qa="component cart-sidebar-item"]').find('[data-qa="component add-comment-form"]').parent(); + // The thread sits in a cart sidebar item on the cart page but in a plain box on the order + // details page, so it is found through its own add form rather than the sidebar. + getCommentThreadListSection = (): Cypress.Chainable => cy.get('[data-qa="component add-comment-form"]').parent(); getAddCommentButtonSelector = (): string => '[data-qa="component icon"]'; getRemoveCommentButtonSelector = (): string => { if (Cypress.env('isDynamicStoreEnabled')) { diff --git a/cypress/support/pages/yves/company/business-unit/create/company-business-unit-create-page.ts b/cypress/support/pages/yves/company/business-unit/create/company-business-unit-create-page.ts new file mode 100644 index 000000000..76a2e1506 --- /dev/null +++ b/cypress/support/pages/yves/company/business-unit/create/company-business-unit-create-page.ts @@ -0,0 +1,24 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; +import { CompanyBusinessUnitCreateRepository } from './company-business-unit-create-repository'; + +@injectable() +@autoWired +export class CompanyBusinessUnitCreatePage extends YvesPage { + @inject(CompanyBusinessUnitCreateRepository) private repository: CompanyBusinessUnitCreateRepository; + + protected PAGE_URL = '/company/business-unit'; + + create = (params: CreateParams): void => { + this.repository.getCreateButton().click(); + this.repository.getNameInput().clear().type(params.name); + this.repository.getEmailInput().clear().type(params.email); + this.repository.getSubmitButton().click(); + }; +} + +interface CreateParams { + name: string; + email: string; +} diff --git a/cypress/support/pages/yves/company/business-unit/create/company-business-unit-create-repository.ts b/cypress/support/pages/yves/company/business-unit/create/company-business-unit-create-repository.ts new file mode 100644 index 000000000..d52a7c761 --- /dev/null +++ b/cypress/support/pages/yves/company/business-unit/create/company-business-unit-create-repository.ts @@ -0,0 +1,12 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CompanyBusinessUnitCreateRepository { + getCreateButton = (): Cypress.Chainable => cy.get('a[href*="business-unit/create"]'); + getNameInput = (): Cypress.Chainable => cy.get('#company_business_unit_form_name'); + getEmailInput = (): Cypress.Chainable => cy.get('#company_business_unit_form_email'); + getSubmitButton = (): Cypress.Chainable => + cy.get('form[name="company_business_unit_form"]').find('[data-qa="submit-button"]'); +} diff --git a/cypress/support/pages/yves/company/register/repositories/b2b-company-registration-repository.ts b/cypress/support/pages/yves/company/register/repositories/b2b-company-registration-repository.ts index 16d7663ce..b326d5666 100644 --- a/cypress/support/pages/yves/company/register/repositories/b2b-company-registration-repository.ts +++ b/cypress/support/pages/yves/company/register/repositories/b2b-company-registration-repository.ts @@ -15,7 +15,10 @@ export class B2bCompanyRegistrationRepository implements CompanyRegistrationRepo // The checkbox atom renders an outer span carrying the same name/id, so the selector must pin the input. getAcceptTermsCheckbox = (): Cypress.Chainable => cy.get('input[name="company_register_form[accept_terms]"]'); getRegistrationForm = (): Cypress.Chainable => cy.get('form[name="company_register_form"]'); - getPageTitle = (): Cypress.Chainable => cy.get('[data-qa="page-title"]'); + // The redesigned theme heads the page with an auth layout title; the classic theme titles the form + // molecule itself. + getPageTitle = (): Cypress.Chainable => + cy.get('[data-qa="page-title"], [data-qa="component form"]:has(form[name="company_register_form"]) h2.title'); getPageTitleText = (): string => 'Create account'; getRegistrationCompletedMessage = (): string => 'Almost there! We send you an email to validate your email address. Please confirm it to be able to log in.'; diff --git a/cypress/support/pages/yves/company/user/create/company-user-create-page.ts b/cypress/support/pages/yves/company/user/create/company-user-create-page.ts new file mode 100644 index 000000000..cee61b200 --- /dev/null +++ b/cypress/support/pages/yves/company/user/create/company-user-create-page.ts @@ -0,0 +1,47 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; +import { CompanyUserCreateRepository } from './company-user-create-repository'; + +@injectable() +@autoWired +export class CompanyUserCreatePage extends YvesPage { + @inject(CompanyUserCreateRepository) private repository: CompanyUserCreateRepository; + + protected PAGE_URL = '/company/user'; + + create = (params: CreateParams): void => { + this.repository.getCreateButton().click(); + this.selectBusinessUnitByName(params.businessUnitName); + this.repository.getRoleCheckboxLabel(params.roleName).check({ force: true }); + this.repository.getEmailInput().clear().type(params.email); + this.repository.getFirstNameInput().clear().type(params.firstName); + this.repository.getLastNameInput().clear().type(params.lastName); + this.repository.getSubmitButton().click(); + }; + + getUserRow = (businessUnitName: string): Cypress.Chainable => + this.repository.getUserRowByBusinessUnitName(businessUnitName); + + /** + * The options are labelled " (ID: )", so an exact-text select can never match a bare + * name. Read the id off the option whose label carries the name, then select by that. + */ + private selectBusinessUnitByName = (name: string): void => { + this.repository + .getBusinessUnitSelect() + .find('option') + .contains(name) + .then(($option) => { + this.repository.getBusinessUnitSelect().select($option.val() as string, { force: true }); + }); + }; +} + +interface CreateParams { + businessUnitName: string; + roleName: string; + email: string; + firstName: string; + lastName: string; +} diff --git a/cypress/support/pages/yves/company/user/create/company-user-create-repository.ts b/cypress/support/pages/yves/company/user/create/company-user-create-repository.ts new file mode 100644 index 000000000..b16ec1825 --- /dev/null +++ b/cypress/support/pages/yves/company/user/create/company-user-create-repository.ts @@ -0,0 +1,21 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class CompanyUserCreateRepository { + getCreateButton = (): Cypress.Chainable => cy.get('a[href*="company/user/create"]'); + getBusinessUnitSelect = (): Cypress.Chainable => cy.get('select[id*="company_business_unit"]'); + getEmailInput = (): Cypress.Chainable => cy.get('#company_user_form_email'); + getFirstNameInput = (): Cypress.Chainable => cy.get('#company_user_form_first_name'); + getLastNameInput = (): Cypress.Chainable => cy.get('#company_user_form_last_name'); + getSubmitButton = (): Cypress.Chainable => cy.get('form[name="company_user_form"]').find('[data-qa="submit-button"]'); + + // The roles render as checkboxes whose label carries the role name, so the label is the handle. + getRoleCheckboxLabel = (roleName: string): Cypress.Chainable => + cy.contains('label', roleName).find('input[id*="company_role_collection"]'); + + // The users table has no email column, so the business unit name is the only run-unique handle on the row. + getUserRowByBusinessUnitName = (businessUnitName: string): Cypress.Chainable => + cy.contains('table tr', businessUnitName); +} diff --git a/cypress/support/pages/yves/company/user/select/company-user-select-page.ts b/cypress/support/pages/yves/company/user/select/company-user-select-page.ts index 34b6bd278..a7c7c4e1a 100644 --- a/cypress/support/pages/yves/company/user/select/company-user-select-page.ts +++ b/cypress/support/pages/yves/company/user/select/company-user-select-page.ts @@ -10,6 +10,10 @@ export class CompanyUserSelectPage extends YvesPage { protected PAGE_URL = '/company/user/select'; + getBusinessUnitOptions = (): Cypress.Chainable => this.repository.getBusinessUnitOptions(); + + getActiveBusinessUnit = (): Cypress.Chainable => this.repository.getActiveBusinessUnit(); + selectBusinessUnit = (params: SelectBusinessUnitParams): void => { this.repository.getBusinessUnitSelect().select(params.idCompanyUser.toString(), { force: true }); this.repository.getSubmitButton().click(); diff --git a/cypress/support/pages/yves/company/user/select/company-user-select-repository.ts b/cypress/support/pages/yves/company/user/select/company-user-select-repository.ts index 4efbc3d81..09da76f9f 100644 --- a/cypress/support/pages/yves/company/user/select/company-user-select-repository.ts +++ b/cypress/support/pages/yves/company/user/select/company-user-select-repository.ts @@ -1,4 +1,6 @@ export interface CompanyUserSelectRepository { getBusinessUnitSelect(): Cypress.Chainable; getSubmitButton(): Cypress.Chainable; + getBusinessUnitOptions(): Cypress.Chainable; + getActiveBusinessUnit(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/company/user/select/repositories/b2b-company-user-select-repository.ts b/cypress/support/pages/yves/company/user/select/repositories/b2b-company-user-select-repository.ts index 638adf11e..bfb5fe39b 100644 --- a/cypress/support/pages/yves/company/user/select/repositories/b2b-company-user-select-repository.ts +++ b/cypress/support/pages/yves/company/user/select/repositories/b2b-company-user-select-repository.ts @@ -6,4 +6,9 @@ export class B2bCompanyUserSelectRepository implements CompanyUserSelectReposito getBusinessUnitSelect = (): Cypress.Chainable => cy.get('#company_user_account_selector_form_companyUserAccount'); getSubmitButton = (): Cypress.Chainable => cy.get('form[name=company_user_account_selector_form]').find('[type="submit"]'); + getBusinessUnitOptions = (): Cypress.Chainable => + cy.get('#company_user_account_selector_form_companyUserAccount option'); + // The header names only the company, so the account the selector preselects is the one acting. + getActiveBusinessUnit = (): Cypress.Chainable => + cy.get('#company_user_account_selector_form_companyUserAccount option:selected'); } diff --git a/cypress/support/pages/yves/company/user/select/repositories/b2b-mp-company-user-select-repository.ts b/cypress/support/pages/yves/company/user/select/repositories/b2b-mp-company-user-select-repository.ts index fe07252d0..22be9d8de 100644 --- a/cypress/support/pages/yves/company/user/select/repositories/b2b-mp-company-user-select-repository.ts +++ b/cypress/support/pages/yves/company/user/select/repositories/b2b-mp-company-user-select-repository.ts @@ -6,4 +6,9 @@ export class B2bMpCompanyUserSelectRepository implements CompanyUserSelectReposi getBusinessUnitSelect = (): Cypress.Chainable => cy.get('#company_user_account_selector_form_companyUserAccount'); getSubmitButton = (): Cypress.Chainable => cy.get('form[name=company_user_account_selector_form]').find('[type="submit"]'); + getBusinessUnitOptions = (): Cypress.Chainable => + cy.get('#company_user_account_selector_form_companyUserAccount option'); + // The header names only the company, so the account the selector preselects is the one acting. + getActiveBusinessUnit = (): Cypress.Chainable => + cy.get('#company_user_account_selector_form_companyUserAccount option:selected'); } diff --git a/cypress/support/pages/yves/company/user/select/repositories/b2c-company-user-select-repository.ts b/cypress/support/pages/yves/company/user/select/repositories/b2c-company-user-select-repository.ts index d713de881..bc036e051 100644 --- a/cypress/support/pages/yves/company/user/select/repositories/b2c-company-user-select-repository.ts +++ b/cypress/support/pages/yves/company/user/select/repositories/b2c-company-user-select-repository.ts @@ -6,4 +6,9 @@ export class B2cCompanyUserSelectRepository implements CompanyUserSelectReposito getBusinessUnitSelect = (): Cypress.Chainable => cy.get('#company_user_account_selector_form_companyUserAccount'); getSubmitButton = (): Cypress.Chainable => cy.get('form[name=company_user_account_selector_form]').find('[type="submit"]'); + getBusinessUnitOptions = (): Cypress.Chainable => + cy.get('#company_user_account_selector_form_companyUserAccount option'); + // The top navigation names the business unit the customer is currently acting for. + getActiveBusinessUnit = (): Cypress.Chainable => + cy.get('[data-qa="component navigation-top"] a[href*="/company/user/select"]'); } diff --git a/cypress/support/pages/yves/company/user/select/repositories/b2c-mp-company-user-select-repository.ts b/cypress/support/pages/yves/company/user/select/repositories/b2c-mp-company-user-select-repository.ts index 58b743c65..819ad0184 100644 --- a/cypress/support/pages/yves/company/user/select/repositories/b2c-mp-company-user-select-repository.ts +++ b/cypress/support/pages/yves/company/user/select/repositories/b2c-mp-company-user-select-repository.ts @@ -6,4 +6,9 @@ export class B2cMpCompanyUserSelectRepository implements CompanyUserSelectReposi getBusinessUnitSelect = (): Cypress.Chainable => cy.get('#company_user_account_selector_form_companyUserAccount'); getSubmitButton = (): Cypress.Chainable => cy.get('form[name=company_user_account_selector_form]').find('[type="submit"]'); + getBusinessUnitOptions = (): Cypress.Chainable => + cy.get('#company_user_account_selector_form_companyUserAccount option'); + // The top navigation names the business unit the customer is currently acting for. + getActiveBusinessUnit = (): Cypress.Chainable => + cy.get('[data-qa="component navigation-top"] a[href*="/company/user/select"]'); } diff --git a/cypress/support/pages/yves/company/user/select/repositories/suite-company-user-select-repository.ts b/cypress/support/pages/yves/company/user/select/repositories/suite-company-user-select-repository.ts index 715f552ea..2d81dea8f 100644 --- a/cypress/support/pages/yves/company/user/select/repositories/suite-company-user-select-repository.ts +++ b/cypress/support/pages/yves/company/user/select/repositories/suite-company-user-select-repository.ts @@ -6,4 +6,9 @@ export class SuiteCompanyUserSelectRepository implements CompanyUserSelectReposi getBusinessUnitSelect = (): Cypress.Chainable => cy.get('#company_user_account_selector_form_companyUserAccount'); getSubmitButton = (): Cypress.Chainable => cy.get('form[name=company_user_account_selector_form]').find('[type="submit"]'); + getBusinessUnitOptions = (): Cypress.Chainable => + cy.get('#company_user_account_selector_form_companyUserAccount option'); + // The top navigation names the business unit the customer is currently acting for. + getActiveBusinessUnit = (): Cypress.Chainable => + cy.get('[data-qa="component navigation-top"] a[href*="/company/user/select"]'); } diff --git a/cypress/support/pages/yves/configurable-bundle/bundle-configurator-page.ts b/cypress/support/pages/yves/configurable-bundle/bundle-configurator-page.ts new file mode 100644 index 000000000..a60ad2f1e --- /dev/null +++ b/cypress/support/pages/yves/configurable-bundle/bundle-configurator-page.ts @@ -0,0 +1,44 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; +import { BundleConfiguratorRepository } from './bundle-configurator-repository'; + +@injectable() +@autoWired +export class BundleConfiguratorPage extends YvesPage { + @inject(BundleConfiguratorRepository) private repository: BundleConfiguratorRepository; + + protected PAGE_URL = '/configurable-bundle/configurator/template-selection'; + + chooseTemplate = (templateName: string): void => { + this.repository.getTemplateName(templateName).parents(this.repository.getTemplateLinkSelector()).first().click(); + this.repository.getConfiguratorSidebar().should('be.visible'); + }; + + // A candidate is picked by the text or sku its card carries or, where a shop's slot offers its demo products in no + // stable set from run to run, by its position in the slot's list. + selectSlotProduct = (params: SelectSlotProductParams): void => { + this.repository.getSlotButton(params.slotName).click(); + + const configuratorProduct = + params.productIdentifier !== undefined + ? this.repository.getConfiguratorProduct(params.productIdentifier).first() + : this.repository.getConfiguratorProducts().eq(params.productPosition ?? 0); + + configuratorProduct.find(this.repository.getConfiguratorProductSelectButtonSelector()).first().click(); + }; + + goToSummary = (): void => { + this.repository.getSlotButton('Summary').click(); + }; + + addConfiguredBundleToCart = (): void => { + this.repository.getAddToCartButton().click(); + }; +} + +interface SelectSlotProductParams { + slotName: string; + productIdentifier?: string; + productPosition?: number; +} diff --git a/cypress/support/pages/yves/configurable-bundle/bundle-configurator-repository.ts b/cypress/support/pages/yves/configurable-bundle/bundle-configurator-repository.ts new file mode 100644 index 000000000..41597f8a7 --- /dev/null +++ b/cypress/support/pages/yves/configurable-bundle/bundle-configurator-repository.ts @@ -0,0 +1,24 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class BundleConfiguratorRepository { + getTemplateName = (templateName: string): Cypress.Chainable => + cy.contains('[data-qa="component template-list"] .template-list__item-name', templateName); + getTemplateLinkSelector = (): string => 'a'; + getConfiguratorSidebar = (): Cypress.Chainable => cy.get('[data-qa="component configurator-sidebar"]'); + getSlotButton = (slotName: string): Cypress.Chainable => + cy.contains('form[name="configurator_state_form"] button', slotName); + // Every shop renders the slot's candidates as configurator-product cards. Suite and b2b print the sku in the + // card, b2c only the name, but every card's selection form carries the sku in a hidden input. + getConfiguratorProduct = (productIdentifier: string): Cypress.Chainable => + cy.get( + `[data-qa="component configurator-product"]:contains("${productIdentifier}"), ` + + `[data-qa="component configurator-product"]:has(input[type="hidden"][value="${productIdentifier}"])` + ); + getConfiguratorProducts = (): Cypress.Chainable => cy.get('[data-qa="component configurator-product"]'); + getConfiguratorProductSelectButtonSelector = (): string => 'button'; + getAddToCartButton = (): Cypress.Chainable => + cy.get('form[name="configurator_state_form"][action*="add-to-cart"] button'); +} diff --git a/cypress/support/pages/yves/content/cms-content-page.ts b/cypress/support/pages/yves/content/cms-content-page.ts index f770301bb..a09f39c37 100644 --- a/cypress/support/pages/yves/content/cms-content-page.ts +++ b/cypress/support/pages/yves/content/cms-content-page.ts @@ -4,6 +4,9 @@ import { inject, injectable } from 'inversify'; import { YvesPage } from '@pages/yves'; import { ContentRepository } from './content-repository'; +// Store codes are upper case (/AT), language prefixes lower case (/en). +const LANGUAGE_PATH_SUFFIX = /\/[a-z]{2}$/; + @injectable() @autoWired export class CmsContentPage extends YvesPage { @@ -11,6 +14,33 @@ export class CmsContentPage extends YvesPage { protected PAGE_URL = '/search'; + visitCmsPage = (params: VisitCmsPageParams): void => { + cy.visit(`/${params.locale}/${params.cmsPageName}`); + }; + + // A store-scoped url is only known at run time, because the store switcher owns the + // prefix; callers derive it from the switcher instead of hard-coding a store path. + visitCmsPageUrl = (cmsPageUrl: string): void => { + cy.visit(cmsPageUrl); + }; + + // The classic B2B store switcher lands on the bare store prefix while the other themes land on the + // store and language prefix, and a cms page url always carries the language. + getCmsPageUrlOnCurrentStore = (params: VisitCmsPageOnCurrentStoreParams): Cypress.Chainable => { + const language = params.localeName.split('_')[0]; + + return cy.url().then((currentUrl: string) => { + const storeUrl = currentUrl.split('?')[0].replace(/\/$/, ''); + const storeLanguageUrl = LANGUAGE_PATH_SUFFIX.test(storeUrl) ? storeUrl : `${storeUrl}/${language}`; + + return `${storeLanguageUrl}/${params.cmsPageName}`; + }); + }; + + visitCmsPageOnCurrentStore = (params: VisitCmsPageOnCurrentStoreParams): void => { + this.getCmsPageUrlOnCurrentStore(params).then((cmsPageUrl: string) => cy.visit(cmsPageUrl)); + }; + findCmsPageFromSuggestions = (params: SearchParams): void => { this.repository.search(params.query); cy.intercept('**/search/suggestion**').as('searchSuggestion'); @@ -23,3 +53,13 @@ export class CmsContentPage extends YvesPage { interface SearchParams { query: string; } + +interface VisitCmsPageParams { + locale: string; + cmsPageName: string; +} + +interface VisitCmsPageOnCurrentStoreParams { + cmsPageName: string; + localeName: string; +} diff --git a/cypress/support/pages/yves/customer/address/customer-address-page.ts b/cypress/support/pages/yves/customer/address/customer-address-page.ts index a86543a8d..61e2ad70c 100644 --- a/cypress/support/pages/yves/customer/address/customer-address-page.ts +++ b/cypress/support/pages/yves/customer/address/customer-address-page.ts @@ -36,4 +36,25 @@ export class CustomerAddressPage extends YvesPage { }; getAddressAddedMessage = (): Cypress.Chainable => cy.contains(this.repository.getAddressAddedMessage()); + + getBody = (): Cypress.Chainable => cy.get('body'); + + getAddressListEntry = (text: string): Cypress.Chainable => + cy.contains(this.repository.getAddressListEntrySelector(), text); + + /** + * The delete button sits on the card wrapping the address, and that wrapper is a different + * element in every repository. Walking up to the nearest ancestor holding exactly one delete + * form finds it without naming any of them, and cannot reach a neighbouring address's button. + */ + deleteAddress = (text: string): void => { + const deleteForm = this.repository.getAddressDeleteFormSelector(); + + this.getAddressListEntry(text) + .parents() + .filter((index: number, element: HTMLElement) => Cypress.$(element).find(deleteForm).length === 1) + .first() + .find(`${deleteForm} button`) + .click(); + }; } diff --git a/cypress/support/pages/yves/customer/address/customer-address-repository.ts b/cypress/support/pages/yves/customer/address/customer-address-repository.ts index 7fd549531..86f7c8f0e 100644 --- a/cypress/support/pages/yves/customer/address/customer-address-repository.ts +++ b/cypress/support/pages/yves/customer/address/customer-address-repository.ts @@ -27,4 +27,6 @@ export interface CustomerAddressRepository { getSubmitButton(): Cypress.Chainable; getAddNewAddressLink(): Cypress.Chainable; getAddressAddedMessage(): string; + getAddressListEntrySelector(): string; + getAddressDeleteFormSelector(): string; } diff --git a/cypress/support/pages/yves/customer/address/repositories/b2b-customer-address-repository.ts b/cypress/support/pages/yves/customer/address/repositories/b2b-customer-address-repository.ts index 369c50745..95a54d3f6 100644 --- a/cypress/support/pages/yves/customer/address/repositories/b2b-customer-address-repository.ts +++ b/cypress/support/pages/yves/customer/address/repositories/b2b-customer-address-repository.ts @@ -39,10 +39,17 @@ export class B2bCustomerAddressRepository implements CustomerAddressRepository { getSubmitButton(): Cypress.Chainable { return cy.get('form[name="addressForm"] button[type="submit"]'); } + // The classic theme renders the link as a plain action bar entry without a data-qa hook. getAddNewAddressLink(): Cypress.Chainable { - return cy.get('[data-qa="customer-add-new-address"]'); + return cy.get('[data-qa="customer-add-new-address"], a[href$="/customer/address/new"]').first(); } getAddressAddedMessage(): string { return 'Address was successfully added'; } + getAddressListEntrySelector(): string { + return 'ul.display-address li'; + } + getAddressDeleteFormSelector(): string { + return 'form[action*="address/delete"]'; + } } diff --git a/cypress/support/pages/yves/customer/address/repositories/b2b-mp-customer-address-repository.ts b/cypress/support/pages/yves/customer/address/repositories/b2b-mp-customer-address-repository.ts index 1f492cc54..fc2fc6c68 100644 --- a/cypress/support/pages/yves/customer/address/repositories/b2b-mp-customer-address-repository.ts +++ b/cypress/support/pages/yves/customer/address/repositories/b2b-mp-customer-address-repository.ts @@ -45,4 +45,10 @@ export class B2bMpCustomerAddressRepository implements CustomerAddressRepository getAddressAddedMessage(): string { return 'Address was successfully added'; } + getAddressListEntrySelector(): string { + return 'ul.display-address li'; + } + getAddressDeleteFormSelector(): string { + return 'form[action*="address/delete"]'; + } } diff --git a/cypress/support/pages/yves/customer/address/repositories/b2c-customer-address-repository.ts b/cypress/support/pages/yves/customer/address/repositories/b2c-customer-address-repository.ts index 7839a21bf..370ad66b4 100644 --- a/cypress/support/pages/yves/customer/address/repositories/b2c-customer-address-repository.ts +++ b/cypress/support/pages/yves/customer/address/repositories/b2c-customer-address-repository.ts @@ -45,4 +45,10 @@ export class B2cCustomerAddressRepository implements CustomerAddressRepository { getAddressAddedMessage(): string { return 'Address was successfully added'; } + getAddressListEntrySelector(): string { + return 'ul.display-address li'; + } + getAddressDeleteFormSelector(): string { + return 'form[action*="address/delete"]'; + } } diff --git a/cypress/support/pages/yves/customer/address/repositories/b2c-mp-customer-address-repository.ts b/cypress/support/pages/yves/customer/address/repositories/b2c-mp-customer-address-repository.ts index 6c33e1182..82916b0da 100644 --- a/cypress/support/pages/yves/customer/address/repositories/b2c-mp-customer-address-repository.ts +++ b/cypress/support/pages/yves/customer/address/repositories/b2c-mp-customer-address-repository.ts @@ -45,4 +45,10 @@ export class B2cMpCustomerAddressRepository implements CustomerAddressRepository getAddressAddedMessage(): string { return 'Address was successfully added'; } + getAddressListEntrySelector(): string { + return 'ul.display-address li'; + } + getAddressDeleteFormSelector(): string { + return 'form[action*="address/delete"]'; + } } diff --git a/cypress/support/pages/yves/customer/address/repositories/suite-customer-address-repository.ts b/cypress/support/pages/yves/customer/address/repositories/suite-customer-address-repository.ts index 99f8091fc..b09ef81fe 100644 --- a/cypress/support/pages/yves/customer/address/repositories/suite-customer-address-repository.ts +++ b/cypress/support/pages/yves/customer/address/repositories/suite-customer-address-repository.ts @@ -45,4 +45,10 @@ export class SuiteCustomerAddressRepository implements CustomerAddressRepository getAddressAddedMessage(): string { return 'Address was successfully added'; } + getAddressListEntrySelector(): string { + return 'ul.display-address li'; + } + getAddressDeleteFormSelector(): string { + return 'form[action*="address/delete"]'; + } } diff --git a/cypress/support/pages/yves/customer/order/order-details-page.ts b/cypress/support/pages/yves/customer/order/order-details-page.ts index d1c5b8d31..d559c62ce 100644 --- a/cypress/support/pages/yves/customer/order/order-details-page.ts +++ b/cypress/support/pages/yves/customer/order/order-details-page.ts @@ -36,7 +36,31 @@ export class OrderDetailsPage extends YvesPage { return this.repository.getOrderDetailTableBlock(); }; + // A configured bundle is the innermost article naming its template: some themes wrap the whole shipment in an + // article of its own, and a bundle's product rows never carry the template name. + getConfiguredBundles = (templateName: string): Cypress.Chainable => { + return this.repository + .getOrderDetailTableBlock() + .find(`article:contains("${templateName}")`) + .filter( + (_index: number, article: HTMLElement): boolean => + Cypress.$(article).find(`article:contains("${templateName}")`).length === 0 + ); + }; + getEditOrderForm = (): Cypress.Chainable => { return this.repository.getEditOrderForm(); }; + + getCancelOrderButton = (): Cypress.Chainable => { + return this.repository.getCancelOrderButton(); + }; + + cancelOrder = (): void => { + this.repository.getCancelOrderButton().click(); + }; + + createReturn = (): void => { + this.repository.getCreateReturnLink().first().click(); + }; } diff --git a/cypress/support/pages/yves/customer/order/order-details-repository.ts b/cypress/support/pages/yves/customer/order/order-details-repository.ts index 1e652c9f5..c514e4e57 100644 --- a/cypress/support/pages/yves/customer/order/order-details-repository.ts +++ b/cypress/support/pages/yves/customer/order/order-details-repository.ts @@ -7,4 +7,12 @@ export interface OrderDetailsRepository { getEditOrderConfirmButton(): Cypress.Chainable; getEditOrderForm(): Cypress.Chainable; getOrderDetailTableBlock(): Cypress.Chainable; + + // OrderCancelButtonWidget renders its form only while every item of the order sits in a + // cancellable state, so the button is absent from the DOM rather than hidden. + getCancelOrderButton(): Cypress.Chainable; + + // SalesReturnPage's return-create-link molecule, which the order details page embeds and the + // demoshops render from the same component model. + getCreateReturnLink(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/customer/order/order-page.ts b/cypress/support/pages/yves/customer/order/order-page.ts index efe7af5ce..4134f0422 100644 --- a/cypress/support/pages/yves/customer/order/order-page.ts +++ b/cypress/support/pages/yves/customer/order/order-page.ts @@ -24,6 +24,9 @@ export class OrderPage extends YvesPage { this.repository.getOrderFilterApplyButton().click(); }; + getOrderHistoryRow = (orderReference: string): Cypress.Chainable => + this.repository.getOrderTable().contains('tr', orderReference); + editOrder = (): void => { this.repository.getEditOrderButton().click(); diff --git a/cypress/support/pages/yves/customer/order/order-repository.ts b/cypress/support/pages/yves/customer/order/order-repository.ts index 37162f45a..f30f45ae7 100644 --- a/cypress/support/pages/yves/customer/order/order-repository.ts +++ b/cypress/support/pages/yves/customer/order/order-repository.ts @@ -3,4 +3,5 @@ export interface OrderRepository { getOrderFilterApplyButton(): Cypress.Chainable; getEditOrderButton(): Cypress.Chainable; getEditOrderConfirmButton(): Cypress.Chainable; + getOrderTable(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-details-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-details-repository.ts index c84ef89f7..984434cd9 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-details-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-details-repository.ts @@ -28,4 +28,12 @@ export class B2bMpOrderDetailsRepository implements OrderDetailsRepository { getOrderDetailTableBlock(): Cypress.Chainable { return cy.get('[data-qa="component order-detail-table"]'); } + // The cancel button is a remote-form-submit: the button carries the form action as an attribute + // and submits a form rendered elsewhere, so it is not inside a form of its own. + getCancelOrderButton(): Cypress.Chainable { + return cy.get('remote-form-submit[form-action*="order/cancel"] button'); + } + getCreateReturnLink(): Cypress.Chainable { + return cy.get('[data-qa="component return-create-link"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-repository.ts index 037e1a331..d129de588 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2b-mp-order-repository.ts @@ -23,4 +23,7 @@ export class B2bMpOrderRepository implements OrderRepository { getOrderFilters(): Cypress.Chainable { return cy.get('form[name="orderSearchForm"]'); } + getOrderTable(): Cypress.Chainable { + return cy.get('[data-qa="component order-table"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2b-order-details-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2b-order-details-repository.ts index 2266b5751..1c2dabdf3 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2b-order-details-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2b-order-details-repository.ts @@ -29,4 +29,12 @@ export class B2bOrderDetailsRepository implements OrderDetailsRepository { getOrderDetailTableBlock(): Cypress.Chainable { return cy.get('[data-qa="component order-detail-table"]'); } + // The cancel button is a remote-form-submit: the button carries the form action as an attribute + // and submits a form rendered elsewhere, so it is not inside a form of its own. + getCancelOrderButton(): Cypress.Chainable { + return cy.get('remote-form-submit[form-action*="order/cancel"] button'); + } + getCreateReturnLink(): Cypress.Chainable { + return cy.get('[data-qa="component return-create-link"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2b-order-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2b-order-repository.ts index 21fa0ced9..2b3d780fd 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2b-order-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2b-order-repository.ts @@ -23,4 +23,7 @@ export class B2bOrderRepository implements OrderRepository { getOrderFilters(): Cypress.Chainable { return cy.get('form[name="orderSearchForm"]'); } + getOrderTable(): Cypress.Chainable { + return cy.get('[data-qa="component order-table"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-details-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-details-repository.ts index 228720565..fa8ee6b6f 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-details-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-details-repository.ts @@ -29,4 +29,10 @@ export class B2cMpOrderDetailsRepository implements OrderDetailsRepository { getOrderDetailTableBlock(): Cypress.Chainable { return cy.get('[data-qa="component order-detail-table"]'); } + getCancelOrderButton(): Cypress.Chainable { + return cy.get('remote-form-submit[form-action*="order/cancel"] button'); + } + getCreateReturnLink(): Cypress.Chainable { + return cy.get('[data-qa="component return-create-link"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-repository.ts index b4a475ff5..d47afbe31 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2c-mp-order-repository.ts @@ -21,4 +21,7 @@ export class B2cMpOrderRepository implements OrderRepository { getOrderFilters(): Cypress.Chainable { return cy.get('[data-qa="component order-filters"]'); } + getOrderTable(): Cypress.Chainable { + return cy.get('[data-qa="component order-table"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2c-order-details-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2c-order-details-repository.ts index 48890fe37..56b4bafe2 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2c-order-details-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2c-order-details-repository.ts @@ -29,4 +29,10 @@ export class B2cOrderDetailsRepository implements OrderDetailsRepository { getOrderDetailTableBlock(): Cypress.Chainable { return cy.get('[data-qa="component order-detail-table"]'); } + getCancelOrderButton(): Cypress.Chainable { + return cy.get('remote-form-submit[form-action*="order/cancel"] button'); + } + getCreateReturnLink(): Cypress.Chainable { + return cy.get('[data-qa="component return-create-link"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/b2c-order-repository.ts b/cypress/support/pages/yves/customer/order/repositories/b2c-order-repository.ts index 155d555e7..38a95ec2b 100644 --- a/cypress/support/pages/yves/customer/order/repositories/b2c-order-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/b2c-order-repository.ts @@ -21,4 +21,7 @@ export class B2cOrderRepository implements OrderRepository { getOrderFilters(): Cypress.Chainable { return cy.get('[data-qa="component order-filters"]'); } + getOrderTable(): Cypress.Chainable { + return cy.get('[data-qa="component order-table"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/suite-order-details-repository.ts b/cypress/support/pages/yves/customer/order/repositories/suite-order-details-repository.ts index 597bcd4bd..aa99d5ebe 100644 --- a/cypress/support/pages/yves/customer/order/repositories/suite-order-details-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/suite-order-details-repository.ts @@ -27,4 +27,10 @@ export class SuiteOrderDetailsRepository implements OrderDetailsRepository { getOrderDetailTableBlock(): Cypress.Chainable { return cy.get('[data-qa="component order-detail-table"]'); } + getCancelOrderButton(): Cypress.Chainable { + return cy.get('form[action*="order/cancel"] button'); + } + getCreateReturnLink(): Cypress.Chainable { + return cy.get('[data-qa="component return-create-link"]'); + } } diff --git a/cypress/support/pages/yves/customer/order/repositories/suite-order-repository.ts b/cypress/support/pages/yves/customer/order/repositories/suite-order-repository.ts index 99137ee2b..9afc58251 100644 --- a/cypress/support/pages/yves/customer/order/repositories/suite-order-repository.ts +++ b/cypress/support/pages/yves/customer/order/repositories/suite-order-repository.ts @@ -21,4 +21,7 @@ export class SuiteOrderRepository implements OrderRepository { getOrderFilters(): Cypress.Chainable { return cy.get('[data-qa="component order-filters"]'); } + getOrderTable(): Cypress.Chainable { + return cy.get('[data-qa="component order-table"]'); + } } diff --git a/cypress/support/pages/yves/customer/overview/repositories/b2b-customer-overview-repository.ts b/cypress/support/pages/yves/customer/overview/repositories/b2b-customer-overview-repository.ts index ceb0d807d..c8c719bec 100644 --- a/cypress/support/pages/yves/customer/overview/repositories/b2b-customer-overview-repository.ts +++ b/cypress/support/pages/yves/customer/overview/repositories/b2b-customer-overview-repository.ts @@ -24,9 +24,10 @@ export class B2bCustomerOverviewRepository implements CustomerOverviewRepository return cy.get('[data-qa="component order-detail-table"]'); } // The B2B shops replace the vendor customer navigation with the sidebar molecule, which carries no - // per-section marker, so the section is matched on the link target instead. + // per-section marker, so the section is matched on the link target instead. The classic theme also + // renders the same links in the header's hidden account dropdown, so only the visible one is taken. getSidebarLink(section: CustomerSidebarSection): Cypress.Chainable { - return cy.get(`[data-qa="component navigation-sidebar-item"] a[href$="/customer/${section}"]`); + return cy.get(`[data-qa="component navigation-sidebar-item"] a[href$="/customer/${section}"]:visible`); } getDefaultBillingAddressHeading(): string { return 'Default Billing Address'; diff --git a/cypress/support/pages/yves/customer/overview/repositories/b2c-customer-overview-repository.ts b/cypress/support/pages/yves/customer/overview/repositories/b2c-customer-overview-repository.ts index f0cec4e04..7872b890c 100644 --- a/cypress/support/pages/yves/customer/overview/repositories/b2c-customer-overview-repository.ts +++ b/cypress/support/pages/yves/customer/overview/repositories/b2c-customer-overview-repository.ts @@ -23,8 +23,9 @@ export class B2cCustomerOverviewRepository implements CustomerOverviewRepository getOrderDetailTableRow(): Cypress.Chainable { return cy.get('[data-qa="component order-detail-table"]'); } + // The side drawer renders the same navigation a second time, so the link is taken from the account sidebar. getSidebarLink(section: CustomerSidebarSection): Cypress.Chainable { - return cy.get(`[data-id="sidebar-${section}"]`); + return cy.get(`[data-qa="customer-account-sidebar"] [data-id="sidebar-${section}"]`); } getDefaultBillingAddressHeading(): string { return 'Default Billing Address'; diff --git a/cypress/support/pages/yves/customer/overview/repositories/b2c-mp-customer-overview-repository.ts b/cypress/support/pages/yves/customer/overview/repositories/b2c-mp-customer-overview-repository.ts index 5b4255d00..01a3983be 100644 --- a/cypress/support/pages/yves/customer/overview/repositories/b2c-mp-customer-overview-repository.ts +++ b/cypress/support/pages/yves/customer/overview/repositories/b2c-mp-customer-overview-repository.ts @@ -23,8 +23,9 @@ export class B2cMpCustomerOverviewRepository implements CustomerOverviewReposito getOrderDetailTableRow(): Cypress.Chainable { return cy.get('[data-qa="component order-detail-table"]'); } + // The side drawer renders the same navigation a second time, so the link is taken from the account sidebar. getSidebarLink(section: CustomerSidebarSection): Cypress.Chainable { - return cy.get(`[data-id="sidebar-${section}"]`); + return cy.get(`[data-qa="customer-account-sidebar"] [data-id="sidebar-${section}"]`); } getDefaultBillingAddressHeading(): string { return 'Default Billing Address'; diff --git a/cypress/support/pages/yves/customer/profile/customer-profile-page.ts b/cypress/support/pages/yves/customer/profile/customer-profile-page.ts index 9b27b2a30..600573b18 100644 --- a/cypress/support/pages/yves/customer/profile/customer-profile-page.ts +++ b/cypress/support/pages/yves/customer/profile/customer-profile-page.ts @@ -44,4 +44,20 @@ export class CustomerProfilePage extends YvesPage { getPasswordsDoNotMatchError(): Cypress.Chainable { return cy.contains(this.repository.getPasswordsDoNotMatchMessage()); } + + getSalutationSelect(): Cypress.Chainable { + return this.repository.getSalutationSelect(); + } + + getFirstNameInput(): Cypress.Chainable { + return this.repository.getFirstNameInput(); + } + + getLastNameInput(): Cypress.Chainable { + return this.repository.getLastNameInput(); + } + + getEmailInput(): Cypress.Chainable { + return this.repository.getEmailInput(); + } } diff --git a/cypress/support/pages/yves/home/home-page.ts b/cypress/support/pages/yves/home/home-page.ts index 743b806fe..092abd0d6 100644 --- a/cypress/support/pages/yves/home/home-page.ts +++ b/cypress/support/pages/yves/home/home-page.ts @@ -21,6 +21,8 @@ export class HomePage extends YvesPage { ); }; + getStoreSelectorOption = (store: string): Cypress.Chainable => cy.get(this.repository.getStoreSelectorOption(store)); + selectStore = (store: string): void => { // Cypress does not fire the 'change' event when the option is already selected, // so window.location never gets set. Read the store URL from the option value directly. diff --git a/cypress/support/pages/yves/index.ts b/cypress/support/pages/yves/index.ts index f183b3810..3ce4f821b 100644 --- a/cypress/support/pages/yves/index.ts +++ b/cypress/support/pages/yves/index.ts @@ -25,6 +25,8 @@ export * from './customer/newsletter/customer-newsletter-page'; export * from './customer/order/order-page'; export * from './customer/order/order-details-page'; export * from './product-comparison/product-comparison-page'; +export * from './product-set/product-sets-page'; +export * from './configurable-bundle/bundle-configurator-page'; export * from './content/cms-content-page'; export * from './company/user/manage/manage-company-role-user-page'; export * from './ssp-inquiry/ssp-inquiry-list-page'; @@ -58,3 +60,14 @@ export * from './recurring-orders/list/recurring-order-list-page'; export * from './recurring-orders/detail/recurring-order-detail-page'; export * from './recurring-orders/review/recurring-order-review-page'; export * from './company/register/company-registration-page'; +export * from './quick-order/quick-order-page'; +export * from './shopping-list/shopping-list-page'; +export * from './wishlist/wishlist-page'; +export * from './product-configurator/product-configurator-page'; +export * from './return/return-list-page'; +export * from './return/return-create-page'; +export * from './return/return-view-page'; +export * from './agent-control-bar/agent-control-bar-page'; +export * from './company/business-unit/create/company-business-unit-create-page'; +export * from './company/user/create/company-user-create-page'; +export * from './quote-request/quote-request-page'; diff --git a/cypress/support/pages/yves/merchant/merchant-page.ts b/cypress/support/pages/yves/merchant/merchant-page.ts index 2fd6401de..815b97ad7 100644 --- a/cypress/support/pages/yves/merchant/merchant-page.ts +++ b/cypress/support/pages/yves/merchant/merchant-page.ts @@ -11,7 +11,31 @@ export class MerchantPage extends YvesPage { protected PAGE_URL = '/merchant'; + visitProfile = (params: VisitProfileParams): void => { + cy.visit(params.url); + }; + sendMerchantRelationRequest = (): void => { this.repository.getMerchantRelationRequestButton().click(); }; + + // The profile renders label/value pairs as information items; the label is the only stable handle. + getInformationItemValue = (params: GetInformationItemValueParams): Cypress.Chainable => { + return cy + .get('[data-qa="component merchant-profile"]') + .contains(this.repository.getInformationItemLabelSelector(), params.label) + .parent(); + }; + + getProfileContent = (): Cypress.Chainable => { + return cy.get('[data-qa="component merchant-profile"]'); + }; +} + +interface VisitProfileParams { + url: string; +} + +interface GetInformationItemValueParams { + label: string; } diff --git a/cypress/support/pages/yves/merchant/merchant-repository.ts b/cypress/support/pages/yves/merchant/merchant-repository.ts index 549cadaff..05b1c22cb 100644 --- a/cypress/support/pages/yves/merchant/merchant-repository.ts +++ b/cypress/support/pages/yves/merchant/merchant-repository.ts @@ -1,3 +1,4 @@ export interface MerchantRepository { getMerchantRelationRequestButton(): Cypress.Chainable; + getInformationItemLabelSelector(): string; } diff --git a/cypress/support/pages/yves/merchant/repositories/b2b-merchant-repository.ts b/cypress/support/pages/yves/merchant/repositories/b2b-merchant-repository.ts index 74d5d89de..53d93c828 100644 --- a/cypress/support/pages/yves/merchant/repositories/b2b-merchant-repository.ts +++ b/cypress/support/pages/yves/merchant/repositories/b2b-merchant-repository.ts @@ -5,4 +5,5 @@ import { MerchantRepository } from '../merchant-repository'; export class B2bMerchantRepository implements MerchantRepository { getMerchantRelationRequestButton = (): Cypress.Chainable => cy.get('[data-qa="merchant-relation-request-create-button"]'); + getInformationItemLabelSelector = (): string => '[data-qa="component information-item"] strong'; } diff --git a/cypress/support/pages/yves/merchant/repositories/b2b-mp-merchant-repository.ts b/cypress/support/pages/yves/merchant/repositories/b2b-mp-merchant-repository.ts index 3bfff866d..a80b38545 100644 --- a/cypress/support/pages/yves/merchant/repositories/b2b-mp-merchant-repository.ts +++ b/cypress/support/pages/yves/merchant/repositories/b2b-mp-merchant-repository.ts @@ -5,4 +5,5 @@ import { MerchantRepository } from '../merchant-repository'; export class B2bMpMerchantRepository implements MerchantRepository { getMerchantRelationRequestButton = (): Cypress.Chainable => cy.get('[data-qa="merchant-relation-request-create-button"]'); + getInformationItemLabelSelector = (): string => '[data-qa="component information-box"] strong'; } diff --git a/cypress/support/pages/yves/merchant/repositories/b2c-merchant-repository.ts b/cypress/support/pages/yves/merchant/repositories/b2c-merchant-repository.ts index 35cb0f916..a116a0600 100644 --- a/cypress/support/pages/yves/merchant/repositories/b2c-merchant-repository.ts +++ b/cypress/support/pages/yves/merchant/repositories/b2c-merchant-repository.ts @@ -5,4 +5,5 @@ import { MerchantRepository } from '../merchant-repository'; export class B2cMerchantRepository implements MerchantRepository { getMerchantRelationRequestButton = (): Cypress.Chainable => cy.get('[data-qa="merchant-relation-request-create-button"]'); + getInformationItemLabelSelector = (): string => '[data-qa="component information-item"] strong'; } diff --git a/cypress/support/pages/yves/merchant/repositories/b2c-mp-merchant-repository.ts b/cypress/support/pages/yves/merchant/repositories/b2c-mp-merchant-repository.ts index 8e93d03ec..718642ab0 100644 --- a/cypress/support/pages/yves/merchant/repositories/b2c-mp-merchant-repository.ts +++ b/cypress/support/pages/yves/merchant/repositories/b2c-mp-merchant-repository.ts @@ -5,4 +5,5 @@ import { MerchantRepository } from '../merchant-repository'; export class B2cMpMerchantRepository implements MerchantRepository { getMerchantRelationRequestButton = (): Cypress.Chainable => cy.get('[data-qa="merchant-relation-request-create-button"]'); + getInformationItemLabelSelector = (): string => '[data-qa="component information-item"] strong'; } diff --git a/cypress/support/pages/yves/merchant/repositories/suite-merchant-repository.ts b/cypress/support/pages/yves/merchant/repositories/suite-merchant-repository.ts index 979949463..17fa605dc 100644 --- a/cypress/support/pages/yves/merchant/repositories/suite-merchant-repository.ts +++ b/cypress/support/pages/yves/merchant/repositories/suite-merchant-repository.ts @@ -5,4 +5,5 @@ import { MerchantRepository } from '../merchant-repository'; export class SuiteMerchantRepository implements MerchantRepository { getMerchantRelationRequestButton = (): Cypress.Chainable => cy.get('[data-qa="merchant-relation-request-create-button"]'); + getInformationItemLabelSelector = (): string => '[data-qa="component information-item"] strong'; } diff --git a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts index 6e3adb25f..fea306b9d 100644 --- a/cypress/support/pages/yves/multi-cart/multi-cart-page.ts +++ b/cypress/support/pages/yves/multi-cart/multi-cart-page.ts @@ -31,6 +31,21 @@ export class MultiCartPage extends YvesPage { getMiniCartRadios = (): Cypress.Chainable => { return this.repository.getMiniCartRadios(); }; + + getCartRow = (name: string): Cypress.Chainable => this.repository.getQuoteTable().contains('tr', name); + + openShareCartPage = (name: string): void => { + this.getCartRow(name).find('a[href*="/shared-cart/share/"]').click(); + }; + + // The share form lists every other company user by name and one access level each. The B2B + // themes cover the native select with a select2 widget, so it is selected forcibly. + shareCartWithCompanyUser = (params: ShareCartWithCompanyUserParams): void => { + cy.contains('[data-qa="component user-share-list"] li', params.name) + .find('select') + .select(params.accessLevel, { force: true }); + cy.get('form[name="shareCartForm"] button[type="submit"]').click(); + }; } interface CreateCartParams { @@ -40,3 +55,8 @@ interface CreateCartParams { interface SelectCartParams { name: string; } + +interface ShareCartWithCompanyUserParams { + name: string; + accessLevel: string; +} diff --git a/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts b/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts index d32e6ee8a..96b8a4291 100644 --- a/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts +++ b/cypress/support/pages/yves/multi-cart/repositories/b2b-multi-cart-repository.ts @@ -7,6 +7,9 @@ export class B2bMultiCartRepository implements MultiCartRepository { getCreateCartNameInput = (): Cypress.Chainable => cy.get('#quoteForm_name'); getCreateCartForm = (): Cypress.Chainable => cy.get('form[name=quoteForm]'); getQuoteTable = (): Cypress.Chainable => cy.get('[data-qa="component quote-table"]'); + // The redesigned B2B header puts the mini cart in a cart pill, the classic one in the user navigation. getMiniCartRadios = (): Cypress.Chainable => - cy.get('[data-qa="component header-cart-pill"] [data-qa="component mini-cart-detail"]'); + cy.get( + '[data-qa="component header-cart-pill"] [data-qa="component mini-cart-detail"], [data-qa="component user-navigation"] [data-qa="component mini-cart-detail"]' + ); } diff --git a/cypress/support/pages/yves/product-configurator/product-configurator-page.ts b/cypress/support/pages/yves/product-configurator/product-configurator-page.ts new file mode 100644 index 000000000..20bbc5fcd --- /dev/null +++ b/cypress/support/pages/yves/product-configurator/product-configurator-page.ts @@ -0,0 +1,49 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { AbstractPage } from '../../abstract-page'; +import { ProductConfiguratorRepository } from './product-configurator-repository'; + +// An option's label reads " + <price>"; only the title reaches the shop's display data. +const OPTION_LABEL_PRICE_SEPARATOR = '+'; + +@injectable() +@autoWired +export class ProductConfiguratorPage extends AbstractPage { + @inject(ProductConfiguratorRepository) private repository: ProductConfiguratorRepository; + + // The example configurator is its own application on a sibling host of the storefront. Cypress + // follows the gateway's redirect into it in the same tab because both share the spryker.local + // superdomain, so no cross-origin handling is needed. + getHeading = (): Cypress.Chainable => this.repository.getHeading(); + + getOptionTitle = (groupNumber: number, optionNumber: number): Cypress.Chainable<string> => + this.repository + .getGroupOption(groupNumber, optionNumber) + .find(this.repository.getOptionLabelSelector()) + .invoke('text') + .then((label: string) => label.split(OPTION_LABEL_PRICE_SEPARATOR)[0].trim()); + + // The radio is visually replaced by its tile, so the input the value lives on is covered. + selectOption = (groupNumber: number, optionNumber: number): void => { + this.repository + .getGroupOption(groupNumber, optionNumber) + .find(this.repository.getOptionInputSelector()) + .check({ force: true }); + }; + + save = (): void => { + this.repository.getSaveButton().click(); + }; + + // The option lookup waits for the configurator application to render, which is on a sibling host + // the configure button redirects to. + chooseOption = (params: ChooseOptionParams): void => { + this.selectOption(params.groupNumber, params.optionNumber); + this.save(); + }; +} + +interface ChooseOptionParams { + groupNumber: number; + optionNumber: number; +} diff --git a/cypress/support/pages/yves/product-configurator/product-configurator-repository.ts b/cypress/support/pages/yves/product-configurator/product-configurator-repository.ts new file mode 100644 index 000000000..e38db0af0 --- /dev/null +++ b/cypress/support/pages/yves/product-configurator/product-configurator-repository.ts @@ -0,0 +1,24 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ProductConfiguratorRepository { + // The example configurator renders one Angular component per option group, and the group element + // itself carries no data-qa, so the component's own tag name is what identifies it. + getGroups = (): Cypress.Chainable => cy.get('app-configurator-group'); + + getGroupOption = (groupNumber: number, optionNumber: number): Cypress.Chainable => + this.getGroups() + .eq(groupNumber - 1) + .find('[data-qa="configurator-group-item"]') + .eq(optionNumber - 1); + + getOptionLabelSelector = (): string => '[data-qa="configurator-item-label"]'; + + getOptionInputSelector = (): string => '[data-qa="configurator-item-input"]'; + + getSaveButton = (): Cypress.Chainable => cy.get('[data-qa="product-details-submit-button"]'); + + getHeading = (): Cypress.Chainable => cy.get('[data-qa="header-heading"]'); +} diff --git a/cypress/support/pages/yves/product-set/product-sets-page.ts b/cypress/support/pages/yves/product-set/product-sets-page.ts new file mode 100644 index 000000000..6f2ac67b6 --- /dev/null +++ b/cypress/support/pages/yves/product-set/product-sets-page.ts @@ -0,0 +1,66 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; +import { ProductSetsRepository } from './product-sets-repository'; + +@injectable() +@autoWired +export class ProductSetsPage extends YvesPage { + @inject(ProductSetsRepository) private repository: ProductSetsRepository; + + protected PAGE_URL = '/product-sets'; + + getProductSetCard = (name: string): Cypress.Chainable => + cy.contains(this.repository.getProductSetCardSelector(), name); + + openProductSet = (name: string): void => { + this.getProductSetCard(name).find(this.repository.getProductSetCardLinkSelector()).first().click(); + }; + + getProductSetDetails = (): Cypress.Chainable => this.repository.getProductSetDetails(); + + getProductSetProductItems = (): Cypress.Chainable => this.repository.getProductSetProductItems(); + + // The B2B storefronts hide the native select behind a select2 widget, which still submits on its change. + selectProductVariant = (params: SelectProductVariantParams): void => { + this.repository + .getVariantSelect(params.productName, params.attributeKey) + .select(params.attributeValue, { force: true }); + }; + + addAllProductsToCart = (): void => { + // The button ships disabled and the storefront enables it once every product in the set has a + // concrete resolved, so clicking before a variant is picked is a silent no-op. + this.repository.getAddAllToCartButton().should('be.enabled'); + this.repository.getAddAllToCartButton().click(); + }; + + waitUntilProductSetIsPublished = (urlKey: string): void => { + cy.reloadUntilFound(`/en/${urlKey}`, this.repository.getProductSetDetailsSelector(), 'body', 15, 3000, [ + 'console queue:worker:start --stop-when-empty', + ]); + }; + + waitUntilProductSetIsListed = (name: string): void => { + cy.reloadUntilFound( + this.PAGE_URL, + `${this.repository.getProductSetCardSelector()}:contains("${name}")`, + 'body', + 15, + 3000, + ['console queue:worker:start --stop-when-empty'] + ); + }; + + waitUntilProductSetIsGone = (urlKey: string): void => { + cy.reloadUntilGone(`/en/${urlKey}`, this.repository.getProductSetDetailsSelector(), 'body', 15, 3000, [ + 'console queue:worker:start --stop-when-empty', + ]); + }; +} + +interface SelectProductVariantParams { + productName: string; + attributeKey: string; + attributeValue: string; +} diff --git a/cypress/support/pages/yves/product-set/product-sets-repository.ts b/cypress/support/pages/yves/product-set/product-sets-repository.ts new file mode 100644 index 000000000..b20d271da --- /dev/null +++ b/cypress/support/pages/yves/product-set/product-sets-repository.ts @@ -0,0 +1,16 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ProductSetsRepository { + getProductSetCardSelector = (): string => 'article'; + getProductSetCardLinkSelector = (): string => 'a'; + getProductSetDetails = (): Cypress.Chainable => cy.get('[data-qa="component product-set-details"]'); + getProductSetDetailsSelector = (): string => '[data-qa="component product-set-details"]'; + getProductSetProductItems = (): Cypress.Chainable => cy.get('[data-qa="component product-item"]'); + getAddAllToCartButton = (): Cypress.Chainable => cy.get('form[name="addItemsForm"] button'); + // One select per super attribute of the product, all of them named attributes[<abstract>][<key>]. + getVariantSelect = (productName: string, attributeKey: string): Cypress.Chainable => + cy.contains('[data-qa="component product-item"]', productName).find(`select[name$="[${attributeKey}]"]`); +} diff --git a/cypress/support/pages/yves/product/product-page.ts b/cypress/support/pages/yves/product/product-page.ts index 92b8410ae..0a09e2177 100644 --- a/cypress/support/pages/yves/product/product-page.ts +++ b/cypress/support/pages/yves/product/product-page.ts @@ -4,6 +4,13 @@ import { inject, injectable } from 'inversify'; import { YvesPage } from '@pages/yves'; import { ProductRepository } from './product-repository'; +const CONFIGURE_BUTTON_SELECTOR = '[data-qa="component configuration-form"] button'; +const CONFIGURE_BUTTON_RELOAD_ATTEMPTS = 20; +const CONFIGURE_BUTTON_RELOAD_INTERVAL_MS = 3000; +const AVAILABILITY_WIDGET_SELECTOR = '[data-qa="component product-availability-widget"]'; +const CLASSIC_B2B_OUT_OF_STOCK_ALERT_SELECTOR = '[data-qa="component product-configurator"] .text-alert'; +const IN_STOCK_QUANTITY_PATTERN = /\d+(\.\d+)?\s+in stock/; + @injectable() @autoWired export class ProductPage extends YvesPage { @@ -87,6 +94,28 @@ export class ProductPage extends YvesPage { return this.repository.getInputRadioSelector(); }; + getProductConfigurationStatus = (): Cypress.Chainable => { + return this.repository.getProductConfigurationStatus(); + }; + + configure = (): void => { + this.repository.getConfigureButton().click(); + }; + + // A freshly created product's configuration can still be propagating to storage, and until it + // lands the detail page renders no configure button at all. + reloadUntilConfigurable = (): void => { + cy.url().then((productUrl: string) => { + cy.reloadUntilFound( + productUrl, + CONFIGURE_BUTTON_SELECTOR, + 'body', + CONFIGURE_BUTTON_RELOAD_ATTEMPTS, + CONFIGURE_BUTTON_RELOAD_INTERVAL_MS + ); + }); + }; + getProductConfigurator = (): Cypress.Chainable => { return this.repository.getProductConfigurator(); }; @@ -144,8 +173,10 @@ export class ProductPage extends YvesPage { cy.visit(params.url); }; + // The B2B and B2C themes dress the select up with select2, which covers the native one; the form submitter + // still listens to the native select's change event. selectVariantAttribute = (params: SelectVariantAttributeParams): void => { - this.repository.getVariantAttributeSelect(params.attributeKey).select(params.attributeValue); + this.repository.getVariantAttributeSelect(params.attributeKey).select(params.attributeValue, { force: true }); }; getVariantAttributeOptions = (attributeKey: string): Cypress.Chainable => { @@ -159,6 +190,69 @@ export class ProductPage extends YvesPage { getSelectedVariantAttributeValue = (attributeKey: string): Cypress.Chainable => { return this.repository.getSelectedVariantAttributeInput(attributeKey).invoke('val'); }; + + getRelatedProductsCarousel = (): Cypress.Chainable => this.repository.getRelatedProductsCarousel(); + + getRelatedProductsSection = (): Cypress.Chainable => cy.get(this.repository.getRelatedProductsSectionSelector()); + + getProductDetailPrice = (): Cypress.Chainable => this.repository.getProductDetailPrice(); + + getProductDetailOriginalPrice = (): Cypress.Chainable => this.repository.getProductDetailOriginalPrice(); + + getAlternativeProductsSlider = (): Cypress.Chainable => this.repository.getAlternativeProductsSlider(); + + setQuantity = (params: SetQuantityParams): void => { + this.repository.setQuantity(params.quantity); + }; + + selectSalesUnit = (params: SelectSalesUnitParams): void => { + this.repository.selectSalesUnit(params.salesUnitName); + }; + + getMeasurementUnitChoice = (): Cypress.Chainable => this.repository.getMeasurementUnitChoice(); + + setAmount = (params: SetAmountParams): void => { + this.repository.setAmount(params.amount); + }; + + getPackagingUnitChoice = (): Cypress.Chainable => this.repository.getPackagingUnitChoice(); + + getBundleItems = (): Cypress.Chainable => this.repository.getBundleItems(); + + getOutOfStockNotice = (): Cypress.Chainable => this.repository.getOutOfStockNotice(); + + // A product in stock reads "Available" (never out of stock) or "<n> in stock". The classic B2B theme + // renders no availability widget at all and only flags a product that cannot be bought. + isShownAsAvailable = ($body: JQuery<HTMLElement>): boolean => { + const text = $body.text(); + + if (text.includes('Available') || IN_STOCK_QUANTITY_PATTERN.test(text)) { + return true; + } + + return ( + $body.find(AVAILABILITY_WIDGET_SELECTOR).length === 0 && + $body.find(CLASSIC_B2B_OUT_OF_STOCK_ALERT_SELECTOR).length === 0 + ); + }; + + getAvailabilityNotificationEmailField = (): Cypress.Chainable => + this.repository.getAvailabilityNotificationEmailField(); + + getAvailabilityNotificationUnsubscribeForm = (): Cypress.Chainable => + this.repository.getAvailabilityNotificationUnsubscribeForm(); + + getFlashMessages = (): Cypress.Chainable => this.repository.getFlashMessages(); + + subscribeToAvailabilityNotification = (params: SubscribeToAvailabilityNotificationParams): void => { + this.repository.getAvailabilityNotificationEmailField().clear(); + this.repository.getAvailabilityNotificationEmailField().type(params.email); + this.repository.getAvailabilityNotificationSubscribeForm().submit(); + }; + + unsubscribeFromAvailabilityNotification = (): void => { + this.repository.getAvailabilityNotificationUnsubscribeForm().submit(); + }; } interface SelectSoldByProductOfferParams { @@ -181,6 +275,22 @@ interface VisitProductDetailPageParams { url: string; } +interface SubscribeToAvailabilityNotificationParams { + email: string; +} + +interface SetAmountParams { + amount: number; +} + +interface SelectSalesUnitParams { + salesUnitName: string; +} + +interface SetQuantityParams { + quantity: number; +} + interface SelectVariantAttributeParams { attributeKey: string; attributeValue: string; diff --git a/cypress/support/pages/yves/product/product-repository.ts b/cypress/support/pages/yves/product/product-repository.ts index ee01e81a8..73e4b6329 100644 --- a/cypress/support/pages/yves/product/product-repository.ts +++ b/cypress/support/pages/yves/product/product-repository.ts @@ -4,6 +4,11 @@ export interface ProductRepository { getMerchantRelationRequestLinkAttribute(): string; getInputRadioSelector(): string; getProductConfigurator(): Cypress.Chainable; + + // ProductConfigurationWidget prints whether the product is configured yet, and the form whose + // button hands over to the external configurator. + getProductConfigurationStatus(): Cypress.Chainable; + getConfigureButton(): Cypress.Chainable; getAddToCartButton(): Cypress.Chainable; getAddToCartSuccessMessage(): string; getQuantityInput(): Cypress.Chainable; @@ -29,4 +34,44 @@ export interface ProductRepository { getVariantAttributeSelect(attributeKey: string): Cypress.Chainable; getVariantAttributeOptions(attributeKey: string): Cypress.Chainable; getSelectedVariantAttributeInput(attributeKey: string): Cypress.Chainable; + getRelatedProductsCarousel(): Cypress.Chainable; + getRelatedProductsSectionSelector(): string; + + // The price block on the detail page itself. The related-products carousel prints prices too, + // so this must stay narrowed to the product being viewed. + getProductDetailPrice(): Cypress.Chainable; + + // Rendered only when an ORIGINAL price above the default exists, which is what makes it the + // assertion for a strike-through price rather than a second copy of the default one. + getProductDetailOriginalPrice(): Cypress.Chainable; + + // Rendered next to its own heading, not in the related-products slot — both are the same carousel + // component in some themes, so the heading is what tells them apart. + getAlternativeProductsSlider(): Cypress.Chainable; + + // The quantity control renders as a select for some products and as a formatted-number-input for + // others, and the volume-price component only recalculates on a real change event — so setting the + // quantity is an interaction, not a selector. + setQuantity(quantity: number): void; + + // The measurement-unit widget's own controls: which sales unit the quantity is counted in, and the + // block it reveals when the quantity does not land on a whole base unit. + selectSalesUnit(salesUnitName: string): void; + getMeasurementUnitChoice(): Cypress.Chainable; + + // A packaging unit is ordered by amount rather than by quantity, and it has its own choice block + // for the min / max / interval rules that amount has to satisfy. + setAmount(amount: number): void; + getPackagingUnitChoice(): Cypress.Chainable; + + // What a bundle product lists on its detail page. The data-qa is the same in every theme. + getBundleItems(): Cypress.Chainable; + + // Availability state and the back-in-stock notification form. The form ids come from the Symfony + // form types, so they are the same wherever the widget is rendered. + getOutOfStockNotice(): Cypress.Chainable; + getAvailabilityNotificationEmailField(): Cypress.Chainable; + getAvailabilityNotificationSubscribeForm(): Cypress.Chainable; + getAvailabilityNotificationUnsubscribeForm(): Cypress.Chainable; + getFlashMessages(): Cypress.Chainable; } diff --git a/cypress/support/pages/yves/product/repositories/b2b-mp-product-repository.ts b/cypress/support/pages/yves/product/repositories/b2b-mp-product-repository.ts index e5767df63..3058dddd7 100644 --- a/cypress/support/pages/yves/product/repositories/b2b-mp-product-repository.ts +++ b/cypress/support/pages/yves/product/repositories/b2b-mp-product-repository.ts @@ -51,4 +51,80 @@ export class B2bMpProductRepository implements ProductRepository { this.getVariantAttributeSelect(attributeKey).find('option[value]:not([value=""])'); getSelectedVariantAttributeInput = (attributeKey: string): Cypress.Chainable => cy.get(`input[type="hidden"][name="attribute[${attributeKey}]"]`); + getRelatedProductsSectionSelector = (): string => '[class*="title--product-slider"]:contains("Similar products")'; + getRelatedProductsCarousel = (): Cypress.Chainable => + cy.get(this.getRelatedProductsSectionSelector()).first().parent().find('slick-carousel'); + getProductConfigurationStatus = (): Cypress.Chainable => + cy.get('[data-qa="component product-configurator"] [data-qa="component status"]'); + getConfigureButton = (): Cypress.Chainable => cy.get('[data-qa="component configuration-form"] button'); + + getProductDetailPrice = (): Cypress.Chainable => cy.get('volume-price span.volume-price__price:visible').first(); + getProductDetailOriginalPrice = (): Cypress.Chainable => + cy.get('volume-price span[class*="volume-price"][class*="original"]:visible').first(); + + getAlternativeProductsSlider = (): Cypress.Chainable => cy.get('[data-qa="component product-alternative-slider"]'); + + setQuantity = (quantity: number): void => { + cy.get('body').then(($body) => { + // The volume-price component binds its own quantity control. A logged-in detail page also + // renders a quantity select for the shopping-list widget, so matching on the name alone finds + // two and cy.select() refuses the pair. + if ($body.find('select.js-volume-price__quantity').length) { + cy.get('select.js-volume-price__quantity').first().select(String(quantity)); + + return; + } + + // On a measurement-unit product the quantity is counted in sales units, and the field beside + // it holds the resulting amount in base units — writing the amount instead would not convert. + if ($body.find('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').length) { + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input') + .first() + .type(String(quantity)); + + return; + } + + if ($body.find('select[name="quantity"]').length) { + cy.get('select[name="quantity"]').first().select(String(quantity)); + + return; + } + + // The volume-price component re-prices on the change event, which typing alone does not fire + // before the field loses focus. + cy.get('formatted-number-input input').first().clear(); + cy.get('formatted-number-input input').first().type(String(quantity)); + cy.get('formatted-number-input input').first().trigger('change'); + }); + }; + + // select2 lays its own box over the native select; the packaging unit selector still listens to the + // native select's change event. + selectSalesUnit = (salesUnitName: string): void => { + cy.get('select[name="id-product-measurement-sales-unit"]').select(salesUnitName, { force: true }); + }; + + getMeasurementUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__measurement-unit-choice'); + + setAmount = (amount: number): void => { + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().type(String(amount)); + }; + + getPackagingUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__packaging-unit-choice'); + + getBundleItems = (): Cypress.Chainable => cy.get('[data-qa*="component bundle-items"]'); + + getOutOfStockNotice = (): Cypress.Chainable => + cy.get('[data-qa="component product-availability-widget"] [data-qa="component status"]:contains("Out of stock")'); + getAvailabilityNotificationEmailField = (): Cypress.Chainable => + cy.get('#availabilityNotificationSubscriptionForm_email'); + getAvailabilityNotificationSubscribeForm = (): Cypress.Chainable => + cy.get('form#availability_notification_subscription'); + getAvailabilityNotificationUnsubscribeForm = (): Cypress.Chainable => cy.get('form#availability_unsubscribe'); + getFlashMessages = (): Cypress.Chainable => cy.get('[data-qa="component notification-area"] flash-message'); } diff --git a/cypress/support/pages/yves/product/repositories/b2b-product-repository.ts b/cypress/support/pages/yves/product/repositories/b2b-product-repository.ts index 190470e8d..fb113fa40 100644 --- a/cypress/support/pages/yves/product/repositories/b2b-product-repository.ts +++ b/cypress/support/pages/yves/product/repositories/b2b-product-repository.ts @@ -48,4 +48,85 @@ export class B2bProductRepository implements ProductRepository { this.getVariantAttributeSelect(attributeKey).find('option[value]:not([value=""])'); getSelectedVariantAttributeInput = (attributeKey: string): Cypress.Chainable => cy.get(`input[type="hidden"][name="attribute[${attributeKey}]"]`); + getRelatedProductsSectionSelector = (): string => '[class*="title--product-slider"]:contains("Similar products")'; + getRelatedProductsCarousel = (): Cypress.Chainable => + cy.get(this.getRelatedProductsSectionSelector()).first().parent().find('slick-carousel'); + getProductConfigurationStatus = (): Cypress.Chainable => + cy.get('[data-qa="component product-configurator"] [data-qa="component status"]'); + getConfigureButton = (): Cypress.Chainable => cy.get('[data-qa="component configuration-form"] button'); + + getProductDetailPrice = (): Cypress.Chainable => cy.get('volume-price span.volume-price__price:visible').first(); + getProductDetailOriginalPrice = (): Cypress.Chainable => + cy.get('volume-price span[class*="volume-price"][class*="original"]:visible').first(); + + getAlternativeProductsSlider = (): Cypress.Chainable => cy.get('[data-qa="component product-alternative-slider"]'); + + setQuantity = (quantity: number): void => { + cy.get('body').then(($body) => { + // The volume-price component binds its own quantity control. A logged-in detail page also + // renders a quantity select for the shopping-list widget, so matching on the name alone finds + // two and cy.select() refuses the pair. + if ($body.find('select.js-volume-price__quantity').length) { + cy.get('select.js-volume-price__quantity').first().select(String(quantity)); + + return; + } + + // On a measurement-unit product the quantity is counted in sales units, and the field beside + // it holds the resulting amount in base units — writing the amount instead would not convert. + if ($body.find('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').length) { + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input') + .first() + .type(String(quantity)); + + return; + } + + if ($body.find('select[name="quantity"]').length) { + cy.get('select[name="quantity"]').first().select(String(quantity)); + + return; + } + + // The volume-price component re-prices on the change event, which typing alone does not fire + // before the field loses focus. + cy.get('formatted-number-input input').first().clear(); + cy.get('formatted-number-input input').first().type(String(quantity)); + cy.get('formatted-number-input input').first().trigger('change'); + }); + }; + + // Both B2B themes dress the native select up with select2, which lays its own box over it; the + // packaging unit selector still listens to the native select's change event. + selectSalesUnit = (salesUnitName: string): void => { + cy.get('select[name="id-product-measurement-sales-unit"]').select(salesUnitName, { force: true }); + }; + + getMeasurementUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__measurement-unit-choice'); + + setAmount = (amount: number): void => { + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().type(String(amount)); + }; + + getPackagingUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__packaging-unit-choice'); + + getBundleItems = (): Cypress.Chainable => cy.get('[data-qa*="component bundle-items"]'); + + // The redesigned theme states availability in a status badge either way; the classic theme has no + // badge and only renders an alert under the add to cart form once the product is out of stock. + getOutOfStockNotice = (): Cypress.Chainable => + cy.get( + '[data-qa="component product-availability-widget"] [data-qa="component status"]:contains("Out of stock"), ' + + '[data-qa="component product-configurator"] .text-alert:contains("This product is currently not available.")' + ); + getAvailabilityNotificationEmailField = (): Cypress.Chainable => + cy.get('#availabilityNotificationSubscriptionForm_email'); + getAvailabilityNotificationSubscribeForm = (): Cypress.Chainable => + cy.get('form#availability_notification_subscription'); + getAvailabilityNotificationUnsubscribeForm = (): Cypress.Chainable => cy.get('form#availability_unsubscribe'); + getFlashMessages = (): Cypress.Chainable => cy.get('[data-qa="component notification-area"] flash-message'); } diff --git a/cypress/support/pages/yves/product/repositories/b2c-mp-product-repository.ts b/cypress/support/pages/yves/product/repositories/b2c-mp-product-repository.ts index 39649ab82..daa1b5f0a 100644 --- a/cypress/support/pages/yves/product/repositories/b2c-mp-product-repository.ts +++ b/cypress/support/pages/yves/product/repositories/b2c-mp-product-repository.ts @@ -3,7 +3,9 @@ import { ProductRepository } from '../product-repository'; @injectable() export class B2cMpProductRepository implements ProductRepository { - getSoldByProductOffers = (): Cypress.Chainable => cy.get('[data-qa="component merchant-product-offer-item"]'); + // The sold by list renders the merchant's own product as a merchant product item ahead of the offer items. + getSoldByProductOffers = (): Cypress.Chainable => + cy.get('[data-qa="component merchant-product-item"], [data-qa="component merchant-product-offer-item"]'); getSoldByProductOfferRadios = (): Cypress.Chainable => cy.get('[data-qa="component merchant-product-offer-item"] input[type="radio"]'); getMerchantRelationRequestLinkAttribute = (): string => '[data-qa="merchant-relation-request-create-link"]'; @@ -44,4 +46,92 @@ export class B2cMpProductRepository implements ProductRepository { this.getVariantAttributeSelect(attributeKey).find('option[value]:not([value=""])'); getSelectedVariantAttributeInput = (attributeKey: string): Cypress.Chainable => cy.get(`input[type="hidden"][name="attribute[${attributeKey}]"]`); + getRelatedProductsSectionSelector = (): string => '[class*="product-slider"]:contains("You might also like")'; + getRelatedProductsCarousel = (): Cypress.Chainable => + cy.get(this.getRelatedProductsSectionSelector()).first().parent().find('slick-carousel'); + getProductConfigurationStatus = (): Cypress.Chainable => + cy.get('[data-qa="component product-configurator"] [data-qa="component status"]'); + getConfigureButton = (): Cypress.Chainable => cy.get('[data-qa="component configuration-form"] button'); + + getProductDetailPrice = (): Cypress.Chainable => cy.get('volume-price span.volume-price__price:visible').first(); + getProductDetailOriginalPrice = (): Cypress.Chainable => + cy.get('volume-price span[class*="volume-price"][class*="original"]:visible').first(); + + getAlternativeProductsSlider = (): Cypress.Chainable => + cy.get('[class*="product-slider"]:contains("Alternative products")').first().parent().find('slick-carousel'); + + setQuantity = (quantity: number): void => { + cy.get('body').then(($body) => { + // The volume-price component binds its own quantity control. A logged-in detail page also + // renders a quantity select for the shopping-list widget, so matching on the name alone finds + // two and cy.select() refuses the pair. + if ($body.find('select.js-volume-price__quantity').length) { + cy.get('select.js-volume-price__quantity').first().select(String(quantity)); + + return; + } + + // On a measurement-unit product the quantity is counted in sales units, and the field beside + // it holds the resulting amount in base units — writing the amount instead would not convert. + if ($body.find('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').length) { + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input') + .first() + .type(String(quantity)); + + return; + } + + if ($body.find('select[name="quantity"]').length) { + cy.get('select[name="quantity"]').first().select(String(quantity)); + + return; + } + + // The detail page renders its quantity read-only, so only the counter buttons change it. + if ($body.find('.js-quantity-counter__input[readonly]:visible').length) { + cy.get('.js-quantity-counter__input[readonly]:visible') + .first() + .then(($input) => { + const difference = quantity - parseInt(String($input.val()).replace(/\D/g, ''), 10); + const button = difference > 0 ? '.js-quantity-counter__incr' : '.js-quantity-counter__decr'; + + Cypress._.times(Math.abs(difference), () => + cy.wrap($input).closest('quantity-counter').find(button).click() + ); + }); + + return; + } + + cy.get('formatted-number-input input').first().clear(); + cy.get('formatted-number-input input').first().type(String(quantity)); + }); + }; + + selectSalesUnit = (salesUnitName: string): void => { + cy.get('select[name="id-product-measurement-sales-unit"]').select(salesUnitName); + }; + + getMeasurementUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__measurement-unit-choice'); + + setAmount = (amount: number): void => { + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().type(String(amount)); + }; + + getPackagingUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__packaging-unit-choice'); + + getBundleItems = (): Cypress.Chainable => cy.get('[data-qa*="component bundle-items"]'); + + // The B2C theme renders no availability status, only an out-of-stock note in place of the quantity. + getOutOfStockNotice = (): Cypress.Chainable => cy.get('[data-qa="component availability-product"]'); + getAvailabilityNotificationEmailField = (): Cypress.Chainable => + cy.get('#availabilityNotificationSubscriptionForm_email'); + getAvailabilityNotificationSubscribeForm = (): Cypress.Chainable => + cy.get('form#availability_notification_subscription'); + getAvailabilityNotificationUnsubscribeForm = (): Cypress.Chainable => cy.get('form#availability_unsubscribe'); + getFlashMessages = (): Cypress.Chainable => cy.get('[data-qa="component notification-area"] flash-message'); } diff --git a/cypress/support/pages/yves/product/repositories/b2c-product-repository.ts b/cypress/support/pages/yves/product/repositories/b2c-product-repository.ts index caad5f8c1..5d788017c 100644 --- a/cypress/support/pages/yves/product/repositories/b2c-product-repository.ts +++ b/cypress/support/pages/yves/product/repositories/b2c-product-repository.ts @@ -44,4 +44,92 @@ export class B2cProductRepository implements ProductRepository { this.getVariantAttributeSelect(attributeKey).find('option[value]:not([value=""])'); getSelectedVariantAttributeInput = (attributeKey: string): Cypress.Chainable => cy.get(`input[type="hidden"][name="attribute[${attributeKey}]"]`); + getRelatedProductsSectionSelector = (): string => '[class*="product-slider"]:contains("You might also like")'; + getRelatedProductsCarousel = (): Cypress.Chainable => + cy.get(this.getRelatedProductsSectionSelector()).first().parent().find('slick-carousel'); + getProductConfigurationStatus = (): Cypress.Chainable => + cy.get('[data-qa="component product-configurator"] [data-qa="component status"]'); + getConfigureButton = (): Cypress.Chainable => cy.get('[data-qa="component configuration-form"] button'); + + getProductDetailPrice = (): Cypress.Chainable => cy.get('volume-price span.volume-price__price:visible').first(); + getProductDetailOriginalPrice = (): Cypress.Chainable => + cy.get('volume-price span[class*="volume-price"][class*="original"]:visible').first(); + + getAlternativeProductsSlider = (): Cypress.Chainable => + cy.get('[class*="product-slider"]:contains("Alternative products")').first().parent().find('slick-carousel'); + + setQuantity = (quantity: number): void => { + cy.get('body').then(($body) => { + // The volume-price component binds its own quantity control. A logged-in detail page also + // renders a quantity select for the shopping-list widget, so matching on the name alone finds + // two and cy.select() refuses the pair. + if ($body.find('select.js-volume-price__quantity').length) { + cy.get('select.js-volume-price__quantity').first().select(String(quantity)); + + return; + } + + // On a measurement-unit product the quantity is counted in sales units, and the field beside + // it holds the resulting amount in base units — writing the amount instead would not convert. + if ($body.find('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').length) { + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input') + .first() + .type(String(quantity)); + + return; + } + + if ($body.find('select[name="quantity"]').length) { + cy.get('select[name="quantity"]').first().select(String(quantity)); + + return; + } + + // The detail page renders its quantity read-only, so only the counter buttons change it. + if ($body.find('.js-quantity-counter__input[readonly]:visible').length) { + cy.get('.js-quantity-counter__input[readonly]:visible') + .first() + .then(($input) => { + const difference = quantity - parseInt(String($input.val()).replace(/\D/g, ''), 10); + const button = difference > 0 ? '.js-quantity-counter__incr' : '.js-quantity-counter__decr'; + + Cypress._.times(Math.abs(difference), () => + cy.wrap($input).closest('quantity-counter').find(button).click() + ); + }); + + return; + } + + cy.get('formatted-number-input input').first().clear(); + cy.get('formatted-number-input input').first().type(String(quantity)); + }); + }; + + selectSalesUnit = (salesUnitName: string): void => { + cy.get('select[name="id-product-measurement-sales-unit"]').select(salesUnitName); + }; + + getMeasurementUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__measurement-unit-choice'); + + setAmount = (amount: number): void => { + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().type(String(amount)); + }; + + getPackagingUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__packaging-unit-choice'); + + getBundleItems = (): Cypress.Chainable => cy.get('[data-qa*="component bundle-items"]'); + + // The B2C theme renders no availability status, only an out-of-stock note in place of the quantity. + getOutOfStockNotice = (): Cypress.Chainable => cy.get('[data-qa="component availability-product"]'); + getAvailabilityNotificationEmailField = (): Cypress.Chainable => + cy.get('#availabilityNotificationSubscriptionForm_email'); + getAvailabilityNotificationSubscribeForm = (): Cypress.Chainable => + cy.get('form#availability_notification_subscription'); + getAvailabilityNotificationUnsubscribeForm = (): Cypress.Chainable => cy.get('form#availability_unsubscribe'); + getFlashMessages = (): Cypress.Chainable => cy.get('[data-qa="component notification-area"] flash-message'); } diff --git a/cypress/support/pages/yves/product/repositories/suite-product-repository.ts b/cypress/support/pages/yves/product/repositories/suite-product-repository.ts index 4f8e00ddf..3910972a5 100644 --- a/cypress/support/pages/yves/product/repositories/suite-product-repository.ts +++ b/cypress/support/pages/yves/product/repositories/suite-product-repository.ts @@ -46,4 +46,76 @@ export class SuiteProductRepository implements ProductRepository { this.getVariantAttributeSelect(attributeKey).find('option[value]:not([value=""])'); getSelectedVariantAttributeInput = (attributeKey: string): Cypress.Chainable => cy.get(`input[type="hidden"][name="attribute[${attributeKey}]"]`); + getRelatedProductsSectionSelector = (): string => 'main simple-carousel[data-qa="component simple-carousel"]'; + getRelatedProductsCarousel = (): Cypress.Chainable => cy.get(this.getRelatedProductsSectionSelector()).first(); + getProductConfigurationStatus = (): Cypress.Chainable => + cy.get('[data-qa="component product-configurator"] [data-qa="component status"]'); + getConfigureButton = (): Cypress.Chainable => cy.get('[data-qa="component configuration-form"] button'); + + getProductDetailPrice = (): Cypress.Chainable => + cy.get('[data-qa="component product-configurator"] volume-price span.volume-price__price'); + getProductDetailOriginalPrice = (): Cypress.Chainable => + cy.get('[data-qa="component product-configurator"] volume-price span[class*="volume-price"][class*="original"]'); + + getAlternativeProductsSlider = (): Cypress.Chainable => + cy.contains('h2', 'Alternative products').next('simple-carousel'); + + setQuantity = (quantity: number): void => { + cy.get('body').then(($body) => { + // The volume-price component binds its own quantity control. A logged-in detail page also + // renders a quantity select for the shopping-list widget, so matching on the name alone finds + // two and cy.select() refuses the pair. + if ($body.find('select.js-volume-price__quantity').length) { + cy.get('select.js-volume-price__quantity').first().select(String(quantity)); + + return; + } + + // On a measurement-unit product the quantity is counted in sales units, and the field beside + // it holds the resulting amount in base units — writing the amount instead would not convert. + if ($body.find('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').length) { + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-sales-unit-quantity input') + .first() + .type(String(quantity)); + + return; + } + + if ($body.find('select[name="quantity"]').length) { + cy.get('select[name="quantity"]').first().select(String(quantity)); + + return; + } + + cy.get('formatted-number-input input').first().clear(); + cy.get('formatted-number-input input').first().type(String(quantity)); + }); + }; + + selectSalesUnit = (salesUnitName: string): void => { + cy.get('select[name="id-product-measurement-sales-unit"]').select(salesUnitName); + }; + + getMeasurementUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__measurement-unit-choice'); + + setAmount = (amount: number): void => { + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().clear(); + cy.get('.js-packaging-unit-quantity-selector__formatted-user-amount input').first().type(String(amount)); + }; + + getPackagingUnitChoice = (): Cypress.Chainable => + cy.get('.js-packaging-unit-quantity-selector__packaging-unit-choice'); + + getBundleItems = (): Cypress.Chainable => cy.get('[data-qa*="component bundle-items"]'); + + getOutOfStockNotice = (): Cypress.Chainable => + cy.get('[data-qa="component product-availability-widget"] [data-qa="component status"]:contains("Out of stock")'); + getAvailabilityNotificationEmailField = (): Cypress.Chainable => + cy.get('#availabilityNotificationSubscriptionForm_email'); + getAvailabilityNotificationSubscribeForm = (): Cypress.Chainable => + cy.get('form#availability_notification_subscription'); + getAvailabilityNotificationUnsubscribeForm = (): Cypress.Chainable => cy.get('form#availability_unsubscribe'); + getFlashMessages = (): Cypress.Chainable => cy.get('[data-qa="component notification-area"] flash-message'); } diff --git a/cypress/support/pages/yves/quick-order/quick-order-page.ts b/cypress/support/pages/yves/quick-order/quick-order-page.ts new file mode 100644 index 000000000..6a4b0c2a2 --- /dev/null +++ b/cypress/support/pages/yves/quick-order/quick-order-page.ts @@ -0,0 +1,25 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; + +@injectable() +@autoWired +export class QuickOrderPage extends YvesPage { + protected PAGE_URL = '/quick-order'; + + // One "<sku>,<quantity>" per line, which is what the page tells the buyer to paste in. + verifyPastedOrder = (pastedOrder: string): void => { + cy.get('#text_order_form_textOrder').clear(); + cy.get('#text_order_form_textOrder').type(pastedOrder); + cy.get('button[name="textOrder"]').click(); + }; + + addRowsToCart = (): void => { + cy.get('button[name="addToCart"]').click(); + }; + + addRowsToShoppingList = (name: string): void => { + cy.get('select[name="idShoppingList"]').select(name); + cy.get('button[name="addToShoppingList"]').click(); + }; +} diff --git a/cypress/support/pages/yves/quote-request/quote-request-page.ts b/cypress/support/pages/yves/quote-request/quote-request-page.ts new file mode 100644 index 000000000..2ac3e66f5 --- /dev/null +++ b/cypress/support/pages/yves/quote-request/quote-request-page.ts @@ -0,0 +1,57 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +import { YvesPage } from '@pages/yves'; + +// No per-repository repository: the quote request pages come from the core QuoteRequestPage and +// QuoteRequestAgentPage modules, which the shops do not re-theme, and the feature only exists on +// the company-account storefronts. The markup carries almost no data-qa, so the routes the links +// and forms point at are the handles. +@injectable() +@autoWired +export class QuoteRequestPage extends YvesPage { + protected PAGE_URL = '/quote-request'; + + createFromCart = (): void => { + cy.visit('/quote-request/create'); + cy.get('form[name="quote_request_form"]').find('button[type="submit"]').click(); + }; + + getReference = (): Cypress.Chainable<string> => + cy + .get('a[href*="/quote-request/send-to-user/"]') + .invoke('attr', 'href') + .then((href) => (href as string).split('/send-to-user/')[1]); + + sendToAgent = (): void => { + this.getSendToAgentLink().click(); + }; + + getSendToAgentLink = (): Cypress.Chainable => cy.get('a[href*="/quote-request/send-to-user/"]'); + + visitDetails = (reference: string): void => { + cy.visit(`/quote-request/details/${reference}`); + }; + + convertToCart = (reference: string): void => { + cy.get(`a[href*="/quote-request/convert-to-cart/${reference}"]`).click(); + }; + + visitAgentRevise = (reference: string): void => { + cy.visit(`/agent/quote-request/revise/${reference}`); + }; + + // The price cell is a source-price form: a use_default_price checkbox guards the input, so the + // custom price is only taken once that box is cleared. + reviseFirstItemPrice = (price: string): void => { + cy.get('input[name="use_default_price"]').first().uncheck({ force: true }); + const priceInput = '#quote_request_agent_form_latestVersion_quote_items_0_sourceUnitGrossPrice'; + + cy.get(priceInput).clear({ force: true }); + cy.get(priceInput).type(price, { force: true }); + }; + + sendToCustomer = (): void => { + cy.contains('button', 'Send to Customer').click(); + }; +} diff --git a/cypress/support/pages/yves/return/return-create-page.ts b/cypress/support/pages/yves/return/return-create-page.ts new file mode 100644 index 000000000..d42207e1e --- /dev/null +++ b/cypress/support/pages/yves/return/return-create-page.ts @@ -0,0 +1,26 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; +import { ReturnCreateRepository } from './return-create-repository'; + +@injectable() +@autoWired +export class ReturnCreatePage extends YvesPage { + @inject(ReturnCreateRepository) private repository: ReturnCreateRepository; + + protected PAGE_URL = '/return/create'; + + // The visible control is a styled label; the real input is the one carrying the value and it is + // covered by CSS, so it has to be checked forcibly. Its change event is what enables the submit + // button, which SalesReturnPage renders disabled until a line is ticked. + selectItem = (sku: string): void => { + this.repository + .getReturnItemBlock(sku) + .find(this.repository.getReturnItemCheckboxSelector()) + .check({ force: true }); + }; + + submit = (): void => { + this.repository.getSubmitButton().click(); + }; +} diff --git a/cypress/support/pages/yves/return/return-create-repository.ts b/cypress/support/pages/yves/return/return-create-repository.ts new file mode 100644 index 000000000..e1dbe43c5 --- /dev/null +++ b/cypress/support/pages/yves/return/return-create-repository.ts @@ -0,0 +1,18 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +@injectable() +@autoWired +export class ReturnCreateRepository { + // Every returnable line of the order renders as its own grid--justify row carrying the item's SKU - + // a .box only in the suite, the B2B and B2C themes drop that class - so the SKU is what identifies + // the line whose checkbox puts the item in the return. A line the OMS does not consider returnable + // renders that checkbox disabled rather than hiding it. + getReturnItemBlock = (sku: string): Cypress.Chainable => cy.contains('small', sku).closest('.grid--justify'); + + getReturnItemCheckboxSelector = (): string => 'input.js-return-create__trigger-state-toggler'; + + // SalesReturnPage ships the submit button disabled; its own JS enables it once a line is ticked. + // The redesigned B2B theme repeats it in the page header, and either one submits the form. + getSubmitButton = (): Cypress.Chainable => cy.get('button.js-return-create__target-state-toggler').first(); +} diff --git a/cypress/support/pages/yves/return/return-list-page.ts b/cypress/support/pages/yves/return/return-list-page.ts new file mode 100644 index 000000000..084f082c8 --- /dev/null +++ b/cypress/support/pages/yves/return/return-list-page.ts @@ -0,0 +1,9 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; + +@injectable() +@autoWired +export class ReturnListPage extends YvesPage { + protected PAGE_URL = '/return/list'; +} diff --git a/cypress/support/pages/yves/return/return-view-page.ts b/cypress/support/pages/yves/return/return-view-page.ts new file mode 100644 index 000000000..a35eac2e2 --- /dev/null +++ b/cypress/support/pages/yves/return/return-view-page.ts @@ -0,0 +1,9 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; + +@injectable() +@autoWired +export class ReturnViewPage extends YvesPage { + protected PAGE_URL = '/return/view'; +} diff --git a/cypress/support/pages/yves/shopping-list/shopping-list-page.ts b/cypress/support/pages/yves/shopping-list/shopping-list-page.ts new file mode 100644 index 000000000..356d394d1 --- /dev/null +++ b/cypress/support/pages/yves/shopping-list/shopping-list-page.ts @@ -0,0 +1,92 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; + +@injectable() +@autoWired +export class ShoppingListPage extends YvesPage { + protected PAGE_URL = '/shopping-list'; + + // Generated here, not taken from a fixture, so a retry creates a list of its own rather than a + // second one under the name the failed attempt already used. + createShoppingList = (name?: string): string => { + const shoppingListName = name ?? `Shopping list ${this.faker.string.uuid()}`; + + cy.get('#shopping_list_form_name').clear(); + cy.get('#shopping_list_form_name').type(shoppingListName); + cy.get('form[name="shopping_list_form"] [data-qa="submit-button"]').click(); + + return shoppingListName; + }; + + // The B2B shops render the overview, the share entries and the items through their own molecules. + getShoppingListOverviewEntry = (name: string): Cypress.Chainable => + cy.contains( + '[data-qa="component shopping-list-overview"] a, [data-qa="component shopping-list-overview-table"] a', + name + ); + + openShoppingList = (name: string): void => { + this.getShoppingListOverviewEntry(name).click(); + }; + + getShoppingListItemsTable = (): Cypress.Chainable => + cy.get('[data-qa="component shopping-list"], [data-qa="component shopping-list-table"]'); + + getShoppingListOverviewRow = (name: string): Cypress.Chainable => + cy.contains( + '[data-qa="component shopping-list-overview"] tbody tr, [data-qa="component shopping-list-overview-table"] tbody tr', + name + ); + + // The visible Share button on a list's own page. Scoped to the customer content, because the + // collapsed side drawer carries a hidden copy of the same link. + openSharePage = (): void => { + cy.get('#customer-content a[href*="/shopping-list/share/"]').first().click(); + }; + + shareWithCompanyUser = (params: ShareWithCompanyUserParams): void => { + cy.contains('[data-qa="component share-list-item"], [data-qa="component shopping-list-item"]', params.name) + .find('select') + .select(params.accessLevel, { force: true }); + cy.get('form[name="share_shopping_list_form"] [data-qa="submit-button"]').click(); + }; + + // A shopping-list row reaches the configurator through the generic remote-form-submit molecule, so + // the configurator route in its form-action is what tells it apart from the row's other actions. + // The classic B2B theme renders each row as a product card instead of a table row. + configureProduct = (params: ConfigureProductParams): void => { + cy.contains( + '[data-qa="component shopping-list"] tr, [data-qa="component shopping-list-table"] [data-qa="component product-card-item"]', + params.sku + ) + .find('[data-qa="component remote-form-submit"][form-action*="configurator"] button') + .click(); + }; + + addAllAvailableProductsToCart = (): void => { + cy.get('form[name="shopping_list_add_item_to_cart_form"] button[name="add-all-available"]').click(); + }; + + // The add-to-shopping-list widget lives on the product detail page. Its offer field is filled in + // server-side from the offer selected there, so reading it back proves which merchant the next + // add belongs to. + getAddToShoppingListProductOfferInput = (): Cypress.Chainable => + cy.get('form.js-shopping-list__form input[name="productOfferReference"]'); + + // Forced, because the B2B marketplace keeps this form in a popup that has to be opened first and + // dresses the list select up with select2; the form submits all the same. + addDisplayedProductToShoppingList = (name: string): void => { + cy.get('form.js-shopping-list__form select[name="idShoppingList"]').select(name, { force: true }); + cy.get('form.js-shopping-list__form [data-qa="add-to-shopping-list-button"]').click({ force: true }); + }; +} + +interface ShareWithCompanyUserParams { + name: string; + accessLevel: string; +} + +interface ConfigureProductParams { + sku: string; +} diff --git a/cypress/support/pages/yves/wishlist/wishlist-page.ts b/cypress/support/pages/yves/wishlist/wishlist-page.ts new file mode 100644 index 000000000..d813b7030 --- /dev/null +++ b/cypress/support/pages/yves/wishlist/wishlist-page.ts @@ -0,0 +1,61 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; +import { YvesPage } from '@pages/yves'; + +@injectable() +@autoWired +export class WishlistPage extends YvesPage { + protected PAGE_URL = '/wishlist'; + + // Generated here, not taken from a fixture, so a retry creates a wishlist of its own rather than a + // second one under the failed attempt's name. The form's name validation allows only [ A-Za-z0-9_-]. + createWishlist = (name?: string): string => { + const wishlistName = name ?? `Wishlist ${this.faker.string.uuid()}`; + + cy.get('#wishlist_form_name').clear(); + cy.get('#wishlist_form_name').type(wishlistName); + cy.get('[data-qa="component wishlist-form"] [type="submit"]').click(); + + return wishlistName; + }; + + getWishlistOverviewEntry = (name: string): Cypress.Chainable => + cy.contains('[data-qa="component wishlist-overview-table"] a', name); + + openWishlist = (name: string): void => { + this.getWishlistOverviewEntry(name).click(); + }; + + // The B2C shops rename the detail table's component to wishlist-detail-table. + getWishlistItemsTable = (): Cypress.Chainable => + cy.get('[data-qa="component wishlist-table"], [data-qa="component wishlist-detail-table"]'); + + // The wishlist selector is a widget on the product detail page: it posts the displayed product + // to `wishlist/add-item`. Its picker is filled in by an ajax call after page load, so reading it + // is what waits for that call to have rendered. The B2C shops render the older wishlist-selector + // molecule instead of wishlist-selector-default, and wrap the picker in a custom select that hides it. + getWishlistPicker = (): Cypress.Chainable => + cy.get( + '[data-qa="component wishlist-selector-default"] [name="wishlist-name"], [data-qa="component wishlist-selector"] [name="wishlist-name"]' + ); + + addDisplayedProductToWishlist = (name: string): void => { + this.getWishlistPicker().filter('select').first().select(name, { force: true }); + this.getAddToWishlistForm().submit(); + }; + + getAddToWishlistForm = (): Cypress.Chainable => + cy.get('form.wishlist-selector-default__form, form.wishlist-selector__form').first(); + + // A wishlist row carries its own configure form, distinct from both the detail page's + // configuration-form and the cart's configuration-cart-form. + configureProduct = (params: ConfigureProductParams): void => { + cy.contains('[data-qa="component wishlist-table"] tr, [data-qa="component wishlist-detail-table"] tr', params.sku) + .find('[data-qa="component wishlist-configuration-form"] button') + .click(); + }; +} + +interface ConfigureProductParams { + sku: 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 index 539091b6e..37c008904 100644 --- a/cypress/support/scenarios/backoffice/assign-store-to-product-scenario.ts +++ b/cypress/support/scenarios/backoffice/assign-store-to-product-scenario.ts @@ -16,6 +16,9 @@ export class AssignStoreToProductScenario { .find({ searchQuery: params.abstractProductSku, interceptTableUrl: `**/product-management/index/table**`, + // The abstract sku is unique, and waiting for the table to show that one row keeps the edit + // link from being taken off the unfiltered table before it redraws. + expectedCount: 1, }) .then((getRow) => { if (!getRow) { diff --git a/cypress/support/scenarios/backoffice/create-cms-page-scenario.ts b/cypress/support/scenarios/backoffice/create-cms-page-scenario.ts index b430e8b72..e470caa02 100644 --- a/cypress/support/scenarios/backoffice/create-cms-page-scenario.ts +++ b/cypress/support/scenarios/backoffice/create-cms-page-scenario.ts @@ -12,7 +12,11 @@ export class CreateCmsPageScenario { this.cmsPageCreatePage.visit(); this.cmsPageCreatePage.create({ cmsPageName: params.cmsPageName }); - this.cmsPlaceholderEditPage.update({ cmsPageName: params.cmsPageName }); + if (params.placeholders) { + this.cmsPlaceholderEditPage.updateTitleAndContent(params.placeholders); + } else { + this.cmsPlaceholderEditPage.update({ cmsPageName: params.cmsPageName }); + } if (params.shouldTriggerPublishAndSync) { cy.runQueueWorker(); @@ -22,5 +26,7 @@ export class CreateCmsPageScenario { interface ExecuteParams { cmsPageName: string; + // Omit to write the page name into the title placeholder, which is all most callers need. + placeholders?: { title: string; content: string }; shouldTriggerPublishAndSync?: boolean; } 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 index aeba3b56f..46aee19cc 100644 --- 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 @@ -24,7 +24,7 @@ export class EnableCmsBlockForAllStoresScenario { getRow().then(($cmsBlockRow: JQuery<HTMLElement>) => { if (!this.blockListPage.rowIsAssignedToStore({ row: $cmsBlockRow, storeName: params.storeName })) { - this.blockListPage.clickEditAction($cmsBlockRow); + this.blockListPage.clickEditActionOfBlock(params.cmsBlockName); this.blockUpdatePage.assignAllAvailableStore(); this.blockUpdatePage.save(); diff --git a/cypress/support/scenarios/backoffice/index.ts b/cypress/support/scenarios/backoffice/index.ts index 1596dd1e4..5b31011f9 100644 --- a/cypress/support/scenarios/backoffice/index.ts +++ b/cypress/support/scenarios/backoffice/index.ts @@ -24,6 +24,7 @@ export * from './customer-mfa-remove-scenario'; export * from './deactivate-product-scenario'; export * from './activate-product-scenario'; export * from './approve-product-offer-scenario'; +export * from './keep-product-offer-stores-scenario'; export * from './merchant-registration-approval-scenario'; export * from './merchant-registration-rejection-scenario'; export * from './merchant-activation-scenario'; diff --git a/cypress/support/scenarios/backoffice/keep-product-offer-stores-scenario.ts b/cypress/support/scenarios/backoffice/keep-product-offer-stores-scenario.ts new file mode 100644 index 000000000..1960b5cfa --- /dev/null +++ b/cypress/support/scenarios/backoffice/keep-product-offer-stores-scenario.ts @@ -0,0 +1,43 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { ProductOfferEditPage } from '@pages/backoffice'; +import { OffersPage } from '@pages/mp'; +import { MerchantUserLoginScenario } from '../mp/merchant-user-login-scenario'; +import { UserLoginScenario } from './user-login-scenario'; + +@injectable() +@autoWired +export class KeepProductOfferStoresScenario { + @inject(ProductOfferEditPage) private productOfferEditPage: ProductOfferEditPage; + @inject(OffersPage) private offersPage: OffersPage; + @inject(UserLoginScenario) private userLoginScenario: UserLoginScenario; + @inject(MerchantUserLoginScenario) private merchantUserLoginScenario: MerchantUserLoginScenario; + + execute = (params: ExecuteParams): void => { + // The B2C marketplace Back Office only views offers; their stores are edited by the merchant in the Merchant Portal. + if (Cypress.env('repositoryId') === 'b2c-mp') { + this.merchantUserLoginScenario.execute({ username: params.merchantUsername ?? '', password: params.password }); + this.offersPage.openOffer({ query: params.productOfferReference }); + this.offersPage.removeStores(params.storeNamesToRemove); + this.offersPage.saveOffer(); + } else { + this.userLoginScenario.execute({ username: params.backofficeUsername, password: params.password }); + this.productOfferEditPage.visitOffer(params.idProductOffer); + this.productOfferEditPage.keepOnlyStores(params.storeNamesToKeep); + this.productOfferEditPage.save(); + } + + cy.runQueueWorker(); + }; +} + +interface ExecuteParams { + backofficeUsername: string; + // Only the Merchant Portal path signs in as the merchant, so only the shops taking it seed one. + merchantUsername?: string; + password: string; + idProductOffer: number; + productOfferReference: string; + storeNamesToKeep: string[]; + storeNamesToRemove: string[]; +} diff --git a/cypress/support/scenarios/mp/merchant-user-account-scenario.ts b/cypress/support/scenarios/mp/merchant-user-account-scenario.ts index 6d19c8c64..384d62f0b 100644 --- a/cypress/support/scenarios/mp/merchant-user-account-scenario.ts +++ b/cypress/support/scenarios/mp/merchant-user-account-scenario.ts @@ -8,7 +8,7 @@ export class MerchantUserAccountScenario { @inject(AccountPage) private accountPage: AccountPage; executeChangePassword = (defaultPassword: string, newPassword: string): void => { - this.accountPage.visit(); + this.accountPage.visitAccount(); this.accountPage.openChangePasswordForm(); this.accountPage.changePassword(defaultPassword, newPassword); this.accountPage.getPasswordChangedMessage().should('be.visible'); diff --git a/cypress/support/scenarios/yves/checkout-scenario.ts b/cypress/support/scenarios/yves/checkout-scenario.ts index 8e1c3a671..6a1d097a6 100644 --- a/cypress/support/scenarios/yves/checkout-scenario.ts +++ b/cypress/support/scenarios/yves/checkout-scenario.ts @@ -28,7 +28,11 @@ export class CheckoutScenario { if (params?.isGuest) { this.checkoutCustomerPage.checkoutAsGuest(); } - this.fillShippingAddress(params); + // A checkout resumed after the cart changed re-enters at the first invalidated step, and the + // address it already holds is no longer asked for. + if (!params?.shouldSkipAddressStep) { + this.fillShippingAddress(params); + } if (!params?.shouldSkipShipmentStep) { this.checkoutShipmentPage.setStandardShippingMethod(); @@ -50,6 +54,7 @@ export class CheckoutScenario { private fillShippingAddress = (params?: ExecuteParams): void => { const fillShippingAddressParams = { idCustomerAddress: params?.idCustomerAddress, + hasOwnAddressPerItem: params?.hasOwnAddressPerItem, shipmentType: params?.shipmentType, skipServicePointAddressOverride: params?.skipServicePointAddressOverride, servicePointSelection: params?.servicePointSelection, @@ -80,9 +85,11 @@ export class CheckoutScenario { interface ExecuteParams { isGuest?: boolean; isMultiShipment?: boolean; + hasOwnAddressPerItem?: boolean; idCustomerAddress?: number; shouldTriggerOmsInCli?: boolean; paymentMethod?: string; + shouldSkipAddressStep?: boolean; shouldSkipShipmentStep?: boolean; shouldSkipPlaceOrder?: boolean; shipmentType?: string; diff --git a/cypress/support/scenarios/yves/configure-bundle-scenario.ts b/cypress/support/scenarios/yves/configure-bundle-scenario.ts new file mode 100644 index 000000000..34cc55dcd --- /dev/null +++ b/cypress/support/scenarios/yves/configure-bundle-scenario.ts @@ -0,0 +1,30 @@ +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { BundleConfiguratorPage } from '@pages/yves'; + +@injectable() +@autoWired +export class ConfigureBundleScenario { + @inject(BundleConfiguratorPage) private bundleConfiguratorPage: BundleConfiguratorPage; + + execute = (params: ExecuteParams): void => { + this.bundleConfiguratorPage.visit(); + this.bundleConfiguratorPage.chooseTemplate(params.templateName); + + params.slotSelections.forEach((slotSelection) => this.bundleConfiguratorPage.selectSlotProduct(slotSelection)); + + this.bundleConfiguratorPage.goToSummary(); + this.bundleConfiguratorPage.addConfiguredBundleToCart(); + }; +} + +interface ExecuteParams { + templateName: string; + slotSelections: SlotSelection[]; +} + +interface SlotSelection { + slotName: string; + productIdentifier?: string; + productPosition?: number; +} diff --git a/cypress/support/scenarios/yves/customer-login-scenario.ts b/cypress/support/scenarios/yves/customer-login-scenario.ts index 4d1048e95..bfe7d7e33 100644 --- a/cypress/support/scenarios/yves/customer-login-scenario.ts +++ b/cypress/support/scenarios/yves/customer-login-scenario.ts @@ -8,6 +8,14 @@ export class CustomerLoginScenario { @inject(LoginPage) private loginPage: LoginPage; execute = (params: ExecuteParams): void => { + if (params.alternativeEmails?.length) { + this.findRegisteredEmail([params.email, ...params.alternativeEmails], params.password).then((email: string) => { + this.execute({ ...params, email, alternativeEmails: undefined }); + }); + + return; + } + if (params.withoutSession) { if (params.resetSession) { cy.clearCookies(); @@ -29,6 +37,28 @@ export class CustomerLoginScenario { cy.location('pathname').should('not.include', '/login'); }); }; + + // Shops sharing one repository id can seed the same demo customer under different e-mail domains, + // so the first address the storefront API accepts with the password is the one that is registered. + private findRegisteredEmail = (emails: string[], password: string): Cypress.Chainable<string> => { + const [email, ...remainingEmails] = emails; + + return cy + .request({ + method: 'POST', + url: Cypress.env().glueUrl + '/access-tokens', + headers: { 'Content-Type': 'application/json' }, + body: { data: { type: 'access-tokens', attributes: { username: email, password } } }, + failOnStatusCode: false, + }) + .then((response): Cypress.Chainable<string> => { + if (response.isOkStatusCode || !remainingEmails.length) { + return cy.wrap(email); + } + + return this.findRegisteredEmail(remainingEmails, password); + }); + }; } interface ExecuteParams { @@ -36,4 +66,5 @@ interface ExecuteParams { password: string; withoutSession?: boolean; resetSession?: boolean; + alternativeEmails?: string[]; } diff --git a/cypress/support/scenarios/yves/impersonate-customer-scenario.ts b/cypress/support/scenarios/yves/impersonate-customer-scenario.ts new file mode 100644 index 000000000..f660c003b --- /dev/null +++ b/cypress/support/scenarios/yves/impersonate-customer-scenario.ts @@ -0,0 +1,32 @@ +import { AgentControlBarPage } from '@pages/yves'; +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { AgentLoginScenario } from './agent-login-scenario'; + +@injectable() +@autoWired +export class ImpersonateCustomerScenario { + @inject(AgentLoginScenario) private agentLoginScenario: AgentLoginScenario; + @inject(AgentControlBarPage) private agentControlBarPage: AgentControlBarPage; + + /** + * Signs an agent in and switches them into a customer's session. This is how a customer created + * through a form can be driven at all: nothing knows their password, and the agent never needs it. + */ + execute = (params: ExecuteParams): void => { + this.agentLoginScenario.execute({ + username: params.agentUsername, + password: params.agentPassword, + withoutSession: true, + }); + + this.agentControlBarPage.visit(); + this.agentControlBarPage.impersonate(params.customerEmail); + }; +} + +interface ExecuteParams { + agentUsername: string; + agentPassword: string; + customerEmail: string; +} diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index 0cebbd69f..39864542f 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -1,6 +1,7 @@ export * from './agent-login-scenario'; export * from './checkout-scenario'; export * from './checkout-mp-scenario'; +export * from './place-order-scenario'; export * from './customer-login-scenario'; export * from './customer-logout-scenario'; export * from './locale-switching-scenario'; @@ -10,3 +11,7 @@ export * from './agent-logout-scenario'; export * from './agent-mfa-login-scenario'; export * from './customer-mfa-activation-scenario'; export * from './product-add-to-cart-scenario'; +export * from './impersonate-customer-scenario'; +export * from './open-product-detail-page-on-store-scenario'; +export * from './wait-for-storefront-url-scenario'; +export * from './configure-bundle-scenario'; diff --git a/cypress/support/scenarios/yves/open-product-detail-page-on-store-scenario.ts b/cypress/support/scenarios/yves/open-product-detail-page-on-store-scenario.ts new file mode 100644 index 000000000..cb042aa26 --- /dev/null +++ b/cypress/support/scenarios/yves/open-product-detail-page-on-store-scenario.ts @@ -0,0 +1,30 @@ +import { autoWired } from '@utils'; +import { CatalogPage, ProductPage } from '@pages/yves'; +import { inject, injectable } from 'inversify'; +import { SelectStoreScenario } from './select-store-scenario'; + +// The suggestion dropdown ranks by completion, so a sku query can put a sibling product first and a +// spec would then read prices, offers or a 404 off the wrong detail page. Going through the result +// blocks and matching on the product name keeps it exact, and the closing check makes a wrong landing +// fail here rather than as a mystery timeout further down. +@injectable() +@autoWired +export class OpenProductDetailPageOnStoreScenario { + @inject(SelectStoreScenario) private selectStoreScenario: SelectStoreScenario; + @inject(CatalogPage) private catalogPage: CatalogPage; + @inject(ProductPage) private productPage: ProductPage; + + execute = (params: ExecuteParams): void => { + this.selectStoreScenario.execute(params.storeName); + this.catalogPage.searchForProducts({ query: params.abstractSku }); + this.catalogPage.openProductDetailPageFromResults({ productName: params.productName }); + this.productPage.getProductConfigurator().should('contain', params.sku); + }; +} + +interface ExecuteParams { + storeName: string; + abstractSku: string; + sku: string; + productName: string; +} diff --git a/cypress/support/scenarios/yves/place-order-scenario.ts b/cypress/support/scenarios/yves/place-order-scenario.ts new file mode 100644 index 000000000..e060597f0 --- /dev/null +++ b/cypress/support/scenarios/yves/place-order-scenario.ts @@ -0,0 +1,34 @@ +import { CustomerOverviewPage, OrderDetailsPage } from '@pages/yves'; +import { autoWired } from '@utils'; +import { inject, injectable } from 'inversify'; +import { CheckoutScenario } from './checkout-scenario'; + +// The storefront order details page is addressed by the order's id, which is also what the back +// office order detail page takes. +const ORDER_ID_QUERY_PARAMETER = 'id'; + +@injectable() +@autoWired +export class PlaceOrderScenario { + @inject(CheckoutScenario) private checkoutScenario: CheckoutScenario; + @inject(CustomerOverviewPage) private customerOverviewPage: CustomerOverviewPage; + @inject(OrderDetailsPage) private orderDetailsPage: OrderDetailsPage; + + /** + * Checks the signed-in customer's cart out and yields the id of the order it placed, so the back + * office can open exactly that order. Searching the sales table instead races the shards that place + * orders on the same application at the same time. + */ + execute = (params?: ExecuteParams): Cypress.Chainable<number> => { + this.checkoutScenario.execute(params); + this.customerOverviewPage.viewLastPlacedOrder(); + // Reading the url only once the details page has rendered keeps it from yielding the overview's. + this.orderDetailsPage.getOrderReferenceBlock(); + + return cy + .location('search') + .then((search: string): number => Number(new URLSearchParams(search).get(ORDER_ID_QUERY_PARAMETER))); + }; +} + +type ExecuteParams = Parameters<CheckoutScenario['execute']>[0]; diff --git a/cypress/support/scenarios/yves/product-add-to-cart-scenario.ts b/cypress/support/scenarios/yves/product-add-to-cart-scenario.ts index 23d7a2ad5..dd3a17522 100644 --- a/cypress/support/scenarios/yves/product-add-to-cart-scenario.ts +++ b/cypress/support/scenarios/yves/product-add-to-cart-scenario.ts @@ -6,7 +6,8 @@ import { inject, injectable } from 'inversify'; // search and added from its PDP; the b2b-style ones quick-add by SKU straight from the cart page. const CATALOG_SEARCH_REPOSITORY_IDS = ['b2c', 'b2c-mp']; -const ADD_TO_CART_BUTTON = '[data-qa="add-to-cart-button"]'; +// Scoped to the product configurator: the B2C mini-cart labels its remove buttons add-to-cart-button too. +const ADD_TO_CART_BUTTON = '[data-qa="component product-configurator"] [data-qa="add-to-cart-button"]'; const PUBLISH_RELOAD_ATTEMPTS = 20; diff --git a/cypress/support/scenarios/yves/wait-for-storefront-url-scenario.ts b/cypress/support/scenarios/yves/wait-for-storefront-url-scenario.ts new file mode 100644 index 000000000..6a7b87760 --- /dev/null +++ b/cypress/support/scenarios/yves/wait-for-storefront-url-scenario.ts @@ -0,0 +1,42 @@ +import { autoWired } from '@utils'; +import { injectable } from 'inversify'; + +const HTTP_STATUS_OK = 200; +const HTTP_STATUS_NOT_FOUND = 404; + +// A store that no longer carries a page answers with a redirect to its own error page instead of a +// bare 404, so "not found" is recognised by that target as well. +const NOT_FOUND_PAGE_PATH = 'error-page/404'; + +// Publish and synchronize is asynchronous; every attempt drains the queue again before re-reading the +// storefront. +const PUBLISH_AND_SYNC_ATTEMPTS = 10; + +@injectable() +@autoWired +export class WaitForStorefrontUrlScenario { + execute = (params: ExecuteParams, attemptsLeft = PUBLISH_AND_SYNC_ATTEMPTS): void => { + cy.request({ url: params.url, failOnStatusCode: false, followRedirect: false }).then((response) => { + const isServed = response.status === HTTP_STATUS_OK; + const isNotFound = + response.status === HTTP_STATUS_NOT_FOUND || String(response.redirectedToUrl).includes(NOT_FOUND_PAGE_PATH); + const isExpected = params.shouldBeServed ? isServed : isNotFound; + + if (isExpected || attemptsLeft === 0) { + expect(isExpected, `store url ${params.url} ${params.shouldBeServed ? 'is served' : 'is not found'}`).to.equal( + true + ); + + return; + } + + cy.runQueueWorker(); + this.execute(params, attemptsLeft - 1); + }); + }; +} + +interface ExecuteParams { + url: string; + shouldBeServed: boolean; +} diff --git a/cypress/support/types/backoffice/acl-navigation-access.ts b/cypress/support/types/backoffice/acl-navigation-access.ts index 336569188..2c35d8d66 100644 --- a/cypress/support/types/backoffice/acl-navigation-access.ts +++ b/cypress/support/types/backoffice/acl-navigation-access.ts @@ -3,4 +3,6 @@ import { User } from './shared'; export interface AclNavigationAccessDynamicFixtures { restrictedUser: User; combinedUser: User; + deniedActionUser: User; + blockedUser: User; } diff --git a/cypress/support/types/backoffice/company-structure-creation.ts b/cypress/support/types/backoffice/company-structure-creation.ts new file mode 100644 index 000000000..78919dec5 --- /dev/null +++ b/cypress/support/types/backoffice/company-structure-creation.ts @@ -0,0 +1,13 @@ +import { User } from './shared'; + +export interface CompanyStructureCreationStaticFixtures { + defaultPassword: string; + companyUserRolePermissionNames: string[]; + companyUserPagePath: string; + companyRolePagePath: string; +} + +export interface CompanyStructureCreationDynamicFixtures { + rootUser: User; + agentUser: User; +} diff --git a/cypress/support/types/backoffice/data-exchange.ts b/cypress/support/types/backoffice/data-exchange.ts new file mode 100644 index 000000000..3868537b4 --- /dev/null +++ b/cypress/support/types/backoffice/data-exchange.ts @@ -0,0 +1,17 @@ +import { User } from './shared'; + +export interface ApiSpecificationDownloadStaticFixtures { + defaultPassword: string; +} + +export interface ApiSpecificationDownloadDynamicFixtures { + rootUser: User; +} + +export interface DynamicEntityConfigurationStaticFixtures { + defaultPassword: string; +} + +export interface DynamicEntityConfigurationDynamicFixtures { + rootUser: User; +} diff --git a/cypress/support/types/backoffice/dynamic-store-creation.ts b/cypress/support/types/backoffice/dynamic-store-creation.ts new file mode 100644 index 000000000..51225d46b --- /dev/null +++ b/cypress/support/types/backoffice/dynamic-store-creation.ts @@ -0,0 +1,14 @@ +import { ProductConcrete, Store, User } from './shared'; + +export interface DynamicStoreCreationDynamicFixtures { + rootUser: User; + product: ProductConcrete; +} + +export interface DynamicStoreCreationStaticFixtures { + defaultPassword: string; + store: Store; + productPrice: string; + cmsPageName: string; + registrationCmsBlockNames: string[]; +} diff --git a/cypress/support/types/backoffice/glossary-management.ts b/cypress/support/types/backoffice/glossary-management.ts new file mode 100644 index 000000000..6bfc36caa --- /dev/null +++ b/cypress/support/types/backoffice/glossary-management.ts @@ -0,0 +1,12 @@ +import { User } from './shared'; + +export interface GlossaryManagementStaticFixtures { + defaultPassword: string; + glossaryKeyPrefix: string; + translation: string; + updatedTranslation: string; +} + +export interface GlossaryManagementDynamicFixtures { + rootUser: User; +} diff --git a/cypress/support/types/backoffice/index.ts b/cypress/support/types/backoffice/index.ts index 5d7f9a649..f17893166 100644 --- a/cypress/support/types/backoffice/index.ts +++ b/cypress/support/types/backoffice/index.ts @@ -4,6 +4,7 @@ export * from './category-re-sort'; export * from './tax'; export * from './product-search'; export * from './product-relation'; +export * from './product-set-management'; export * from './cms-block'; export * from './cms-page-management'; export * from './discount'; @@ -24,6 +25,7 @@ export * from './ssp-model-management'; export * from './ssp-service-management'; export * from './product-offer'; export * from './navigation-menu-filter'; +export * from './navigation-smoke'; export * from './navigation-tree'; export * from './product-attribute-visibility'; export * from './restore-session-after-login-timeout'; @@ -35,3 +37,10 @@ export * from './refund'; export * from './workflow-management'; export * from './workflow-instance-lifecycle'; export * from './order-experience-management'; +export * from './glossary-management'; +export * from './warehouse-picking-oms'; +export * from './company-structure-creation'; +export * from './data-exchange'; +export * from './product-lifecycle-management'; +export * from './dynamic-store-creation'; +export * from './merchant-management'; diff --git a/cypress/support/types/backoffice/merchant-management.ts b/cypress/support/types/backoffice/merchant-management.ts new file mode 100644 index 000000000..00d13ed87 --- /dev/null +++ b/cypress/support/types/backoffice/merchant-management.ts @@ -0,0 +1,60 @@ +import { Merchant, ProductConcrete, ProductOffer, Url, User } from '../mp/shared'; + +export interface MerchantDeactivationDynamicFixtures { + rootUser: User; + merchantUser: User; + merchant: Merchant; + merchantUrlEN: Url; + merchantProduct: ProductConcrete; +} + +export interface MerchantDeactivationStaticFixtures { + defaultPassword: string; +} + +export interface MerchantCrudDynamicFixtures { + rootUser: User; + merchantWaitingForApproval: Merchant; + renamedMerchant: Merchant; + renamedMerchantUrlEN: Url; + unassignedMerchant: Merchant; + unassignedMerchantUrlEN: Url; +} + +export interface MerchantCrudStaticFixtures { + defaultPassword: string; +} + +export interface OfferApprovalDynamicFixtures { + rootUser: User; + merchant: Merchant; + merchantProduct: ProductConcrete; + productOffer: ProductOffer; +} + +export interface OfferApprovalStaticFixtures { + defaultPassword: string; +} + +export interface OfferViewAndFilterDynamicFixtures { + rootUser: User; + merchant1: Merchant; + merchant2: Merchant; + merchantProduct1: ProductConcrete; + merchantProduct2: ProductConcrete; + productOffer1: ProductOffer; + productOffer2: ProductOffer; +} + +export interface OfferViewAndFilterStaticFixtures { + defaultPassword: string; +} + +export interface MerchantUserManagementDynamicFixtures { + rootUser: User; + merchant: Merchant; +} + +export interface MerchantUserManagementStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/backoffice/navigation-smoke.ts b/cypress/support/types/backoffice/navigation-smoke.ts new file mode 100644 index 000000000..b330d2bc8 --- /dev/null +++ b/cypress/support/types/backoffice/navigation-smoke.ts @@ -0,0 +1,10 @@ +import { User } from './shared'; + +export interface NavigationSmokeStaticFixtures { + defaultPassword: string; + accessDeniedUrlPart: string; +} + +export interface NavigationSmokeDynamicFixtures { + rootUser: User; +} diff --git a/cypress/support/types/backoffice/order-management.ts b/cypress/support/types/backoffice/order-management.ts index 657d89f01..5442d8164 100644 --- a/cypress/support/types/backoffice/order-management.ts +++ b/cypress/support/types/backoffice/order-management.ts @@ -47,3 +47,57 @@ export interface OmsReservationFlowDynamicFixtures { export interface OmsReservationFlowStaticFixtures { defaultPassword: string; } + +export interface OrderRefundDynamicFixtures { + rootUser: User; + customer: Customer; + address: Address; + firstRefundedProduct: Product; + secondRefundedProduct: Product; + thirdRefundedProduct: Product; +} + +export interface OrderRefundStaticFixtures { + defaultPassword: string; +} + +export interface ShipmentManagementDynamicFixtures { + rootUser: User; + customer: Customer; + address: Address; + keptProduct: Product; + movedProduct: Product; + reassignedProduct: Product; +} + +export interface ShipmentManagementStaticFixtures { + defaultPassword: string; + newShipmentAddress: ShipmentAddressFixture; + editedShipmentAddress: ShipmentAddressFixture; +} + +export interface ShipmentAddressFixture { + salutation: string; + firstName: string; + lastName: string; + email: string; + country: string; + address1: string; + address2: string; + city: string; + zipCode: string; +} + +export interface ConfigurableProductOmsDynamicFixtures { + rootUser: User; + customer: Customer; + address: Address; + product: Product; +} + +export interface ConfigurableProductOmsStaticFixtures { + defaultPassword: string; + configurationNotCompleteStatus: string; + configurationCompleteStatus: string; + orderShippingEvents: Array<{ state: string; shouldTriggerOmsInCli?: boolean }>; +} diff --git a/cypress/support/types/backoffice/product-lifecycle-management.ts b/cypress/support/types/backoffice/product-lifecycle-management.ts new file mode 100644 index 000000000..2dfd21190 --- /dev/null +++ b/cypress/support/types/backoffice/product-lifecycle-management.ts @@ -0,0 +1,10 @@ +import { Customer, User } from '../yves/shared'; + +export interface ProductLifecycleManagementStaticFixtures { + defaultPassword: string; +} + +export interface ProductLifecycleManagementDynamicFixtures { + rootUser: User; + customer: Customer; +} diff --git a/cypress/support/types/backoffice/product-set-management.ts b/cypress/support/types/backoffice/product-set-management.ts new file mode 100644 index 000000000..ef129c746 --- /dev/null +++ b/cypress/support/types/backoffice/product-set-management.ts @@ -0,0 +1,13 @@ +import { Customer, ProductConcrete, User } from './shared'; + +export interface ProductSetManagementDynamicFixtures { + rootUser: User; + customer: Customer; + firstProduct: ProductConcrete; + secondProduct: ProductConcrete; + thirdProduct: ProductConcrete; +} + +export interface ProductSetManagementStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/backoffice/shared/index.ts b/cypress/support/types/backoffice/shared/index.ts index 936d71844..abeee01c7 100644 --- a/cypress/support/types/backoffice/shared/index.ts +++ b/cypress/support/types/backoffice/shared/index.ts @@ -3,6 +3,7 @@ export * from './address'; export * from './customer'; export * from './product'; export * from './product-concrete'; +export * from './product-localized-attributes'; export * from './product-offer'; export * from './quote'; export * from './user'; diff --git a/cypress/support/types/backoffice/shared/product-concrete.ts b/cypress/support/types/backoffice/shared/product-concrete.ts index be4c4e81d..bfb42f4c1 100644 --- a/cypress/support/types/backoffice/shared/product-concrete.ts +++ b/cypress/support/types/backoffice/shared/product-concrete.ts @@ -1,6 +1,9 @@ +import { ProductLocalizedAttributes } from './product-localized-attributes'; + export interface ProductConcrete { id_product_concrete: number; sku: string; abstract_sku: string; name: string; + localized_attributes: ProductLocalizedAttributes[]; } diff --git a/cypress/support/types/backoffice/shared/product-localized-attributes.ts b/cypress/support/types/backoffice/shared/product-localized-attributes.ts new file mode 100644 index 000000000..e54e8e88d --- /dev/null +++ b/cypress/support/types/backoffice/shared/product-localized-attributes.ts @@ -0,0 +1,4 @@ +export interface ProductLocalizedAttributes { + name: string; + description: string; +} diff --git a/cypress/support/types/backoffice/warehouse-picking-oms.ts b/cypress/support/types/backoffice/warehouse-picking-oms.ts new file mode 100644 index 000000000..dde073b36 --- /dev/null +++ b/cypress/support/types/backoffice/warehouse-picking-oms.ts @@ -0,0 +1,13 @@ +import { Customer, Product, User } from './shared'; + +export interface WarehousePickingOmsDynamicFixtures { + rootUser: User; + warehouseUser: User; + customer: Customer; + product: Product; + salesOrder: { id_sales_order: number; order_reference: string }; +} + +export interface WarehousePickingOmsStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/mp/index.ts b/cypress/support/types/mp/index.ts index b36ededca..4f38d65c7 100644 --- a/cypress/support/types/mp/index.ts +++ b/cypress/support/types/mp/index.ts @@ -7,3 +7,5 @@ export * from './marketplace-order-management'; export * from './multi-factor-authentication'; export * from './data-import'; export * from './restore-session-after-login-timeout'; +export * from './merchant-portal'; +export * from './product-offer'; diff --git a/cypress/support/types/mp/marketplace-order-management.ts b/cypress/support/types/mp/marketplace-order-management.ts index 403218234..0f30c3042 100644 --- a/cypress/support/types/mp/marketplace-order-management.ts +++ b/cypress/support/types/mp/marketplace-order-management.ts @@ -27,3 +27,23 @@ export interface OrderCreationDmsStaticFixtures { store: Store; paymentMethods: PaymentMethod[]; } + +export interface OrderFulfilmentDynamicFixtures { + rootUser: User; + merchant: Merchant; + merchantUser: User; + customer: Customer; + address: Address; + merchantProduct: ProductConcrete; + merchantProduct2: ProductConcrete; +} + +export interface OrderFulfilmentStaticFixtures { + defaultPassword: string; + orderItemStates: OrderItemStates; +} + +interface OrderItemStates { + shipped: string; + delivered: string; +} diff --git a/cypress/support/types/mp/marketplace-product-concretes.ts b/cypress/support/types/mp/marketplace-product-concretes.ts index f7a610867..c5bdbd80b 100644 --- a/cypress/support/types/mp/marketplace-product-concretes.ts +++ b/cypress/support/types/mp/marketplace-product-concretes.ts @@ -1,13 +1,42 @@ -import { Merchant, ProductConcrete, User } from './shared'; +import { Customer, Merchant, ProductConcrete, User } from './shared'; export interface ProductConcreteManagementDynamicFixtures { + rootUser: User; merchant: Merchant; merchantUser: User; + approvalMerchant: Merchant; + customer?: Customer; concreteProduct1: ProductConcrete; concreteProduct2: ProductConcrete; + pendingProduct: ProductConcrete; } export interface ProductConcreteManagementStaticFixtures { defaultPassword: string; + createdProduct: CreatedProduct; + pendingProductPrice: string; +} + +interface CreatedProduct { + attributeName: string; + attributeValues: string[]; +} + +export interface MerchantProductManagementDynamicFixtures { + merchant: Merchant; + merchantUser: User; + variantProduct: ProductConcrete; +} + +export interface MerchantProductManagementStaticFixtures { + defaultPassword: string; + variantAttributeKey: string; + addedConcrete: AddedConcrete; +} + +interface AddedConcrete { + attributeValue: string; + stockQuantity: number; + searchableLocales: string[]; } diff --git a/cypress/support/types/mp/merchant-portal.ts b/cypress/support/types/mp/merchant-portal.ts new file mode 100644 index 000000000..42af04b1b --- /dev/null +++ b/cypress/support/types/mp/merchant-portal.ts @@ -0,0 +1,58 @@ +import { Company, CompanyBusinessUnit, Customer, Merchant, ProductConcrete, Url, User } from './shared'; + +export interface MerchantProfileUpdateDynamicFixtures { + merchantUser: User; + merchant: Merchant; + merchantUrlEN: Url; +} + +export interface MerchantProfileUpdateStaticFixtures { + defaultPassword: string; +} + +export interface ProductVolumePricesDynamicFixtures { + customer: Customer; + merchantUser: User; + merchant: Merchant; + merchantProduct: ProductConcrete; + editableProduct: ProductConcrete; +} + +export interface ProductVolumePricesStaticFixtures { + defaultPassword: string; + unitPrice: string; + volumeTier: VolumeTier; +} + +interface VolumeTier { + // The quantity from which the tier price applies, and a quantity above it that the storefront + // is driven to. + threshold: number; + quantity: number; + price: string; +} + +export interface CustomerSpecificPricesDynamicFixtures { + rootUser: User; + merchantUser: User; + merchant: Merchant; + company: Company; + businessUnit: CompanyBusinessUnit; + companyCustomer: Customer; + customer: Customer; + merchantProduct: ProductConcrete; +} + +export interface CustomerSpecificPricesStaticFixtures { + defaultPassword: string; + storeName: string; + currency: string; + defaultPrice: string; + customerPrice: CustomerPrice; +} + +interface CustomerPrice { + netAmount: number; + grossAmount: number; + displayed: string; +} diff --git a/cypress/support/types/mp/product-offer.ts b/cypress/support/types/mp/product-offer.ts new file mode 100644 index 000000000..cef44b00a --- /dev/null +++ b/cypress/support/types/mp/product-offer.ts @@ -0,0 +1,53 @@ +import { Customer, Merchant, ProductConcrete, ProductOffer, User } from './shared'; + +interface ProductOfferPrice { + id_price_product_offer: number; +} + +export interface OfferVolumePricesDynamicFixtures { + customer: Customer; + merchantUser: User; + merchant: Merchant; + merchantProduct: ProductConcrete; + productOffer: ProductOffer; + productOfferPrice: ProductOfferPrice; + editableProductOffer: ProductOffer; +} + +export interface OfferVolumePricesStaticFixtures { + defaultPassword: string; + offerPrice: string; + volumeTier: VolumeTier; +} + +interface VolumeTier { + // The quantity from which the tier price applies, and a quantity above it that the storefront + // is driven to. + threshold: number; + quantity: number; + price: string; +} + +export interface OfferCreationDynamicFixtures { + customer: Customer; + productMerchant: Merchant; + offerMerchant: Merchant; + offerMerchantUser: User; + merchantProduct: ProductConcrete; + offeredProduct: ProductConcrete; + productOffer: ProductOffer; +} + +export interface OfferCreationStaticFixtures { + defaultPassword: string; + storeName: string; + currency: string; + offer: OfferUnderTest; +} + +interface OfferUnderTest { + netAmount: number; + grossAmount: number; + displayedPrice: string; + stockQuantity: number; +} diff --git a/cypress/support/types/mp/shared/company.ts b/cypress/support/types/mp/shared/company.ts index 5bb94f87d..27e0b572b 100644 --- a/cypress/support/types/mp/shared/company.ts +++ b/cypress/support/types/mp/shared/company.ts @@ -1,4 +1,5 @@ export interface Company { + id_company: number; key: string; name: string; } diff --git a/cypress/support/types/mp/shared/merchant.ts b/cypress/support/types/mp/shared/merchant.ts index 357f302cd..5d1bc0dc9 100644 --- a/cypress/support/types/mp/shared/merchant.ts +++ b/cypress/support/types/mp/shared/merchant.ts @@ -1,6 +1,7 @@ import { Stock } from './stock'; export interface Merchant { + id_merchant: number; merchant_reference: string; name: string; stocks: Stock[]; diff --git a/cypress/support/types/mp/shared/product-concrete.ts b/cypress/support/types/mp/shared/product-concrete.ts index 5f9611b78..2e6ffe989 100644 --- a/cypress/support/types/mp/shared/product-concrete.ts +++ b/cypress/support/types/mp/shared/product-concrete.ts @@ -1,4 +1,6 @@ export interface ProductConcrete { sku: string; abstract_sku: string; + fk_product_abstract: number; + localized_attributes: { name: string }[]; } diff --git a/cypress/support/types/mp/shared/product-offer.ts b/cypress/support/types/mp/shared/product-offer.ts index 4bd9a0250..0ab2cbee3 100644 --- a/cypress/support/types/mp/shared/product-offer.ts +++ b/cypress/support/types/mp/shared/product-offer.ts @@ -1,3 +1,5 @@ export interface ProductOffer { + id_product_offer: number; product_offer_reference: string; + merchant_sku: string; } diff --git a/cypress/support/types/yves/agent-assist.ts b/cypress/support/types/yves/agent-assist.ts new file mode 100644 index 000000000..e0a162352 --- /dev/null +++ b/cypress/support/types/yves/agent-assist.ts @@ -0,0 +1,12 @@ +import { Address, Customer, ProductConcrete, User } from './shared'; + +export interface CustomerImpersonationStaticFixtures { + defaultPassword: string; +} + +export interface CustomerImpersonationDynamicFixtures { + customer: Customer; + address: Address; + agentUser: User; + product: ProductConcrete; +} diff --git a/cypress/support/types/yves/availability-calculation.ts b/cypress/support/types/yves/availability-calculation.ts new file mode 100644 index 000000000..c877ecdb5 --- /dev/null +++ b/cypress/support/types/yves/availability-calculation.ts @@ -0,0 +1,18 @@ +import { Address, Customer, ProductConcrete, User } from './shared'; + +export interface AvailabilityCalculationStaticFixtures { + defaultPassword: string; + initialStock: number; + orderedQuantity: number; +} + +export interface AvailabilityCalculationDynamicFixtures { + rootUser: User; + orderingCustomer: Customer; + + // A second customer whose cart already holds the product, so the reservation is read from a cart + // the order did not consume. + cartCustomer: Customer; + address: Address; + product: ProductConcrete; +} diff --git a/cypress/support/types/yves/back-in-stock-notification.ts b/cypress/support/types/yves/back-in-stock-notification.ts new file mode 100644 index 000000000..01e18f20e --- /dev/null +++ b/cypress/support/types/yves/back-in-stock-notification.ts @@ -0,0 +1,15 @@ +import { Customer, ProductConcrete } from './shared'; + +export interface BackInStockNotificationStaticFixtures { + defaultPassword: string; + + // Storefront wording, so a repository translating it differently overrides it here. + subscribedMessage: string; + unsubscribedMessage: string; +} + +export interface BackInStockNotificationDynamicFixtures { + customer: Customer; + outOfStockProduct: ProductConcrete; + inStockProduct: ProductConcrete; +} diff --git a/cypress/support/types/yves/business-on-behalf.ts b/cypress/support/types/yves/business-on-behalf.ts new file mode 100644 index 000000000..e7860c80f --- /dev/null +++ b/cypress/support/types/yves/business-on-behalf.ts @@ -0,0 +1,14 @@ +import { Company, CompanyBusinessUnit, CompanyUser, Customer } from './shared'; + +export interface BusinessOnBehalfDynamicFixtures { + customer: Customer; + company: Company; + firstBusinessUnit: CompanyBusinessUnit; + secondBusinessUnit: CompanyBusinessUnit; + firstCompanyUser: CompanyUser; + secondCompanyUser: CompanyUser; +} + +export interface BusinessOnBehalfStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/yves/cart.ts b/cypress/support/types/yves/cart.ts index 1d4bf6f3f..c5935db65 100644 --- a/cypress/support/types/yves/cart.ts +++ b/cypress/support/types/yves/cart.ts @@ -1,4 +1,4 @@ -import { Customer, ProductConcrete, Quote, Discount } from './shared'; +import { Address, Customer, Discount, Merchant, ProductConcrete, ProductOffer, Quote } from './shared'; export interface CartItemNoteManagementDynamicFixtures { customer: Customer; @@ -33,3 +33,21 @@ export interface RemoveCartItemStaticFixtures { defaultPassword: string; total1: string; } + +export interface SharedCartDynamicFixtures { + ownerCustomer: Customer; + receiverCustomer: Customer; + receiverAddress: Address; + product: ProductConcrete; + merchant: Merchant; + productOffer: ProductOffer; + colleagueSharedQuote: Quote; + linkSharedQuote: Quote; +} + +export interface SharedCartStaticFixtures { + defaultPassword: string; + soldByText: string; + fullAccessText: string; + cartPreviewTitlePrefix: string; +} diff --git a/cypress/support/types/yves/catalog-filters.ts b/cypress/support/types/yves/catalog-filters.ts new file mode 100644 index 000000000..28ba8c0b7 --- /dev/null +++ b/cypress/support/types/yves/catalog-filters.ts @@ -0,0 +1,33 @@ +import { Customer, Merchant } from './shared'; + +export interface CatalogFiltersStaticFixtures { + defaultPassword: string; + searchTerm: string; + // A colour on the shops that carry colours; the B2B catalogs barely do, so they narrow by material. + attributeFilter: FacetSelection; + + // Substrings of the facet headings the catalog has to offer; the full wording differs per theme. + filterTitles: string[]; + ascendingPriceSortLabel: string; + descendingPriceSortLabel: string; + + // Only in the marketplace shops; the storefront names the merchant facet after its product-document field. + merchantFilterName: string; +} + +export interface CatalogFiltersDynamicFixtures { + customer: Customer; + + // Only in the marketplace shops: two merchants each offering a product of the same name. + localizedAttribute: LocalizedAttribute; + merchant2: Merchant; +} + +interface FacetSelection { + name: string; + value: string; +} + +interface LocalizedAttribute { + name: string; +} diff --git a/cypress/support/types/yves/checkout.ts b/cypress/support/types/yves/checkout.ts index 955a6d788..d212e849c 100644 --- a/cypress/support/types/yves/checkout.ts +++ b/cypress/support/types/yves/checkout.ts @@ -1,4 +1,4 @@ -import { Address, Customer, ProductConcrete, Store, User } from './shared'; +import { Address, Customer, ProductConcrete, Quote, ShipmentMethod, Store, User } from './shared'; export interface BasicCheckoutDynamicFixtures { customer: Customer; @@ -29,3 +29,153 @@ interface PaymentMethod { export interface CheckoutStaticFixtures { defaultPassword: string; } + +export interface SplitDeliveryStaticFixtures { + defaultPassword: string; + expectedShipmentCount: number; +} + +export interface SplitDeliveryDynamicFixtures { + customer: Customer; + rootUser: User; + product1: ProductConcrete; + product2: ProductConcrete; + product3: ProductConcrete; +} + +export interface CheckoutAuthenticationStaticFixtures { + defaultPassword: string; + registrationPassword: string; + salutation: string; +} + +export interface CheckoutAuthenticationDynamicFixtures { + customer: Customer; + address: Address; + product1: ProductConcrete; +} + +export interface CheckoutAddressFixture { + firstName: string; + lastName: string; + address1: string; + address2: string; + zipCode: string; + city: string; + company: string; + phone: string; +} + +export interface BusinessUnitAddressCheckoutStaticFixtures { + defaultPassword: string; + businessUnitAddressStreet: string; +} + +export interface BusinessUnitAddressCheckoutDynamicFixtures { + customer: Customer; + companyUser: CompanyUser; + product1: ProductConcrete; + rootUser: User; +} + +interface CompanyUser { + id_company_user: number; +} + +export interface MultiMerchantOrderStaticFixtures { + defaultPassword: string; + expectedShipmentCount: number; + soldByText: string; +} + +export interface MultiMerchantOrderDynamicFixtures { + customer: Customer; + address: Address; + rootUser: User; + product1: ProductConcrete; + product2: ProductConcrete; + product3: ProductConcrete; + merchant1: Merchant; + merchant2: Merchant; + productOffer1: ProductOffer; + productOffer2: ProductOffer; +} + +interface ProductOffer { + product_offer_reference: string; +} + +interface Merchant { + name: string; + merchant_reference: string; +} + +export interface CartApprovalProcessStaticFixtures { + defaultPassword: string; + waitingStatus: string; + approvedStatus: string; +} + +export interface CartApprovalProcessDynamicFixtures { + buyer: Customer; + approver: Customer; + buyerAddress: Address; + buyerCompanyUser: CompanyUserReference; + approverCompanyUser: CompanyUserReference; + product1: ProductConcrete; + quote: Quote; +} + +interface CompanyUserReference { + id_company_user: number; +} + +export interface QuoteRequestLifecycleStaticFixtures { + defaultPassword: string; + revisedItemPrice: string; + revisedItemPriceFormatted: string; + originalItemPriceFormatted: string; +} + +export interface QuoteRequestLifecycleDynamicFixtures { + customer: Customer; + address: Address; + companyUser: QuoteRequestCompanyUser; + agentUser: User; + product1: ProductConcrete; + quote: Quote; +} + +interface QuoteRequestCompanyUser { + id_company_user: number; +} + +export interface ClickAndCollectStaticFixtures { + defaultPassword: string; + pickupShipmentTypeKey: string; + expectedShipmentCount: number; + billingAddress: CheckoutAddressFixture; +} + +export interface ClickAndCollectDynamicFixtures { + customer: Customer; + address: Address; + rootUser: User; + product1: ProductConcrete; + pickupOffer: ClickAndCollectOffer; + pickupShipmentMethod: ShipmentMethod; + servicePoint: ClickAndCollectServicePoint; + servicePointAddress: ClickAndCollectServicePointAddress; +} + +interface ClickAndCollectOffer { + product_offer_reference: string; +} + +interface ClickAndCollectServicePoint { + name: string; +} + +interface ClickAndCollectServicePointAddress { + address1: string; +} diff --git a/cypress/support/types/yves/cms.ts b/cypress/support/types/yves/cms.ts index 7eb87acb8..9da1430ec 100644 --- a/cypress/support/types/yves/cms.ts +++ b/cypress/support/types/yves/cms.ts @@ -10,3 +10,13 @@ export interface CmsPageSearchDmsStaticFixtures { store: Store; cmsPageName: string; } + +export interface CmsPagePublishDynamicFixtures { + rootUser: User; +} + +export interface CmsPagePublishStaticFixtures { + defaultPassword: string; + defaultLocaleName: string; + cmsPageName: string; +} diff --git a/cypress/support/types/yves/comments.ts b/cypress/support/types/yves/comments.ts index 0c26cda0f..ad14cf540 100644 --- a/cypress/support/types/yves/comments.ts +++ b/cypress/support/types/yves/comments.ts @@ -1,10 +1,12 @@ -import { Customer, ProductConcrete, Quote } from './shared'; +import { Address, Customer, ProductConcrete, Quote, User } from './shared'; export interface CartCommentsDynamicFixtures { customer: Customer; - product: ProductConcrete; + address: Address; + product1: ProductConcrete; quote: Quote; emptyQuote: Quote; + rootUser: User; } export interface CartCommentsStaticFixtures { @@ -13,4 +15,17 @@ export interface CartCommentsStaticFixtures { commentToModify: string; modifiedComment: string; commentsToRemove: string; + commentToKeepThroughCheckout: string; +} + +export interface OrderCommentsDynamicFixtures { + customer: Customer; + address: Address; + product: ProductConcrete; + rootUser: User; +} + +export interface OrderCommentsStaticFixtures { + defaultPassword: string; + commentOnOrder: string; } diff --git a/cypress/support/types/yves/company-structure.ts b/cypress/support/types/yves/company-structure.ts new file mode 100644 index 000000000..b67142704 --- /dev/null +++ b/cypress/support/types/yves/company-structure.ts @@ -0,0 +1,13 @@ +import { Customer, User } from './shared'; + +export interface CompanyStructureCreationStaticFixtures { + defaultPassword: string; + restrictedRoleName: string; + companyUserPagePath: string; + companyRolePagePath: string; +} + +export interface CompanyStructureCreationDynamicFixtures { + adminCustomer: Customer; + agentUser: User; +} diff --git a/cypress/support/types/yves/configurable-bundle-checkout.ts b/cypress/support/types/yves/configurable-bundle-checkout.ts new file mode 100644 index 000000000..c328d3f1d --- /dev/null +++ b/cypress/support/types/yves/configurable-bundle-checkout.ts @@ -0,0 +1,18 @@ +import { Customer } from './shared'; + +export interface ConfigurableBundleCheckoutDynamicFixtures { + customer: Customer; +} + +export interface ConfigurableBundleCheckoutStaticFixtures { + defaultPassword: string; + templateName: string; + firstConfiguration: BundleSlotSelection[]; + secondConfiguration: BundleSlotSelection[]; +} + +export interface BundleSlotSelection { + slotName: string; + productIdentifier?: string; + productPosition?: number; +} diff --git a/cypress/support/types/yves/configurable-product-checkout.ts b/cypress/support/types/yves/configurable-product-checkout.ts new file mode 100644 index 000000000..eb4fc9cb4 --- /dev/null +++ b/cypress/support/types/yves/configurable-product-checkout.ts @@ -0,0 +1,16 @@ +import { Address, Customer, ProductConcrete } from './shared'; + +export interface ConfigurableProductCheckoutStaticFixtures { + defaultPassword: string; + configurationNotCompleteStatus: string; + configurationCompleteStatus: string; + // Marketplace invoice is offered only for a cart of merchant items, which the B2C marketplace does not make of + // a product without a merchant. + paymentMethod: string; +} + +export interface ConfigurableProductCheckoutDynamicFixtures { + customer: Customer; + address: Address; + product: ProductConcrete; +} diff --git a/cypress/support/types/yves/configurable-product-rfq.ts b/cypress/support/types/yves/configurable-product-rfq.ts new file mode 100644 index 000000000..88c3a7575 --- /dev/null +++ b/cypress/support/types/yves/configurable-product-rfq.ts @@ -0,0 +1,19 @@ +import { Address, Customer, ProductConcrete, User } from './shared'; + +export interface ConfigurableProductRfqStaticFixtures { + defaultPassword: string; + configurationNotCompleteStatus: string; + configurationCompleteStatus: string; +} + +export interface ConfigurableProductRfqDynamicFixtures { + customer: Customer; + address: Address; + companyUser: RfqCompanyUser; + agentUser: User; + product: ProductConcrete; +} + +interface RfqCompanyUser { + id_company_user: number; +} diff --git a/cypress/support/types/yves/configurable-product-shopping-list.ts b/cypress/support/types/yves/configurable-product-shopping-list.ts new file mode 100644 index 000000000..06096bd43 --- /dev/null +++ b/cypress/support/types/yves/configurable-product-shopping-list.ts @@ -0,0 +1,14 @@ +import { Customer, ProductConcrete } from './shared'; + +export interface ConfigurableProductShoppingListStaticFixtures { + defaultPassword: string; + configurationNotCompleteStatus: string; + configurationCompleteStatus: string; + unconfiguredCheckoutBlockedMessage: string; + availableStock: number; +} + +export interface ConfigurableProductShoppingListDynamicFixtures { + customer: Customer; + product: ProductConcrete; +} diff --git a/cypress/support/types/yves/customer-specific-prices.ts b/cypress/support/types/yves/customer-specific-prices.ts new file mode 100644 index 000000000..d0c5c2958 --- /dev/null +++ b/cypress/support/types/yves/customer-specific-prices.ts @@ -0,0 +1,42 @@ +import { Customer, ProductConcrete } from './shared'; + +// Where demo data backs the scenario the static fixture names the product and both customers; +// elsewhere the dynamic fixture creates them and the static one carries only the prices it seeds. +export type CustomerSpecificPricesStaticFixtures = PricesStaticFixtures | DemoDataStaticFixtures; + +export interface CustomerSpecificPricesDynamicFixtures { + defaultPriceCustomer: Customer; + merchantPriceCustomer: Customer; + product: ProductConcrete; +} + +export interface CustomerSpecificPricesCustomer { + email: string; + alternativeEmails?: string[]; +} + +export interface CustomerSpecificPricesProduct { + abstractSku: string; + concreteSku: string; + + // The abstract name carries the catalog card; the concrete name carries the cart line, and the + // two differ in the B2B demo data. + name: string; + cartItemName: string; +} + +interface PricesStaticFixtures { + defaultPassword: string; + prices: Prices; +} + +interface DemoDataStaticFixtures extends PricesStaticFixtures { + defaultPriceCustomer: CustomerSpecificPricesCustomer; + merchantPriceCustomer: CustomerSpecificPricesCustomer; + product: CustomerSpecificPricesProduct; +} + +interface Prices { + defaultPrice: string; + merchantPrice: string; +} diff --git a/cypress/support/types/yves/discontinued-alternative-products.ts b/cypress/support/types/yves/discontinued-alternative-products.ts new file mode 100644 index 000000000..c4ff0d2ae --- /dev/null +++ b/cypress/support/types/yves/discontinued-alternative-products.ts @@ -0,0 +1,18 @@ +import { Customer, ProductConcrete, User } from './shared'; + +export interface DiscontinuedAlternativeProductsStaticFixtures { + defaultPassword: string; + + // Glossary wording the wishlist row prints; a repository translating it differently overrides it here. + discontinuedLabel: string; + alternativeLabel: string; +} + +export interface DiscontinuedAlternativeProductsDynamicFixtures { + rootUser: User; + customer: Customer; + discontinuedProduct: ProductConcrete; + substituteProduct: ProductConcrete; + wishlistProduct: ProductConcrete; + wishlistSubstituteProduct: ProductConcrete; +} diff --git a/cypress/support/types/yves/discount.ts b/cypress/support/types/yves/discount.ts new file mode 100644 index 000000000..0f51e7f28 --- /dev/null +++ b/cypress/support/types/yves/discount.ts @@ -0,0 +1,22 @@ +import { Address, Customer, Discount, ProductConcrete } from './shared'; + +export interface DiscountsAndPromotionsStaticFixtures { + defaultPassword: string; + // The B2C marketplace offers its invoice only for merchant items, which the fixture cart does not carry. + paymentMethod: string; +} + +export interface DiscountsAndPromotionsDynamicFixtures { + customer: Customer; + address: Address; + promotionalProduct: ProductConcrete; + voucherDiscount: Discount; + cartRuleDiscount: Discount; + promotionDiscount: Discount; + voucherCode: DiscountVoucherCode; + promotionVoucherCode: DiscountVoucherCode; +} + +export interface DiscountVoucherCode { + code: string; +} diff --git a/cypress/support/types/yves/index.ts b/cypress/support/types/yves/index.ts index 7e85eeace..5b35f1327 100644 --- a/cypress/support/types/yves/index.ts +++ b/cypress/support/types/yves/index.ts @@ -9,10 +9,28 @@ export * from './customer-account-management'; export * from './company-account'; export * from './cms'; export * from './product-comparison'; +export * from './configurable-bundle-checkout'; +export * from './product-sets'; +export * from './product-relations'; export * from './product'; export * from './reorder'; export * from './order-amendment'; export * from './product-attribute-visibility'; +export * from './customer-specific-prices'; +export * from './original-price'; +export * from './discontinued-alternative-products'; +export * from './quick-add-to-cart'; +export * from './volume-prices'; +export * from './measurement-unit-checkout'; +export * from './packaging-unit-checkout'; +export * from './product-bundle-checkout'; +export * from './catalog-filters'; +export * from './back-in-stock-notification'; +export * from './configurable-product-checkout'; +export * from './configurable-product-shopping-list'; +export * from './configurable-product-rfq'; +export * from './product-restrictions'; +export * from './availability-calculation'; export * from './locale'; export * from './catalog'; export * from './ssp-inquiry'; @@ -22,3 +40,13 @@ export * from './ssp-asset-specific-catalog'; export * from './ssp-dashboard-management'; export * from './purchasing-control'; export * from './recurring-orders'; +export * from './agent-assist'; +export * from './company-structure'; +export * from './discount'; +export * from './shopping-list'; +export * from './quick-order'; +export * from './business-on-behalf'; +export * from './order-cancellation'; +export * from './return-management'; +export * from './multistore'; +export * from './product-offer'; diff --git a/cypress/support/types/yves/measurement-unit-checkout.ts b/cypress/support/types/yves/measurement-unit-checkout.ts new file mode 100644 index 000000000..dd92e0d2b --- /dev/null +++ b/cypress/support/types/yves/measurement-unit-checkout.ts @@ -0,0 +1,19 @@ +import { Customer, ProductConcrete } from './shared'; + +export interface MeasurementUnitCheckoutStaticFixtures { + defaultPassword: string; + + // Sales unit whose conversion is a whole base unit, and one whose conversion is not. + wholeSalesUnit: SalesUnitQuantity; + fractionalSalesUnit: SalesUnitQuantity; +} + +interface SalesUnitQuantity { + name: string; + quantity: number; +} + +export interface MeasurementUnitCheckoutDynamicFixtures { + customer: Customer; + product: ProductConcrete; +} diff --git a/cypress/support/types/yves/multistore.ts b/cypress/support/types/yves/multistore.ts new file mode 100644 index 000000000..8f86130b6 --- /dev/null +++ b/cypress/support/types/yves/multistore.ts @@ -0,0 +1,47 @@ +import { Customer, Merchant, ProductConcrete, ProductOffer, User } from './shared'; + +export interface MultistoreCmsPageDynamicFixtures { + rootUser: User; +} + +export interface MultistoreCmsPageStaticFixtures { + defaultPassword: string; + cmsPageName: string; + storeName: string; + localeName: string; +} + +export interface MultistoreProductDynamicFixtures { + rootUser: User; + product: ProductConcrete; + productToUnassign: ProductConcrete; + customer: Customer; +} + +export interface MultistoreProductStaticFixtures { + defaultPassword: string; + primaryStoreName: string; + secondaryStoreName: string; + primaryStorePrice: string; + secondaryStorePrice: string; + unassignedStoreProductPrice: string; + currencySymbol: string; +} + +export interface MultistoreProductOfferDynamicFixtures { + rootUser: User; + product: ProductConcrete; + merchant: Merchant; + merchantToUnassign: Merchant; + merchantToUnassignUser?: User; + productOffer: ProductOffer; + productOfferToUnassign: ProductOffer; +} + +export interface MultistoreProductOfferStaticFixtures { + defaultPassword: string; + primaryStoreName: string; + secondaryStoreName: string; + primaryStorePrice: string; + secondaryStorePrice: string; +} diff --git a/cypress/support/types/yves/order-cancellation.ts b/cypress/support/types/yves/order-cancellation.ts new file mode 100644 index 000000000..2726c408a --- /dev/null +++ b/cypress/support/types/yves/order-cancellation.ts @@ -0,0 +1,18 @@ +import { Address, Customer, ProductConcrete, User } from './shared'; + +export interface OrderCancellationDynamicFixtures { + rootUser: User; + + wholeOrderCustomer: Customer; + wholeOrderAddress: Address; + wholeOrderProduct: ProductConcrete; + + mixedStateCustomer: Customer; + mixedStateAddress: Address; + advancedItemProduct: ProductConcrete; + cancellableItemProduct: ProductConcrete; +} + +export interface OrderCancellationStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/yves/original-price.ts b/cypress/support/types/yves/original-price.ts new file mode 100644 index 000000000..72b6c8079 --- /dev/null +++ b/cypress/support/types/yves/original-price.ts @@ -0,0 +1,34 @@ +import { Customer, Merchant, ProductConcrete } from './shared'; + +export interface OriginalPriceStaticFixtures { + defaultPassword: string; + abstractPrice: DisplayedPrice; + variant: PricedVariant; +} + +interface DisplayedPrice { + default: string; + original: string; +} + +interface PricedVariant extends DisplayedPrice { + attributeKey: string; + attributeValue: string; +} + +export interface OriginalPriceDynamicFixtures { + customer: Customer; + product: ProductConcrete; + discountedVariant: ProductConcrete; +} + +export interface MerchantProductOriginalPriceStaticFixtures { + defaultPassword: string; + abstractPrice: DisplayedPrice; +} + +export interface MerchantProductOriginalPriceDynamicFixtures { + customer: Customer; + merchant: Merchant; + merchantProduct: ProductConcrete; +} diff --git a/cypress/support/types/yves/packaging-unit-checkout.ts b/cypress/support/types/yves/packaging-unit-checkout.ts new file mode 100644 index 000000000..f802f8dde --- /dev/null +++ b/cypress/support/types/yves/packaging-unit-checkout.ts @@ -0,0 +1,15 @@ +import { Address, Customer, ProductConcrete } from './shared'; + +export interface PackagingUnitCheckoutStaticFixtures { + defaultPassword: string; + + // An amount below the minimum and off the interval, and one that satisfies both. + rejectedAmount: number; + acceptedAmount: number; +} + +export interface PackagingUnitCheckoutDynamicFixtures { + customer: Customer; + address: Address; + product: ProductConcrete; +} diff --git a/cypress/support/types/yves/product-bundle-checkout.ts b/cypress/support/types/yves/product-bundle-checkout.ts new file mode 100644 index 000000000..1e2932f4f --- /dev/null +++ b/cypress/support/types/yves/product-bundle-checkout.ts @@ -0,0 +1,16 @@ +import { Address, Customer, ProductConcrete } from './shared'; + +export interface ProductBundleCheckoutStaticFixtures { + defaultPassword: string; + // The items a bundle expands into carry no merchant, so the B2C marketplace does not offer its marketplace + // invoice for them. + paymentMethod: string; +} + +export interface ProductBundleCheckoutDynamicFixtures { + customer: Customer; + address: Address; + bundleProduct: ProductConcrete; + bundledProductOne: ProductConcrete; + bundledProductTwo: ProductConcrete; +} diff --git a/cypress/support/types/yves/product-offer.ts b/cypress/support/types/yves/product-offer.ts new file mode 100644 index 000000000..2ec3401d0 --- /dev/null +++ b/cypress/support/types/yves/product-offer.ts @@ -0,0 +1,20 @@ +import { Address, Customer, Merchant, ProductConcrete, ProductOffer, User } from './shared'; + +export interface OfferAvailabilityDynamicFixtures { + rootUser: User; + orderingCustomer: Customer; + + // A second customer whose cart already holds the offer, so the reservation is read from a cart the + // order did not consume. + cartCustomer: Customer; + address: Address; + merchant: Merchant; + merchantProduct: ProductConcrete; + productOffer: ProductOffer; +} + +export interface OfferAvailabilityStaticFixtures { + defaultPassword: string; + initialStock: number; + orderedQuantity: number; +} diff --git a/cypress/support/types/yves/product-relations.ts b/cypress/support/types/yves/product-relations.ts new file mode 100644 index 000000000..6d587cd12 --- /dev/null +++ b/cypress/support/types/yves/product-relations.ts @@ -0,0 +1,12 @@ +import { Customer, ProductConcrete } from './shared'; + +export interface ProductRelationsDynamicFixtures { + customer: Customer; + productWithRelatedProduct: ProductConcrete; + relatedProduct: ProductConcrete; + productWithoutRelatedProduct: ProductConcrete; +} + +export interface ProductRelationsStaticFixtures { + defaultPassword: string; +} diff --git a/cypress/support/types/yves/product-restrictions.ts b/cypress/support/types/yves/product-restrictions.ts new file mode 100644 index 000000000..8b3481f45 --- /dev/null +++ b/cypress/support/types/yves/product-restrictions.ts @@ -0,0 +1,22 @@ +import { Customer, ProductConcrete } from './shared'; + +export interface ProductRestrictionsStaticFixtures { + defaultPassword: string; + + // A customer whose company business unit sits in the merchant relationship the blacklist is scoped + // to, and one in no merchant relationship at all. + blacklistedCustomer: StaticCustomer; + unrestrictedCustomer: StaticCustomer; +} + +interface StaticCustomer { + email: string; +} + +export interface ProductRestrictionsDynamicFixtures { + // A customer of its own in the business unit the whitelist's merchant relationship is assigned to, + // so the whitelist narrows no catalog another spec browses. + whitelistedCustomer: Customer; + allowedProduct: ProductConcrete; + hiddenProduct: ProductConcrete; +} diff --git a/cypress/support/types/yves/product-sets.ts b/cypress/support/types/yves/product-sets.ts new file mode 100644 index 000000000..4de4d35e1 --- /dev/null +++ b/cypress/support/types/yves/product-sets.ts @@ -0,0 +1,15 @@ +import { Customer, ProductConcrete, User } from './shared'; + +export interface ProductSetsDynamicFixtures { + rootUser: User; + customer: Customer; + variantProduct: ProductConcrete; + secondVariantProduct: ProductConcrete; + simpleProduct: ProductConcrete; +} + +export interface ProductSetsStaticFixtures { + defaultPassword: string; + variantAttributeKey: string; + variantAttributeValue: string; +} diff --git a/cypress/support/types/yves/quick-add-to-cart.ts b/cypress/support/types/yves/quick-add-to-cart.ts new file mode 100644 index 000000000..a9f58ba36 --- /dev/null +++ b/cypress/support/types/yves/quick-add-to-cart.ts @@ -0,0 +1,26 @@ +import { Customer } from './shared'; + +export interface QuickAddToCartDynamicFixtures { + customer: Customer; +} + +export interface QuickAddToCartStaticFixtures { + defaultPassword: string; + buyableProduct: SearchableProduct; + unbuyableProduct: SearchableProduct; + productGroup: GroupedProduct; +} + +interface SearchableProduct { + searchQuery: string; + + // What the cart line must read once the card has been quick added. A sku in most repositories, a + // product name where that is what the demo data makes identifiable. + cartEntry?: string; +} + +interface GroupedProduct extends SearchableProduct { + // The colour code the swatch carries in its style, or the colour name its tooltip prints, + // whichever the repository's theme keys the swatch by. + swatchIdentifier: string; +} diff --git a/cypress/support/types/yves/quick-order.ts b/cypress/support/types/yves/quick-order.ts new file mode 100644 index 000000000..5dc774d6f --- /dev/null +++ b/cypress/support/types/yves/quick-order.ts @@ -0,0 +1,23 @@ +import { Address, Customer, Merchant, ProductConcrete } from './shared'; + +export interface QuickOrderToCheckoutDynamicFixtures { + customer: Customer; + reorderCustomer: Customer; + reorderAddress: Address; + shoppingList: QuickOrderShoppingList; + product1: ProductConcrete; + product2: ProductConcrete; + merchant1: Merchant; + merchant2: Merchant; +} + +export interface QuickOrderToCheckoutStaticFixtures { + defaultPassword: string; + soldByText: string; + firstProductQuantity: number; + secondProductQuantity: number; +} + +interface QuickOrderShoppingList { + name: string; +} diff --git a/cypress/support/types/yves/return-management.ts b/cypress/support/types/yves/return-management.ts new file mode 100644 index 000000000..d21c78d68 --- /dev/null +++ b/cypress/support/types/yves/return-management.ts @@ -0,0 +1,21 @@ +import type { ActionEnum } from '@pages/mp'; +import { Address, Customer, ProductConcrete, User } from './shared'; + +export interface ReturnCreationStorefrontDynamicFixtures { + rootUser: User; + customer: Customer; + address: Address; + firstReturnedProduct: ProductConcrete; + secondReturnedProduct: ProductConcrete; + keptProduct: ProductConcrete; + merchantUser?: User; +} + +export interface ReturnCreationStorefrontStaticFixtures { + defaultPassword: string; + returnDetailsTitle: string; + waitingForReturnState: string; + shippedState: string; + orderShippingEvents: Array<{ state: string; shouldTriggerOmsInCli?: boolean }>; + merchantOrderShippingActions?: Array<keyof typeof ActionEnum>; +} diff --git a/cypress/support/types/yves/shared/product-concrete.ts b/cypress/support/types/yves/shared/product-concrete.ts index af98fb6d6..684d58b5f 100644 --- a/cypress/support/types/yves/shared/product-concrete.ts +++ b/cypress/support/types/yves/shared/product-concrete.ts @@ -2,6 +2,7 @@ import { ProductLocalizedAttributes } from './product-localized-attributes'; export interface ProductConcrete { id_product_concrete: number; + fk_product_abstract: number; sku: string; abstract_sku: string; attributes: object; diff --git a/cypress/support/types/yves/shared/product-offer.ts b/cypress/support/types/yves/shared/product-offer.ts index 4bd9a0250..c5ecfb507 100644 --- a/cypress/support/types/yves/shared/product-offer.ts +++ b/cypress/support/types/yves/shared/product-offer.ts @@ -1,3 +1,4 @@ export interface ProductOffer { + id_product_offer: number; product_offer_reference: string; } diff --git a/cypress/support/types/yves/shopping-list.ts b/cypress/support/types/yves/shopping-list.ts new file mode 100644 index 000000000..866a0a26e --- /dev/null +++ b/cypress/support/types/yves/shopping-list.ts @@ -0,0 +1,26 @@ +import { Customer, Merchant, ProductConcrete, ProductOffer } from './shared'; + +export interface ShoppingListProductOffersDynamicFixtures { + customer: Customer; + product: ProductConcrete; + merchant1: Merchant; + merchant2: Merchant; + productOffer1: ProductOffer; + productOffer2: ProductOffer; +} + +export interface ShoppingListProductOffersStaticFixtures { + defaultPassword: string; + soldByText: string; +} + +export interface ShoppingListSharingDynamicFixtures { + ownerCustomer: Customer; + receiverCustomer: Customer; + product: ProductConcrete; +} + +export interface ShoppingListSharingStaticFixtures { + defaultPassword: string; + fullAccessText: string; +} diff --git a/cypress/support/types/yves/volume-prices.ts b/cypress/support/types/yves/volume-prices.ts new file mode 100644 index 000000000..cf52b8477 --- /dev/null +++ b/cypress/support/types/yves/volume-prices.ts @@ -0,0 +1,19 @@ +import { Customer, ProductConcrete } from './shared'; + +export interface VolumePricesStaticFixtures { + defaultPassword: string; + unitPrice: string; + volumeTier: VolumeTier; + + belowTierQuantity: number; +} + +interface VolumeTier { + quantity: number; + price: string; +} + +export interface VolumePricesDynamicFixtures { + customer: Customer; + product: ProductConcrete; +} diff --git a/cypress/support/utils/feature/feature-check.ts b/cypress/support/utils/feature/feature-check.ts new file mode 100644 index 000000000..b677fb2ef --- /dev/null +++ b/cypress/support/utils/feature/feature-check.ts @@ -0,0 +1,118 @@ +// One repository id can run on shops that install different features (`b2b` runs on b2b-demo-shop and on the +// b2b lane of b2b-demo-marketplace), so a spec that needs such a feature asks the running shop for it instead +// of branching on the repository id. + +const HTTP_NOT_FOUND = 404; + +const CONSOLE_SUCCESS = 0; + +const REQUIRED_FEATURE_ENV_KEY = 'requiredFeature'; + +interface Feature { + description: string; + isPresent: () => Cypress.Chainable<boolean>; +} + +// A route of an uninstalled module answers 404, an installed one answers (or redirects to the login) without it. +// A host the shop does not deploy does not answer at all. +const isUrlServed = (url: string): Cypress.Chainable<boolean> => + cy + .task<number | null>('probeUrl', url) + .then((status: number | null): boolean => status !== null && status !== HTTP_NOT_FOUND); + +const isConsoleCommandRegistered = (command: string): Cypress.Chainable<boolean> => + cy + .request({ + method: 'POST', + url: `${Cypress.env('glueBackendUrl')}/dynamic-fixtures`, + headers: { 'Content-Type': 'application/vnd.api+json' }, + body: { + data: { + type: 'dynamic-fixtures', + attributes: { + operations: [{ type: 'cli-command', name: `console help ${command}`, key: 'consoleHelp' }], + }, + }, + }, + timeout: 100000, + }) + .then((response): boolean => { + const resources = [].concat(response.body.data); + + return resources.some( + (resource: { attributes: { data: { status_code: number } } }) => + resource.attributes.data.status_code === CONSOLE_SUCCESS + ); + }); + +const FEATURES = { + workflow: { + description: 'workflow management in the back office', + isPresent: (): Cypress.Chainable<boolean> => isUrlServed(`${Cypress.env('backofficeUrl')}/workflow/process`), + }, + configuration: { + description: 'configuration management in the back office', + isPresent: (): Cypress.Chainable<boolean> => isUrlServed(`${Cypress.env('backofficeUrl')}/configuration/manage`), + }, + marketplaceStorefront: { + description: 'marketplace merchants on the storefront', + isPresent: (): Cypress.Chainable<boolean> => isUrlServed(`${Cypress.env('glueUrl')}/merchants`), + }, + productAttachments: { + description: 'product attachments', + isPresent: (): Cypress.Chainable<boolean> => isConsoleCommandRegistered('data:import:product-attachment'), + }, + dateTimeConfigurator: { + description: 'date-time product configurator', + isPresent: (): Cypress.Chainable<boolean> => + isUrlServed(`${new URL(Cypress.env('backofficeUrl')).protocol}//date-time-configurator-example.spryker.local/`), + }, +} satisfies Record<string, Feature>; + +export type FeatureName = keyof typeof FEATURES; + +/** + * Declares, at the top of a describe, that the spec needs a feature on the listed repository ids. The feature is + * probed before the fixtures load, because the fixtures of an absent feature cannot be created either; when it is + * absent, the fixtures are not loaded and every hook and test of the spec is skipped. + * + * @example skipWhenFeatureAbsent('workflow', ['b2b']) + */ +export const skipWhenFeatureAbsent = (featureName: FeatureName, repositoryIds: string[]): void => { + if (!repositoryIds.includes(Cypress.env('repositoryId'))) { + return; + } + + Cypress.env(REQUIRED_FEATURE_ENV_KEY, featureName); +}; + +/** + * Runs the callback unless the spec declared a feature with skipWhenFeatureAbsent() that the running shop lacks. + */ +export const whenRequiredFeaturePresent = (callback: () => void): void => { + const featureName: FeatureName | undefined = Cypress.env(REQUIRED_FEATURE_ENV_KEY); + + if (!featureName) { + callback(); + + return; + } + + const feature: Feature = FEATURES[featureName]; + + feature.isPresent().then((isPresent: boolean): void => { + if (isPresent) { + callback(); + + return; + } + + // this.skip() in a before hook marks only the tests pending and still runs the suite's later before hooks, + // which read the fixtures that were not loaded. A pending suite skips its hooks as well as its tests. + Cypress.mocha.getRunner().suite.suites.forEach((suite: Mocha.Suite): void => { + suite.pending = true; + }); + + cy.task('log', `Skipping ${Cypress.spec.relative}: the shop has no ${feature.description}.`); + }); +}; diff --git a/cypress/support/utils/feature/index.ts b/cypress/support/utils/feature/index.ts new file mode 100644 index 000000000..50863bb67 --- /dev/null +++ b/cypress/support/utils/feature/index.ts @@ -0,0 +1 @@ +export * from './feature-check'; diff --git a/cypress/support/utils/index.ts b/cypress/support/utils/index.ts index 52058cfdc..a1597f1d9 100644 --- a/cypress/support/utils/index.ts +++ b/cypress/support/utils/index.ts @@ -1,4 +1,5 @@ export * from './api'; export * from './checkout'; +export * from './feature'; export * from './inversify'; export * from './nestable'; diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index a1ad17b24..9cc02b903 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -4,6 +4,7 @@ import { Container, interfaces } from 'inversify'; import { REPOSITORIES } from './types'; import { SuiteAgentLoginRepository } from '../../pages/yves/agent-login/repositories/suite-agent-login-repository'; +import { SuiteAgentControlBarRepository } from '../../pages/yves/agent-control-bar/repositories/suite-agent-control-bar-repository'; import { B2bCartRepository } from '../../pages/yves/cart/repositories/b2b-cart-repository'; import { SuiteCartRepository } from '../../pages/yves/cart/repositories/suite-cart-repository'; import { SuiteCheckoutAddressRepository } from '../../pages/yves/checkout/address/repositories/suite-checkout-address-repository'; @@ -40,6 +41,7 @@ import { B2bMpMerchantRelationRequestDetailsRepository } from '../../pages/yves/ import { B2bMpMerchantRelationRequestIndexRepository } from '../../pages/yves/company/merchant-relation-request/index/repositories/b2b-mp-merchant-relation-request-index-repository'; import { B2cMpLoginRepository } from '../../pages/yves/login/repositories/b2c-mp-login-repository'; import { B2cMpAgentLoginRepository } from '../../pages/yves/agent-login/repositories/b2c-mp-agent-login-repository'; +import { B2cMpAgentControlBarRepository } from '../../pages/yves/agent-control-bar/repositories/b2c-mp-agent-control-bar-repository'; import { B2cMpCartRepository } from '../../pages/yves/cart/repositories/b2c-mp-cart-repository'; import { B2cMpCheckoutAddressRepository } from '../../pages/yves/checkout/address/repositories/b2c-mp-checkout-address-repository'; import { B2cMpCheckoutCustomerRepository } from '../../pages/yves/checkout/customer/repositories/b2c-mp-checkout-customer-repository'; @@ -47,6 +49,7 @@ import { B2cMpCheckoutPaymentRepository } from '../../pages/yves/checkout/paymen import { B2cMpCheckoutShipmentRepository } from '../../pages/yves/checkout/shipment/repositories/b2c-mp-checkout-shipment-repository'; import { B2cMpCheckoutSummaryRepository } from '../../pages/yves/checkout/summary/repositories/b2c-mp-checkout-summary-repository'; import { B2bMpAgentLoginRepository } from '../../pages/yves/agent-login/repositories/b2b-mp-agent-login-repository'; +import { B2bMpAgentControlBarRepository } from '../../pages/yves/agent-control-bar/repositories/b2b-mp-agent-control-bar-repository'; import { B2bMpCheckoutAddressRepository } from '../../pages/yves/checkout/address/repositories/b2b-mp-checkout-address-repository'; import { B2bMpCheckoutCustomerRepository } from '../../pages/yves/checkout/customer/repositories/b2b-mp-checkout-customer-repository'; import { B2bMpCheckoutPaymentRepository } from '../../pages/yves/checkout/payment/repositories/b2b-mp-checkout-payment-repository'; @@ -63,6 +66,7 @@ import { B2bMerchantRelationRequestIndexRepository } from '../../pages/yves/comp import { B2bMerchantRepository } from '../../pages/yves/merchant/repositories/b2b-merchant-repository'; import { B2cLoginRepository } from '../../pages/yves/login/repositories/b2c-login-repository'; import { B2cAgentLoginRepository } from '../../pages/yves/agent-login/repositories/b2c-agent-login-repository'; +import { B2cAgentControlBarRepository } from '../../pages/yves/agent-control-bar/repositories/b2c-agent-control-bar-repository'; import { B2cCartRepository } from '../../pages/yves/cart/repositories/b2c-cart-repository'; import { B2cCheckoutAddressRepository } from '../../pages/yves/checkout/address/repositories/b2c-checkout-address-repository'; import { B2cCheckoutCustomerRepository } from '../../pages/yves/checkout/customer/repositories/b2c-checkout-customer-repository'; @@ -106,6 +110,7 @@ import { B2bCheckoutShipmentRepository } from '../../pages/yves/checkout/shipmen import { B2bCheckoutPaymentRepository } from '../../pages/yves/checkout/payment/repositories/b2b-checkout-payment-repository'; import { B2bCheckoutSummaryRepository } from '../../pages/yves/checkout/summary/repositories/b2b-checkout-summary-repository'; import { B2bAgentLoginRepository } from '../../pages/yves/agent-login/repositories/b2b-agent-login-repository'; +import { B2bAgentControlBarRepository } from '../../pages/yves/agent-control-bar/repositories/b2b-agent-control-bar-repository'; import { B2cMpMultiCartRepository } from '../../pages/yves/multi-cart/repositories/b2c-mp-multi-cart-repository'; import { B2cMpCommentCartRepository } from '../../pages/yves/comment/cart/repositories/b2c-mp-comment-cart-repository'; import { B2cMpCompanyUserSelectRepository } from '../../pages/yves/company/user/select/repositories/b2c-mp-company-user-select-repository'; @@ -291,6 +296,7 @@ const suiteMappings: BindingsMap = { [REPOSITORIES.CheckoutPaymentRepository]: SuiteCheckoutPaymentRepository, [REPOSITORIES.CheckoutSummaryRepository]: SuiteCheckoutSummaryRepository, [REPOSITORIES.AgentLoginRepository]: SuiteAgentLoginRepository, + [REPOSITORIES.AgentControlBarRepository]: SuiteAgentControlBarRepository, [REPOSITORIES.CatalogRepository]: SuiteCatalogRepository, [REPOSITORIES.ProductRepository]: SuiteProductRepository, [REPOSITORIES.CompanyUserSelectRepository]: SuiteCompanyUserSelectRepository, @@ -358,6 +364,7 @@ const b2cMappings: BindingsMap = { [REPOSITORIES.CheckoutPaymentRepository]: B2cCheckoutPaymentRepository, [REPOSITORIES.CheckoutSummaryRepository]: B2cCheckoutSummaryRepository, [REPOSITORIES.AgentLoginRepository]: B2cAgentLoginRepository, + [REPOSITORIES.AgentControlBarRepository]: B2cAgentControlBarRepository, [REPOSITORIES.CatalogRepository]: B2cCatalogRepository, [REPOSITORIES.ProductRepository]: B2cProductRepository, [REPOSITORIES.CompanyUserSelectRepository]: B2cCompanyUserSelectRepository, @@ -408,6 +415,7 @@ const b2bMappings: BindingsMap = { [REPOSITORIES.CheckoutPaymentRepository]: B2bCheckoutPaymentRepository, [REPOSITORIES.CheckoutSummaryRepository]: B2bCheckoutSummaryRepository, [REPOSITORIES.AgentLoginRepository]: B2bAgentLoginRepository, + [REPOSITORIES.AgentControlBarRepository]: B2bAgentControlBarRepository, [REPOSITORIES.CatalogRepository]: B2bCatalogRepository, [REPOSITORIES.ProductRepository]: B2bProductRepository, [REPOSITORIES.CompanyUserSelectRepository]: B2bCompanyUserSelectRepository, @@ -463,6 +471,7 @@ const b2cMpMappings: BindingsMap = { [REPOSITORIES.CheckoutPaymentRepository]: B2cMpCheckoutPaymentRepository, [REPOSITORIES.CheckoutSummaryRepository]: B2cMpCheckoutSummaryRepository, [REPOSITORIES.AgentLoginRepository]: B2cMpAgentLoginRepository, + [REPOSITORIES.AgentControlBarRepository]: B2cMpAgentControlBarRepository, [REPOSITORIES.CatalogRepository]: B2cMpCatalogRepository, [REPOSITORIES.ProductRepository]: B2cMpProductRepository, [REPOSITORIES.CompanyUserSelectRepository]: B2cMpCompanyUserSelectRepository, @@ -513,6 +522,7 @@ const b2bMpMappings: BindingsMap = { [REPOSITORIES.CheckoutPaymentRepository]: B2bMpCheckoutPaymentRepository, [REPOSITORIES.CheckoutSummaryRepository]: B2bMpCheckoutSummaryRepository, [REPOSITORIES.AgentLoginRepository]: B2bMpAgentLoginRepository, + [REPOSITORIES.AgentControlBarRepository]: B2bMpAgentControlBarRepository, [REPOSITORIES.CatalogRepository]: B2bMpCatalogRepository, [REPOSITORIES.ProductRepository]: B2bMpProductRepository, [REPOSITORIES.CompanyUserSelectRepository]: B2bMpCompanyUserSelectRepository, diff --git a/cypress/support/utils/inversify/types.ts b/cypress/support/utils/inversify/types.ts index 06d626569..791734f01 100644 --- a/cypress/support/utils/inversify/types.ts +++ b/cypress/support/utils/inversify/types.ts @@ -12,6 +12,7 @@ export const enum REPOSITORIES { CheckoutPaymentRepository = 'CheckoutPaymentRepository', CheckoutSummaryRepository = 'CheckoutSummaryRepository', AgentLoginRepository = 'AgentLoginRepository', + AgentControlBarRepository = 'AgentControlBarRepository', CatalogRepository = 'CatalogRepository', ProductRepository = 'ProductRepository', CompanyUserSelectRepository = 'CompanyUserSelectRepository',