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(
|
||||
"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 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(
|
||||
"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;
|
||||
|
||||
cy.visit(`${urlList.products}${createdProduct.id}`);
|
||||
cy.get(PRODUCT_DETAILS.dataGridTable).scrollIntoView();
|
||||
|
||||
enterVariantEditPage();
|
||||
|
||||
cy.get(PRODUCT_DETAILS.addVariantButton)
|
||||
.click()
|
||||
.then(() => {
|
||||
|
|
|
@ -144,11 +144,10 @@ export function addVariantToDataGrid(variantName) {
|
|||
.should("be.visible")
|
||||
.get(PRODUCT_DETAILS.firstRowDataGrid)
|
||||
.click({ force: true })
|
||||
.type(variantName)
|
||||
.type(variantName, { force: true })
|
||||
.get(BUTTON_SELECTORS.confirm)
|
||||
.click()
|
||||
.confirmationMessageShouldAppear()
|
||||
.reload()
|
||||
.waitForProgressBarToNotBeVisible();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue