fix test for home page analitics (#2216)

This commit is contained in:
Karolina Rakoczy 2022-08-24 10:58:17 +02:00 committed by GitHub
parent df55dba571
commit fefaeb00a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,13 +6,14 @@ import faker from "faker";
import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors";
import { urlList } from "../../fixtures/urlList";
import { createCustomer } from "../../support/api/requests/Customer";
import { deleteChannelsStartsWith } from "../../support/api/utils/channelsUtils";
import * as homePageUtils from "../../support/api/utils/homePageUtils";
import {
createReadyToFulfillOrder,
createWaitingForCaptureOrder,
} from "../../support/api/utils/ordersUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import filterTests from "../../support/filterTests";
import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils";
import {
changeChannel,
getOrdersReadyForCaptureRegex,
@ -46,6 +47,9 @@ describe("As an admin I want to see correct information on dashboard home page",
before(() => {
cy.clearSessionData().loginUserViaRequest();
productsUtils.deleteProductsStartsWith(startsWith);
deleteShippingStartsWith(startsWith);
deleteChannelsStartsWith(startsWith);
productsUtils
.createProductWithShipping({
@ -98,7 +102,7 @@ describe("As an admin I want to see correct information on dashboard home page",
homePageUtils.getSalesAmount(defaultChannel.slug).then(salesAmount => {
salesAmountRegexp = getSalesAmountRegex(
salesAmount,
productPrice * 2 + shippingPrice,
(productPrice + shippingPrice) * 2,
);
});