diff --git a/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js b/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js index 7531a76b4..91233341f 100644 --- a/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js +++ b/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js @@ -91,7 +91,8 @@ describe("Products available in listings", () => { .then(({ product: productResp }) => { product = productResp; const productUrl = productDetailsUrl(product.id); - updateProductIsAvailableForPurchase(productUrl, true); + cy.visit(productUrl); + updateProductIsAvailableForPurchase(true); }) .then(() => { getProductDetails(product.id, defaultChannel.slug); @@ -121,7 +122,8 @@ describe("Products available in listings", () => { .then(({ product: productResp }) => { product = productResp; const productUrl = productDetailsUrl(product.id); - updateProductIsAvailableForPurchase(productUrl, false); + cy.visit(productUrl); + updateProductIsAvailableForPurchase(false); }) .then(() => { getProductDetails(product.id, defaultChannel.slug); diff --git a/cypress/elements/channels/available-channels-form.js b/cypress/elements/channels/available-channels-form.js index 705a4e7b5..e7153ba08 100644 --- a/cypress/elements/channels/available-channels-form.js +++ b/cypress/elements/channels/available-channels-form.js @@ -2,7 +2,7 @@ export const AVAILABLE_CHANNELS_FORM = { manageChannelsButton: "[data-test-id='channels-availability-manage-button']", assignedChannels: "[data-test-id='expand-icon']", publishedRadioButtons: "[name*='isPublished'] > ", - availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']", + availableForPurchaseRadioButtons: "[id*='isAvailableForPurchase']", radioButtonsValueTrue: "[value='true']", radioButtonsValueFalse: "[value='false']", visibleInListingsButton: "[id*='visibleInListings']", diff --git a/cypress/support/pages/catalog/products/productDetailsPage.js b/cypress/support/pages/catalog/products/productDetailsPage.js index 274807c90..b2873c749 100644 --- a/cypress/support/pages/catalog/products/productDetailsPage.js +++ b/cypress/support/pages/catalog/products/productDetailsPage.js @@ -8,10 +8,7 @@ import { editSeoSettings } from "../seoComponent"; const valueTrue = AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue; const valueFalse = AVAILABLE_CHANNELS_FORM.radioButtonsValueFalse; -export function updateProductIsAvailableForPurchase( - productUrl, - isAvailableForPurchase, -) { +export function updateProductIsAvailableForPurchase(isAvailableForPurchase) { const isAvailableForPurchaseSelector = isAvailableForPurchase ? valueTrue : valueFalse; @@ -43,6 +40,7 @@ function updateProductManageInChannel(manageSelector) { .get(BUTTON_SELECTORS.confirm) .click() .confirmationMessageShouldAppear() + .confirmationMessageShouldDisappear() .wait("@ProductChannelListingUpdate"); }