2021-01-19 21:17:49 +00:00
|
|
|
Cypress.Commands.add("createShippingRate", (name, shippingZone) => {
|
|
|
|
const mutation = `
|
|
|
|
mutation{
|
|
|
|
CreateShippingRate(input:{
|
|
|
|
maximumDeliveryDays: null
|
|
|
|
minimumDeliveryDays: null
|
|
|
|
name: "${name}"
|
|
|
|
shippingZone: "${shippingZone}"
|
|
|
|
type: "PRICE"
|
|
|
|
})
|
|
|
|
}
|
|
|
|
`;
|
2021-01-21 10:05:54 +00:00
|
|
|
return mutation;
|
2021-01-19 21:17:49 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
Cypress.Commands.add("createShippingZone", (name, country) => {
|
|
|
|
const mutation = `
|
|
|
|
mutation{
|
|
|
|
shippingZoneCreate(input:{
|
|
|
|
name: "${name}"
|
|
|
|
countries: "${country}"
|
|
|
|
}){
|
|
|
|
shippingZone{
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2021-01-21 10:05:54 +00:00
|
|
|
return mutation;
|
2021-01-19 21:17:49 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
Cypress.Commands.add("", (shippingRateId, channelId) => {
|
|
|
|
const mutation = `
|
|
|
|
mutation{
|
|
|
|
shippingMethodChannelListingUpdate(id:"${shippingRateId}", input:{
|
|
|
|
addChannels: {
|
|
|
|
channelId:"${channelId}"
|
|
|
|
}
|
|
|
|
}){
|
|
|
|
shippingMethod{
|
|
|
|
id
|
|
|
|
}
|
|
|
|
shippingErrors{
|
|
|
|
code
|
|
|
|
message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2021-01-21 10:05:54 +00:00
|
|
|
return mutation;
|
2021-01-19 21:17:49 +00:00
|
|
|
});
|