
* 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>
34 lines
947 B
JavaScript
34 lines
947 B
JavaScript
export function getSalesForChannel(channelSlug, period) {
|
|
const query = `query{
|
|
ordersTotal(period: ${period}, channel:"${channelSlug}"){
|
|
gross{
|
|
amount
|
|
}
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(query);
|
|
}
|
|
export function getOrdersForChannel(channelSlug, { gte, lte }) {
|
|
const query = `query{
|
|
orders(filter: { created: { gte: "${gte}", lte: "${lte}" } }, channel:"${channelSlug}"){
|
|
totalCount
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(query);
|
|
}
|
|
export function getOrdersWithStatus(status, channelSlug) {
|
|
const query = `query{
|
|
orders(filter: { status: ${status} }, channel:"${channelSlug}"){
|
|
totalCount
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(query);
|
|
}
|
|
export function getProductsOutOfStock(channelSlug) {
|
|
const query = `query{
|
|
products(filter: { stockAvailability: OUT_OF_STOCK, channel:"${channelSlug}" }){
|
|
totalCount
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(query);
|
|
}
|