saleor-dashboard/cypress/utils/homePageUtils.js
Jakub Majorek a83a245654
Drop deprecated fields (#1071)
* Drop deprecated fields

* Update changelog

* Update test recordings

* Fix e2e tests

* Fix product sorting (#1079)

* update stories

Co-authored-by: Karolina Rakoczy <rakoczy.karolina@gmail.com>
2021-04-26 09:49:55 +02:00

30 lines
947 B
JavaScript

import * as homePage from "../apiRequests/HomePage";
import { getDatePeriod } from "./misc";
export function getOrdersReadyToFulfill(channelSlug) {
return homePage
.getOrdersWithStatus("READY_TO_FULFILL", channelSlug)
.its("body.data.orders.totalCount");
}
export function getOrdersReadyForCapture(channelSlug) {
return homePage
.getOrdersWithStatus("READY_TO_CAPTURE", channelSlug)
.its("body.data.orders.totalCount");
}
export function getProductsOutOfStock(channelSlug) {
return homePage
.getProductsOutOfStock(channelSlug)
.its("body.data.products.totalCount");
}
export function getSalesAmount(channelSlug) {
return homePage
.getSalesForChannel(channelSlug, "TODAY")
.its("body.data.ordersTotal.gross.amount");
}
export function getTodaysOrders(channelSlug) {
const today = getDatePeriod(1);
return homePage
.getOrdersForChannel(channelSlug, today)
.its("body.data.orders.totalCount");
}