Saleor 3038 tests for payments by adyen (#1086)

* add tests for puchase by type

* add expect for isShippingRequired

* tests for adyen

* tests for adyen

* tests for adyen

* tests for adyen

* adyen

* adyen

* adyen

* adyen

* adyen

* warehouses in chcekout

* rm warehouses in chcekout

* adyen payments

* adyen
This commit is contained in:
Karolina Rakoczy 2021-05-16 13:38:53 +02:00 committed by GitHub
parent 935a6f4542
commit 9f71106f32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 1136 additions and 353 deletions

View file

@ -87,6 +87,24 @@ jobs:
echo "::set-output name=custom_api_uri::$(echo $pull_request_body | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1)" echo "::set-output name=custom_api_uri::$(echo $pull_request_body | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1)"
- name: Cypress run - name: Cypress run
if: ${{ steps.api_uri.outputs.custom_api_uri}} != 'https://qa.staging.saleor.cloud/graphql/'
uses: cypress-io/github-action@v2
env:
API_URI: ${{ steps.api_uri.outputs.custom_api_uri || secrets.API_URI }}
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
CYPRESS_baseUrl: ${{ secrets.CYPRESS_BASEURL }}
CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }}
CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }}
CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }}
with:
build: npm run build
start: npx local-web-server --spa index.html
wait-on: http://localhost:9000/
wait-on-timeout: 120
spec: cypress/integration/allEnv/**/*.js
- name: Cypress run
if: ${{ steps.api_uri.outputs.custom_api_uri}} == 'https://qa.staging.saleor.cloud/graphql/'
uses: cypress-io/github-action@v2 uses: cypress-io/github-action@v2
env: env:
API_URI: ${{ steps.api_uri.outputs.custom_api_uri || secrets.API_URI }} API_URI: ${{ steps.api_uri.outputs.custom_api_uri || secrets.API_URI }}

View file

