test fix available for purchase (#3661)
This commit is contained in:
parent
36c14bd9a0
commit
352ac9566b
3 changed files with 7 additions and 7 deletions
|
@ -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);
|
||||
|
|
|
@ -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']",
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue