
* reference type cypress working * refactor * remove screenshots * add reference * add slash marker * run tests based on shop version * fix run tests based on shop version * fix run tests based on shop version * change base url to localhost * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix yml * fix yml * chage file names * fix files names * fix broken imports add checking for errors in grpah responses * fix broken imports add checking for errors in grpah responses * update jest * fix snapshot
34 lines
946 B
JavaScript
34 lines
946 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);
|
|
}
|