Skip to content

Commit 1da4a88

Browse files
committed
GH-1765 Fixing test
1 parent a1785b1 commit 1da4a88

File tree

1 file changed

+4
-43
lines changed

1 file changed

+4
-43
lines changed

projects/storefrontapp-e2e-cypress/cypress/integration/regression/checkout-as-persistent-user.e2e-spec.ts

+4-43
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,19 @@
11
import { product } from '../../sample-data/checkout-flow';
22

33
context('Check login', () => {
4+
const testUser = 'test-user-cypress@ydev.hybris.com';
5+
46
before(() => {
57
cy.window().then(win => win.sessionStorage.clear());
6-
cy.login('test-user-cypress@ydev.hybris.com', 'Password123.');
8+
cy.login(testUser, 'Password123.');
79
cy.visit('/');
810
});
911

1012
it('should login successfully', () => {
1113
cy.get('.cx-login-greet').should('contain', 'Test User');
1214
});
1315

14-
it('should add a shipping address', () => {
15-
cy.request({
16-
method: 'POST',
17-
url: `${Cypress.env(
18-
'API_URL'
19-
)}/rest/v2/electronics/users/test-user-cypress@ydev.hybris.com/addresses?lang=en&curr=USD`,
20-
headers: {
21-
Authorization: `bearer ${
22-
JSON.parse(sessionStorage.getItem('auth')).userToken.token[
23-
'access_token'
24-
]
25-
}`
26-
},
27-
body: {
28-
defaultAddress: false,
29-
titleCode: 'mr',
30-
firstName: 'Test',
31-
lastName: 'User',
32-
line1: '999 de Maisonneuve',
33-
line2: '',
34-
town: 'Montreal',
35-
region: { isocode: 'US-AK' },
36-
country: { isocode: 'US' },
37-
postalCode: 'H4B3L4',
38-
phone: ''
39-
}
40-
}).then(response => {
41-
expect(response.status).to.eq(201);
42-
});
43-
});
44-
4516
it('should go to product page from category page', () => {
46-
// click big banner
4717
cy.get('.Section1 cx-responsive-banner')
4818
.first()
4919
.find('img')
@@ -74,7 +44,7 @@ context('Check login', () => {
7444
method: 'POST',
7545
url: `${Cypress.env(
7646
'API_URL'
77-
)}/rest/v2/electronics/users/test-user-cypress@ydev.hybris.com/carts/${cartid}/paymentdetails`,
47+
)}/rest/v2/electronics-spa/users/${testUser}/carts/${cartid}/paymentdetails`,
7848
headers: {
7949
Authorization: `bearer ${
8050
JSON.parse(sessionStorage.getItem('auth')).userToken.token[
@@ -171,15 +141,6 @@ context('Check login', () => {
171141
cy.get('cx-order-summary .cx-summary-amount').should('not.be.empty');
172142
});
173143

174-
it('should delete shipping address', () => {
175-
cy.visit('/my-account/address-book');
176-
cy.getByText('delete')
177-
.first()
178-
.click();
179-
cy.get('.cx-address-card--delete-mode button.btn-primary').click();
180-
cy.get('cx-global-message').contains('Address deleted successfully!');
181-
});
182-
183144
it('should delete payment method', () => {
184145
cy.visit('/my-account/payment-details');
185146
cy.getByText('Delete')

0 commit comments

Comments
 (0)