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)"
- 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
env:
API_URI: ${{ steps.api_uri.outputs.custom_api_uri || secrets.API_URI }}
@ -106,7 +124,7 @@ jobs:
with:
name: cypress-videos
path: cypress/videos
translation-messages:
runs-on: ubuntu-latest
steps:

View file

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

View file

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

View file

@ -25,3 +25,7 @@ export function getVariantsLines(variantsList, quantity) {
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 = {
menageChannelsButton: "[data-test-id='channels-availiability-manage-button']",
assignedChannels: "[class*=expandIcon]",
assignedChannels: "[data-test-id='expand-icon']",
publishedRadioButtons: "[name*='isPublished']",
availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']",
radioButtonsValueTrue: "[value='true']",

View file

@ -8,5 +8,5 @@ export const BUTTON_SELECTORS = {
selectOption: "[data-test*='select-option']",
notSelectedOption: ":not([aria-selected])",
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 = {
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",
"currency": "PLN",
"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" />
import faker from "faker";
import { createChannel } from "../apiRequests/Channels";
import { updateChannelInProduct } from "../apiRequests/Product";
import { getCollection } from "../apiRequests/storeFront/Collections";
import { searchInShop } from "../apiRequests/storeFront/Search";
import { createChannel } from "../../apiRequests/Channels";
import { updateChannelInProduct } from "../../apiRequests/Product";
import { getCollection } from "../../apiRequests/storeFront/Collections";
import { searchInShop } from "../../apiRequests/storeFront/Search";
import {
assignProductsToCollection,
createCollection
} from "../steps/collectionsSteps";
import { urlList } from "../url/urlList";
import * as channelsUtils from "../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../utils/collectionsUtils";
import * as productsUtils from "../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../utils/shippingUtils";
} from "../../steps/collectionsSteps";
import { urlList } from "../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../../utils/collectionsUtils";
import * as productsUtils from "../../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../utils/shippingUtils";
import {
isCollectionVisible,
isProductInCollectionVisible
} from "../utils/storeFront/collectionsUtils";
import { isProductVisibleInSearchResult } from "../utils/storeFront/storeFrontProductUtils";
} from "../../utils/storeFront/collectionsUtils";
import { isProductVisibleInSearchResult } from "../../utils/storeFront/storeFrontProductUtils";
describe("Collections", () => {
const startsWith = "CyCollections-";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,18 +4,18 @@ import faker from "faker";
import {
createCustomer,
deleteCustomersStartsWith
} from "../../apiRequests/Customer";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
import { selectChannelInPicker } from "../../steps/channelsSteps";
import { finalizeDraftOrder } from "../../steps/draftOrderSteps";
import { urlList } from "../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { createOrder } from "../../utils/ordersUtils";
import * as productsUtils from "../../utils/products/productsUtils";
} from "../../../apiRequests/Customer";
import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors";
import { selectChannelInPicker } from "../../../steps/channelsSteps";
import { finalizeDraftOrder } from "../../../steps/draftOrderSteps";
import { urlList } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import { createOrder } from "../../../utils/ordersUtils";
import * as productsUtils from "../../../utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../../utils/shippingUtils";
describe("Orders", () => {
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" />
import faker from "faker";
import { createAttribute } from "../../apiRequests/Attribute";
import { createTypeProduct } from "../../apiRequests/Product";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
import { PRODUCTS_LIST } from "../../elements/catalog/products/products-list";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { metadataForms } from "../../steps/catalog/metadataSteps";
import { createAttribute } from "../../../apiRequests/Attribute";
import { createTypeProduct } from "../../../apiRequests/Product";
import { PRODUCT_DETAILS } from "../../../elements/catalog/products/product-details";
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { metadataForms } from "../../../steps/catalog/metadataSteps";
import {
fillUpPriceList,
priceInputLists
} from "../../steps/catalog/products/priceList";
import { fillUpCommonFieldsForAllProductTypes } from "../../steps/catalog/products/productSteps";
import { selectChannelInDetailsPages } from "../../steps/channelsSteps";
import { urlList } from "../../url/urlList";
} from "../../../steps/catalog/products/priceList";
import { fillUpCommonFieldsForAllProductTypes } from "../../../steps/catalog/products/productSteps";
import { selectChannelInDetailsPages } from "../../../steps/channelsSteps";
import { urlList } from "../../../url/urlList";
import {
expectCorrectProductInformation,
expectCorrectProductVariantInformation
} from "../../utils/products/checkProductInfo";
import * as productUtils from "../../utils/products/productsUtils";
} from "../../../utils/products/checkProductInfo";
import * as productUtils from "../../../utils/products/productsUtils";
describe("Create product", () => {
const startsWith = "CyCreateProduct-";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,21 +1,21 @@
import faker from "faker";
import { createCategory } from "../../apiRequests/Category";
import { createCollection } from "../../apiRequests/Collections";
import { getProductDetails } from "../../apiRequests/storeFront/ProductDetails";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { metadataForms } from "../../steps/catalog/metadataSteps";
import { fillUpCommonFieldsForAllProductTypes } from "../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../../utils/collectionsUtils";
import { expectCorrectProductInformation } from "../../utils/products/checkProductInfo";
import { createCategory } from "../../../apiRequests/Category";
import { createCollection } from "../../../apiRequests/Collections";
import { getProductDetails } from "../../../apiRequests/storeFront/ProductDetails";
import { PRODUCT_DETAILS } from "../../../elements/catalog/products/product-details";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { metadataForms } from "../../../steps/catalog/metadataSteps";
import { fillUpCommonFieldsForAllProductTypes } from "../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../../../utils/collectionsUtils";
import { expectCorrectProductInformation } from "../../../utils/products/checkProductInfo";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
} from "../../../utils/products/productsUtils";
describe("Update products", () => {
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 { 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 { fillUpAddressForm } from "./shared/addressForm";
export function finalizeDraftOrder(name, address) {
cy.get(DRAFT_ORDER_SELECTORS.addProducts)
.click()
.get(ASSIGN_PRODUCTS_SELECTORS.searchInput)
.type(name);
.type(name)
.get(SHARED_ELEMENTS.progressBar)
.should("not.be.visible");
cy.contains(ASSIGN_PRODUCTS_SELECTORS.tableRow, name)
.find(ASSIGN_PRODUCTS_SELECTORS.checkbox)
.click()
@ -21,12 +24,11 @@ export function finalizeDraftOrder(name, address) {
.click()
.get(DRAFT_ORDER_SELECTORS.customerEmail)
.should("be.visible")
.get(DRAFT_ORDER_SELECTORS.editShippingAddress)
.click();
fillUpAddressForm(address);
cy.get(DRAFT_ORDER_SELECTORS.editBillingAddress).click();
fillUpAddressForm(address);
cy.get(DRAFT_ORDER_SELECTORS.addShippingCarrierLink)
.get(SHARED_ELEMENTS.skeleton)
.should("not.exist")
.get(BUTTON_SELECTORS.submit)
.click()
.get(DRAFT_ORDER_SELECTORS.addShippingCarrierLink)
.click()
.get(SELECT_SHIPPING_METHOD_FORM.selectShippingMethod)
.click()

View file

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

View file

@ -54,3 +54,10 @@ Cypress.Commands.add("sendRequestWithQuery", (query, authorization = "auth") =>
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(() => checkoutRequest.completeCheckout(checkout.id))
.then(order => ({ checkout, order }));
.then(({ order }) => ({ checkout, order }));
}
export function createCheckoutWithVoucher({
channelSlug,
email = "email@example.com",
@ -51,7 +52,8 @@ export function createReadyToFulfillOrder(
address
) {
let order;
return createDraftOrder(customerId, shippingMethodId, channelId, address)
return orderRequest
.createDraftOrder(customerId, shippingMethodId, channelId, address)
.then(orderResp => {
order = orderResp;
assignVariantsToOrder(order, variantsList);
@ -68,7 +70,8 @@ export function createOrder({
address
}) {
let order;
return createDraftOrder(customerId, shippingMethodId, channelId, address)
return orderRequest
.createDraftOrder(customerId, shippingMethodId, channelId, address)
.then(orderResp => {
order = orderResp;
assignVariantsToOrder(order, variantsList);
@ -83,16 +86,22 @@ function assignVariantsToOrder(order, variantsList) {
});
}
export function createDraftOrder(
customerId,
shippingMethodId,
channelId,
address
) {
return orderRequest
.createDraftOrder(customerId, shippingMethodId, channelId, address)
.its("body.data.draftOrderCreate.order");
export function addPayment(checkoutId) {
return checkoutRequest.addPayment({
checkoutId,
gateway: "mirumee.payments.dummy",
token: "not-charged"
});
}
export function addAdyenPayment(checkoutId, amount) {
return checkoutRequest.addPayment({
checkoutId,
gateway: "mirumee.payments.adyen",
amount
});
}
export function createAndCompleteCheckoutWithoutShipping({
channelSlug,
email,
@ -108,5 +117,5 @@ export function createAndCompleteCheckoutWithoutShipping({
addPayment(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"
}
},
"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": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
@ -1773,17 +1767,6 @@
"uuid": "^3.3.2"
},
"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": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
@ -5786,9 +5769,9 @@
"dev": true
},
"@types/sizzle": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==",
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz",
"integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==",
"dev": true
},
"@types/source-list-map": {
@ -10972,19 +10955,19 @@
"dev": true
},
"cypress": {
"version": "6.9.1",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-6.9.1.tgz",
"integrity": "sha512-/RVx6sOhsyTR9sd9v0BHI4tnDZAhsH9rNat7CIKCUEr5VPWxyfGH0EzK4IHhAqAH8vjFcD4U14tPiJXshoUrmQ==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-7.2.0.tgz",
"integrity": "sha512-lHHGay+YsffDn4M0bkkwezylBVHUpwwhtqte4LNPrFRCHy77X38+1PUe3neFb3glVTM+rbILtTN6FhO2djcOuQ==",
"dev": true,
"requires": {
"@cypress/listr-verbose-renderer": "^0.4.1",
"@cypress/request": "^2.88.5",
"@cypress/xvfb": "^1.2.4",
"@types/node": "12.12.50",
"@types/sinonjs__fake-timers": "^6.0.1",
"@types/node": "^14.14.31",
"@types/sinonjs__fake-timers": "^6.0.2",
"@types/sizzle": "^2.3.2",
"arch": "^2.1.2",
"blob-util": "2.0.2",
"arch": "^2.2.0",
"blob-util": "^2.0.2",
"bluebird": "^3.7.2",
"cachedir": "^2.3.0",
"chalk": "^4.1.0",
@ -10992,49 +10975,59 @@
"cli-table3": "~0.6.0",
"commander": "^5.1.0",
"common-tags": "^1.8.0",
"dayjs": "^1.9.3",
"dayjs": "^1.10.4",
"debug": "4.3.2",
"eventemitter2": "^6.4.2",
"execa": "^4.0.2",
"eventemitter2": "^6.4.3",
"execa": "4.1.0",
"executable": "^4.1.1",
"extract-zip": "^1.7.0",
"fs-extra": "^9.0.1",
"fs-extra": "^9.1.0",
"getos": "^3.2.1",
"is-ci": "^2.0.0",
"is-installed-globally": "^0.3.2",
"is-ci": "^3.0.0",
"is-installed-globally": "~0.4.0",
"lazy-ass": "^1.6.0",
"listr": "^0.14.3",
"lodash": "^4.17.19",
"lodash": "^4.17.21",
"log-symbols": "^4.0.0",
"minimist": "^1.2.5",
"moment": "^2.29.1",
"ospath": "^1.2.2",
"pretty-bytes": "^5.4.1",
"pretty-bytes": "^5.6.0",
"ramda": "~0.27.1",
"request-progress": "^3.0.0",
"supports-color": "^7.2.0",
"supports-color": "^8.1.1",
"tmp": "~0.2.1",
"untildify": "^4.0.0",
"url": "^0.11.0",
"yauzl": "^2.10.0"
},
"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": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
"integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
"dev": true,
"requires": {
"ansi-styles": "^4.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": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz",
@ -11052,17 +11045,6 @@
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
"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": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
@ -11072,23 +11054,6 @@
"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": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
@ -11101,21 +11066,21 @@
"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": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"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": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
@ -11136,31 +11101,10 @@
"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": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
@ -11180,15 +11124,6 @@
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"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=",
"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": {
"version": "1.14.3",
"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==",
"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": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz",
@ -13465,15 +13466,6 @@
"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": {
"version": "2.0.0",
"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": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
@ -14467,6 +14470,15 @@
"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==",
"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": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
@ -14784,18 +14796,18 @@
}
},
"global-dirs": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz",
"integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz",
"integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==",
"dev": true,
"requires": {
"ini": "1.3.7"
"ini": "2.0.0"
},
"dependencies": {
"ini": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz",
"integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz",
"integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==",
"dev": true
}
}
@ -16397,13 +16409,13 @@
"integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU="
},
"is-installed-globally": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz",
"integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==",
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz",
"integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==",
"dev": true,
"requires": {
"global-dirs": "^2.0.1",
"is-path-inside": "^3.0.1"
"global-dirs": "^3.0.0",
"is-path-inside": "^3.0.2"
}
},
"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": {
"version": "0.4.0",
"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",
"core-js": "^3.7.0",
"cross-env": "^6.0.3",
"cypress": "^6.9.1",
"cypress": "^7.2.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"enzyme-to-json": "^3.6.1",
@ -239,6 +239,7 @@
"cy:run": "cypress run",
"cy:run:record": "npm run cy:run -- --record",
"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: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",

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff