Fix cancel fulfillment test (#2169)

* Fix test for cancel fulfillment

* add TC numbers
This commit is contained in:
Karolina Rakoczy 2022-07-18 14:00:24 +03:00 committed by GitHub
parent 1879d0cfb3
commit 683527ebe9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,7 @@ describe("Orders", () => {
}); });
xit( xit(
"should create order with selected channel", "should create order with selected channel. TC: SALEOR_2104",
{ tags: ["@orders", "@allEnv"] }, { tags: ["@orders", "@allEnv"] },
() => { () => {
cy.visit(urlList.orders) cy.visit(urlList.orders)
@ -124,7 +124,7 @@ describe("Orders", () => {
); );
it( it(
"should not be possible to change channel in order", "should not be possible to change channel in order. TC: SALEOR_2105",
{ tags: ["@orders", "@allEnv", "@stable"] }, { tags: ["@orders", "@allEnv", "@stable"] },
() => { () => {
createOrder({ createOrder({
@ -143,42 +143,47 @@ describe("Orders", () => {
}, },
); );
it("should cancel fulfillment", { tags: ["@orders", "@allEnv"] }, () => { it(
let order; "should cancel fulfillment. TC: SALEOR_2106",
createFulfilledOrder({ { tags: ["@orders", "@allEnv"] },
customerId: customer.id, () => {
channelId: defaultChannel.id, let order;
shippingMethodId: shippingMethod.id, createFulfilledOrder({
variantsList, customerId: customer.id,
address, channelId: defaultChannel.id,
warehouse: warehouse.id, shippingMethodId: shippingMethod.id,
}) variantsList,
.then(({ order: orderResp }) => { address,
order = orderResp; warehouse: warehouse.id,
cy.visit(urlList.orders);
cy.expectSkeletonIsVisible();
cy.contains(ORDERS_SELECTORS.orderRow, order.number).click();
cy.get(SHARED_ELEMENTS.skeleton)
.should("not.exist")
.get(ORDERS_SELECTORS.cancelFulfillment)
.click()
.fillAutocompleteSelect(
ORDERS_SELECTORS.cancelFulfillmentSelectField,
warehouse.name,
)
.addAliasToGraphRequest("OrderFulfillmentCancel")
.get(BUTTON_SELECTORS.submit)
.click()
.waitForRequestAndCheckIfNoErrors("@OrderFulfillmentCancel");
getOrder(order.id);
}) })
.then(orderResp => { .then(({ order: orderResp }) => {
expect(orderResp.status).to.be.eq("UNFULFILLED"); order = orderResp;
}); cy.visit(urlList.orders);
}); cy.expectSkeletonIsVisible();
cy.contains(ORDERS_SELECTORS.orderRow, order.number).click();
cy.get(SHARED_ELEMENTS.skeleton)
.should("not.exist")
.get(ORDERS_SELECTORS.cancelFulfillment)
.click()
.get(ORDERS_SELECTORS.cancelFulfillmentSelectField)
.click()
.get(BUTTON_SELECTORS.selectOption)
.first()
.click()
.addAliasToGraphRequest("OrderFulfillmentCancel")
.get(BUTTON_SELECTORS.submit)
.click()
.waitForRequestAndCheckIfNoErrors("@OrderFulfillmentCancel");
getOrder(order.id);
})
.then(orderResp => {
expect(orderResp.status).to.be.eq("UNFULFILLED");
});
},
);
it( it(
"should make a refund", "should make a refund. TC: 2107",
{ tags: ["@orders", "@allEnv", "@stable"] }, { tags: ["@orders", "@allEnv", "@stable"] },
() => { () => {
let order; let order;