saleor-dashboard/cypress/support/customCommands/basicOperations/index.js
Karolina Rakoczy 2407ae6f76
gift cards in checkout (#1376)
* gift cards in checkout

* complete checkout after trying to add gift card

* fix gift cards tests

* fix gift cards

* update snapshots

* fix tests

* fix gift cards in checkout

* delete created channels
2021-09-29 15:24:47 +02:00

19 lines
488 B
JavaScript

Cypress.Commands.add("getTextFromElement", element =>
cy.get(element).invoke("text")
);
Cypress.Commands.add("clearAndType", { prevSubject: true }, (subject, text) => {
cy.wrap(subject)
.clear()
.type(text);
});
Cypress.Commands.add("waitForRequestAndCheckIfNoErrors", alias => {
cy.wait(alias).then(resp => {
expect(
resp.response.body.errors,
`There are errors in ${alias} operation in graphql response`
).to.be.undefined;
return resp;
});
});