diff --git a/cypress/e2e/backoffice/customer-group/customer-group-company-membership.cy.ts b/cypress/e2e/backoffice/customer-group/customer-group-company-membership.cy.ts index 2aabba956..0280b86c3 100644 --- a/cypress/e2e/backoffice/customer-group/customer-group-company-membership.cy.ts +++ b/cypress/e2e/backoffice/customer-group/customer-group-company-membership.cy.ts @@ -20,8 +20,8 @@ describe( ], }, (): void => { - if (Cypress.env('repositoryId') !== 'suite') { - it.skip('skipped because tests run only for suite', () => {}); + if (!['suite', 'b2b-mp'].includes(Cypress.env('repositoryId'))) { + it.skip('skipped because tests run only for suite and b2b-mp', () => {}); return; } diff --git a/cypress/fixtures/b2b-mp/backoffice/customer-group/dynamic-customer-group-company-membership.json b/cypress/fixtures/b2b-mp/backoffice/customer-group/dynamic-customer-group-company-membership.json new file mode 100644 index 000000000..dd3d8b88f --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/customer-group/dynamic-customer-group-company-membership.json @@ -0,0 +1,83 @@ +{ + "data": { + "type": "dynamic-fixtures", + "attributes": { + "synchronize": false, + "operations": [ + { + "type": "helper", + "name": "haveUser", + "key": "rootUser", + "arguments": [{ "password": "change123" }] + }, + { + "type": "helper", + "name": "addUserToGroup", + "arguments": ["#rootUser.id_user", 1] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customer", + "arguments": [{}] + }, + { + "type": "helper", + "name": "haveCustomer", + "key": "customerToKeep", + "arguments": [{}] + }, + { + "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": "haveCompany", + "key": "companyToKeep", + "arguments": [{ "status": "approved", "is_active": true }] + }, + { + "type": "helper", + "name": "haveCompanyBusinessUnit", + "key": "businessUnitToKeep", + "arguments": [{ "fk_company": "#companyToKeep.id_company" }] + }, + { + "type": "helper", + "name": "haveCustomerGroup", + "key": "customerGroupWithMemberships", + "arguments": [ + { + "customerAssignment": { + "idsCustomerToAssign": ["#customer.id_customer", "#customerToKeep.id_customer"] + }, + "companyAssignment": { + "idsCompanyToAssign": ["#company.id_company", "#companyToKeep.id_company"] + }, + "companyBusinessUnitAssignment": { + "idsCompanyBusinessUnitToAssign": [ + "#businessUnit.id_company_business_unit", + "#businessUnitToKeep.id_company_business_unit" + ] + } + } + ] + }, + { + "type": "builder", + "name": "CustomerGroupBuilder", + "key": "newCustomerGroup" + } + ] + } + } +} diff --git a/cypress/fixtures/b2b-mp/backoffice/customer-group/static-customer-group-company-membership.json b/cypress/fixtures/b2b-mp/backoffice/customer-group/static-customer-group-company-membership.json new file mode 100644 index 000000000..ba4339e8a --- /dev/null +++ b/cypress/fixtures/b2b-mp/backoffice/customer-group/static-customer-group-company-membership.json @@ -0,0 +1,3 @@ +{ + "defaultPassword": "change123" +} diff --git a/cypress/support/utils/inversify/inversify.config.ts b/cypress/support/utils/inversify/inversify.config.ts index f7e20d09f..06e34f628 100644 --- a/cypress/support/utils/inversify/inversify.config.ts +++ b/cypress/support/utils/inversify/inversify.config.ts @@ -580,6 +580,9 @@ const b2bMpMappings: BindingsMap = { [REPOSITORIES.CategoryCreateRepository]: B2bMpCategoryCreateRepository, [REPOSITORIES.CategoryEditRepository]: B2bMpCategoryEditRepository, [REPOSITORIES.CategoryReSortRepository]: B2bMpCategoryReSortRepository, + [REPOSITORIES.CustomerGroupFormRepository]: SuiteCustomerGroupFormRepository, + [REPOSITORIES.CustomerGroupViewRepository]: SuiteCustomerGroupViewRepository, + [REPOSITORIES.CustomerGroupListRepository]: SuiteCustomerGroupListRepository, }; const mappings = {