Skip to content

Instantly share code, notes, and snippets.

@cybrox
Created March 20, 2019 15:35
Show Gist options
  • Save cybrox/6c800ca75b3caa590d5894cf330d611f to your computer and use it in GitHub Desktop.
Save cybrox/6c800ca75b3caa590d5894cf330d611f to your computer and use it in GitHub Desktop.
phx-ete6.js
before(() => {
// Before we run any tests, we reset our database.
// We also check back in any open database connection. If you save a
// test file, cypress will re-run the tests, not finishing the ones it
// is currently running, so we might end up with a checked-out connection
// lying around and blocking our database reset.
cy.checkindb()
cy.resetdb()
})
beforeEach(() => {
// Before each test, we check out a database connection
cy.checkoutdb()
})
afterEach(() => {
// After each test, we check the database connection back in
cy.checkindb()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment