fixing failing critical variants tests (#3212)
This commit is contained in:
parent
0fef41b04f
commit
3055af4841
2 changed files with 35 additions and 3 deletions
|
@ -77,7 +77,7 @@ describe("As an admin I should be able to create variant", () => {
|
||||||
|
|
||||||
it(
|
it(
|
||||||
"should be able to create variant visible for the customers in all channels. TC: SALEOR_2901",
|
"should be able to create variant visible for the customers in all channels. TC: SALEOR_2901",
|
||||||
{ tags: ["@variants", "@allEnv", "@critical", "@stable", "@oldRelease"] },
|
{ tags: ["@variants", "@allEnv", "@stable", "@oldRelease"] },
|
||||||
() => {
|
() => {
|
||||||
const name = `${startsWith}${faker.datatype.number()}`;
|
const name = `${startsWith}${faker.datatype.number()}`;
|
||||||
const price = 10;
|
const price = 10;
|
||||||
|
@ -127,6 +127,36 @@ describe("As an admin I should be able to create variant", () => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
it(
|
||||||
|
"should be able to create variant. TC: SALEOR_2900",
|
||||||
|
{ tags: ["@variants", "@allEnv", "@critical", "@stable", "@oldRelease"] },
|
||||||
|
() => {
|
||||||
|
const name = `${startsWith}${faker.datatype.number()}`;
|
||||||
|
let createdProduct;
|
||||||
|
|
||||||
|
createProduct({
|
||||||
|
attributeId: attribute.id,
|
||||||
|
name,
|
||||||
|
productTypeId: productType.id,
|
||||||
|
categoryId: category.id,
|
||||||
|
}).then(resp => {
|
||||||
|
createdProduct = resp;
|
||||||
|
|
||||||
|
updateChannelInProduct({
|
||||||
|
productId: createdProduct.id,
|
||||||
|
channelId: defaultChannel.id,
|
||||||
|
});
|
||||||
|
updateChannelInProduct({
|
||||||
|
productId: createdProduct.id,
|
||||||
|
channelId: newChannel.id,
|
||||||
|
});
|
||||||
|
cy.visit(
|
||||||
|
`${urlList.products}${createdProduct.id}`,
|
||||||
|
).waitForProgressBarToNotBeVisible();
|
||||||
|
addVariantToDataGrid(name);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
it(
|
it(
|
||||||
"should be able to create several variants visible for the customers. TC: SALEOR_2902",
|
"should be able to create several variants visible for the customers. TC: SALEOR_2902",
|
||||||
|
@ -151,7 +181,10 @@ describe("As an admin I should be able to create variant", () => {
|
||||||
createdProduct = productResp;
|
createdProduct = productResp;
|
||||||
|
|
||||||
cy.visit(`${urlList.products}${createdProduct.id}`);
|
cy.visit(`${urlList.products}${createdProduct.id}`);
|
||||||
|
cy.get(PRODUCT_DETAILS.dataGridTable).scrollIntoView();
|
||||||
|
|
||||||
enterVariantEditPage();
|
enterVariantEditPage();
|
||||||
|
|
||||||
cy.get(PRODUCT_DETAILS.addVariantButton)
|
cy.get(PRODUCT_DETAILS.addVariantButton)
|
||||||
.click()
|
.click()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
@ -144,11 +144,10 @@ export function addVariantToDataGrid(variantName) {
|
||||||
.should("be.visible")
|
.should("be.visible")
|
||||||
.get(PRODUCT_DETAILS.firstRowDataGrid)
|
.get(PRODUCT_DETAILS.firstRowDataGrid)
|
||||||
.click({ force: true })
|
.click({ force: true })
|
||||||
.type(variantName)
|
.type(variantName, { force: true })
|
||||||
.get(BUTTON_SELECTORS.confirm)
|
.get(BUTTON_SELECTORS.confirm)
|
||||||
.click()
|
.click()
|
||||||
.confirmationMessageShouldAppear()
|
.confirmationMessageShouldAppear()
|
||||||
.reload()
|
|
||||||
.waitForProgressBarToNotBeVisible();
|
.waitForProgressBarToNotBeVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue