fixing failing critical variants tests (#3212)

This commit is contained in:
wojteknowacki 2023-02-23 16:41:35 +01:00 committed by GitHub
parent 0fef41b04f
commit 3055af4841
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 3 deletions

View file

@ -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(() => {

View file

@ -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();
}