tests for collections

This commit is contained in:
Karolina Rakoczy 2021-02-19 13:41:40 +01:00
parent 2ea9035e9c
commit ca5df50640
3 changed files with 10 additions and 3 deletions

View file

@ -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{

View file

@ -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";

View file

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