tests for collections
This commit is contained in:
parent
2ea9035e9c
commit
ca5df50640
3 changed files with 10 additions and 3 deletions
|
@ -25,11 +25,14 @@ class Collections {
|
||||||
edges{
|
edges{
|
||||||
node{
|
node{
|
||||||
id
|
id
|
||||||
|
name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
return cy.sendRequestWithQuery(query);
|
return cy
|
||||||
|
.sendRequestWithQuery(query)
|
||||||
|
.then(resp => resp.body.data.collections.edges);
|
||||||
}
|
}
|
||||||
deleteCollection(collectionId) {
|
deleteCollection(collectionId) {
|
||||||
const mutation = `mutation{
|
const mutation = `mutation{
|
||||||
|
|
|
@ -3,7 +3,7 @@ import faker from "faker";
|
||||||
|
|
||||||
import Channels from "../apiRequests/Channels";
|
import Channels from "../apiRequests/Channels";
|
||||||
import { LEFT_MENU_SELECTORS } from "../elements/account/left-menu/left-menu-selectors";
|
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 { ADD_CHANNEL_FORM_SELECTORS } from "../elements/channels/add-channel-form-selectors";
|
||||||
import { CHANNEL_FORM_SELECTORS } from "../elements/channels/channel-form-selectors";
|
import { CHANNEL_FORM_SELECTORS } from "../elements/channels/channel-form-selectors";
|
||||||
import { CHANNELS_SELECTORS } from "../elements/channels/channels-selectors";
|
import { CHANNELS_SELECTORS } from "../elements/channels/channels-selectors";
|
||||||
|
|
|
@ -9,11 +9,13 @@ import { urlList } from "../url/urlList";
|
||||||
import ChannelsUtils from "../utils/channelsUtils";
|
import ChannelsUtils from "../utils/channelsUtils";
|
||||||
import CollectionsUtils from "../utils/collectionsUtils";
|
import CollectionsUtils from "../utils/collectionsUtils";
|
||||||
import ProductsUtils from "../utils/productsUtils";
|
import ProductsUtils from "../utils/productsUtils";
|
||||||
|
import ShippingUtils from "../utils/shippingUtils";
|
||||||
|
|
||||||
describe("Collections", () => {
|
describe("Collections", () => {
|
||||||
const channelsUtils = new ChannelsUtils();
|
const channelsUtils = new ChannelsUtils();
|
||||||
const productsUtils = new ProductsUtils();
|
const productsUtils = new ProductsUtils();
|
||||||
const collectionsUtils = new CollectionsUtils();
|
const collectionsUtils = new CollectionsUtils();
|
||||||
|
const shippingUtils = new ShippingUtils();
|
||||||
|
|
||||||
const startsWith = "Cy-";
|
const startsWith = "Cy-";
|
||||||
const name = `${startsWith}${faker.random.number()}`;
|
const name = `${startsWith}${faker.random.number()}`;
|
||||||
|
@ -23,7 +25,8 @@ describe("Collections", () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
productsUtils.deleteProperProducts(startsWith);
|
productsUtils.deleteProperProducts(startsWith);
|
||||||
// collectionsUtils.deleteProperCollections(startsWith);
|
collectionsUtils.deleteProperCollections(startsWith);
|
||||||
|
shippingUtils.deleteShipping(startsWith);
|
||||||
|
|
||||||
channelsUtils
|
channelsUtils
|
||||||
.getDefaultChannel()
|
.getDefaultChannel()
|
||||||
|
@ -31,6 +34,7 @@ describe("Collections", () => {
|
||||||
defaultChannel = channel;
|
defaultChannel = channel;
|
||||||
productsUtils.createTypeAttributeAndCategoryForProduct(name);
|
productsUtils.createTypeAttributeAndCategoryForProduct(name);
|
||||||
})
|
})
|
||||||
|
// .then(() => shippingUtils.createShipping(defaultChannel.id, name, ))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const attribute = productsUtils.getAttribute();
|
const attribute = productsUtils.getAttribute();
|
||||||
const productType = productsUtils.getProductType();
|
const productType = productsUtils.getProductType();
|
||||||
|
|
Loading…
Reference in a new issue