Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cypress/integration/add-to-cart.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('add to cart', () => {
it('verify that the configurable product is added to cart', () => {
cy.visit('/p/WS01/gwyn-endurance-tee-1577/WS01')
indexedDB.deleteDatabase('shop')
indexedDB.deleteDatabase('carts')
cy.clearLocalStorage()
cy.get('[aria-label="Select color Green"]').click()
cy.get('[aria-label="Select color Green"]').click()
cy.get('[aria-label="Select size L"]').click()
Expand All @@ -16,9 +13,6 @@ describe('add to cart', () => {

it('verify that the bundle product is added to cart', () => {
cy.visit('/p/24-WG080/sprite-yoga-companion-kit-45')
indexedDB.deleteDatabase('shop')
indexedDB.deleteDatabase('carts')
cy.clearLocalStorage()
cy.get('#bundleOption_2').click({ force: true })
cy.get('#bundleOptionQty_1').clear().type('2')
cy.get('#bundleOption_6').click({ force: true })
Expand Down
16 changes: 16 additions & 0 deletions cypress/integration/add-to-compare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
describe('add to compare', () => {
it('Two products should be added to comparison table', () => {
cy.visit('/c/jackets-23')
cy.get(':nth-child(1) > .product > .no-underline > .product-image > img').click()
cy.get('.py40 > :nth-child(2) > .p0').click()
cy.scrollTo(0, 0)
cy.get('.row > .middle-xs > div > .inline-flex').click()
cy.wait(500)
cy.get(':nth-child(2) > .product > .no-underline > .product-image > img').click()
cy.get('.py40 > :nth-child(2) > .p0').click()
cy.scrollTo(0, 0)
cy.get('.compare-icon').click()
cy.get(':nth-child(1) > .compare__top-info')
cy.get(':nth-child(2) > .compare__top-info')
})
})
3 changes: 0 additions & 3 deletions cypress/integration/basic-client-path.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('basic client path', () => {
it('should go through basic user flow', () => {
cy.visit('/')
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=productLink]').eq(7).click()
cy.get('[data-testid=addToCart]').click()
cy.get('[data-testid=notificationAction2]').click()
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/category-page.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('Category page', () => {
it('verification of filters in the Women category', () => {
cy.visit('/')
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=menuButton]').click()
cy.get('[data-testid=categoryButton]').contains('Women').click()
cy.get('[data-testid=categoryLink][href="/c/women-20"]').click()
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/checkout-page.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('checkout page', () => {
it('Default shipping/billing address should be changed', () => {
cy.visit('/')
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=accountButton]').click()
cy.get('[name=email]').type('logintest@user.co')
cy.get('[name=password]').type('123qwe!@#')
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/home-page.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('home page', () => {
it('verify the content of the homepage', () => {
cy.visit('/')
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=mainSliderTitle]').first().contains('Luma Yoga')
cy.get('.VueCarousel-dot-button').eq(1).click()
cy.get('[data-testid=mainSliderTitle]').eq(1).contains('Luma Fitness')
Expand Down
5 changes: 1 addition & 4 deletions cypress/integration/local-storage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('local-storage', () => {
it('Items added to the cart should be kept.', () => {
cy.visit('p/WS11/diva-gym-tee-1545/WS11')
indexedDB.deleteDatabase('shop')
indexedDB.deleteDatabase('carts')
cy.clearLocalStorage()
cy.get('[aria-label="Select color Yellow"]').click().should('have.class', 'active')
cy.get('[aria-label="Select size S"]').click()
cy.get('[data-testid=variantsLabel]').first().contains('Yellow')
Expand All @@ -19,7 +16,7 @@ describe('local-storage', () => {
cy.get('[data-testid=productSku]').contains('WS11-S-Yellow')
cy.get('[data-testid=productQty]').contains('1')
cy.get('[data-testid=editButton').click()
cy.get('[data-testid=productQtyInput]').clear().type('2').blur()
cy.get('[data-testid=productQtyInput]').clear().type(2).blur()
cy.get('.summary').click()
cy.wait(500)
cy.reload()
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/login-path.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('login path', () => {
it('should login user', () => {
cy.visit('/')
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=accountButton]').click()
cy.get('[name=email]').type('test@test.com')
cy.get('[name=password]').type('Password123')
Expand Down
2 changes: 0 additions & 2 deletions cypress/integration/product-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
describe('product page', () => {
it('should verify that all information are visible', () => {
cy.visit('/p/WS01/gwyn-endurance-tee-1577/WS01')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=productName]').contains('Gwyn Endurance Tee')
cy.get('[data-testid=productGalleryImage]').first().should(
'have.attr',
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/register-path.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('register path', () => {
it('should register user', () => {
cy.visit('/')
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=accountButton]').click()
cy.get('[data-testid=registerLink]').click()
cy.get('[name=email]').type('test@test.com')
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/search-results.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
describe('Search results', () => {
it('verification of the search results', () => {
cy.visit('/')
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
cy.clearLocalStorage()
cy.get('[data-testid=openSearchPanel]').first().should('not.be.visible')
cy.get('[data-testid=openSearchPanel]').last().click()
cy.get('#search').should('be.visible').type('Didi Sport Watch')
Expand Down
8 changes: 8 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ before(() => {
);
})
})

beforeEach(() => {
cy.setCookie('shop/claims/onboardingAccepted', 'test')
indexedDB.deleteDatabase('shop')
indexedDB.deleteDatabase('carts')
cy.clearLocalStorage()
})