Created
December 16, 2019 14:21
-
-
Save aleccool213/5df73bab0eff93f4be583178e32a6554 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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