From 2bc32d41879a1a1a2fda5900dad7c86f148ba5e4 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 15 Jun 2020 11:04:09 +0100 Subject: [PATCH 01/11] Test exit code --- ci/browser_tests_chrome.sh | 2 +- ci/browser_tests_firefox.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/browser_tests_chrome.sh b/ci/browser_tests_chrome.sh index c5642f7832..31f40bec0f 100755 --- a/ci/browser_tests_chrome.sh +++ b/ci/browser_tests_chrome.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_chrome $TESTFILES +npm run nightwatch_local_chrome $TESTFILES || TEST_EXITCODE=1 echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/ci/browser_tests_firefox.sh b/ci/browser_tests_firefox.sh index 89abb5d2b7..d5399c83ed 100755 --- a/ci/browser_tests_firefox.sh +++ b/ci/browser_tests_firefox.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_firefox $TESTFILES +npm run nightwatch_local_firefox $TESTFILES || TEST_EXITCODE=1 echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] From 0ea3832327e4361b911637f7346e610bc6251011 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 15 Jun 2020 11:32:00 +0100 Subject: [PATCH 02/11] Pass param --- ci/browser_tests_chrome.sh | 2 +- ci/browser_tests_firefox.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/browser_tests_chrome.sh b/ci/browser_tests_chrome.sh index 31f40bec0f..1b6c7ca795 100755 --- a/ci/browser_tests_chrome.sh +++ b/ci/browser_tests_chrome.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_chrome $TESTFILES || TEST_EXITCODE=1 +npm run nightwatch_local_chrome -- $TESTFILES || TEST_EXITCODE=1 echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/ci/browser_tests_firefox.sh b/ci/browser_tests_firefox.sh index d5399c83ed..7ef289dc00 100755 --- a/ci/browser_tests_firefox.sh +++ b/ci/browser_tests_firefox.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_firefox $TESTFILES || TEST_EXITCODE=1 +npm run nightwatch_local_firefox -- $TESTFILES || TEST_EXITCODE=1 echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] From eca218f3c8d20700432a0983c23d0106729d9dfe Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 15 Jun 2020 11:40:41 +0100 Subject: [PATCH 03/11] Pass through package.json --- ci/browser_tests_chrome.sh | 2 +- ci/browser_tests_firefox.sh | 2 +- package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/browser_tests_chrome.sh b/ci/browser_tests_chrome.sh index 1b6c7ca795..c5642f7832 100755 --- a/ci/browser_tests_chrome.sh +++ b/ci/browser_tests_chrome.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_chrome -- $TESTFILES || TEST_EXITCODE=1 +npm run nightwatch_local_chrome $TESTFILES echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/ci/browser_tests_firefox.sh b/ci/browser_tests_firefox.sh index 7ef289dc00..89abb5d2b7 100755 --- a/ci/browser_tests_firefox.sh +++ b/ci/browser_tests_firefox.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_firefox -- $TESTFILES || TEST_EXITCODE=1 +npm run nightwatch_local_firefox $TESTFILES echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/package.json b/package.json index afacc50006..ece1dc12e5 100644 --- a/package.json +++ b/package.json @@ -162,8 +162,8 @@ "make-mock-compiler": "node ci/makeMockCompiler.js", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "nightwatch_parallel": "nightwatch -e chrome,firefox --config nightwatch.js", - "nightwatch_local_firefox": "nightwatch --config nightwatch.js --env firefox", - "nightwatch_local_chrome": "nightwatch --config nightwatch.js --env chrome", + "nightwatch_local_firefox": "nightwatch --config nightwatch.js --env firefox || exit 1;", + "nightwatch_local_chrome": "nightwatch --config nightwatch.js --env chrome || exit 1;", "nightwatch_local_ballot": "nightwatch ./test-browser/tests/ballot.test.js --config nightwatch.js --env chrome ", "nightwatch_local_usingWorker": "nightwatch ./test-browser/tests/usingWebWorker.test.js --config nightwatch.js --env chrome ", "nightwatch_local_libraryDeployment": "nightwatch ./test-browser/tests/libraryDeployment.test.js --config nightwatch.js --env chrome ", From f19fa2cc4abaf9642c5fdbb23ff1cb8164de0561 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 15 Jun 2020 11:52:56 +0100 Subject: [PATCH 04/11] Concat exit code after test spliting --- ci/browser_tests_chrome.sh | 2 +- ci/browser_tests_firefox.sh | 2 +- package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/browser_tests_chrome.sh b/ci/browser_tests_chrome.sh index c5642f7832..fe356be28b 100755 --- a/ci/browser_tests_chrome.sh +++ b/ci/browser_tests_chrome.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_chrome $TESTFILES +npm run nightwatch_local_chrome ${TESTFILES || exit 1;} echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/ci/browser_tests_firefox.sh b/ci/browser_tests_firefox.sh index 89abb5d2b7..be90222fee 100755 --- a/ci/browser_tests_firefox.sh +++ b/ci/browser_tests_firefox.sh @@ -22,7 +22,7 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_firefox $TESTFILES +npm run nightwatch_local_firefox ${TESTFILES || exit 1;} echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/package.json b/package.json index ece1dc12e5..afacc50006 100644 --- a/package.json +++ b/package.json @@ -162,8 +162,8 @@ "make-mock-compiler": "node ci/makeMockCompiler.js", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "nightwatch_parallel": "nightwatch -e chrome,firefox --config nightwatch.js", - "nightwatch_local_firefox": "nightwatch --config nightwatch.js --env firefox || exit 1;", - "nightwatch_local_chrome": "nightwatch --config nightwatch.js --env chrome || exit 1;", + "nightwatch_local_firefox": "nightwatch --config nightwatch.js --env firefox", + "nightwatch_local_chrome": "nightwatch --config nightwatch.js --env chrome", "nightwatch_local_ballot": "nightwatch ./test-browser/tests/ballot.test.js --config nightwatch.js --env chrome ", "nightwatch_local_usingWorker": "nightwatch ./test-browser/tests/usingWebWorker.test.js --config nightwatch.js --env chrome ", "nightwatch_local_libraryDeployment": "nightwatch ./test-browser/tests/libraryDeployment.test.js --config nightwatch.js --env chrome ", From 250dd919663ae144ee9048073c61681ac7433474 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 15 Jun 2020 12:10:57 +0100 Subject: [PATCH 05/11] Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci Debug ci false positive"# --- ci/browser_tests_chrome.sh | 5 ++++- ci/browser_tests_firefox.sh | 5 ++++- test-browser/helpers/init.js | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ci/browser_tests_chrome.sh b/ci/browser_tests_chrome.sh index fe356be28b..1fa610d844 100755 --- a/ci/browser_tests_chrome.sh +++ b/ci/browser_tests_chrome.sh @@ -22,7 +22,10 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_chrome ${TESTFILES || exit 1;} +ls +for TESTFILE in $TESTFILES; do + ./node_modules/.bin/nightwatch --config nightwatch.js --env chrome $TESTFILE || exit 1; +done echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/ci/browser_tests_firefox.sh b/ci/browser_tests_firefox.sh index be90222fee..a5c5fa3b0a 100755 --- a/ci/browser_tests_firefox.sh +++ b/ci/browser_tests_firefox.sh @@ -22,7 +22,10 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -npm run nightwatch_local_firefox ${TESTFILES || exit 1;} +ls +for TESTFILE in $TESTFILES; do + ./node_modules/.bin/nightwatch --config nightwatch.js --env firefox $TESTFILE || exit 1; +done echo "$TEST_EXITCODE" if [ "$TEST_EXITCODE" -eq 1 ] diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index c4341a362b..1d01999473 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -14,11 +14,11 @@ module.exports = function (browser, callback, url, preloadPlugins = true) { .execute(() => { document.getElementById('autoCompile').click() }) - .perform(function () { - callback() - }) }) - } else callback() + } + }) + .perform(()=>{ + callback() }) }) } From 47303b91e0fd66ae6da68821d847459a1937c3c9 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 15 Jun 2020 19:29:56 +0100 Subject: [PATCH 06/11] Fixed linting error --- test-browser/helpers/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index 1d01999473..9dbf198505 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -17,7 +17,7 @@ module.exports = function (browser, callback, url, preloadPlugins = true) { }) } }) - .perform(()=>{ + .perform(() => { callback() }) }) From 555abaf3351e00c0560df2ed0d7567120743e4fb Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 16 Jun 2020 09:15:41 +0100 Subject: [PATCH 07/11] Added done callback --- test-browser/commands/clickLaunchIcon.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-browser/commands/clickLaunchIcon.js b/test-browser/commands/clickLaunchIcon.js index 6774813b20..59db1e0384 100644 --- a/test-browser/commands/clickLaunchIcon.js +++ b/test-browser/commands/clickLaunchIcon.js @@ -2,8 +2,9 @@ const EventEmitter = require('events') class ClickLaunchIcon extends EventEmitter { command (icon) { - this.api.waitForElementVisible('#icon-panel div[plugin="' + icon + '"]').click('#icon-panel div[plugin="' + icon + '"]').perform(() => { + this.api.waitForElementVisible('#icon-panel div[plugin="' + icon + '"]').click('#icon-panel div[plugin="' + icon + '"]').perform((done) => { this.emit('complete') + done() }) return this } From ccd25469756fdfc5a6ba87c0b4d31c03b5ecc076 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 16 Jun 2020 10:27:35 +0100 Subject: [PATCH 08/11] done callback --- test-browser/commands/clickLaunchIcon.js | 2 +- test-browser/helpers/init.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test-browser/commands/clickLaunchIcon.js b/test-browser/commands/clickLaunchIcon.js index 59db1e0384..850c0d0197 100644 --- a/test-browser/commands/clickLaunchIcon.js +++ b/test-browser/commands/clickLaunchIcon.js @@ -3,8 +3,8 @@ const EventEmitter = require('events') class ClickLaunchIcon extends EventEmitter { command (icon) { this.api.waitForElementVisible('#icon-panel div[plugin="' + icon + '"]').click('#icon-panel div[plugin="' + icon + '"]').perform((done) => { - this.emit('complete') done() + this.emit('complete') }) return this } diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index 9dbf198505..23ae1d7bf9 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -10,16 +10,17 @@ module.exports = function (browser, callback, url, preloadPlugins = true) { if (preloadPlugins) { initModules(browser, () => { browser.clickLaunchIcon('solidity') - .pause(2000) + console.log('called init after') + browser.pause(2000) .execute(() => { document.getElementById('autoCompile').click() }) }) } }) - .perform(() => { - callback() - }) + }) + .perform(() => { + callback() }) } From 39202c92e7c1785bcaec88db3ed61ef10716dd84 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 16 Jun 2020 14:53:45 +0100 Subject: [PATCH 09/11] Replace ids with data-attribute --- test-browser/helpers/init.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index 23ae1d7bf9..0a2ffa702b 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -10,8 +10,7 @@ module.exports = function (browser, callback, url, preloadPlugins = true) { if (preloadPlugins) { initModules(browser, () => { browser.clickLaunchIcon('solidity') - console.log('called init after') - browser.pause(2000) + .pause(2000) .execute(() => { document.getElementById('autoCompile').click() }) @@ -26,16 +25,13 @@ module.exports = function (browser, callback, url, preloadPlugins = true) { function initModules (browser, callback) { browser.pause(5000) - .click('#icon-panel div[plugin="pluginManager"]') - .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidity"] button') - .pause(5000) - .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_udapp"] button') - .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button') - .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button') - .scrollAndClick('#icon-panel div[plugin="fileExplorers"]') + .click('[data-id="verticalIconsKindpluginManager"]') + .scrollAndClick('[data-id="pluginManagerComponentActivateButtonsolidityStaticAnalysis"]') + .scrollAndClick('[data-id="pluginManagerComponentActivateButtondebugger"]') + .scrollAndClick('[data-id="verticalIconsKindfileExplorers"]') .clickLaunchIcon('settings') - .setValue('#gistaccesstoken', process.env.gist_token) - .click('#savegisttoken') - .click('#settingsView #Flatly') // e2e tests were initially developed with Flatly. Some tests are failing with the default one (Dark), because the dark theme put uppercase everywhere. + .setValue('[data-id="settingsTabGistAccessToken"]', process.env.gist_token) + .click('[data-id="settingsTabSaveGistToken"]') + .click('[data-id="settingsTabThemeFlatly"]') // e2e tests were initially developed with Flatly. Some tests are failing with the default one (Dark), because the dark theme put uppercase everywhere. .perform(() => { callback() }) } From 79067737145f1f3dc31b447b7794dd71acc788af Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 16 Jun 2020 17:12:21 +0100 Subject: [PATCH 10/11] Set test exit code --- ci/browser_tests_chrome.sh | 3 +-- ci/browser_tests_firefox.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ci/browser_tests_chrome.sh b/ci/browser_tests_chrome.sh index 1fa610d844..5430bdb2b4 100755 --- a/ci/browser_tests_chrome.sh +++ b/ci/browser_tests_chrome.sh @@ -22,9 +22,8 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -ls for TESTFILE in $TESTFILES; do - ./node_modules/.bin/nightwatch --config nightwatch.js --env chrome $TESTFILE || exit 1; + ./node_modules/.bin/nightwatch --config nightwatch.js --env chrome $TESTFILE || TEST_EXITCODE=1 done echo "$TEST_EXITCODE" diff --git a/ci/browser_tests_firefox.sh b/ci/browser_tests_firefox.sh index a5c5fa3b0a..8ba2bacf06 100755 --- a/ci/browser_tests_firefox.sh +++ b/ci/browser_tests_firefox.sh @@ -22,9 +22,8 @@ setupRemixd sleep 5 TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings) -ls for TESTFILE in $TESTFILES; do - ./node_modules/.bin/nightwatch --config nightwatch.js --env firefox $TESTFILE || exit 1; + ./node_modules/.bin/nightwatch --config nightwatch.js --env firefox $TESTFILE || TEST_EXITCODE=1 done echo "$TEST_EXITCODE" From 9934a3ffeb6b5ce962826846c6d55f16c1048219 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 17 Jun 2020 09:57:04 +0200 Subject: [PATCH 11/11] fix e2e tests --- test-browser/tests/usingWebWorker.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-browser/tests/usingWebWorker.test.js b/test-browser/tests/usingWebWorker.test.js index c59da319d3..daf12b422a 100644 --- a/test-browser/tests/usingWebWorker.test.js +++ b/test-browser/tests/usingWebWorker.test.js @@ -23,7 +23,7 @@ module.exports = { .execute(() => { document.getElementById('nightlies').checked = true }) - .noWorkerErrorFor('soljson-v0.3.4+commit.7dab890.js') + .noWorkerErrorFor('soljson-v0.3.4+commit.7dab8902.js') .noWorkerErrorFor('soljson-v0.6.5+commit.f956cc89.js') .noWorkerErrorFor('soljson-v0.6.8-nightly.2020.5.14+commit.a6d0067b.js') .noWorkerErrorFor('soljson-v0.6.0-nightly.2019.12.17+commit.d13438ee.js') @@ -31,6 +31,7 @@ module.exports = { .execute(() => { document.getElementById('nightlies').checked = false }) + .end() }, tearDown: sauce