Update tests check if all data created in before are correct (#2917)
* add commend to check if data are correct * Add command for checking created data
This commit is contained in:
parent
92539ae968
commit
39ce183583
53 changed files with 168 additions and 19 deletions
|
@ -84,7 +84,10 @@ describe("As a staff user I want to manage apps", () => {
|
||||||
categoryId: category.id,
|
categoryId: category.id,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(({ variantsList: variants }) => (variantsList = variants));
|
.then(({ variantsList: variants }) => {
|
||||||
|
variantsList = variants
|
||||||
|
cy.checkIfDataAreNotNull({createdApp,defaultChannel,address,warehouse,shippingMethod,variantsList,checkout})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -66,7 +66,16 @@ describe("As an admin I want to manage categories", () => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.then(({ product: productResp }) => (product = productResp));
|
.then(({ product: productResp }) => {
|
||||||
|
product = productResp;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
attribute,
|
||||||
|
category,
|
||||||
|
productType,
|
||||||
|
product,
|
||||||
|
defaultChannel,
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -70,7 +70,10 @@ describe("As an admin I want to manage collections.", () => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.then(({ product: productResp }) => (product = productResp));
|
.then(({ product: productResp }) => {
|
||||||
|
product = productResp
|
||||||
|
cy.checkIfDataAreNotNull({attribute, category, productType, product, defaultChannel})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -63,6 +63,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
||||||
shippingMethodName: resp.shippingMethod.name,
|
shippingMethodName: resp.shippingMethod.name,
|
||||||
variantsList: resp.variantsList,
|
variantsList: resp.variantsList,
|
||||||
};
|
};
|
||||||
|
cy.checkIfDataAreNotNull(dataForCheckout);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ describe("As a customer I should be able to purchase gift card as a product", ()
|
||||||
})
|
})
|
||||||
.then(({ variantsList: variantsResp }) => {
|
.then(({ variantsList: variantsResp }) => {
|
||||||
variants = variantsResp;
|
variants = variantsResp;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel, productType, attribute, category, shippingMethod, variants, address})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ describe("Warehouses in checkout", () => {
|
||||||
})
|
})
|
||||||
.then(({ variantsList }) => {
|
.then(({ variantsList }) => {
|
||||||
variantsInOtherWarehouse = variantsList;
|
variantsInOtherWarehouse = variantsList;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel, usAddress, secondUsAddress, productData, checkoutData, variantsInOtherWarehouse})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,10 @@ describe("Products without shipment option", () => {
|
||||||
productTypeId: productTypeResp.id,
|
productTypeId: productTypeResp.id,
|
||||||
warehouseId: warehouse.id,
|
warehouseId: warehouse.id,
|
||||||
}).then(
|
}).then(
|
||||||
({ variantsList }) => (productWithoutShipping = variantsList),
|
({ variantsList }) => {
|
||||||
|
productWithoutShipping = variantsList
|
||||||
|
cy.checkIfDataAreNotNull({channel, address, warehouse, shippingMethod, productWithShipping, productWithoutShipping})
|
||||||
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -43,6 +43,13 @@ describe("As an unlogged customer I want to order physical and digital products"
|
||||||
shippingMethod = resp.shippingMethod;
|
shippingMethod = resp.shippingMethod;
|
||||||
digitalVariants = resp.digitalVariants;
|
digitalVariants = resp.digitalVariants;
|
||||||
physicalVariants = resp.physicalVariants;
|
physicalVariants = resp.physicalVariants;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
defaultChannel,
|
||||||
|
address,
|
||||||
|
shippingMethod,
|
||||||
|
digitalVariants,
|
||||||
|
physicalVariants,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ describe("Manage products stocks in checkout", () => {
|
||||||
lastVariantInStock = resp.createdVariants.find(
|
lastVariantInStock = resp.createdVariants.find(
|
||||||
variant => variant.name === "lastVariantInStock",
|
variant => variant.name === "lastVariantInStock",
|
||||||
);
|
);
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel, address,shippingMethod, variantsWithLowStock, variantsWithoutTrackInventory, lastVariantInStock})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
||||||
];
|
];
|
||||||
let channel;
|
let channel;
|
||||||
let category;
|
let category;
|
||||||
let product;
|
|
||||||
|
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
|
@ -33,6 +32,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
||||||
getDefaultChannel().then(defaultChannel => (channel = defaultChannel));
|
getDefaultChannel().then(defaultChannel => (channel = defaultChannel));
|
||||||
createCategory({ name: startsWith }).then(
|
createCategory({ name: startsWith }).then(
|
||||||
categoryResp => (category = categoryResp),
|
categoryResp => (category = categoryResp),
|
||||||
|
cy.checkIfDataAreNotNull({channel, category})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
||||||
const inputType = attributeType.key;
|
const inputType = attributeType.key;
|
||||||
const attributeValues = ["1", "2"];
|
const attributeValues = ["1", "2"];
|
||||||
let productType;
|
let productType;
|
||||||
|
let product;
|
||||||
|
|
||||||
createProductTypeWithNewVariantSelectionAttribute({
|
createProductTypeWithNewVariantSelectionAttribute({
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -29,6 +29,7 @@ describe("As an admin I want to delete and update content attribute", () => {
|
||||||
}).then(attributeResp => {
|
}).then(attributeResp => {
|
||||||
attribute = attributeResp;
|
attribute = attributeResp;
|
||||||
});
|
});
|
||||||
|
cy.checkIfDataAreNotNull(attribute)
|
||||||
});
|
});
|
||||||
|
|
||||||
it(
|
it(
|
||||||
|
|
|
@ -39,13 +39,17 @@ describe("Channels", () => {
|
||||||
shippingZone = shippingZoneResp;
|
shippingZone = shippingZoneResp;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
cy.fixture("addresses").then(addresses => {
|
cy.fixture("addresses")
|
||||||
usAddress = addresses.usAddress;
|
.then(addresses => {
|
||||||
createWarehouseViaApi({
|
usAddress = addresses.usAddress;
|
||||||
name: randomName,
|
createWarehouseViaApi({
|
||||||
address: usAddress,
|
name: randomName,
|
||||||
|
address: usAddress,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(warehouse => {
|
||||||
|
cy.checkIfDataAreNotNull({ shippingZone, usAddress, warehouse });
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -48,6 +48,7 @@ describe("Tests on inactive channel", () => {
|
||||||
currencyCode: currency,
|
currencyCode: currency,
|
||||||
}).then(channel => {
|
}).then(channel => {
|
||||||
newChannel = channel;
|
newChannel = channel;
|
||||||
|
cy.checkIfDataAreNotNull({ address, defaultChannel, newChannel });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ describe("Tests for customer", () => {
|
||||||
address = usAddress;
|
address = usAddress;
|
||||||
secondAddress = secondUsAddress;
|
secondAddress = secondUsAddress;
|
||||||
});
|
});
|
||||||
|
cy.checkIfDataAreNotNull({ address, secondAddress });
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -25,7 +25,10 @@ describe("Tests for menu navigation", () => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
deleteMenusStartsWith(startsWith);
|
deleteMenusStartsWith(startsWith);
|
||||||
createMenuViaApi(randomName).then(
|
createMenuViaApi(randomName).then(
|
||||||
({ menu: menuResp }) => (menu = menuResp),
|
({ menu: menuResp }) => {
|
||||||
|
menu = menuResp
|
||||||
|
cy.checkIfDataAreNotNull(menu)
|
||||||
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,10 @@ describe("Adyen payments", () => {
|
||||||
categoryId: category.id,
|
categoryId: category.id,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(({ variantsList: variants }) => (variantsList = variants));
|
.then(({ variantsList: variants }) => {
|
||||||
|
variantsList = variants
|
||||||
|
cy.checkIfDataAreNotNull({address,defaultChannel,warehouse,shippingMethod,variantsList,checkout,paymentCards,cardData})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -50,6 +50,7 @@ describe("Stripe payments", () => {
|
||||||
defaultChannel = values.defaultChannel;
|
defaultChannel = values.defaultChannel;
|
||||||
shippingMethod = values.shippingMethod;
|
shippingMethod = values.shippingMethod;
|
||||||
variantsList = values.variantsList;
|
variantsList = values.variantsList;
|
||||||
|
cy.checkIfDataAreNotNull({address,defaultChannel,shippingMethod,variantsList,checkout,paymentCards,cardData})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
deleteProductsStartsWith(startsWith);
|
deleteProductsStartsWith(startsWith);
|
||||||
createAttribute({ name: startsWith }).then(resp => (attribute = resp));
|
createAttribute({ name: startsWith }).then(resp => (attribute = resp));
|
||||||
|
cy.checkIfDataAreNotNull(attribute);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -29,7 +29,10 @@ describe("As an admin I want to manage product types", () => {
|
||||||
deleteProductsStartsWith(startsWith);
|
deleteProductsStartsWith(startsWith);
|
||||||
createAttribute({ name: startsWith }).then(resp => (attribute = resp));
|
createAttribute({ name: startsWith }).then(resp => (attribute = resp));
|
||||||
createCategory({ name: startsWith }).then(resp => (category = resp));
|
createCategory({ name: startsWith }).then(resp => (category = resp));
|
||||||
getDefaultChannel().then(resp => (channel = resp));
|
getDefaultChannel().then(resp => {
|
||||||
|
channel = resp
|
||||||
|
cy.checkIfDataAreNotNull({attribute, channel, category})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -95,6 +95,7 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
||||||
})
|
})
|
||||||
.then(variantsListResp => {
|
.then(variantsListResp => {
|
||||||
secondVariantsList = variantsListResp;
|
secondVariantsList = variantsListResp;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel,address,warehouse,variantsList, secondVariantsList, attribute})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ describe("As a user I should be able to update and delete shipping method", () =
|
||||||
createShippingZone(name, "US", defaultChannel.id, warehouse.id).then(
|
createShippingZone(name, "US", defaultChannel.id, warehouse.id).then(
|
||||||
shippingZoneResp => {
|
shippingZoneResp => {
|
||||||
shippingZone = shippingZoneResp;
|
shippingZone = shippingZoneResp;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel, shippingZone, shippingMethod, warehouse, usAddress})
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,12 +40,12 @@ describe("As a user I should be able to update and delete shipping zone", () =>
|
||||||
warehouse = warehouseResp;
|
warehouse = warehouseResp;
|
||||||
|
|
||||||
updateChannelWarehouses(defaultChannel.id, warehouse.id);
|
updateChannelWarehouses(defaultChannel.id, warehouse.id);
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel, shippingZone, plAddress, warehouse})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const rateName = `${startsWith}${faker.datatype.number()}`;
|
|
||||||
|
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
createShippingZone(name, "US", defaultChannel.id, warehouse.id).then(
|
createShippingZone(name, "US", defaultChannel.id, warehouse.id).then(
|
||||||
|
|
|
@ -83,6 +83,7 @@ describe("As a user I want to create shipping method with postal codes", () => {
|
||||||
})
|
})
|
||||||
.then(({ variantsList: variantsListResp }) => {
|
.then(({ variantsList: variantsListResp }) => {
|
||||||
variantsList = variantsListResp;
|
variantsList = variantsListResp;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel,usAddress,secondUsAddress,shippingZone,warehouse,variantsList})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ describe("As a staff user I want to manage shipping weights", () => {
|
||||||
})
|
})
|
||||||
.then(({ variantsList: variantsListResp }) => {
|
.then(({ variantsList: variantsListResp }) => {
|
||||||
variantsList = variantsListResp;
|
variantsList = variantsListResp;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel,usAddress,shippingZone,warehouse,variantsList})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ describe("As a staff user I want to change shop default weight unit", () => {
|
||||||
})
|
})
|
||||||
.then(shippingZoneResp => {
|
.then(shippingZoneResp => {
|
||||||
shippingZone = shippingZoneResp;
|
shippingZone = shippingZoneResp;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel,usAddress,shippingZone,warehouse})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ describe("Tests for site settings", () => {
|
||||||
cy.fixture("addresses").then(({ usAddress, plAddress }) => {
|
cy.fixture("addresses").then(({ usAddress, plAddress }) => {
|
||||||
address = usAddress;
|
address = usAddress;
|
||||||
updateShopAddress(plAddress);
|
updateShopAddress(plAddress);
|
||||||
|
cy.checkIfDataAreNotNull(address)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ describe("As an admin I want to manage warehouses", () => {
|
||||||
cy.fixture("addresses").then(addresses => {
|
cy.fixture("addresses").then(addresses => {
|
||||||
usAddress = addresses.usAddress;
|
usAddress = addresses.usAddress;
|
||||||
secondUsAddress = addresses.secondUsAddress;
|
secondUsAddress = addresses.secondUsAddress;
|
||||||
|
cy.checkIfDataAreNotNull({usAddress,secondUsAddress})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ describe("Tests for customer registration", () => {
|
||||||
deleteCustomersStartsWith(startsWith);
|
deleteCustomersStartsWith(startsWith);
|
||||||
getDefaultChannel().then(channel => {
|
getDefaultChannel().then(channel => {
|
||||||
defaultChannel = channel;
|
defaultChannel = channel;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ describe("As an admin I want to create sale for products", () => {
|
||||||
})
|
})
|
||||||
.then(({ warehouse: warehouseResp }) => {
|
.then(({ warehouse: warehouseResp }) => {
|
||||||
warehouse = warehouseResp;
|
warehouse = warehouseResp;
|
||||||
|
cy.checkIfDataAreNotNull({productType,attribute,category,defaultChannel,warehouse})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ describe("Sales discounts for variant", () => {
|
||||||
warehouseId: warehouse.id,
|
warehouseId: warehouse.id,
|
||||||
price: productPrice,
|
price: productPrice,
|
||||||
};
|
};
|
||||||
|
cy.checkIfDataAreNotNull({productData, defaultChannel, warehouse, address})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ describe("As an admin I want to update sales", () => {
|
||||||
warehouseId: warehouse.id,
|
warehouseId: warehouse.id,
|
||||||
price: productPrice,
|
price: productPrice,
|
||||||
};
|
};
|
||||||
|
cy.checkIfDataAreNotNull({productData, defaultChannel, warehouse, address, sale, variants})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ describe("As an admin I want to create voucher", () => {
|
||||||
auth: "token",
|
auth: "token",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
cy.checkIfDataAreNotNull({createdChannel, dataForCheckout, defaultChannel})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ describe("As an admin I want to create voucher", () => {
|
||||||
shippingMethodName: shippingMethodResp.name,
|
shippingMethodName: shippingMethodResp.name,
|
||||||
auth: "token",
|
auth: "token",
|
||||||
};
|
};
|
||||||
|
cy.checkIfDataAreNotNull({dataForCheckout, defaultChannel})
|
||||||
cy.clearSessionData();
|
cy.clearSessionData();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -51,6 +51,7 @@ describe("As an admin I want to update vouchers", () => {
|
||||||
auth: "token",
|
auth: "token",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
cy.checkIfDataAreNotNull({dataForCheckout, defaultChannel, product})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ describe("Test for metadata", () => {
|
||||||
})
|
})
|
||||||
.then(({ product: productResp }) => {
|
.then(({ product: productResp }) => {
|
||||||
product = productResp;
|
product = productResp;
|
||||||
|
cy.checkIfDataAreNotNull({channel, product})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ xdescribe("Channels in draft orders", () => {
|
||||||
})
|
})
|
||||||
.then(channelResp => {
|
.then(channelResp => {
|
||||||
otherChannel = channelResp;
|
otherChannel = channelResp;
|
||||||
|
cy.checkIfDataAreNotNull({ defaultChannel, otherChannel });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ xdescribe("Draft orders", () => {
|
||||||
categoryId: categoryResp.id,
|
categoryId: categoryResp.id,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
cy.checkIfDataAreNotNull({ defaultChannel, warehouse, address }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ describe("As an admin I want to manage stock reservation", () => {
|
||||||
productType = productTypeResp;
|
productType = productTypeResp;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel,address,warehouse,attribute,category,productType,dataForCheckout})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -105,6 +105,7 @@ describe("Orders", () => {
|
||||||
)
|
)
|
||||||
.then(({ variantsList: variantsResp }) => {
|
.then(({ variantsList: variantsResp }) => {
|
||||||
variantsList = variantsResp;
|
variantsList = variantsResp;
|
||||||
|
cy.checkIfDataAreNotNull({customer,defaultChannel,warehouse,shippingMethod,variantsList,address})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,10 @@ describe("Tests for pages", () => {
|
||||||
attribute = attributeResp;
|
attribute = attributeResp;
|
||||||
createPageType({ name, attributeId: attribute.id });
|
createPageType({ name, attributeId: attribute.id });
|
||||||
})
|
})
|
||||||
.then(({ pageType: pageTypeResp }) => (pageType = pageTypeResp));
|
.then(({ pageType: pageTypeResp }) => {
|
||||||
|
pageType = pageTypeResp;
|
||||||
|
cy.checkIfDataAreNotNull({ attribute, pageType });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -55,6 +55,7 @@ describe("As an admin I should be able to create product", () => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
createAttribute({ name }).then(attributeResp => {
|
createAttribute({ name }).then(attributeResp => {
|
||||||
attribute = attributeResp;
|
attribute = attributeResp;
|
||||||
|
cy.checkIfDataAreNotNull({attribute})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -53,6 +53,13 @@ describe("Products available in listings", () => {
|
||||||
productType = productTypeResp;
|
productType = productTypeResp;
|
||||||
attribute = attributeResp;
|
attribute = attributeResp;
|
||||||
category = categoryResp;
|
category = categoryResp;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
productType,
|
||||||
|
attribute,
|
||||||
|
category,
|
||||||
|
defaultChannel,
|
||||||
|
warehouse,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -38,6 +38,12 @@ describe("Published products", () => {
|
||||||
)
|
)
|
||||||
.then(channel => {
|
.then(channel => {
|
||||||
defaultChannel = channel;
|
defaultChannel = channel;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
productType,
|
||||||
|
attribute,
|
||||||
|
category,
|
||||||
|
defaultChannel,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,12 @@ describe("Products displayed in listings", () => {
|
||||||
)
|
)
|
||||||
.then(channel => {
|
.then(channel => {
|
||||||
defaultChannel = channel;
|
defaultChannel = channel;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
productType,
|
||||||
|
attribute,
|
||||||
|
category,
|
||||||
|
defaultChannel,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,14 @@ describe("As an admin I should be able to filter products", () => {
|
||||||
})
|
})
|
||||||
.then(({ product: product }) => {
|
.then(({ product: product }) => {
|
||||||
updateProduct(product.id, { collections: [collection.id] });
|
updateProduct(product.id, { collections: [collection.id] });
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
attribute,
|
||||||
|
productType,
|
||||||
|
category,
|
||||||
|
warehouse,
|
||||||
|
channel,
|
||||||
|
collection,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ describe("As an admin I should be able to sort products", () => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
getDefaultChannel().then(channel => {
|
getDefaultChannel().then(channel => {
|
||||||
defaultChannel = channel;
|
defaultChannel = channel;
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,10 @@ describe("As an admin I should be able to create variant", () => {
|
||||||
|
|
||||||
createChannel({ isActive: true, name, currencyCode: "PLN" });
|
createChannel({ isActive: true, name, currencyCode: "PLN" });
|
||||||
})
|
})
|
||||||
.then(resp => (newChannel = resp));
|
.then(resp => {
|
||||||
|
newChannel = resp
|
||||||
|
cy.checkIfDataAreNotNull({defaultChannel,warehouse,attribute,productType,category,newChannel})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -86,6 +86,16 @@ describe("Creating variants", () => {
|
||||||
)
|
)
|
||||||
.then(type => {
|
.then(type => {
|
||||||
simpleProductType = type;
|
simpleProductType = type;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
defaultChannel,
|
||||||
|
warehouse,
|
||||||
|
attribute,
|
||||||
|
productType,
|
||||||
|
simpleProductType,
|
||||||
|
category,
|
||||||
|
shippingMethod,
|
||||||
|
address,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,20 @@ describe("Updating products without sku", () => {
|
||||||
categoryId: category.id,
|
categoryId: category.id,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(productResp => (product = productResp));
|
.then(productResp => {
|
||||||
|
product = productResp;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
defaultChannel,
|
||||||
|
address,
|
||||||
|
warehouse,
|
||||||
|
shippingMethod,
|
||||||
|
attribute,
|
||||||
|
category,
|
||||||
|
productTypeWithVariants,
|
||||||
|
productTypeWithoutVariants,
|
||||||
|
product,
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -58,6 +58,12 @@ describe("Update products", () => {
|
||||||
})
|
})
|
||||||
.then(({ product: productResp }) => {
|
.then(({ product: productResp }) => {
|
||||||
product = productResp;
|
product = productResp;
|
||||||
|
cy.checkIfDataAreNotNull({
|
||||||
|
defaultChannel,
|
||||||
|
collection,
|
||||||
|
product,
|
||||||
|
attribute,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ describe("Staff members", () => {
|
||||||
cy.clearSessionData().visit(urlLink);
|
cy.clearSessionData().visit(urlLink);
|
||||||
fillUpSetPassword(password);
|
fillUpSetPassword(password);
|
||||||
cy.clearSessionData();
|
cy.clearSessionData();
|
||||||
|
cy.checkIfDataAreNotNull({user})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,10 @@ describe("As an admin I want to manage translations", () => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
deleteCategoriesStartsWith(startsWith);
|
deleteCategoriesStartsWith(startsWith);
|
||||||
createCategory({ name: startsWith }).then(
|
createCategory({ name: startsWith }).then(
|
||||||
categoryResp => (category = categoryResp),
|
categoryResp => {
|
||||||
|
category = categoryResp
|
||||||
|
cy.checkIfDataAreNotNull({category})
|
||||||
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,3 +17,17 @@ Cypress.Commands.add("waitForRequestAndCheckIfNoErrors", alias => {
|
||||||
return resp;
|
return resp;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add("checkIfDataAreNotNull", (data) => {
|
||||||
|
expect(data, "Created data should not be null").to.be.not.null;
|
||||||
|
if(typeof data === "object"){
|
||||||
|
Object.keys(data).forEach(key => {
|
||||||
|
cy.checkIfDataAreNotNull(data[key])
|
||||||
|
})
|
||||||
|
}else if(Array.isArray(data)){
|
||||||
|
expect(data).not.to.be.empty;
|
||||||
|
data.forEach(singleData => {
|
||||||
|
cy.checkIfDataAreNotNull(singleData)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
Loading…
Reference in a new issue