From 727315fae50d5b3e459fcd8fb34241d24c21c7a1 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 23 Sep 2021 14:46:15 +0530 Subject: [PATCH] final e2e tests for compilation error check --- .../src/tests/solidityUnittests.spec.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts index 09788a88e1..7c5e9322aa 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts @@ -90,7 +90,7 @@ module.exports = { .waitForElementContainsText('*[data-id="testTabTestsExecutionStopped"]', 'The test execution has been stopped', 60000) }, - 'Should fail on compilation': function (browser: NightwatchBrowser) { + 'Should fail on compilation, open file on error click, not disappear error': function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .addFile('tests/compilationError_test.sol', sources[0]['compilationError_test.sol']) .click('div[title="default_workspace/tests/compilationError_test.sol"] span[class="close"]') @@ -102,16 +102,9 @@ module.exports = { .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'SyntaxError: No visibility specified', 120000) .waitForElementContainsText('*[data-id="testTabTestsExecutionStoppedError"]', 'The test execution has been stopped because of error(s) in your test file', 120000) .click('*[data-id="tests/compilationError_test.sol"]') - .getEditorValue((content) => { - browser.assert.ok(content.indexOf(` - contract failOnCompilation { - fallback() { - - } - }`) !== -1, - 'current displayed content is not from the compilationError_test source code') - }) - .pause(20000) + .pause(1000) + .getEditorValue((content) => browser.assert.ok(content.indexOf(`contract failOnCompilation {`) !== -1)) + .verify.elementPresent('*[data-id="tests/compilationError_test.sol"]') }, 'Should fail on deploy': function (browser: NightwatchBrowser) { @@ -451,7 +444,7 @@ const sources = [ }, 'compilationError_test.sol': { content: ` - pragma solidity ^0.7.0; + pragma solidity ^0.8.0; contract failOnCompilation { fallback() {