diff --git a/cypress/apiRequests/Product.js b/cypress/apiRequests/Product.js index 0f0858021..3b3f8f3de 100644 --- a/cypress/apiRequests/Product.js +++ b/cypress/apiRequests/Product.js @@ -190,13 +190,17 @@ export function createTypeProduct({ slug = name, shippable = true }) { + const variantAttributesLine = getValueWithDefault( + hasVariants, + `variantAttributes: "${attributeId}"` + ); const mutation = `mutation{ productTypeCreate(input: { name: "${name}" slug: "${slug}" productAttributes: "${attributeId}" - variantAttributes: "${attributeId}" hasVariants: ${hasVariants} + ${variantAttributesLine} isShippingRequired:${shippable} }){ productErrors{ diff --git a/cypress/elements/catalog/products/assign-products-selectors.js b/cypress/elements/catalog/products/assign-products-selectors.js index 6acac9a80..c570007c4 100644 --- a/cypress/elements/catalog/products/assign-products-selectors.js +++ b/cypress/elements/catalog/products/assign-products-selectors.js @@ -2,5 +2,6 @@ export const ASSIGN_PRODUCTS_SELECTORS = { searchInput: "[name='query']", tableRow: "[class*='MuiTableRow']", checkbox: "[type='checkbox']", - submitButton: "[type='submit']" + submitButton: "[type='submit']", + dialogContent: '[data-test-id="searchQuery"]' }; diff --git a/cypress/steps/catalog/products/VariantsSteps.js b/cypress/steps/catalog/products/VariantsSteps.js index 8986e674c..400a37e26 100644 --- a/cypress/steps/catalog/products/VariantsSteps.js +++ b/cypress/steps/catalog/products/VariantsSteps.js @@ -17,12 +17,9 @@ export function variantsShouldBeVisible({ name, price }) { export function createFirstVariant({ sku, warehouseId, price, attribute }) { cy.get(PRODUCT_DETAILS.addVariantsButton).click(); cy.get(VARIANTS_SELECTORS.valueContainer) - .contains(attribute) - .find(VARIANTS_SELECTORS.attributeCheckbox) .click() - .get(VARIANTS_SELECTORS.valueContainer) - .find(BUTTON_SELECTORS.checked) - .should("exist") + .contains(attribute) + .click() .get(VARIANTS_SELECTORS.nextButton) .click(); fillUpPriceList(price); diff --git a/cypress/steps/draftOrderSteps.js b/cypress/steps/draftOrderSteps.js index 5533473ec..85f8e3b5e 100644 --- a/cypress/steps/draftOrderSteps.js +++ b/cypress/steps/draftOrderSteps.js @@ -9,8 +9,9 @@ export function finalizeDraftOrder(name, address) { .click() .get(ASSIGN_PRODUCTS_SELECTORS.searchInput) .type(name) - .get(SHARED_ELEMENTS.progressBar) - .should("not.be.visible"); + .get(ASSIGN_PRODUCTS_SELECTORS.dialogContent) + .find(SHARED_ELEMENTS.progressBar) + .should("not.exist"); cy.contains(ASSIGN_PRODUCTS_SELECTORS.tableRow, name) .find(ASSIGN_PRODUCTS_SELECTORS.checkbox) .click() diff --git a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx index da78da99e..d9c5e3dab 100644 --- a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx +++ b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx @@ -248,7 +248,7 @@ const OrderProductAddDialog: React.FC = props => { description="dialog header" /> - +