test: fix broken tests & change inactive time for cypress

This commit is contained in:
Dominik Biedebach 2022-05-13 14:34:53 +02:00 committed by Dominik
parent 7d25030e80
commit 483468df66
6 changed files with 17 additions and 17 deletions

View File

@ -4,19 +4,17 @@ context('/src/Examples/CollaborativeEditing/React/', () => {
})
it('should show the current room with participants', () => {
cy.get('.editor__status').then(status => {
status.should('contain', 'rooms.')
status.should('contain', 'users online')
})
cy.wait(3000)
cy.get('.editor__status')
.should('contain', 'rooms.')
.should('contain', 'users online')
})
it('should allow user to change name', () => {
cy.window().then(win => {
cy.wait(5000)
cy.stub(win, 'prompt').returns('John Doe')
cy.get('.editor__name > button').click()
cy.wait(1000)
cy.wait(3000)
cy.get('.editor__name').should('contain', 'John Doe')
})

View File

@ -4,21 +4,18 @@ context('/src/Examples/CollaborativeEditing/Vue/', () => {
})
it('should show the current room with participants', () => {
cy.get('.editor__status').then(status => {
status.should('contain', 'rooms.')
status.should('contain', 'users online')
})
cy.wait(3000)
cy.get('.editor__status')
.should('contain', 'rooms.')
.should('contain', 'users online')
})
it('should allow user to change name', () => {
cy.window().then(win => {
cy.wait(5000)
cy.stub(win, 'prompt').returns('John Doe')
cy.get('.editor__name > button').click()
cy.wait(1000)
cy.wait(3000)
cy.get('.editor__name').should('contain', 'John Doe')
})
})
})

View File

@ -3,7 +3,6 @@ context('/src/Examples/Images/React/', () => {
cy.visit('/src/Examples/Images/React/')
})
// TODO: Write tests
it('finds image elements inside editor', () => {
cy.get('.ProseMirror img').should('have.length', 2)
})
@ -19,6 +18,7 @@ context('/src/Examples/Images/React/', () => {
cy.window().then(win => {
cy.stub(win, 'prompt').returns('https://unsplash.it/250/250')
cy.wait(1000)
cy.get('button').contains('add image from URL').click()
cy.wait(1000)
cy.get('.ProseMirror img').should('have.length', 3)

View File

@ -19,6 +19,7 @@ context('/src/Examples/Images/Vue/', () => {
cy.window().then(win => {
cy.stub(win, 'prompt').returns('https://unsplash.it/250/250')
cy.wait(1000)
cy.get('button').contains('add image from URL').click()
cy.wait(1000)
cy.get('.ProseMirror img').should('have.length', 3)

View File

@ -39,8 +39,10 @@ context('/src/Experiments/CollaborationAnnotation/Vue/', () => {
cy.get('.editor-1 .ProseMirror').type('{selectall}{backspace}Hello world{selectall}')
cy.get('button').contains('comment').eq(0).click()
cy.wait(1000)
cy.get('.comment').should('exist').contains('This is a test comment')
cy.get('button').contains('update').click()
cy.wait(1000)
cy.get('.comment').should('exist').contains('This is the new comment')
})
})
@ -51,9 +53,11 @@ context('/src/Experiments/CollaborationAnnotation/Vue/', () => {
cy.get('.editor-1 .ProseMirror').type('{selectall}{backspace}Hello world{selectall}')
cy.get('button').contains('comment').eq(0).click()
cy.wait(1000)
cy.get('.comment').should('exist').contains('This is a test comment')
cy.get('button').contains('remove').click()
cy.get('.ProseMirror .annotation').should('not.exist')
cy.wait(1000)
cy.get('.comment').should('not.exist')
})
})

View File

@ -2,5 +2,5 @@
"baseUrl": "http://localhost:3000",
"integrationFolder": "../",
"testFiles": "{demos,tests}/**/*.spec.{js,ts}",
"defaultCommandTimeout": 50000
"defaultCommandTimeout": 5000
}