From 6579b502fd5717e5caa25c42b762529520026cec Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 25 Aug 2020 19:28:27 +0200 Subject: [PATCH] fix(e2e): wait for editor before running tests (#39465) --- cypress/integration/learn/challenges/output.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cypress/integration/learn/challenges/output.js b/cypress/integration/learn/challenges/output.js index 03fb0934ca..a9750685f7 100644 --- a/cypress/integration/learn/challenges/output.js +++ b/cypress/integration/learn/challenges/output.js @@ -2,6 +2,7 @@ const selectors = { defaultOutput: '.output-text', + editor: '.monaco-editor', hotkeys: '.default-layout > div', runTestsButton: 'button:contains("Run the Tests")' }; @@ -38,6 +39,8 @@ describe('Classic challenge', function() { it('shows test output when the tests are run', () => { cy.visit(locations.index); + // first wait for the editor to load + cy.get(selectors.editor, { timeout: 10000 }); cy.get(selectors.runTestsButton) .click() .then(() => { @@ -49,6 +52,8 @@ describe('Classic challenge', function() { it('shows test output when the tests are triggered by the keyboard', () => { cy.visit(locations.index); + // first wait for the editor to load + cy.get(selectors.editor, { timeout: 10000 }); cy.get(selectors.hotkeys) .focus() .type('{ctrl}{enter}')