
* 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
19 lines
488 B
JavaScript
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;
|
|
});
|
|
});
|