Skip to content

Commit

Permalink
Merge branch 'v6.2.0' into PWA-1703-6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fkloes committed Feb 15, 2019
2 parents bf80fcb + 871fc9b commit 4cfb506
Show file tree
Hide file tree
Showing 17 changed files with 156 additions and 134 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ coverage
/pipelines/
/trustedPipelines/
/themes/*/extensions/
/themes/*/e2e/
!/extensions/@shopgate-product-reviews
!/extensions/@shopgate-tracking-native
!/extensions/@shopgate-user-privacy
26 changes: 20 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,21 @@ setup-frontend-with-current-ip:
echo '{\n "ip": "$(shell ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | awk '{print $1}')",\n "port": 8080,\n "apiPort": 9666,\n "hmrPort": 3000,\n "remotePort": 8000,\n "sourceMapsType": "cheap-module-eval-source-map"\n}\n' > ./.sgcloud/frontend.json;


# Open cypress UI for GMD theme
e2e-gmd:
cd themes/theme-gmd && yarn run e2e;
cd themes/theme-gmd && yarn run e2e;

# Open cypress UI for IOS theme
e2e-ios11:
cd themes/theme-ios11 && yarn run e2e;
cd themes/theme-ios11 && yarn run e2e;

# Run GMD legacy tests
e2e-gmd-legacy:
npx cypress run -P ./themes/theme-gmd/e2e -s 'themes/theme-gmd/e2e/integration/specFiles/functional/legacy.js'

# Run IOS legacy tests
e2e-ios11-legacy:
npx cypress run -P ./themes/theme-ios11/e2e -s 'themes/theme-ios11/e2e/integration/specFiles/consistency/legacy.js,themes/theme-ios11/e2e/integration/specFiles/functional/legacy.js'

e2e-checkout:
cd themes/theme-gmd && yarn run e2e:checkout;
Expand All @@ -159,10 +169,14 @@ e2e-user:
cd themes/theme-gmd && yarn run e2e:user;

e2e-install:
npm i --no-save --no-package-lock cypress@3.1.1;



npm i --no-save --no-package-lock cypress symlink-dir
# Symlinking support, plugins, fixtures
npx symlink-dir ./utils/e2e/support ./themes/theme-gmd/e2e/cypress/support
npx symlink-dir ./utils/e2e/fixtures ./themes/theme-gmd/e2e/cypress/fixtures
npx symlink-dir ./utils/e2e/plugins ./themes/theme-gmd/e2e/cypress/plugins
npx symlink-dir ./utils/e2e/support ./themes/theme-ios11/e2e/cypress/support
npx symlink-dir ./utils/e2e/fixtures ./themes/theme-ios11/e2e/cypress/fixtures
npx symlink-dir ./utils/e2e/plugins ./themes/theme-ios11/e2e/cypress/plugins

