From ccd3adb6affddfa13f862b2ce5c0e057644d0bcf Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 2 Nov 2020 14:58:11 +0100 Subject: [PATCH] Fixed failing e2e tests --- apps/remix-ide-e2e/src/tests/editor.test.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/editor.test.ts b/apps/remix-ide-e2e/src/tests/editor.test.ts index 928ab7f4ce..8ac886a3ad 100644 --- a/apps/remix-ide-e2e/src/tests/editor.test.ts +++ b/apps/remix-ide-e2e/src/tests/editor.test.ts @@ -77,7 +77,10 @@ module.exports = { }, 'Should highlight source code': function (browser: NightwatchBrowser) { + // include all files here because switching between plugins in side-panel removes highlight browser.addFile('sourcehighlight.js', sourcehighlightScript) + .addFile('removeSourcehighlightScript.js', removeSourcehighlightScript) + .addFile('removeAllSourcehighlightScript.js', removeAllSourcehighlightScript) .openFile('browser/sourcehighlight.js') .executeScript('remix.exeCurrent()') .editorScroll('down', 60) @@ -90,20 +93,26 @@ module.exports = { }, 'Should remove 1 highlight from source code': function (browser: NightwatchBrowser) { - browser.addFile('removeSourcehighlightScript.js', removeSourcehighlightScript) - .openFile('browser/removeSourcehighlightScript.js') + browser.waitForElementVisible('li[key="browser/removeSourcehighlightScript.js"]') + .click('li[key="browser/removeSourcehighlightScript.js"]') + .pause(2000) .executeScript('remix.exeCurrent()') - .openFile('browser/3_Ballot.sol') + .waitForElementVisible('li[key="browser/3_Ballot.sol"]') + .click('li[key="browser/3_Ballot.sol"]') + .pause(2000) .waitForElementNotPresent('.highlightLine32') .checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)') .checkElementStyle('.highlightLine50', 'background-color', 'rgb(8, 108, 181)') }, 'Should remove all highlights from source code': function (browser: NightwatchBrowser) { - browser.addFile('removeAllSourcehighlightScript.js', removeAllSourcehighlightScript) - .openFile('browser/removeAllSourcehighlightScript.js') + browser.waitForElementVisible('li[key="browser/removeAllSourcehighlightScript.js"]') + .click('li[key="browser/removeAllSourcehighlightScript.js"]') + .pause(2000) .executeScript('remix.exeCurrent()') - .openFile('browser/3_Ballot.sol') + .waitForElementVisible('li[key="browser/3_Ballot.sol"]') + .click('li[key="browser/3_Ballot.sol"]') + .pause(2000) .waitForElementNotPresent('.highlightLine32') .waitForElementNotPresent('.highlightLine40') .waitForElementNotPresent('.highlightLine50')