Skip to content

Instantly share code, notes, and snippets.

View Samueldhardy's full-sized avatar

Samuel David Hardy Samueldhardy

View GitHub Profile
integration_tests:
<<: *defaults
docker:
## docker image file for cypress
- image: cypress/base:8
environment:
## this enables colors in the output
TERM: xterm
steps:
- attach_workspace:
@Samueldhardy
Samueldhardy / cypress-test-example.js
Created October 29, 2018 12:25
cypress/test/test.spec.js
describe('query: GetFoobar()', () => {
const GetFoobar = (foo, bar) => `{
foo(foo: ${foo}, bar: ${bar}) {
id
foobar {
foo
bar
}
}
}`;
@Samueldhardy
Samueldhardy / cypress-commands-index-example.js
Created October 29, 2018 12:16
cypress/commands/index.js
// --------------------------------------
// Log in and return auth token.
// --------------------------------------
Cypress.Commands.add('login', () => {
const apiLoginRoot = Cypress.env('API_LOGIN_ROOT');
const body = {
email,
password,
};
@Samueldhardy
Samueldhardy / cypress-plugins-index-example.js
Last active October 29, 2018 13:47
cypress/plugins/index.js
module.exports = (on, config) => {
config.baseUrl = process.env.API_ROOT;
config.env.API_LOGIN_ROOT = process.env.API_LOGIN_ROOT;
config.env.GQL_SERVER_ROOT = process.env.GQL_SERVER_ROOT;
return config;
};