Created
March 20, 2019 15:36
-
-
Save cybrox/9a556cbef21e9dc80af55d34ca819e22 to your computer and use it in GitHub Desktop.
phx-ete7.js
This file contains hidden or 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
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