####################################################################################################
# MAKE HELPER WHICH USES THE CORRECT MAKEFILE TO RUN (local or another one predefined by Jenkins)
Expand Down
11 changes: 6 additions & 5 deletions themes/theme-gmd/e2e/cypress.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"integrationFolder": "./integration",
"fixturesFolder": "../../../node_modules/@shopgate/pwa-e2e-test/fixtures",
"pluginsFile": "../../../node_modules/@shopgate/pwa-e2e-test/plugins/",
"supportFile": "../../../node_modules/@shopgate/pwa-e2e-test/support/"
}
"integrationFolder": "./integration",
"fixturesFolder": "./cypress/fixtures",
"pluginsFile": "./cypress/plugins",
"supportFile": "./cypress/support",
"userAgent": "Mozilla/5.0 (Linux; Android 7.0; SM-G892A Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Mobile Safari/537.36"
}
22 changes: 10 additions & 12 deletions themes/theme-gmd/e2e/helper/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ import els from '../elements/de';
/**
* Helper function that clears the Cart
*/
export function clearProductFromCart() {
export function clearProductsFromCart() {
try {
// Delete single product from cart
cy.visit('Cart');
cy.wait(500);
cy.get(els.contextMenu).each(() => {
cy.get(els.contextMenu)
.should('be.visible')
.first()
.click();
cy.get(els.contextMenuButton)
.contains('Entfernen')
.click();
cy.wait(1000);
cy.visit('cart');
cy.get(els.contextMenu).each(($el) => {
cy.window().spyAction('RECEIVE_CART', () => {
cy.wrap($el).should('be.visible').click();
cy.get(els.contextMenuButton)
.contains('Entfernen')
.click();
});
});

// Check for empty cart
cy.get(els.emptyCartPlaceHolderString)
.scrollIntoView()
Expand Down
28 changes: 12 additions & 16 deletions themes/theme-gmd/e2e/integration/consistency/CartPage.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { clearProductFromCart } from '../../helper/cart';
import { clearProductsFromCart } from '../../helper/cart';
import els from '../../elements/de';

describe('AndroidGMDTest CartPage', () => {
after(clearProductsFromCart);

it('it should check for empty cart', () => {
cy.visit('');
cy.get(els.navigatorButton)
.click();
cy.get(els.navDrawerCartButton)
.click();
cy.get(els.emptyCartPlaceHolderString)
.should('be.visible');
cy.get(els.navigatorButton).click();
cy.get(els.navDrawerCartButton).click();
cy.get(els.emptyCartPlaceHolderString).should('be.visible');
});

it('it should check for product in cart', () => {
Expand All @@ -21,11 +20,12 @@ describe('AndroidGMDTest CartPage', () => {
cy.get(els.productWithManyProps4GridViewName)
.last()
.click();
cy.get(els.addToCartButton)
.click();
cy.get(els.cartButton)
.last()
.click();
cy.window().spyAction('RECEIVE_CART', () => {
cy.get(els.addToCartButton).click();
});
cy.window().spyAction('ROUTE_DID_ENTER', () => {
cy.get(els.cartButton).last().click();
});
cy.get(els.cartItem)
.contains('Product with many Properties - 4 -')
.should('be.visible');
Expand Down Expand Up @@ -53,8 +53,4 @@ describe('AndroidGMDTest CartPage', () => {
.contains('* Alle Preise inkl. MwSt. evtl. zzgl. Versand')
.should('be.visible');
});

it('should clear Cart', () => {
clearProductFromCart();
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { clearProductFromCart } from '../../helper/cart';
import { clearProductsFromCart } from '../../helper/cart';
import els from '../../elements/de';

describe('AndroidGMDTest CartPageCoupons', () => {
after(clearProductsFromCart);

it('should add second product to cart', () => {
cy.visit('');
cy.get(els.basicCategory)
Expand Down Expand Up @@ -37,8 +39,4 @@ describe('AndroidGMDTest CartPageCoupons', () => {
cy.get(els.couponSubmitButton)
.should('be.visible');
});

it('should clear Cart', () => {
clearProductFromCart();
});
});
37 changes: 21 additions & 16 deletions themes/theme-gmd/e2e/integration/functional/CartPage.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import els from '../../elements/de';
import { clearProductFromCart } from '../../helper/cart';
import { clearProductsFromCart } from '../../helper/cart';

describe('functional tests cart page', () => {
it.skip('check for increase / decrease quanitity', () => {
after(clearProductsFromCart);

it('check for increase / decrease quanitity', () => {
cy.visit('');

cy.get(els.allProductCategory)
Expand All @@ -21,15 +23,15 @@ describe('functional tests cart page', () => {
cy.get(els.quantityPicker)
.should('be.visible')
.click()
.type(2)
.type('2')
.wait(100)
.focus()
.blur();
cy.get('[data-test-id="minPrice: 0 price: 398 currency: EUR"]')
.should('be.visible');
cy.get(els.quantityPicker)
.clear()
.type(1)
.type('1')
.wait(100)
.focus()
.blur();
Expand Down Expand Up @@ -94,14 +96,21 @@ describe('functional tests cart page', () => {
.should('be.visible')
.click()
.wait(2000);
cy.get(els.size5ShoeSizeVariant)
.should('be.visible')
.last()
.click()
.wait(2000);
cy.get(els.addToCartButton)
.should('be.visible')
.click();

// Wait until variant selection and data received
cy.window().spyAction('RECEIVE_PRODUCT', () => {
cy.get(els.size5ShoeSizeVariant)
.should('be.visible')
.last()
.click();
});

cy.window().spyAction('RECEIVE_CART', () => {
cy.get(els.addToCartButton)
.should('be.visible')
.click();
});

cy.get(els.cartButtonProductPage)
.last()
.should('be.visible')
Expand All @@ -110,8 +119,4 @@ describe('functional tests cart page', () => {
cy.get(els.productWithChild1ColorBlackSize5CartItem)
.should('be.visible');
});

it('should check for delete product from cart', () => {
clearProductFromCart();
});
});
8 changes: 3 additions & 5 deletions themes/theme-gmd/e2e/integration/functional/CartPageCoupon.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import els from '../../elements/de';
import { clearProductFromCart } from '../../helper/cart';
import { clearProductsFromCart } from '../../helper/cart';
import { checkForWrongCoupon } from '../../helper/coupon';

describe('functional tests cart page', () => {
after(clearProductsFromCart);

it('should add second product to cart', () => {
cy.visit('');
cy.get(els.basicCategory)
Expand Down Expand Up @@ -51,8 +53,4 @@ describe('functional tests cart page', () => {
cy.get(els.deleteCouponButton)
.should('not.exist');
});

it('should check for delete product from cart', () => {
clearProductFromCart();
});
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import els from '../../elements/de';

import { clearProductFromCart } from '../../helper/cart';
import { clearProductsFromCart } from '../../helper/cart';

describe('functional test cart page options', () => {
after(clearProductsFromCart);

it('should check for product with options', () => {
cy.visit('');

Expand Down Expand Up @@ -34,8 +36,4 @@ describe('functional test cart page options', () => {
.contains('bright')
.should('be.visible');
});

it('should clear cart', () => {
clearProductFromCart();
});
});
5 changes: 1 addition & 4 deletions themes/theme-gmd/e2e/integration/functional/CategoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ describe('functional tests category page', () => {

it('check for sorting reset', () => {
cy.go('back');
cy.get(els.allProductCategory).first()
.should('be.visible')
.click();
cy.get("[data-test-id='sorting'] [data-test-id='filter.sort.most_popular']")
cy.get(els.shopLogo)
.should('be.visible');
});
});
Expand Down
52 changes: 28 additions & 24 deletions themes/theme-gmd/e2e/integration/functional/FavoritesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ describe('e2e functional test favoritePage', () => {
.should('be.visible')
.last()
.click();
cy.get(els.favoriteButtonProductPage)
.should('be.visible')
.last()
.click();
cy.go('back');
cy.go('back');
cy.go('back');
cy.window().spyAction('RECEIVE_FAVORITES', () => {
cy.get(els.favoriteButtonProductPage)
.should('be.visible')
.last()
.click();
});
cy.get(els.navigatorButton)
.first()
.should('be.visible')
.click()
.wait(1000);
cy.get(els.navDrawerFavoritesButton)
.should('be.visible')
.click();
.wait(200);

cy.window().spyAction('ROUTE_DID_ENTER', () => {
cy.get(els.navDrawerFavoritesButton)
.should('be.visible')
.click();
});
cy.get(els.addToCartButton)
.should('be.visible')
.click();
Expand All @@ -40,31 +42,33 @@ describe('e2e functional test favoritePage', () => {
.contains('Abbrechen')
.should('be.visible')
.click();
cy.wait(3000);
cy.get(els.addToCartButton)
.click();

cy.wait(500);

cy.get(els.addToCartButton).click();
cy.get(els.basicDialogText)
.contains('Um dieses Produkt zum Warenkorb hinzuzufügen, wählen Sie bitte die Varianten.')
.should('be.visible');
cy.get(els.basicDialogOkButton)
.contains('Varianten wählen')
.click();

cy.window().spyAction('ROUTE_DID_ENTER', () => {
cy.get(els.basicDialogOkButton)
.contains('Varianten wählen')
.click();
});
cy.get(els.variantPickerColor)
.contains('Color auswählen')
.should('be.visible');
cy.get(els.variantPickerShoeSize)
.contains('Shoe size auswählen')
.should('be.visible');
cy.reload()
.wait(3000);
cy.get(els.favoriteButtonProductPage)
.click()
.wait(1000);

cy.window().spyAction('RECEIVE_FAVORITES', () => {
cy.get(els.favoriteButtonProductPage).click();
});
});

it('should check for empty fav list', () => {
cy.visit('/favourite_list');
cy.get(els.favoritesPageEmptyFavComponent)
.should('be.visible');
cy.get(els.favoritesPageEmptyFavComponent).should('be.visible');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ describe('e2e functional test favoritePage', () => {
.should('be.visible')
.last()
.click();
cy.go('back');
cy.go('back');
cy.get(els.navigatorButton)
.should('be.visible')
.click()
.wait(1000);
cy.get(els.navDrawerFavoritesButton)
.should('be.visible')
.click();
cy.get(els.favoriteButtonFavList)
.should('be.visible')
.last()
.click()
.wait(4000);

cy.window().spyAction('RECEIVE_FAVORITES', () => {
cy.get(els.favoriteButtonFavList)
.should('be.visible')
.last()
.click();
});
});

it('should check for empty fav list', () => {
Expand Down
Loading

0 comments on commit 4cfb506

Please sign in to comment.