|
1 | 1 | import { product } from '../../sample-data/checkout-flow';
|
2 | 2 |
|
3 | 3 | context('Check login', () => {
|
| 4 | + const testUser = 'test-user-cypress@ydev.hybris.com'; |
| 5 | + |
4 | 6 | before(() => {
|
5 | 7 | cy.window().then(win => win.sessionStorage.clear());
|
6 |
| - cy.login('test-user-cypress@ydev.hybris.com', 'Password123.'); |
| 8 | + cy.login(testUser, 'Password123.'); |
7 | 9 | cy.visit('/');
|
8 | 10 | });
|
9 | 11 |
|
10 | 12 | it('should login successfully', () => {
|
11 | 13 | cy.get('.cx-login-greet').should('contain', 'Test User');
|
12 | 14 | });
|
13 | 15 |
|
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 |
| - |
45 | 16 | it('should go to product page from category page', () => {
|
46 |
| - // click big banner |
47 | 17 | cy.get('.Section1 cx-responsive-banner')
|
48 | 18 | .first()
|
49 | 19 | .find('img')
|
@@ -74,7 +44,7 @@ context('Check login', () => {
|
74 | 44 | method: 'POST',
|
75 | 45 | url: `${Cypress.env(
|
76 | 46 | '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`, |
78 | 48 | headers: {
|
79 | 49 | Authorization: `bearer ${
|
80 | 50 | JSON.parse(sessionStorage.getItem('auth')).userToken.token[
|
@@ -171,15 +141,6 @@ context('Check login', () => {
|
171 | 141 | cy.get('cx-order-summary .cx-summary-amount').should('not.be.empty');
|
172 | 142 | });
|
173 | 143 |
|
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 |
| - |
183 | 144 | it('should delete payment method', () => {
|
184 | 145 | cy.visit('/my-account/payment-details');
|
185 | 146 | cy.getByText('Delete')
|
|
0 commit comments