improve tests

This commit is contained in:
Nolan Lawson 2018-02-18 17:54:38 -08:00
parent 014f23887f
commit cad7f98e37
4 changed files with 6 additions and 0 deletions

View file

@ -1,6 +1,7 @@
describe('Basic spec', () => {
beforeEach(() => {
cy.visit('/')
cy.wait(500)
})
it('has the correct <h1>', () => {

View file

@ -1,6 +1,7 @@
describe('Login spec', () => {
beforeEach(() => {
cy.visit('/')
cy.wait(500)
})
it('Cannot log in to a fake instance', () => {
@ -24,6 +25,7 @@ describe('Login spec', () => {
it('Logs out', () => {
cy.login('foobar@localhost:3000', 'foobarfoobar')
cy.wait(500)
cy.get('nav a[aria-label=Settings]').click()
cy.get('a').contains('Instances').click()
cy.get('a').contains('localhost:3000').click()

View file

@ -4,6 +4,7 @@ describe('Basic timeline spec', () => {
beforeEach(() => {
cy.login('foobar@localhost:3000', 'foobarfoobar')
cy.visit('/')
cy.wait(500)
})
const homeTimeline = [

View file

@ -33,8 +33,10 @@ Cypress.Commands.add('login', (email, password) => {
})
cy.visit('/settings/instances/add')
cy.wait(500)
cy.get('#instanceInput').clear().type('localhost:3000')
cy.get('.add-new-instance').submit()
cy.wait(500)
cy.url().should('equal', 'http://localhost:3000/auth/sign_in')
cy.get('input#user_email').should('exist')
cy.get('input#user_password').should('exist')