From 8e3c2a3b66cfc8b700fd4761b7574eccd1a3cb0d Mon Sep 17 00:00:00 2001 From: Dominik Biedebach Date: Fri, 13 May 2022 16:27:55 +0200 Subject: [PATCH] test: fix images test in react and collaboration annotation test --- demos/src/Examples/Images/React/index.spec.js | 5 +---- demos/src/Examples/Images/Vue/index.spec.js | 2 +- .../Experiments/CollaborationAnnotation/Vue/index.spec.js | 2 ++ tests/cypress.json | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/demos/src/Examples/Images/React/index.spec.js b/demos/src/Examples/Images/React/index.spec.js index 97567193..0716a8f0 100644 --- a/demos/src/Examples/Images/React/index.spec.js +++ b/demos/src/Examples/Images/React/index.spec.js @@ -17,10 +17,7 @@ context('/src/Examples/Images/React/', () => { it('allows images to be added via URL', () => { 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('button').contains('add image from URL').click({ force: false }) cy.get('.ProseMirror img').should('have.length', 3) }) }) diff --git a/demos/src/Examples/Images/Vue/index.spec.js b/demos/src/Examples/Images/Vue/index.spec.js index 6e8e554c..6fb20eed 100644 --- a/demos/src/Examples/Images/Vue/index.spec.js +++ b/demos/src/Examples/Images/Vue/index.spec.js @@ -20,7 +20,7 @@ context('/src/Examples/Images/Vue/', () => { cy.stub(win, 'prompt').returns('https://unsplash.it/250/250') cy.wait(1000) - cy.get('button').contains('add image from URL').click() + cy.get('button').contains('add image from URL').click({ force: false }) cy.wait(1000) cy.get('.ProseMirror img').should('have.length', 3) }) diff --git a/demos/src/Experiments/CollaborationAnnotation/Vue/index.spec.js b/demos/src/Experiments/CollaborationAnnotation/Vue/index.spec.js index 52e530f4..43d29590 100644 --- a/demos/src/Experiments/CollaborationAnnotation/Vue/index.spec.js +++ b/demos/src/Experiments/CollaborationAnnotation/Vue/index.spec.js @@ -40,6 +40,7 @@ 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('.editor-1 .ProseMirror').find('.annotation').click() cy.get('.comment').should('exist').contains('This is a test comment') cy.get('button').contains('update').click() cy.wait(1000) @@ -54,6 +55,7 @@ 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('.editor-1 .ProseMirror').find('.annotation').click() cy.get('.comment').should('exist').contains('This is a test comment') cy.get('button').contains('remove').click() cy.get('.ProseMirror .annotation').should('not.exist') diff --git a/tests/cypress.json b/tests/cypress.json index 1eeb7a07..9ca28255 100644 --- a/tests/cypress.json +++ b/tests/cypress.json @@ -2,5 +2,5 @@ "baseUrl": "http://localhost:3000", "integrationFolder": "../", "testFiles": "{demos,tests}/**/*.spec.{js,ts}", - "defaultCommandTimeout": 5000 + "defaultCommandTimeout": 15000 }