describe('The home page', () => { beforeEach(() => { cy.exec('npm run db:seed') }) afterEach(() => { cy.exec('npm run db:wipe') }) it('displays heading', () => { cy.visit('/home') cy.get('h1').should('contain', 'Home') }) it('displays texts from api', () => { cy.intercept('GET', '/api/texts').as('getTexts') cy.visit('/home') cy.wait('@getTexts') cy.get('#texts-list').should('contain', 'Tanach') }) })