diff --git a/.gitignore b/.gitignore
index 80a435b58..5276cad05 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,9 @@ dist/
/media/
/node_modules/
/static/
+/videos/
+/screenshots/
+/results/
/saleor/static/assets/
webpack-bundle.json
/templates/templated_email/compiled/*
diff --git a/cypress.json b/cypress.json
index 9341eab2a..9380de1ab 100644
--- a/cypress.json
+++ b/cypress.json
@@ -3,5 +3,8 @@
"defaultCommandTimeout": 15000,
"requestTimeout": 15000,
"viewportWidth": 1400,
- "viewportHeight": 660
-}
+ "viewportHeight": 660,
+ "retries": {
+ "runMode": 2
+ }
+}
\ No newline at end of file
diff --git a/cypress/apiRequests/Product.js b/cypress/apiRequests/Product.js
index 6e6a102d1..2ccd8527f 100644
--- a/cypress/apiRequests/Product.js
+++ b/cypress/apiRequests/Product.js
@@ -112,6 +112,7 @@ export function createVariant({
warehouseId,
quantity,
channelId,
+ attributeId,
price = 1,
costPrice = 1
}) {
@@ -134,7 +135,10 @@ export function createVariant({
const mutation = `mutation{
productVariantBulkCreate(product: "${productId}", variants: {
- attributes: []
+ attributes: [{
+ id:"${attributeId}"
+ values: ["value"]
+ }]
sku: "${sku}"
${channelListings}
${stocks}
diff --git a/cypress/elements/catalog/products/product-details.js b/cypress/elements/catalog/products/product-details.js
index e7a94040c..1a80f1515 100644
--- a/cypress/elements/catalog/products/product-details.js
+++ b/cypress/elements/catalog/products/product-details.js
@@ -12,5 +12,6 @@ export const PRODUCT_DETAILS = {
addVariantsButton: "[data-test*='button-add-variant']",
descriptionInput: "[data-test-id='description']",
ratingInput: "[name='rating']",
- skuInput: "[name='sku']"
+ skuInput: "[name='sku']",
+ variantRow: "[data-test-id='product-variant-row']"
};
diff --git a/cypress/elements/shared/button-selectors.js b/cypress/elements/shared/button-selectors.js
index 94540610c..1a6fa43e6 100644
--- a/cypress/elements/shared/button-selectors.js
+++ b/cypress/elements/shared/button-selectors.js
@@ -1,5 +1,5 @@
export const BUTTON_SELECTORS = {
- back: '[data-test="back"]',
+ back: '[data-test-id="app-header-back-button"]',
submit: '[data-test="submit"]',
confirm: '[data-test="button-bar-confirm"]',
goBackButton: "[data-test-id='app-header-back-button']",
diff --git a/cypress/integration/collections.js b/cypress/integration/collections.js
index c31e341ca..c41de4a10 100644
--- a/cypress/integration/collections.js
+++ b/cypress/integration/collections.js
@@ -20,7 +20,7 @@ import {
import { isProductVisibleInSearchResult } from "../utils/storeFront/storeFrontProductUtils";
describe("Collections", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyCollections-";
const name = `${startsWith}${faker.random.number()}`;
let attribute;
diff --git a/cypress/integration/configuration/channels.js b/cypress/integration/configuration/channels.js
index 87656477b..a18a46e6c 100644
--- a/cypress/integration/configuration/channels.js
+++ b/cypress/integration/configuration/channels.js
@@ -14,12 +14,13 @@ 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 = "Cypress:";
+ const channelStartsWith = `CyChannels:`;
const currency = "PLN";
before(() => {
@@ -67,6 +68,10 @@ 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(PRODUCTS_LIST.productsList)
.first()
.click()
diff --git a/cypress/integration/configuration/shippingMethod.js b/cypress/integration/configuration/shippingMethod.js
index f5443f01a..68934ca4d 100644
--- a/cypress/integration/configuration/shippingMethod.js
+++ b/cypress/integration/configuration/shippingMethod.js
@@ -21,7 +21,7 @@ import * as shippingUtils from "../../utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../utils/storeFront/checkoutUtils";
describe("Shipping methods", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyShippingMethods-";
const name = `${startsWith}${faker.random.number()}`;
const price = 8;
let defaultChannel;
diff --git a/cypress/integration/discounts/sales.js b/cypress/integration/discounts/sales.js
index 8df14d6c4..1e92afce3 100644
--- a/cypress/integration/discounts/sales.js
+++ b/cypress/integration/discounts/sales.js
@@ -19,7 +19,7 @@ import {
import { getProductPrice } from "../../utils/storeFront/storeFrontProductUtils";
describe("Sales discounts", () => {
- const startsWith = "Cy-";
+ const startsWith = "CySales-";
let productType;
let attribute;
diff --git a/cypress/integration/discounts/vouchers.js b/cypress/integration/discounts/vouchers.js
index 74dbe32f3..ed7782592 100644
--- a/cypress/integration/discounts/vouchers.js
+++ b/cypress/integration/discounts/vouchers.js
@@ -16,7 +16,7 @@ import {
} from "../../utils/shippingUtils";
describe("Vouchers discounts", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyVou-";
const productPrice = 100;
const shippingPrice = 100;
diff --git a/cypress/integration/homePage/homePageAnalitics.js b/cypress/integration/homePage/homePageAnalitics.js
index 3046b5765..7d9485248 100644
--- a/cypress/integration/homePage/homePageAnalitics.js
+++ b/cypress/integration/homePage/homePageAnalitics.js
@@ -18,7 +18,7 @@ import * as shippingUtils from "../../utils/shippingUtils";
//
describe("Homepage analytics", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyHomeAnalytics-";
let customerId;
let defaultChannel;
@@ -28,6 +28,7 @@ describe("Homepage analytics", () => {
let category;
let warehouse;
let shippingMethod;
+ let addresses;
const productPrice = 22;
const shippingPrice = 12;
@@ -39,7 +40,6 @@ describe("Homepage analytics", () => {
productsUtils.deleteProductsStartsWith(startsWith);
deleteCustomersStartsWith(startsWith);
shippingUtils.deleteShippingStartsWith(startsWith);
- let addresses;
getDefaultChannel()
.then(channel => {
@@ -139,7 +139,8 @@ describe("Homepage analytics", () => {
defaultChannel.slug,
randomEmail,
createdVariants,
- shippingMethod.id
+ shippingMethod.id,
+ addresses.plAddress
);
cy.get("@ordersReadyForCapture").then(ordersReadyForCaptureBefore => {
diff --git a/cypress/integration/orders/channelsInDraftOrders.js b/cypress/integration/orders/channelsInDraftOrders.js
index cbeb76dc1..ab9cce530 100644
--- a/cypress/integration/orders/channelsInDraftOrders.js
+++ b/cypress/integration/orders/channelsInDraftOrders.js
@@ -13,7 +13,7 @@ import { urlList } from "../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils";
describe("Channels in draft orders", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyChannelInDraftOrders-";
const randomName = startsWith + faker.random.number();
let defaultChannel;
diff --git a/cypress/integration/orders/draftOrders.js b/cypress/integration/orders/draftOrders.js
index 9719c12c6..d32968dfc 100644
--- a/cypress/integration/orders/draftOrders.js
+++ b/cypress/integration/orders/draftOrders.js
@@ -18,7 +18,7 @@ import {
} from "../../utils/shippingUtils";
describe("Draft orders", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyDraftOrders-";
const randomName = startsWith + faker.random.number();
let defaultChannel;
diff --git a/cypress/integration/orders/orders.js b/cypress/integration/orders/orders.js
index 3f6fe3b0c..b067c1219 100644
--- a/cypress/integration/orders/orders.js
+++ b/cypress/integration/orders/orders.js
@@ -18,7 +18,7 @@ import {
} from "../../utils/shippingUtils";
describe("Orders", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyOrders-";
const randomName = startsWith + faker.random.number();
let customer;
diff --git a/cypress/integration/products/createProduct.js b/cypress/integration/products/createProduct.js
index f818a33b1..66d9dfb80 100644
--- a/cypress/integration/products/createProduct.js
+++ b/cypress/integration/products/createProduct.js
@@ -19,7 +19,7 @@ import {
import * as productUtils from "../../utils/products/productsUtils";
describe("Create product", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyCreateProduct-";
const name = `${startsWith}${faker.random.number()}`;
const generalInfo = {
name: `${startsWith}${faker.random.number()}`,
diff --git a/cypress/integration/products/menageProducts/availableForPurchaseProducts.js b/cypress/integration/products/menageProducts/availableForPurchaseProducts.js
index d95eaffcd..024d0a40a 100644
--- a/cypress/integration/products/menageProducts/availableForPurchaseProducts.js
+++ b/cypress/integration/products/menageProducts/availableForPurchaseProducts.js
@@ -10,7 +10,7 @@ import { isProductAvailableForPurchase } from "../../../utils/storeFront/storeFr
//
describe("Products available in listings", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyAvailForPurchase-";
const name = `${startsWith}${faker.random.number()}`;
let productType;
let attribute;
diff --git a/cypress/integration/products/menageProducts/publishedProducts.js b/cypress/integration/products/menageProducts/publishedProducts.js
index 0037ce178..34685c264 100644
--- a/cypress/integration/products/menageProducts/publishedProducts.js
+++ b/cypress/integration/products/menageProducts/publishedProducts.js
@@ -9,7 +9,7 @@ import { isProductVisible } from "../../../utils/storeFront/storeFrontProductUti
//
describe("Published products", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyPublishedProducts-";
const name = `${startsWith}${faker.random.number()}`;
let productType;
let attribute;
diff --git a/cypress/integration/products/menageProducts/visibleInListingsProducts.js b/cypress/integration/products/menageProducts/visibleInListingsProducts.js
index 4ba06b086..776dbaa0d 100644
--- a/cypress/integration/products/menageProducts/visibleInListingsProducts.js
+++ b/cypress/integration/products/menageProducts/visibleInListingsProducts.js
@@ -9,7 +9,7 @@ import { isProductVisibleInSearchResult } from "../../../utils/storeFront/storeF
//
describe("Products displayed in listings", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyVisibleInListings-";
const name = `${startsWith}${faker.random.number()}`;
let productType;
let attribute;
diff --git a/cypress/integration/products/productsList/filteringProducts.js b/cypress/integration/products/productsList/filteringProducts.js
index 14a2681eb..e2f08cd1d 100644
--- a/cypress/integration/products/productsList/filteringProducts.js
+++ b/cypress/integration/products/productsList/filteringProducts.js
@@ -6,6 +6,7 @@ import {
selectFilterOption,
selectProductsOutOfStock
} from "../../../steps/catalog/products/productsListSteps";
+import { selectChannelInHeader } from "../../../steps/channelsSteps";
import { urlList } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import {
@@ -20,7 +21,7 @@ import {
} from "../../../utils/shippingUtils";
describe("Products", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyFilterProducts-";
const name = `${startsWith}${faker.random.number()}`;
const stockQuantity = 747;
const price = 342;
@@ -93,7 +94,7 @@ describe("Products", () => {
});
});
- xit("should filter products out of stock", () => {
+ it("should filter products out of stock", () => {
const productOutOfStock = `${startsWith}${faker.random.number()}`;
createProductInChannel({
name: productOutOfStock,
@@ -105,6 +106,7 @@ describe("Products", () => {
categoryId: category.id,
price
});
+ selectChannelInHeader(channel.name);
selectProductsOutOfStock();
cy.getTextFromElement(PRODUCTS_LIST.productsNames).then(product => {
expect(product).to.includes(productOutOfStock);
diff --git a/cypress/integration/products/productsVariants.js b/cypress/integration/products/productsVariants.js
index 1cc91100b..98db5b38c 100644
--- a/cypress/integration/products/productsVariants.js
+++ b/cypress/integration/products/productsVariants.js
@@ -5,10 +5,13 @@ import {
createProduct,
updateChannelInProduct
} from "../../apiRequests/Product";
+import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import {
createFirstVariant,
- createVariant
+ createVariant,
+ variantsShouldBeVisible
} from "../../steps/catalog/products/VariantsSteps";
+import { selectChannelInHeader } from "../../steps/channelsSteps";
import { urlList } from "../../url/urlList";
import {
deleteChannelsStartsWith,
@@ -20,7 +23,7 @@ import { getProductVariants } from "../../utils/storeFront/storeFrontProductUtil
//
describe("Creating variants", () => {
- const startsWith = "Cy-";
+ const startsWith = "CyCreateVariants-";
const attributeValues = ["value1", "value2"];
let defaultChannel;
@@ -88,6 +91,8 @@ describe("Creating variants", () => {
price,
attribute: attributeValues[0]
});
+ selectChannelInHeader(defaultChannel.name);
+ variantsShouldBeVisible({ name, price });
getProductVariants(createdProduct.id, defaultChannel.slug);
})
.then(([variant]) => {
@@ -95,7 +100,7 @@ describe("Creating variants", () => {
expect(variant).to.have.property("price", price);
});
});
- it("should create several variants", () => {
+ xit("should create several variants", () => {
const name = `${startsWith}${faker.random.number()}`;
const secondVariantSku = `${startsWith}${faker.random.number()}`;
const variants = [{ price: 7 }, { name: attributeValues[1], price: 16 }];
@@ -121,7 +126,14 @@ describe("Creating variants", () => {
price: variants[1].price
});
})
- .then(() => getProductVariants(createdProduct.id, defaultChannel.slug))
+ .then(() => {
+ selectChannelInHeader(defaultChannel.name);
+ variantsShouldBeVisible({
+ name: variants[1].name,
+ price: variants.price
+ });
+ getProductVariants(createdProduct.id, defaultChannel.slug);
+ })
.then(([firstVariant, secondVariant]) => {
expect(firstVariant).to.have.property("price", variants[0].price);
expect(secondVariant).to.have.property("name", variants[1].name);
@@ -164,6 +176,10 @@ describe("Creating variants", () => {
price: variantsPrice,
attribute: attributeValues[0]
});
+ selectChannelInHeader(defaultChannel.name);
+ variantsShouldBeVisible({ name, price: variantsPrice });
+ selectChannelInHeader(newChannel.name);
+ variantsShouldBeVisible({ name, price: variantsPrice });
getProductVariants(createdProduct.id, defaultChannel.slug);
})
.then(([variant]) => {
diff --git a/cypress/screenshots/channels.js/Channels -- should navigate to channels page -- before all hook (failed).png b/cypress/screenshots/channels.js/Channels -- should navigate to channels page -- before all hook (failed).png
deleted file mode 100644
index 9a915910b..000000000
Binary files a/cypress/screenshots/channels.js/Channels -- should navigate to channels page -- before all hook (failed).png and /dev/null differ
diff --git a/cypress/steps/catalog/products/VariantsSteps.js b/cypress/steps/catalog/products/VariantsSteps.js
index cab3ae3f3..3ce2b98cf 100644
--- a/cypress/steps/catalog/products/VariantsSteps.js
+++ b/cypress/steps/catalog/products/VariantsSteps.js
@@ -1,8 +1,15 @@
import { PRICE_LIST } from "../../../elements/catalog/products/price-list";
import { PRODUCT_DETAILS } from "../../../elements/catalog/products/product-details";
import { VARIANTS_SELECTORS } from "../../../elements/catalog/products/variants-selectors";
+import { AVAILABLE_CHANNELS_FORM } from "../../../elements/channels/available-channels-form";
+import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
+import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { fillUpPriceList } from "./priceList";
+export function variantsShouldBeVisible({ name, price }) {
+ cy.contains(PRODUCT_DETAILS.variantRow, name).should("be.visible");
+ cy.contains(PRODUCT_DETAILS.variantRow, price).should("be.visible");
+}
export function createFirstVariant({ sku, warehouseId, price, attribute }) {
cy.get(PRODUCT_DETAILS.addVariantsButton).click();
cy.get(VARIANTS_SELECTORS.valueContainer)
@@ -21,6 +28,10 @@ export function createFirstVariant({ sku, warehouseId, price, attribute }) {
cy.addAliasToGraphRequest("ProductVariantBulkCreate");
cy.get(VARIANTS_SELECTORS.nextButton).click();
cy.wait("@ProductVariantBulkCreate");
+ cy.get(SHARED_ELEMENTS.progressBar)
+ .should("not.be.visible")
+ .get(AVAILABLE_CHANNELS_FORM.menageChannelsButton)
+ .should("be.visible");
}
export function createVariant({
sku,
@@ -48,4 +59,10 @@ export function createVariant({
cy.addAliasToGraphRequest("ProductVariantDetails");
cy.get(VARIANTS_SELECTORS.saveButton).click();
cy.wait("@ProductVariantDetails");
+ cy.get(BUTTON_SELECTORS.back)
+ .click()
+ .get(SHARED_ELEMENTS.progressBar)
+ .should("not.be.visible")
+ .get(AVAILABLE_CHANNELS_FORM.menageChannelsButton)
+ .should("be.visible");
}
diff --git a/cypress/steps/permissions.js b/cypress/steps/permissions.js
index e8de98b9c..95453678e 100644
--- a/cypress/steps/permissions.js
+++ b/cypress/steps/permissions.js
@@ -2,8 +2,6 @@ import { LEFT_MENU_SELECTORS } from "../elements/account/left-menu/left-menu-sel
import { SHARED_ELEMENTS } from "../elements/shared/sharedElements";
import { urlList } from "../url/urlList";
-/* eslint-disable no-unused-expressions */
-
export function navigateToAllAvailablePageAndCheckIfDisplayed({
user,
permissions
diff --git a/cypress/utils/ordersUtils.js b/cypress/utils/ordersUtils.js
index 1610d1ccd..ad47cf0de 100644
--- a/cypress/utils/ordersUtils.js
+++ b/cypress/utils/ordersUtils.js
@@ -5,10 +5,13 @@ export function createWaitingForCaptureOrder(
channelSlug,
email,
variantsList,
- shippingMethodId
+ shippingMethodId,
+ address
) {
let checkout;
- return createCheckout({ channelSlug, email, variantsList })
+ const auth = "token";
+ cy.loginInShop();
+ return createCheckout({ channelSlug, email, variantsList, address, auth })
.then(checkoutResp => {
checkout = checkoutResp;
checkoutRequest.addShippingMethod(checkout.id, shippingMethodId);
diff --git a/cypress/utils/products/productsUtils.js b/cypress/utils/products/productsUtils.js
index 0f6dc51e5..82a157016 100644
--- a/cypress/utils/products/productsUtils.js
+++ b/cypress/utils/products/productsUtils.js
@@ -32,6 +32,7 @@ export function createProductInChannel({
createVariant({
productId: product.id,
sku: name,
+ attributeId,
warehouseId,
quantityInWarehouse,
channelId,
@@ -93,6 +94,7 @@ export function updateProduct(productId, input) {
export function createVariant({
productId,
sku,
+ attributeId,
warehouseId,
quantityInWarehouse,
channelId,
@@ -102,6 +104,7 @@ export function createVariant({
.createVariant({
productId,
sku,
+ attributeId,
warehouseId,
quantity: quantityInWarehouse,
channelId,
diff --git a/cypress/videos/channels.js.mp4 b/cypress/videos/channels.js.mp4
deleted file mode 100644
index e0b361503..000000000
Binary files a/cypress/videos/channels.js.mp4 and /dev/null differ
diff --git a/cypress/videos/collections.js.mp4 b/cypress/videos/collections.js.mp4
deleted file mode 100644
index 10cbc2fb1..000000000
Binary files a/cypress/videos/collections.js.mp4 and /dev/null differ
diff --git a/src/products/components/ProductVariants/ProductVariants.tsx b/src/products/components/ProductVariants/ProductVariants.tsx
index e67c316fb..7420bc2b4 100644
--- a/src/products/components/ProductVariants/ProductVariants.tsx
+++ b/src/products/components/ProductVariants/ProductVariants.tsx
@@ -358,6 +358,7 @@ export const ProductVariants: React.FC = props => {
return (
|
|
|
|
|
|
|
|
|
|
|
|
|
|