-
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.
Restructured tests into smaller parts.
- Loading branch information
Showing
38 changed files
with
1,040 additions
and
547 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...management/order-management-suite-1.cy.ts → ...ice/order-management/order-creation.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
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
84 changes: 84 additions & 0 deletions
84
cypress/e2e/mp/marketplace-agent-assist/agent-authorization.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,84 @@ | ||
import { AgentAuthorizationDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; | ||
import { IndexPage } from '@pages/backoffice'; | ||
import { AgentLoginPage, LoginPage } from '@pages/yves'; | ||
import { UserLoginScenario } from '@scenarios/backoffice'; | ||
import { MerchantAgentLoginUserScenario } from '@scenarios/mp'; | ||
import { container } from '@utils'; | ||
|
||
/** | ||
* Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} | ||
*/ | ||
describe('agent authorization', { tags: ['@marketplace-agent-assist'] }, (): void => { | ||
const yvesLoginPage = container.get(LoginPage); | ||
const yvesAgentLoginPage = container.get(AgentLoginPage); | ||
const backofficeIndexPage = container.get(IndexPage); | ||
const userLoginScenario = container.get(UserLoginScenario); | ||
const merchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); | ||
|
||
let dynamicFixtures: AgentAuthorizationDynamicFixtures; | ||
let staticFixtures: MarketplaceAgentAssistStaticFixtures; | ||
|
||
before((): void => { | ||
({ dynamicFixtures, staticFixtures } = Cypress.env()); | ||
}); | ||
|
||
it('agent (customer) should be able to login to backoffice', (): void => { | ||
userLoginScenario.execute({ | ||
username: dynamicFixtures.customerAgentUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
backofficeIndexPage.visit(); | ||
backofficeIndexPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent (merchant user) should be able to login to backoffice', (): void => { | ||
merchantAgentLoginUserScenario.execute({ | ||
username: dynamicFixtures.merchantAgentUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
backofficeIndexPage.visit(); | ||
backofficeIndexPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => { | ||
yvesAgentLoginPage.visit(); | ||
yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); | ||
yvesAgentLoginPage.assertPageLocation(); | ||
}); | ||
|
||
it('merchant user should not be able to login to storefront agent dashboard', (): void => { | ||
yvesAgentLoginPage.visit(); | ||
yvesAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
cy.contains(yvesAgentLoginPage.getFailedAuthenticationText()); | ||
yvesAgentLoginPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent (merchant user) should not be able to login to storefront', (): void => { | ||
yvesLoginPage.visit(); | ||
yvesLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
cy.contains(yvesLoginPage.getFailedAuthenticationText()); | ||
yvesLoginPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent (customer) should not be able to login to storefront', (): void => { | ||
yvesLoginPage.visit(); | ||
yvesLoginPage.login(dynamicFixtures.customerAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
cy.contains(yvesLoginPage.getFailedAuthenticationText()); | ||
yvesLoginPage.assertPageLocation(); | ||
}); | ||
|
||
it('merchant user should not be able to login to storefront', (): void => { | ||
yvesLoginPage.visit(); | ||
yvesLoginPage.login(dynamicFixtures.merchantUser.username, staticFixtures.defaultPassword); | ||
|
||
cy.contains(yvesLoginPage.getFailedAuthenticationText()); | ||
yvesLoginPage.assertPageLocation(); | ||
}); | ||
}); |
166 changes: 166 additions & 0 deletions
166
cypress/e2e/mp/marketplace-agent-assist/agent-dashboard.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,166 @@ | ||
import { AgentDashboardDynamicFixtures, MarketplaceAgentAssistStaticFixtures } from '@interfaces/mp'; | ||
import { AgentDashboardPage, DashboardPage, AgentLoginPage as MpAgentLoginPage } from '@pages/mp'; | ||
import { UserLoginScenario } from '@scenarios/backoffice'; | ||
import { MerchantAgentLoginUserScenario } from '@scenarios/mp'; | ||
import { container } from '@utils'; | ||
|
||
/** | ||
* Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists} | ||
*/ | ||
describe('agent dashboard', { tags: ['@marketplace-agent-assist'] }, (): void => { | ||
const mpAgentLoginPage = container.get(MpAgentLoginPage); | ||
const mpDashboardPage = container.get(DashboardPage); | ||
const mpAgentDashboardPage = container.get(AgentDashboardPage); | ||
const userLoginScenario = container.get(UserLoginScenario); | ||
const merchantAgentLoginUserScenario = container.get(MerchantAgentLoginUserScenario); | ||
|
||
let dynamicFixtures: AgentDashboardDynamicFixtures; | ||
let staticFixtures: MarketplaceAgentAssistStaticFixtures; | ||
|
||
before((): void => { | ||
({ dynamicFixtures, staticFixtures } = Cypress.env()); | ||
}); | ||
|
||
it('agent should be able to see "Merchant Users" table', (): void => { | ||
merchantAgentLoginUserScenario.execute({ | ||
username: dynamicFixtures.merchantAgentUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.assertPageLocation(); | ||
mpAgentDashboardPage.getDashboardSidebarSelector().contains('Merchant Users'); | ||
|
||
cy.contains('Merchant'); | ||
cy.contains('Merchant Approval'); | ||
cy.contains('First Name'); | ||
cy.contains('Last Name'); | ||
cy.contains('Email'); | ||
cy.contains('User Status'); | ||
}); | ||
|
||
it('agent should be able to see active merchant user in a table', (): void => { | ||
merchantAgentLoginUserScenario.execute({ | ||
username: dynamicFixtures.merchantAgentUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); | ||
}); | ||
|
||
it('agent should be able to filter by merchant user properties', (): void => { | ||
merchantAgentLoginUserScenario.execute({ | ||
username: dynamicFixtures.merchantAgentUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchant.name, 3).should('exist'); | ||
mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); | ||
}); | ||
|
||
it('agent should be able to see/assist inactive merchant user in a table', (): void => { | ||
mpAgentLoginPage.visit(); | ||
mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deactivatedMerchantUser.username).should('exist'); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deactivatedMerchantUser.username); | ||
|
||
mpDashboardPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent should be able to see/assist deleted merchant user in a table', (): void => { | ||
mpAgentLoginPage.visit(); | ||
mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.findMerchantUser(dynamicFixtures.deletedMerchantUser.username).should('exist'); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.deletedMerchantUser.username); | ||
|
||
mpDashboardPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent should be able to see/assist merchant users from active (without approved access) merchant', (): void => { | ||
userLoginScenario.execute({ | ||
username: dynamicFixtures.rootUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
mpAgentLoginPage.visit(); | ||
mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage | ||
.findMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username) | ||
.should('exist'); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromActiveDeniedMerchant.username); | ||
|
||
mpDashboardPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent should be able to see/assist merchant users from inactive (with approved access) merchant', (): void => { | ||
userLoginScenario.execute({ | ||
username: dynamicFixtures.rootUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
mpAgentLoginPage.visit(); | ||
mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage | ||
.findMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username) | ||
.should('exist'); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveApprovedMerchant.username); | ||
|
||
mpDashboardPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent should be able to see/assist merchant users from inactive (without approved access) merchant', (): void => { | ||
userLoginScenario.execute({ | ||
username: dynamicFixtures.rootUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
mpAgentLoginPage.visit(); | ||
mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage | ||
.findMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username) | ||
.should('exist'); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUserFromInactiveDeniedMerchant.username); | ||
|
||
mpDashboardPage.assertPageLocation(); | ||
}); | ||
|
||
it('agent should be able to see/assist merchant users from active (with approved access) merchant', (): void => { | ||
userLoginScenario.execute({ | ||
username: dynamicFixtures.rootUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
mpAgentLoginPage.visit(); | ||
mpAgentLoginPage.login(dynamicFixtures.merchantAgentUser.username, staticFixtures.defaultPassword); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.findMerchantUser(dynamicFixtures.merchantUser.username).should('exist'); | ||
|
||
mpAgentDashboardPage.visit(); | ||
mpAgentDashboardPage.assistMerchantUser(dynamicFixtures.merchantUser.username); | ||
|
||
mpDashboardPage.assertPageLocation(); | ||
}); | ||
}); |
Oops, something went wrong.