Skip to content

Instantly share code, notes, and snippets.

@cybrox
Created March 20, 2019 15:36
Show Gist options
  • Save cybrox/9a556cbef21e9dc80af55d34ca819e22 to your computer and use it in GitHub Desktop.
Save cybrox/9a556cbef21e9dc80af55d34ca819e22 to your computer and use it in GitHub Desktop.
phx-ete7.js
Cypress.Commands.add("resetdb", () => {
cy.exec('docker-compose run myapp mix do ecto.drop, ecto.create, ecto.migrate')
})
Cypress.Commands.add("checkoutdb", () => {
cy.request('POST', '/api/end-to-end/db/checkout').as('checkoutDb')
})
Cypress.Commands.add("checkindb", () => {
cy.request('POST', '/api/end-to-end/db/checkin').as('checkinDb')
})
Cypress.Commands.add("factorydb", (schema, attrs) => {
cy.log(`Creating a ${schema} via fullstack factory`)
cy.request('POST', '/api/end-to-end/db/factory', {
schema: schema,
attributes: attrs
}).as('factoryDb')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment