Skip to content

Commit

Permalink
Fix login and logout
Browse files Browse the repository at this point in the history
According to cypress-io/cypress#8037, all session storage is cleared after each test. So we definitely need to login every time again.
  • Loading branch information
norgeindian authored Oct 12, 2023
1 parent f0d1519 commit 6ab16ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cypress/integration/luma/user/account.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ describe('Account test creation', () => {

describe('Account activities', () => {
beforeEach(() => {
cy.wait(2500)
Account.login(account.customer.customer.email, account.customer.password)
})

before(() => {
cy.wait(2500)
Magento2RestApi.createCustomerAccount(account.customer)
Account.login(account.customer.customer.email, account.customer.password)
Account.createAddress(account.customerInfo)
Account.logout()
})

after(() => {
Expand Down Expand Up @@ -135,7 +136,6 @@ describe('Account activities', () => {
})

it('Can remove an address', () => {
Account.login(account.customer.customer.email, account.customer.password)
Account.createAddress(account.customerInfo)
cy.visit(account.routes.accountAddresses)
cy.wait(4000)
Expand All @@ -147,7 +147,6 @@ describe('Account activities', () => {
})

it('Can change the newsletter subscription', () => {
Account.login(account.customer.customer.email, account.customer.password)
cy.visit(account.routes.manageNewsletter)
cy.contains('General Subscription')
cy.get('#subscription').should('be.checked')
Expand Down

0 comments on commit 6ab16ec

Please sign in to comment.