tests - removing redundant session cleanup, navigator confirmation added (#4023)

* set notifiedAboutNavigator: true in local storage when logging in
This commit is contained in:
wojteknowacki 2023-07-28 09:48:41 +02:00 committed by GitHub
parent 922c9fb4ce
commit 1bd4aeadf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 546 additions and 348 deletions

View file

@ -7,9 +7,16 @@ import { APP_DETAILS } from "../elements/apps/appDetails";
import { APPS_LIST_SELECTORS } from "../elements/apps/appsList";
import { WEBHOOK_DETAILS } from "../elements/apps/webhookDetails";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { appDetailsUrl, urlList } from "../fixtures/urlList";
import {
appDetailsUrl,
urlList,
} from "../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../fixtures/users";
import { createApp, getApp, updateApp } from "../support/api/requests/Apps";
import {
createApp,
getApp,
updateApp,
} from "../support/api/requests/Apps";
import {
addShippingMethod,
createCheckout,
@ -18,7 +25,9 @@ import {
import { createVoucher } from "../support/api/requests/Discounts/Vouchers";
import { createGiftCard } from "../support/api/requests/GiftCard";
import { getDefaultChannel } from "../support/api/utils/channelsUtils";
import { getShippingMethodIdFromCheckout } from "../support/api/utils/ordersUtils";
import {
getShippingMethodIdFromCheckout,
} from "../support/api/utils/ordersUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
@ -41,7 +50,7 @@ describe("As a staff user I want to manage apps", () => {
const email = `example@example.com`;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createApp(name, "MANAGE_APPS").then(app => {
createdApp = app;
@ -93,7 +102,7 @@ describe("As a staff user I want to manage apps", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest("auth", ONE_PERMISSION_USERS.app);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.app);
});
it(

View file

@ -3,18 +3,27 @@
import faker from "faker";
import { CATEGORIES_LIST_SELECTORS } from "../../elements/catalog/categories/categories-list";
import { CATEGORY_DETAILS_SELECTORS } from "../../elements/catalog/categories/category-details";
import {
CATEGORIES_LIST_SELECTORS,
} from "../../elements/catalog/categories/categories-list";
import {
CATEGORY_DETAILS_SELECTORS,
} 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 {
categoryDetailsUrl,
urlList,
} from "../../fixtures/urlList";
import {
createCategory as createCategoryRequest,
getCategory,
} from "../../support/api/requests/Category";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import { ensureCanvasStatic } from "../../support/customCommands/sharedElementsOperations/canvas";
import {
ensureCanvasStatic,
} from "../../support/customCommands/sharedElementsOperations/canvas";
import {
createCategory,
updateCategory,
@ -32,7 +41,7 @@ describe("As an admin I want to manage categories", () => {
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
channelsUtils
.getDefaultChannel()
@ -71,7 +80,7 @@ describe("As an admin I want to manage categories", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -4,7 +4,10 @@
import faker from "faker";
import { BUTTON_SELECTORS } from "../../elements";
import { collectionDetailsUrl, urlList } from "../../fixtures/urlList";
import {
collectionDetailsUrl,
urlList,
} from "../../fixtures/urlList";
import { createChannel } from "../../support/api/requests/Channels";
import {
addChannelToCollection,
@ -12,8 +15,12 @@ import {
createCollection as createCollectionRequest,
} from "../../support/api/requests/Collections";
import { updateChannelInProduct } from "../../support/api/requests/Product";
import { getCollection } from "../../support/api/requests/storeFront/Collections";
import { getProductDetails } from "../../support/api/requests/storeFront/ProductDetails";
import {
getCollection,
} from "../../support/api/requests/storeFront/Collections";
import {
getProductDetails,
} from "../../support/api/requests/storeFront/ProductDetails";
import { searchInShop } from "../../support/api/requests/storeFront/Search";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
@ -35,7 +42,7 @@ describe("As an admin I want to manage collections.", () => {
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
channelsUtils
.getDefaultChannel()
@ -76,7 +83,7 @@ describe("As an admin I want to manage collections.", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -1,7 +1,9 @@
/// <reference types="cypress" />
import faker from "faker";
import { GIFT_CARD_LIST } from "../../../elements/catalog/giftCard/giftCardList";
import {
GIFT_CARD_LIST,
} from "../../../elements/catalog/giftCard/giftCardList";
import { urlList } from "../../../fixtures/urlList";
import { completeCheckout } from "../../../support/api/requests/Checkout";
import {
@ -17,8 +19,11 @@ import {
addPayment,
purchaseProductWithPromoCode,
} from "../../../support/api/utils/ordersUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import { updateTaxConfigurationForChannel } from "../../../support/api/utils/taxesUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import {
updateTaxConfigurationForChannel,
} from "../../../support/api/utils/taxesUtils";
import { giftCardsPage } from "../../../support/pages";
describe("As a admin I want to use enabled gift card in checkout", () => {
@ -38,7 +43,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
before(() => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createProductWithShipping({ name, shippingPrice, productPrice })
@ -59,7 +64,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateTaxConfigurationForChannel({
channelSlug: defaultChannel.slug,
pricesEnteredWithTax: true,

View file

@ -20,11 +20,11 @@ describe("As an admin I want to create gift card", () => {
const currency = "USD";
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -10,19 +10,21 @@ import {
activatePlugin,
updatePlugin,
} from "../../../support/api/requests/Plugins";
import { getMailWithGiftCardExportWithAttachment } from "../../../support/api/utils/users";
import {
getMailWithGiftCardExportWithAttachment,
} from "../../../support/api/utils/users";
import { giftCardsPage } from "../../../support/pages";
describe("As an admin I want to export gift card", () => {
const startsWith = "updateGCard";
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
activatePlugin({ id: "mirumee.notifications.admin_email" });
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -2,8 +2,11 @@
import faker from "faker";
import * as channelsUtils from "../../../support/api/utils/channelsUtils";
import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import {
createWaitingForCaptureOrder,
} from "../../../support/api/utils/ordersUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import { createShipping } from "../../../support/api/utils/shippingUtils";
describe("As a customer I should be able to purchase gift card as a product", () => {
@ -25,7 +28,7 @@ describe("As a customer I should be able to purchase gift card as a product", ()
};
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
const name = `${startsWith}${faker.datatype.number()}`;
@ -84,7 +87,7 @@ describe("As a customer I should be able to purchase gift card as a product", ()
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -3,10 +3,15 @@
import faker from "faker";
import { GIFT_CARD_UPDATE } from "../../../elements/catalog/giftCard/giftCardUpdate";
import {
GIFT_CARD_UPDATE,
} from "../../../elements/catalog/giftCard/giftCardUpdate";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { MESSAGES } from "../../../fixtures";
import { giftCardDetailsUrl, urlList } from "../../../fixtures/urlList";
import {
giftCardDetailsUrl,
urlList,
} from "../../../fixtures/urlList";
import {
createGiftCard,
getGiftCardWithId,
@ -16,13 +21,8 @@ import { giftCardsPage } from "../../../support/pages";
describe("As an admin I want to update gift card", () => {
const startsWith = "updateGCard";
before(() => {
cy.clearSessionData().loginUserViaRequest();
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -3,7 +3,9 @@
import faker from "faker";
import { WAREHOUSES_DETAILS } from "../../elements/warehouses/warehouse-details";
import {
WAREHOUSES_DETAILS,
} from "../../elements/warehouses/warehouse-details";
import {
completeCheckout,
createCheckout,
@ -39,7 +41,7 @@ describe("Warehouses in checkout", () => {
const warehouseSlug = `${faker.lorem.slug()}slug`;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("addresses")
.then(addresses => {
usAddress = addresses.usAddress;
@ -101,7 +103,7 @@ describe("Warehouses in checkout", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -28,7 +28,7 @@ describe("Products without shipment option", () => {
let productWithoutShipping;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createChannel({
name,

View file

@ -17,7 +17,9 @@ import {
getShippingMethodIdFromCheckout,
updateShippingInCheckout,
} from "../../support/api/utils/ordersUtils";
import { createDigitalAndPhysicalProductWithNewDataAndDefaultChannel } from "../../support/api/utils/products/productsUtils";
import {
createDigitalAndPhysicalProductWithNewDataAndDefaultChannel,
} from "../../support/api/utils/products/productsUtils";
describe("As an unlogged customer I want to order physical and digital products", () => {
const startsWith = `CyPurchaseByType`;
@ -33,7 +35,7 @@ describe("As an unlogged customer I want to order physical and digital products"
let physicalVariants;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createDigitalAndPhysicalProductWithNewDataAndDefaultChannel({
physicalProductName: physicalName,
digitalProductName: digitalName,
@ -54,7 +56,7 @@ describe("As an unlogged customer I want to order physical and digital products"
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -8,8 +8,12 @@ import {
createCheckout,
} from "../../support/api/requests/Checkout";
import { getVariants } from "../../support/api/requests/Product";
import { createWaitingForCaptureOrder } from "../../support/api/utils/ordersUtils";
import { createNewProductWithSeveralVariants } from "../../support/api/utils/products/productsUtils";
import {
createWaitingForCaptureOrder,
} from "../../support/api/utils/ordersUtils";
import {
createNewProductWithSeveralVariants,
} from "../../support/api/utils/products/productsUtils";
describe("Manage products stocks in checkout", () => {
const startsWith = "CyStocksCheckout-";
@ -23,7 +27,7 @@ describe("Manage products stocks in checkout", () => {
let lastVariantInStock;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
const variantsData = [
{

View file

@ -21,7 +21,7 @@ describe("Warehouses in checkout", () => {
"should not be possible to buy product for country not listed in warehouse",
{ tags: ["@checkout", "@allEnv", "@stable", "@oldRelease"] },
() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
const name = `${startsWith}${faker.datatype.number()}`;
cy.fixture("addresses")
.then(addresses => {

View file

@ -7,9 +7,15 @@ import { addVariantUrl } from "../../../fixtures/urlList";
import { createCategory } from "../../../support/api/requests/Category";
import { getVariant } from "../../../support/api/requests/Product";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import { createProductInChannelWithoutVariants } from "../../../support/api/utils/products/productsUtils";
import { createProductTypeWithNewVariantSelectionAttribute } from "../../../support/api/utils/productTypeUtils";
import { fillUpVariantDetails } from "../../../support/pages/catalog/products/VariantsPage";
import {
createProductInChannelWithoutVariants,
} from "../../../support/api/utils/products/productsUtils";
import {
createProductTypeWithNewVariantSelectionAttribute,
} from "../../../support/api/utils/productTypeUtils";
import {
fillUpVariantDetails,
} from "../../../support/pages/catalog/products/VariantsPage";
describe("As an admin I want to use attributes in variant selection", () => {
const startsWith = "VarSel" + Date.now();
@ -24,7 +30,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
let category;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel().then(defaultChannel => (channel = defaultChannel));
createCategory({ name: startsWith }).then(categoryResp => {
category = categoryResp;
@ -33,7 +39,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
attributesTypes.forEach(attributeType => {

View file

@ -3,12 +3,18 @@
import faker from "faker";
import { ATTRIBUTES_DETAILS } from "../../../elements/attribute/attributes_details";
import {
ATTRIBUTES_DETAILS,
} from "../../../elements/attribute/attributes_details";
import { ATTRIBUTES_LIST } from "../../../elements/attribute/attributes_list";
import { urlList } from "../../../fixtures/urlList";
import { getAttribute } from "../../../support/api/requests/Attribute";
import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData";
import { createAttributeWithInputType } from "../../../support/pages/attributesPage";
import {
expectCorrectDataInAttribute,
} from "../../../support/api/utils/attributes/checkAttributeData";
import {
createAttributeWithInputType,
} from "../../../support/pages/attributesPage";
describe("As an admin I want to create content attribute", () => {
const startsWith = "AttrCont" + Date.now();
@ -42,13 +48,8 @@ describe("As an admin I want to create content attribute", () => {
{ unitSystem: "without selecting unit", testCase: "SALEOR_0521" },
];
before(() => {
cy.clearSessionData().loginUserViaRequest();
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest()
cy.loginUserViaRequest()
.visit(urlList.attributes)
.get(ATTRIBUTES_LIST.createAttributeButton)
.click()

View file

@ -3,15 +3,22 @@
import faker from "faker";
import { ATTRIBUTES_DETAILS } from "../../../elements/attribute/attributes_details";
import {
ATTRIBUTES_DETAILS,
} from "../../../elements/attribute/attributes_details";
import { ATTRIBUTES_LIST } from "../../../elements/attribute/attributes_list";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { attributeDetailsUrl, urlList } from "../../../fixtures/urlList";
import {
attributeDetailsUrl,
urlList,
} from "../../../fixtures/urlList";
import {
createAttribute,
getAttribute,
} from "../../../support/api/requests/Attribute";
import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData";
import {
expectCorrectDataInAttribute,
} from "../../../support/api/utils/attributes/checkAttributeData";
import {
createAttributeWithInputType,
fillUpAttributeNameAndCode,
@ -48,13 +55,8 @@ describe("As an admin I want to create product attribute", () => {
{ unitSystem: "without selecting unit", testCase: "SALEOR_0510" },
];
before(() => {
cy.clearSessionData().loginUserViaRequest();
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest()
cy.loginUserViaRequest()
.visit(urlList.attributes)
.get(ATTRIBUTES_LIST.createAttributeButton)
.click();

View file

@ -9,18 +9,16 @@ import {
createAttribute,
getAttribute,
} from "../../../support/api/requests/Attribute";
import { fillUpAttributeNameAndCode } from "../../../support/pages/attributesPage";
import {
fillUpAttributeNameAndCode,
} from "../../../support/pages/attributesPage";
describe("As an admin I want to delete and update content attribute", () => {
const startsWith = "AttrContDel" + Date.now();
let attribute;
before(() => {
cy.clearSessionData().loginUserViaRequest();
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createAttribute({
name: `${startsWith}${faker.datatype.number()}`,
type: "PAGE_TYPE",

View file

@ -7,8 +7,12 @@ import {
} from "../../../elements/shared/sharedElements";
import { updateAttribute } from "../../../support/api/requests/Attribute";
import { createProduct } from "../../../support/api/requests/Product";
import { createTypeAttributeAndCategoryForProduct } from "../../../support/api/utils/products/productsUtils";
import { enterAttributeAndChanegeIsFilterableInDashbord } from "../../../support/pages/attributesPage";
import {
createTypeAttributeAndCategoryForProduct,
} from "../../../support/api/utils/products/productsUtils";
import {
enterAttributeAndChanegeIsFilterableInDashbord,
} from "../../../support/pages/attributesPage";
import {
enterProductListPage,
selectAttributeFilter,
@ -21,7 +25,7 @@ xdescribe("Tests for using attributes in filters", () => {
let attribute;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createTypeAttributeAndCategoryForProduct({
name: startsWith,
attributeValues: [startsWith],
@ -38,7 +42,7 @@ xdescribe("Tests for using attributes in filters", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -2,14 +2,25 @@
/// <reference types="../../../support"/>
import faker from "faker";
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 {
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 { MESSAGES } from "../../../fixtures/";
import { productDetailsUrl, urlList } from "../../../fixtures/urlList";
import {
productDetailsUrl,
urlList,
} from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { createChannel } from "../../../support/api/requests/Channels";
import { getFirstProducts } from "../../../support/api/requests/Product";
@ -17,7 +28,9 @@ import {
createShippingZoneWithoutWarehouse,
getShippingZone,
} from "../../../support/api/requests/ShippingMethod";
import { createWarehouse as createWarehouseViaApi } from "../../../support/api/requests/Warehouse";
import {
createWarehouse as createWarehouseViaApi,
} from "../../../support/api/requests/Warehouse";
import {
createChannelByView,
setChannelRequiredFields,
@ -32,7 +45,7 @@ describe("Channels", () => {
let usAddress;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createShippingZoneWithoutWarehouse(randomName, "US").then(
shippingZoneResp => {
shippingZone = shippingZoneResp;
@ -52,10 +65,7 @@ describe("Channels", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.channel,
);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.channel);
});
it(

View file

@ -3,8 +3,12 @@
import faker from "faker";
import { CHANNEL_FORM_SELECTORS } from "../../../elements/channels/channel-form-selectors";
import { DRAFT_ORDER_SELECTORS } from "../../../elements/orders/draft-order-selectors";
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 {
@ -12,13 +16,17 @@ import {
createChannel,
} from "../../../support/api/requests/Channels";
import { createCheckout } from "../../../support/api/requests/Checkout";
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
import {
getProductDetails,
} from "../../../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
} from "../../../support/api/utils/products/productsUtils";
import { isProductVisible } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import {
isProductVisible,
} from "../../../support/api/utils/storeFront/storeFrontProductUtils";
describe("Tests on inactive channel", () => {
const channelStartsWith = `InactiveChannel`;
@ -30,7 +38,7 @@ describe("Tests on inactive channel", () => {
let newChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("addresses").then(({ plAddress }) => {
address = plAddress;
});
@ -47,7 +55,7 @@ describe("Tests on inactive channel", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -3,11 +3,18 @@
import faker from "faker";
import { CUSTOMER_DETAILS_SELECTORS } from "../../elements/customer/customer-details";
import { CUSTOMERS_LIST_SELECTORS } from "../../elements/customer/customers-list";
import {
CUSTOMER_DETAILS_SELECTORS,
} from "../../elements/customer/customer-details";
import {
CUSTOMERS_LIST_SELECTORS,
} from "../../elements/customer/customers-list";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { customerDetailsUrl, urlList } from "../../fixtures/urlList";
import {
customerDetailsUrl,
urlList,
} from "../../fixtures/urlList";
import {
addressCreate,
createCustomer,
@ -20,7 +27,7 @@ describe("Tests for customer", () => {
let secondAddress;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("addresses").then(({ usAddress, secondUsAddress }) => {
address = usAddress;
secondAddress = secondUsAddress;
@ -29,7 +36,7 @@ describe("Tests for customer", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -21,7 +21,7 @@ describe("Tests for menu navigation", () => {
let menu;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createMenuViaApi(randomName).then(({ menu: menuResp }) => {
menu = menuResp;
cy.checkIfDataAreNotNull(menu);
@ -29,7 +29,7 @@ describe("Tests for menu navigation", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -3,8 +3,12 @@
import faker from "faker";
import { PERMISSION_GROUP_DETAILS_SELECTORS } from "../../elements/permissionGroup/permissionGroupDetails";
import { PERMISSION_GROUP_LIST_SELECTORS } from "../../elements/permissionGroup/permissionGroupsList";
import {
PERMISSION_GROUP_DETAILS_SELECTORS,
} from "../../elements/permissionGroup/permissionGroupDetails";
import {
PERMISSION_GROUP_LIST_SELECTORS,
} from "../../elements/permissionGroup/permissionGroupsList";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import {
@ -17,18 +21,16 @@ import {
createPermissionGroup,
getPermissionGroup,
} from "../../support/api/requests/PermissionGroup.js";
import { getStaffMembersStartsWith } from "../../support/api/requests/StaffMembers";
import {
getStaffMembersStartsWith,
} from "../../support/api/requests/StaffMembers";
describe("Permissions groups", () => {
const startsWith = "CyPermissions-" + Date.now();
const permissionManageProducts = "[MANAGE_PRODUCTS]";
before(() => {
cy.clearSessionData().loginUserViaRequest();
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -36,7 +36,7 @@ describe("Adyen payments", () => {
let cardData;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("cards").then(cardsResp => {
paymentCards = cardsResp.adyen;
cardData = {
@ -101,7 +101,7 @@ describe("Adyen payments", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createCheckout({
channelSlug: defaultChannel.slug,
email,

View file

@ -3,7 +3,9 @@
import faker from "faker";
import { PLUGINS_DETAILS_SELECTORS } from "../../../elements/plugins/pluginDetails";
import {
PLUGINS_DETAILS_SELECTORS,
} from "../../../elements/plugins/pluginDetails";
import { PLUGINS_LIST_SELECTORS } from "../../../elements/plugins/pluginsList";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { urlList } from "../../../fixtures/urlList";
@ -25,7 +27,7 @@ describe("As an admin I want to manage plugins", () => {
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel().then(channel => {
defaultChannel = channel;
activatePlugin({ id: "mirumee.notifications.admin_email" });
@ -37,10 +39,7 @@ describe("As an admin I want to manage plugins", () => {
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest()
.visit(urlList.plugins)
.expectSkeletonIsVisible();
cy.loginUserViaRequest().visit(urlList.plugins).expectSkeletonIsVisible();
});
it(

View file

@ -13,7 +13,9 @@ import {
addStripePaymentAndGetConfirmationData,
getShippingMethodIdFromCheckout,
} from "../../../support/api/utils/ordersUtils";
import { createProductWithShipping } from "../../../support/api/utils/products/productsUtils";
import {
createProductWithShipping,
} from "../../../support/api/utils/products/productsUtils";
describe("Stripe payments", () => {
const startsWith = "Stripe-" + faker.datatype.number();
@ -28,7 +30,7 @@ describe("Stripe payments", () => {
let cardData;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("cards").then(({ stripe }) => {
paymentCards = stripe;
cardData = {
@ -56,7 +58,7 @@ describe("Stripe payments", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createCheckout({
channelSlug: defaultChannel.slug,
email,

View file

@ -3,7 +3,9 @@
import faker from "faker";
import { PRODUCT_TYPE_DETAILS_SELECTORS } from "../../../elements/productTypes/productTypeDetails";
import {
PRODUCT_TYPE_DETAILS_SELECTORS,
} from "../../../elements/productTypes/productTypeDetails";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { productTypeDetailsUrl } from "../../../fixtures/urlList";
import { createAttribute } from "../../../support/api/requests/Attribute";
@ -18,13 +20,13 @@ describe("As an admin I want to manage attributes in product types", () => {
let attribute;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createAttribute({ name: startsWith }).then(resp => (attribute = resp));
cy.checkIfDataAreNotNull(attribute);
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -10,13 +10,8 @@ import { createProductType } from "../../../support/pages/productTypePage";
describe("As an admin I want to create product types", () => {
const startsWith = "productType";
before(() => {
cy.clearSessionData().loginUserViaRequest();
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest()
cy.loginUserViaRequest()
.visit(urlList.productTypes)
.expectSkeletonIsVisible();
});

View file

@ -11,9 +11,13 @@ import {
createTypeProduct,
getProductType,
} from "../../../support/api/requests/ProductType";
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
import {
getProductDetails,
} from "../../../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import { createProductInChannel } from "../../../support/api/utils/products/productsUtils";
import {
createProductInChannel,
} from "../../../support/api/utils/products/productsUtils";
describe("As an admin I want to manage product types", () => {
const startsWith = "delProdType" + faker.datatype.number();
@ -22,7 +26,7 @@ describe("As an admin I want to manage product types", () => {
let attribute;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createAttribute({ name: startsWith }).then(resp => (attribute = resp));
createCategory({ name: startsWith }).then(resp => (category = resp));
getDefaultChannel().then(resp => {
@ -32,7 +36,7 @@ describe("As an admin I want to manage product types", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -4,7 +4,9 @@
import faker from "faker";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { SHIPPING_ZONE_DETAILS } from "../../../elements/shipping/shipping-zone-details";
import {
SHIPPING_ZONE_DETAILS,
} from "../../../elements/shipping/shipping-zone-details";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { createChannel } from "../../../support/api/requests/Channels";
import {
@ -22,10 +24,6 @@ describe("As a staff user I want have different shipping method prices for each
const startsWith = "ChannelShippingMethod";
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
});
it(
"should be able to display different price for each channel. TC: SALEOR_0805",
{ tags: ["@shipping", "@allEnv", "@stable"] },

View file

@ -5,14 +5,21 @@ import faker from "faker";
import { urlList } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { updateChannelWarehouses } from "../../../support/api/requests/Channels";
import {
updateChannelWarehouses,
} from "../../../support/api/requests/Channels";
import { createCheckout } from "../../../support/api/requests/Checkout";
import { createVariant } from "../../../support/api/requests/Product";
import { createWarehouse } from "../../../support/api/requests/Warehouse";
import * as channelsUtils from "../../../support/api/utils/channelsUtils";
import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils";
import {
createWaitingForCaptureOrder,
} from "../../../support/api/utils/ordersUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import {
isShippingAvailableInCheckout,
} from "../../../support/api/utils/storeFront/checkoutUtils";
import {
createShippingRate,
createShippingZone,
@ -37,7 +44,7 @@ describe("As a staff user I want to create shipping zone and rate", () => {
const productTypeSlug = `${faker.lorem.slug()}slug`;
const productSlug = `${faker.lorem.slug()}slug`;
const warehouseSlug = `${faker.lorem.slug()}slug`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
channelsUtils
.getDefaultChannel()
.then(channel => {
@ -108,7 +115,7 @@ describe("As a staff user I want to create shipping zone and rate", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -4,7 +4,9 @@
import faker from "faker";
import { shippingRateUrl } from "../../../fixtures/urlList";
import { updateChannelWarehouses } from "../../../support/api/requests/Channels";
import {
updateChannelWarehouses,
} from "../../../support/api/requests/Channels";
import {
addChannelToShippingMethod,
createShippingRate,
@ -30,7 +32,7 @@ describe("As a user I should be able to update and delete shipping method", () =
let warehouse;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel()
.then(channel => {
@ -64,7 +66,7 @@ describe("As a user I should be able to update and delete shipping method", () =
beforeEach(() => {
const rateName = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createShippingRate({
name: rateName,
shippingZone: shippingZone.id,

View file

@ -5,14 +5,18 @@ import faker from "faker";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { shippingZoneDetailsUrl } from "../../../fixtures/urlList";
import { updateChannelWarehouses } from "../../../support/api/requests/Channels";
import {
updateChannelWarehouses,
} from "../../../support/api/requests/Channels";
import {
createShippingZone,
getShippingZone,
} from "../../../support/api/requests/ShippingMethod";
import { createWarehouse } from "../../../support/api/requests/Warehouse";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import { fillUpShippingZoneData } from "../../../support/pages/shippingMethodPage";
import {
fillUpShippingZoneData,
} from "../../../support/pages/shippingMethodPage";
import { enterAndSelectShippings } from "../../../support/pages/shippingZones";
describe("As a user I should be able to update and delete shipping zone", () => {
@ -25,7 +29,7 @@ describe("As a user I should be able to update and delete shipping zone", () =>
let warehouse;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel()
.then(channel => {
defaultChannel = channel;
@ -48,7 +52,7 @@ describe("As a user I should be able to update and delete shipping zone", () =>
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createShippingZone(name, "US", defaultChannel.id, warehouse.id).then(
shippingZoneResp => {
shippingZone = shippingZoneResp;

View file

@ -5,16 +5,22 @@ import faker from "faker";
import { shippingZoneDetailsUrl } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { updateChannelWarehouses } from "../../../support/api/requests/Channels";
import {
updateChannelWarehouses,
} from "../../../support/api/requests/Channels";
import { createCheckout } from "../../../support/api/requests/Checkout";
import { createShippingZone } from "../../../support/api/requests/ShippingMethod";
import {
createShippingZone,
} from "../../../support/api/requests/ShippingMethod";
import { createWarehouse } from "../../../support/api/requests/Warehouse";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
} from "../../../support/api/utils/products/productsUtils";
import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils";
import {
isShippingAvailableInCheckout,
} from "../../../support/api/utils/storeFront/checkoutUtils";
import {
createRateWithPostalCode,
postalCodesOptions,
@ -34,7 +40,7 @@ describe("As a user I want to create shipping method with postal codes", () => {
let variantsList;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel()
.then(channel => {
defaultChannel = channel;
@ -90,9 +96,9 @@ describe("As a user I want to create shipping method with postal codes", () => {
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping)
.visit(shippingZoneDetailsUrl(shippingZone.id));
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping).visit(
shippingZoneDetailsUrl(shippingZone.id),
);
});
it(

View file

@ -5,16 +5,22 @@ import faker from "faker";
import { shippingZoneDetailsUrl } from "../../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../../fixtures/users";
import { updateChannelWarehouses } from "../../../../support/api/requests/Channels";
import {
updateChannelWarehouses,
} from "../../../../support/api/requests/Channels";
import { createCheckout } from "../../../../support/api/requests/Checkout";
import { createShippingZone } from "../../../../support/api/requests/ShippingMethod";
import {
createShippingZone,
} from "../../../../support/api/requests/ShippingMethod";
import { createWarehouse } from "../../../../support/api/requests/Warehouse";
import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
} from "../../../../support/api/utils/products/productsUtils";
import { isShippingAvailableInCheckout } from "../../../../support/api/utils/storeFront/checkoutUtils";
import {
isShippingAvailableInCheckout,
} from "../../../../support/api/utils/storeFront/checkoutUtils";
import {
createShippingRate,
rateOptions,
@ -33,7 +39,7 @@ describe("As a staff user I want to manage shipping weights", () => {
let variantsList;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel()
.then(channel => {
defaultChannel = channel;
@ -80,9 +86,9 @@ describe("As a staff user I want to manage shipping weights", () => {
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping)
.visit(shippingZoneDetailsUrl(shippingZone.id));
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping).visit(
shippingZoneDetailsUrl(shippingZone.id),
);
});
it(

View file

@ -4,14 +4,23 @@
import faker from "faker";
import { SHARED_ELEMENTS } from "../../../../elements/shared/sharedElements";
import { SHIPPING_RATE_DETAILS } from "../../../../elements/shipping/shipping-rate-details";
import { shippingRateUrl, urlList } from "../../../../fixtures/urlList";
import { updateChannelWarehouses } from "../../../../support/api/requests/Channels";
import {
SHIPPING_RATE_DETAILS,
} from "../../../../elements/shipping/shipping-rate-details";
import {
shippingRateUrl,
urlList,
} from "../../../../fixtures/urlList";
import {
updateChannelWarehouses,
} from "../../../../support/api/requests/Channels";
import {
createShippingRate as createShippingRateViaApi,
createShippingZone,
} from "../../../../support/api/requests/ShippingMethod";
import { updateShopWeightUnit } from "../../../../support/api/requests/ShopSettings";
import {
updateShopWeightUnit,
} from "../../../../support/api/requests/ShopSettings";
import { createWarehouse } from "../../../../support/api/requests/Warehouse";
import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils";
import { changeWeightUnit } from "../../../../support/pages/shippingMethodPage";
@ -26,7 +35,7 @@ describe("As a staff user I want to change shop default weight unit", () => {
let warehouse;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateShopWeightUnit("KG")
.then(() => {
getDefaultChannel().then(channel => {

View file

@ -12,7 +12,7 @@ describe("Tests for site settings", () => {
let address;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("addresses").then(({ usAddress, plAddress }) => {
address = usAddress;

View file

@ -4,15 +4,21 @@
import faker from "faker";
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 {
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 {
shippingZoneDetailsUrl,
urlList,
warehouseDetailsUrl,
} from "../../../fixtures/urlList";
import { updateChannelWarehouses } from "../../../support/api/requests/Channels";
import {
updateChannelWarehouses,
} from "../../../support/api/requests/Channels";
import {
createShippingZone,
createShippingZoneWithoutWarehouse,
@ -29,7 +35,7 @@ describe("As an admin I want to manage warehouses", () => {
let secondUsAddress;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("addresses").then(addresses => {
usAddress = addresses.usAddress;
secondUsAddress = addresses.secondUsAddress;
@ -38,7 +44,7 @@ describe("As an admin I want to manage warehouses", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -3,7 +3,9 @@
import faker from "faker";
import { CUSTOMER_DETAILS_SELECTORS } from "../elements/customers/customer-details";
import {
CUSTOMER_DETAILS_SELECTORS,
} from "../elements/customers/customer-details";
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
import { customerDetailsUrl } from "../fixtures/urlList";
import {
@ -20,7 +22,7 @@ describe("Tests for customer registration", () => {
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel().then(channel => {
defaultChannel = channel;
cy.checkIfDataAreNotNull({ defaultChannel });

View file

@ -7,9 +7,12 @@ 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 * as productsUtils from "../../../support/api/utils/products/productsUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import { createShipping } from "../../../support/api/utils/shippingUtils";
import { getProductPrice } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import {
getProductPrice,
} from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import {
getDefaultTaxClass,
updateTaxConfigurationForChannel,
@ -36,7 +39,7 @@ describe("As an admin I want to create sale for products", () => {
before(() => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createTypeAttributeAndCategoryForProduct({ name })
.then(
@ -82,7 +85,7 @@ describe("As an admin I want to create sale for products", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateTaxConfigurationForChannel({
channelSlug: defaultChannel.slug,
pricesEnteredWithTax: true,

View file

@ -11,7 +11,8 @@ import {
createSaleInChannel,
getVariantWithSaleStatus,
} from "../../../support/api/utils/discounts/salesUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import { createShipping } from "../../../support/api/utils/shippingUtils";
import {
getDefaultTaxClass,
@ -36,7 +37,7 @@ describe("Sales discounts for variant", () => {
before(() => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
channelsUtils
.getDefaultChannel()
.then(channel => {
@ -86,7 +87,7 @@ describe("Sales discounts for variant", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateTaxConfigurationForChannel({
channelSlug: defaultChannel.slug,
pricesEnteredWithTax: true,

View file

@ -46,7 +46,7 @@ describe("As an admin I want to update sales", () => {
before(() => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
deleteProductsStartsWith(startsWith);
deleteShippingStartsWith(startsWith);
deleteSalesStartsWith(startsWith);
@ -104,7 +104,7 @@ describe("As an admin I want to update sales", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateTaxConfigurationForChannel({
channelSlug: defaultChannel.slug,
pricesEnteredWithTax: true,

View file

@ -10,8 +10,11 @@ import {
addPayment,
createCheckoutWithVoucher,
} from "../../../support/api/utils/ordersUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import { updateTaxConfigurationForChannel } from "../../../support/api/utils/taxesUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import {
updateTaxConfigurationForChannel,
} from "../../../support/api/utils/taxesUtils";
import {
createVoucher,
discountOptions,
@ -30,7 +33,7 @@ describe("As an admin I want to create voucher", () => {
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createProductWithShipping({ name, productPrice, shippingPrice })
.then(
@ -63,7 +66,7 @@ describe("As an admin I want to create voucher", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateTaxConfigurationForChannel({
channelSlug: defaultChannel.slug,
pricesEnteredWithTax: true,

View file

@ -8,7 +8,8 @@ import {
addPayment,
createCheckoutWithVoucher,
} from "../../../support/api/utils/ordersUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import {
discountOptions,
loginAndCreateCheckoutForVoucherWithDiscount,
@ -26,7 +27,7 @@ describe("As an admin I want to create voucher", () => {
before(() => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createProductWithShipping({ name, productPrice, shippingPrice })
.then(

View file

@ -6,11 +6,21 @@ import faker from "faker";
import { VOUCHERS_SELECTORS } from "../../../elements/discounts/vouchers";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { voucherDetailsUrl } from "../../../fixtures/urlList";
import { createVoucherInChannel } from "../../../support/api/utils/discounts/vouchersUtils";
import { createCheckoutWithVoucher } from "../../../support/api/utils/ordersUtils";
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
import { updateTaxConfigurationForChannel } from "../../../support/api/utils/taxesUtils";
import { formatDate, formatTime } from "../../../support/formatData/formatDate";
import {
createVoucherInChannel,
} from "../../../support/api/utils/discounts/vouchersUtils";
import {
createCheckoutWithVoucher,
} from "../../../support/api/utils/ordersUtils";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import {
updateTaxConfigurationForChannel,
} from "../../../support/api/utils/taxesUtils";
import {
formatDate,
formatTime,
} from "../../../support/formatData/formatDate";
import { setVoucherDate } from "../../../support/pages/discounts/vouchersPage";
describe("As an admin I want to update vouchers", () => {
@ -26,7 +36,7 @@ describe("As an admin I want to update vouchers", () => {
before(() => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createProductWithShipping({ name, productPrice, shippingPrice })
.then(
@ -57,7 +67,7 @@ describe("As an admin I want to update vouchers", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateTaxConfigurationForChannel({
channelSlug: defaultChannel.slug,
pricesEnteredWithTax: true,

View file

@ -44,7 +44,7 @@ describe("As an admin I want to see correct information on dashboard home page",
let ordersRegexp;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createProductWithShipping({
name: randomName,
@ -140,7 +140,7 @@ describe("As an admin I want to see correct information on dashboard home page",
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -5,10 +5,6 @@ import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
import { urlList } from "../fixtures/urlList";
describe("User authorization", () => {
beforeEach(() => {
cy.clearSessionData();
});
it(
"should successfully log in an user",
{ tags: ["@login", "@allEnv", "@stable", "@oldRelease"] },

View file

@ -6,8 +6,13 @@ 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 {
createDraftOrder,
getOrder,
} from "../support/api/requests/Order";
import {
getProductMetadata,
} from "../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../support/api/utils/channelsUtils";
import {
createProductInChannel,
@ -22,7 +27,7 @@ describe("Test for metadata", () => {
let product;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel()
.then(channelResp => {
channel = channelResp;
@ -47,7 +52,7 @@ describe("Test for metadata", () => {
"should create metadata for product",
{ tags: ["@metadata", "@allEnv", "@stable"] },
() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateMetadata(product.id, metadata.key, metadata.value);
updatePrivateMetadata(product.id, metadata.key, metadata.value)
.then(() => {
@ -90,7 +95,7 @@ describe("Test for metadata", () => {
{ tags: ["@metadata", "@allEnv", "@stable"] },
() => {
let order;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createDraftOrder({ channelId: channel.id })
.then(orderResp => {
order = orderResp;

View file

@ -35,9 +35,6 @@ import {
} from "../support/pages/mainMenuPage";
describe("As a staff user I want to navigate through shop using different permissions", () => {
beforeEach(() => {
cy.clearSessionData();
});
it(
`should be able to navigate through shop as a staff member using DISCOUNTS permission. TC: SALEOR_3405a - sales list`,
{ tags: ["@allEnv", "@navigation", "@stable", "@oldRelease", "@critical"] },

View file

@ -3,9 +3,13 @@
import faker from "faker";
import { CHANNEL_FORM_SELECTORS } from "../../elements/channels/channel-form-selectors";
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 {
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";
@ -23,7 +27,7 @@ xdescribe("Channels in draft orders", () => {
let otherChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
channelsUtils
.getDefaultChannel()
.then(channel => {
@ -37,7 +41,7 @@ xdescribe("Channels in draft orders", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -19,7 +19,9 @@ import {
getDefaultChannel,
} from "../../support/api/utils/";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import { ensureCanvasStatic } from "../../support/customCommands/sharedElementsOperations/canvas";
import {
ensureCanvasStatic,
} from "../../support/customCommands/sharedElementsOperations/canvas";
import {
finalizeDraftOrder,
selectChannelInPicker,
@ -36,7 +38,7 @@ describe("Draft orders", () => {
let shippingMethod;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateOrdersSettings();
getDefaultChannel()
.then(channel => {
@ -94,7 +96,7 @@ describe("Draft orders", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -4,7 +4,9 @@
import faker from "faker";
import { createCheckout } from "../../support/api/requests/Checkout";
import { updateStockReservation } from "../../support/api/requests/ShopSettings";
import {
updateStockReservation,
} from "../../support/api/requests/ShopSettings";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import {
createProductInChannel,
@ -34,7 +36,7 @@ describe("As an admin I want to manage stock reservation", () => {
let dataForCheckout;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.fixture("addresses").then(addresses => {
address = addresses.usAddress;
@ -81,7 +83,7 @@ describe("As an admin I want to manage stock reservation", () => {
beforeEach(() => {
const productName = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createProductInChannel({
attributeId: attribute.id,

View file

@ -80,7 +80,7 @@ describe("Orders", () => {
privateMetadataValue + "- updated private metadata value";
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
updateOrdersSettings();
getDefaultChannel()
.then(channel => {
@ -148,10 +148,7 @@ describe("Orders", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.order,
);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.order);
});
it(

View file

@ -4,7 +4,10 @@
import faker from "faker";
import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
import { ONE_PERMISSION_USERS, urlList } from "../../fixtures";
import {
ONE_PERMISSION_USERS,
urlList,
} from "../../fixtures";
import {
createChannel,
createCustomer,
@ -34,7 +37,7 @@ describe("Orders", () => {
let taxClass;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createChannel({ name: randomName })
.then(channelResp => {
channel = channelResp;
@ -103,12 +106,10 @@ describe("Orders", () => {
});
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.order)
.then(() => {
// set notifiedAboutNavigator to make navigator banner gone from the start - banner was covering needed elements during test
window.localStorage.setItem("notifiedAboutNavigator", "true");
});
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.order).then(() => {
// set notifiedAboutNavigator to make navigator banner gone from the start - banner was covering needed elements during test
window.localStorage.setItem("notifiedAboutNavigator", "true");
});
});
it(

View file

@ -3,11 +3,18 @@
import faker from "faker";
import { PAGE_TYPE_DETAILS_SELECTORS } from "../../elements/pageTypes/pageTypeDetails";
import { PAGE_TYPES_LIST_SELECTORS } from "../../elements/pageTypes/pageTypesList";
import {
PAGE_TYPE_DETAILS_SELECTORS,
} from "../../elements/pageTypes/pageTypeDetails";
import {
PAGE_TYPES_LIST_SELECTORS,
} from "../../elements/pageTypes/pageTypesList";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { pageTypeDetailsUrl, urlList } from "../../fixtures/urlList";
import {
pageTypeDetailsUrl,
urlList,
} from "../../fixtures/urlList";
import { createAttribute } from "../../support/api/requests/Attribute";
import {
createPageType,
@ -18,7 +25,7 @@ describe("Tests for page types", () => {
const startsWith = "PageTypes";
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -37,7 +37,7 @@ describe("Tests for pages", () => {
};
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
attributeRequests
.createAttribute({ name, type: "PAGE_TYPE" })
.then(attributeResp => {
@ -51,7 +51,7 @@ describe("Tests for pages", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -3,7 +3,9 @@
import faker from "faker";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
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 { urlList } from "../../fixtures/urlList";
@ -52,14 +54,14 @@ describe("As an admin I should be able to create product", () => {
let attribute;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createAttribute({ name }).then(attributeResp => {
attribute = attributeResp;
cy.checkIfDataAreNotNull({ attribute });
});
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -1,12 +1,16 @@
/// <reference types="cypress"/>
/// <reference types="../../support"/>
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
import {
PRODUCT_DETAILS,
} from "../../elements/catalog/products/product-details";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import { demoProductsNames } from "../../fixtures/products";
import { productDetailsUrl } from "../../fixtures/urlList";
import { getFirstProducts } from "../../support/api/requests/Product";
import { deleteCollectionsStartsWith } from "../../support/api/utils/catalog/collectionsUtils";
import {
deleteCollectionsStartsWith,
} from "../../support/api/utils/catalog/collectionsUtils";
import {
createNewProductWithNewDataAndDefaultChannel,
deleteProductsStartsWith,
@ -14,7 +18,7 @@ import {
describe("Tests for images", () => {
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -5,12 +5,19 @@ import faker from "faker";
import { productDetailsUrl } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
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 productsUtils
from "../../../support/api/utils/products/productsUtils";
import * as shippingUtils from "../../../support/api/utils/shippingUtils";
import { isProductAvailableForPurchase } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import { updateProductIsAvailableForPurchase } from "../../../support/pages/catalog/products/productDetailsPage";
import {
isProductAvailableForPurchase,
} from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import {
updateProductIsAvailableForPurchase,
} from "../../../support/pages/catalog/products/productDetailsPage";
describe("Products available in listings", () => {
const startsWith = "CyAvailForPurchase-";
@ -22,7 +29,7 @@ describe("Products available in listings", () => {
let warehouse;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
shippingUtils.deleteShippingStartsWith(startsWith);
productsUtils.deleteProductsStartsWith(startsWith);
@ -65,10 +72,7 @@ describe("Products available in listings", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.product,
);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product);
});
it(

View file

@ -5,11 +5,18 @@ import faker from "faker";
import { productDetailsUrl } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
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 { updateProductPublish } from "../../../support/pages/catalog/products/productDetailsPage";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import {
isProductVisible,
} from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import {
updateProductPublish,
} from "../../../support/pages/catalog/products/productDetailsPage";
describe("Published products", () => {
const startsWith = "CyPublishedProducts-";
@ -20,7 +27,7 @@ describe("Published products", () => {
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createTypeAttributeAndCategoryForProduct({ name })
.then(
@ -47,10 +54,7 @@ describe("Published products", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.product,
);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product);
});
it(

View file

@ -6,9 +6,14 @@ 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 { updateProductVisibleInListings } from "../../../support/pages/catalog/products/productDetailsPage";
import * as productsUtils
from "../../../support/api/utils/products/productsUtils";
import {
isProductVisibleInSearchResult,
} from "../../../support/api/utils/storeFront/storeFrontProductUtils";
import {
updateProductVisibleInListings,
} from "../../../support/pages/catalog/products/productDetailsPage";
describe("Products displayed in listings", () => {
const startsWith = "CyVisibleInListings-";
@ -19,7 +24,7 @@ describe("Products displayed in listings", () => {
let defaultChannel;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productsUtils
.createTypeAttributeAndCategoryForProduct({ name })
.then(
@ -46,10 +51,7 @@ describe("Products displayed in listings", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.product,
);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product);
});
it(

View file

@ -2,15 +2,19 @@
/// <reference types="../../../support"/>
import { SHARED_ELEMENTS } from "../../../elements";
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import {
PRODUCTS_LIST,
} from "../../../elements/catalog/products/products-list";
import { LOCAL_STORAGE_FOR_COLUMN_PICKER } from "../../../fixtures";
import { urlList } from "../../../fixtures/urlList";
import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas";
import {
ensureCanvasStatic,
} from "../../../support/customCommands/sharedElementsOperations/canvas";
import { columnPickerPage } from "../../../support/pages";
describe("As an admin I should be able to use column picker", () => {
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -2,11 +2,19 @@
/// <reference types="../../../support"/>
import faker from "faker";
import { BUTTON_SELECTORS, PRODUCTS_LIST } from "../../../elements/";
import {
BUTTON_SELECTORS,
PRODUCTS_LIST,
} from "../../../elements/";
import { MESSAGES } from "../../../fixtures/";
import { urlList } from "../../../fixtures/urlList";
import { getDefaultChannel, productsUtils } from "../../../support/api/utils/";
import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas";
import {
getDefaultChannel,
productsUtils,
} from "../../../support/api/utils/";
import {
ensureCanvasStatic,
} from "../../../support/customCommands/sharedElementsOperations/canvas";
describe("Test for deleting products", () => {
const startsWith = "AABulkDeleteCypress";
@ -16,7 +24,7 @@ describe("Test for deleting products", () => {
let product;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel()
.then(channelResp => {
channel = channelResp;

View file

@ -32,7 +32,7 @@ describe("As an admin I should be able to filter products", () => {
let collection;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createTypeAttributeAndCategoryForProduct({ name }).then(
({
attribute: attributeResp,
@ -86,7 +86,7 @@ describe("As an admin I should be able to filter products", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest().visit(urlList.products);
cy.loginUserViaRequest().visit(urlList.products);
});
const filterProductsBy = [

View file

@ -2,13 +2,17 @@
/// <reference types="../../../support"/>
import { PAGINATION } from "../../../elements";
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import {
PRODUCTS_LIST,
} from "../../../elements/catalog/products/products-list";
import { urlList } from "../../../fixtures/urlList";
import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas";
import {
ensureCanvasStatic,
} from "../../../support/customCommands/sharedElementsOperations/canvas";
describe("As an admin I should be able to manage products table", () => {
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
cy.visit(urlList.products);
});

View file

@ -1,20 +1,10 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import {
PRODUCTS_LIST,
} from "../../../elements/catalog/products/products-list";
import {
PRESETS,
SEARCH,
} from "../../../elements/shared";
import {
LOCAL_STORAGE_KEYS,
urlList,
} from "../../../fixtures/";
import {
ensureCanvasStatic,
} from "../../../support/customCommands/sharedElementsOperations/canvas";
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import { PRESETS, SEARCH } from "../../../elements/shared";
import { LOCAL_STORAGE_KEYS, urlList } from "../../../fixtures/";
import { ensureCanvasStatic } from "../../../support/customCommands/sharedElementsOperations/canvas";
import {
addPresetWithName,
clickDeletePresetButton,
@ -29,7 +19,7 @@ import {
describe("As a user I should be able to save selected filters with search queries under the given name", () => {
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -1,6 +1,8 @@
/// <reference types="cypress"/>
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import {
PRODUCTS_LIST,
} from "../../../elements/catalog/products/products-list";
import { urlList } from "../../../fixtures/urlList";
import {
changeToDatagridView,
@ -9,12 +11,10 @@ import {
describe("As an user I should be able switch between product views", () => {
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest()
.then(() => {
// set notifiedAboutNavigator to make navigator banner gone from the start - banner was covering needed elements during test
window.localStorage.setItem("notifiedAboutNavigator", "true");
});
cy.loginUserViaRequest().then(() => {
// set notifiedAboutNavigator to make navigator banner gone from the start - banner was covering needed elements during test
window.localStorage.setItem("notifiedAboutNavigator", "true");
});
cy.visit(urlList.products);
});

View file

@ -1,7 +1,9 @@
/// <reference types="cypress"/>
/// <reference types="../../../support"/>
import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list";
import {
PRODUCTS_LIST,
} from "../../../elements/catalog/products/products-list";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { urlList } from "../../../fixtures/urlList";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
@ -16,15 +18,14 @@ describe.skip("As an admin I should be able to sort products", () => {
let defaultChannel;
beforeEach(() => {
cy.clearSessionData()
.loginUserViaRequest()
cy.loginUserViaRequest()
.visit(urlList.products)
.get(SHARED_ELEMENTS.header)
.should("be.visible");
});
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel().then(channel => {
defaultChannel = channel;
cy.checkIfDataAreNotNull({ defaultChannel });

View file

@ -3,7 +3,9 @@
import faker from "faker";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
import {
PRODUCT_DETAILS,
} from "../../elements/catalog/products/product-details";
import { urlList } from "../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
import { createChannel } from "../../support/api/requests/Channels";
@ -12,7 +14,9 @@ import {
updateChannelInProduct,
} from "../../support/api/requests/Product";
import * as productUtils from "../../support/api/utils/products/productsUtils";
import { getProductVariants } from "../../support/api/utils/storeFront/storeFrontProductUtils";
import {
getProductVariants,
} from "../../support/api/utils/storeFront/storeFrontProductUtils";
import {
addVariantToDataGrid,
enterVariantEditPage,
@ -36,7 +40,7 @@ describe("As an admin I should be able to create variant", () => {
before(() => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productUtils
.createShippingProductTypeAttributeAndCategory(name, attributeValues)
@ -63,10 +67,7 @@ describe("As an admin I should be able to create variant", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.product,
);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product);
});
it(

View file

@ -8,7 +8,10 @@ import {
PRODUCT_DETAILS,
PRODUCTS_LIST,
} from "../../../elements/";
import { ONE_PERMISSION_USERS, urlList } from "../../../fixtures/";
import {
ONE_PERMISSION_USERS,
urlList,
} from "../../../fixtures/";
import {
productsRequests,
productsTypeRequests,
@ -41,7 +44,7 @@ describe("Creating variants", () => {
let address;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
const name = `${startsWith}${faker.datatype.number()}`;
const simpleProductTypeName = `${startsWith}${faker.datatype.number()}`;
@ -97,10 +100,7 @@ describe("Creating variants", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.product,
);
cy.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product);
});
it(

View file

@ -3,7 +3,9 @@
import faker from "faker";
import { VARIANTS_SELECTORS } from "../../../elements/catalog/products/variants-selectors";
import {
VARIANTS_SELECTORS,
} from "../../../elements/catalog/products/variants-selectors";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import { productVariantDetailUrl } from "../../../fixtures/urlList";
@ -14,10 +16,15 @@ import {
updateChannelPriceInVariant,
} from "../../../support/api/requests/Product";
import { createTypeProduct } from "../../../support/api/requests/ProductType";
import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersUtils";
import * as productUtils from "../../../support/api/utils/products/productsUtils";
import {
createWaitingForCaptureOrder,
} from "../../../support/api/utils/ordersUtils";
import * as productUtils
from "../../../support/api/utils/products/productsUtils";
import * as shippingUtils from "../../../support/api/utils/shippingUtils";
import { deleteWarehouseStartsWith } from "../../../support/api/utils/warehouseUtils";
import {
deleteWarehouseStartsWith,
} from "../../../support/api/utils/warehouseUtils";
describe("Updating products without sku", () => {
const startsWith = "UpdateProductsSku";
@ -38,7 +45,7 @@ describe("Updating products without sku", () => {
const attributeValues = ["value1", "value2"];
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
productUtils.deleteProductsStartsWith(startsWith);
shippingUtils.deleteShippingStartsWith(startsWith);
deleteWarehouseStartsWith(startsWith);
@ -90,7 +97,7 @@ describe("Updating products without sku", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(
"should be able to add SKU to simple product TC: SALEOR_2802",

View file

@ -3,21 +3,29 @@
import faker from "faker";
import { PRODUCT_DETAILS } from "../../elements/catalog/products/product-details";
import {
PRODUCT_DETAILS,
} from "../../elements/catalog/products/product-details";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
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 {
getProductDetails,
} from "../../support/api/requests/storeFront/ProductDetails";
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
import { expectCorrectProductInformation } from "../../support/api/utils/products/checkProductInfo";
import {
expectCorrectProductInformation,
} from "../../support/api/utils/products/checkProductInfo";
import {
createProductInChannel,
createTypeAttributeAndCategoryForProduct,
} from "../../support/api/utils/products/productsUtils";
import { metadataForms } from "../../support/pages/catalog/metadataComponent";
import { fillUpCommonFieldsForAllProductTypes } from "../../support/pages/catalog/products/productDetailsPage";
import {
fillUpCommonFieldsForAllProductTypes,
} from "../../support/pages/catalog/products/productDetailsPage";
describe("Update products", () => {
const startsWith = "CyUpdateProducts-";
@ -30,7 +38,7 @@ describe("Update products", () => {
let attribute;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
getDefaultChannel()
.then(channel => {
defaultChannel = channel;

View file

@ -12,7 +12,11 @@ import {
STAFF_MEMBERS_LIST_SELECTORS,
} from "../elements/";
import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
import { MESSAGES, TEST_ADMIN_USER, urlList } from "../fixtures";
import {
MESSAGES,
TEST_ADMIN_USER,
urlList,
} from "../fixtures";
import { userDetailsUrl } from "../fixtures/urlList";
import {
activatePlugin,
@ -42,7 +46,7 @@ describe("Staff members", () => {
let user;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
activatePlugin({ id: "mirumee.notifications.admin_email" });
inviteStaffMemberWithFirstPermission({ email })
.then(({ user: userResp }) => {
@ -58,7 +62,7 @@ describe("Staff members", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -18,7 +18,7 @@ describe("As an admin I want to manage translations", () => {
let category;
before(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
createCategory({ name: startsWith, slug }).then(categoryResp => {
category = categoryResp;
cy.checkIfDataAreNotNull({ category });
@ -26,7 +26,7 @@ describe("As an admin I want to manage translations", () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest();
cy.loginUserViaRequest();
});
it(

View file

@ -47,6 +47,7 @@ Cypress.Commands.add(
"_saleorRefreshToken",
resp.body.data.tokenCreate.refreshToken,
);
window.localStorage.setItem("notifiedAboutNavigator", "true");
window.sessionStorage.setItem(
authorization,
resp.body.data.tokenCreate.token,

View file

@ -24,7 +24,9 @@ import {
SHARED_ELEMENTS,
} from "../elements";
import { urlList } from "../fixtures/urlList";
import { ensureCanvasStatic } from "../support/customCommands/sharedElementsOperations/canvas";
import {
ensureCanvasStatic,
} from "../support/customCommands/sharedElementsOperations/canvas";
import cypressGrep from "../support/cypress-grep/support";
commandTimings();