
* fix failing tests * skip test for variant * skip failing test * uncomment tests for fixed bugs * fix test.yaml
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);
|
|
}
|