fix test for publishing products (#2215)

This commit is contained in:
Karolina Rakoczy 2022-08-08 12:40:42 +02:00 committed by GitHub
parent eaf3271dc9
commit 5ce4a87515
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View file

@ -50,7 +50,7 @@ describe("Published products", () => {
it(
"should update product to published",
{ tags: ["@products", "@allEnv"] },
{ tags: ["@products", "@allEnv", "@stable"] },
() => {
const productName = `${startsWith}${faker.datatype.number()}`;
@ -79,7 +79,7 @@ describe("Published products", () => {
it(
"should update product to not published",
{ tags: ["@products", "@allEnv"] },
{ tags: ["@products", "@allEnv", "@stable"] },
() => {
const productName = `${startsWith}${faker.datatype.number()}`;
let product;

View file

@ -9,7 +9,7 @@ const valueFalse = AVAILABLE_CHANNELS_FORM.radioButtonsValueFalse;
export function updateProductIsAvailableForPurchase(
productUrl,
isAvailableForPurchase
isAvailableForPurchase,
) {
const isAvailableForPurchaseSelector = isAvailableForPurchase
? valueTrue
@ -27,7 +27,7 @@ export function updateProductPublish(productUrl, isPublished) {
export function updateProductVisibleInListings(productUrl) {
updateProductMenageInChannel(
productUrl,
AVAILABLE_CHANNELS_FORM.visibleInListingsButton
AVAILABLE_CHANNELS_FORM.visibleInListingsButton,
);
}
@ -36,16 +36,17 @@ function updateProductMenageInChannel(productUrl, menageSelector) {
.get(AVAILABLE_CHANNELS_FORM.assignedChannels)
.click()
.get(menageSelector)
.click();
cy.addAliasToGraphRequest("ProductChannelListingUpdate");
cy.get(BUTTON_SELECTORS.confirm)
.click()
.waitForProgressBarToNotBeVisible()
.addAliasToGraphRequest("ProductChannelListingUpdate")
.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@ProductChannelListingUpdate");
}
export function fillUpCommonFieldsForAllProductTypes(
{ generalInfo, seo, metadata, productOrganization },
createMode = true
createMode = true,
) {
return fillUpAllCommonFieldsInCreateAndUpdate({ generalInfo, seo, metadata })
.then(() => {
@ -54,7 +55,7 @@ export function fillUpCommonFieldsForAllProductTypes(
} else {
fillUpCollectionAndCategory({
category: productOrganization.category,
collection: productOrganization.collection
collection: productOrganization.collection,
});
}
})
@ -64,7 +65,7 @@ export function fillUpCommonFieldsForAllProductTypes(
export function fillUpAllCommonFieldsInCreateAndUpdate({
generalInfo,
seo,
metadata
metadata,
}) {
return fillUpProductGeneralInfo(generalInfo)
.then(() => {
@ -92,7 +93,7 @@ export function fillUpProductGeneralInfo({ name, description, rating }) {
export function fillUpProductOrganization({
productType,
category,
collection
collection,
}) {
const organization = {};
return cy