@jetshop/template-trend 5.9.0 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.linaria-cache/packages/template-trend/src/components/Auth/LogInPage.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/Address.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/CustomerType.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/LoginFields.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/SignUpPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Auth/UI/Form.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Cart/CartButton.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Cart/CartFlyout.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/Cart/CartItem.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/Cart/FreeShipping.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/CategoryHeader.linaria.css +8 -8
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/ActiveFilters.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Filter.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/FilterDrawer.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/FilterDropdownMenu.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/ActiveCarot.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/FilterButton.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/ListAccordion.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/shared/styles.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/RangeFilters.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductCard.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductGrid.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductGridWindow.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/StandardCategoryPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/WindowedCategoryPage.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ContentPage/ContentPage.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/CookieConsent.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Forms/GlobalError.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Forms/Input.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/Forms/InputStatus.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/Forms/Success.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Container.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Content/index.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Footer/Footer.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/Layout/Footer/SocialLinks.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Categories/MobileCategories.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/CategoryMenu.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/CategoryMenuContainer.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/SubMenuSection.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/SubMenuWrapper.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/ChannelSelector.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/ChannelSelectorModal.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/Selector.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Header.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Logo.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/LogoSearchBar.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/MobileMenu.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/RecommendedChannel/ChannelBanner.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/RecommendedChannel/RecommendedChannelSelector.linaria.css +9 -9
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/SearchBar.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/SearchButton.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/TopNav.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/MaxWidth.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Notifications.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/LoadingPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/CustomerNameHeader.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/DeleteAccount.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPages.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPagesSidebar.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPagesStartPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/ListOrder.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/ListDetail.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/OrderTotals.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/ShippingPayment.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderListPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/ProfileDeliveryAddresses.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/ProfilePage.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/NavigationTree/NavTree.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Newsletter/NewsletterField.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/NotFoundPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Pagination/Pagination.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductList/AddToCart.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductList/Favourite.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductList/Favourites.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductList/Product.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/AddToCart/AddToCartForm.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/AddToCart/ProductToast.linaria.css +9 -9
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/Campaigns.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ConfigurationSelector.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/Images/ImageContainer.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/IncludedInPackages.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/PackageProduct.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/PackageProductItem.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductInfo.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductInfoAccordion.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductPageLoadingState.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/RelatedProducts.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/NotifyWhenBack.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/StockOrb.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/StockStatusIndicator.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/WarehouseStock.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/VariantSelector.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/styledComponents.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/CategoryList.linaria.css +7 -0
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchMeta.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchPage.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchResults.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchTerm.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/WindowedSearchResults.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/StartPage/CategoryList.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/Row.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageCampaign.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageCategories.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageHTMLContent.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageHero.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageProductGrid.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/StartPage/StartPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Store/Store.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreList.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreLocator.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreMap.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreMarker.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreSearch.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/UserLocation.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ui/Badge.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ui/Button.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ui/CloseButton.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ui/Headings.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ui/Spinner.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Breadcrumbs/Breadcrumbs.linaria.css +2 -2
- package/.linaria-cache/packages/ui/Button/Button.linaria.css +2 -2
- package/.linaria-cache/packages/ui/Button/SecondaryButton.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Button/TrendButton.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ChannelSelector/ChannelSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ChannelSelector/ChannelSelectorButtons.linaria.css +2 -2
- package/.linaria-cache/packages/ui/ChannelSelector/LargeSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ChannelSelector/MiniSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Checkbox/Checkbox.linaria.css +4 -4
- package/.linaria-cache/packages/ui/Checkbox/CheckboxGroup.linaria.css +2 -2
- package/.linaria-cache/packages/ui/DropdownMenu/DropdownMenu.linaria.css +2 -2
- package/.linaria-cache/packages/ui/ErrorBoundary/Generic.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Gallery/Gallery.linaria.css +2 -2
- package/.linaria-cache/packages/ui/JetshopText.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Loading/LoadingBar.linaria.css +2 -2
- package/.linaria-cache/packages/ui/Modal/Drawer/Drawer.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Modal/ModalRoot.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Modal/TargetWrapper.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Pagination/Pagination.linaria.css +1 -1
- package/.linaria-cache/packages/ui/PreOrderDateSelector/PreOrderDateSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Price/Price.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ProductList/Badges.linaria.css +7 -7
- package/.linaria-cache/packages/ui/ProductSpecifications/ProductSpecifications.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Search/SearchField.linaria.css +5 -5
- package/.linaria-cache/packages/ui/Search/SearchPage/SearchMeta.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Select/Components.linaria.css +8 -8
- package/cypress/integration/essentials.spec.js +50 -0
- package/package.json +5 -5
- package/schema.graphql +1 -0
- package/src/components/CategoryPage/Filters/ListFilters.js +1 -2
- package/src/components/CategoryPage/WindowedCategoryPage.js +6 -5
- package/src/components/Forms/Input.js +3 -6
- package/src/components/Layout/Header/RecommendedChannel/RecommendedChannelSelector.js +1 -1
- package/src/components/Layout/Header/TopNav.js +13 -11
- package/src/components/MyPages/MyPagesSidebar.js +0 -1
- package/src/components/ProductPage/AddToCart/ProductToast.js +1 -1
- package/src/components/StartPage/Content/Row.js +0 -37
- package/cypress/constants.js +0 -5
- package/cypress/integration/addToCart/addToCart.spec.js +0 -27
- package/cypress/integration/addToCart/disabledVariations.spec.js +0 -17
- package/cypress/integration/addToCart/newslettersubscriber.spec.js +0 -24
- package/cypress/integration/addToCart/notifyWhenBackInStock.spec.js +0 -20
- package/cypress/integration/addToCart/productConfigurations.spec.js +0 -35
- package/cypress/integration/addToCart/productVariations.spec.js +0 -42
- package/cypress/integration/addToCart/sizePriceChange.spec.js +0 -20
- package/cypress/integration/analytics/gtag.spec.js +0 -87
- package/cypress/integration/analytics/releware.spec.js +0 -95
- package/cypress/integration/auth/login.spec.js +0 -18
- package/cypress/integration/auth/signup.spec.js +0 -98
- package/cypress/integration/category_page_spec.js +0 -73
- package/cypress/integration/filters.spec.js +0 -103
- package/cypress/integration/getbyarticlenumber.spec.js +0 -28
- package/cypress/integration/packages.spec.js +0 -85
- package/cypress/integration/prefetch_headers_spec.js +0 -26
- package/cypress/integration/product_browsing_spec.js +0 -17
- package/cypress/integration/search/autocomplete.spec.js +0 -28
- package/cypress/integration/search/search_page.spec.js +0 -39
- package/cypress/integration/ssr/categorySSR.js +0 -9
- package/cypress/integration/ssr/productSSR.js +0 -9
- package/cypress/integration/ssr/startPageSSR.js +0 -5
- package/cypress/integration/start_page_spec.js +0 -5
- package/cypress/integration/stores_page.spec.js +0 -5
|
@@ -2,9 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import MaxWidth from '../../Layout/MaxWidth';
|
|
3
3
|
import { styled } from 'linaria/react';
|
|
4
4
|
import { theme } from '../../Theme';
|
|
5
|
-
import { ReactComponent as Caret } from '@jetshop/ui/svg/Carrot.svg';
|
|
6
|
-
import { Above } from '@jetshop/ui/Breakpoints';
|
|
7
|
-
import { useAnimation, swipeEffect } from '@jetshop/ui/hooks';
|
|
8
5
|
|
|
9
6
|
const Container = styled('div')`
|
|
10
7
|
position: relative;
|
|
@@ -37,40 +34,6 @@ const ItemsContainer = styled('div')`
|
|
|
37
34
|
}
|
|
38
35
|
`;
|
|
39
36
|
|
|
40
|
-
const Button = styled('button')`
|
|
41
|
-
position: absolute;
|
|
42
|
-
font-family: initial;
|
|
43
|
-
margin: 0 10px;
|
|
44
|
-
top: 50%;
|
|
45
|
-
transform: translateY(-50%);
|
|
46
|
-
z-index: 2;
|
|
47
|
-
width: 40px;
|
|
48
|
-
height: 40px;
|
|
49
|
-
border-radius: 50%;
|
|
50
|
-
background: rgba(255, 255, 255, 0.2);
|
|
51
|
-
|
|
52
|
-
&:focus,
|
|
53
|
-
&:active {
|
|
54
|
-
outline: none;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
background: rgba(255, 255, 255, 0.6);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&.left svg {
|
|
62
|
-
transform: rotateZ(90deg);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.right {
|
|
66
|
-
right: 0;
|
|
67
|
-
|
|
68
|
-
svg {
|
|
69
|
-
transform: rotateZ(-90deg);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
37
|
const Row = ({ header, children }) => {
|
|
75
38
|
return (
|
|
76
39
|
<MaxWidth>
|
package/cypress/constants.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const PRODUCT_URL = 'se/accessories/watches/watch-classic-504';
|
|
2
|
-
export const OUT_OF_STOCK_PRODUCT_URL = 'se/preview?articlenumber=224733';
|
|
3
|
-
export const CATEGORY_URL = 'se/accessories/watches';
|
|
4
|
-
export const ARTICLENUMBER_URL = 'se/articlenumber/6952315';
|
|
5
|
-
export const US_ARTICLENUMBER_URL = 'int/articlenumber/6952315';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { PRODUCT_URL, OUT_OF_STOCK_PRODUCT_URL } from '../../constants';
|
|
2
|
-
|
|
3
|
-
describe('Add to cart tests', () => {
|
|
4
|
-
it('Will add add a basic product to the cart', () => {
|
|
5
|
-
cy.visit(PRODUCT_URL);
|
|
6
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
7
|
-
cy.get('[data-testid="product-toast"]').should('exist');
|
|
8
|
-
cy.get('[data-testid="cart-button"]').click();
|
|
9
|
-
cy.get('[data-testid="item-name"]').should('not.be.empty');
|
|
10
|
-
cy.get('[data-testid="increment-quantity"]').click();
|
|
11
|
-
cy.get('[data-testid="item-quantity"]').should('contain', 2);
|
|
12
|
-
cy.get('[data-testid="remove-from-cart"]').click();
|
|
13
|
-
cy.get('[data-testid="item-name"]').should('not.exist');
|
|
14
|
-
});
|
|
15
|
-
it('Add to cart button is disabled if product is out of stock', () => {
|
|
16
|
-
cy.visit(OUT_OF_STOCK_PRODUCT_URL);
|
|
17
|
-
cy.get('button[data-testid="add-to-cart"]').should('be.disabled');
|
|
18
|
-
});
|
|
19
|
-
it('Checkout button is linked to the checkout', () => {
|
|
20
|
-
cy.visit(PRODUCT_URL);
|
|
21
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
22
|
-
cy.get('button[data-testid="cart-button"]').click();
|
|
23
|
-
cy.get('[data-testid="checkout-button"]')
|
|
24
|
-
.should('have.attr', 'href')
|
|
25
|
-
.and('include', 'externalcheckout');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const PRODUCT_WITH_INVALID_VARIATIONS_URL = '/furniture/toldbod-pendant';
|
|
2
|
-
describe('Disabled variations', () => {
|
|
3
|
-
it('Will add a product with attributes if they have been selected', () => {
|
|
4
|
-
cy.visit(PRODUCT_WITH_INVALID_VARIATIONS_URL);
|
|
5
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
6
|
-
cy.get('[data-testid="product-toast"]').should('not.exist');
|
|
7
|
-
cy.findByText('Ø 250').click();
|
|
8
|
-
cy.get('#option-Color').click();
|
|
9
|
-
cy.findByText('White', { selector: 'li[role=menuitem]' }).click();
|
|
10
|
-
cy.get('button[data-testid="add-to-cart"]').should('be.disabled');
|
|
11
|
-
cy.get('#option-Color').click();
|
|
12
|
-
cy.findByText('Black', { selector: 'li[role=menuitem]' }).click();
|
|
13
|
-
cy.findByText('Ø 250').click();
|
|
14
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
15
|
-
cy.get('[data-testid="product-toast"]').should('exist');
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
describe('Notify when back test', () => {
|
|
2
|
-
it('Subscribes to newsletter with a random email', () => {
|
|
3
|
-
cy.visit('/');
|
|
4
|
-
cy.get(
|
|
5
|
-
'[data-testid="newsletter-subscription-input"]'
|
|
6
|
-
).type('edgardavids@glasses.com', { force: true });
|
|
7
|
-
cy.get('button[data-testid="newsletter-subscription-submit"]').click();
|
|
8
|
-
cy.get('p[data-testid="newsletter-subscription-success"]').should(
|
|
9
|
-
'contain',
|
|
10
|
-
'You are now subscribed'
|
|
11
|
-
);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('Cannot subscribe with an invalid email', () => {
|
|
15
|
-
cy.visit('/');
|
|
16
|
-
cy.get(
|
|
17
|
-
'[data-testid="newsletter-subscription-input"]'
|
|
18
|
-
).type('edgardavids.com', { force: true });
|
|
19
|
-
cy.get('button[data-testid="newsletter-subscription-submit"]').click();
|
|
20
|
-
cy.get('p[data-testid="newsletter-subscription-success"]').should(
|
|
21
|
-
'not.exist'
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const PRODUCT_URL = 'accessories/glasses-black';
|
|
2
|
-
|
|
3
|
-
describe('Notify when back test', () => {
|
|
4
|
-
it('Will fill out notify when back with a test email', () => {
|
|
5
|
-
cy.visit(PRODUCT_URL);
|
|
6
|
-
cy.get('button[data-testid="add-to-cart"]').should('not.exist');
|
|
7
|
-
cy.get('button[data-testid="notify-when-back-button"]').click();
|
|
8
|
-
cy.get('input[data-testid="notify-when-back-input"]').type(
|
|
9
|
-
'test@example.com',
|
|
10
|
-
{
|
|
11
|
-
force: true
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
cy.get('button[data-testid="notify-when-back-ok"]').click({ force: true });
|
|
15
|
-
cy.get('p[data-testid="notify-when-back-success"]').should(
|
|
16
|
-
'contain',
|
|
17
|
-
'You are now subscribed'
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const PRODUCT_URL = 'furniture/black-leather-sofa';
|
|
2
|
-
|
|
3
|
-
describe('Add to cart product configuration tests', () => {
|
|
4
|
-
it('Will add add a product with configurations', () => {
|
|
5
|
-
cy.visit(PRODUCT_URL);
|
|
6
|
-
|
|
7
|
-
cy.get('.price').should('contain', '420');
|
|
8
|
-
|
|
9
|
-
cy.get('#option-Head').click();
|
|
10
|
-
cy.findAllByRole('menuitem', { name: 'putter' }).click();
|
|
11
|
-
cy.get('#option-Head').should('contain', 'putter');
|
|
12
|
-
|
|
13
|
-
cy.get('.price').should('contain', '370');
|
|
14
|
-
|
|
15
|
-
cy.get('#option-stick').click();
|
|
16
|
-
cy.findAllByRole('menuitem', { name: 'shiny' }).click();
|
|
17
|
-
cy.get('#option-stick').should('contain', 'shiny');
|
|
18
|
-
|
|
19
|
-
cy.get('.price').should('contain', '470');
|
|
20
|
-
|
|
21
|
-
cy.get('#option-grip').click();
|
|
22
|
-
cy.findAllByRole('menuitem', { name: 'plastic' }).click();
|
|
23
|
-
cy.get('#option-grip').should('contain', 'plastic');
|
|
24
|
-
|
|
25
|
-
cy.get('.price').should('contain', '455');
|
|
26
|
-
|
|
27
|
-
cy.findByRole('button', { name: /add to cart/i }).click();
|
|
28
|
-
|
|
29
|
-
cy.get('[data-testid="product-toast"]').should('exist');
|
|
30
|
-
cy.get('[data-testid="cart-button"]').click();
|
|
31
|
-
cy.get('[data-testid="item-name"]').should('not.be.empty');
|
|
32
|
-
cy.get('[data-testid="item-price"]').should('contain', '455');
|
|
33
|
-
cy.get('[data-testid="cart-button"]').click();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const PRODUCT_WITH_VARIATIONS_URL = 'furniture/armchair-lord';
|
|
2
|
-
|
|
3
|
-
describe('Product variants', () => {
|
|
4
|
-
it('can be successfully selected and added to cart', () => {
|
|
5
|
-
cy.visit(PRODUCT_WITH_VARIATIONS_URL);
|
|
6
|
-
|
|
7
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
8
|
-
cy.get('[data-testid="product-toast"]').should('not.exist');
|
|
9
|
-
cy.findByText('Small').click();
|
|
10
|
-
cy.findByText('JA').click();
|
|
11
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
12
|
-
cy.get('[data-testid="product-toast"]').should('not.exist');
|
|
13
|
-
cy.get('input[data-testid="Skriv in ditt önskade tryck här-input"]').type(
|
|
14
|
-
'Hello, World'
|
|
15
|
-
);
|
|
16
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
17
|
-
cy.get('[data-testid="product-toast"]').should('exist');
|
|
18
|
-
cy.get('[data-testid="cart-button"]').click();
|
|
19
|
-
cy.get('[data-testid="item-name"]').should('not.be.empty');
|
|
20
|
-
cy.get('[data-testid="increment-quantity"]').click();
|
|
21
|
-
cy.get('[data-testid="item-quantity"]').should('contain', 2);
|
|
22
|
-
cy.get('[data-testid="remove-from-cart"]').click();
|
|
23
|
-
cy.get('[data-testid="item-name"]').should('not.exist');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('Preselection', () => {
|
|
27
|
-
it('preselects variant when included in the url', () => {
|
|
28
|
-
cy.visit('accessories/belts/belt-light?att=Mzg=');
|
|
29
|
-
cy.get('[aria-pressed="true"]').should('contain', '38');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('preselects the cheapest variant by default', () => {
|
|
33
|
-
cy.visit('accessories/belts/belt-light');
|
|
34
|
-
cy.get('[aria-pressed="true"]').should('contain', '37');
|
|
35
|
-
|
|
36
|
-
cy.visit('/furniture/aj-floor-lamp');
|
|
37
|
-
cy.get('[aria-pressed="true"]')
|
|
38
|
-
.should('contain', 'Black')
|
|
39
|
-
.should('contain', '140');
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const PRODUCT_URL = 'accessories/belt-light';
|
|
2
|
-
|
|
3
|
-
describe('Produce price', () => {
|
|
4
|
-
it('changes when variant is changed', () => {
|
|
5
|
-
cy.visit(PRODUCT_URL);
|
|
6
|
-
cy.get('.new-price').should('contain', '499');
|
|
7
|
-
cy.findByText('36').click();
|
|
8
|
-
cy.get('.new-price').should('contain', '563');
|
|
9
|
-
cy.findByText('38').click();
|
|
10
|
-
cy.get('.new-price').should('contain', '500');
|
|
11
|
-
cy.get('button[data-testid="add-to-cart"]').click();
|
|
12
|
-
cy.get('[data-testid="product-toast"]').should('exist');
|
|
13
|
-
cy.get('[data-testid="cart-button"]').click();
|
|
14
|
-
cy.get('[data-testid="item-name"]').should('not.be.empty');
|
|
15
|
-
cy.get('.price')
|
|
16
|
-
.first()
|
|
17
|
-
.should('contain', '500');
|
|
18
|
-
cy.get('[data-testid="cart-button"]').click();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { callsTo } from '../../support/dataLayer';
|
|
2
|
-
import { PRODUCT_URL, CATEGORY_URL } from '../../constants';
|
|
3
|
-
const eventMatcher = eventName => [
|
|
4
|
-
function eventMatcher(calls) {
|
|
5
|
-
return calls.find(call => call[0] === 'event' && call[1] === eventName);
|
|
6
|
-
},
|
|
7
|
-
`Event ${eventName} is pushed to dataLayer`
|
|
8
|
-
];
|
|
9
|
-
|
|
10
|
-
const pageviewMatcher = path => [
|
|
11
|
-
function pageviewMatcher(calls) {
|
|
12
|
-
const pageViewCall = calls.find(
|
|
13
|
-
call => call[0] === 'event' && call[1] === 'page_view'
|
|
14
|
-
);
|
|
15
|
-
return pageViewCall.length > 0;
|
|
16
|
-
},
|
|
17
|
-
`Page View for "${path}" is pushed to dataLayer`
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
describe('Analytics: GTAG – Google Analytics', () => {
|
|
21
|
-
it('Start Page: Should trigger view events', () => {
|
|
22
|
-
cy.visit('/');
|
|
23
|
-
cy.get('@gtm_dataLayer_push').should(push => {
|
|
24
|
-
expect(callsTo(push)).to.satisfy(...eventMatcher('view_item_list'));
|
|
25
|
-
expect(callsTo(push)).to.satisfy(...pageviewMatcher('/'));
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('Category Page: Should trigger view events', () => {
|
|
30
|
-
cy.visit(CATEGORY_URL);
|
|
31
|
-
cy.get('@gtm_dataLayer_push').should(push => {
|
|
32
|
-
expect(callsTo(push)).to.satisfy(...eventMatcher('view_item_list'));
|
|
33
|
-
expect(callsTo(push)).to.satisfy(...pageviewMatcher(CATEGORY_URL));
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('Category Page: Should trigger click events', () => {
|
|
38
|
-
cy.visit(CATEGORY_URL);
|
|
39
|
-
|
|
40
|
-
cy.findAllByTestId('product').first().click();
|
|
41
|
-
|
|
42
|
-
cy.get('@gtm_dataLayer_push').should(push => {
|
|
43
|
-
expect(callsTo(push)).to.satisfy(...eventMatcher('select_content'));
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('Product Page: Should trigger view events', () => {
|
|
48
|
-
cy.visit(PRODUCT_URL);
|
|
49
|
-
cy.get('@gtm_dataLayer_push').should(push => {
|
|
50
|
-
expect(callsTo(push)).to.satisfy(...eventMatcher('view_item'));
|
|
51
|
-
expect(callsTo(push)).to.satisfy(...pageviewMatcher(PRODUCT_URL));
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('Product Page: Should trigger cart events', () => {
|
|
56
|
-
cy.visit(PRODUCT_URL);
|
|
57
|
-
|
|
58
|
-
// Add to cart
|
|
59
|
-
cy.findByTestId('add-to-cart').click({ force: true });
|
|
60
|
-
cy.get('@gtm_dataLayer_push').should(push => {
|
|
61
|
-
expect(callsTo(push)).to.satisfy(...eventMatcher('add_to_cart'));
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// Remove from to cart
|
|
65
|
-
cy.findByTestId('cart-button').click({ force: true });
|
|
66
|
-
cy.findByTestId('remove-from-cart').first().click();
|
|
67
|
-
cy.get('@gtm_dataLayer_push').should(push => {
|
|
68
|
-
expect(callsTo(push)).to.satisfy(...eventMatcher('remove_from_cart'));
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('Product Page: Attribute click events to the appropriate list and apppropriate currency', () => {
|
|
73
|
-
cy.visit(CATEGORY_URL);
|
|
74
|
-
|
|
75
|
-
cy.findAllByTestId('product').first().click();
|
|
76
|
-
|
|
77
|
-
cy.findByTestId('add-to-cart').click({ force: true });
|
|
78
|
-
cy.get('@gtm_dataLayer_push').should(push => {
|
|
79
|
-
const addToCartEvent = callsTo(push).find(
|
|
80
|
-
ev => Array.isArray(ev) && ev[1] === 'add_to_cart'
|
|
81
|
-
);
|
|
82
|
-
expect(addToCartEvent[2].currency).to.equal('SEK');
|
|
83
|
-
expect(addToCartEvent[2].items[0].list_name).to.equal('Watches');
|
|
84
|
-
expect(callsTo(push)).to.satisfy(...eventMatcher('add_to_cart'));
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { PRODUCT_URL } from '../../constants';
|
|
2
|
-
|
|
3
|
-
// const BASE_EVENT = {
|
|
4
|
-
// itemId: '155',
|
|
5
|
-
// accountId: 'jetshop',
|
|
6
|
-
// siteId: 'localhost'
|
|
7
|
-
// };
|
|
8
|
-
|
|
9
|
-
function getRelewareCalls(spy) {
|
|
10
|
-
return spy
|
|
11
|
-
.getCalls()
|
|
12
|
-
.filter(call => call.args[0].indexOf('log.releware.net') > -1)
|
|
13
|
-
.map(call => {
|
|
14
|
-
const query = new URL(call.args[0]).searchParams;
|
|
15
|
-
return {
|
|
16
|
-
itemId: query.get('_item_id'),
|
|
17
|
-
accountId: query.get('aid'),
|
|
18
|
-
event: query.get('o'),
|
|
19
|
-
siteId: query.get('sid')
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
describe('Analytics: Releware', () => {
|
|
25
|
-
beforeEach(function() {
|
|
26
|
-
// Stub window.fetch before any app code runs
|
|
27
|
-
cy.on('window:before:load', win => {
|
|
28
|
-
const doFetch = win.fetch;
|
|
29
|
-
cy.stub(win, 'fetch', (path, options) => {
|
|
30
|
-
if (path.indexOf('log.releware.net') > -1) {
|
|
31
|
-
return Promise.resolve();
|
|
32
|
-
}
|
|
33
|
-
return doFetch(path, options);
|
|
34
|
-
}).as('fetch');
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// FIXME: The heed_recommendation event is not implemented in this template
|
|
39
|
-
// yet. This test (modified to target the correct list) should pass
|
|
40
|
-
// once it is.
|
|
41
|
-
//
|
|
42
|
-
// it('Category Page: Should trigger click events for recommendations', () => {
|
|
43
|
-
// cy.visit(CATEGORY_URL);
|
|
44
|
-
|
|
45
|
-
// cy.getByTestId('product')
|
|
46
|
-
// .first()
|
|
47
|
-
// .click();
|
|
48
|
-
|
|
49
|
-
// cy.get('@fetch').should(spy => {
|
|
50
|
-
// const calls = getRelewareCalls(spy);
|
|
51
|
-
|
|
52
|
-
// expect(calls).to.have.lengthOf(1);
|
|
53
|
-
// expect(calls).to.deep.equal([
|
|
54
|
-
// { ...BASE_EVENT, event: 'heed_recommendation' }
|
|
55
|
-
// ]);
|
|
56
|
-
// });
|
|
57
|
-
// });
|
|
58
|
-
|
|
59
|
-
it('Product Page: Should trigger view events', () => {
|
|
60
|
-
cy.visit(PRODUCT_URL);
|
|
61
|
-
cy.get('@fetch').should(spy => {
|
|
62
|
-
const calls = getRelewareCalls(spy);
|
|
63
|
-
|
|
64
|
-
expect(calls).to.have.lengthOf(1);
|
|
65
|
-
expect(calls[0].event).to.equal('view_item');
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('Product Page: Should trigger cart events', () => {
|
|
70
|
-
cy.visit(PRODUCT_URL);
|
|
71
|
-
cy.findByTestId('add-to-cart').click();
|
|
72
|
-
|
|
73
|
-
cy.get('@fetch').should(spy => {
|
|
74
|
-
const calls = getRelewareCalls(spy);
|
|
75
|
-
expect(calls).to.have.lengthOf(2);
|
|
76
|
-
expect(calls[1].event).to.equal('pick_item');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// FIXME: How to implement this is not mentioned in any of the releware
|
|
80
|
-
// docs, it might be so that they only track add events.
|
|
81
|
-
//
|
|
82
|
-
// cy.getByTestId('header-cart')
|
|
83
|
-
// .click({ force: true })
|
|
84
|
-
// .getByTestId('remove-from-cart')
|
|
85
|
-
// .first()
|
|
86
|
-
// .click();
|
|
87
|
-
// cy.get('@fetch').should(spy => {
|
|
88
|
-
// const calls = getRelewareCalls(spy);
|
|
89
|
-
// expect(calls).to.have.lengthOf(3);
|
|
90
|
-
// expect(calls.slice(2)).to.deep.equal([
|
|
91
|
-
// { ...BASE_EVENT, event: '???' }
|
|
92
|
-
// ]);
|
|
93
|
-
// });
|
|
94
|
-
});
|
|
95
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
describe('Log In', () => {
|
|
2
|
-
it('Will show an error when the user enters bad credentials', () => {
|
|
3
|
-
cy.visit('/se/login');
|
|
4
|
-
cy.get('#email').type('test@test.com');
|
|
5
|
-
cy.get('#password').type('iamanonsensepassword');
|
|
6
|
-
cy.get('button[type="submit"]').contains('Log in').click();
|
|
7
|
-
cy.findByText('Login failed. Please try again').should('exist');
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('Will log a user in with correct credentials', () => {
|
|
11
|
-
cy.visit('/se/login');
|
|
12
|
-
cy.get('#email').type('wolverine@jetshop.se');
|
|
13
|
-
cy.get('#password').type('jetshop');
|
|
14
|
-
cy.get('button[type="submit"]').contains('Log in').click();
|
|
15
|
-
cy.findByText('Login failed. Please try again').should('not.exist');
|
|
16
|
-
cy.url().should('contain', 'my-pages');
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
function randomString() {
|
|
2
|
-
return Math.random().toString(25);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
describe('User can sign up', () => {
|
|
6
|
-
it('as a private customer', () => {
|
|
7
|
-
cy.visit('/se/signup');
|
|
8
|
-
|
|
9
|
-
cy.get("input[name='pid']").type('test');
|
|
10
|
-
cy.get("input[name='firstName']").type('Private');
|
|
11
|
-
cy.get("input[name='lastName']").type('Customer');
|
|
12
|
-
cy.get("input[name='streetName']").type('test');
|
|
13
|
-
cy.get("input[name='postalCode']").type('51234');
|
|
14
|
-
cy.get("input[name='city']").type('test');
|
|
15
|
-
cy.get("input[name='emailAddress']").type(`${randomString()}@test.com`);
|
|
16
|
-
cy.get("input[name='password']").type('cypresstest');
|
|
17
|
-
cy.get('[data-testid="sign-up-button"]').click();
|
|
18
|
-
|
|
19
|
-
cy.get('h2[data-testid="customer-name"]').should(
|
|
20
|
-
'contain',
|
|
21
|
-
'Private Customer'
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
cy.get('a[href="/se/my-pages/profile"]').click();
|
|
25
|
-
|
|
26
|
-
cy.get('input[type="checkbox"][name="confirm"]').click({ force: true });
|
|
27
|
-
|
|
28
|
-
cy.get('button[type="submit"]').contains('Delete account').click();
|
|
29
|
-
});
|
|
30
|
-
it('as a business customer', () => {
|
|
31
|
-
cy.visit('/se/signup');
|
|
32
|
-
|
|
33
|
-
cy.get('input[type="radio"][value="company"]').click({ force: true });
|
|
34
|
-
cy.get("input[name='organizationNumber']").type('test');
|
|
35
|
-
cy.get("input[name='company']").type('test');
|
|
36
|
-
cy.get("input[name='companyAtt']").type('test');
|
|
37
|
-
cy.get("input[name='department']").type('test');
|
|
38
|
-
cy.get("input[name='firstName']").type('test');
|
|
39
|
-
cy.get("input[name='lastName']").type('test');
|
|
40
|
-
cy.get("input[name='streetName']").type('test');
|
|
41
|
-
cy.get("input[name='postalCode']").type('51234');
|
|
42
|
-
cy.get("input[name='city']").type('test');
|
|
43
|
-
cy.get("input[name='emailAddress']").type(
|
|
44
|
-
`${randomString()}@business-test.com`
|
|
45
|
-
);
|
|
46
|
-
cy.get("input[name='password']").type('cypresstest');
|
|
47
|
-
cy.get('[data-testid="sign-up-button"]').click();
|
|
48
|
-
|
|
49
|
-
cy.get('a[href="/se/my-pages/profile"]').click();
|
|
50
|
-
|
|
51
|
-
cy.get('input[type="checkbox"][name="confirm"]').click({ force: true });
|
|
52
|
-
|
|
53
|
-
cy.get('button[type="submit"]').contains('Delete account').click();
|
|
54
|
-
|
|
55
|
-
cy.get('span').contains('Log in').should('be.visible');
|
|
56
|
-
});
|
|
57
|
-
it('with encrypted values', () => {
|
|
58
|
-
cy.visit('/se/signup');
|
|
59
|
-
|
|
60
|
-
cy.get("input[name='pid']").type('test');
|
|
61
|
-
cy.get("input[name='firstName']").type('eTZ7FGaVn/RAThBesp3unQ==');
|
|
62
|
-
cy.get("input[name='lastName']").type('Pehrers');
|
|
63
|
-
cy.get("input[name='streetName']").type('test');
|
|
64
|
-
cy.get("input[name='postalCode']").type('51234');
|
|
65
|
-
cy.get("input[name='city']").type('test');
|
|
66
|
-
cy.get("input[name='emailAddress']").type(`${randomString()}@test.com`);
|
|
67
|
-
cy.get("input[name='password']").type('cypresstest');
|
|
68
|
-
cy.get('[data-testid="sign-up-button"]').click();
|
|
69
|
-
|
|
70
|
-
cy.get('a[href="/se/my-pages/profile"]').click();
|
|
71
|
-
cy.get('h2[data-testid="customer-name"]').should('contain', 'Erik Pehrers');
|
|
72
|
-
|
|
73
|
-
cy.get('input[type="checkbox"][name="confirm"]').click({ force: true });
|
|
74
|
-
|
|
75
|
-
cy.get('button[type="submit"]').contains('Delete account').click();
|
|
76
|
-
|
|
77
|
-
cy.get('span').contains('Log in').should('be.visible');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('Displays email validation error', () => {
|
|
81
|
-
cy.visit('/se/signup');
|
|
82
|
-
|
|
83
|
-
cy.get("input[name='pid']").type('test');
|
|
84
|
-
cy.get("input[name='firstName']").type('integrationtest');
|
|
85
|
-
cy.get("input[name='lastName']").type('E god');
|
|
86
|
-
cy.get("input[name='streetName']").type('test');
|
|
87
|
-
cy.get("input[name='postalCode']").type('51234');
|
|
88
|
-
cy.get("input[name='city']").type('test');
|
|
89
|
-
cy.get("input[name='emailAddress']").type('kantarellen@egod.com');
|
|
90
|
-
cy.get("input[name='password']").type('cypresstest');
|
|
91
|
-
cy.get('[data-testid="sign-up-button"]').click();
|
|
92
|
-
|
|
93
|
-
cy.get('div[data-testid="validation-error"]').should(
|
|
94
|
-
'contain',
|
|
95
|
-
'The specified e-mail address is already registered.'
|
|
96
|
-
);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { CATEGORY_URL } from '../constants';
|
|
2
|
-
|
|
3
|
-
const ACCESSORIES_URL = '/accessories';
|
|
4
|
-
const FURNITURE_URL = '/furniture';
|
|
5
|
-
const CAMPAIGN_URL = '/campaigns';
|
|
6
|
-
|
|
7
|
-
describe('Category Page', () => {
|
|
8
|
-
beforeEach(() => cy.visit(`${ACCESSORIES_URL}?channelCountry=US`));
|
|
9
|
-
it('Loads the right header', () => {
|
|
10
|
-
cy.findByTestId('page-header').should('contain', 'Accessories');
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('Can handle pagination', () => {
|
|
14
|
-
cy.visit(`${ACCESSORIES_URL}?channelCountry=US&standardPagination=true`);
|
|
15
|
-
cy.get('a')
|
|
16
|
-
.contains('Next')
|
|
17
|
-
.click();
|
|
18
|
-
cy.url().should('contain', 'page=2');
|
|
19
|
-
cy.get('#root').should('contain', 'Page 2 of 2');
|
|
20
|
-
cy.get('a')
|
|
21
|
-
.contains('Prev')
|
|
22
|
-
.click();
|
|
23
|
-
cy.url().should('not.contain', 'page=2');
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
describe('Infinite pagination', () => {
|
|
28
|
-
it('has non moving scroll position on fetch', () => {
|
|
29
|
-
let yOffset;
|
|
30
|
-
cy.visit(CAMPAIGN_URL);
|
|
31
|
-
cy.scrollTo('bottom');
|
|
32
|
-
cy.window()
|
|
33
|
-
.then(win => {
|
|
34
|
-
yOffset = win.pageYOffset;
|
|
35
|
-
})
|
|
36
|
-
.then(() => {
|
|
37
|
-
cy.get('a')
|
|
38
|
-
.contains('Show more')
|
|
39
|
-
.click();
|
|
40
|
-
cy.wait(2000);
|
|
41
|
-
cy.window()
|
|
42
|
-
.its('pageYOffset')
|
|
43
|
-
.should('equal', yOffset);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
it('paginates correctly when retreiving more products', () => {
|
|
47
|
-
cy.visit(FURNITURE_URL);
|
|
48
|
-
cy.get('a')
|
|
49
|
-
.contains('Show more')
|
|
50
|
-
.click();
|
|
51
|
-
cy.wait(2000);
|
|
52
|
-
cy.scrollTo('bottom');
|
|
53
|
-
cy.url().should('contain', 'page=2');
|
|
54
|
-
cy.scrollTo('top');
|
|
55
|
-
cy.url().should('not.contain', 'page=2');
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe('product browsing', () => {
|
|
60
|
-
describe('news category', () => {
|
|
61
|
-
beforeEach(() => cy.visit(`${CATEGORY_URL}?channelCountry=US`));
|
|
62
|
-
|
|
63
|
-
it('contains a category description', () => {
|
|
64
|
-
cy.findByTestId('category-description');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('contains a product grid with products', () => {
|
|
68
|
-
cy.findByTestId('product-grid').within(() =>
|
|
69
|
-
cy.findAllByTestId('product')
|
|
70
|
-
);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|