-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from spryker/feature/cc-32736/dev-merchant-rela…
…tions CC-32421 Merchant Relation Requests & Enhanced Merchant Relations.
- Loading branch information
Showing
146 changed files
with
4,302 additions
and
627 deletions.
There are no files selected for viewing
162 changes: 162 additions & 0 deletions
162
cypress/e2e/backoffice/merchant-b2b-contract-requests/request-management.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
import { container } from '@utils'; | ||
import { RequestManagementDynamicFixtures, RequestManagementStaticFixtures } from '@interfaces/backoffice'; | ||
import { UserLoginScenario } from '@scenarios/backoffice'; | ||
import { | ||
ActionEnum, | ||
MerchantRelationRequestEditPage, | ||
MerchantRelationRequestListPage, | ||
MerchantRelationshipListPage, | ||
} from '@pages/backoffice'; | ||
|
||
/** | ||
* Merchant Relation Requests & Enhanced Merchant Relations checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4105896492/Business+Journey+B2B+Marketplace+-+to+automate} | ||
*/ | ||
describe('request management', { tags: ['@merchant-b2b-contract-requests'] }, (): void => { | ||
const merchantRelationRequestListPage = container.get(MerchantRelationRequestListPage); | ||
const merchantRelationRequestEditPage = container.get(MerchantRelationRequestEditPage); | ||
const merchantRelationshipListPage = container.get(MerchantRelationshipListPage); | ||
const userLoginScenario = container.get(UserLoginScenario); | ||
|
||
let dynamicFixtures: RequestManagementDynamicFixtures; | ||
let staticFixtures: RequestManagementStaticFixtures; | ||
|
||
before((): void => { | ||
({ dynamicFixtures, staticFixtures } = Cypress.env()); | ||
}); | ||
|
||
beforeEach((): void => { | ||
userLoginScenario.execute({ | ||
username: dynamicFixtures.rootUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
}); | ||
|
||
it('operator should be able to see all requests from all merchants', (): void => { | ||
const merchants = [dynamicFixtures.merchant1, dynamicFixtures.merchant2, dynamicFixtures.merchant3]; | ||
|
||
merchants.forEach((merchant) => { | ||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: merchant.id_merchant, | ||
}); | ||
|
||
cy.contains(merchant.name); | ||
}); | ||
}); | ||
|
||
it('operator should be able to see internal comments from all merchant users', (): void => { | ||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant1.id_merchant, | ||
}); | ||
|
||
cy.contains(staticFixtures.internalCommentFromMerchantUser1); | ||
cy.contains(staticFixtures.internalCommentFromMerchantUser2); | ||
}); | ||
|
||
it('operator should be able to add internal comment', (): void => { | ||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant1.id_merchant, | ||
}); | ||
|
||
merchantRelationRequestEditPage.addInternalComment({ comment: staticFixtures.internalCommentFromRootUser }); | ||
|
||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant1.id_merchant, | ||
}); | ||
|
||
cy.contains(staticFixtures.internalCommentFromRootUser); | ||
}); | ||
|
||
it('operator should be able to add internal comment with emoji', (): void => { | ||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant1.id_merchant, | ||
}); | ||
|
||
merchantRelationRequestEditPage.addInternalComment({ | ||
comment: staticFixtures.internalCommentFromRootUserWithEmoji, | ||
}); | ||
|
||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant1.id_merchant, | ||
}); | ||
|
||
cy.contains(staticFixtures.internalCommentFromRootUserWithEmoji); | ||
}); | ||
|
||
it('operator should be able to reject request', (): void => { | ||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant3.id_merchant, | ||
}); | ||
|
||
merchantRelationRequestEditPage.reject(); | ||
|
||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.view, | ||
idMerchant: dynamicFixtures.merchant3.id_merchant, | ||
}); | ||
|
||
cy.contains('Rejected'); | ||
|
||
merchantRelationshipListPage.visit(); | ||
merchantRelationshipListPage.applyFilters({ idCompany: dynamicFixtures.company2.id_company }); | ||
merchantRelationshipListPage.getEditButtons().should('have.length', 0); | ||
}); | ||
|
||
it('operator should be able to approve request (additionally copy internal comments to relation)', (): void => { | ||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant1.id_merchant, | ||
}); | ||
|
||
merchantRelationRequestEditPage.approve({ isSplitEnabled: false }); | ||
|
||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.view, | ||
idMerchant: dynamicFixtures.merchant1.id_merchant, | ||
}); | ||
cy.contains('Approved'); | ||
|
||
merchantRelationshipListPage.visit(); | ||
merchantRelationshipListPage.update({ idCompany: dynamicFixtures.company1.id_company }); | ||
|
||
cy.contains(staticFixtures.internalCommentFromMerchantUser1); | ||
cy.contains(staticFixtures.internalCommentFromMerchantUser2); | ||
}); | ||
|
||
it('operator should be able to approve request with enabled BU splitting', (): void => { | ||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.edit, | ||
idMerchant: dynamicFixtures.merchant2.id_merchant, | ||
}); | ||
|
||
merchantRelationRequestEditPage.approve({ isSplitEnabled: true }); | ||
|
||
merchantRelationRequestListPage.visit(); | ||
merchantRelationRequestListPage.update({ | ||
action: ActionEnum.view, | ||
idMerchant: dynamicFixtures.merchant2.id_merchant, | ||
}); | ||
cy.contains('Approved'); | ||
|
||
merchantRelationshipListPage.visit(); | ||
merchantRelationshipListPage.applyFilters({ idCompany: dynamicFixtures.company2.id_company }); | ||
merchantRelationshipListPage.getEditButtons().should('have.length', 2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.