2021-09-27 10:04:21 +00:00
|
|
|
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 => {
|
2021-09-29 13:24:47 +00:00
|
|
|
expect(
|
|
|
|
resp.response.body.errors,
|
2021-12-05 15:03:04 +00:00
|
|
|
`No errors in ${alias} operation in graphql response`
|
2021-09-29 13:24:47 +00:00
|
|
|
).to.be.undefined;
|
2021-09-27 10:04:21 +00:00
|
|
|
return resp;
|
|
|
|
});
|
|
|
|
});
|