@ -1,4 +1,9 @@
import { getDefaultAddress, getVariantsLines } from "./utils/Utils"; import {
getDefaultAddress,
getPaymentDataLine,
getValueWithDefault,
getVariantsLines
} from "./utils/Utils";
export function createCheckout({ export function createCheckout({
channelSlug, channelSlug,
@ -45,21 +50,33 @@ export function addShippingMethod(checkoutId, shippingMethodId) {
const mutation = `mutation{ const mutation = `mutation{
checkoutShippingMethodUpdate(checkoutId:"${checkoutId}", checkoutShippingMethodUpdate(checkoutId:"${checkoutId}",
shippingMethodId:"${shippingMethodId}"){ shippingMethodId:"${shippingMethodId}"){
checkoutErrors{ errors{
message message
field field
} }
checkout{
totalPrice{
gross{
amount
}
}
}
} }
}`; }`;
return cy.sendRequestWithQuery(mutation); return cy
.sendRequestWithQuery(mutation)
.its("body.data.checkoutShippingMethodUpdate");
} }
export function addPayment(checkoutId, gateway, token) { export function addPayment({ checkoutId, gateway, token, amount }) {
const tokenLine = getValueWithDefault(token, `token:"${token}"`);
const amountLine = getValueWithDefault(amount, `amount: ${amount}`);
const mutation = `mutation{ const mutation = `mutation{
checkoutPaymentCreate(checkoutId:"${checkoutId}", checkoutPaymentCreate(checkoutId:"${checkoutId}",
input:{ input:{
gateway: "${gateway}" gateway: "${gateway}"
token:"${token}" ${tokenLine}
${amountLine}
}){ }){
paymentErrors{ paymentErrors{
field field
@ -72,9 +89,10 @@ export function addPayment(checkoutId, gateway, token) {
.its("body.data.checkoutPaymentCreate"); .its("body.data.checkoutPaymentCreate");
} }
export function completeCheckout(checkoutId) { export function completeCheckout(checkoutId, paymentData) {
const paymentDataLine = getPaymentDataLine(paymentData);
const mutation = `mutation{ const mutation = `mutation{
checkoutComplete(checkoutId:"${checkoutId}"){ checkoutComplete(checkoutId:"${checkoutId}" ${paymentDataLine}){
order{ order{
id id
} }
@ -86,9 +104,7 @@ export function completeCheckout(checkoutId) {
} }
} }
}`; }`;
return cy return cy.sendRequestWithQuery(mutation).its("body.data.checkoutComplete");
.sendRequestWithQuery(mutation)
.its("body.data.checkoutComplete.order");
} }
export function addVoucher(checkoutId, voucherCode) { export function addVoucher(checkoutId, voucherCode) {

View file

@ -69,6 +69,7 @@ export function getOrder(orderId) {
const query = `query getOrder{ const query = `query getOrder{
order(id:"${orderId}"){ order(id:"${orderId}"){
status status
paymentStatus
isShippingRequired isShippingRequired
shippingMethod{ shippingMethod{
id id

View file

@ -25,3 +25,7 @@ export function getVariantsLines(variantsList, quantity) {
variantId:"${variant.id}"}` variantId:"${variant.id}"}`
); );
} }
export const getPaymentDataLine = paymentData =>
paymentData
? `, paymentData:"{\\"riskData\\":{\\"clientData\\":\\"${paymentData.clientData}\\"}, \\"paymentMethod\\":{\\"type\\":\\"scheme\\", \\"encryptedCardNumber\\":\\"${paymentData.encryptedCardNumber}\\", \\"encryptedExpiryMonth\\":\\"${paymentData.encryptedExpiryMonth}\\", \\"encryptedExpiryYear\\":\\"${paymentData.encryptedExpiryYear}\\", \\"encryptedSecurityCode\\":\\"${paymentData.encryptedSecurityCode}\\", \\"brand\\":\\"${paymentData.brand}\\"}}"`
: "";

View file

@ -1,6 +1,6 @@
export const AVAILABLE_CHANNELS_FORM = { export const AVAILABLE_CHANNELS_FORM = {
menageChannelsButton: "[data-test-id='channels-availiability-manage-button']", menageChannelsButton: "[data-test-id='channels-availiability-manage-button']",
assignedChannels: "[class*=expandIcon]", assignedChannels: "[data-test-id='expand-icon']",
publishedRadioButtons: "[name*='isPublished']", publishedRadioButtons: "[name*='isPublished']",
availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']", availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']",
radioButtonsValueTrue: "[value='true']", radioButtonsValueTrue: "[value='true']",

View file

@ -8,5 +8,5 @@ export const BUTTON_SELECTORS = {
selectOption: "[data-test*='select-option']", selectOption: "[data-test*='select-option']",
notSelectedOption: ":not([aria-selected])", notSelectedOption: ":not([aria-selected])",
deleteButton: '[data-test="button-bar-delete"]', deleteButton: '[data-test="button-bar-delete"]',
expandIcon: `[class*="expandIcon"]` expandIcon: '[data-test-id="expand-icon"]'
}; };

View file

@ -1,4 +1,5 @@
export const SHARED_ELEMENTS = { export const SHARED_ELEMENTS = {
header: "[data-test-id='page-header']", header: "[data-test-id='page-header']",
progressBar: '[role="progressbar"]' progressBar: '[role="progressbar"]',
skeleton: '[data-test-id="skeleton"]'
}; };

View file

@ -12,5 +12,19 @@
"phone": "123456787", "phone": "123456787",
"currency": "PLN", "currency": "PLN",
"countryFullName": "Poland" "countryFullName": "Poland"
},
"usAddress": {
"firstName": "test",
"lastName": "test",
"companyName": "Test2",
"streetAddress1": "Antonio Ridge",
"streetAddress2": "34930",
"city": "North Patrickfort",
"postalCode": "70957",
"country": "US",
"countryArea": "LA",
"phone": "2025550189",
"currency": "USD",
"countryFullName": "United States of America"
} }
} }

View file

@ -0,0 +1,35 @@
{
"clientData": "eyJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXZpY2VGaW5nZXJwcmludCI6InpabUlDMEVYOHcwMDMwMDAwMDAwMDAwMDAwS1piSVFqNmt6czAwNjA4MjQxOTBjVkI5NGlLekJHS1IybWJMc3JmckFKUEdCY2JHSG0wMDZpdmJTdVlkRzBSMDAwMDBZVnhFcjAwMDAwVk1yM0h5dHhQNmlaQ3FuSTRsc2s6NDAiLCJwZXJzaXN0ZW50Q29va2llIjpbXSwiY29tcG9uZW50cyI6eyJ1c2VyQWdlbnQiOiJkYzJjNDM2MThlOTM0YjY2NmIwOWIxNmEzZDE4NmViZCIsIndlYmRyaXZlciI6MCwibGFuZ3VhZ2UiOiJwbC1QTCIsImNvbG9yRGVwdGgiOjMwLCJkZXZpY2VNZW1vcnkiOjgsInBpeGVsUmF0aW8iOjIsImhhcmR3YXJlQ29uY3VycmVuY3kiOjEyLCJzY3JlZW5XaWR0aCI6MTc5Miwic2NyZWVuSGVpZ2h0IjoxMTIwLCJhdmFpbGFibGVTY3JlZW5XaWR0aCI6MTc5MiwiYXZhaWxhYmxlU2NyZWVuSGVpZ2h0IjoxMDMwLCJ0aW1lem9uZU9mZnNldCI6LTEyMCwidGltZXpvbmUiOiJFdXJvcGUvV2Fyc2F3Iiwic2Vzc2lvblN0b3JhZ2UiOjEsImxvY2FsU3RvcmFnZSI6MSwiaW5kZXhlZERiIjoxLCJhZGRCZWhhdmlvciI6MCwib3BlbkRhdGFiYXNlIjoxLCJwbGF0Zm9ybSI6Ik1hY0ludGVsIiwicGx1Z2lucyI6ImMxMzU2NDM4NzUxNzZkZWU5MTkyZTE5ZDRkOGM3YTkwIiwiY2FudmFzIjoiZDYxNjRlNzA3ZWQ4NDdlNTE4OGE1YjUyMDhmNDI1OGIiLCJ3ZWJnbCI6IjcwM2ZjZWMyM2MxNjhlYjAzNmM0MjA3MzA1ODYzZmNlIiwid2ViZ2xWZW5kb3JBbmRSZW5kZXJlciI6IkludGVsIEluYy5+SW50ZWwoUikgVUhEIEdyYXBoaWNzIDYzMCIsImFkQmxvY2siOjAsImhhc0xpZWRMYW5ndWFnZXMiOjAsImhhc0xpZWRSZXNvbHV0aW9uIjowLCJoYXNMaWVkT3MiOjAsImhhc0xpZWRCcm93c2VyIjowLCJmb250cyI6IjI5MmVhMmNjZWNjZDAyYjAxYzBjNGMxZDQxMzIxNzVlIiwiYXVkaW8iOiIzOTRmNjQwMGY0NDg5NDIwNDIzZGYzMzY1OGU1NGJlNiIsImVudW1lcmF0ZURldmljZXMiOiJmMjA4Yzc3MWExNjBiNjRmNDkzOWFmYmE1OTY2YTRhZiJ9fQ==",
"encryptedExpiryMonth": "test_03",
"encryptedExpiryYear": "test_2030",
"encryptedSecurityCodes": {
"unknown": "665",
"matches": "test_001"
},
"cards": {
"simpleCard": {
"brand": "visa",
"encryptedCardNumber": "test_4111111145551142"
},
"threeDSecureOneAuth": {
"brand": "visa",
"encryptedCardNumber": "test_4212345678901237"
},
"threeDSecureTwoAuth": {
"encryptedCardNumber": "test_5454545454545454",
"brand": "mc"
},
"errorCard": {
"brand": "visa",
"encryptedCardNumber": "test_5201282999005515"
},
"closeAccount" : {
"brand": "visa",
"encryptedCardNumber" : "test_5454541580311093"
},
"avs" : {
"brand": "visa",
"encryptedCardNumber" : "test_4400000000000008"
}
}
}

View file

@ -1,24 +1,24 @@
// <reference types="cypress" /> // <reference types="cypress" />
import faker from "faker"; import faker from "faker";
import { createChannel } from "../apiRequests/Channels"; import { createChannel } from "../../apiRequests/Channels";
import { updateChannelInProduct } from "../apiRequests/Product"; import { updateChannelInProduct } from "../../apiRequests/Product";
import { getCollection } from "../apiRequests/storeFront/Collections"; import { getCollection } from "../../apiRequests/storeFront/Collections";
import { searchInShop } from "../apiRequests/storeFront/Search"; import { searchInShop } from "../../apiRequests/storeFront/Search";
import { import {
assignProductsToCollection, assignProductsToCollection,
createCollection createCollection
} from "../steps/collectionsSteps"; } from "../../steps/collectionsSteps";
import { urlList } from "../url/urlList"; import { urlList } from "../../url/urlList";
import * as channelsUtils from "../utils/channelsUtils"; import * as channelsUtils from "../../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../utils/collectionsUtils"; import { deleteCollectionsStartsWith } from "../../utils/collectionsUtils";
import * as productsUtils from "../utils/products/productsUtils"; import * as productsUtils from "../../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../utils/shippingUtils"; import { deleteShippingStartsWith } from "../../utils/shippingUtils";
import { import {
isCollectionVisible, isCollectionVisible,
isProductInCollectionVisible isProductInCollectionVisible
} from "../utils/storeFront/collectionsUtils"; } from "../../utils/storeFront/collectionsUtils";
import { isProductVisibleInSearchResult } from "../utils/storeFront/storeFrontProductUtils"; import { isProductVisibleInSearchResult } from "../../utils/storeFront/storeFrontProductUtils";
describe("Collections", () => { describe("Collections", () => {
const startsWith = "CyCollections-"; const startsWith = "CyCollections-";

View file

@ -1,23 +1,23 @@
// <reference types="cypress" /> // <reference types="cypress" />
import faker from "faker"; import faker from "faker";
import { createChannel } from "../../apiRequests/Channels"; import { createChannel } from "../../../apiRequests/Channels";
import { LEFT_MENU_SELECTORS } from "../../elements/account/left-menu/left-menu-selectors"; import { LEFT_MENU_SELECTORS } from "../../../elements/account/left-menu/left-menu-selectors";
import { PRODUCTS_LIST } from "../../elements/catalog/products/products-list"; import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import { ADD_CHANNEL_FORM_SELECTORS } from "../../elements/channels/add-channel-form-selectors"; import { ADD_CHANNEL_FORM_SELECTORS } from "../../../elements/channels/add-channel-form-selectors";
import { AVAILABLE_CHANNELS_FORM } from "../../elements/channels/available-channels-form"; import { AVAILABLE_CHANNELS_FORM } from "../../../elements/channels/available-channels-form";
import { CHANNEL_FORM_SELECTORS } from "../../elements/channels/channel-form-selectors"; import { CHANNEL_FORM_SELECTORS } from "../../../elements/channels/channel-form-selectors";
import { CHANNELS_SELECTORS } from "../../elements/channels/channels-selectors"; import { CHANNELS_SELECTORS } from "../../../elements/channels/channels-selectors";
import { SELECT_CHANNELS_TO_ASSIGN } from "../../elements/channels/select-channels-to-assign"; import { SELECT_CHANNELS_TO_ASSIGN } from "../../../elements/channels/select-channels-to-assign";
import { CONFIGURATION_SELECTORS } from "../../elements/configuration/configuration-selectors"; import { CONFIGURATION_SELECTORS } from "../../../elements/configuration/configuration-selectors";
import { HEADER_SELECTORS } from "../../elements/header/header-selectors"; import { HEADER_SELECTORS } from "../../../elements/header/header-selectors";
import { DRAFT_ORDER_SELECTORS } from "../../elements/orders/draft-order-selectors"; import { DRAFT_ORDER_SELECTORS } from "../../../elements/orders/draft-order-selectors";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors"; import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { createChannelByView } from "../../steps/channelsSteps"; import { createChannelByView } from "../../../steps/channelsSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import { deleteChannelsStartsWith } from "../../utils/channelsUtils"; import { deleteChannelsStartsWith } from "../../../utils/channelsUtils";
describe("Channels", () => { describe("Channels", () => {
const channelStartsWith = `CyChannels:`; const channelStartsWith = `CyChannels:`;
@ -68,10 +68,8 @@ describe("Channels", () => {
cy.addAliasToGraphRequest("InitialProductFilterAttributes"); cy.addAliasToGraphRequest("InitialProductFilterAttributes");
cy.visit(urlList.products); cy.visit(urlList.products);
cy.wait("@InitialProductFilterAttributes"); cy.wait("@InitialProductFilterAttributes");
cy.get(SHARED_ELEMENTS.progressBar) cy.get(SHARED_ELEMENTS.progressBar).should("not.exist");
.should("not.exist") cy.get(PRODUCTS_LIST.emptyProductRow).should("not.exist");
.get(PRODUCTS_LIST.emptyProductRow)
.should("not.exist");
cy.get(PRODUCTS_LIST.productsList) cy.get(PRODUCTS_LIST.productsList)
.first() .first()
.click() .click()

View file

@ -219,7 +219,7 @@ describe("Purchase products with all products types", () => {
.then(() => { .then(() => {
completeCheckout(checkout.id); completeCheckout(checkout.id);
}) })
.then(order => { .then(({ order }) => {
getOrder(order.id); getOrder(order.id);
}) })
.then(order => { .then(order => {

View file

@ -1,26 +1,26 @@
// <reference types="cypress" /> // <reference types="cypress" />
import faker from "faker"; import faker from "faker";
import { createChannel } from "../../apiRequests/Channels"; import { createChannel } from "../../../apiRequests/Channels";
import { createCheckout } from "../../apiRequests/Checkout"; import { createCheckout } from "../../../apiRequests/Checkout";
import { import {
addChannelToShippingMethod, addChannelToShippingMethod,
addChannelToShippingZone addChannelToShippingZone
} from "../../apiRequests/ShippingMethod"; } from "../../../apiRequests/ShippingMethod";
import { createWarehouse } from "../../apiRequests/Warehouse"; import { createWarehouse } from "../../../apiRequests/Warehouse";
import { SHIPPING_ZONE_DETAILS } from "../../elements/shipping/shipping-zone-details"; import { SHIPPING_ZONE_DETAILS } from "../../../elements/shipping/shipping-zone-details";
import { selectChannelInHeader } from "../../steps/channelsSteps"; import { selectChannelInHeader } from "../../../steps/channelsSteps";
import { import {
createShippingRate, createShippingRate,
createShippingZone, createShippingZone,
rateOptions rateOptions
} from "../../steps/shippingMethodSteps"; } from "../../../steps/shippingMethodSteps";
import { getFormattedCurrencyAmount } from "../../support/format/formatCurrencyAmount"; import { getFormattedCurrencyAmount } from "../../../support/format/formatCurrencyAmount";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils"; import * as channelsUtils from "../../../utils/channelsUtils";
import * as productsUtils from "../../utils/products/productsUtils"; import * as productsUtils from "../../../utils/products/productsUtils";
import * as shippingUtils from "../../utils/shippingUtils"; import * as shippingUtils from "../../../utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../utils/storeFront/checkoutUtils"; import { isShippingAvailableInCheckout } from "../../../utils/storeFront/checkoutUtils";
describe("Shipping methods", () => { describe("Shipping methods", () => {
const startsWith = "CyShippingMethods-"; const startsWith = "CyShippingMethods-";

View file

@ -1,5 +1,5 @@
// <reference types="cypress" /> // <reference types="cypress" />
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
describe("Warehouse settings", () => { describe("Warehouse settings", () => {
beforeEach(() => { beforeEach(() => {

View file

@ -2,22 +2,22 @@
import faker from "faker"; import faker from "faker";
import { createChannel } from "../../apiRequests/Channels"; import { createChannel } from "../../../apiRequests/Channels";
import { updateChannelInProduct } from "../../apiRequests/Product"; import { updateChannelInProduct } from "../../../apiRequests/Product";
import { import {
assignProducts, assignProducts,
createSale, createSale,
discountOptions discountOptions
} from "../../steps/discounts/salesSteps"; } from "../../../steps/discounts/salesSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils"; import * as channelsUtils from "../../../utils/channelsUtils";
import { deleteSalesStartsWith } from "../../utils/discounts/salesUtils"; import { deleteSalesStartsWith } from "../../../utils/discounts/salesUtils";
import * as productsUtils from "../../utils/products/productsUtils"; import * as productsUtils from "../../../utils/products/productsUtils";
import { import {
createShipping, createShipping,
deleteShippingStartsWith deleteShippingStartsWith
} from "../../utils/shippingUtils"; } from "../../../utils/shippingUtils";
import { getProductPrice } from "../../utils/storeFront/storeFrontProductUtils"; import { getProductPrice } from "../../../utils/storeFront/storeFrontProductUtils";
describe("Sales discounts", () => { describe("Sales discounts", () => {
const startsWith = "CySales-"; const startsWith = "CySales-";

View file

@ -1,20 +1,20 @@
// <reference types="cypress" /> // <reference types="cypress" />
import faker from "faker"; import faker from "faker";
import { createChannel } from "../../apiRequests/Channels"; import { createChannel } from "../../../apiRequests/Channels";
import { import {
createVoucher, createVoucher,
discountOptions discountOptions
} from "../../steps/discounts/vouchersSteps"; } from "../../../steps/discounts/vouchersSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils"; import * as channelsUtils from "../../../utils/channelsUtils";
import { deleteVouchersStartsWith } from "../../utils/discounts/vouchersUtils"; import { deleteVouchersStartsWith } from "../../../utils/discounts/vouchersUtils";
import { createCheckoutWithVoucher } from "../../utils/ordersUtils"; import { createCheckoutWithVoucher } from "../../../utils/ordersUtils";
import * as productsUtils from "../../utils/products/productsUtils"; import * as productsUtils from "../../../utils/products/productsUtils";
import { import {
createShipping, createShipping,
deleteShippingStartsWith deleteShippingStartsWith
} from "../../utils/shippingUtils"; } from "../../../utils/shippingUtils";
describe("Vouchers discounts", () => { describe("Vouchers discounts", () => {
const startsWith = "CyVou-"; const startsWith = "CyVou-";

View file

@ -1,6 +1,6 @@
import { TEST_ADMIN_USER, USER_WITHOUT_NAME } from "../../Data/users"; import { TEST_ADMIN_USER, USER_WITHOUT_NAME } from "../../../Data/users";
import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors"; import { HOMEPAGE_SELECTORS } from "../../../elements/homePage/homePage-selectors";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
describe("Displaying welcome message on home page", () => { describe("Displaying welcome message on home page", () => {
it("should display user name on home page", () => { it("should display user name on home page", () => {

View file

@ -3,18 +3,18 @@ import faker from "faker";
import { import {
createCustomer, createCustomer,
deleteCustomersStartsWith deleteCustomersStartsWith
} from "../../apiRequests/Customer"; } from "../../../apiRequests/Customer";
import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors"; import { HOMEPAGE_SELECTORS } from "../../../elements/homePage/homePage-selectors";
import { changeChannel } from "../../steps/homePageSteps"; import { changeChannel } from "../../../steps/homePageSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils"; import { getDefaultChannel } from "../../../utils/channelsUtils";
import * as homePageUtils from "../../utils/homePageUtils"; import * as homePageUtils from "../../../utils/homePageUtils";
import { import {
createReadyToFulfillOrder, createReadyToFulfillOrder,
createWaitingForCaptureOrder createWaitingForCaptureOrder
} from "../../utils/ordersUtils"; } from "../../../utils/ordersUtils";
import * as productsUtils from "../../utils/products/productsUtils"; import * as productsUtils from "../../../utils/products/productsUtils";
import * as shippingUtils from "../../utils/shippingUtils"; import * as shippingUtils from "../../../utils/shippingUtils";
// <reference types="cypress" /> // <reference types="cypress" />
describe("Homepage analytics", () => { describe("Homepage analytics", () => {

View file

@ -1,6 +1,6 @@
// <reference types="cypress" /> // <reference types="cypress" />
import { LOGIN_SELECTORS } from "../elements/account/login-selectors"; import { LOGIN_SELECTORS } from "../../elements/account/login-selectors";
import { urlList } from "../url/urlList"; import { urlList } from "../../url/urlList";
describe("User authorization", () => { describe("User authorization", () => {
beforeEach(() => { beforeEach(() => {

View file

@ -1,5 +1,5 @@
import { PERMISSIONS_OPTIONS } from "../Data/permissionsUsers"; import { PERMISSIONS_OPTIONS } from "../../Data/permissionsUsers";
import * as permissionsSteps from "../steps/permissions"; import * as permissionsSteps from "../../steps/permissions";
describe("Navigation for users with different permissions", () => { describe("Navigation for users with different permissions", () => {
Object.keys(PERMISSIONS_OPTIONS).forEach(key => { Object.keys(PERMISSIONS_OPTIONS).forEach(key => {

View file

@ -1,17 +1,17 @@
// <reference types="cypress" /> // <reference types="cypress" />
import faker from "faker"; import faker from "faker";
import { createChannel } from "../../apiRequests/Channels"; import { createChannel } from "../../../apiRequests/Channels";
import { CHANNEL_FORM_SELECTORS } from "../../elements/channels/channel-form-selectors"; import { CHANNEL_FORM_SELECTORS } from "../../../elements/channels/channel-form-selectors";
import { HEADER_SELECTORS } from "../../elements/header/header-selectors"; import { HEADER_SELECTORS } from "../../../elements/header/header-selectors";
import { DRAFT_ORDER_SELECTORS } from "../../elements/orders/draft-order-selectors"; import { DRAFT_ORDER_SELECTORS } from "../../../elements/orders/draft-order-selectors";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors"; import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors";
import { import {
selectChannelInHeader, selectChannelInHeader,
selectChannelInPicker selectChannelInPicker
} from "../../steps/channelsSteps"; } from "../../../steps/channelsSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils"; import * as channelsUtils from "../../../utils/channelsUtils";
describe("Channels in draft orders", () => { describe("Channels in draft orders", () => {
const startsWith = "CyChannelInDraftOrders-"; const startsWith = "CyChannelInDraftOrders-";

View file

@ -4,18 +4,18 @@ import faker from "faker";
import { import {
createCustomer, createCustomer,
deleteCustomersStartsWith deleteCustomersStartsWith
} from "../../apiRequests/Customer"; } from "../../../apiRequests/Customer";
import { DRAFT_ORDERS_LIST_SELECTORS } from "../../elements/orders/draft-orders-list-selectors"; import { DRAFT_ORDERS_LIST_SELECTORS } from "../../../elements/orders/draft-orders-list-selectors";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors"; import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors";
import { selectChannelInPicker } from "../../steps/channelsSteps"; import { selectChannelInPicker } from "../../../steps/channelsSteps";
import { finalizeDraftOrder } from "../../steps/draftOrderSteps"; import { finalizeDraftOrder } from "../../../steps/draftOrderSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils"; import { getDefaultChannel } from "../../../utils/channelsUtils";
import * as productsUtils from "../../utils/products/productsUtils"; import * as productsUtils from "../../../utils/products/productsUtils";
import { import {
createShipping, createShipping,
deleteShippingStartsWith deleteShippingStartsWith
} from "../../utils/shippingUtils"; } from "../../../utils/shippingUtils";
describe("Draft orders", () => { describe("Draft orders", () => {
const startsWith = "CyDraftOrders-"; const startsWith = "CyDraftOrders-";

View file

@ -4,18 +4,18 @@ import faker from "faker";
import { import {
createCustomer, createCustomer,
deleteCustomersStartsWith deleteCustomersStartsWith
} from "../../apiRequests/Customer"; } from "../../../apiRequests/Customer";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors"; import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors";
import { selectChannelInPicker } from "../../steps/channelsSteps"; import { selectChannelInPicker } from "../../../steps/channelsSteps";
import { finalizeDraftOrder } from "../../steps/draftOrderSteps"; import { finalizeDraftOrder } from "../../../steps/draftOrderSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils"; import { getDefaultChannel } from "../../../utils/channelsUtils";
import { createOrder } from "../../utils/ordersUtils"; import { createOrder } from "../../../utils/ordersUtils";
import * as productsUtils from "../../utils/products/productsUtils"; import * as productsUtils from "../../../utils/products/productsUtils";
import { import {
createShipping, createShipping,
deleteShippingStartsWith deleteShippingStartsWith
} from "../../utils/shippingUtils"; } from "../../../utils/shippingUtils";
describe("Orders", () => { describe("Orders", () => {
const startsWith = "CyOrders-"; const startsWith = "CyOrders-";

View file

@ -0,0 +1,233 @@
import faker from "faker";
import { createAttribute } from "../../../apiRequests/Attribute";
import { createCategory } from "../../../apiRequests/Category";
import {
checkoutShippingAddressUpdate,
checkoutShippingMethodUpdate,
checkoutVariantsUpdate,
completeCheckout,
createCheckout
} from "../../../apiRequests/Checkout";
import { getOrder } from "../../../apiRequests/Order";
import { createTypeProduct } from "../../../apiRequests/Product";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import {
addPayment,
createAndCompleteCheckoutWithoutShipping,
createWaitingForCaptureOrder
} from "../../../utils/ordersUtils";
import {
createProductInChannel,
deleteProductsStartsWith
} from "../../../utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../../utils/shippingUtils";
describe("Purchase products with all products types", () => {
const startsWith = `CyPurchaseByType`;
const name = `${startsWith}${faker.datatype.number()}`;
const email = `${startsWith}@example.com`;
const testsMessage = "Check order status";
const { softExpect } = chai;
let defaultChannel;
let address;
let warehouse;
let attribute;
let category;
let shippingMethod;
let createProductData;
before(() => {
cy.clearSessionData().loginUserViaRequest();
deleteProductsStartsWith(startsWith);
deleteShippingStartsWith(startsWith);
getDefaultChannel().then(channelResp => (defaultChannel = channelResp));
cy.fixture("addresses")
.then(addresses => {
address = addresses.usAddress;
createShipping({
channelId: defaultChannel.id,
name,
address,
price: 10
});
})
.then(
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
warehouse = warehouseResp;
shippingMethod = shippingMethodResp;
}
);
createAttribute(name)
.then(attributeResp => {
attribute = attributeResp;
createCategory(name);
})
.then(categoryResp => {
category = categoryResp;
});
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
createProductData = {
channelId: defaultChannel.id,
warehouseId: warehouse.id,
quantityInWarehouse: 10,
attributeId: attribute.id,
categoryId: category.id,
price: 10
};
});
it("should purchase digital product", () => {
const digitalName = `${startsWith}${faker.datatype.number()}`;
createTypeProduct({
name: digitalName,
attributeId: attribute.id,
shippable: false
})
.then(productType => {
createProductData.name = digitalName;
createProductData.productTypeId = productType.id;
createProductInChannel(createProductData);
})
.then(({ variantsList }) => {
createAndCompleteCheckoutWithoutShipping({
channelSlug: defaultChannel.slug,
email,
billingAddress: address,
variantsList,
auth: "token"
});
})
.then(({ order }) => {
getOrder(order.id);
})
.then(order => {
softExpect(
order.isShippingRequired,
"Check if is shipping required in order"
).to.eq(false);
expect(order.status, testsMessage).to.be.eq("UNFULFILLED");
});
});
it("should purchase physical product", () => {
const physicalName = `${startsWith}${faker.datatype.number()}`;
createTypeProduct({
name: physicalName,
attributeId: attribute.id,
shippable: true
})
.then(productType => {
createProductData.name = physicalName;
createProductData.productTypeId = productType.id;
createProductInChannel(createProductData);
})
.then(({ variantsList }) => {
createWaitingForCaptureOrder(
defaultChannel.slug,
email,
variantsList,
shippingMethod.id,
address
);
})
.then(({ order }) => {
getOrder(order.id);
})
.then(order => {
softExpect(
order.isShippingRequired,
"Check if is shipping required in order"
).to.eq(true);
expect(order.status, testsMessage).to.be.eq("UNFULFILLED");
});
});
it("should purchase multiple products with all product types", () => {
const physicalName = `${startsWith}${faker.datatype.number()}`;
const digitalName = `${startsWith}${faker.datatype.number()}`;
let digitalProductVariantsList;
let checkout;
createTypeProduct({
name: digitalName,
attributeId: attribute.id,
shippable: false
})
.then(productType => {
createProductData.name = digitalName;
createProductData.productTypeId = productType.id;
createProductInChannel(createProductData);
})
.then(({ variantsList }) => {
digitalProductVariantsList = variantsList;
createCheckout({
channelSlug: defaultChannel.slug,
email,
variantsList: digitalProductVariantsList,
billingAddress: address,
auth: "token"
});
})
.then(checkoutResp => {
checkout = checkoutResp;
addPayment(checkout.id);
})
.then(() => {
createTypeProduct({
name: physicalName,
attributeId: attribute.id,
shippable: true
});
})
.then(productType => {
createProductData.name = physicalName;
createProductData.productTypeId = productType.id;
createProductInChannel(createProductData);
})
.then(({ variantsList }) => {
checkoutVariantsUpdate(checkout.id, variantsList);
})
.then(() => {
checkoutShippingMethodUpdate(checkout.id, shippingMethod.id);
})
.then(({ checkoutErrors }) => {
expect(
checkoutErrors,
"Should be not possible to add shipping method without shipping address"
).to.have.lengthOf(1);
checkoutShippingAddressUpdate(checkout.id, address);
})
.then(() => {
addPayment(checkout.id);
})
.then(({ paymentErrors }) => {
expect(
paymentErrors,
"Should be not possible to add payment without shipping"
).to.have.lengthOf(1);
checkoutShippingMethodUpdate(checkout.id, shippingMethod.id);
})
.then(() => {
addPayment(checkout.id);
})
.then(() => {
completeCheckout(checkout.id);
})
.then(({ order }) => {
getOrder(order.id);
})
.then(order => {
softExpect(
order.isShippingRequired,
"Check if is shipping required in order"
).to.eq(true);
expect(order.status, testsMessage).to.be.eq("UNFULFILLED");
});
});
});

View file

@ -1,24 +1,24 @@
// <reference types="cypress" /> // <reference types="cypress" />
import faker from "faker"; import faker from "faker";
import { createAttribute } from "../../apiRequests/Attribute"; import { createAttribute } from "../../../apiRequests/Attribute";
import { createTypeProduct } from "../../apiRequests/Product"; import { createTypeProduct } from "../../../apiRequests/Product";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details"; import { PRODUCT_DETAILS } from "../../../elements/catalog/products/product-details";
import { PRODUCTS_LIST } from "../../elements/catalog/products/products-list"; import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { metadataForms } from "../../steps/catalog/metadataSteps"; import { metadataForms } from "../../../steps/catalog/metadataSteps";
import { import {
fillUpPriceList, fillUpPriceList,
priceInputLists priceInputLists
} from "../../steps/catalog/products/priceList"; } from "../../../steps/catalog/products/priceList";
import { fillUpCommonFieldsForAllProductTypes } from "../../steps/catalog/products/productSteps"; import { fillUpCommonFieldsForAllProductTypes } from "../../../steps/catalog/products/productSteps";
import { selectChannelInDetailsPages } from "../../steps/channelsSteps"; import { selectChannelInDetailsPages } from "../../../steps/channelsSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import { import {
expectCorrectProductInformation, expectCorrectProductInformation,
expectCorrectProductVariantInformation expectCorrectProductVariantInformation
} from "../../utils/products/checkProductInfo"; } from "../../../utils/products/checkProductInfo";
import * as productUtils from "../../utils/products/productsUtils"; import * as productUtils from "../../../utils/products/productsUtils";
describe("Create product", () => { describe("Create product", () => {
const startsWith = "CyCreateProduct-"; const startsWith = "CyCreateProduct-";

View file

@ -1,12 +1,12 @@
import faker from "faker"; import faker from "faker";
import { getProductDetails } from "../../../apiRequests/storeFront/ProductDetails"; import { getProductDetails } from "../../../../apiRequests/storeFront/ProductDetails";
import { updateProductIsAvailableForPurchase } from "../../../steps/catalog/products/productSteps"; import { updateProductIsAvailableForPurchase } from "../../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../../url/urlList"; import { productDetailsUrl } from "../../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils"; import { getDefaultChannel } from "../../../../utils/channelsUtils";
import * as productsUtils from "../../../utils/products/productsUtils"; import * as productsUtils from "../../../../utils/products/productsUtils";
import * as shippingUtils from "../../../utils/shippingUtils"; import * as shippingUtils from "../../../../utils/shippingUtils";
import { isProductAvailableForPurchase } from "../../../utils/storeFront/storeFrontProductUtils"; import { isProductAvailableForPurchase } from "../../../../utils/storeFront/storeFrontProductUtils";
// <reference types="cypress" /> // <reference types="cypress" />
describe("Products available in listings", () => { describe("Products available in listings", () => {

View file

@ -1,11 +1,11 @@
import faker from "faker"; import faker from "faker";
import { getProductDetails } from "../../../apiRequests/storeFront/ProductDetails"; import { getProductDetails } from "../../../../apiRequests/storeFront/ProductDetails";
import { updateProductPublish } from "../../../steps/catalog/products/productSteps"; import { updateProductPublish } from "../../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../../url/urlList"; import { productDetailsUrl } from "../../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils"; import { getDefaultChannel } from "../../../../utils/channelsUtils";
import * as productsUtils from "../../../utils/products/productsUtils"; import * as productsUtils from "../../../../utils/products/productsUtils";
import { isProductVisible } from "../../../utils/storeFront/storeFrontProductUtils"; import { isProductVisible } from "../../../../utils/storeFront/storeFrontProductUtils";
// <reference types="cypress" /> // <reference types="cypress" />
describe("Published products", () => { describe("Published products", () => {

View file

@ -1,11 +1,11 @@
import faker from "faker"; import faker from "faker";
import { searchInShop } from "../../../apiRequests/storeFront/Search"; import { searchInShop } from "../../../../apiRequests/storeFront/Search";
import { updateProductVisibleInListings } from "../../../steps/catalog/products/productSteps"; import { updateProductVisibleInListings } from "../../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../../url/urlList"; import { productDetailsUrl } from "../../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils"; import { getDefaultChannel } from "../../../../utils/channelsUtils";
import * as productsUtils from "../../../utils/products/productsUtils"; import * as productsUtils from "../../../../utils/products/productsUtils";
import { isProductVisibleInSearchResult } from "../../../utils/storeFront/storeFrontProductUtils"; import { isProductVisibleInSearchResult } from "../../../../utils/storeFront/storeFrontProductUtils";
// <reference types="cypress" /> // <reference types="cypress" />
describe("Products displayed in listings", () => { describe("Products displayed in listings", () => {

View file

@ -1,24 +1,24 @@
import faker from "faker"; import faker from "faker";
import { createCollection } from "../../../apiRequests/Collections"; import { createCollection } from "../../../../apiRequests/Collections";
import { updateProduct } from "../../../apiRequests/Product"; import { updateProduct } from "../../../../apiRequests/Product";
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; import { PRODUCTS_LIST } from "../../../../elements/catalog/products/products-list";
import { import {
selectFilterOption, selectFilterOption,
selectProductsOutOfStock selectProductsOutOfStock
} from "../../../steps/catalog/products/productsListSteps"; } from "../../../../steps/catalog/products/productsListSteps";
import { selectChannelInHeader } from "../../../steps/channelsSteps"; import { selectChannelInHeader } from "../../../../steps/channelsSteps";
import { urlList } from "../../../url/urlList"; import { urlList } from "../../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils"; import { getDefaultChannel } from "../../../../utils/channelsUtils";
import { import {
createProductInChannel, createProductInChannel,
createTypeAttributeAndCategoryForProduct, createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith deleteProductsStartsWith
} from "../../../utils/products/productsUtils"; } from "../../../../utils/products/productsUtils";
import { import {
createShipping, createShipping,
deleteShippingStartsWith deleteShippingStartsWith
} from "../../../utils/shippingUtils"; } from "../../../../utils/shippingUtils";
describe("Products", () => { describe("Products", () => {
const startsWith = "CyFilterProducts-"; const startsWith = "CyFilterProducts-";

View file

@ -1,11 +1,11 @@
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; import { PRODUCTS_LIST } from "../../../../elements/catalog/products/products-list";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; import { BUTTON_SELECTORS } from "../../../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; import { SHARED_ELEMENTS } from "../../../../elements/shared/sharedElements";
import { import {
getDisplayedColumnArray, getDisplayedColumnArray,
isNumberOfProductsSameAsInSelectResultsOnPage isNumberOfProductsSameAsInSelectResultsOnPage
} from "../../../steps/catalog/products/productsListSteps"; } from "../../../../steps/catalog/products/productsListSteps";
import { urlList } from "../../../url/urlList"; import { urlList } from "../../../../url/urlList";
describe("Products", () => { describe("Products", () => {
beforeEach(() => { beforeEach(() => {

View file

@ -1,7 +1,7 @@
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; import { PRODUCTS_LIST } from "../../../../elements/catalog/products/products-list";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; import { SHARED_ELEMENTS } from "../../../../elements/shared/sharedElements";
import { urlList } from "../../../url/urlList"; import { urlList } from "../../../../url/urlList";
import { expectProductsSortedBy } from "../../../utils/products/productsListUtils"; import { expectProductsSortedBy } from "../../../../utils/products/productsListUtils";
describe("Sorting products", () => { describe("Sorting products", () => {
const sortByList = ["name", "type", "price"]; const sortByList = ["name", "type", "price"];

View file

@ -1,24 +1,24 @@
import faker from "faker"; import faker from "faker";
import { createChannel } from "../../apiRequests/Channels"; import { createChannel } from "../../../apiRequests/Channels";
import { import {
createProduct, createProduct,
updateChannelInProduct updateChannelInProduct
} from "../../apiRequests/Product"; } from "../../../apiRequests/Product";
import { import {
createFirstVariant, createFirstVariant,
createVariant, createVariant,
variantsShouldBeVisible variantsShouldBeVisible
} from "../../steps/catalog/products/VariantsSteps"; } from "../../../steps/catalog/products/VariantsSteps";
import { selectChannelInHeader } from "../../steps/channelsSteps"; import { selectChannelInHeader } from "../../../steps/channelsSteps";
import { urlList } from "../../url/urlList"; import { urlList } from "../../../url/urlList";
import { import {
deleteChannelsStartsWith, deleteChannelsStartsWith,
getDefaultChannel getDefaultChannel
} from "../../utils/channelsUtils"; } from "../../../utils/channelsUtils";
import * as productUtils from "../../utils/products/productsUtils"; import * as productUtils from "../../../utils/products/productsUtils";
import * as shippingUtils from "../../utils/shippingUtils"; import * as shippingUtils from "../../../utils/shippingUtils";
import { getProductVariants } from "../../utils/storeFront/storeFrontProductUtils"; import { getProductVariants } from "../../../utils/storeFront/storeFrontProductUtils";
// <reference types="cypress" /> // <reference types="cypress" />
describe("Creating variants", () => { describe("Creating variants", () => {

View file

@ -1,21 +1,21 @@
import faker from "faker"; import faker from "faker";
import { createCategory } from "../../apiRequests/Category"; import { createCategory } from "../../../apiRequests/Category";
import { createCollection } from "../../apiRequests/Collections"; import { createCollection } from "../../../apiRequests/Collections";
import { getProductDetails } from "../../apiRequests/storeFront/ProductDetails"; import { getProductDetails } from "../../../apiRequests/storeFront/ProductDetails";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details"; import { PRODUCT_DETAILS } from "../../../elements/catalog/products/product-details";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { metadataForms } from "../../steps/catalog/metadataSteps"; import { metadataForms } from "../../../steps/catalog/metadataSteps";
import { fillUpCommonFieldsForAllProductTypes } from "../../steps/catalog/products/productSteps"; import { fillUpCommonFieldsForAllProductTypes } from "../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../url/urlList"; import { productDetailsUrl } from "../../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils"; import { getDefaultChannel } from "../../../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../../utils/collectionsUtils"; import { deleteCollectionsStartsWith } from "../../../utils/collectionsUtils";
import { expectCorrectProductInformation } from "../../utils/products/checkProductInfo"; import { expectCorrectProductInformation } from "../../../utils/products/checkProductInfo";
import { import {
createProductInChannel, createProductInChannel,
createTypeAttributeAndCategoryForProduct, createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith deleteProductsStartsWith
} from "../../utils/products/productsUtils"; } from "../../../utils/products/productsUtils";
describe("Update products", () => { describe("Update products", () => {
const startsWith = "Cy-"; const startsWith = "Cy-";

View file

@ -0,0 +1,173 @@
import faker from "faker";
import {
addShippingMethod,
completeCheckout,
completeCheckoutWithAdyen,
createCheckout
} from "../../apiRequests/Checkout";
import { getOrder } from "../../apiRequests/Order";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { addAdyenPayment } from "../../utils/ordersUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
describe("Adyen payments", () => {
const startsWith = "CyChannelInDraftOrders-";
const name = startsWith + faker.datatype.number();
const email = `CyChannelInDraftOrders@example.com`;
let address;
let defaultChannel;
let warehouse;
let shippingMethod;
let variantsList;
let checkout;
let paymentCards;
let cardData;
before(() => {
cy.clearSessionData().loginUserViaRequest();
deleteProductsStartsWith(startsWith);
deleteShippingStartsWith(startsWith);
cy.fixture("cards").then(cardsResp => {
paymentCards = cardsResp;
cardData = {
clientData: paymentCards.clientData,
encryptedExpiryMonth: paymentCards.encryptedExpiryMonth,
encryptedExpiryYear: paymentCards.encryptedExpiryYear,
encryptedSecurityCode: paymentCards.encryptedSecurityCodes.matches
};
});
cy.fixture("addresses")
.then(addresses => {
address = addresses.usAddress;
getDefaultChannel();
})
.then(channelResp => {
defaultChannel = channelResp;
createShipping({
channelId: channelResp.id,
name,
address,
price: 10
});
})
.then(
({
warehouse: warehouseResp,
shippingZone: shippingZoneResp,
shippingMethod: shippingMethodResp
}) => {
warehouse = warehouseResp;
shippingMethod = shippingMethodResp;
}
);
createTypeAttributeAndCategoryForProduct(name)
.then(({ productType, attribute, category }) => {
createProductInChannel({
name,
channelId: defaultChannel.id,
warehouseId: warehouse.id,
productTypeId: productType.id,
attributeId: attribute.id,
categoryId: category.id
});
})
.then(({ variantsList: variants }) => (variantsList = variants));
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
createCheckout({
channelSlug: defaultChannel.slug,
email,
variantsList,
address,
billingAddress: address,
auth: "token"
})
.then(checkoutResp => {
checkout = checkoutResp;
addShippingMethod(checkout.id, shippingMethod.id);
})
.then(({ checkout: checkoutResp }) => {
addAdyenPayment(checkout.id, checkoutResp.totalPrice.gross.amount);
});
});
it("should purchase products with simple card", () => {
const simpleCard = cardData;
simpleCard.encryptedCardNumber =
paymentCards.cards.simpleCard.encryptedCardNumber;
simpleCard.brand = paymentCards.cards.simpleCard.brand;
completeCheckout(checkout.id, simpleCard)
.then(({ order }) => {
getOrder(order.id);
})
.then(order => {
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
});
});
it("should purchase product with 3D secure 2 Auth", () => {
const threeDSecureCard = cardData;
threeDSecureCard.encryptedCardNumber =
paymentCards.cards.threeDSecureTwoAuth.encryptedCardNumber;
threeDSecureCard.brand = paymentCards.cards.threeDSecureTwoAuth.brand;
completeCheckout(checkout.id, threeDSecureCard)
.then(({ order }) => {
getOrder(order.id);
})
.then(order => {
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
});
});
it("should purchase product with 3D secure 1 Auth", () => {
const threeDSecureCardOneAuth = cardData;
threeDSecureCardOneAuth.encryptedCardNumber =
paymentCards.cards.threeDSecureOneAuth.encryptedCardNumber;
threeDSecureCardOneAuth.brand =
paymentCards.cards.threeDSecureOneAuth.brand;
completeCheckout(checkout.id, threeDSecureCardOneAuth)
.then(({ order }) => {
getOrder(order.id);
})
.then(order => {
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
});
});
it("should fail with unknown security number", () => {
const simpleCard = cardData;
simpleCard.encryptedCardNumber =
paymentCards.cards.simpleCard.encryptedCardNumber;
simpleCard.brand = paymentCards.cards.simpleCard.brand;
simpleCard.encryptedSecurityCode =
paymentCards.encryptedSecurityCodes.unknown;
completeCheckout(checkout.id, simpleCard).then(({ checkoutErrors }) => {
expect(checkoutErrors).to.have.length(1);
});
});
it("should fail with timeout in 3D authorization", () => {
const errorCard = cardData;
errorCard.encryptedCardNumber =
paymentCards.cards.errorCard.encryptedCardNumber;
errorCard.brand = paymentCards.cards.errorCard.brand;
completeCheckout(checkout.id, errorCard).then(({ checkoutErrors }) => {
expect(checkoutErrors).to.have.length(1);
});
});
it("should fail with closed account", () => {
const closeAccount = cardData;
closeAccount.encryptedCardNumber =
paymentCards.cards.closeAccount.encryptedCardNumber;
closeAccount.brand = paymentCards.cards.closeAccount.brand;
completeCheckout(checkout.id, closeAccount).then(({ checkoutErrors }) => {
expect(checkoutErrors).to.have.length(1);
});
});
});

View file

@ -1,13 +1,16 @@
import { ASSIGN_PRODUCTS_SELECTORS } from "../elements/catalog/products/assign-products-selectors"; import { ASSIGN_PRODUCTS_SELECTORS } from "../elements/catalog/products/assign-products-selectors";
import { DRAFT_ORDER_SELECTORS } from "../elements/orders/draft-order-selectors"; import { DRAFT_ORDER_SELECTORS } from "../elements/orders/draft-order-selectors";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../elements/shared/sharedElements";
import { SELECT_SHIPPING_METHOD_FORM } from "../elements/shipping/select-shipping-method-form"; import { SELECT_SHIPPING_METHOD_FORM } from "../elements/shipping/select-shipping-method-form";
import { fillUpAddressForm } from "./shared/addressForm";
export function finalizeDraftOrder(name, address) { export function finalizeDraftOrder(name, address) {
cy.get(DRAFT_ORDER_SELECTORS.addProducts) cy.get(DRAFT_ORDER_SELECTORS.addProducts)
.click() .click()
.get(ASSIGN_PRODUCTS_SELECTORS.searchInput) .get(ASSIGN_PRODUCTS_SELECTORS.searchInput)
.type(name); .type(name)
.get(SHARED_ELEMENTS.progressBar)
.should("not.be.visible");
cy.contains(ASSIGN_PRODUCTS_SELECTORS.tableRow, name) cy.contains(ASSIGN_PRODUCTS_SELECTORS.tableRow, name)
.find(ASSIGN_PRODUCTS_SELECTORS.checkbox) .find(ASSIGN_PRODUCTS_SELECTORS.checkbox)
.click() .click()
@ -21,12 +24,11 @@ export function finalizeDraftOrder(name, address) {
.click() .click()
.get(DRAFT_ORDER_SELECTORS.customerEmail) .get(DRAFT_ORDER_SELECTORS.customerEmail)
.should("be.visible") .should("be.visible")
.get(DRAFT_ORDER_SELECTORS.editShippingAddress) .get(SHARED_ELEMENTS.skeleton)
.click(); .should("not.exist")
fillUpAddressForm(address); .get(BUTTON_SELECTORS.submit)
cy.get(DRAFT_ORDER_SELECTORS.editBillingAddress).click(); .click()
fillUpAddressForm(address); .get(DRAFT_ORDER_SELECTORS.addShippingCarrierLink)
cy.get(DRAFT_ORDER_SELECTORS.addShippingCarrierLink)
.click() .click()
.get(SELECT_SHIPPING_METHOD_FORM.selectShippingMethod) .get(SELECT_SHIPPING_METHOD_FORM.selectShippingMethod)
.click() .click()

View file

@ -1,4 +1,5 @@
import { ADDRESS_SELECTORS } from "../../elements/shared/addressForm"; import { ADDRESS_SELECTORS } from "../../elements/shared/addressForm";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { fillAutocompleteSelect } from "./autocompleteSelect"; import { fillAutocompleteSelect } from "./autocompleteSelect";
export function fillUpAddressForm(address) { export function fillUpAddressForm(address) {
@ -21,6 +22,6 @@ export function fillUpAddressForm(address) {
fillAutocompleteSelect(ADDRESS_SELECTORS.country, address.countryFullName); fillAutocompleteSelect(ADDRESS_SELECTORS.country, address.countryFullName);
cy.get(ADDRESS_SELECTORS.countryArea) cy.get(ADDRESS_SELECTORS.countryArea)
.type(address.countryArea) .type(address.countryArea)
.get(ADDRESS_SELECTORS.saveButton) .get(BUTTON_SELECTORS.submit)
.click(); .click();
} }

View file

@ -54,3 +54,10 @@ Cypress.Commands.add("sendRequestWithQuery", (query, authorization = "auth") =>
url: urlList.apiUri url: urlList.apiUri
}) })
); );
Cypress.on(
"uncaught:exception",
(err, runnable) =>
// returning false here prevents Cypress from
// failing the test
false
);

View file

@ -19,8 +19,9 @@ export function createWaitingForCaptureOrder(
}) })
.then(() => addPayment(checkout.id)) .then(() => addPayment(checkout.id))
.then(() => checkoutRequest.completeCheckout(checkout.id)) .then(() => checkoutRequest.completeCheckout(checkout.id))
.then(order => ({ checkout, order })); .then(({ order }) => ({ checkout, order }));
} }
export function createCheckoutWithVoucher({ export function createCheckoutWithVoucher({
channelSlug, channelSlug,
email = "email@example.com", email = "email@example.com",
@ -51,7 +52,8 @@ export function createReadyToFulfillOrder(
address address
) { ) {
let order; let order;
return createDraftOrder(customerId, shippingMethodId, channelId, address) return orderRequest
.createDraftOrder(customerId, shippingMethodId, channelId, address)
.then(orderResp => { .then(orderResp => {
order = orderResp; order = orderResp;
assignVariantsToOrder(order, variantsList); assignVariantsToOrder(order, variantsList);
@ -68,7 +70,8 @@ export function createOrder({
address address
}) { }) {
let order; let order;
return createDraftOrder(customerId, shippingMethodId, channelId, address) return orderRequest
.createDraftOrder(customerId, shippingMethodId, channelId, address)
.then(orderResp => { .then(orderResp => {
order = orderResp; order = orderResp;
assignVariantsToOrder(order, variantsList); assignVariantsToOrder(order, variantsList);
@ -83,16 +86,22 @@ function assignVariantsToOrder(order, variantsList) {
}); });
} }
export function createDraftOrder( export function addPayment(checkoutId) {
customerId, return checkoutRequest.addPayment({
shippingMethodId, checkoutId,
channelId, gateway: "mirumee.payments.dummy",
address token: "not-charged"
) { });
return orderRequest
.createDraftOrder(customerId, shippingMethodId, channelId, address)
.its("body.data.draftOrderCreate.order");
} }
export function addAdyenPayment(checkoutId, amount) {
return checkoutRequest.addPayment({
checkoutId,
gateway: "mirumee.payments.adyen",
amount
});
}
export function createAndCompleteCheckoutWithoutShipping({ export function createAndCompleteCheckoutWithoutShipping({
channelSlug, channelSlug,
email, email,
@ -108,5 +117,5 @@ export function createAndCompleteCheckoutWithoutShipping({
addPayment(checkout.id); addPayment(checkout.id);
}) })
.then(() => checkoutRequest.completeCheckout(checkout.id)) .then(() => checkoutRequest.completeCheckout(checkout.id))
.then(order => ({ checkout, order })); .then(({ order }) => ({ checkout, order }));
} }

295
package-lock.json generated
View file

@ -1706,12 +1706,6 @@
"restore-cursor": "^1.0.1" "restore-cursor": "^1.0.1"
} }
}, },
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"onetime": { "onetime": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
@ -1773,17 +1767,6 @@
"uuid": "^3.3.2" "uuid": "^3.3.2"
}, },
"dependencies": { "dependencies": {
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"dev": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"qs": { "qs": {
"version": "6.5.2", "version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
@ -5786,9 +5769,9 @@
"dev": true "dev": true
}, },
"@types/sizzle": { "@types/sizzle": {
"version": "2.3.2", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz",
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==", "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==",
"dev": true "dev": true
}, },
"@types/source-list-map": { "@types/source-list-map": {
@ -10972,19 +10955,19 @@
"dev": true "dev": true
}, },
"cypress": { "cypress": {
"version": "6.9.1", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-6.9.1.tgz", "resolved": "https://registry.npmjs.org/cypress/-/cypress-7.2.0.tgz",
"integrity": "sha512-/RVx6sOhsyTR9sd9v0BHI4tnDZAhsH9rNat7CIKCUEr5VPWxyfGH0EzK4IHhAqAH8vjFcD4U14tPiJXshoUrmQ==", "integrity": "sha512-lHHGay+YsffDn4M0bkkwezylBVHUpwwhtqte4LNPrFRCHy77X38+1PUe3neFb3glVTM+rbILtTN6FhO2djcOuQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@cypress/listr-verbose-renderer": "^0.4.1", "@cypress/listr-verbose-renderer": "^0.4.1",
"@cypress/request": "^2.88.5", "@cypress/request": "^2.88.5",
"@cypress/xvfb": "^1.2.4", "@cypress/xvfb": "^1.2.4",
"@types/node": "12.12.50", "@types/node": "^14.14.31",
"@types/sinonjs__fake-timers": "^6.0.1", "@types/sinonjs__fake-timers": "^6.0.2",
"@types/sizzle": "^2.3.2", "@types/sizzle": "^2.3.2",
"arch": "^2.1.2", "arch": "^2.2.0",
"blob-util": "2.0.2", "blob-util": "^2.0.2",
"bluebird": "^3.7.2", "bluebird": "^3.7.2",
"cachedir": "^2.3.0", "cachedir": "^2.3.0",
"chalk": "^4.1.0", "chalk": "^4.1.0",
@ -10992,49 +10975,59 @@
"cli-table3": "~0.6.0", "cli-table3": "~0.6.0",
"commander": "^5.1.0", "commander": "^5.1.0",
"common-tags": "^1.8.0", "common-tags": "^1.8.0",
"dayjs": "^1.9.3", "dayjs": "^1.10.4",
"debug": "4.3.2", "debug": "4.3.2",
"eventemitter2": "^6.4.2", "eventemitter2": "^6.4.3",
"execa": "^4.0.2", "execa": "4.1.0",
"executable": "^4.1.1", "executable": "^4.1.1",
"extract-zip": "^1.7.0", "extract-zip": "^1.7.0",
"fs-extra": "^9.0.1", "fs-extra": "^9.1.0",
"getos": "^3.2.1", "getos": "^3.2.1",
"is-ci": "^2.0.0", "is-ci": "^3.0.0",
"is-installed-globally": "^0.3.2", "is-installed-globally": "~0.4.0",
"lazy-ass": "^1.6.0", "lazy-ass": "^1.6.0",
"listr": "^0.14.3", "listr": "^0.14.3",
"lodash": "^4.17.19", "lodash": "^4.17.21",
"log-symbols": "^4.0.0", "log-symbols": "^4.0.0",
"minimist": "^1.2.5", "minimist": "^1.2.5",
"moment": "^2.29.1",
"ospath": "^1.2.2", "ospath": "^1.2.2",
"pretty-bytes": "^5.4.1", "pretty-bytes": "^5.6.0",
"ramda": "~0.27.1", "ramda": "~0.27.1",
"request-progress": "^3.0.0", "request-progress": "^3.0.0",
"supports-color": "^7.2.0", "supports-color": "^8.1.1",
"tmp": "~0.2.1", "tmp": "~0.2.1",
"untildify": "^4.0.0", "untildify": "^4.0.0",
"url": "^0.11.0", "url": "^0.11.0",
"yauzl": "^2.10.0" "yauzl": "^2.10.0"
}, },
"dependencies": { "dependencies": {
"@types/node": {
"version": "12.12.50",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.50.tgz",
"integrity": "sha512-5ImO01Fb8YsEOYpV+aeyGYztcYcjGsBvN4D7G5r1ef2cuQOpymjWNQi5V0rKHE6PC2ru3HkoUr/Br2/8GUA84w==",
"dev": true
},
"chalk": { "chalk": {
"version": "4.1.0", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-styles": "^4.1.0", "ansi-styles": "^4.1.0",
"supports-color": "^7.1.0" "supports-color": "^7.1.0"
},
"dependencies": {
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
} }
}, },
"ci-info": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.1.1.tgz",
"integrity": "sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ==",
"dev": true
},
"cli-table3": { "cli-table3": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz",
@ -11052,17 +11045,6 @@
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
"dev": true "dev": true
}, },
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"debug": { "debug": {
"version": "4.3.2", "version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
@ -11072,23 +11054,6 @@
"ms": "2.1.2" "ms": "2.1.2"
} }
}, },
"execa": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
"integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.0",
"get-stream": "^5.0.0",
"human-signals": "^1.1.1",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.0",
"onetime": "^5.1.0",
"signal-exit": "^3.0.2",
"strip-final-newline": "^2.0.0"
}
},
"fs-extra": { "fs-extra": {
"version": "9.1.0", "version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
@ -11101,21 +11066,21 @@
"universalify": "^2.0.0" "universalify": "^2.0.0"
} }
}, },
"get-stream": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
"integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
"dev": true,
"requires": {
"pump": "^3.0.0"
}
},
"has-flag": { "has-flag": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true "dev": true
}, },
"is-ci": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.0.tgz",
"integrity": "sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ==",
"dev": true,
"requires": {
"ci-info": "^3.1.1"
}
},
"jsonfile": { "jsonfile": {
"version": "6.1.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
@ -11136,31 +11101,10 @@
"is-unicode-supported": "^0.1.0" "is-unicode-supported": "^0.1.0"
} }
}, },
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"supports-color": { "supports-color": {
"version": "7.2.0", "version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"has-flag": "^4.0.0" "has-flag": "^4.0.0"
@ -11180,15 +11124,6 @@
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true "dev": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
} }
} }
}, },
@ -12414,6 +12349,12 @@
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
"dev": true "dev": true
}, },
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"escodegen": { "escodegen": {
"version": "1.14.3", "version": "1.14.3",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
@ -13064,6 +13005,66 @@
"integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==", "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==",
"dev": true "dev": true
}, },
"execa": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
"integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.0",
"get-stream": "^5.0.0",
"human-signals": "^1.1.1",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.0",
"onetime": "^5.1.0",
"signal-exit": "^3.0.2",
"strip-final-newline": "^2.0.0"
},
"dependencies": {
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"executable": { "executable": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz",
@ -13465,15 +13466,6 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"mkdirp": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true,
"requires": {
"minimist": "^1.2.5"
}
},
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@ -14199,6 +14191,17 @@
} }
} }
}, },
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"dev": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"format": { "format": {
"version": "0.2.2", "version": "0.2.2",
"resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
@ -14467,6 +14470,15 @@
"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==",
"dev": true "dev": true
}, },
"get-stream": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
"integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
"dev": true,
"requires": {
"pump": "^3.0.0"
}
},
"get-value": { "get-value": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
@ -14784,18 +14796,18 @@
} }
}, },
"global-dirs": { "global-dirs": {
"version": "2.1.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz",
"integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==",
"dev": true, "dev": true,
"requires": { "requires": {
"ini": "1.3.7" "ini": "2.0.0"
}, },
"dependencies": { "dependencies": {
"ini": { "ini": {
"version": "1.3.7", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz",
"integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==",
"dev": true "dev": true
} }
} }
@ -16397,13 +16409,13 @@
"integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU=" "integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU="
}, },
"is-installed-globally": { "is-installed-globally": {
"version": "0.3.2", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz",
"integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"global-dirs": "^2.0.1", "global-dirs": "^3.0.0",
"is-path-inside": "^3.0.1" "is-path-inside": "^3.0.2"
} }
}, },
"is-interactive": { "is-interactive": {
@ -19700,6 +19712,15 @@
} }
} }
}, },
"mkdirp": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true,
"requires": {
"minimist": "^1.2.5"
}
},
"mock-apollo-client": { "mock-apollo-client": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/mock-apollo-client/-/mock-apollo-client-0.4.0.tgz", "resolved": "https://registry.npmjs.org/mock-apollo-client/-/mock-apollo-client-0.4.0.tgz",

View file

@ -134,7 +134,7 @@
"codecov": "^3.7.1", "codecov": "^3.7.1",
"core-js": "^3.7.0", "core-js": "^3.7.0",
"cross-env": "^6.0.3", "cross-env": "^6.0.3",
"cypress": "^6.9.1", "cypress": "^7.2.0",
"enzyme": "^3.11.0", "enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5", "enzyme-adapter-react-16": "^1.15.5",
"enzyme-to-json": "^3.6.1", "enzyme-to-json": "^3.6.1",
@ -239,6 +239,7 @@
"cy:run": "cypress run", "cy:run": "cypress run",
"cy:run:record": "npm run cy:run -- --record", "cy:run:record": "npm run cy:run -- --record",
"cy:open": "cypress open", "cy:open": "cypress open",
"cy:run:allEnv": "cypress run --spec 'cypress/integration/stagedOnly/*'",
"test:e2e:run": "start-server-and-test start http://localhost:9000 cy:run", "test:e2e:run": "start-server-and-test start http://localhost:9000 cy:run",
"test:e2e:run:record": "start-server-and-test start http://localhost:9000 cy:run:record", "test:e2e:run:record": "start-server-and-test start http://localhost:9000 cy:run:record",
"test:e2e:dev": "start-server-and-test start http://localhost:9000 cy:open", "test:e2e:dev": "start-server-and-test start http://localhost:9000 cy:open",

View file

@ -42,6 +42,7 @@ const Skeleton: React.FC<SkeletonProps> = props => {
return ( return (
<span <span
data-test-id="skeleton"
className={classNames(classes.skeleton, className, { className={classNames(classes.skeleton, className, {
[classes.primary]: primary [classes.primary]: primary
})} })}

View file

@ -6,6 +6,7 @@ const ChevronDown: React.FC = () => {
return ( return (
<svg <svg
data-test-id="expand-icon"
width="10" width="10"
height="7" height="7"
viewBox="0 0 10 7" viewBox="0 0 10 7"

View file

@ -248,6 +248,7 @@ const OrderCustomerAddressesEditDialog: React.FC<OrderCustomerAddressesEditDialo
color="primary" color="primary"
variant="contained" variant="contained"
type="submit" type="submit"
data-test="submit"
> >
<FormattedMessage {...buttonMessages.select} /> <FormattedMessage {...buttonMessages.select} />
</ConfirmButton> </ConfirmButton>

File diff suppressed because it is too large Load diff