Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
declare global {
namespace Cypress {
interface Chainable<Subject> {
createFooBar: () => Chainable<string>;
}
}
}
/**
* Creates a foo and returns a bar.
*/
Cypress.Commands.add("createFooBar", () => {
cy.getCookie("token").then((token: any) => {
return graphQLClient
.request(print(CREATE_FOO), {
token: token.value,
fooName: "IAM A FOO",
input: {}
})
.then(results => {
return results.mutator.createFoo.bar;
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.