Skip to content

Commit c6b5012

Browse files
committed
merge conflicts
2 parents 00e10d8 + 56e1bc5 commit c6b5012

File tree

116 files changed

+2422
-1021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2422
-1021
lines changed

cypress.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineConfig({
1111
mailCatcherUrl: process.env.ENV_MAIL_CATCHER_URL,
1212
operationRunnerUrl: process.env.OPERATION_RUNNER_URL,
1313
cli: {
14-
// TODO: move to .env
14+
// TODO: TEMPORARILY SOLUTION: rework + move to .env
1515
store: 'DE',
1616
containerPath: '../suite-nonsplit',
1717
containerName: 'spryker_cli_1',
@@ -30,6 +30,10 @@ export default defineConfig({
3030
},
3131
});
3232
},
33+
retries: {
34+
runMode: 2,
35+
openMode: 0,
36+
},
3337
},
3438
viewportWidth: parseInt(process.env.VIEWPORT_WIDGTH ?? '1000', 10),
3539
viewportHeight: parseInt(process.env.VIEWPORT_HEIGHT ?? '660', 10),

cypress/e2e/backoffice/order-management/agent/backoffice-merchant-agent.cy.ts renamed to cypress/e2e/backoffice/order-management/merchant-agent-assist/agent-permission-in-backoffice.cy.ts

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,29 @@ import { BackofficeUserCreatePage } from '../../support/pages/backoffice/user/cr
55
import { CreateRootUserScenario } from '../../support/scenarios/backoffice/create-root-user-scenario';
66
import { BackofficeLoginUserScenario } from '../../support/scenarios/backoffice/backoffice-login-user-scenario';
77

