diff --git a/cypress/e2e/apps.js b/cypress/e2e/apps.js index e7577e291..49eba7830 100644 --- a/cypress/e2e/apps.js +++ b/cypress/e2e/apps.js @@ -84,7 +84,10 @@ describe("As a staff user I want to manage apps", () => { categoryId: category.id, }); }) - .then(({ variantsList: variants }) => (variantsList = variants)); + .then(({ variantsList: variants }) => { + variantsList = variants + cy.checkIfDataAreNotNull({createdApp,defaultChannel,address,warehouse,shippingMethod,variantsList,checkout}) + }); }); beforeEach(() => { diff --git a/cypress/e2e/catalog/categories.js b/cypress/e2e/catalog/categories.js index 180f2d630..f288206e2 100644 --- a/cypress/e2e/catalog/categories.js +++ b/cypress/e2e/catalog/categories.js @@ -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(() => { diff --git a/cypress/e2e/catalog/collections.js b/cypress/e2e/catalog/collections.js index 6e2f2103d..0ab6aac73 100644 --- a/cypress/e2e/catalog/collections.js +++ b/cypress/e2e/catalog/collections.js @@ -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(() => { diff --git a/cypress/e2e/catalog/giftCards/activateGiftCards.js b/cypress/e2e/catalog/giftCards/activateGiftCards.js index 5d8970c0c..c8babd9b7 100644 --- a/cypress/e2e/catalog/giftCards/activateGiftCards.js +++ b/cypress/e2e/catalog/giftCards/activateGiftCards.js @@ -63,6 +63,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => { shippingMethodName: resp.shippingMethod.name, variantsList: resp.variantsList, }; + cy.checkIfDataAreNotNull(dataForCheckout); }); }); diff --git a/cypress/e2e/catalog/giftCards/purchaseGiftCard.js b/cypress/e2e/catalog/giftCards/purchaseGiftCard.js index ff9855578..8e9a134be 100644 --- a/cypress/e2e/catalog/giftCards/purchaseGiftCard.js +++ b/cypress/e2e/catalog/giftCards/purchaseGiftCard.js @@ -79,6 +79,7 @@ describe("As a customer I should be able to purchase gift card as a product", () }) .then(({ variantsList: variantsResp }) => { variants = variantsResp; + cy.checkIfDataAreNotNull({defaultChannel, productType, attribute, category, shippingMethod, variants, address}) }); }); diff --git a/cypress/e2e/checkout/clickAndCollect.js b/cypress/e2e/checkout/clickAndCollect.js index 67b31f659..28000bdc8 100644 --- a/cypress/e2e/checkout/clickAndCollect.js +++ b/cypress/e2e/checkout/clickAndCollect.js @@ -83,6 +83,7 @@ describe("Warehouses in checkout", () => { }) .then(({ variantsList }) => { variantsInOtherWarehouse = variantsList; + cy.checkIfDataAreNotNull({defaultChannel, usAddress, secondUsAddress, productData, checkoutData, variantsInOtherWarehouse}) }); }); diff --git a/cypress/e2e/checkout/productWithoutShipping.js b/cypress/e2e/checkout/productWithoutShipping.js index 8279ca125..951977652 100644 --- a/cypress/e2e/checkout/productWithoutShipping.js +++ b/cypress/e2e/checkout/productWithoutShipping.js @@ -84,7 +84,10 @@ describe("Products without shipment option", () => { productTypeId: productTypeResp.id, warehouseId: warehouse.id, }).then( - ({ variantsList }) => (productWithoutShipping = variantsList), + ({ variantsList }) => { + productWithoutShipping = variantsList + cy.checkIfDataAreNotNull({channel, address, warehouse, shippingMethod, productWithShipping, productWithoutShipping}) + } ); }, ); diff --git a/cypress/e2e/checkout/purchaseWithProductTypes.js b/cypress/e2e/checkout/purchaseWithProductTypes.js index de5a9bc9a..c08c63edd 100644 --- a/cypress/e2e/checkout/purchaseWithProductTypes.js +++ b/cypress/e2e/checkout/purchaseWithProductTypes.js @@ -43,6 +43,13 @@ describe("As an unlogged customer I want to order physical and digital products" shippingMethod = resp.shippingMethod; digitalVariants = resp.digitalVariants; physicalVariants = resp.physicalVariants; + cy.checkIfDataAreNotNull({ + defaultChannel, + address, + shippingMethod, + digitalVariants, + physicalVariants, + }); }); }); diff --git a/cypress/e2e/checkout/stocksInCheckout.js b/cypress/e2e/checkout/stocksInCheckout.js index caaefc76d..099d3684b 100644 --- a/cypress/e2e/checkout/stocksInCheckout.js +++ b/cypress/e2e/checkout/stocksInCheckout.js @@ -56,6 +56,7 @@ describe("Manage products stocks in checkout", () => { lastVariantInStock = resp.createdVariants.find( variant => variant.name === "lastVariantInStock", ); + cy.checkIfDataAreNotNull({defaultChannel, address,shippingMethod, variantsWithLowStock, variantsWithoutTrackInventory, lastVariantInStock}) }); }); diff --git a/cypress/e2e/configuration/attributes/attributeVariantSelection.js b/cypress/e2e/configuration/attributes/attributeVariantSelection.js index 183e8b468..ee47f4ff1 100644 --- a/cypress/e2e/configuration/attributes/attributeVariantSelection.js +++ b/cypress/e2e/configuration/attributes/attributeVariantSelection.js @@ -25,7 +25,6 @@ describe("As an admin I want to use attributes in variant selection", () => { ]; let channel; let category; - let product; before(() => { cy.clearSessionData().loginUserViaRequest(); @@ -33,6 +32,7 @@ describe("As an admin I want to use attributes in variant selection", () => { getDefaultChannel().then(defaultChannel => (channel = defaultChannel)); createCategory({ name: startsWith }).then( 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 attributeValues = ["1", "2"]; let productType; + let product; createProductTypeWithNewVariantSelectionAttribute({ name, diff --git a/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js b/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js index 8fdf6f3dd..237da7397 100644 --- a/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js +++ b/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js @@ -29,6 +29,7 @@ describe("As an admin I want to delete and update content attribute", () => { }).then(attributeResp => { attribute = attributeResp; }); + cy.checkIfDataAreNotNull(attribute) }); it( diff --git a/cypress/e2e/configuration/channels/channels.js b/cypress/e2e/configuration/channels/channels.js index 534dc06ae..19b363d14 100644 --- a/cypress/e2e/configuration/channels/channels.js +++ b/cypress/e2e/configuration/channels/channels.js @@ -39,13 +39,17 @@ describe("Channels", () => { shippingZone = shippingZoneResp; }, ); - cy.fixture("addresses").then(addresses => { - usAddress = addresses.usAddress; - createWarehouseViaApi({ - name: randomName, - address: usAddress, + cy.fixture("addresses") + .then(addresses => { + usAddress = addresses.usAddress; + createWarehouseViaApi({ + name: randomName, + address: usAddress, + }); + }) + .then(warehouse => { + cy.checkIfDataAreNotNull({ shippingZone, usAddress, warehouse }); }); - }); }); beforeEach(() => { diff --git a/cypress/e2e/configuration/channels/inactiveChannel.js b/cypress/e2e/configuration/channels/inactiveChannel.js index 7ac9e84e8..df0a364d6 100644 --- a/cypress/e2e/configuration/channels/inactiveChannel.js +++ b/cypress/e2e/configuration/channels/inactiveChannel.js @@ -48,6 +48,7 @@ describe("Tests on inactive channel", () => { currencyCode: currency, }).then(channel => { newChannel = channel; + cy.checkIfDataAreNotNull({ address, defaultChannel, newChannel }); }); }); diff --git a/cypress/e2e/configuration/customer.js b/cypress/e2e/configuration/customer.js index 0aeaf2c9b..c29d06603 100644 --- a/cypress/e2e/configuration/customer.js +++ b/cypress/e2e/configuration/customer.js @@ -27,6 +27,7 @@ describe("Tests for customer", () => { address = usAddress; secondAddress = secondUsAddress; }); + cy.checkIfDataAreNotNull({ address, secondAddress }); }); beforeEach(() => { diff --git a/cypress/e2e/configuration/navigation.js b/cypress/e2e/configuration/navigation.js index 589312d3f..0e5ecd2d5 100644 --- a/cypress/e2e/configuration/navigation.js +++ b/cypress/e2e/configuration/navigation.js @@ -25,7 +25,10 @@ describe("Tests for menu navigation", () => { cy.clearSessionData().loginUserViaRequest(); deleteMenusStartsWith(startsWith); createMenuViaApi(randomName).then( - ({ menu: menuResp }) => (menu = menuResp), + ({ menu: menuResp }) => { + menu = menuResp + cy.checkIfDataAreNotNull(menu) + }, ); }); diff --git a/cypress/e2e/configuration/plugins/adyen.js b/cypress/e2e/configuration/plugins/adyen.js index 1da28fcf1..c2b966804 100644 --- a/cypress/e2e/configuration/plugins/adyen.js +++ b/cypress/e2e/configuration/plugins/adyen.js @@ -91,7 +91,10 @@ describe("Adyen payments", () => { categoryId: category.id, }); }) - .then(({ variantsList: variants }) => (variantsList = variants)); + .then(({ variantsList: variants }) => { + variantsList = variants + cy.checkIfDataAreNotNull({address,defaultChannel,warehouse,shippingMethod,variantsList,checkout,paymentCards,cardData}) + }); }); beforeEach(() => { diff --git a/cypress/e2e/configuration/plugins/stripe.js b/cypress/e2e/configuration/plugins/stripe.js index d4a838c95..0bddccdd2 100644 --- a/cypress/e2e/configuration/plugins/stripe.js +++ b/cypress/e2e/configuration/plugins/stripe.js @@ -50,6 +50,7 @@ describe("Stripe payments", () => { defaultChannel = values.defaultChannel; shippingMethod = values.shippingMethod; variantsList = values.variantsList; + cy.checkIfDataAreNotNull({address,defaultChannel,shippingMethod,variantsList,checkout,paymentCards,cardData}) }); }); diff --git a/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js b/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js index 98a37d7da..363b2e351 100644 --- a/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js +++ b/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js @@ -22,6 +22,7 @@ describe("As an admin I want to manage attributes in product types", () => { cy.clearSessionData().loginUserViaRequest(); deleteProductsStartsWith(startsWith); createAttribute({ name: startsWith }).then(resp => (attribute = resp)); + cy.checkIfDataAreNotNull(attribute); }); beforeEach(() => { diff --git a/cypress/e2e/configuration/productTypes/deleteProductType.js b/cypress/e2e/configuration/productTypes/deleteProductType.js index aabd4f89f..a6ce2ca74 100644 --- a/cypress/e2e/configuration/productTypes/deleteProductType.js +++ b/cypress/e2e/configuration/productTypes/deleteProductType.js @@ -29,7 +29,10 @@ describe("As an admin I want to manage product types", () => { deleteProductsStartsWith(startsWith); createAttribute({ name: startsWith }).then(resp => (attribute = resp)); createCategory({ name: startsWith }).then(resp => (category = resp)); - getDefaultChannel().then(resp => (channel = resp)); + getDefaultChannel().then(resp => { + channel = resp + cy.checkIfDataAreNotNull({attribute, channel, category}) + }); }); beforeEach(() => { diff --git a/cypress/e2e/configuration/shippingMethods/createShippingMethod.js b/cypress/e2e/configuration/shippingMethods/createShippingMethod.js index 7c7fc5cde..8c85a1460 100644 --- a/cypress/e2e/configuration/shippingMethods/createShippingMethod.js +++ b/cypress/e2e/configuration/shippingMethods/createShippingMethod.js @@ -95,6 +95,7 @@ describe("As a staff user I want to create shipping zone and rate", () => { }) .then(variantsListResp => { secondVariantsList = variantsListResp; + cy.checkIfDataAreNotNull({defaultChannel,address,warehouse,variantsList, secondVariantsList, attribute}) }); }); diff --git a/cypress/e2e/configuration/shippingMethods/editShippingMethod.js b/cypress/e2e/configuration/shippingMethods/editShippingMethod.js index 0e44fb0fe..dc8d07c4a 100644 --- a/cypress/e2e/configuration/shippingMethods/editShippingMethod.js +++ b/cypress/e2e/configuration/shippingMethods/editShippingMethod.js @@ -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( shippingZoneResp => { shippingZone = shippingZoneResp; + cy.checkIfDataAreNotNull({defaultChannel, shippingZone, shippingMethod, warehouse, usAddress}) }, ); }); diff --git a/cypress/e2e/configuration/shippingMethods/editShippingZone.js b/cypress/e2e/configuration/shippingMethods/editShippingZone.js index d2cb8f813..c827d71cb 100644 --- a/cypress/e2e/configuration/shippingMethods/editShippingZone.js +++ b/cypress/e2e/configuration/shippingMethods/editShippingZone.js @@ -40,12 +40,12 @@ describe("As a user I should be able to update and delete shipping zone", () => warehouse = warehouseResp; updateChannelWarehouses(defaultChannel.id, warehouse.id); + cy.checkIfDataAreNotNull({defaultChannel, shippingZone, plAddress, warehouse}) }); }); }); beforeEach(() => { - const rateName = `${startsWith}${faker.datatype.number()}`; cy.clearSessionData().loginUserViaRequest(); createShippingZone(name, "US", defaultChannel.id, warehouse.id).then( diff --git a/cypress/e2e/configuration/shippingMethods/postalCodes.js b/cypress/e2e/configuration/shippingMethods/postalCodes.js index 7b572b5c6..5b7c4c3f5 100644 --- a/cypress/e2e/configuration/shippingMethods/postalCodes.js +++ b/cypress/e2e/configuration/shippingMethods/postalCodes.js @@ -83,6 +83,7 @@ describe("As a user I want to create shipping method with postal codes", () => { }) .then(({ variantsList: variantsListResp }) => { variantsList = variantsListResp; + cy.checkIfDataAreNotNull({defaultChannel,usAddress,secondUsAddress,shippingZone,warehouse,variantsList}) }); }); diff --git a/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js b/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js index 2bdabaf14..a930c8355 100644 --- a/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js +++ b/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js @@ -74,6 +74,7 @@ describe("As a staff user I want to manage shipping weights", () => { }) .then(({ variantsList: variantsListResp }) => { variantsList = variantsListResp; + cy.checkIfDataAreNotNull({defaultChannel,usAddress,shippingZone,warehouse,variantsList}) }); }); diff --git a/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js b/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js index ea63fb4fb..0966e4bf7 100644 --- a/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js +++ b/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js @@ -51,6 +51,7 @@ describe("As a staff user I want to change shop default weight unit", () => { }) .then(shippingZoneResp => { shippingZone = shippingZoneResp; + cy.checkIfDataAreNotNull({defaultChannel,usAddress,shippingZone,warehouse}) }); }); diff --git a/cypress/e2e/configuration/siteSettings.js b/cypress/e2e/configuration/siteSettings.js index 2aea7b4fc..8cda56512 100644 --- a/cypress/e2e/configuration/siteSettings.js +++ b/cypress/e2e/configuration/siteSettings.js @@ -17,6 +17,7 @@ describe("Tests for site settings", () => { cy.fixture("addresses").then(({ usAddress, plAddress }) => { address = usAddress; updateShopAddress(plAddress); + cy.checkIfDataAreNotNull(address) }); }); diff --git a/cypress/e2e/configuration/warehouses/warehouse.js b/cypress/e2e/configuration/warehouses/warehouse.js index ae443572c..d94d4f28b 100644 --- a/cypress/e2e/configuration/warehouses/warehouse.js +++ b/cypress/e2e/configuration/warehouses/warehouse.js @@ -35,6 +35,7 @@ describe("As an admin I want to manage warehouses", () => { cy.fixture("addresses").then(addresses => { usAddress = addresses.usAddress; secondUsAddress = addresses.secondUsAddress; + cy.checkIfDataAreNotNull({usAddress,secondUsAddress}) }); }); diff --git a/cypress/e2e/customerRegistration.js b/cypress/e2e/customerRegistration.js index 9f99245c9..ee43fc329 100644 --- a/cypress/e2e/customerRegistration.js +++ b/cypress/e2e/customerRegistration.js @@ -25,6 +25,7 @@ describe("Tests for customer registration", () => { deleteCustomersStartsWith(startsWith); getDefaultChannel().then(channel => { defaultChannel = channel; + cy.checkIfDataAreNotNull({defaultChannel}) }); }); diff --git a/cypress/e2e/discounts/sales/createSalesForProducts.js b/cypress/e2e/discounts/sales/createSalesForProducts.js index a17788e43..33ec8051d 100644 --- a/cypress/e2e/discounts/sales/createSalesForProducts.js +++ b/cypress/e2e/discounts/sales/createSalesForProducts.js @@ -69,6 +69,7 @@ describe("As an admin I want to create sale for products", () => { }) .then(({ warehouse: warehouseResp }) => { warehouse = warehouseResp; + cy.checkIfDataAreNotNull({productType,attribute,category,defaultChannel,warehouse}) }); }); diff --git a/cypress/e2e/discounts/sales/createSalesForVariants.js b/cypress/e2e/discounts/sales/createSalesForVariants.js index 195c2c584..77dd2e973 100644 --- a/cypress/e2e/discounts/sales/createSalesForVariants.js +++ b/cypress/e2e/discounts/sales/createSalesForVariants.js @@ -71,6 +71,7 @@ describe("Sales discounts for variant", () => { warehouseId: warehouse.id, price: productPrice, }; + cy.checkIfDataAreNotNull({productData, defaultChannel, warehouse, address}) }); }); diff --git a/cypress/e2e/discounts/sales/updateSales.js b/cypress/e2e/discounts/sales/updateSales.js index 591d8f276..e39ab5b2b 100644 --- a/cypress/e2e/discounts/sales/updateSales.js +++ b/cypress/e2e/discounts/sales/updateSales.js @@ -82,6 +82,7 @@ describe("As an admin I want to update sales", () => { warehouseId: warehouse.id, price: productPrice, }; + cy.checkIfDataAreNotNull({productData, defaultChannel, warehouse, address, sale, variants}) }); }); diff --git a/cypress/e2e/discounts/vouchers/createVouchers.js b/cypress/e2e/discounts/vouchers/createVouchers.js index a1ddd05ef..d2579c2a3 100644 --- a/cypress/e2e/discounts/vouchers/createVouchers.js +++ b/cypress/e2e/discounts/vouchers/createVouchers.js @@ -53,6 +53,7 @@ describe("As an admin I want to create voucher", () => { auth: "token", }; }, + cy.checkIfDataAreNotNull({createdChannel, dataForCheckout, defaultChannel}) ); }); diff --git a/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js b/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js index 7718ccbfd..33ecd7ccd 100644 --- a/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js +++ b/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js @@ -49,6 +49,7 @@ describe("As an admin I want to create voucher", () => { shippingMethodName: shippingMethodResp.name, auth: "token", }; + cy.checkIfDataAreNotNull({dataForCheckout, defaultChannel}) cy.clearSessionData(); }, ); diff --git a/cypress/e2e/discounts/vouchers/updateVouchers.js b/cypress/e2e/discounts/vouchers/updateVouchers.js index 0c38e7ace..a3f1c4b6d 100644 --- a/cypress/e2e/discounts/vouchers/updateVouchers.js +++ b/cypress/e2e/discounts/vouchers/updateVouchers.js @@ -51,6 +51,7 @@ describe("As an admin I want to update vouchers", () => { auth: "token", }; }, + cy.checkIfDataAreNotNull({dataForCheckout, defaultChannel, product}) ); }); diff --git a/cypress/e2e/metadata.js b/cypress/e2e/metadata.js index 1af7aeac4..da5ab9473 100644 --- a/cypress/e2e/metadata.js +++ b/cypress/e2e/metadata.js @@ -41,6 +41,7 @@ describe("Test for metadata", () => { }) .then(({ product: productResp }) => { product = productResp; + cy.checkIfDataAreNotNull({channel, product}) }); }); diff --git a/cypress/e2e/orders/channelsInDraftOrders.js b/cypress/e2e/orders/channelsInDraftOrders.js index 73a02c6d0..8d6db12a3 100644 --- a/cypress/e2e/orders/channelsInDraftOrders.js +++ b/cypress/e2e/orders/channelsInDraftOrders.js @@ -33,6 +33,7 @@ xdescribe("Channels in draft orders", () => { }) .then(channelResp => { otherChannel = channelResp; + cy.checkIfDataAreNotNull({ defaultChannel, otherChannel }); }); }); diff --git a/cypress/e2e/orders/draftOrders.js b/cypress/e2e/orders/draftOrders.js index e3c4722d5..2d2e3c0ed 100644 --- a/cypress/e2e/orders/draftOrders.js +++ b/cypress/e2e/orders/draftOrders.js @@ -77,6 +77,7 @@ xdescribe("Draft orders", () => { categoryId: categoryResp.id, }); }, + cy.checkIfDataAreNotNull({ defaultChannel, warehouse, address }), ); }); diff --git a/cypress/e2e/orders/manageStockReservation.js b/cypress/e2e/orders/manageStockReservation.js index 32df92775..a3001d2a1 100644 --- a/cypress/e2e/orders/manageStockReservation.js +++ b/cypress/e2e/orders/manageStockReservation.js @@ -67,6 +67,7 @@ describe("As an admin I want to manage stock reservation", () => { productType = productTypeResp; }, ); + cy.checkIfDataAreNotNull({defaultChannel,address,warehouse,attribute,category,productType,dataForCheckout}) }); }); }); diff --git a/cypress/e2e/orders/orders.js b/cypress/e2e/orders/orders.js index 3c2bdd0fc..9f896b57b 100644 --- a/cypress/e2e/orders/orders.js +++ b/cypress/e2e/orders/orders.js @@ -105,6 +105,7 @@ describe("Orders", () => { ) .then(({ variantsList: variantsResp }) => { variantsList = variantsResp; + cy.checkIfDataAreNotNull({customer,defaultChannel,warehouse,shippingMethod,variantsList,address}) }); }); diff --git a/cypress/e2e/pages/pages.js b/cypress/e2e/pages/pages.js index 36b3256d2..647891f59 100644 --- a/cypress/e2e/pages/pages.js +++ b/cypress/e2e/pages/pages.js @@ -40,7 +40,10 @@ describe("Tests for pages", () => { attribute = attributeResp; createPageType({ name, attributeId: attribute.id }); }) - .then(({ pageType: pageTypeResp }) => (pageType = pageTypeResp)); + .then(({ pageType: pageTypeResp }) => { + pageType = pageTypeResp; + cy.checkIfDataAreNotNull({ attribute, pageType }); + }); }); beforeEach(() => { diff --git a/cypress/e2e/products/createProduct.js b/cypress/e2e/products/createProduct.js index 323cfbb62..aa48aadc5 100644 --- a/cypress/e2e/products/createProduct.js +++ b/cypress/e2e/products/createProduct.js @@ -55,6 +55,7 @@ describe("As an admin I should be able to create product", () => { cy.clearSessionData().loginUserViaRequest(); createAttribute({ name }).then(attributeResp => { attribute = attributeResp; + cy.checkIfDataAreNotNull({attribute}) }); }); beforeEach(() => { diff --git a/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js b/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js index d8042ec1e..7531a76b4 100644 --- a/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js +++ b/cypress/e2e/products/manageProducts/availableForPurchaseProducts.js @@ -53,6 +53,13 @@ describe("Products available in listings", () => { productType = productTypeResp; attribute = attributeResp; category = categoryResp; + cy.checkIfDataAreNotNull({ + productType, + attribute, + category, + defaultChannel, + warehouse, + }); }, ); }); diff --git a/cypress/e2e/products/manageProducts/publishedProducts.js b/cypress/e2e/products/manageProducts/publishedProducts.js index 37f1401f6..045c21e4d 100644 --- a/cypress/e2e/products/manageProducts/publishedProducts.js +++ b/cypress/e2e/products/manageProducts/publishedProducts.js @@ -38,6 +38,12 @@ describe("Published products", () => { ) .then(channel => { defaultChannel = channel; + cy.checkIfDataAreNotNull({ + productType, + attribute, + category, + defaultChannel, + }); }); }); diff --git a/cypress/e2e/products/manageProducts/visibleInListingsProducts.js b/cypress/e2e/products/manageProducts/visibleInListingsProducts.js index e4e1c21d9..ce353b505 100644 --- a/cypress/e2e/products/manageProducts/visibleInListingsProducts.js +++ b/cypress/e2e/products/manageProducts/visibleInListingsProducts.js @@ -37,6 +37,12 @@ describe("Products displayed in listings", () => { ) .then(channel => { defaultChannel = channel; + cy.checkIfDataAreNotNull({ + productType, + attribute, + category, + defaultChannel, + }); }); }); diff --git a/cypress/e2e/products/productsList/filteringProducts.js b/cypress/e2e/products/productsList/filteringProducts.js index 876ffb3ed..9b40da8c1 100644 --- a/cypress/e2e/products/productsList/filteringProducts.js +++ b/cypress/e2e/products/productsList/filteringProducts.js @@ -80,6 +80,14 @@ describe("As an admin I should be able to filter products", () => { }) .then(({ product: product }) => { updateProduct(product.id, { collections: [collection.id] }); + cy.checkIfDataAreNotNull({ + attribute, + productType, + category, + warehouse, + channel, + collection, + }); }); }); diff --git a/cypress/e2e/products/productsList/sortingProducts.js b/cypress/e2e/products/productsList/sortingProducts.js index 57656b4a4..2f822b862 100644 --- a/cypress/e2e/products/productsList/sortingProducts.js +++ b/cypress/e2e/products/productsList/sortingProducts.js @@ -27,6 +27,7 @@ describe("As an admin I should be able to sort products", () => { cy.clearSessionData().loginUserViaRequest(); getDefaultChannel().then(channel => { defaultChannel = channel; + cy.checkIfDataAreNotNull({defaultChannel}) }); }); diff --git a/cypress/e2e/products/productsVariants.js b/cypress/e2e/products/productsVariants.js index 851374910..2c0dae032 100644 --- a/cypress/e2e/products/productsVariants.js +++ b/cypress/e2e/products/productsVariants.js @@ -48,7 +48,10 @@ describe("As an admin I should be able to create variant", () => { createChannel({ isActive: true, name, currencyCode: "PLN" }); }) - .then(resp => (newChannel = resp)); + .then(resp => { + newChannel = resp + cy.checkIfDataAreNotNull({defaultChannel,warehouse,attribute,productType,category,newChannel}) + }); }); beforeEach(() => { diff --git a/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js b/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js index 4b87dcf19..3065998ae 100644 --- a/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js +++ b/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js @@ -86,6 +86,16 @@ describe("Creating variants", () => { ) .then(type => { simpleProductType = type; + cy.checkIfDataAreNotNull({ + defaultChannel, + warehouse, + attribute, + productType, + simpleProductType, + category, + shippingMethod, + address, + }); }); }); diff --git a/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js b/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js index f6bc3507a..11b55da65 100644 --- a/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js +++ b/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js @@ -73,7 +73,20 @@ describe("Updating products without sku", () => { categoryId: category.id, }); }) - .then(productResp => (product = productResp)); + .then(productResp => { + product = productResp; + cy.checkIfDataAreNotNull({ + defaultChannel, + address, + warehouse, + shippingMethod, + attribute, + category, + productTypeWithVariants, + productTypeWithoutVariants, + product, + }); + }); }); beforeEach(() => { diff --git a/cypress/e2e/products/updatingProducts.js b/cypress/e2e/products/updatingProducts.js index bc1f6918d..f8a9c1834 100644 --- a/cypress/e2e/products/updatingProducts.js +++ b/cypress/e2e/products/updatingProducts.js @@ -58,6 +58,12 @@ describe("Update products", () => { }) .then(({ product: productResp }) => { product = productResp; + cy.checkIfDataAreNotNull({ + defaultChannel, + collection, + product, + attribute, + }); }); }); diff --git a/cypress/e2e/staffMembers.js b/cypress/e2e/staffMembers.js index 38c98e27e..065503472 100644 --- a/cypress/e2e/staffMembers.js +++ b/cypress/e2e/staffMembers.js @@ -52,6 +52,7 @@ describe("Staff members", () => { cy.clearSessionData().visit(urlLink); fillUpSetPassword(password); cy.clearSessionData(); + cy.checkIfDataAreNotNull({user}) }); }); diff --git a/cypress/e2e/translations.js b/cypress/e2e/translations.js index 28437548a..49f12386b 100644 --- a/cypress/e2e/translations.js +++ b/cypress/e2e/translations.js @@ -21,7 +21,10 @@ describe("As an admin I want to manage translations", () => { cy.clearSessionData().loginUserViaRequest(); deleteCategoriesStartsWith(startsWith); createCategory({ name: startsWith }).then( - categoryResp => (category = categoryResp), + categoryResp => { + category = categoryResp + cy.checkIfDataAreNotNull({category}) + }, ); }); diff --git a/cypress/support/customCommands/basicOperations/index.js b/cypress/support/customCommands/basicOperations/index.js index 2da1e2098..4f33de223 100644 --- a/cypress/support/customCommands/basicOperations/index.js +++ b/cypress/support/customCommands/basicOperations/index.js @@ -17,3 +17,17 @@ Cypress.Commands.add("waitForRequestAndCheckIfNoErrors", alias => { 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) + }) + } +}) \ No newline at end of file