Commit 39062aba authored by Alexandros Georgantas's avatar Alexandros Georgantas

test(app): init cypress tasks

parent 7bba7224
describe('Dashboard', async () => {
describe('Dashboard', () => {
beforeEach(() => {
cy.task('seed:createBooksWithUsersAndTeams')
})
it('shows dashboard', () => {
cy.login('author')
cy.visit('/books')
......
......@@ -10,8 +10,14 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
const createBooksWithUsersAndTeams = require('../../scripts/createBooksWithUsersAndTeams')
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
on('task', {
'seed:createBooksWithUsersAndTeams': async () => {
return createBooksWithUsersAndTeams()
},
})
}
......@@ -242,5 +242,5 @@ const createBooksWithUsersAndTeams = async () => {
throw new Error(e)
}
}
createBooksWithUsersAndTeams()
module.exports = createBooksWithUsersAndTeams
// createBooksWithUsersAndTeams()/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment