Fix cypress test for enable gift card (#2214)
* All specs has unique data * All specs has unique data
This commit is contained in:
parent
f058f4d01f
commit
2c57de07e4
19 changed files with 17 additions and 21 deletions
|
@ -26,7 +26,7 @@ import {
|
||||||
} from "../../../support/pages/catalog/giftCardPage";
|
} from "../../../support/pages/catalog/giftCardPage";
|
||||||
|
|
||||||
describe("As a admin I want to use enabled gift card in checkout", () => {
|
describe("As a admin I want to use enabled gift card in checkout", () => {
|
||||||
const startsWith = "GiftCardsCheckout";
|
const startsWith = "ActivateGiftCards";
|
||||||
const productPrice = 50;
|
const productPrice = 50;
|
||||||
const shippingPrice = 50;
|
const shippingPrice = 50;
|
||||||
const email = "example@example.com";
|
const email = "example@example.com";
|
||||||
|
@ -72,7 +72,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
||||||
|
|
||||||
it(
|
it(
|
||||||
"should be able to enable gift card and use it in checkout. TC: SALEOR_1006",
|
"should be able to enable gift card and use it in checkout. TC: SALEOR_1006",
|
||||||
{ tags: ["@giftCard", "@allEnv"] },
|
{ tags: ["@giftCard", "@allEnv", "@stable"] },
|
||||||
() => {
|
() => {
|
||||||
const expectedGiftCardBalance =
|
const expectedGiftCardBalance =
|
||||||
giftCardData.amount - productPrice - shippingPrice;
|
giftCardData.amount - productPrice - shippingPrice;
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
} from "../../../support/pages/catalog/giftCardPage";
|
} from "../../../support/pages/catalog/giftCardPage";
|
||||||
|
|
||||||
describe("As an admin I want to create gift card", () => {
|
describe("As an admin I want to create gift card", () => {
|
||||||
const startsWith = "GiftCards";
|
const startsWith = "CreateGCards";
|
||||||
const amount = 50;
|
const amount = 50;
|
||||||
const currency = "USD";
|
const currency = "USD";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { deleteGiftCardsWithTagStartsWith } from "../../../support/api/utils/cat
|
||||||
import { formatDate } from "../../../support/formatData/formatDate";
|
import { formatDate } from "../../../support/formatData/formatDate";
|
||||||
|
|
||||||
describe("As an admin I want to update gift card", () => {
|
describe("As an admin I want to update gift card", () => {
|
||||||
const startsWith = "GiftCards";
|
const startsWith = "updateGCard";
|
||||||
|
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.clearSessionData().loginUserViaRequest();
|
cy.clearSessionData().loginUserViaRequest();
|
||||||
|
|
|
@ -30,7 +30,7 @@ import {
|
||||||
} from "../../support/pages/warehousePage";
|
} from "../../support/pages/warehousePage";
|
||||||
|
|
||||||
describe("Warehouses in checkout", () => {
|
describe("Warehouses in checkout", () => {
|
||||||
const startsWith = `CyWarehouseCheckout`;
|
const startsWith = `clickAndCollect`;
|
||||||
let defaultChannel;
|
let defaultChannel;
|
||||||
let usAddress;
|
let usAddress;
|
||||||
let secondUsAddress;
|
let secondUsAddress;
|
||||||
|
|
|
@ -11,7 +11,6 @@ import {
|
||||||
createTypeAttributeAndCategoryForProduct,
|
createTypeAttributeAndCategoryForProduct,
|
||||||
deleteProductsStartsWith,
|
deleteProductsStartsWith,
|
||||||
} from "../../../support/api/utils/products/productsUtils";
|
} from "../../../support/api/utils/products/productsUtils";
|
||||||
import filterTests from "../../../support/filterTests";
|
|
||||||
import { enterAttributeAndChanegeIsFilterableInDashbord } from "../../../support/pages/attributesPage";
|
import { enterAttributeAndChanegeIsFilterableInDashbord } from "../../../support/pages/attributesPage";
|
||||||
import {
|
import {
|
||||||
enterProductListPage,
|
enterProductListPage,
|
||||||
|
|
|
@ -20,7 +20,6 @@ import { createWarehouse as createWarehouseViaApi } from "../../../support/api/r
|
||||||
import { deleteChannelsStartsWith } from "../../../support/api/utils/channelsUtils";
|
import { deleteChannelsStartsWith } from "../../../support/api/utils/channelsUtils";
|
||||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||||
import { deleteWarehouseStartsWith } from "../../../support/api/utils/warehouseUtils";
|
import { deleteWarehouseStartsWith } from "../../../support/api/utils/warehouseUtils";
|
||||||
import { returnValueDependsOnShopVersion } from "../../../support/formatData/dataDependingOnVersion";
|
|
||||||
import { createChannelByView } from "../../../support/pages/channelsPage";
|
import { createChannelByView } from "../../../support/pages/channelsPage";
|
||||||
|
|
||||||
describe("Channels", () => {
|
describe("Channels", () => {
|
||||||
|
|
|
@ -25,9 +25,9 @@ import {
|
||||||
} from "../../../support/api/utils/shippingUtils";
|
} from "../../../support/api/utils/shippingUtils";
|
||||||
|
|
||||||
describe("Adyen payments", () => {
|
describe("Adyen payments", () => {
|
||||||
const startsWith = "CyChannelInDraftOrders-";
|
const startsWith = "Adyen";
|
||||||
const name = startsWith + faker.datatype.number();
|
const name = startsWith + faker.datatype.number();
|
||||||
const email = `CyChannelInDraftOrders@example.com`;
|
const email = `example@example.com`;
|
||||||
|
|
||||||
let address;
|
let address;
|
||||||
let defaultChannel;
|
let defaultChannel;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||||
import { deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils";
|
import { deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils";
|
||||||
|
|
||||||
describe("As an admin I want to manage attributes in product types", () => {
|
describe("As an admin I want to manage attributes in product types", () => {
|
||||||
const startsWith = "productType";
|
const startsWith = "attrProdType";
|
||||||
let category;
|
let category;
|
||||||
let channel;
|
let channel;
|
||||||
let attribute;
|
let attribute;
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {
|
||||||
} from "../../../support/api/utils/products/productsUtils";
|
} from "../../../support/api/utils/products/productsUtils";
|
||||||
|
|
||||||
describe("As an admin I want to manage product types", () => {
|
describe("As an admin I want to manage product types", () => {
|
||||||
const startsWith = "productType";
|
const startsWith = "delProdType";
|
||||||
let category;
|
let category;
|
||||||
let channel;
|
let channel;
|
||||||
let attribute;
|
let attribute;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { fillUpShippingZoneData } from "../../../support/pages/shippingMethodPag
|
||||||
import { enterAndSelectShippings } from "../../../support/pages/shippingZones";
|
import { enterAndSelectShippings } from "../../../support/pages/shippingZones";
|
||||||
|
|
||||||
describe("As a user I should be able to update and delete shipping zone", () => {
|
describe("As a user I should be able to update and delete shipping zone", () => {
|
||||||
const startsWith = "EditShipping-";
|
const startsWith = "EditShippingZ-";
|
||||||
const name = `${startsWith}${faker.datatype.number()}`;
|
const name = `${startsWith}${faker.datatype.number()}`;
|
||||||
|
|
||||||
let defaultChannel;
|
let defaultChannel;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {
|
||||||
} from "../../../support/pages/shippingMethodPage";
|
} from "../../../support/pages/shippingMethodPage";
|
||||||
|
|
||||||
describe("As a user I want to create shipping method with postal codes", () => {
|
describe("As a user I want to create shipping method with postal codes", () => {
|
||||||
const startsWith = "CyShippingMethods-";
|
const startsWith = "postalCodes-";
|
||||||
const name = `${startsWith}${faker.datatype.number()}`;
|
const name = `${startsWith}${faker.datatype.number()}`;
|
||||||
|
|
||||||
const price = 10;
|
const price = 10;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {
|
||||||
} from "../../../../support/pages/shippingMethodPage";
|
} from "../../../../support/pages/shippingMethodPage";
|
||||||
|
|
||||||
describe("As a staff user I want to manage shipping weights", () => {
|
describe("As a staff user I want to manage shipping weights", () => {
|
||||||
const startsWith = "CyWeightRates-";
|
const startsWith = "weightsLimits";
|
||||||
const name = `${startsWith}${faker.datatype.number()}`;
|
const name = `${startsWith}${faker.datatype.number()}`;
|
||||||
|
|
||||||
const price = 10;
|
const price = 10;
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {
|
||||||
} from "../../support/pages/discounts/salesPage";
|
} from "../../support/pages/discounts/salesPage";
|
||||||
|
|
||||||
xdescribe("Sales discounts for products", () => {
|
xdescribe("Sales discounts for products", () => {
|
||||||
const startsWith = "CySales-";
|
const startsWith = "SalesProd-";
|
||||||
|
|
||||||
let productType;
|
let productType;
|
||||||
let attribute;
|
let attribute;
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
} from "../../support/pages/discounts/salesPage";
|
} from "../../support/pages/discounts/salesPage";
|
||||||
|
|
||||||
xdescribe("Sales discounts for variant", () => {
|
xdescribe("Sales discounts for variant", () => {
|
||||||
const startsWith = "CySales-";
|
const startsWith = "SalesVar-";
|
||||||
|
|
||||||
let productType;
|
let productType;
|
||||||
let attribute;
|
let attribute;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {
|
||||||
} from "../../../support/pages/discounts/vouchersPage";
|
} from "../../../support/pages/discounts/vouchersPage";
|
||||||
|
|
||||||
describe("As an admin I want to create voucher", () => {
|
describe("As an admin I want to create voucher", () => {
|
||||||
const startsWith = "CyVou-";
|
const startsWith = "CyVouLimit-";
|
||||||
const productPrice = 100;
|
const productPrice = 100;
|
||||||
const shippingPrice = 100;
|
const shippingPrice = 100;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { formatDate, formatTime } from "../../../support/formatData/formatDate";
|
||||||
import { setVoucherDate } from "../../../support/pages/discounts/vouchersPage";
|
import { setVoucherDate } from "../../../support/pages/discounts/vouchersPage";
|
||||||
|
|
||||||
describe("As an admin I want to update vouchers", () => {
|
describe("As an admin I want to update vouchers", () => {
|
||||||
const startsWith = "CyVou-";
|
const startsWith = "UpdateVou-";
|
||||||
const productPrice = 100;
|
const productPrice = 100;
|
||||||
const shippingPrice = 100;
|
const shippingPrice = 100;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
|
import { LOGIN_SELECTORS } from "../elements/account/login-selectors";
|
||||||
import { urlList } from "../fixtures/urlList";
|
import { urlList } from "../fixtures/urlList";
|
||||||
import filterTests from "../support/filterTests";
|
|
||||||
|
|
||||||
describe("User authorization", () => {
|
describe("User authorization", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import {
|
||||||
import { selectChannelInDetailsPages } from "../../../support/pages/channelsPage";
|
import { selectChannelInDetailsPages } from "../../../support/pages/channelsPage";
|
||||||
|
|
||||||
describe("Creating variants", () => {
|
describe("Creating variants", () => {
|
||||||
const startsWith = "CyCreateVariants-";
|
const startsWith = "CreateProdSku";
|
||||||
const attributeValues = ["value1", "value2"];
|
const attributeValues = ["value1", "value2"];
|
||||||
|
|
||||||
let defaultChannel;
|
let defaultChannel;
|
||||||
|
|
|
@ -14,7 +14,6 @@ import { updateTranslationToCategory } from "../support/pages/translationsPage";
|
||||||
xdescribe("As an admin I want to manage translations", () => {
|
xdescribe("As an admin I want to manage translations", () => {
|
||||||
const startsWith = "TestTranslations";
|
const startsWith = "TestTranslations";
|
||||||
const randomNumber = faker.datatype.number();
|
const randomNumber = faker.datatype.number();
|
||||||
const name = `${startsWith}${randomNumber}`;
|
|
||||||
|
|
||||||
let category;
|
let category;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue