Saleor 4437 refactor tests (#1389)

* reference type cypress working

* refactor

* remove screenshots

* add reference

* add slash marker

* run tests based on shop version

* fix run tests based on shop version

* fix run tests based on shop version

* change base url to localhost

* fix plugins

* fix plugins

* fix plugins

* fix plugins

* fix plugins

* fix plugins

* fix yml

* fix yml

* chage file names

* fix files names

* fix broken imports add checking for errors in grpah responses

* fix broken imports add checking for errors in grpah responses

* update jest

* fix snapshot
This commit is contained in:
Karolina Rakoczy 2021-09-27 12:04:21 +02:00 committed by GitHub
parent b98f069aab
commit 2c64a966cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 1629 additions and 1294 deletions

View file

@ -167,7 +167,7 @@
"sort-imports": "off", // imports are handled by simple-import-sort/sort
"sort-keys": "off",
"space-before-function-paren": "off",
"spaced-comment": "error",
"spaced-comment": ["error", "always", { "markers": ["/"] }],
"use-isnan": "error",
"valid-typeof": "off",
"no-restricted-imports": [

View file

@ -8,7 +8,7 @@ on:
jobs:
cypress-run:
if: github.event.pull_request.head.repo.full_name == 'mirumee/saleor-dashboard' && (((github.event.action == 'labeled') && (github.event.label.name == 'run e2e')) || ((github.event.action != 'labeled') && contains(github.event.pull_request.labels.*.name, 'run e2e')))
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

View file

@ -5,6 +5,7 @@ export const MENU_DETAILS = {
autocompleteSelectReference: '[data-test-id="containerAutocompleteSelect"]',
categoryItem: '[data-test-id="category"]',
collectionItem: '[data-test-id="collection"]',
pageItem: '[data-test-id="page"]'
pageItem: '[data-test-id="page"]',
anyMenuItem: '[id="downshift-0-item-2"]'
}
};

View file

@ -1,17 +1,19 @@
/// <reference types="cypress"/>
/// <reference types="../support"/>
import faker from "faker";
import { createApp, getApp } from "../apiRequests/Apps";
import { ONE_PERMISSION_USERS } from "../Data/users";
import { APP_DETAILS } from "../elements/apps/appDetails";
import { APPS_LIST } from "../elements/apps/appsList";
import { WEBHOOK_DETAILS } from "../elements/apps/webhookDetails";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { confirmationMessageShouldDisappear } from "../steps/shared/confirmationMessages";
import { appDetailsUrl, urlList } from "../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../fixtures/users";
import { createApp, getApp } from "../support/api/requests/Apps";
import { deleteAppsStartsWith } from "../support/api/utils/appUtils";
import filterTests from "../support/filterTests";
import { appDetailsUrl, urlList } from "../url/urlList";
import { deleteAppsStartsWith } from "../utils/appUtils";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for apps", () => {
const startsWith = "Apps";
const name = `${startsWith}${faker.datatype.number()}`;
@ -45,9 +47,9 @@ filterTests(["all"], () => {
.click()
.addAliasToGraphRequest("AppCreate")
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.wait("@AppCreate")
.click()
.confirmationMessageShouldDisappear()
.waitForRequestAndCheckIfNoErrors("@AppCreate")
.its("response.body.data.appCreate.app")
.then(app => {
getApp(app.id);
@ -71,8 +73,8 @@ filterTests(["all"], () => {
.get(WEBHOOK_DETAILS.targetUrlInput)
.type(targetUrl)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
getApp(createdApp.id).then(({ webhooks }) => {
expect(webhooks[0].name).to.eq(randomName);
expect(webhooks[0].targetUrl).to.eq(targetUrl);

View file

@ -1,21 +1,22 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { getCategory } from "../apiRequests/Category";
import { CATEGORIES_LIST } from "../elements/catalog/categories/categories-list";
import { CATEGORY_DETAILS } from "../elements/catalog/categories/category-details";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../elements/shared/sharedElements";
import { createCategory } from "../steps/categoriesSteps";
import { confirmationMessageShouldDisappear } from "../steps/shared/confirmationMessages";
import filterTests from "../support/filterTests";
import { categoryDetailsUrl, urlList } from "../url/urlList";
import { deleteCategoriesStartsWith } from "../utils/categoryUtils";
import * as channelsUtils from "../utils/channelsUtils";
import * as productsUtils from "../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../utils/shippingUtils";
import { CATEGORIES_LIST } from "../../elements/catalog/categories/categories-list";
import { CATEGORY_DETAILS } from "../../elements/catalog/categories/category-details";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { categoryDetailsUrl, urlList } from "../../fixtures/urlList";
import { getCategory } from "../../support/api/requests/Category";
import { deleteCategoriesStartsWith } from "../../support/api/utils/categoryUtils";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
import { createCategory } from "../../support/pages/catalog/categoriesPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Categories", () => {
const startsWith = "CyCollections";
const name = `${startsWith}${faker.datatype.number()}`;
@ -118,11 +119,11 @@ filterTests(["all"], () => {
.click()
.addAliasToGraphRequest("productBulkDelete")
.get(BUTTON_SELECTORS.submit)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
cy.contains(CATEGORY_DETAILS.productRow, product.name)
.should("not.exist")
.wait("@productBulkDelete");
.waitForRequestAndCheckIfNoErrors("@productBulkDelete");
getCategory(category.id).then(categoryResp => {
expect(categoryResp.products.edges.length).to.be.eq(0);
});

View file

@ -1,27 +1,29 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createChannel } from "../apiRequests/Channels";
import { updateChannelInProduct } from "../apiRequests/Product";
import { getCollection } from "../apiRequests/storeFront/Collections";
import { searchInShop } from "../apiRequests/storeFront/Search";
import {
assignProductsToCollection,
createCollection
} from "../steps/collectionsSteps";
import filterTests from "../support/filterTests";
import { urlList } from "../url/urlList";
import * as channelsUtils from "../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../utils/collectionsUtils";
import * as productsUtils from "../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../utils/shippingUtils";
import { urlList } from "../../fixtures/urlList";
import { createChannel } from "../../support/api/requests/Channels";
import { updateChannelInProduct } from "../../support/api/requests/Product";
import { getCollection } from "../../support/api/requests/storeFront/Collections";
import { searchInShop } from "../../support/api/requests/storeFront/Search";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../../support/api/utils/collectionsUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils";
import {
isCollectionVisible,
isProductInCollectionVisible
} from "../utils/storeFront/collectionsUtils";
import { isProductVisibleInSearchResult } from "../utils/storeFront/storeFrontProductUtils";
} from "../../support/api/utils/storeFront/collectionsUtils";
import { isProductVisibleInSearchResult } from "../../support/api/utils/storeFront/storeFrontProductUtils";
import filterTests from "../../support/filterTests";
import {
assignProductsToCollection,
createCollection
} from "../../support/pages/catalog/collectionsPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Collections", () => {
const startsWith = "CyCollections-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,7 +1,11 @@
// <reference types="cypress" />
/// <reference types="cypress" />
/// <reference types="../../support"/>
import faker from "faker";
import { getGiftCardWithTag } from "../apiRequests/giftCards";
import { getGiftCardWithTag } from "../../support/api/requests/GiftCard";
import filterTests from "../../support/filterTests";
import { formatDate } from "../../support/formatData/formatDate";
import {
expiryPeriods,
openAndFillUpCreateGiftCardDialog,
@ -9,11 +13,9 @@ import {
setExpiryDate,
setExpiryPeriod,
setNeverExpire
} from "../steps/giftCardSteps";
import filterTests from "../support/filterTests";
import { formatDate } from "../support/format/formatDate";
} from "../../support/pages/catalog/giftCardPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
describe("Tests for gift cards", () => {
const startsWith = "GiftCards";
const amount = 50;

View file

@ -1,25 +1,26 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createChannel } from "../../apiRequests/Channels";
import { createChannel } from "../../support/api/requests/Channels";
import {
addProductsToCheckout,
addShippingMethod,
createCheckout
} from "../../apiRequests/Checkout";
import filterTests from "../../support/filterTests";
} from "../../support/api/requests/Checkout";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
} from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Products without shipment option", () => {
const startsWith = "WithoutShipmentCheckout-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,33 +1,36 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createAttribute } from "../../apiRequests/Attribute";
import { createCategory } from "../../apiRequests/Category";
import { createAttribute } from "../../support/api/requests/Attribute";
import { createCategory } from "../../support/api/requests/Category";
import {
checkoutShippingAddressUpdate,
checkoutShippingMethodUpdate,
checkoutVariantsUpdate,
completeCheckout,
createCheckout
} from "../../apiRequests/Checkout";
import { getOrder } from "../../apiRequests/Order";
import { createTypeProduct } from "../../apiRequests/productType";
import filterTests from "../../support/filterTests";
import { getDefaultChannel } from "../../utils/channelsUtils";
} from "../../support/api/requests/Checkout";
import { getOrder } from "../../support/api/requests/Order";
import { createTypeProduct } from "../../support/api/requests/ProductType";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import {
addPayment,
createAndCompleteCheckoutWithoutShipping,
createWaitingForCaptureOrder
} from "../../utils/ordersUtils";
} from "../../support/api/utils/ordersUtils";
import {
createProductInChannel,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
} from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
filterTests(["all", "critical"], () => {
filterTests({ definedTags: ["all", "critical"] }, () => {
describe("Purchase products with all products types", () => {
const startsWith = `CyPurchaseByType`;
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,24 +1,27 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import {
addProductsToCheckout,
createCheckout
} from "../../apiRequests/Checkout";
import { getVariants } from "../../apiRequests/Product";
import filterTests from "../../support/filterTests";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { createOrderWithNewProduct } from "../../utils/ordersUtils";
} from "../../support/api/requests/Checkout";
import { getVariants } from "../../support/api/requests/Product";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import { createOrderWithNewProduct } from "../../support/api/utils/ordersUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
} from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
filterTests(["all", "critical"], () => {
filterTests({ definedTags: ["all", "critical"] }, () => {
describe("Products stocks in checkout", () => {
const startsWith = "CyStocksCheckout-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,19 +1,22 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createCheckout } from "../../apiRequests/Checkout";
import filterTests from "../../support/filterTests";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { createCheckout } from "../../support/api/requests/Checkout";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
} from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Warehouses in checkout", () => {
const startsWith = `CyWarehouseCheckout`;
let defaultChannel;

View file

@ -1,16 +1,17 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { getAttribute } from "../../../apiRequests/Attribute";
import { ATTRIBUTES_LIST } from "../../../elements/attribute/attributes_list";
import { createAttributeWithInputType } from "../../../steps/attributesSteps";
import { urlList } from "../../../fixtures/urlList";
import { getAttribute } from "../../../support/api/requests/Attribute";
import { deleteAttributesStartsWith } from "../../../support/api/utils/attributes/attributeUtils";
import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData";
import filterTests from "../../../support/filterTests";
import { urlList } from "../../../url/urlList";
import { deleteAttributesStartsWith } from "../../../utils/attributes/attributeUtils";
import { expectCorrectDataInAttribute } from "../../../utils/attributes/checkAttributeData";
import { createAttributeWithInputType } from "../../../support/pages/attributesPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Create attribute with type", () => {
const startsWith = "AttrCreate";
const attributesTypes = [

View file

@ -1,15 +1,18 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { getAttribute } from "../../../apiRequests/Attribute";
import { ATTRIBUTES_DETAILS } from "../../../elements/attribute/attributes_details";
import { ATTRIBUTES_LIST } from "../../../elements/attribute/attributes_list";
import { createAttributeWithInputType } from "../../../steps/attributesSteps";
import { urlList } from "../../../fixtures/urlList";
import { getAttribute } from "../../../support/api/requests/Attribute";
import { deleteAttributesStartsWith } from "../../../support/api/utils/attributes/attributeUtils";
import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData";
import filterTests from "../../../support/filterTests";
import { urlList } from "../../../url/urlList";
import { deleteAttributesStartsWith } from "../../../utils/attributes/attributeUtils";
import { expectCorrectDataInAttribute } from "../../../utils/attributes/checkAttributeData";
import { createAttributeWithInputType } from "../../../support/pages/attributesPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Create content attribute", () => {
const startsWith = "AttrCont";
const attributesTypes = [

View file

@ -1,57 +1,69 @@
import { updateAttribute } from "../../../apiRequests/Attribute";
import { createProduct } from "../../../apiRequests/Product";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { enterAttributeAndChanegeIsFilterableInDashbord } from "../../../steps/attributesSteps";
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import {
getElementByDataTestId,
SHARED_ELEMENTS
} from "../../../elements/shared/sharedElements";
import { updateAttribute } from "../../../support/api/requests/Attribute";
import { createProduct } from "../../../support/api/requests/Product";
import {
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../../support/api/utils/products/productsUtils";
import filterTests from "../../../support/filterTests";
import { enterAttributeAndChanegeIsFilterableInDashbord } from "../../../support/pages/attributesPage";
import {
enterProductListPage,
selectAttributeFilter,
showFilters
} from "../../../steps/catalog/products/productsListSteps";
import {
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../../utils/products/productsUtils";
} from "../../../support/pages/catalog/products/productsListPage";
describe("Tests for using attributes in filters", () => {
const startsWith = "AttrFilter";
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for using attributes in filters", () => {
const startsWith = "AttrFilter";
let attribute;
let attribute;
before(() => {
cy.clearSessionData().loginUserViaRequest();
deleteProductsStartsWith(startsWith);
createTypeAttributeAndCategoryForProduct(startsWith, [startsWith]).then(
({ attribute: attributeResp, category, productType }) => {
attribute = attributeResp;
createProduct({
attributeId: attribute.id,
attributeValue: startsWith,
categoryId: category.id,
productTypeId: productType.id,
name: startsWith
});
}
);
});
it("should use attribute as filter", () => {
updateAttribute({
attributeId: attribute.id,
filterableInDashboard: false
before(() => {
cy.clearSessionData().loginUserViaRequest();
deleteProductsStartsWith(startsWith);
createTypeAttributeAndCategoryForProduct(startsWith, [startsWith]).then(
({ attribute: attributeResp, category, productType }) => {
attribute = attributeResp;
createProduct({
attributeId: attribute.id,
attributeValue: startsWith,
categoryId: category.id,
productTypeId: productType.id,
name: startsWith
});
}
);
});
enterAttributeAndChanegeIsFilterableInDashbord(attribute.id);
enterProductListPage();
selectAttributeFilter(attribute.slug, attribute.name);
cy.contains(SHARED_ELEMENTS.tableRow, attribute.name).should("be.visible");
});
it("should remove attribute from filters", () => {
updateAttribute({ attributeId: attribute.id, filterableInDashboard: true });
enterAttributeAndChanegeIsFilterableInDashbord(attribute.id);
enterProductListPage();
showFilters();
cy.contains(SHARED_ELEMENTS.filters.filterRow, attribute.name).should(
"not.exist"
);
it("should use attribute as filter", () => {
updateAttribute({
attributeId: attribute.id,
filterableInDashboard: false
});
enterAttributeAndChanegeIsFilterableInDashbord(attribute.id);
enterProductListPage();
selectAttributeFilter(attribute.slug, attribute.name);
cy.contains(SHARED_ELEMENTS.tableRow, attribute.name).should(
"be.visible"
);
});
it("should remove attribute from filters", () => {
updateAttribute({
attributeId: attribute.id,
filterableInDashboard: true
});
enterAttributeAndChanegeIsFilterableInDashbord(attribute.id);
enterProductListPage();
showFilters();
cy.get(getElementByDataTestId(attribute.name)).should("not.exist");
});
});
});

View file

@ -1,27 +1,27 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { createChannel } from "../../apiRequests/Channels";
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import { ADD_CHANNEL_FORM_SELECTORS } from "../../../elements/channels/add-channel-form-selectors";
import { AVAILABLE_CHANNELS_FORM } from "../../../elements/channels/available-channels-form";
import { CHANNELS_SELECTORS } from "../../../elements/channels/channels-selectors";
import { SELECT_CHANNELS_TO_ASSIGN } from "../../../elements/channels/select-channels-to-assign";
import { HEADER_SELECTORS } from "../../../elements/header/header-selectors";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { urlList } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { createChannel } from "../../../support/api/requests/Channels";
import {
createShippingZone,
getShippingZone
} from "../../apiRequests/ShippingMethod";
import { ONE_PERMISSION_USERS } from "../../Data/users";
import { PRODUCTS_LIST } from "../../elements/catalog/products/products-list";
import { ADD_CHANNEL_FORM_SELECTORS } from "../../elements/channels/add-channel-form-selectors";
import { AVAILABLE_CHANNELS_FORM } from "../../elements/channels/available-channels-form";
import { CHANNELS_SELECTORS } from "../../elements/channels/channels-selectors";
import { SELECT_CHANNELS_TO_ASSIGN } from "../../elements/channels/select-channels-to-assign";
import { HEADER_SELECTORS } from "../../elements/header/header-selectors";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { createChannelByView } from "../../steps/channelsSteps";
import { waitForProgressBarToNotExist } from "../../steps/shared/progressBar";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import { deleteChannelsStartsWith } from "../../utils/channelsUtils";
import { deleteShippingStartsWith } from "../../utils/shippingUtils";
} from "../../../support/api/requests/ShippingMethod";
import { deleteChannelsStartsWith } from "../../../support/api/utils/channelsUtils";
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
import filterTests from "../../../support/filterTests";
import { createChannelByView } from "../../../support/pages/channelsPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Channels", () => {
const channelStartsWith = `CyChannels`;
const randomName = `${channelStartsWith} ${faker.datatype.number()}`;
@ -50,9 +50,9 @@ filterTests(["all"], () => {
cy.addAliasToGraphRequest("Channels");
cy.visit(urlList.channels);
cy.softExpectSkeletonIsVisible();
cy.wait("@Channels");
cy.waitForRequestAndCheckIfNoErrors("@Channels");
createChannelByView({ name: randomChannel, currency });
cy.wait("@Channel");
cy.waitForRequestAndCheckIfNoErrors("@Channel");
// New channel should be visible in channels list
cy.get(ADD_CHANNEL_FORM_SELECTORS.backToChannelsList)
@ -71,11 +71,12 @@ filterTests(["all"], () => {
// new channel should be visible at product availability form
cy.clearSessionData().loginUserViaRequest();
cy.addAliasToGraphRequest("InitialProductFilterAttributes");
cy.visit(urlList.products);
cy.wait("@InitialProductFilterAttributes");
waitForProgressBarToNotExist();
cy.get(PRODUCTS_LIST.emptyProductRow).should("not.exist");
cy.get(PRODUCTS_LIST.productsList)
cy.visit(urlList.products)
.waitForRequestAndCheckIfNoErrors("@InitialProductFilterAttributes")
.waitForProgressBarToNotExist()
.get(PRODUCTS_LIST.emptyProductRow)
.should("not.exist")
.get(PRODUCTS_LIST.productsList)
.first()
.click()
.get(AVAILABLE_CHANNELS_FORM.menageChannelsButton)
@ -98,7 +99,7 @@ filterTests(["all"], () => {
currency,
shippingZone: shippingZone.name
});
cy.wait("@Channel");
cy.waitForRequestAndCheckIfNoErrors("@Channel");
getShippingZone(shippingZone.id).then(shippingZoneResp => {
const assignedChannel = shippingZoneResp.channels.find(
channel => channel.name === randomChannel
@ -154,7 +155,7 @@ filterTests(["all"], () => {
.click();
cy.addAliasToGraphRequest("Channels");
cy.get(BUTTON_SELECTORS.submit).click();
cy.wait("@Channels");
cy.waitForRequestAndCheckIfNoErrors("@Channels");
cy.get(CHANNELS_SELECTORS.channelName)
.contains(randomChannelToDelete)

View file

@ -1,26 +1,31 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { activateChannel, createChannel } from "../../apiRequests/Channels";
import { createCheckout } from "../../apiRequests/Checkout";
import { getProductDetails } from "../../apiRequests/storeFront/ProductDetails";
import { CHANNEL_FORM_SELECTORS } from "../../elements/channels/channel-form-selectors";
import { DRAFT_ORDER_SELECTORS } from "../../elements/orders/draft-order-selectors";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import { CHANNEL_FORM_SELECTORS } from "../../../elements/channels/channel-form-selectors";
import { DRAFT_ORDER_SELECTORS } from "../../../elements/orders/draft-order-selectors";
import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors";
import { urlList } from "../../../fixtures/urlList";
import {
activateChannel,
createChannel
} from "../../../support/api/requests/Channels";
import { createCheckout } from "../../../support/api/requests/Checkout";
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
import {
deleteChannelsStartsWith,
getDefaultChannel
} from "../../utils/channelsUtils";
} from "../../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
import { isProductVisible } from "../../utils/storeFront/storeFrontProductUtils";
} from "../../../support/api/utils/products/productsUtils";
import { isProductVisible } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import filterTests from "../../../support/filterTests";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Tests on inactive channel", () => {
const channelStartsWith = `InactiveChannel`;
const randomName = `${channelStartsWith}${faker.datatype.number()}`;

View file

@ -1,17 +1,18 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { getCustomer } from "../../apiRequests/Customer";
import { ONE_PERMISSION_USERS } from "../../Data/users";
import { CUSTOMER_DETAILS } from "../../elements/customer/customer-details";
import { CUSTOMERS_LIST } from "../../elements/customer/customers-list";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { fillUpAddressForm } from "../../steps/shared/addressForm";
import { confirmationMessageShouldDisappear } from "../../steps/shared/confirmationMessages";
import { urlList } from "../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
import { getCustomer } from "../../support/api/requests/Customer";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for customer", () => {
const channelStartsWith = `Customers`;
@ -37,15 +38,15 @@ filterTests(["all"], () => {
.fixture("addresses")
.then(({ usAddress }) => {
address = usAddress;
fillUpAddressForm(address);
cy.fillUpAddressForm(address);
})
.get(CUSTOMER_DETAILS.noteInput)
.type(note)
.addAliasToGraphRequest("CreateCustomer")
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.wait("@CreateCustomer")
.click()
.confirmationMessageShouldDisappear()
.waitForRequestAndCheckIfNoErrors("@CreateCustomer")
.its("response.body.data.customerCreate.user")
.then(customer => {
getCustomer(customer.id);

View file

@ -1,18 +1,21 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import {
createMenu as createMenuViaApi,
getMenu
} from "../../apiRequests/Menu";
} from "../../support/api/requests/Menu";
import { deleteMenusStartsWith } from "../../support/api/utils/navigationUtils";
import filterTests from "../../support/filterTests";
import {
createMenu,
createNewMenuItem,
MENU_ITEM_TYPES
} from "../../steps/navigationSteps";
import filterTests from "../../support/filterTests";
import { deleteMenusStartsWith } from "../../utils/navigationUtils";
} from "../../support/pages/navigationPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for menu navigation", () => {
const startsWith = "Navigation";
const randomName = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,25 +1,27 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import {
createPermissionGroup,
getPermissionGroup
} from "../../apiRequests/PermissionGroup.js";
import { getStaffMembersStartsWith } from "../../apiRequests/StaffMembers";
import { TEST_ADMIN_USER } from "../../Data/users.js";
import { PERMISSION_GROUP_DETAILS } from "../../elements/permissionGroup/permissionGroupDetails";
import { PERMISSION_GROUP_LIST } from "../../elements/permissionGroup/permissionGroupsList";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { waitForProgressBarToNotExist } from "../../steps/shared/progressBar.js";
import filterTests from "../../support/filterTests.js";
import {
permissionGroupDetails,
staffMemberDetailsUrl,
urlList
} from "../../url/urlList";
import { deletePermissionGroupsStartsWith } from "../../utils/permissionGroupUtils.js";
} from "../../fixtures/urlList";
import { TEST_ADMIN_USER } from "../../fixtures/users.js";
import {
createPermissionGroup,
getPermissionGroup
} from "../../support/api/requests/PermissionGroup.js";
import { getStaffMembersStartsWith } from "../../support/api/requests/StaffMembers";
import { deletePermissionGroupsStartsWith } from "../../support/api/utils/permissionGroupUtils.js";
import filterTests from "../../support/filterTests.js";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Permissions groups", () => {
const startsWith = "CyPermissions-";
@ -51,8 +53,8 @@ filterTests(["all"], () => {
.get(PERMISSION_GROUP_DETAILS.assignMemberButton)
.should("be.visible")
.get(BUTTON_SELECTORS.back)
.click();
waitForProgressBarToNotExist();
.click()
.waitForProgressBarToNotExist();
cy.contains(
PERMISSION_GROUP_LIST.permissionGroupRow,
permissionName
@ -110,7 +112,7 @@ filterTests(["all"], () => {
.addAliasToGraphRequest("PermissionGroupUpdate")
.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@PermissionGroupUpdate");
.waitForRequestAndCheckIfNoErrors("@PermissionGroupUpdate");
getPermissionGroup(group.id);
})
.then(resp => {
@ -141,7 +143,7 @@ filterTests(["all"], () => {
.addAliasToGraphRequest("PermissionGroupUpdate")
.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@PermissionGroupUpdate");
.waitForRequestAndCheckIfNoErrors("@PermissionGroupUpdate");
cy.visit(staffMemberDetailsUrl(staffMember.id));
cy.get(SHARED_ELEMENTS.header).should("be.visible");
cy.contains(permissionName).should("not.exist");

View file

@ -1,25 +1,28 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import {
addShippingMethod,
completeCheckout,
createCheckout
} from "../apiRequests/Checkout";
import { getOrder } from "../apiRequests/Order";
import filterTests from "../support/filterTests";
import { getDefaultChannel } from "../utils/channelsUtils";
import { addAdyenPayment } from "../utils/ordersUtils";
} from "../../../support/api/requests/Checkout";
import { getOrder } from "../../../support/api/requests/Order";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import { addAdyenPayment } from "../../../support/api/utils/ordersUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../utils/products/productsUtils";
} from "../../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../utils/shippingUtils";
} from "../../../support/api/utils/shippingUtils";
import filterTests from "../../../support/filterTests";
filterTests(["stagedOnly"], () => {
filterTests({ definedTags: ["stagedOnly"] }, () => {
describe("Adyen payments", () => {
const startsWith = "CyChannelInDraftOrders-";
const name = startsWith + faker.datatype.number();

View file

@ -1,21 +1,23 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { createChannel } from "../apiRequests/Channels";
import { PLUGINS_DETAILS } from "../../../elements/plugins/pluginDetails";
import { PLUGINS_LIST } from "../../../elements/plugins/pluginsList";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { urlList } from "../../../fixtures/urlList";
import { createChannel } from "../../../support/api/requests/Channels";
import {
customerRegistration,
deleteCustomersStartsWith,
requestPasswordReset
} from "../apiRequests/Customer";
import { PLUGINS_DETAILS } from "../elements/plugins/pluginDetails";
import { PLUGINS_LIST } from "../elements/plugins/pluginsList";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { confirmationMessageShouldDisappear } from "../steps/shared/confirmationMessages";
import filterTests from "../support/filterTests";
import { urlList } from "../url/urlList";
import { getDefaultChannel } from "../utils/channelsUtils";
import { getMailsForUser } from "../utils/users";
} from "../../../support/api/requests/Customer";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import { getMailsForUser } from "../../../support/api/utils/users";
import filterTests from "../../../support/filterTests";
filterTests(["stagedOnly"], () => {
filterTests({ definedTags: ["stagedOnly"], version: "3.1.1" }, () => {
describe("Plugins", () => {
const startsWith = "Plugins";
const randomName = `${startsWith}${faker.datatype.number()}`;
@ -43,8 +45,8 @@ filterTests(["stagedOnly"], () => {
.get(PLUGINS_DETAILS.accountConfirmationSubjectInput)
.clearAndType(randomName)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
customerRegistration({
email: customerEmail,
channel: defaultChannel.slug
@ -66,8 +68,8 @@ filterTests(["stagedOnly"], () => {
.clear()
.clearAndType(randomName)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
requestPasswordReset(Cypress.env("USER_NAME"), defaultChannel.slug)
.then(() => {
getMailsForUser(customerEmail);

View file

@ -1,20 +1,20 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createAttribute } from "../../apiRequests/Attribute";
import { PRODUCT_TYPE_DETAILS } from "../../elements/productTypes/productTypeDetails";
import { productTypeDetailsUrl, urlList } from "../../fixtures/urlList";
import { createAttribute } from "../../support/api/requests/Attribute";
import {
createTypeProduct,
getProductType
} from "../../apiRequests/productType";
import { PRODUCT_TYPE_DETAILS } from "../../elements/productTypes/productTypeDetails";
import { createProductType } from "../../steps/productTypeSteps";
import { assignElements } from "../../steps/shared/assignElements";
import { confirmationMessageShouldDisappear } from "../../steps/shared/confirmationMessages";
import { visitAndWaitForProgressBarToDisappear } from "../../steps/shared/progressBar";
} from "../../support/api/requests/ProductType";
import { deleteProductsStartsWith } from "../../support/api/utils/products/productsUtils";
import filterTests from "../../support/filterTests";
import { productTypeDetailsUrl, urlList } from "../../url/urlList";
import { deleteProductsStartsWith } from "../../utils/products/productsUtils";
import { createProductType } from "../../support/pages/productTypePage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for product types", () => {
const startsWith = "ProductType";
@ -64,15 +64,15 @@ filterTests(["all"], () => {
createTypeProduct({ name })
.then(productType => {
visitAndWaitForProgressBarToDisappear(
cy.visitAndWaitForProgressBarToDisappear(
productTypeDetailsUrl(productType.id)
)
.get(PRODUCT_TYPE_DETAILS.assignProductAttributeButton)
.click();
cy.addAliasToGraphRequest("AssignProductAttribute");
assignElements(startsWith, false);
confirmationMessageShouldDisappear();
cy.wait("@AssignProductAttribute");
.click()
.addAliasToGraphRequest("AssignProductAttribute")
.assignElements(startsWith, false)
.confirmationMessageShouldDisappear()
.waitForRequestAndCheckIfNoErrors("@AssignProductAttribute");
getProductType(productType.id);
})
.then(productType => {
@ -85,17 +85,17 @@ filterTests(["all"], () => {
createTypeProduct({ name, hasVariants: false })
.then(productType => {
visitAndWaitForProgressBarToDisappear(
cy.visitAndWaitForProgressBarToDisappear(
productTypeDetailsUrl(productType.id)
)
.get(PRODUCT_TYPE_DETAILS.hasVariantsButton)
.click()
.get(PRODUCT_TYPE_DETAILS.assignVariantAttributeButton)
.click();
cy.addAliasToGraphRequest("AssignProductAttribute");
assignElements(startsWith, false);
confirmationMessageShouldDisappear();
cy.wait("@AssignProductAttribute");
.click()
.addAliasToGraphRequest("AssignProductAttribute")
.assignElements(startsWith, false)
.confirmationMessageShouldDisappear()
.wait("@AssignProductAttribute");
getProductType(productType.id);
})
.then(productType => {

View file

@ -1,27 +1,25 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { createChannel } from "../../../apiRequests/Channels";
import {
addChannelToShippingMethod,
addChannelToShippingZone
} from "../../../apiRequests/ShippingMethod";
import { ONE_PERMISSION_USERS } from "../../../Data/users";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { SHIPPING_ZONE_DETAILS } from "../../../elements/shipping/shipping-zone-details";
import { enterHomePageChangeChannelAndReturn } from "../../../steps/channelsSteps";
import { urlList } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { createChannel } from "../../../support/api/requests/Channels";
import {
waitForProgressBarToNotBeVisible,
waitForProgressBarToNotExist
} from "../../../steps/shared/progressBar";
addChannelToShippingMethod,
addChannelToShippingZone
} from "../../../support/api/requests/ShippingMethod";
import * as channelsUtils from "../../../support/api/utils/channelsUtils";
import * as shippingUtils from "../../../support/api/utils/shippingUtils";
import filterTests from "../../../support/filterTests";
import { getCurrencyAndAmountInString } from "../../../support/format/formatCurrencyAmount";
import { urlList } from "../../../url/urlList";
import * as channelsUtils from "../../../utils/channelsUtils";
import * as shippingUtils from "../../../utils/shippingUtils";
import { getCurrencyAndAmountInString } from "../../../support/formatData/formatCurrencyAmount";
import { enterHomePageChangeChannelAndReturn } from "../../../support/pages/channelsPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Channels in shippingMethod", () => {
const startsWith = "ChannelShippingMethod";
let defaultChannel;
@ -90,23 +88,25 @@ filterTests(["all"], () => {
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping)
.visit(urlList.shippingMethods)
.get(SHARED_ELEMENTS.header)
.should("be.visible");
waitForProgressBarToNotExist();
cy.addAliasToGraphRequest("ShippingZone");
cy.getTextFromElement(SHARED_ELEMENTS.table);
.should("be.visible")
.waitForProgressBarToNotExist()
.addAliasToGraphRequest("ShippingZone")
.getTextFromElement(SHARED_ELEMENTS.table);
})
.then(tableText => {
if (!tableText.includes(shippingZone.name)) {
cy.get(BUTTON_SELECTORS.nextPaginationButton).click();
}
cy.contains(shippingZone.name).click();
cy.wait("@ShippingZone");
cy.contains(shippingZone.name)
.click()
.waitForRequestAndCheckIfNoErrors("@ShippingZone");
enterHomePageChangeChannelAndReturn(defaultChannel.name);
waitForProgressBarToNotBeVisible();
cy.get(SHARED_ELEMENTS.skeleton).should("not.exist");
cy.getTextFromElement(
SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell
)
cy.waitForProgressBarToNotBeVisible()
.get(SHARED_ELEMENTS.skeleton)
.should("not.exist")
.getTextFromElement(
SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell
)
.then(text => {
const expectedValue = getCurrencyAndAmountInString(
defaultChannelPrice,
@ -115,8 +115,9 @@ filterTests(["all"], () => {
expect(text).to.be.eq(expectedValue);
enterHomePageChangeChannelAndReturn(createdChannel.name);
waitForProgressBarToNotBeVisible();
cy.get(SHARED_ELEMENTS.skeleton).should("not.exist");
cy.waitForProgressBarToNotBeVisible()
.get(SHARED_ELEMENTS.skeleton)
.should("not.exist");
})
.then(() => {
cy.getTextFromElement(

View file

@ -1,22 +1,24 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { createCheckout } from "../../../apiRequests/Checkout";
import { createWarehouse } from "../../../apiRequests/Warehouse";
import { ONE_PERMISSION_USERS } from "../../../Data/users";
import { urlList } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { createCheckout } from "../../../support/api/requests/Checkout";
import { createWarehouse } from "../../../support/api/requests/Warehouse";
import * as channelsUtils from "../../../support/api/utils/channelsUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import * as shippingUtils from "../../../support/api/utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils";
import filterTests from "../../../support/filterTests";
import {
createShippingRate,
createShippingZone,
rateOptions
} from "../../../steps/shippingMethodSteps";
import filterTests from "../../../support/filterTests";
import { urlList } from "../../../url/urlList";
import * as channelsUtils from "../../../utils/channelsUtils";
import * as productsUtils from "../../../utils/products/productsUtils";
import * as shippingUtils from "../../../utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../../utils/storeFront/checkoutUtils";
} from "../../../support/pages/shippingMethodPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Create shipping method", () => {
const startsWith = "CreateShippingMethods-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,26 +1,28 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { createCheckout } from "../../../apiRequests/Checkout";
import { createShippingZone } from "../../../apiRequests/ShippingMethod";
import { createWarehouse } from "../../../apiRequests/Warehouse";
import { ONE_PERMISSION_USERS } from "../../../Data/users";
import {
createRateWithPostalCode,
postalCodesOptions
} from "../../../steps/shippingMethodSteps";
import filterTests from "../../../support/filterTests";
import { shippingZoneDetailsUrl } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import { shippingZoneDetailsUrl } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { createCheckout } from "../../../support/api/requests/Checkout";
import { createShippingZone } from "../../../support/api/requests/ShippingMethod";
import { createWarehouse } from "../../../support/api/requests/Warehouse";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../../utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../../utils/storeFront/checkoutUtils";
} from "../../../support/api/utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils";
import filterTests from "../../../support/filterTests";
import {
createRateWithPostalCode,
postalCodesOptions
} from "../../../support/pages/shippingMethodPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Postal codes in shipping", () => {
const startsWith = "CyShippingMethods-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,26 +1,28 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../../support"/>
import faker from "faker";
import { createCheckout } from "../../../../apiRequests/Checkout";
import { createShippingZone } from "../../../../apiRequests/ShippingMethod";
import { createWarehouse } from "../../../../apiRequests/Warehouse";
import { ONE_PERMISSION_USERS } from "../../../../Data/users";
import {
createShippingRate,
rateOptions
} from "../../../../steps/shippingMethodSteps";
import filterTests from "../../../../support/filterTests";
import { shippingZoneDetailsUrl } from "../../../../url/urlList";
import { getDefaultChannel } from "../../../../utils/channelsUtils";
import { shippingZoneDetailsUrl } from "../../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../../fixtures/users";
import { createCheckout } from "../../../../support/api/requests/Checkout";
import { createShippingZone } from "../../../../support/api/requests/ShippingMethod";
import { createWarehouse } from "../../../../support/api/requests/Warehouse";
import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../../../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../../../utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../../../utils/storeFront/checkoutUtils";
} from "../../../../support/api/utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../../../support/api/utils/shippingUtils";
import { isShippingAvailableInCheckout } from "../../../../support/api/utils/storeFront/checkoutUtils";
import filterTests from "../../../../support/filterTests";
import {
createShippingRate,
rateOptions
} from "../../../../support/pages/shippingMethodPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Shipping weight limits", () => {
const startsWith = "CyWeightRates-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,22 +1,23 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../../../support"/>
import faker from "faker";
import { SHARED_ELEMENTS } from "../../../../elements/shared/sharedElements";
import { SHIPPING_RATE_DETAILS } from "../../../../elements/shipping/shipping-rate-details";
import { urlList, weightRateUrl } from "../../../../fixtures/urlList";
import {
createShippingRate as createShippingRateViaApi,
createShippingZone
} from "../../../../apiRequests/ShippingMethod";
import { updateShopWeightUnit } from "../../../../apiRequests/shopSettings";
import { SHARED_ELEMENTS } from "../../../../elements/shared/sharedElements";
import { SHIPPING_RATE_DETAILS } from "../../../../elements/shipping/shipping-rate-details";
import { waitForProgressBarToNotBeVisible } from "../../../../steps/shared/progressBar";
import { changeWeightUnit } from "../../../../steps/shippingMethodSteps";
} from "../../../../support/api/requests/ShippingMethod";
import { updateShopWeightUnit } from "../../../../support/api/requests/ShopSettings";
import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils";
import { deleteProductsStartsWith } from "../../../../support/api/utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../../../support/api/utils/shippingUtils";
import filterTests from "../../../../support/filterTests";
import { urlList, weightRateUrl } from "../../../../url/urlList";
import { getDefaultChannel } from "../../../../utils/channelsUtils";
import { deleteProductsStartsWith } from "../../../../utils/products/productsUtils";
import { deleteShippingStartsWith } from "../../../../utils/shippingUtils";
import { changeWeightUnit } from "../../../../support/pages/shippingMethodPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Recalculate weights", () => {
const startsWith = "RecalculateWeight";
const name = `${startsWith}${faker.datatype.number()}`;
@ -83,7 +84,7 @@ filterTests(["all"], () => {
const rate = shippingMethods.find(
element => element.id === shippingMethod.id
);
waitForProgressBarToNotBeVisible();
cy.waitForProgressBarToNotBeVisible();
expect(rate.minimumOrderWeight.unit).to.eq("G");
cy.get(SHIPPING_RATE_DETAILS.minWeightInput).invoke("val");
})

View file

@ -1,14 +1,18 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { getShopInfo, updateShopAddress } from "../../apiRequests/shopSettings";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SITE_SETTINGS_DETAILS } from "../../elements/siteSettings/site-settings-details";
import { fillUpBasicAddress } from "../../steps/shared/addressForm";
import { confirmationMessageShouldDisappear } from "../../steps/shared/confirmationMessages";
import { urlList } from "../../fixtures/urlList";
import {
getShopInfo,
updateShopAddress
} from "../../support/api/requests/ShopSettings";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for site settings", () => {
let address;
@ -33,8 +37,8 @@ filterTests(["all"], () => {
cy.get(SITE_SETTINGS_DETAILS.nameInput)
.clearAndType(name)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
getShopInfo().then(shopInfo => {
expect(shopInfo.name).to.eq(name);
});
@ -46,8 +50,8 @@ filterTests(["all"], () => {
cy.get(SITE_SETTINGS_DETAILS.urlInput)
.clearAndType(url)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
getShopInfo().then(shopInfo => {
expect(shopInfo.domain.host).to.eq(url);
});
@ -59,17 +63,18 @@ filterTests(["all"], () => {
cy.get(SITE_SETTINGS_DETAILS.descriptionInput)
.clearAndType(description)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
getShopInfo().then(shopInfo => {
expect(shopInfo.description).to.eq(description);
});
});
it("should change store address", () => {
fillUpBasicAddress(address);
cy.get(BUTTON_SELECTORS.confirm).click();
confirmationMessageShouldDisappear();
cy.fillUpBasicAddress(address)
.get(BUTTON_SELECTORS.confirm)
.click()
.confirmationMessageShouldDisappear();
getShopInfo().then(({ companyAddress }) => {
expect(companyAddress.companyName).to.eq(address.companyName);
cy.expectCorrectBasicAddress(companyAddress, address);

View file

@ -1,17 +1,21 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createCategory, getCategory } from "../../apiRequests/Category";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { ELEMENT_TRANSLATION } from "../../elements/translations/element-translation";
import { LANGUAGES_LIST } from "../../elements/translations/languages-list";
import { confirmationMessageShouldDisappear } from "../../steps/shared/confirmationMessages";
import { findElementOnTable } from "../../steps/shared/tables";
import { urlList } from "../../fixtures/urlList";
import {
createCategory,
getCategory
} from "../../support/api/requests/Category";
import { deleteCategoriesStartsWith } from "../../support/api/utils/categoryUtils";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import { deleteCategoriesStartsWith } from "../../utils/categoryUtils";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"], version: "3.1.1" }, () => {
describe("Tests for translations", () => {
const startsWith = "Translations";
const randomNumber = faker.datatype.number();
@ -32,8 +36,8 @@ filterTests(["all"], () => {
it("should create translation", () => {
cy.visit(urlList.translations)
.get(LANGUAGES_LIST.polishLanguageButton)
.click();
findElementOnTable(category.name);
.click()
.findElementOnTable(category.name);
cy.get(ELEMENT_TRANSLATION.editNameButton)
.click()
.get(SHARED_ELEMENTS.skeleton)
@ -41,9 +45,9 @@ filterTests(["all"], () => {
.get(ELEMENT_TRANSLATION.translationInputField)
.type(`TranslatedName${randomNumber}`)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.get(ELEMENT_TRANSLATION.editDescriptionButton)
.click()
.confirmationMessageShouldDisappear()
.get(ELEMENT_TRANSLATION.editDescriptionButton)
.click()
.get(SHARED_ELEMENTS.richTextEditor.loader)
.should("not.exist")
@ -51,22 +55,22 @@ filterTests(["all"], () => {
.type(`TranslatedDescription${randomNumber}`)
.wait(500)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.get(ELEMENT_TRANSLATION.editSeoTitleButton)
.click()
.confirmationMessageShouldDisappear()
.get(ELEMENT_TRANSLATION.editSeoTitleButton)
.click()
.get(ELEMENT_TRANSLATION.translationInputField)
.type(`TranslatedSeoTitle${randomNumber}`)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.get(ELEMENT_TRANSLATION.editSeoDescriptionButton)
.click()
.confirmationMessageShouldDisappear()
.get(ELEMENT_TRANSLATION.editSeoDescriptionButton)
.click()
.get(ELEMENT_TRANSLATION.translationInputField)
.type(`TranslatedSeoDescription${randomNumber}`)
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
.click()
.confirmationMessageShouldDisappear();
getCategory(category.id, "PL").then(({ translation }) => {
expect(translation.name).to.eq(`TranslatedName${randomNumber}`);
expect(translation.description).to.includes(

View file

@ -1,24 +1,27 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createShippingZone } from "../../apiRequests/ShippingMethod";
import { createWarehouse, getWarehouse } from "../../apiRequests/Warehouse";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHIPPING_ZONE_DETAILS } from "../../elements/shipping/shipping-zone-details";
import { WAREHOUSES_DETAILS } from "../../elements/warehouses/warehouse-details";
import { WAREHOUSES_LIST } from "../../elements/warehouses/warehouses-list";
import { fillUpBasicAddress } from "../../steps/shared/addressForm";
import { fillAutocompleteSelect } from "../../steps/shared/selects";
import filterTests from "../../support/filterTests";
import {
shippingZoneDetailsUrl,
urlList,
warehouseDetailsUrl
} from "../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { deleteShippingStartsWith } from "../../utils/shippingUtils";
} from "../../fixtures/urlList";
import { createShippingZone } from "../../support/api/requests/ShippingMethod";
import {
createWarehouse,
getWarehouse
} from "../../support/api/requests/Warehouse";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Warehouse settings", () => {
const startsWith = "CyWarehouse";
let usAddress;
@ -39,13 +42,14 @@ filterTests(["all"], () => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.visit(urlList.warehouses)
.get(WAREHOUSES_LIST.createNewButton)
.click();
cy.get(WAREHOUSES_DETAILS.nameInput).type(name);
fillUpBasicAddress(usAddress);
cy.addAliasToGraphRequest("WarehouseCreate")
.click()
.get(WAREHOUSES_DETAILS.nameInput)
.type(name)
.fillUpBasicAddress(usAddress)
.addAliasToGraphRequest("WarehouseCreate")
.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@WarehouseCreate")
.waitForRequestAndCheckIfNoErrors("@WarehouseCreate")
.its("response.body.data.createWarehouse.warehouse")
.then(warehouse => {
getWarehouse(warehouse.id);
@ -77,15 +81,15 @@ filterTests(["all"], () => {
})
.then(shippingZoneResp => {
shippingZone = shippingZoneResp;
cy.visit(shippingZoneDetailsUrl(shippingZone.id));
fillAutocompleteSelect(
SHIPPING_ZONE_DETAILS.warehouseSelector,
warehouse.name
);
cy.addAliasToGraphRequest("UpdateShippingZone")
cy.visit(shippingZoneDetailsUrl(shippingZone.id))
.fillAutocompleteSelect(
SHIPPING_ZONE_DETAILS.warehouseSelector,
warehouse.name
)
.addAliasToGraphRequest("UpdateShippingZone")
.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@UpdateShippingZone");
.waitForRequestAndCheckIfNoErrors("@UpdateShippingZone");
getWarehouse(warehouse.id);
})
.then(warehouseResp => {
@ -107,7 +111,7 @@ filterTests(["all"], () => {
.addAliasToGraphRequest("WarehouseDelete")
.get(BUTTON_SELECTORS.submit)
.click()
.wait("@WarehouseDelete");
.waitForRequestAndCheckIfNoErrors("@WarehouseDelete");
getWarehouse(warehouse.id).should("be.null");
});
});

View file

@ -1,17 +1,19 @@
/// <reference types="cypress"/>
/// <reference types="../support"/>
import faker from "faker";
import { CUSTOMER_DETAILS } from "../elements/customers/customer-details";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { customerDetailsUrl } from "../fixtures/urlList";
import {
confirmAccount,
customerRegistration,
deleteCustomersStartsWith
} from "../apiRequests/Customer";
import { CUSTOMER_DETAILS } from "../elements/customers/customer-details";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { confirmationMessageShouldDisappear } from "../steps/shared/confirmationMessages";
} from "../support/api/requests/Customer";
import { getDefaultChannel } from "../support/api/utils/channelsUtils";
import { getMailActivationLinkForUser } from "../support/api/utils/users";
import filterTests from "../support/filterTests";
import { customerDetailsUrl } from "../url/urlList";
import { getDefaultChannel } from "../utils/channelsUtils";
import { getMailActivationLinkForUser } from "../utils/users";
describe("Tests for customer registration", () => {
const startsWith = "Registration";
@ -27,7 +29,7 @@ describe("Tests for customer registration", () => {
});
});
filterTests(["stagedOnly"], () => {
filterTests({ definedTags: ["stagedOnly"] }, () => {
it("should register customer", () => {
const email = `${startsWith}${faker.datatype.number()}@example.com`;
customerRegistration({ email, channel: defaultChannel.slug });
@ -72,9 +74,9 @@ describe("Tests for customer registration", () => {
.get(CUSTOMER_DETAILS.isActiveCheckbox)
.click()
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.clearSessionData()
.click()
.confirmationMessageShouldDisappear()
.clearSessionData()
.loginUserViaRequest("token", {
email,
password: Cypress.env("USER_PASSWORD")

View file

@ -1,26 +1,27 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createChannel } from "../../apiRequests/Channels";
import { updateChannelInProduct } from "../../apiRequests/Product";
import { urlList } from "../../fixtures/urlList";
import { createChannel } from "../../support/api/requests/Channels";
import { updateChannelInProduct } from "../../support/api/requests/Product";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import { deleteSalesStartsWith } from "../../support/api/utils/discounts/salesUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../support/api/utils/shippingUtils";
import { getProductPrice } from "../../support/api/utils/storeFront/storeFrontProductUtils";
import filterTests from "../../support/filterTests";
import {
assignProducts,
createSale,
discountOptions
} from "../../steps/discounts/salesSteps";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils";
import { deleteSalesStartsWith } from "../../utils/discounts/salesUtils";
import * as productsUtils from "../../utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
import { getProductPrice } from "../../utils/storeFront/storeFrontProductUtils";
} from "../../support/pages/discounts/salesPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Sales discounts", () => {
const startsWith = "CySales-";

View file

@ -1,24 +1,26 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createChannel } from "../../apiRequests/Channels";
import { ONE_PERMISSION_USERS } from "../../Data/users";
import {
createVoucher,
discountOptions
} from "../../steps/discounts/vouchersSteps";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils";
import { deleteVouchersStartsWith } from "../../utils/discounts/vouchersUtils";
import { createCheckoutWithVoucher } from "../../utils/ordersUtils";
import * as productsUtils from "../../utils/products/productsUtils";
import { urlList } from "../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
import { createChannel } from "../../support/api/requests/Channels";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import { deleteVouchersStartsWith } from "../../support/api/utils/discounts/vouchersUtils";
import { createCheckoutWithVoucher } from "../../support/api/utils/ordersUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
import {
createVoucher,
discountOptions
} from "../../support/pages/discounts/vouchersPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Vouchers discounts", () => {
const startsWith = "CyVou-";
const productPrice = 100;

View file

@ -1,9 +1,12 @@
import { TEST_ADMIN_USER, USER_WITHOUT_NAME } from "../../Data/users";
import { expectWelcomeMessageIncludes } from "../../steps/homePageSteps";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
/// <reference types="cypress"/>
/// <reference types="../../support"/>
filterTests(["all"], () => {
import { urlList } from "../../fixtures/urlList";
import { TEST_ADMIN_USER, USER_WITHOUT_NAME } from "../../fixtures/users";
import filterTests from "../../support/filterTests";
import { expectWelcomeMessageIncludes } from "../../support/pages/homePage";
filterTests({ definedTags: ["all"] }, () => {
describe("Displaying welcome message on home page", () => {
it("should display user name on home page", () => {
cy.loginUserViaRequest();

View file

@ -1,25 +1,28 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors";
import { urlList } from "../../fixtures/urlList";
import {
createCustomer,
deleteCustomersStartsWith
} from "../../apiRequests/Customer";
import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors";
import { changeChannel } from "../../steps/homePageSteps";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils";
import * as homePageUtils from "../../utils/homePageUtils";
} from "../../support/api/requests/Customer";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import * as homePageUtils from "../../support/api/utils/homePageUtils";
import {
createReadyToFulfillOrder,
createWaitingForCaptureOrder
} from "../../utils/ordersUtils";
import * as productsUtils from "../../utils/products/productsUtils";
import * as shippingUtils from "../../utils/shippingUtils";
} from "../../support/api/utils/ordersUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import * as shippingUtils from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
import { changeChannel } from "../../support/pages/homePage";
// <reference types="cypress" />
filterTests(["all", "critical"], () => {
filterTests({ definedTags: ["all", "critical"] }, () => {
describe("Homepage analytics", () => {
const startsWith = "CyHomeAnalytics";

View file

@ -1,9 +1,11 @@
// <reference types="cypress" />
import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
import filterTests from "../support/filterTests";
import { urlList } from "../url/urlList";
/// <reference types="cypress"/>
/// <reference types="../support"/>
filterTests(["all"], () => {
import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
import { urlList } from "../fixtures/urlList";
import filterTests from "../support/filterTests";
filterTests({ definedTags: ["all"] }, () => {
describe("User authorization", () => {
beforeEach(() => {
cy.clearSessionData();

View file

@ -1,16 +1,21 @@
/// <reference types="cypress"/>
/// <reference types="../support"/>
import faker from "faker";
import { updateMetadata, updatePrivateMetadata } from "../apiRequests/Metadata";
import { createDraftOrder, getOrder } from "../apiRequests/Order";
import { getProductMetadata } from "../apiRequests/storeFront/ProductDetails";
import filterTests from "../support/filterTests";
import { getDefaultChannel } from "../utils/channelsUtils";
import {
updateMetadata,
updatePrivateMetadata
} from "../support/api/requests/Metadata";
import { createDraftOrder, getOrder } from "../support/api/requests/Order";
import { getProductMetadata } from "../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct
} from "../utils/products/productsUtils";
} from "../support/api/utils/products/productsUtils";
import filterTests from "../support/filterTests";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Test for metadata", () => {
const startsWith = "Metadata";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,11 +1,14 @@
import { PERMISSIONS_OPTIONS } from "../Data/permissionsUsers";
import * as permissionsSteps from "../steps/permissions";
/// <reference types="cypress"/>
/// <reference types="../support"/>
import { PERMISSIONS_OPTIONS } from "../fixtures/permissionsUsers";
import filterTests from "../support/filterTests";
import * as permissionsSteps from "../support/pages/permissionsPage";
describe("Navigation for users with different permissions", () => {
Object.keys(PERMISSIONS_OPTIONS).forEach(key => {
const tags = key === "all" ? ["critical", "all"] : ["all"];
filterTests(tags, () => {
filterTests({ definedTags: tags }, () => {
it(`should navigate as an user with ${key} permission`, () => {
const permissionOption = PERMISSIONS_OPTIONS[key];
const permissions = permissionOption.permissions;

View file

@ -1,20 +1,22 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createChannel } from "../../apiRequests/Channels";
import { CHANNEL_FORM_SELECTORS } from "../../elements/channels/channel-form-selectors";
import { HEADER_SELECTORS } from "../../elements/header/header-selectors";
import { DRAFT_ORDER_SELECTORS } from "../../elements/orders/draft-order-selectors";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
import { urlList } from "../../fixtures/urlList";
import { createChannel } from "../../support/api/requests/Channels";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import filterTests from "../../support/filterTests";
import {
selectChannelInHeader,
selectChannelInPicker
} from "../../steps/channelsSteps";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import * as channelsUtils from "../../utils/channelsUtils";
} from "../../support/pages/channelsPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Channels in draft orders", () => {
const startsWith = "CyChannelInDraftOrders-";
const randomName = startsWith + faker.datatype.number();

View file

@ -1,25 +1,27 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { DRAFT_ORDERS_LIST_SELECTORS } from "../../elements/orders/draft-orders-list-selectors";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
import { urlList } from "../../fixtures/urlList";
import {
createCustomer,
deleteCustomersStartsWith
} from "../../apiRequests/Customer";
import { updateOrdersSettings } from "../../apiRequests/Order";
import { DRAFT_ORDERS_LIST_SELECTORS } from "../../elements/orders/draft-orders-list-selectors";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
import { selectChannelInPicker } from "../../steps/channelsSteps";
import { finalizeDraftOrder } from "../../steps/draftOrderSteps";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils";
import * as productsUtils from "../../utils/products/productsUtils";
} from "../../support/api/requests/Customer";
import { updateOrdersSettings } from "../../support/api/requests/Order";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
import { selectChannelInPicker } from "../../support/pages/channelsPage";
import { finalizeDraftOrder } from "../../support/pages/draftOrderPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Draft orders", () => {
const startsWith = "CyDraftOrders-";
const randomName = startsWith + faker.datatype.number();

View file

@ -1,34 +1,38 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import {
createCustomer,
deleteCustomersStartsWith
} from "../../apiRequests/Customer";
import { getOrder, updateOrdersSettings } from "../../apiRequests/Order";
import { ONE_PERMISSION_USERS } from "../../Data/users";
import { ORDER_REFUND } from "../../elements/orders/order-refund";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { selectChannelInPicker } from "../../steps/channelsSteps";
import { finalizeDraftOrder } from "../../steps/draftOrderSteps";
import { fillAutocompleteSelect } from "../../steps/shared/selects";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { urlList } from "../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
import {
createCustomer,
deleteCustomersStartsWith
} from "../../support/api/requests/Customer";
import {
getOrder,
updateOrdersSettings
} from "../../support/api/requests/Order";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import {
createFulfilledOrder,
createOrder,
createReadyToFulfillOrder
} from "../../utils/ordersUtils";
import * as productsUtils from "../../utils/products/productsUtils";
} from "../../support/api/utils/ordersUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../utils/shippingUtils";
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
import { selectChannelInPicker } from "../../support/pages/channelsPage";
import { finalizeDraftOrder } from "../../support/pages/draftOrderPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Orders", () => {
const startsWith = "CyOrders-";
const randomName = startsWith + faker.datatype.number();
@ -160,16 +164,15 @@ filterTests(["all"], () => {
cy.get(SHARED_ELEMENTS.skeleton)
.should("not.exist")
.get(ORDERS_SELECTORS.cancelFulfillment)
.click();
})
.then(() => {
fillAutocompleteSelect(
ORDERS_SELECTORS.cancelFulfillmentSelectField,
warehouse.name
);
cy.addAliasToGraphRequest("OrderFulfillmentCancel");
cy.get(BUTTON_SELECTORS.submit).click();
cy.wait("@OrderFulfillmentCancel");
.click()
.fillAutocompleteSelect(
ORDERS_SELECTORS.cancelFulfillmentSelectField,
warehouse.name
)
.addAliasToGraphRequest("OrderFulfillmentCancel")
.get(BUTTON_SELECTORS.submit)
.click()
.waitForRequestAndCheckIfNoErrors("@OrderFulfillmentCancel");
getOrder(order.id);
})
.then(orderResp => {
@ -198,7 +201,9 @@ filterTests(["all"], () => {
.addAliasToGraphRequest("OrderFulfillmentRefundProducts");
cy.get(BUTTON_SELECTORS.submit)
.click()
.wait("@OrderFulfillmentRefundProducts");
.waitForRequestAndCheckIfNoErrors(
"@OrderFulfillmentRefundProducts"
);
getOrder(order.id);
})
.then(orderResp => {

View file

@ -1,17 +1,21 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createAttribute } from "../../apiRequests/Attribute";
import { createPageType, getPageType } from "../../apiRequests/PageTypes";
import { PAGE_TYPE_DETAILS } from "../../elements/pageTypes/pageTypeDetails";
import { PAGE_TYPES_LIST } from "../../elements/pageTypes/pageTypesList";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { assignElements } from "../../steps/shared/assignElements";
import { confirmationMessageShouldDisappear } from "../../steps/shared/confirmationMessages";
import { pageTypeDetailsUrl, urlList } from "../../fixtures/urlList";
import { createAttribute } from "../../support/api/requests/Attribute";
import {
createPageType,
getPageType
} from "../../support/api/requests/PageType";
import filterTests from "../../support/filterTests";
import { pageTypeDetailsUrl, urlList } from "../../url/urlList";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for page types", () => {
const startsWith = "PageTypes";
@ -29,9 +33,9 @@ filterTests(["all"], () => {
.type(randomName)
.addAliasToGraphRequest("PageTypeCreate")
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.wait("@PageTypeCreate")
.click()
.confirmationMessageShouldDisappear()
.waitForRequestAndCheckIfNoErrors("@PageTypeCreate")
.its("response.body.data.pageTypeCreate.pageType")
.then(pageType => {
getPageType(pageType.id);
@ -51,9 +55,9 @@ filterTests(["all"], () => {
.get(SHARED_ELEMENTS.progressBar)
.should("be.not.visible")
.get(PAGE_TYPE_DETAILS.assignAttributesButton)
.click();
assignElements(randomName, false);
confirmationMessageShouldDisappear();
.click()
.assignElements(randomName, false)
.confirmationMessageShouldDisappear();
getPageType(pageType.id);
})
.then(pageType => {

View file

@ -1,103 +1,113 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createAttribute } from "../../apiRequests/Attribute";
import { getPage } from "../../apiRequests/Page";
import { createPageType } from "../../apiRequests/PageTypes";
import { attributesTypes, createPage } from "../../steps/pageSteps";
import { deleteAttributesStartsWith } from "../../utils/attributes/attributeUtils";
import { deletePageTypesStartsWith } from "../../utils/pageTypeUtils";
import { createAttribute } from "../../support/api/requests/Attribute";
import { getPage } from "../../support/api/requests/Page";
import { createPageType } from "../../support/api/requests/PageType";
import { deleteAttributesStartsWith } from "../../support/api/utils/attributes/attributeUtils";
import { deletePageTypesStartsWith } from "../../support/api/utils/pageTypeUtils";
import filterTests from "../../support/filterTests";
import { attributesTypes, createPage } from "../../support/pages/pagesPage";
describe("Tests for pages", () => {
const startsWith = `Pages`;
const name = `${startsWith}${faker.datatype.number()}`;
let attribute;
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for pages", () => {
const startsWith = `Pages`;
const name = `${startsWith}${faker.datatype.number()}`;
let attribute;
const attributeValuesOnPage = {
NUMERIC: 1,
RICH_TEXT: faker.lorem.sentence(),
DROPDOWN: "value",
MULTISELECT: "value",
BOOLEAN: true
};
const attributeValuesOnPage = {
NUMERIC: 1,
RICH_TEXT: faker.lorem.sentence(),
DROPDOWN: "value",
MULTISELECT: "value",
BOOLEAN: true
};
before(() => {
cy.clearSessionData().loginUserViaRequest();
deleteAttributesStartsWith(startsWith);
deletePageTypesStartsWith(startsWith);
before(() => {
cy.clearSessionData().loginUserViaRequest();
deleteAttributesStartsWith(startsWith);
deletePageTypesStartsWith(startsWith);
createAttribute({ name, type: "PAGE_TYPE" }).then(attributeResp => {
attribute = attributeResp;
createPageType({ name, attributeId: attribute.id });
});
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
});
it("should create not published page", () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
createPage({ pageName: randomName, pageTypeName: name })
.then(page => {
getPage(page.id);
})
.then(page => {
expect(page.title).to.eq(randomName);
expect(page.isPublished).to.be.false;
expect(page.attributes[0].attribute.id).to.eq(attribute.id);
getPage(page.id, "token").should("be.null");
});
});
it("should create published page", () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
createPage({ pageName: randomName, pageTypeName: name, isPublished: true })
.then(page => {
getPage(page.id, "token");
})
.then(page => {
expect(page.title).to.eq(randomName);
expect(page.isPublished).to.be.true;
expect(page.attributes[0].attribute.id).to.eq(attribute.id);
});
});
Object.keys(attributesTypes).forEach(attributeType => {
it(`should create page with ${attributeType} attribute`, () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
const attributeValues = [attributeValuesOnPage[attributeType]];
createAttribute({
name: randomName,
type: "PAGE_TYPE",
inputType: attributeType,
attributeValues
}).then(attributeResp => {
createAttribute({ name, type: "PAGE_TYPE" }).then(attributeResp => {
attribute = attributeResp;
createPageType({ name: randomName, attributeId: attribute.id });
createPageType({ name, attributeId: attribute.id });
});
createPage({
pageName: randomName,
pageTypeName: randomName,
attributeType,
attributeValue: attributeValuesOnPage[attributeType]
})
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
});
it("should create not published page", () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
createPage({ pageName: randomName, pageTypeName: name })
.then(page => {
getPage(page.id);
})
.then(page => {
expect(page.attributes[0].values[0].inputType).to.eq(attributeType);
if (attributeType !== "BOOLEAN") {
expect(page.attributes[0].values[0].name).to.eq(
attributeValuesOnPage[attributeType].toString()
);
} else {
expect(page.attributes[0].values[0].name).to.includes(
"Yes".toString()
);
}
expect(page.title).to.eq(randomName);
expect(page.isPublished).to.be.false;
expect(page.attributes[0].attribute.id).to.eq(attribute.id);
getPage(page.id, "token").should("be.null");
});
});
it("should create published page", () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
createPage({
pageName: randomName,
pageTypeName: name,
isPublished: true
})
.then(page => {
getPage(page.id, "token");
})
.then(page => {
expect(page.title).to.eq(randomName);
expect(page.isPublished).to.be.true;
expect(page.attributes[0].attribute.id).to.eq(attribute.id);
});
});
Object.keys(attributesTypes).forEach(attributeType => {
it(`should create page with ${attributeType} attribute`, () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
const attributeValues = [attributeValuesOnPage[attributeType]];
createAttribute({
name: randomName,
type: "PAGE_TYPE",
inputType: attributeType,
attributeValues
}).then(attributeResp => {
attribute = attributeResp;
createPageType({ name: randomName, attributeId: attribute.id });
});
createPage({
pageName: randomName,
pageTypeName: randomName,
attributeType,
attributeValue: attributeValuesOnPage[attributeType]
})
.then(page => {
getPage(page.id);
})
.then(page => {
expect(page.attributes[0].values[0].inputType).to.eq(attributeType);
if (attributeType !== "BOOLEAN") {
expect(page.attributes[0].values[0].name).to.eq(
attributeValuesOnPage[attributeType].toString()
);
} else {
expect(page.attributes[0].values[0].name).to.includes(
"Yes".toString()
);
}
});
});
});
});
});

View file

@ -1,30 +1,30 @@
// <reference types="cypress" />
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createAttribute } from "../../apiRequests/Attribute";
import { createTypeProduct } from "../../apiRequests/productType";
import { ONE_PERMISSION_USERS } from "../../Data/users";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
import { PRODUCTS_LIST } from "../../elements/catalog/products/products-list";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { metadataForms } from "../../steps/catalog/metadataSteps";
import {
fillUpPriceList,
priceInputLists
} from "../../steps/catalog/products/priceList";
import { fillUpCommonFieldsForAllProductTypes } from "../../steps/catalog/products/productSteps";
import { selectChannelInDetailsPages } from "../../steps/channelsSteps";
import { confirmationMessageShouldDisappear } from "../../steps/shared/confirmationMessages";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import { urlList } from "../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
import { createAttribute } from "../../support/api/requests/Attribute";
import { createTypeProduct } from "../../support/api/requests/ProductType";
import {
expectCorrectProductInformation,
expectCorrectProductVariantInformation
} from "../../utils/products/checkProductInfo";
import * as productUtils from "../../utils/products/productsUtils";
} from "../../support/api/utils/products/checkProductInfo";
import * as productUtils from "../../support/api/utils/products/productsUtils";
import filterTests from "../../support/filterTests";
import { metadataForms } from "../../support/pages/catalog/metadataComponent";
import {
fillUpPriceList,
priceInputLists
} from "../../support/pages/catalog/products/priceListComponent";
import { fillUpCommonFieldsForAllProductTypes } from "../../support/pages/catalog/products/productDetailsPage";
import { selectChannelInDetailsPages } from "../../support/pages/channelsPage";
filterTests(["all", "critical"], () => {
filterTests({ definedTags: ["all", "critical"] }, () => {
describe("Create product", () => {
const startsWith = "CyCreateProduct-";
const name = `${startsWith}${faker.datatype.number()}`;
@ -75,11 +75,12 @@ filterTests(["all", "critical"], () => {
createTpeAndFillUpProductFields(randomName, true, productData).then(
productOrgResp => (productData.productOrganization = productOrgResp)
);
cy.addAliasToGraphRequest("ProductDetails");
cy.get(BUTTON_SELECTORS.confirm).click();
confirmationMessageShouldDisappear();
cy.wait("@ProductDetails");
cy.get("@ProductDetails")
cy.addAliasToGraphRequest("ProductDetails")
.get(BUTTON_SELECTORS.confirm)
.click()
.confirmationMessageShouldDisappear()
.waitForRequestAndCheckIfNoErrors("@ProductDetails")
.get("@ProductDetails")
.its("response.body")
.then(resp => {
const productResp = resp.find(element => element.data.product).data
@ -105,12 +106,14 @@ filterTests(["all", "critical"], () => {
selectChannelInDetailsPages();
fillUpPriceList(prices.sellingPrice);
fillUpPriceList(prices.costPrice, priceInputLists.costPrice);
cy.get(PRODUCT_DETAILS.skuInput).type(randomName);
cy.addAliasToGraphRequest("ProductDetails");
cy.get(BUTTON_SELECTORS.confirm).click();
confirmationMessageShouldDisappear();
cy.wait("@ProductDetails");
cy.get("@ProductDetails")
cy.get(PRODUCT_DETAILS.skuInput)
.type(randomName)
.addAliasToGraphRequest("ProductDetails")
.get(BUTTON_SELECTORS.confirm)
.click()
.confirmationMessageShouldDisappear()
.wait("@ProductDetails")
.get("@ProductDetails")
.its("response.body")
.then(resp => {
const productResp = resp.find(element => element.data.product).data

View file

@ -1,18 +1,19 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { getProductDetails } from "../../../apiRequests/storeFront/ProductDetails";
import { ONE_PERMISSION_USERS } from "../../../Data/users";
import { updateProductIsAvailableForPurchase } from "../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import * as shippingUtils from "../../../support/api/utils/shippingUtils";
import { isProductAvailableForPurchase } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import filterTests from "../../../support/filterTests";
import { productDetailsUrl } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import * as productsUtils from "../../../utils/products/productsUtils";
import * as shippingUtils from "../../../utils/shippingUtils";
import { isProductAvailableForPurchase } from "../../../utils/storeFront/storeFrontProductUtils";
import { updateProductIsAvailableForPurchase } from "../../../support/pages/catalog/products/productDetailsPage";
// <reference types="cypress" />
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Products available in listings", () => {
const startsWith = "CyAvailForPurchase-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,17 +1,18 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { getProductDetails } from "../../../apiRequests/storeFront/ProductDetails";
import { ONE_PERMISSION_USERS } from "../../../Data/users";
import { updateProductPublish } from "../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import { isProductVisible } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import filterTests from "../../../support/filterTests";
import { productDetailsUrl } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import * as productsUtils from "../../../utils/products/productsUtils";
import { isProductVisible } from "../../../utils/storeFront/storeFrontProductUtils";
import { updateProductPublish } from "../../../support/pages/catalog/products/productDetailsPage";
// <reference types="cypress" />
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Published products", () => {
const startsWith = "CyPublishedProducts-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,17 +1,17 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { searchInShop } from "../../../apiRequests/storeFront/Search";
import { ONE_PERMISSION_USERS } from "../../../Data/users";
import { updateProductVisibleInListings } from "../../../steps/catalog/products/productSteps";
import { productDetailsUrl } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { searchInShop } from "../../../support/api/requests/storeFront/Search";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import { isProductVisibleInSearchResult } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import filterTests from "../../../support/filterTests";
import { productDetailsUrl } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import * as productsUtils from "../../../utils/products/productsUtils";
import { isProductVisibleInSearchResult } from "../../../utils/storeFront/storeFrontProductUtils";
import { updateProductVisibleInListings } from "../../../support/pages/catalog/products/productDetailsPage";
// <reference types="cypress" />
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Products displayed in listings", () => {
const startsWith = "CyVisibleInListings-";
const name = `${startsWith}${faker.datatype.number()}`;

View file

@ -1,29 +1,30 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import faker from "faker";
import { createCollection } from "../../../apiRequests/Collections";
import { updateProduct } from "../../../apiRequests/Product";
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import {
selectChannel,
selectFilterOption,
selectProductsOutOfStock
} from "../../../steps/catalog/products/productsListSteps";
import { waitForProgressBarToNotExist } from "../../../steps/shared/progressBar";
import { searchInTable } from "../../../steps/shared/tables";
import filterTests from "../../../support/filterTests";
import { urlList } from "../../../url/urlList";
import { getDefaultChannel } from "../../../utils/channelsUtils";
import { urlList } from "../../../fixtures/urlList";
import { createCollection } from "../../../support/api/requests/Collections";
import { updateProduct } from "../../../support/api/requests/Product";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../../utils/products/productsUtils";
} from "../../../support/api/utils/products/productsUtils";
import {
createShipping,
deleteShippingStartsWith
} from "../../../utils/shippingUtils";
} from "../../../support/api/utils/shippingUtils";
import filterTests from "../../../support/filterTests";
import {
selectChannel,
selectFilterOption,
selectProductsOutOfStock
} from "../../../support/pages/catalog/products/productsListPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Filtering products", () => {
const startsWith = "CyFilterProducts-";
const name = `${startsWith}${faker.datatype.number()}`;
@ -83,16 +84,17 @@ filterTests(["all"], () => {
updateProduct(product.id, { collections: [collection.id] });
});
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest()
.visit(urlList.products);
});
const filterProductsBy = ["category", "collection", "productType"];
filterProductsBy.forEach(filterBy => {
it(`should filter products by ${filterBy}`, () => {
cy.softExpectSkeletonIsVisible();
waitForProgressBarToNotExist();
cy.softExpectSkeletonIsVisible().waitForProgressBarToNotExist();
selectFilterOption(filterBy, name);
cy.getTextFromElement(PRODUCTS_LIST.productsNames).then(product => {
expect(product).to.includes(name);
@ -113,13 +115,16 @@ filterTests(["all"], () => {
categoryId: category.id,
price
});
cy.waitForProgressBarToNotExist();
selectChannel(channel.slug);
selectProductsOutOfStock();
searchInTable(productOutOfStock);
cy.get(PRODUCTS_LIST.productsNames).should("have.length", 1);
cy.getTextFromElement(PRODUCTS_LIST.productsNames).then(product => {
expect(product).to.includes(productOutOfStock);
});
cy.searchInTable(productOutOfStock)
.get(PRODUCTS_LIST.productsNames)
.should("have.length", 1)
.getTextFromElement(PRODUCTS_LIST.productsNames)
.then(product => {
expect(product).to.includes(productOutOfStock);
});
});
});
});

View file

@ -1,14 +1,16 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { urlList } from "../../../fixtures/urlList";
import filterTests from "../../../support/filterTests";
import {
getDisplayedColumnArray,
isNumberOfProductsSameAsInSelectResultsOnPage
} from "../../../steps/catalog/products/productsListSteps";
import { waitForProgressBarToNotExist } from "../../../steps/shared/progressBar";
import filterTests from "../../../support/filterTests";
import { urlList } from "../../../url/urlList";
} from "../../../support/pages/catalog/products/productsListPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Products", () => {
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
@ -26,10 +28,11 @@ filterTests(["all"], () => {
getDisplayedColumnArray("name").then(
productsList => (firstPageProducts = productsList)
);
cy.addAliasToGraphRequest("ProductList");
cy.get(PRODUCTS_LIST.nextPageButton).click();
waitForProgressBarToNotExist();
cy.wait("@ProductList");
cy.addAliasToGraphRequest("ProductList")
.get(PRODUCTS_LIST.nextPageButton)
.click()
.waitForProgressBarToNotExist()
.wait("@ProductList");
getDisplayedColumnArray("name").then(productList => {
expect(productList).to.not.equal(firstPageProducts);
});
@ -50,8 +53,8 @@ filterTests(["all"], () => {
`${PRODUCTS_LIST.rowNumberOption}${BUTTON_SELECTORS.notSelectedOption}`
)
.first()
.click();
waitForProgressBarToNotExist();
.click()
.waitForProgressBarToNotExist();
isNumberOfProductsSameAsInSelectResultsOnPage().then(
isTheSame =>
expect(

View file

@ -1,11 +1,13 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { waitForProgressBarToNotExist } from "../../../steps/shared/progressBar";
import { urlList } from "../../../fixtures/urlList";
import { expectProductsSortedBy } from "../../../support/api/utils/products/productsListUtils";
import filterTests from "../../../support/filterTests";
import { urlList } from "../../../url/urlList";
import { expectProductsSortedBy } from "../../../utils/products/productsListUtils";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Sorting products", () => {
const sortByList = ["name", "type"];
sortByList.forEach(sortBy => {
@ -16,14 +18,16 @@ filterTests(["all"], () => {
cy.softExpectSkeletonIsVisible();
cy.get(SHARED_ELEMENTS.header).should("be.visible");
if (sortBy !== "name") {
cy.get(PRODUCTS_LIST.tableHeaders[sortBy]).click();
waitForProgressBarToNotExist();
cy.get(PRODUCTS_LIST.tableHeaders[sortBy])
.click()
.waitForProgressBarToNotExist();
}
expectProductsSortedBy(sortBy);
cy.addAliasToGraphRequest("ProductList")
.get(PRODUCTS_LIST.tableHeaders[sortBy])
.click();
waitForProgressBarToNotExist().wait("@ProductList");
.click()
.waitForProgressBarToNotExist()
.waitForRequestAndCheckIfNoErrors("@ProductList");
expectProductsSortedBy(sortBy, false);
});
});

View file

@ -1,29 +1,31 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createChannel } from "../../apiRequests/Channels";
import { urlList } from "../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
import { createChannel } from "../../support/api/requests/Channels";
import {
createProduct,
updateChannelInProduct
} from "../../apiRequests/Product";
import { ONE_PERMISSION_USERS } from "../../Data/users";
} from "../../support/api/requests/Product";
import {
deleteChannelsStartsWith,
getDefaultChannel
} from "../../support/api/utils/channelsUtils";
import * as productUtils from "../../support/api/utils/products/productsUtils";
import * as shippingUtils from "../../support/api/utils/shippingUtils";
import { getProductVariants } from "../../support/api/utils/storeFront/storeFrontProductUtils";
import filterTests from "../../support/filterTests";
import {
createFirstVariant,
createVariant,
variantsShouldBeVisible
} from "../../steps/catalog/products/VariantsSteps";
import { enterHomePageChangeChannelAndReturn } from "../../steps/channelsSteps";
import filterTests from "../../support/filterTests";
import { urlList } from "../../url/urlList";
import {
deleteChannelsStartsWith,
getDefaultChannel
} from "../../utils/channelsUtils";
import * as productUtils from "../../utils/products/productsUtils";
import * as shippingUtils from "../../utils/shippingUtils";
import { getProductVariants } from "../../utils/storeFront/storeFrontProductUtils";
// <reference types="cypress" />
} from "../../support/pages/catalog/products/VariantsPage";
import { enterHomePageChangeChannelAndReturn } from "../../support/pages/channelsPage";
filterTests(["all", "critical"], () => {
filterTests({ definedTags: ["all", "critical"] }, () => {
describe("Creating variants", () => {
const startsWith = "CyCreateVariants-";
const attributeValues = ["value1", "value2"];

View file

@ -1,27 +1,28 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import faker from "faker";
import { createCategory } from "../../apiRequests/Category";
import { createCollection } from "../../apiRequests/Collections";
import { getProductDetails } from "../../apiRequests/storeFront/ProductDetails";
import { ONE_PERMISSION_USERS } from "../../Data/users";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { metadataForms } from "../../steps/catalog/metadataSteps";
import { fillUpCommonFieldsForAllProductTypes } from "../../steps/catalog/products/productSteps";
import { confirmationMessageShouldDisappear } from "../../steps/shared/confirmationMessages";
import filterTests from "../../support/filterTests";
import { productDetailsUrl } from "../../url/urlList";
import { getDefaultChannel } from "../../utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../../utils/collectionsUtils";
import { expectCorrectProductInformation } from "../../utils/products/checkProductInfo";
import { productDetailsUrl } from "../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
import { createCategory } from "../../support/api/requests/Category";
import { createCollection } from "../../support/api/requests/Collections";
import { getProductDetails } from "../../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import { deleteCollectionsStartsWith } from "../../support/api/utils/collectionsUtils";
import { expectCorrectProductInformation } from "../../support/api/utils/products/checkProductInfo";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
deleteProductsStartsWith
} from "../../utils/products/productsUtils";
} from "../../support/api/utils/products/productsUtils";
import filterTests from "../../support/filterTests";
import { metadataForms } from "../../support/pages/catalog/metadataComponent";
import { fillUpCommonFieldsForAllProductTypes } from "../../support/pages/catalog/products/productDetailsPage";
filterTests(["all"], () => {
filterTests({ definedTags: ["all"] }, () => {
describe("Update products", () => {
const startsWith = "CyUpdateProducts-";
const name = `${startsWith}${faker.datatype.number()}`;
@ -107,14 +108,15 @@ filterTests(["all"], () => {
.get(PRODUCT_DETAILS.collectionRemoveButtons)
.click();
fillUpCommonFieldsForAllProductTypes(productData, false);
cy.addAliasToGraphRequest("UpdatePrivateMetadata");
cy.addAliasToGraphRequest("UpdateMetadata");
cy.addAliasToGraphRequest("ProductUpdate");
cy.get(BUTTON_SELECTORS.confirm).click();
confirmationMessageShouldDisappear();
cy.wait("@ProductUpdate");
cy.wait("@UpdateMetadata");
cy.wait("@UpdatePrivateMetadata");
cy.addAliasToGraphRequest("UpdatePrivateMetadata")
.addAliasToGraphRequest("UpdateMetadata")
.addAliasToGraphRequest("ProductUpdate")
.get(BUTTON_SELECTORS.confirm)
.click()
.confirmationMessageShouldDisappear()
.waitForRequestAndCheckIfNoErrors("@ProductUpdate")
.waitForRequestAndCheckIfNoErrors("@UpdateMetadata")
.waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata");
productData.productOrganization.productType = name;
productData.attribute = attribute;
cy.loginUserViaRequest("token")
@ -138,7 +140,7 @@ filterTests(["all"], () => {
.click()
.get(BUTTON_SELECTORS.submit)
.click()
.wait("@ProductDelete")
.waitForRequestAndCheckIfNoErrors("@ProductDelete")
.loginUserViaRequest("token")
.then(() => {
getProductDetails(product.id, defaultChannel.slug).its("body.data");

View file

@ -1,29 +1,31 @@
/// <reference types="cypress"/>
/// <reference types="../support"/>
import faker from "faker";
import {
deleteStaffMembersStartsWith,
updateStaffMember
} from "../apiRequests/StaffMembers";
import { LEFT_MENU_SELECTORS } from "../elements/account/left-menu/left-menu-selectors";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { STAFF_MEMBER_DETAILS } from "../elements/staffMembers/staffMemberDetails";
import { STAFF_MEMBERS_LIST } from "../elements/staffMembers/staffMembersList";
import { expectWelcomeMessageIncludes } from "../steps/homePageSteps";
import { getDisplayedSelectors } from "../steps/permissions";
import { confirmationMessageShouldDisappear } from "../steps/shared/confirmationMessages";
import { urlList, userDetailsUrl } from "../fixtures/urlList";
import {
deleteStaffMembersStartsWith,
updateStaffMember
} from "../support/api/requests/StaffMembers";
import {
getMailActivationLinkForUser,
inviteStaffMemberWithFirstPermission
} from "../support/api/utils/users";
import filterTests from "../support/filterTests";
import { expectWelcomeMessageIncludes } from "../support/pages/homePage";
import { getDisplayedSelectors } from "../support/pages/permissionsPage";
import {
fillUpSetPassword,
fillUpUserDetails,
updateUserActiveFlag
} from "../steps/user";
import filterTests from "../support/filterTests";
import { urlList, userDetailsUrl } from "../url/urlList";
import {
getMailActivationLinkForUser,
inviteStaffMemberWithFirstPermission
} from "../utils/users";
} from "../support/pages/userPage";
filterTests(["stagedOnly"], () => {
filterTests({ definedTags: ["stagedOnly"] }, () => {
describe("Staff members", () => {
const startsWith = "StaffMembers";
const password = Cypress.env("USER_PASSWORD");
@ -99,9 +101,9 @@ filterTests(["stagedOnly"], () => {
.click()
.addAliasToGraphRequest("StaffMemberUpdate")
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
cy.wait("@StaffMemberUpdate")
.click()
.confirmationMessageShouldDisappear()
.waitForRequestAndCheckIfNoErrors("@StaffMemberUpdate")
.clearSessionData()
.loginUserViaRequest("auth", { email, password })
.visit(urlList.homePage);

View file

@ -15,11 +15,17 @@
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
/* eslint-disable @typescript-eslint/no-var-requires */
const graphql = require("graphql-request");
module.exports = async (on, config) => {
// make env variables visible for cypress
config.env.API_URI = process.env.API_URI;
config.env.APP_MOUNT_URI = process.env.APP_MOUNT_URI;
config.env.mailHogUrl = process.env.CYPRESS_MAILHOG;
config.env.SHOP = await getShopInfo(process.env);
on("before:browser:launch", (browser = {}, launchOptions) => {
launchOptions.args.push("--proxy-bypass-list=<-loopback>");
@ -27,3 +33,34 @@ module.exports = (on, config) => {
});
return config;
};
function getShopInfo(envVariables) {
// envVariables.CYPRESS_USER_NAME
const variables = {
email: envVariables.CYPRESS_USER_NAME,
password: envVariables.CYPRESS_USER_PASSWORD
};
const createTokenMutation = graphql.gql`mutation tokenCreate($email: String!, $password: String!){
tokenCreate(email:$email, password:$password){
token
}
}`;
const getShopInfoQuery = graphql.gql`query{
shop{
version
}
}`;
const client = new graphql.GraphQLClient(envVariables.API_URI, {
headers: {}
});
return client.request(createTokenMutation, variables).then(data => {
const token = data.tokenCreate.token;
client.setHeader("Authorization", `JWT ${token}`);
return client
.request(getShopInfoQuery)
.then(shopInfo => shopInfo.shop.version);
});
}

View file

@ -1,15 +0,0 @@
import { CATEGORY_DETAILS } from "../elements/catalog/categories/category-details";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { confirmationMessageShouldDisappear } from "./shared/confirmationMessages";
export function createCategory({ name, description }) {
cy.get(CATEGORY_DETAILS.nameInput)
.type(name)
.get(CATEGORY_DETAILS.descriptionInput)
.type(description)
.addAliasToGraphRequest("CategoryCreate")
.get(BUTTON_SELECTORS.confirm)
.click();
confirmationMessageShouldDisappear();
return cy.wait("@CategoryCreate");
}

View file

@ -1,41 +0,0 @@
import { DRAFT_ORDER_SELECTORS } from "../elements/orders/draft-order-selectors";
import { ASSIGN_ELEMENTS_SELECTORS } from "../elements/shared/assign-elements-selectors";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../elements/shared/sharedElements";
import { SELECT_SHIPPING_METHOD_FORM } from "../elements/shipping/select-shipping-method-form";
import { assignElements } from "./shared/assignElements";
export function finalizeDraftOrder(name, address) {
cy.get(DRAFT_ORDER_SELECTORS.addProducts).click();
assignElements(name);
cy.get(DRAFT_ORDER_SELECTORS.editCustomerButton)
.click()
.get(DRAFT_ORDER_SELECTORS.selectCustomer)
.type(name);
cy.contains(DRAFT_ORDER_SELECTORS.selectCustomerOption, name)
.click()
.get(DRAFT_ORDER_SELECTORS.customerEmail)
.should("be.visible")
.get(SHARED_ELEMENTS.skeleton)
.should("not.exist")
.get(BUTTON_SELECTORS.submit)
.click()
.get(DRAFT_ORDER_SELECTORS.addShippingCarrierLink)
.click()
.get(SELECT_SHIPPING_METHOD_FORM.selectShippingMethod)
.click()
.get(SELECT_SHIPPING_METHOD_FORM.shippingMethodOption)
.first()
.click();
cy.addAliasToGraphRequest("OrderShippingMethodUpdate")
.get(SELECT_SHIPPING_METHOD_FORM.submitButton)
.click();
cy.wait("@OrderShippingMethodUpdate");
cy.getTextFromElement(DRAFT_ORDER_SELECTORS.pageHeader).as(
"draftOrderNumber"
);
cy.addAliasToGraphRequest("OrderDraftFinalize");
cy.get(DRAFT_ORDER_SELECTORS.finalizeButton).click();
cy.wait("@OrderDraftFinalize");
return cy.get("@draftOrderNumber");
}

View file

@ -1,19 +0,0 @@
import { HEADER_SELECTORS } from "../elements/header/header-selectors";
import { HOMEPAGE_SELECTORS } from "../elements/homePage/homePage-selectors";
export function changeChannel(channelName) {
cy.get(HEADER_SELECTORS.channelSelect).click();
cy.addAliasToGraphRequest("Home");
cy.get(HEADER_SELECTORS.channelSelectList)
.contains(channelName)
.click();
cy.wait("@Home");
}
export function expectWelcomeMessageIncludes(name) {
cy.get(HOMEPAGE_SELECTORS.welcomeMessage)
.invoke("text")
.then(text => {
expect(text, `welcome message should contains ${name}`).to.contains(name);
});
}

View file

@ -1,15 +0,0 @@
import { ASSIGN_ELEMENTS_SELECTORS } from "../../elements/shared/assign-elements-selectors";
import { waitForProgressBarToNotBeVisible } from "./progressBar";
export function assignElements(name, withLoader = true) {
cy.get(ASSIGN_ELEMENTS_SELECTORS.searchInput).type(name);
if (withLoader) {
cy.get(ASSIGN_ELEMENTS_SELECTORS.dialogContent);
waitForProgressBarToNotBeVisible();
}
cy.contains(ASSIGN_ELEMENTS_SELECTORS.tableRow, name)
.find(ASSIGN_ELEMENTS_SELECTORS.checkbox)
.click()
.get(ASSIGN_ELEMENTS_SELECTORS.submitButton)
.click();
}

View file

@ -1,8 +0,0 @@
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
export function confirmationMessageShouldDisappear() {
cy.get(SHARED_ELEMENTS.notificationSuccess)
.should("be.visible")
.get(SHARED_ELEMENTS.notificationSuccess)
.should("not.exist");
}

View file

@ -1,14 +0,0 @@
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
export function visitAndWaitForProgressBarToDisappear(url) {
cy.visit(url);
return waitForProgressBarToNotBeVisible();
}
export function waitForProgressBarToNotBeVisible() {
return cy.get(SHARED_ELEMENTS.progressBar).should("be.not.visible");
}
export function waitForProgressBarToNotExist() {
return cy.get(SHARED_ELEMENTS.progressBar).should("not.exist");
}

View file

@ -1,19 +0,0 @@
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { waitForProgressBarToNotExist } from "./progressBar";
export function searchInTable(query) {
cy.get(SHARED_ELEMENTS.searchInput).type(query);
waitForProgressBarToNotExist();
}
export function findElementOnTable(elementName) {
cy.getTextFromElement(SHARED_ELEMENTS.table).then(tableText => {
if (tableText.includes(elementName)) {
cy.contains(SHARED_ELEMENTS.tableRow, elementName).click();
} else {
cy.get(BUTTON_SELECTORS.nextPaginationButton).click();
findElementOnTable(elementName);
}
});
}

View file

@ -1,46 +0,0 @@
import { SET_PASSWORD } from "../elements/account/setPassword";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { INVITE_STAFF_MEMBER_FORM } from "../elements/staffMembers/inviteStaffMemberForm";
import { STAFF_MEMBER_DETAILS } from "../elements/staffMembers/staffMemberDetails";
import { userDetailsUrl } from "../url/urlList";
import { confirmationMessageShouldDisappear } from "./shared/confirmationMessages";
import { visitAndWaitForProgressBarToDisappear } from "./shared/progressBar";
import { fillAutocompleteSelect } from "./shared/selects";
export function fillUpSetPassword(password) {
cy.get(SET_PASSWORD.confirmPasswordInput)
.type(password)
.get(SET_PASSWORD.passwordInput)
.type(password)
.addAliasToGraphRequest("SetPassword")
.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@SetPassword");
}
export function fillUpUserDetails(firstName, lastName, email) {
cy.get(INVITE_STAFF_MEMBER_FORM.firstNameInput)
.type(firstName)
.get(INVITE_STAFF_MEMBER_FORM.lastNameInput)
.type(lastName)
.get(INVITE_STAFF_MEMBER_FORM.emailInput)
.type(email)
.get(BUTTON_SELECTORS.submit)
.click();
confirmationMessageShouldDisappear();
fillAutocompleteSelect(STAFF_MEMBER_DETAILS.permissionsSelect);
cy.addAliasToGraphRequest("StaffMemberUpdate");
cy.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@StaffMemberUpdate");
}
export function updateUserActiveFlag(userId) {
visitAndWaitForProgressBarToDisappear(userDetailsUrl(userId))
.get(STAFF_MEMBER_DETAILS.isActiveCheckBox)
.click()
.addAliasToGraphRequest("StaffMemberUpdate");
cy.get(BUTTON_SELECTORS.confirm)
.click()
.wait("@StaffMemberUpdate");
}

View file

@ -1,4 +1,4 @@
import { stringify } from "../support/format/formatJson";
import { stringify } from "../.././formatData/formatJson";
import { getValueWithDefault, getVariantsListIds } from "./utils/Utils";
export function getFirstProducts(first, search) {
@ -18,7 +18,8 @@ export function getFirstProducts(first, search) {
}
}
}
}`;
}
}`;
return cy
.sendRequestWithQuery(query)
.then(resp => resp.body.data.products.edges);

View file

@ -1,3 +1,4 @@
import { returnValueDependsOnShopVersion } from "../../formatData/dataDependingOnVersion";
import { getValueWithDefault } from "./utils/Utils";
export function createTypeProduct({
@ -5,8 +6,10 @@ export function createTypeProduct({
attributeId,
hasVariants = true,
slug = name,
shippable = true
shippable = true,
kind = "NORMAL"
}) {
const kindLines = returnValueDependsOnShopVersion("3.1", `kind: ${kind}`);
const productAttributesLine = getValueWithDefault(
attributeId,
`productAttributes: "${attributeId}"`
@ -23,6 +26,7 @@ export function createTypeProduct({
hasVariants: ${hasVariants}
${variantAttributesLine}
isShippingRequired:${shippable}
${kindLines}
}){
productErrors{
field

View file

@ -37,6 +37,7 @@ export function getShopInfo() {
const query = `query{
shop{
name
version
domain{
host
}

View file

@ -1,4 +1,4 @@
import { urlList } from "../url/urlList";
import { urlList } from "../../../fixtures/urlList";
export function getStaffMembersStartsWith(startsWith) {
const query = `query{

View file

@ -1,4 +1,4 @@
import { deleteApp, getApps } from "../apiRequests/Apps";
import { deleteApp, getApps } from "../requests/Apps";
export function deleteAppsStartsWith(startsWith) {
cy.deleteElementsStartsWith(deleteApp, getApps, startsWith);

View file

@ -1,4 +1,4 @@
import { deleteAttribute, getAttributes } from "../apiRequests/Attribute";
import { deleteAttribute, getAttributes } from "../../requests/Attribute";
export function deleteAttributesStartsWith(startsWith) {
cy.deleteElementsStartsWith(deleteAttribute, getAttributes, startsWith);

View file

@ -1,4 +1,4 @@
import { deleteCategory, getCategories } from "../apiRequests/Category";
import { deleteCategory, getCategories } from "../requests/Category";
export function deleteCategoriesStartsWith(startsWith) {
cy.deleteElementsStartsWith(deleteCategory, getCategories, startsWith);

View file

@ -1,4 +1,4 @@
import * as channels from "../apiRequests/Channels";
import * as channels from "../requests/Channels";
export function deleteChannelsStartsWith(nameStartsWith) {
channels.getChannels().then(resp => {

View file

@ -1,4 +1,4 @@
import { deleteCollection, getCollections } from "../apiRequests/Collections";
import { deleteCollection, getCollections } from "../requests/Collections";
export function deleteCollectionsStartsWith(startsWith) {
cy.deleteElementsStartsWith(deleteCollection, getCollections, startsWith);

Some files were not shown because too many files have changed in this diff Show more