test: fix for transaction orders test - set local storage to hide navigator banner (#3649)

This commit is contained in:
wojteknowacki 2023-05-15 14:14:40 +02:00 committed by GitHub
parent 0d690ff414
commit dc45c3d090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -114,10 +114,12 @@ describe("Orders", () => {
}); });
beforeEach(() => { beforeEach(() => {
cy.clearSessionData().loginUserViaRequest( cy.clearSessionData()
"auth", .loginUserViaRequest("auth", ONE_PERMISSION_USERS.order)
ONE_PERMISSION_USERS.order, .then(() => {
); // set notifiedAboutNavigator to make navigator banner gone from the start - banner was covering needed elements during test
window.localStorage.setItem("notifiedAboutNavigator", "true");
});
}); });
it( it(

View file

@ -3,6 +3,7 @@ import {
ORDER_GRANT_REFUND, ORDER_GRANT_REFUND,
ORDER_TRANSACTION_CREATE, ORDER_TRANSACTION_CREATE,
ORDERS_SELECTORS, ORDERS_SELECTORS,
SHARED_ELEMENTS,
} from "../../elements"; } from "../../elements";
export function markAsPaidOrderWithRefNumber(transactionNumber) { export function markAsPaidOrderWithRefNumber(transactionNumber) {
@ -34,6 +35,8 @@ export function grantRefundAllProductsAndShippingWithReason(
clickMaxQuantityButton(); clickMaxQuantityButton();
typeRefundReason(refundReason); typeRefundReason(refundReason);
clickRefundShippingCheckbox(); clickRefundShippingCheckbox();
// this check makes sure no banner covers apply button which was making this action flaky
cy.get(SHARED_ELEMENTS.notificationMessage).should("not.exist");
clickApplyRefundButton(); clickApplyRefundButton();
cy.get(ORDER_GRANT_REFUND.refundAmountInput).should("contain.value", total); cy.get(ORDER_GRANT_REFUND.refundAmountInput).should("contain.value", total);
clickConfirmRefundButton(); clickConfirmRefundButton();