From ca5df50640e82feb5ebb98f79b418795d493a428 Mon Sep 17 00:00:00 2001 From: Karolina Rakoczy Date: Fri, 19 Feb 2021 13:41:40 +0100 Subject: [PATCH] tests for collections --- cypress/apiRequests/frontShop/Collections.js | 5 ++++- cypress/integration/channels.js | 2 +- cypress/integration/collections.js | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cypress/apiRequests/frontShop/Collections.js b/cypress/apiRequests/frontShop/Collections.js index 183f0c506..2ff9e4fe2 100644 --- a/cypress/apiRequests/frontShop/Collections.js +++ b/cypress/apiRequests/frontShop/Collections.js @@ -25,11 +25,14 @@ class Collections { edges{ node{ id + name } } } }`; - return cy.sendRequestWithQuery(query); + return cy + .sendRequestWithQuery(query) + .then(resp => resp.body.data.collections.edges); } deleteCollection(collectionId) { const mutation = `mutation{ diff --git a/cypress/integration/channels.js b/cypress/integration/channels.js index bfee7abae..4b3e3354c 100644 --- a/cypress/integration/channels.js +++ b/cypress/integration/channels.js @@ -3,7 +3,7 @@ import faker from "faker"; import Channels from "../apiRequests/Channels"; import { LEFT_MENU_SELECTORS } from "../elements/account/left-menu/left-menu-selectors"; -import { PRODUCTS_SELECTORS } from "../elements/catalog/product-selectors"; +import { PRODUCTS_SELECTORS } from "../elements/catalog/products/product-selectors"; import { ADD_CHANNEL_FORM_SELECTORS } from "../elements/channels/add-channel-form-selectors"; import { CHANNEL_FORM_SELECTORS } from "../elements/channels/channel-form-selectors"; import { CHANNELS_SELECTORS } from "../elements/channels/channels-selectors"; diff --git a/cypress/integration/collections.js b/cypress/integration/collections.js index 7245634b5..8cc5cec26 100644 --- a/cypress/integration/collections.js +++ b/cypress/integration/collections.js @@ -9,11 +9,13 @@ import { urlList } from "../url/urlList"; import ChannelsUtils from "../utils/channelsUtils"; import CollectionsUtils from "../utils/collectionsUtils"; import ProductsUtils from "../utils/productsUtils"; +import ShippingUtils from "../utils/shippingUtils"; describe("Collections", () => { const channelsUtils = new ChannelsUtils(); const productsUtils = new ProductsUtils(); const collectionsUtils = new CollectionsUtils(); + const shippingUtils = new ShippingUtils(); const startsWith = "Cy-"; const name = `${startsWith}${faker.random.number()}`; @@ -23,7 +25,8 @@ describe("Collections", () => { before(() => { cy.clearSessionData().loginUserViaRequest(); productsUtils.deleteProperProducts(startsWith); - // collectionsUtils.deleteProperCollections(startsWith); + collectionsUtils.deleteProperCollections(startsWith); + shippingUtils.deleteShipping(startsWith); channelsUtils .getDefaultChannel() @@ -31,6 +34,7 @@ describe("Collections", () => { defaultChannel = channel; productsUtils.createTypeAttributeAndCategoryForProduct(name); }) + // .then(() => shippingUtils.createShipping(defaultChannel.id, name, )) .then(() => { const attribute = productsUtils.getAttribute(); const productType = productsUtils.getProductType();