diff --git a/cypress/elements/catalog/products/variants-selectors.js b/cypress/elements/catalog/products/variants-selectors.js index 970e7ca0d..3c4f5fe78 100644 --- a/cypress/elements/catalog/products/variants-selectors.js +++ b/cypress/elements/catalog/products/variants-selectors.js @@ -3,7 +3,7 @@ export const VARIANTS_SELECTORS = { valueContainer: "[data-test-id='value-container']", nextButton: "[class*='MuiButton-containedPrimary']", warehouseCheckboxes: "[name*='warehouse:']", - skuInput: "[ data-test-id='sku-input']", + skuInput: "[ name='sku']", attributeSelector: "[data-test='attribute-value']", attributeOption: "[data-test-type='option'], [data-test='multiautocomplete-select-option']", diff --git a/cypress/integration/products/productsVariants.js b/cypress/integration/products/productsVariants.js index 026420b97..55501971a 100644 --- a/cypress/integration/products/productsVariants.js +++ b/cypress/integration/products/productsVariants.js @@ -104,7 +104,6 @@ filterTests({ definedTags: ["all", "critical"] }, () => { cy.visit(`${urlList.products}${createdProduct.id}`); createFirstVariant({ sku: name, - warehouseId: warehouse.id, price, attribute: attributeValues[0] }); @@ -139,7 +138,6 @@ filterTests({ definedTags: ["all", "critical"] }, () => { cy.visit(`${urlList.products}${createdProduct.id}`); createVariant({ sku: secondVariantSku, - warehouseName: warehouse.name, attributeName: variants[1].name, price: variants[1].price, channelName: defaultChannel.name @@ -187,7 +185,6 @@ filterTests({ definedTags: ["all", "critical"] }, () => { cy.visit(`${urlList.products}${createdProduct.id}`); createFirstVariant({ sku: name, - warehouseId: warehouse.id, price: variantsPrice, attribute: attributeValues[0] }); diff --git a/cypress/integration/products/produkctsWithoutSku/createProductWithoutSku.js b/cypress/integration/products/productsWithoutSku/createProductWithoutSku.js similarity index 97% rename from cypress/integration/products/produkctsWithoutSku/createProductWithoutSku.js rename to cypress/integration/products/productsWithoutSku/createProductWithoutSku.js index 3ce148aa8..f2ec94f36 100644 --- a/cypress/integration/products/produkctsWithoutSku/createProductWithoutSku.js +++ b/cypress/integration/products/productsWithoutSku/createProductWithoutSku.js @@ -121,6 +121,7 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { channelId: defaultChannel.id }); cy.visit(`${urlList.products}${createdProduct.id}`); + cy.waitForProgressBarToNotBeVisible(); createFirstVariant({ warehouseId: warehouse.id, price, @@ -135,7 +136,7 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { channelSlug: defaultChannel.slug, email: "example@example.com", variantsList: [variant], - shippingMethodId: shippingMethod.id, + shippingMethodName: shippingMethod.name, address }); }) @@ -180,7 +181,7 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { channelSlug: defaultChannel.slug, email: "example@example.com", variantsList: [secondVariant], - shippingMethodId: shippingMethod.id, + shippingMethodName: shippingMethod.name, address }); }) @@ -234,7 +235,7 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { channelSlug: defaultChannel.slug, email: "example@example.com", variantsList: variants, - shippingMethodId: shippingMethod.id, + shippingMethodName: shippingMethod.name, address }); }); diff --git a/cypress/integration/products/productsWithoutSku/updatingProductsWithoutSku.js b/cypress/integration/products/productsWithoutSku/updatingProductsWithoutSku.js index 303e56dab..b656b54be 100644 --- a/cypress/integration/products/productsWithoutSku/updatingProductsWithoutSku.js +++ b/cypress/integration/products/productsWithoutSku/updatingProductsWithoutSku.js @@ -208,7 +208,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { .get(SHARED_ELEMENTS.skeleton) .should("not.exist") .get(VARIANTS_SELECTORS.skuInput) - .find("input") .clear() .addAliasToGraphRequest("VariantUpdate") .get(BUTTON_SELECTORS.confirm) @@ -267,7 +266,7 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { address, channelSlug: defaultChannel.slug, email, - shippingMethodId: shippingMethod.id, + shippingMethodName: shippingMethod.name, variantsList: [variant] }).then(({ order }) => { expect(order.id).to.be.ok; diff --git a/cypress/support/pages/catalog/products/VariantsPage.js b/cypress/support/pages/catalog/products/VariantsPage.js index 7477b3b1d..298ed371a 100644 --- a/cypress/support/pages/catalog/products/VariantsPage.js +++ b/cypress/support/pages/catalog/products/VariantsPage.js @@ -30,9 +30,14 @@ export function createFirstVariant({ .get(VARIANTS_SELECTORS.nextButton) .click(); fillUpPriceList(price); - cy.get(`[name*='${warehouseId}']`) - .click() - .get(VARIANTS_SELECTORS.stockInput) + if (warehouseId) { + cy.get(`[name*='${warehouseId}']`).click(); + } else { + cy.get(VARIANTS_SELECTORS.warehouseCheckboxes) + .first() + .click(); + } + cy.get(VARIANTS_SELECTORS.stockInput) .type(quantity) .get(VARIANTS_SELECTORS.nextButton) .click(); @@ -80,9 +85,15 @@ export function fillUpGeneralVariantInputs({ }) { fillUpVariantAttributeAndSku({ attributeName, sku }); cy.get(VARIANTS_SELECTORS.addWarehouseButton).click(); - cy.contains(VARIANTS_SELECTORS.warehouseOption, warehouseName).click({ - force: true - }); + if (warehouseName) { + cy.contains(VARIANTS_SELECTORS.warehouseOption, warehouseName).click({ + force: true + }); + } else { + cy.get(VARIANTS_SELECTORS.warehouseOption) + .first() + .click({ force: true }); + } cy.get(VARIANTS_SELECTORS.stockInput).type(quantity); } diff --git a/src/products/components/ProductStocks/ProductStocks.tsx b/src/products/components/ProductStocks/ProductStocks.tsx index 013b6e03d..367c2a87b 100644 --- a/src/products/components/ProductStocks/ProductStocks.tsx +++ b/src/products/components/ProductStocks/ProductStocks.tsx @@ -225,7 +225,6 @@ const ProductStocks: React.FC = ({