8-
describe('backoffice merchant agent', (): void => {
9-
let fixtures: BackofficeMerchantAgentFixtures;
8+
/**
9+
* Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists}
10+
*/
11+
describe('agent permission in backoffice', (): void => {
12+
const userIndexPage: BackofficeUserIndexPage = container.get(BackofficeUserIndexPage);
13+
const userUpdatePage: BackofficeUserUpdatePage = container.get(BackofficeUserUpdatePage);
14+
const userCreatePage: BackofficeUserCreatePage = container.get(BackofficeUserCreatePage);
1015

11-
let userIndexPage: BackofficeUserIndexPage;
12-
let userUpdatePage: BackofficeUserUpdatePage;
13-
let userCreatePage: BackofficeUserCreatePage;
14-
let loginUserScenario: BackofficeLoginUserScenario;
15-
let createRootUserScenario: CreateRootUserScenario;
16+
const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario);
17+
const createRootUserScenario: CreateRootUserScenario = container.get(CreateRootUserScenario);
18+
19+
let fixtures: AgentPermissionInBackofficeFixtures;
1620

1721
before((): void => {
1822
fixtures = Cypress.env('fixtures');
19-
20-
userIndexPage = container.get(BackofficeUserIndexPage);
21-
userUpdatePage = container.get(BackofficeUserUpdatePage);
22-
userCreatePage = container.get(BackofficeUserCreatePage);
23-
loginUserScenario = container.get(BackofficeLoginUserScenario);
24-
createRootUserScenario = container.get(CreateRootUserScenario);
2523
});
2624

2725
beforeEach((): void => {
2826
cy.resetBackofficeCookies();
2927
loginUserScenario.execute(fixtures.user);
3028
});
3129

32-
it('backoffice user should be able to see new merchant agent permission checkbox [@merchant-agent-assist]', (): void => {
30+
it('backoffice user should be able to see new merchant agent permission checkbox', (): void => {
3331
cy.visitBackoffice(userIndexPage.PAGE_URL);
3432
userIndexPage.editUser(fixtures.user.username);
3533

@@ -40,50 +38,50 @@ describe('backoffice merchant agent', (): void => {
4038
.contains('This user is an agent in Merchant Portal');
4139
});
4240

43-
it('backoffice user should be able to see renamed customer agent permission checkbox [@merchant-agent-assist]', (): void => {
41+
it('backoffice user should be able to see renamed customer agent permission checkbox', (): void => {
4442
cy.visitBackoffice(userIndexPage.PAGE_URL);
4543
userIndexPage.editUser(fixtures.user.username);
4644

4745
userUpdatePage.getAgentCustomerCheckbox().should('exist').parent().contains('This user is an agent in Storefront');
4846
});
4947

50-
it('backoffice user should be able to see existing user with merchant agent permission [@merchant-agent-assist]', (): void => {
48+
it('backoffice user should be able to see existing user with merchant agent permission', (): void => {
5149
cy.visitBackoffice(userIndexPage.PAGE_URL);
5250
userIndexPage.editUser(fixtures.merchantAgentUser.username);
5351

5452
userUpdatePage.getAgentMerchantCheckbox().should('be.checked');
5553
});
5654

57-
it('backoffice user should be able to see "Agent Customer" column in user table [@merchant-agent-assist]', (): void => {
55+
it('backoffice user should be able to see "Agent Customer" column in user table', (): void => {
5856
cy.visitBackoffice(userIndexPage.PAGE_URL);
5957
userIndexPage.getUserTableHeader().contains('Agent Customer');
6058
});
6159

62-
it('backoffice user should be able to see "Agent Merchant" column in user table [@merchant-agent-assist]', (): void => {
60+
it('backoffice user should be able to see "Agent Merchant" column in user table', (): void => {
6361
cy.visitBackoffice(userIndexPage.PAGE_URL);
6462
userIndexPage.getUserTableHeader().contains('Agent Merchant');
6563
});
6664

67-
it('backoffice user should be able to see imported user with "Agent Customer" permission [@merchant-agent-assist]', (): void => {
65+
it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => {
6866
cy.visitBackoffice(userIndexPage.PAGE_URL);
6967

7068
userIndexPage.findUser(fixtures.customerAgentUser.username).contains('Agent').should('have.length', 1);
7169
});
7270

73-
it('backoffice user should be able to see imported user with "Agent Merchant" permission [@merchant-agent-assist]', (): void => {
71+
it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => {
7472
cy.visitBackoffice(userIndexPage.PAGE_URL);
7573

7674
userIndexPage.findUser(fixtures.merchantAgentUser.username).contains('Agent').should('have.length', 1);
7775
});
7876

79-
it('backoffice user should be able to create new user without checked merchant agent permission by default [@merchant-agent-assist]', (): void => {
77+
it('backoffice user should be able to create new user without checked merchant agent permission by default', (): void => {
8078
const user: User = createRootUserScenario.execute();
8179

8280
userIndexPage.editUser(user.username);
8381
userUpdatePage.getAgentMerchantCheckbox().should('not.be.checked');
8482
});
8583

86-
it('backoffice user should be able to create new user with merchant agent permission [@merchant-agent-assist]', (): void => {
84+
it('backoffice user should be able to create new user with merchant agent permission', (): void => {
8785
cy.visitBackoffice(userIndexPage.PAGE_URL);
8886
userIndexPage.createNewUser();
8987
const user: User = userCreatePage.createAgentMerchantUser();
@@ -92,7 +90,7 @@ describe('backoffice merchant agent', (): void => {
9290
userUpdatePage.getAgentMerchantCheckbox().should('be.checked');
9391
});
9492

95-
it('backoffice user should be able to modify existing user by setting merchant agent permission [@merchant-agent-assist]', (): void => {
93+
it('backoffice user should be able to modify existing user by setting merchant agent permission', (): void => {
9694
const user: User = createRootUserScenario.execute();
9795

9896
userIndexPage.editUser(user.username);
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import { container } from '../../support/utils/inversify/inversify.config';
2+
import { BackofficeIndexPage } from '../../support/pages/backoffice/index/backoffice-index-page';
3+
import { YvesAgentLoginPage } from '../../support/pages/yves/agent-login/yves-agent-login-page';
4+
import { YvesLoginPage } from '../../support/pages/yves/login/yves-login-page';
5+
import { BackofficeLoginUserScenario } from '../../support/scenarios/backoffice/backoffice-login-user-scenario';
6+
import { YvesLoginCustomerScenario } from '../../support/scenarios/yves/yves-login-customer-scenario';
7+
import { YvesAgentLoginScenario } from '../../support/scenarios/yves/yves-agent-login-scenario';
8+
9+
/**
10+
* Agent Assist in Merchant Portal checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/3975741526/Agent+Assist+in+Merchant+Portal+Checklists}
11+
*/
12+
describe('customer agent login page', (): void => {
13+
const indexPage: BackofficeIndexPage = container.get(BackofficeIndexPage);
14+
const loginPage: YvesLoginPage = container.get(YvesLoginPage);
15+
const agentLoginPage: YvesAgentLoginPage = container.get(YvesAgentLoginPage);
16+
17+
const loginUserScenario: BackofficeLoginUserScenario = container.get(BackofficeLoginUserScenario);
18+
const loginCustomerScenario: YvesLoginCustomerScenario = container.get(YvesLoginCustomerScenario);
19+
const agentLoginScenario: YvesAgentLoginScenario = container.get(YvesAgentLoginScenario);
20+
21+
let fixtures: CustomerAgentLoginPageFixtures;
22+
23+
before((): void => {
24+
fixtures = Cypress.env('fixtures');
25+
});
26+
27+
it('agent (customer) should be able to login to backoffice', (): void => {
28+
cy.resetBackofficeCookies();
29+
loginUserScenario.execute(fixtures.customerAgentUser);
30+
31+
indexPage.assertPageLocation();
32+
});
33+
34+
it('agent (merchant user) should be able to login to backoffice', (): void => {
35+
cy.resetBackofficeCookies();
36+
loginUserScenario.execute(fixtures.merchantAgentUser);
37+
38+
indexPage.assertPageLocation();
39+
});
40+
41+
it('agent (merchant user) should not be able to login to storefront agent dashboard', (): void => {
42+
cy.resetYvesCookies();
43+
agentLoginScenario.execute(fixtures.merchantAgentUser);
44+
45+
cy.contains(agentLoginPage.getFailedAuthenticationText());
46+
agentLoginPage.assertPageLocation();
47+
});
48+
49+
it('merchant user should not be able to login to storefront agent dashboard', (): void => {
50+
cy.resetYvesCookies();
51+
agentLoginScenario.execute(fixtures.merchantUser);
52+
53+
cy.contains(agentLoginPage.getFailedAuthenticationText());
54+
agentLoginPage.assertPageLocation();
55+
});
56+
57+
it('agent (merchant user) should not be able to login to storefront', (): void => {
58+
cy.resetYvesCookies();
59+
cy.visit(loginPage.PAGE_URL);
60+
61+
const customer: Customer = {
62+
email: fixtures.merchantAgentUser.username,
63+
password: fixtures.merchantAgentUser.password,
64+
};
65+
66+
loginCustomerScenario.execute(customer);
67+
68+
cy.contains(loginPage.getFailedAuthenticationText());
69+
loginPage.assertPageLocation();
70+
});
71+
72+
it('agent (customer) should not be able to login to storefront', (): void => {
73+
cy.resetYvesCookies();
74+
cy.visit(loginPage.PAGE_URL);
75+
76+
const customer: Customer = {
77+
email: fixtures.customerAgentUser.username,
78+
password: fixtures.customerAgentUser.password,
79+
};
80+
81+
loginCustomerScenario.execute(customer);
82+
83+
cy.contains(loginPage.getFailedAuthenticationText());
84+
loginPage.assertPageLocation();
85+
});
86+
87+
it('merchant user should not be able to login to storefront', (): void => {
88+
cy.resetYvesCookies();
89+
cy.visit(loginPage.PAGE_URL);
90+
91+
const customer: Customer = {
92+
email: fixtures.merchantUser.username,
93+
password: fixtures.merchantUser.password,
94+
};
95+
96+
loginCustomerScenario.execute(customer);
97+
98+
cy.contains(loginPage.getFailedAuthenticationText());
99+
loginPage.assertPageLocation();
100+
});
101+
});

0 commit comments

Comments
 (0)