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 }) => {
|
.then(({ product: productResp }) => {
|
||||||
product = productResp;
|
product = productResp;
|
||||||
const productUrl = productDetailsUrl(product.id);
|
const productUrl = productDetailsUrl(product.id);
|
||||||
updateProductIsAvailableForPurchase(productUrl, true);
|
cy.visit(productUrl);
|
||||||
|
updateProductIsAvailableForPurchase(true);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getProductDetails(product.id, defaultChannel.slug);
|
getProductDetails(product.id, defaultChannel.slug);
|
||||||
|
@ -121,7 +122,8 @@ describe("Products available in listings", () => {
|
||||||
.then(({ product: productResp }) => {
|
.then(({ product: productResp }) => {
|
||||||
product = productResp;
|
product = productResp;
|
||||||
const productUrl = productDetailsUrl(product.id);
|
const productUrl = productDetailsUrl(product.id);
|
||||||
updateProductIsAvailableForPurchase(productUrl, false);
|
cy.visit(productUrl);
|
||||||
|
updateProductIsAvailableForPurchase(false);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getProductDetails(product.id, defaultChannel.slug);
|
getProductDetails(product.id, defaultChannel.slug);
|
||||||
|
|
|
@ -2,7 +2,7 @@ export const AVAILABLE_CHANNELS_FORM = {
|
||||||
manageChannelsButton: "[data-test-id='channels-availability-manage-button']",
|
manageChannelsButton: "[data-test-id='channels-availability-manage-button']",
|
||||||
assignedChannels: "[data-test-id='expand-icon']",
|
assignedChannels: "[data-test-id='expand-icon']",
|
||||||
publishedRadioButtons: "[name*='isPublished'] > ",
|
publishedRadioButtons: "[name*='isPublished'] > ",
|
||||||
availableForPurchaseRadioButtons: "[name*='isAvailableForPurchase']",
|
availableForPurchaseRadioButtons: "[id*='isAvailableForPurchase']",
|
||||||
radioButtonsValueTrue: "[value='true']",
|
radioButtonsValueTrue: "[value='true']",
|
||||||
radioButtonsValueFalse: "[value='false']",
|
radioButtonsValueFalse: "[value='false']",
|
||||||
visibleInListingsButton: "[id*='visibleInListings']",
|
visibleInListingsButton: "[id*='visibleInListings']",
|
||||||
|
|
|
@ -8,10 +8,7 @@ import { editSeoSettings } from "../seoComponent";
|
||||||
const valueTrue = AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue;
|
const valueTrue = AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue;
|
||||||
const valueFalse = AVAILABLE_CHANNELS_FORM.radioButtonsValueFalse;
|
const valueFalse = AVAILABLE_CHANNELS_FORM.radioButtonsValueFalse;
|
||||||
|
|
||||||
export function updateProductIsAvailableForPurchase(
|
export function updateProductIsAvailableForPurchase(isAvailableForPurchase) {
|
||||||
productUrl,
|
|
||||||
isAvailableForPurchase,
|
|
||||||
) {
|
|
||||||
const isAvailableForPurchaseSelector = isAvailableForPurchase
|
const isAvailableForPurchaseSelector = isAvailableForPurchase
|
||||||
? valueTrue
|
? valueTrue
|
||||||
: valueFalse;
|
: valueFalse;
|
||||||
|
@ -43,6 +40,7 @@ function updateProductManageInChannel(manageSelector) {
|
||||||
.get(BUTTON_SELECTORS.confirm)
|
.get(BUTTON_SELECTORS.confirm)
|
||||||
.click()
|
.click()
|
||||||
.confirmationMessageShouldAppear()
|
.confirmationMessageShouldAppear()
|
||||||
|
.confirmationMessageShouldDisappear()
|
||||||
.wait("@ProductChannelListingUpdate");
|
.wait("@ProductChannelListingUpdate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue