saleor-dashboard/cypress/support/customCommands/basicOperations/index.js
Karolina Rakoczy b7da933bf2
Add tests for preorders- threshold and stocks (#1567)
* tests for preorder, stoks an threshold

* fix tests for ordering products in channel threshold
2021-12-05 16:03:04 +01:00

19 lines
481 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,
`No errors in ${alias} operation in graphql response`
).to.be.undefined;
return resp;
});
});