From 101feb4eb7ea25804c8e8f0d965741e51b39ad29 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 6 Apr 2021 11:13:49 +0200 Subject: [PATCH 01/24] JS error catched for getAccounts --- apps/remix-ide/src/app/tabs/runTab/settings.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/settings.js b/apps/remix-ide/src/app/tabs/runTab/settings.js index d03e58f6ea..dd94ff9727 100644 --- a/apps/remix-ide/src/app/tabs/runTab/settings.js +++ b/apps/remix-ide/src/app/tabs/runTab/settings.js @@ -390,14 +390,15 @@ class SettingsUI { } // TODO: unclear what's the goal of accountListCallId, feels like it can be simplified - fillAccountsList () { + async fillAccountsList () { this.accountListCallId++ - var callid = this.accountListCallId - var txOrigin = this.el.querySelector('#txorigin') - this.blockchain.getAccounts((err, accounts) => { + const callid = this.accountListCallId + const txOrigin = this.el.querySelector('#txorigin') + try { + let accounts = await this.blockchain.getAccounts() if (this.accountListCallId > callid) return this.accountListCallId++ - if (err) { addTooltip(`Cannot get account list: ${err}`) } + if (!accounts) accounts = [] for (var loadedaddress in this.loadedAccounts) { if (accounts.indexOf(loadedaddress) === -1) { txOrigin.removeChild(txOrigin.querySelector('option[value="' + loadedaddress + '"]')) @@ -405,14 +406,16 @@ class SettingsUI { } } for (var i in accounts) { - var address = accounts[i] + const address = accounts[i] if (!this.loadedAccounts[address]) { txOrigin.appendChild(yo``) this.loadedAccounts[address] = 1 } } txOrigin.setAttribute('value', accounts[0]) - }) + } catch (e) { + addTooltip(`Cannot get account list: ${e}`) + } } } From f47657dbba5392f65ffdac53dd1e46069bac63a7 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 6 Apr 2021 13:06:03 +0200 Subject: [PATCH 02/24] refactored --- .../remix-ide/src/app/tabs/runTab/settings.js | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/settings.js b/apps/remix-ide/src/app/tabs/runTab/settings.js index dd94ff9727..8fc7da3700 100644 --- a/apps/remix-ide/src/app/tabs/runTab/settings.js +++ b/apps/remix-ide/src/app/tabs/runTab/settings.js @@ -394,28 +394,29 @@ class SettingsUI { this.accountListCallId++ const callid = this.accountListCallId const txOrigin = this.el.querySelector('#txorigin') + let accounts = [] try { - let accounts = await this.blockchain.getAccounts() - if (this.accountListCallId > callid) return - this.accountListCallId++ - if (!accounts) accounts = [] - for (var loadedaddress in this.loadedAccounts) { - if (accounts.indexOf(loadedaddress) === -1) { - txOrigin.removeChild(txOrigin.querySelector('option[value="' + loadedaddress + '"]')) - delete this.loadedAccounts[loadedaddress] - } - } - for (var i in accounts) { - const address = accounts[i] - if (!this.loadedAccounts[address]) { - txOrigin.appendChild(yo``) - this.loadedAccounts[address] = 1 - } - } - txOrigin.setAttribute('value', accounts[0]) + accounts = await this.blockchain.getAccounts() } catch (e) { addTooltip(`Cannot get account list: ${e}`) } + if (!accounts) accounts = [] + if (this.accountListCallId > callid) return + this.accountListCallId++ + for (var loadedaddress in this.loadedAccounts) { + if (accounts.indexOf(loadedaddress) === -1) { + txOrigin.removeChild(txOrigin.querySelector('option[value="' + loadedaddress + '"]')) + delete this.loadedAccounts[loadedaddress] + } + } + for (var i in accounts) { + const address = accounts[i] + if (!this.loadedAccounts[address]) { + txOrigin.appendChild(yo``) + this.loadedAccounts[address] = 1 + } + } + txOrigin.setAttribute('value', accounts[0]) } } From 4b454c1888b8e6330d2c0fe34a99813f681ec9d4 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 6 Apr 2021 12:42:02 +0200 Subject: [PATCH 03/24] js error handled for gas estimation --- apps/remix-ide/src/app/editor/contextualListener.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/editor/contextualListener.js b/apps/remix-ide/src/app/editor/contextualListener.js index d7b829a4c8..3f748d6b54 100644 --- a/apps/remix-ide/src/app/editor/contextualListener.js +++ b/apps/remix-ide/src/app/editor/contextualListener.js @@ -215,8 +215,8 @@ class ContextualListener extends Plugin { const contract = this.nodes[i] this.contract = this.results.data.contracts[this.results.source.target][contract.name] this.estimationObj = this.contract.evm.gasEstimates - this.creationCost = this.estimationObj.creation.totalCost - this.codeDepositCost = this.estimationObj.creation.codeDepositCost + this.creationCost = this.estimationObj === null ? '' : this.estimationObj.creation.totalCost + this.codeDepositCost = this.estimationObj === null ? '' : this.estimationObj.creation.codeDepositCost } } } From 250318433723b9a89b67097134a37466f20da195 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 6 Apr 2021 13:54:32 +0200 Subject: [PATCH 04/24] writting - for undefined values of gas estimation --- apps/remix-ide/src/app/editor/contextualListener.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/app/editor/contextualListener.js b/apps/remix-ide/src/app/editor/contextualListener.js index 3f748d6b54..ab75e5855e 100644 --- a/apps/remix-ide/src/app/editor/contextualListener.js +++ b/apps/remix-ide/src/app/editor/contextualListener.js @@ -195,9 +195,9 @@ class ContextualListener extends Plugin { const fnName = node.name const fn = fnName + this._getInputParams(node) if (visibility === 'public' || visibility === 'external') { - executionCost = this.estimationObj.external[fn] + executionCost = this.estimationObj === null ? '-' : this.estimationObj.external[fn] } else if (visibility === 'private' || visibility === 'internal') { - executionCost = this.estimationObj.internal[fn] + executionCost = this.estimationObj === null ? '-' : this.estimationObj.internal[fn] } } else { executionCost = this.creationCost @@ -215,8 +215,8 @@ class ContextualListener extends Plugin { const contract = this.nodes[i] this.contract = this.results.data.contracts[this.results.source.target][contract.name] this.estimationObj = this.contract.evm.gasEstimates - this.creationCost = this.estimationObj === null ? '' : this.estimationObj.creation.totalCost - this.codeDepositCost = this.estimationObj === null ? '' : this.estimationObj.creation.codeDepositCost + this.creationCost = this.estimationObj === null ? '-' : this.estimationObj.creation.totalCost + this.codeDepositCost = this.estimationObj === null ? '-' : this.estimationObj.creation.codeDepositCost } } } From a1c9cde9f3de034cc14d9962cab8b2f94e866aee Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 25 Mar 2021 12:17:28 +0100 Subject: [PATCH 05/24] Minute timeout --- apps/remix-ide-e2e/src/commands/addFile.ts | 1 + apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 1 - apps/remix-ide-e2e/src/commands/verifyContracts.ts | 2 +- apps/remix-ide-e2e/src/tests/ballot.test.ts | 6 ++---- apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts | 4 ++-- apps/remix-ide-e2e/src/tests/txListener.test.ts | 2 +- package.json | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 46df6972a0..6914f4b55f 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -19,6 +19,7 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('.newFile') .waitForElementVisible('*[data-id="treeViewLitreeViewItem/blank"]') + .click('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items') .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', name) .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', browser.Keys.ENTER) .pause(2000) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index 9baac64849..c9da6d8229 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -14,7 +14,6 @@ function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number browser.execute(function () { return document.querySelector('#stepdetail').innerHTML }, [], function (result) { - console.log('goToVMtraceStep', result) if (typeof result.value === 'string' && (result.value.indexOf('vm trace step:') !== -1 && result.value.indexOf(step.toString()) !== -1)) { done() } else if (incr > 1000) { diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index 04a4cf0700..88d910374e 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -17,7 +17,7 @@ function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number, browser .clickLaunchIcon('solidity') .pause(opts.wait) - .waitForElementPresent('*[data-id="compiledContracts"] option') + .waitForElementPresent('*[data-id="compiledContracts"] option', 60000) .perform((done) => { if (opts.version) { browser diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index 84d578ff88..e59531468d 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -25,7 +25,7 @@ module.exports = { .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') .setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]') .click('*[data-id="Deploy - transact (not payable)"]') - .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') + .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) .click('*[data-id="universalDappUiTitleExpander"]') .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', @@ -39,12 +39,10 @@ module.exports = { browser.pause(500) .click('*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]') .waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') - // .clickLaunchIcon('debugger') .click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .pause(2000) .waitForElementVisible('#stepdetail') .goToVMTraceStep(144) - // .pause(1000) .checkVariableDebug('soliditystate', stateCheck) .checkVariableDebug('soliditylocals', localsCheck) }, @@ -57,7 +55,7 @@ module.exports = { .clickLaunchIcon('fileExplorers') .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true) .pause(500) - .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') + .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) .click('*[data-id="universalDappUiTitleExpander"]') .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts index 760d8e6bde..2d40044270 100644 --- a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts @@ -34,7 +34,7 @@ module.exports = { .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') .setValue('input[placeholder="uint8 _numProposals"]', '2') .click('*[data-id="Deploy - transact (not payable)"]') - .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') + .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) .click('*[data-id="universalDappUiTitleExpander"]') .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', @@ -65,7 +65,7 @@ module.exports = { .clickLaunchIcon('fileExplorers') .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true) .pause(500) - .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') + .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) .click('*[data-id="universalDappUiTitleExpander"]') .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', diff --git a/apps/remix-ide-e2e/src/tests/txListener.test.ts b/apps/remix-ide-e2e/src/tests/txListener.test.ts index a9bdf3b095..3324649e31 100644 --- a/apps/remix-ide-e2e/src/tests/txListener.test.ts +++ b/apps/remix-ide-e2e/src/tests/txListener.test.ts @@ -26,7 +26,7 @@ module.exports = { .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') .setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]') .click('*[data-id="Deploy - transact (not payable)"]') - .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]') + .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) .click('*[data-id="universalDappUiTitleExpander"]') .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', diff --git a/package.json b/package.json index 5180840e01..20c818872a 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "nightwatch_parallel": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", "nightwatch_local_firefox": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", "nightwatch_local_chrome": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", - "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", + "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=firefox", "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", From e1287c4d2cd4066139966c882af4423c4cdc7d8c Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 25 Mar 2021 16:03:31 +0100 Subject: [PATCH 06/24] Isolate ballot test --- apps/remix-ide-e2e/src/commands/checkVariableDebug.ts | 1 - .../src/tests/{ballot_0_4_11.test.ts => ballot_0_4_11} | 0 .../src/tests/{compiler_api.test.ts => compiler_api} | 0 apps/remix-ide-e2e/src/tests/{debugger.test.ts => debugger} | 0 .../src/tests/{defaultLayout.test.ts => defaultLayout} | 0 apps/remix-ide-e2e/src/tests/{editor.test.ts => editor} | 0 .../src/tests/{fileExplorer.test.ts => fileExplorer} | 0 .../src/tests/{fileManager_api.test.ts => fileManager_api} | 0 .../src/tests/{generalSettings.test.ts => generalSettings} | 0 apps/remix-ide-e2e/src/tests/{gist.test.ts => gist} | 0 .../src/tests/{libraryDeployment.test.ts => libraryDeployment} | 0 .../src/tests/{pluginManager.test.ts => pluginManager} | 0 .../src/tests/{publishContract.test.ts => publishContract} | 0 apps/remix-ide-e2e/src/tests/{recorder.test.ts => recorder} | 0 apps/remix-ide-e2e/src/tests/{remixd.test.ts => remixd} | 0 .../src/tests/{signingMessage.test.ts => signingMessage} | 0 .../src/tests/{solidityImport.test.ts => solidityImport} | 0 .../src/tests/{solidityUnittests.test.ts => solidityUnittests} | 0 .../src/tests/{specialFunctions.test.ts => specialFunctions} | 0 .../src/tests/{staticAnalysis.test.ts => staticAnalysis} | 0 apps/remix-ide-e2e/src/tests/{terminal.test.ts => terminal} | 0 .../tests/{transactionExecution.test.ts => transactionExecution} | 0 apps/remix-ide-e2e/src/tests/{url.test.ts => url} | 0 .../src/tests/{usingWebWorker.test.ts => usingWebWorker} | 0 .../src/tests/{verticalIconsPanel.test.ts => verticalIconsPanel} | 0 apps/remix-ide-e2e/src/tests/{workspace.test.ts => workspace} | 0 26 files changed, 1 deletion(-) rename apps/remix-ide-e2e/src/tests/{ballot_0_4_11.test.ts => ballot_0_4_11} (100%) rename apps/remix-ide-e2e/src/tests/{compiler_api.test.ts => compiler_api} (100%) rename apps/remix-ide-e2e/src/tests/{debugger.test.ts => debugger} (100%) rename apps/remix-ide-e2e/src/tests/{defaultLayout.test.ts => defaultLayout} (100%) rename apps/remix-ide-e2e/src/tests/{editor.test.ts => editor} (100%) rename apps/remix-ide-e2e/src/tests/{fileExplorer.test.ts => fileExplorer} (100%) rename apps/remix-ide-e2e/src/tests/{fileManager_api.test.ts => fileManager_api} (100%) rename apps/remix-ide-e2e/src/tests/{generalSettings.test.ts => generalSettings} (100%) rename apps/remix-ide-e2e/src/tests/{gist.test.ts => gist} (100%) rename apps/remix-ide-e2e/src/tests/{libraryDeployment.test.ts => libraryDeployment} (100%) rename apps/remix-ide-e2e/src/tests/{pluginManager.test.ts => pluginManager} (100%) rename apps/remix-ide-e2e/src/tests/{publishContract.test.ts => publishContract} (100%) rename apps/remix-ide-e2e/src/tests/{recorder.test.ts => recorder} (100%) rename apps/remix-ide-e2e/src/tests/{remixd.test.ts => remixd} (100%) rename apps/remix-ide-e2e/src/tests/{signingMessage.test.ts => signingMessage} (100%) rename apps/remix-ide-e2e/src/tests/{solidityImport.test.ts => solidityImport} (100%) rename apps/remix-ide-e2e/src/tests/{solidityUnittests.test.ts => solidityUnittests} (100%) rename apps/remix-ide-e2e/src/tests/{specialFunctions.test.ts => specialFunctions} (100%) rename apps/remix-ide-e2e/src/tests/{staticAnalysis.test.ts => staticAnalysis} (100%) rename apps/remix-ide-e2e/src/tests/{terminal.test.ts => terminal} (100%) rename apps/remix-ide-e2e/src/tests/{transactionExecution.test.ts => transactionExecution} (100%) rename apps/remix-ide-e2e/src/tests/{url.test.ts => url} (100%) rename apps/remix-ide-e2e/src/tests/{usingWebWorker.test.ts => usingWebWorker} (100%) rename apps/remix-ide-e2e/src/tests/{verticalIconsPanel.test.ts => verticalIconsPanel} (100%) rename apps/remix-ide-e2e/src/tests/{workspace.test.ts => workspace} (100%) diff --git a/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts b/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts index 8ce47f222a..41a45ea702 100644 --- a/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts +++ b/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts @@ -22,7 +22,6 @@ function checkDebug (browser: NightwatchBrowser, id: string, debugValue: Nightwa return elem.innerText }, [id], function (result) { - console.log(id + ' ' + result.value) let value try { value = JSON.parse(result.value) diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts b/apps/remix-ide-e2e/src/tests/ballot_0_4_11 similarity index 100% rename from apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts rename to apps/remix-ide-e2e/src/tests/ballot_0_4_11 diff --git a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts b/apps/remix-ide-e2e/src/tests/compiler_api similarity index 100% rename from apps/remix-ide-e2e/src/tests/compiler_api.test.ts rename to apps/remix-ide-e2e/src/tests/compiler_api diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger similarity index 100% rename from apps/remix-ide-e2e/src/tests/debugger.test.ts rename to apps/remix-ide-e2e/src/tests/debugger diff --git a/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts b/apps/remix-ide-e2e/src/tests/defaultLayout similarity index 100% rename from apps/remix-ide-e2e/src/tests/defaultLayout.test.ts rename to apps/remix-ide-e2e/src/tests/defaultLayout diff --git a/apps/remix-ide-e2e/src/tests/editor.test.ts b/apps/remix-ide-e2e/src/tests/editor similarity index 100% rename from apps/remix-ide-e2e/src/tests/editor.test.ts rename to apps/remix-ide-e2e/src/tests/editor diff --git a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts b/apps/remix-ide-e2e/src/tests/fileExplorer similarity index 100% rename from apps/remix-ide-e2e/src/tests/fileExplorer.test.ts rename to apps/remix-ide-e2e/src/tests/fileExplorer diff --git a/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts b/apps/remix-ide-e2e/src/tests/fileManager_api similarity index 100% rename from apps/remix-ide-e2e/src/tests/fileManager_api.test.ts rename to apps/remix-ide-e2e/src/tests/fileManager_api diff --git a/apps/remix-ide-e2e/src/tests/generalSettings.test.ts b/apps/remix-ide-e2e/src/tests/generalSettings similarity index 100% rename from apps/remix-ide-e2e/src/tests/generalSettings.test.ts rename to apps/remix-ide-e2e/src/tests/generalSettings diff --git a/apps/remix-ide-e2e/src/tests/gist.test.ts b/apps/remix-ide-e2e/src/tests/gist similarity index 100% rename from apps/remix-ide-e2e/src/tests/gist.test.ts rename to apps/remix-ide-e2e/src/tests/gist diff --git a/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts b/apps/remix-ide-e2e/src/tests/libraryDeployment similarity index 100% rename from apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts rename to apps/remix-ide-e2e/src/tests/libraryDeployment diff --git a/apps/remix-ide-e2e/src/tests/pluginManager.test.ts b/apps/remix-ide-e2e/src/tests/pluginManager similarity index 100% rename from apps/remix-ide-e2e/src/tests/pluginManager.test.ts rename to apps/remix-ide-e2e/src/tests/pluginManager diff --git a/apps/remix-ide-e2e/src/tests/publishContract.test.ts b/apps/remix-ide-e2e/src/tests/publishContract similarity index 100% rename from apps/remix-ide-e2e/src/tests/publishContract.test.ts rename to apps/remix-ide-e2e/src/tests/publishContract diff --git a/apps/remix-ide-e2e/src/tests/recorder.test.ts b/apps/remix-ide-e2e/src/tests/recorder similarity index 100% rename from apps/remix-ide-e2e/src/tests/recorder.test.ts rename to apps/remix-ide-e2e/src/tests/recorder diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd similarity index 100% rename from apps/remix-ide-e2e/src/tests/remixd.test.ts rename to apps/remix-ide-e2e/src/tests/remixd diff --git a/apps/remix-ide-e2e/src/tests/signingMessage.test.ts b/apps/remix-ide-e2e/src/tests/signingMessage similarity index 100% rename from apps/remix-ide-e2e/src/tests/signingMessage.test.ts rename to apps/remix-ide-e2e/src/tests/signingMessage diff --git a/apps/remix-ide-e2e/src/tests/solidityImport.test.ts b/apps/remix-ide-e2e/src/tests/solidityImport similarity index 100% rename from apps/remix-ide-e2e/src/tests/solidityImport.test.ts rename to apps/remix-ide-e2e/src/tests/solidityImport diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests similarity index 100% rename from apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts rename to apps/remix-ide-e2e/src/tests/solidityUnittests diff --git a/apps/remix-ide-e2e/src/tests/specialFunctions.test.ts b/apps/remix-ide-e2e/src/tests/specialFunctions similarity index 100% rename from apps/remix-ide-e2e/src/tests/specialFunctions.test.ts rename to apps/remix-ide-e2e/src/tests/specialFunctions diff --git a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts b/apps/remix-ide-e2e/src/tests/staticAnalysis similarity index 100% rename from apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts rename to apps/remix-ide-e2e/src/tests/staticAnalysis diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal similarity index 100% rename from apps/remix-ide-e2e/src/tests/terminal.test.ts rename to apps/remix-ide-e2e/src/tests/terminal diff --git a/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts b/apps/remix-ide-e2e/src/tests/transactionExecution similarity index 100% rename from apps/remix-ide-e2e/src/tests/transactionExecution.test.ts rename to apps/remix-ide-e2e/src/tests/transactionExecution diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url similarity index 100% rename from apps/remix-ide-e2e/src/tests/url.test.ts rename to apps/remix-ide-e2e/src/tests/url diff --git a/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts b/apps/remix-ide-e2e/src/tests/usingWebWorker similarity index 100% rename from apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts rename to apps/remix-ide-e2e/src/tests/usingWebWorker diff --git a/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts b/apps/remix-ide-e2e/src/tests/verticalIconsPanel similarity index 100% rename from apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts rename to apps/remix-ide-e2e/src/tests/verticalIconsPanel diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace similarity index 100% rename from apps/remix-ide-e2e/src/tests/workspace.test.ts rename to apps/remix-ide-e2e/src/tests/workspace From 90f5ecf5f8d707c62213225bfd204908de803596 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 25 Mar 2021 16:26:39 +0100 Subject: [PATCH 07/24] Remove click due to firefox failing test --- apps/remix-ide-e2e/src/commands/addFile.ts | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 6914f4b55f..46df6972a0 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -19,7 +19,6 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('.newFile') .waitForElementVisible('*[data-id="treeViewLitreeViewItem/blank"]') - .click('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items') .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', name) .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', browser.Keys.ENTER) .pause(2000) diff --git a/package.json b/package.json index 20c818872a..5180840e01 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "nightwatch_parallel": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", "nightwatch_local_firefox": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", "nightwatch_local_chrome": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", - "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=firefox", + "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", From 59223e79bdee3bbbd0b652bf0fbc8b224a821760 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 26 Mar 2021 13:26:52 +0100 Subject: [PATCH 08/24] Split ci builds --- .circleci/config.yml | 152 +++++++++++++++--- .../{ballot_0_4_11 => ballot_0_4_11.spec.ts} | 0 ...ts_chrome.sh => browser_tests_chrome_1.sh} | 0 apps/remix-ide/ci/browser_tests_chrome_2.sh | 27 ++++ ..._firefox.sh => browser_tests_firefox_1.sh} | 0 apps/remix-ide/ci/browser_tests_firefox_2.sh | 27 ++++ package.json | 2 +- 7 files changed, 182 insertions(+), 26 deletions(-) rename apps/remix-ide-e2e/src/tests/{ballot_0_4_11 => ballot_0_4_11.spec.ts} (100%) rename apps/remix-ide/ci/{browser_tests_chrome.sh => browser_tests_chrome_1.sh} (100%) create mode 100755 apps/remix-ide/ci/browser_tests_chrome_2.sh rename apps/remix-ide/ci/{browser_tests_firefox.sh => browser_tests_firefox_1.sh} (100%) create mode 100755 apps/remix-ide/ci/browser_tests_firefox_2.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index f5e5e4bb1d..c19a9d10ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ # version: 2 jobs: - remix-libs: + lint: docker: # specify the version you desire here - image: circleci/node:10.18.0-browsers @@ -23,10 +23,31 @@ jobs: - checkout - run: npm install - run: npm run lint:libs + - run: npm run lint + - run: npm run lint remix-ide-e2e + + remix-libs: + docker: + # specify the version you desire here + - image: circleci/node:10.18.0-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + + steps: + - checkout + - run: npm install - run: npm run build:libs - run: npm run test:libs - remix-ide-chrome: + remix-ide-chrome-1: docker: # specify the version you desire here - image: circleci/node:10.18.0-browsers @@ -39,15 +60,12 @@ jobs: environment: - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" - COMMIT_AUTHOR: "Circle CI" - - FILES_TO_PACKAGE: "dist/apps/remix-ide/assets dist/apps/remix-ide/index.html dist/apps/remix-ide/main.js dist/apps/remix-ide/polyfills.js dist/apps/remix-ide/runtime.js dist/apps/remix-ide/vendor.js dist/apps/remix-ide/favicon.ico" working_directory: ~/remix-project parallelism: 20 steps: - checkout - run: npm install - - run: npm run lint - - run: npm run lint remix-ide-e2e - run: npm run build:libs - run: npm run build - run: @@ -57,13 +75,47 @@ jobs: name: Start Selenium command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com background: true - - run: ./apps/remix-ide/ci/browser_tests_chrome.sh + - run: ./apps/remix-ide/ci/browser_tests_chrome_1.sh - store_test_results: path: ./reports/tests - store_artifacts: path: ./reports/screenshots - remix-ide-firefox: + remix-ide-chrome-2: + docker: + # specify the version you desire here + - image: circleci/node:10.18.0-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + + parallelism: 20 + steps: + - checkout + - run: npm install + - run: npm run build:libs + - run: npm run build + - run: + name: Download Selenium + command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + - run: + name: Start Selenium + command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + background: true + - run: ./apps/remix-ide/ci/browser_tests_chrome_2.sh + - store_test_results: + path: ./reports/tests + - store_artifacts: + path: ./reports/screenshots + + remix-ide-firefox-1: docker: # specify the version you desire here - image: circleci/node:10.18.0-browsers @@ -76,15 +128,12 @@ jobs: environment: - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" - COMMIT_AUTHOR: "Circle CI" - - FILES_TO_PACKAGE: "dist/apps/remix-ide/assets dist/apps/remix-ide/index.html dist/apps/remix-ide/main.js dist/apps/remix-ide/polyfills.js dist/apps/remix-ide/runtime.js dist/apps/remix-ide/vendor.js dist/apps/remix-ide/favicon.ico" working_directory: ~/remix-project parallelism: 20 steps: - checkout - run: npm install - - run: npm run lint - - run: npm run lint remix-ide-e2e - run: npm run build:libs - run: npm run build - run: @@ -100,7 +149,47 @@ jobs: - run: name: Install Firefox command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb - - run: ./apps/remix-ide/ci/browser_tests_firefox.sh + - run: ./apps/remix-ide/ci/browser_tests_firefox_1.sh + - store_test_results: + path: ./reports/tests + - store_artifacts: + path: ./reports/screenshots + + remix-ide-firefox-2: + docker: + # specify the version you desire here + - image: circleci/node:10.18.0-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + + parallelism: 20 + steps: + - checkout + - run: npm install + - run: npm run build:libs + - run: npm run build + - run: + name: Download Selenium + command: ./node_modules/.bin/selenium-standalone install --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js + - run: + name: Start Selenium + command: ./node_modules/.bin/selenium-standalone start --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js + background: true + - run: + name: Download Latest Firefox + command: sudo apt-get purge -y firefox && wget https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb + - run: + name: Install Firefox + command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb + - run: ./apps/remix-ide/ci/browser_tests_firefox_2.sh - store_test_results: path: ./reports/tests - store_artifacts: @@ -125,8 +214,6 @@ jobs: steps: - checkout - run: npm install - - run: npm run lint - - run: npm run lint remix-ide-e2e - run: npm run build:libs - run: npm run build - run: @@ -162,7 +249,6 @@ jobs: steps: - checkout - run: npm install - - run: npm run lint - run: npm run build:libs - run: npm run build - run: @@ -246,7 +332,6 @@ jobs: steps: - checkout - run: npm install - - run: npm run lint - run: npm run build:libs - run: npm run build - run: @@ -260,11 +345,20 @@ workflows: version: 2 build_all: jobs: + - lint - remix-libs - - remix-ide-chrome: + requires: + - lint + - remix-ide-chrome-1: + requires: + - remix-libs + - remix-ide-chrome-2: + requires: + - remix-libs + - remix-ide-firefox-1: requires: - remix-libs - - remix-ide-firefox: + - remix-ide-firefox-2: requires: - remix-libs - remix-ide-run-deploy: @@ -272,29 +366,37 @@ workflows: - remix-libs - publish: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy - deploy-remix-live: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy filters: branches: only: remix_live - deploy-remix-alpha: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy filters: branches: only: master - deploy-remix-beta: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy filters: branches: diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11 b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/ballot_0_4_11 rename to apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts diff --git a/apps/remix-ide/ci/browser_tests_chrome.sh b/apps/remix-ide/ci/browser_tests_chrome_1.sh similarity index 100% rename from apps/remix-ide/ci/browser_tests_chrome.sh rename to apps/remix-ide/ci/browser_tests_chrome_1.sh diff --git a/apps/remix-ide/ci/browser_tests_chrome_2.sh b/apps/remix-ide/ci/browser_tests_chrome_2.sh new file mode 100755 index 0000000000..003578e173 --- /dev/null +++ b/apps/remix-ide/ci/browser_tests_chrome_2.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +npm run ganache-cli & +npm run serve & +echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' & +npm run remixd & + +sleep 5 + +npm run build:e2e + +TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings) +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi diff --git a/apps/remix-ide/ci/browser_tests_firefox.sh b/apps/remix-ide/ci/browser_tests_firefox_1.sh similarity index 100% rename from apps/remix-ide/ci/browser_tests_firefox.sh rename to apps/remix-ide/ci/browser_tests_firefox_1.sh diff --git a/apps/remix-ide/ci/browser_tests_firefox_2.sh b/apps/remix-ide/ci/browser_tests_firefox_2.sh new file mode 100755 index 0000000000..45d6553db3 --- /dev/null +++ b/apps/remix-ide/ci/browser_tests_firefox_2.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +npm run ganache-cli & +npm run serve & +echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' & +npm run remixd & + +sleep 5 + +npm run build:e2e + +TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings) +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=firefox || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi diff --git a/package.json b/package.json index 5180840e01..57279fa5a3 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "nightwatch_local_firefox": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", "nightwatch_local_chrome": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", - "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.js --env=chrome", + "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=firefox", "nightwatch_local_usingWorker": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", "nightwatch_local_solidityImport": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", From 683eb80e5069ff4077ca2f8171aab3b26d77829a Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 26 Mar 2021 13:31:53 +0100 Subject: [PATCH 09/24] Fix nesting error --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c19a9d10ff..8588a7d3cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -346,7 +346,7 @@ workflows: build_all: jobs: - lint - - remix-libs + - remix-libs: requires: - lint - remix-ide-chrome-1: From 3988333730e065f637858b52ba33ec508d2f2a1e Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 26 Mar 2021 16:08:29 +0100 Subject: [PATCH 10/24] Wait for content timeout --- apps/remix-ide-e2e/src/commands/addFile.ts | 4 ++-- .../commands/waitForElementContainsText.ts | 19 ++++++++++--------- .../{compiler_api => compiler_api.test.ts} | 12 ++++-------- apps/remix-ide-e2e/src/types/index.d.ts | 2 +- 4 files changed, 17 insertions(+), 20 deletions(-) rename apps/remix-ide-e2e/src/tests/{compiler_api => compiler_api.test.ts} (91%) diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 46df6972a0..9f33147573 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -18,11 +18,11 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC .clickLaunchIcon('fileExplorers') .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('.newFile') - .waitForElementVisible('*[data-id="treeViewLitreeViewItem/blank"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItem/blank"]', 60000) .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', name) .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', browser.Keys.ENTER) .pause(2000) - .waitForElementVisible(`li[data-id="treeViewLitreeViewItem${name}"]`) + .waitForElementVisible(`li[data-id="treeViewLitreeViewItem${name}"]`, 60000) .setEditorValue(content.content) .pause(1000) .perform(function () { diff --git a/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts b/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts index b60fb39e2e..c41bf09b69 100644 --- a/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts +++ b/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts @@ -2,22 +2,23 @@ import { NightwatchBrowser } from 'nightwatch' import EventEmitter from 'events' class WaitForElementContainsText extends EventEmitter { - command (this: NightwatchBrowser, id: string, value: string): NightwatchBrowser { - let incr = 0 + command (this: NightwatchBrowser, id: string, value: string, timeout = 10000): NightwatchBrowser { + let waitId // eslint-disable-line const runid = setInterval(() => { this.api.getText(id, (result) => { - if (typeof result.value === 'string' && value.indexOf(result.value || '') !== -1) { + if (typeof result.value === 'string' && result.value.indexOf(value) !== -1) { clearInterval(runid) - this.api.assert.ok(true, `WaitForElementContainsText ${id} contains ${value}`) + clearTimeout(waitId) + this.api.assert.ok(true, `WaitForElementContainsText ${id} contains ${value} after ${timeout}`) this.emit('complete') - } else incr++ - if (incr > 50) { - clearInterval(runid) - this.api.assert.fail(`WaitForElementContainsText - expected ${value} but got ${result.value}`) - // throw new Error(`WaitForElementContainsText ${id} ${value}`) } }) }, 200) + + waitId = setTimeout(() => { + clearInterval(runid) + this.api.assert.fail(`TimeoutError: An error occurred while running .waitForElementContainsText() command on ${id}`) + }, timeout) return this } } diff --git a/apps/remix-ide-e2e/src/tests/compiler_api b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts similarity index 91% rename from apps/remix-ide-e2e/src/tests/compiler_api rename to apps/remix-ide-e2e/src/tests/compiler_api.test.ts index 3da83f59c6..8281b1fbde 100644 --- a/apps/remix-ide-e2e/src/tests/compiler_api +++ b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts @@ -22,8 +22,7 @@ module.exports = { browser .addFile('test_jsCompile.js', { content: jsCompile }) .executeScript('remix.exeCurrent()') - .pause(5000) - .journalChildIncludes('"languageversion": "0.6.8+commit.0bbfe453"') + .waitForElementContainsText('*[data-id="terminalJournal"]', '"languageversion": "0.6.8+commit.0bbfe453"', 60000) .click('*[data-id="terminalClearConsole"]') }, @@ -31,8 +30,7 @@ module.exports = { browser .addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization }) .executeScript('remix.exeCurrent()') - .pause(10000) - .journalChildIncludes('\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}') + .waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}', 60000) .click('*[data-id="terminalClearConsole"]') }, @@ -40,8 +38,7 @@ module.exports = { browser .addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault }) .executeScript('remix.exeCurrent()') - .pause(10000) - .journalChildIncludes('\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}') + .waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}', 60000) .click('*[data-id="terminalClearConsole"]') }, @@ -60,8 +57,7 @@ module.exports = { .click('li[data-id="treeViewLitreeViewItemREADME.txt"') .addFile('ContractStackLimit.sol', { content: contractStackLimit }) .clickLaunchIcon('solidity') - .pause(10000) - .waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.') + .waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.', 60000) .end() }, diff --git a/apps/remix-ide-e2e/src/types/index.d.ts b/apps/remix-ide-e2e/src/types/index.d.ts index a2423ab159..140b3ee089 100644 --- a/apps/remix-ide-e2e/src/types/index.d.ts +++ b/apps/remix-ide-e2e/src/types/index.d.ts @@ -30,7 +30,7 @@ declare module "nightwatch" { editorScroll(direction: 'up' | 'down', numberOfTimes: number): NightwatchBrowser, renamePath(path: string, newFileName: string, renamedPath: string): NightwatchBrowser, rightClick(cssSelector: string): NightwatchBrowser, - waitForElementContainsText(id: string, value: string): NightwatchBrowser, + waitForElementContainsText(id: string, value: string, timeout?: number): NightwatchBrowser, getModalBody(callback: (value: string, cb: VoidFunction) => void): NightwatchBrowser, modalFooterCancelClick(): NightwatchBrowser, selectContract(contractName: string): NightwatchBrowser, From d1fc4739d712da9c48ba2e2e9248cfc251ff49e3 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 29 Mar 2021 14:43:52 +0100 Subject: [PATCH 11/24] Refactor verifyContracts custom command --- .../src/commands/verifyContracts.ts | 44 +++---------------- .../commands/waitForElementContainsText.ts | 4 +- .../src/tests/compiler_api.test.ts | 3 +- .../src/tests/{debugger => debugger.spec.ts} | 3 +- package.json | 2 +- 5 files changed, 12 insertions(+), 44 deletions(-) rename apps/remix-ide-e2e/src/tests/{debugger => debugger.spec.ts} (98%) diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index 88d910374e..02635cea9d 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -1,4 +1,4 @@ -import { NightwatchBrowser, NightwatchCallbackResult } from 'nightwatch' +import { NightwatchBrowser } from 'nightwatch' import EventEmitter from 'events' class VerifyContracts extends EventEmitter { @@ -13,7 +13,7 @@ class VerifyContracts extends EventEmitter { } } -function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number, version?: string }, callback: (result: NightwatchCallbackResult) => void) { +function verifyContracts (browser: NightwatchBrowser, compiledContractNames: string[], opts: { wait: number, version?: string }, callback: VoidFunction) { browser .clickLaunchIcon('solidity') .pause(opts.wait) @@ -29,44 +29,14 @@ function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number, .assert.containsText('*[data-id="treeViewLicompiler/version"]', `version:\n ${opts.version}`) .modalFooterCancelClick() .perform(done) - } else done() - }) - .execute(function () { - const contracts = document.querySelectorAll('*[data-id="compiledContracts"] option') as NodeListOf - - if (!contracts) { - return null } else { - const ret = [] - - for (let c = 0; c < contracts.length; c++) { - ret.push(contracts[c].value) - } - return ret + compiledContractNames.forEach((name) => { + browser.waitForElementContainsText('[data-id="compiledContracts"]', name, 60000) + }) + done() + callback() } - }, [], function (result) { - callback(result) }) } -function verifyContracts (browser: NightwatchBrowser, compiledContractNames: string[], opts: { wait: number, version?: string }, callback: VoidFunction) { - getCompiledContracts(browser, opts, (result: NightwatchCallbackResult) => { - if (result.value) { - for (const contract in compiledContractNames) { - console.log(' - ' + compiledContractNames[contract], result.value) - if (result.value.indexOf(compiledContractNames[contract]) === -1) { - browser.assert.fail('compiled contract ' + compiledContractNames + ' not found', 'info about error', '') - browser.end() - return - } - } - } else { - browser.assert.fail('compiled contract ' + compiledContractNames + ' not found - none found', 'info about error', '') - browser.end() - } - console.log('contracts all found ' + compiledContractNames) - callback() - }) -} - module.exports = VerifyContracts diff --git a/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts b/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts index c41bf09b69..5376da014d 100644 --- a/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts +++ b/apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts @@ -9,7 +9,7 @@ class WaitForElementContainsText extends EventEmitter { if (typeof result.value === 'string' && result.value.indexOf(value) !== -1) { clearInterval(runid) clearTimeout(waitId) - this.api.assert.ok(true, `WaitForElementContainsText ${id} contains ${value} after ${timeout}`) + this.api.assert.ok(true, `WaitForElementContainsText ${id} contains ${value}`) this.emit('complete') } }) @@ -17,7 +17,7 @@ class WaitForElementContainsText extends EventEmitter { waitId = setTimeout(() => { clearInterval(runid) - this.api.assert.fail(`TimeoutError: An error occurred while running .waitForElementContainsText() command on ${id}`) + this.api.assert.fail(`TimeoutError: An error occurred while running .waitForElementContainsText() command on ${id} after ${timeout} milliseconds`) }, timeout) return this } diff --git a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts index 8281b1fbde..c12c210efb 100644 --- a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts +++ b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts @@ -53,8 +53,7 @@ module.exports = { 'Should produce a stack too deep error': function (browser: NightwatchBrowser) { browser - .clickLaunchIcon('fileExplorers') - .click('li[data-id="treeViewLitreeViewItemREADME.txt"') + .setSolidityCompilerVersion('soljson-v0.8.1+commit.df193b15.js') .addFile('ContractStackLimit.sol', { content: contractStackLimit }) .clickLaunchIcon('solidity') .waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.', 60000) diff --git a/apps/remix-ide-e2e/src/tests/debugger b/apps/remix-ide-e2e/src/tests/debugger.spec.ts similarity index 98% rename from apps/remix-ide-e2e/src/tests/debugger rename to apps/remix-ide-e2e/src/tests/debugger.spec.ts index eaf195d6de..e9f51d8ce6 100644 --- a/apps/remix-ide-e2e/src/tests/debugger +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -188,8 +188,7 @@ module.exports = { browser .addFile('test_jsGetTrace.js', { content: jsGetTrace }) .executeScript('remix.exeCurrent()') - .pause(5000) - .journalChildIncludes('result { "gas": "0x5863", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'result { "gas": "0x5863", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":', 60000) }, 'Should call the debugger api: debug': function (browser: NightwatchBrowser) { diff --git a/package.json b/package.json index 57279fa5a3..42510cda0e 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "nightwatch_local_firefox": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", "nightwatch_local_chrome": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", - "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=firefox", + "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", "nightwatch_local_solidityImport": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", From 42cd487b1f15c7dbf46c0b2de91869f99e6e9e68 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 7 Apr 2021 11:39:08 +0100 Subject: [PATCH 12/24] Fixed debugger test --- apps/remix-ide-e2e/src/commands/addFile.ts | 2 +- .../src/commands/clickInstance.ts | 2 +- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 30 ++++----- package.json | 62 +++++++++---------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 9f33147573..ede0ad6c42 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -18,7 +18,7 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC .clickLaunchIcon('fileExplorers') .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory .click('.newFile') - .waitForElementVisible('*[data-id="treeViewLitreeViewItem/blank"]', 60000) + .waitForElementContainsText('*[data-id="treeViewLitreeViewItem/blank"]', '', 60000) .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', name) .sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', browser.Keys.ENTER) .pause(2000) diff --git a/apps/remix-ide-e2e/src/commands/clickInstance.ts b/apps/remix-ide-e2e/src/commands/clickInstance.ts index ca88a71a0b..091d66ea94 100644 --- a/apps/remix-ide-e2e/src/commands/clickInstance.ts +++ b/apps/remix-ide-e2e/src/commands/clickInstance.ts @@ -6,7 +6,7 @@ class ClickInstance extends EventEmitter { index = index + 2 const selector = '.instance:nth-of-type(' + index + ') > div > button' - this.api.waitForElementPresent(selector).scrollAndClick(selector).perform(() => { this.emit('complete') }) + this.api.waitForElementContainsText(selector, '', 60000).scrollAndClick(selector).perform(() => { this.emit('complete') }) return this } } diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index e9f51d8ce6..736e5e6cf7 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -19,7 +19,7 @@ module.exports = { .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000) .click('*[title="Deploy - transact (not payable)"]') .debugTransaction(0) - .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER') + .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) }, 'Should debug failing transaction': function (browser: NightwatchBrowser) { @@ -33,8 +33,8 @@ module.exports = { .debugTransaction(1) .pause(2000) .scrollAndClick('*[data-id="solidityLocals"]') - .assert.containsText('*[data-id="solidityLocals"]', 'toast') - .assert.containsText('*[data-id="solidityLocals"]', '999') + .waitForElementContainsText('*[data-id="solidityLocals"]', 'toast', 60000) + .waitForElementContainsText('*[data-id="solidityLocals"]', '999', 60000) }, 'Should debug transaction using slider': function (browser: NightwatchBrowser) { @@ -45,8 +45,8 @@ module.exports = { .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) .pause(2000) .click('*[data-id="dropdownPanelSolidityLocals"]') - .assert.containsText('*[data-id="solidityLocals"]', 'no locals') - .assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n51') + .waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000) + .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000) }, 'Should step back and forward transaction': function (browser: NightwatchBrowser) { @@ -54,12 +54,12 @@ module.exports = { .waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]') .scrollAndClick('*[data-id="buttonNavigatorIntoBack"]') .pause(2000) - .assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n50') - .assert.containsText('*[data-id="stepdetail"]', 'execution step:\n50') + .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n50', 60000) + .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n50', 60000) .click('*[data-id="buttonNavigatorIntoForward"]') .pause(2000) - .assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n51') - .assert.containsText('*[data-id="stepdetail"]', 'execution step:\n51') + .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000) + .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n51', 60000) }, 'Should jump through breakpoints': function (browser: NightwatchBrowser) { @@ -69,12 +69,12 @@ module.exports = { .waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .pause(2000) - .assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n0') - .assert.containsText('*[data-id="stepdetail"]', 'execution step:\n0') + .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n0', 60000) + .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n0', 60000) .click('*[data-id="buttonNavigatorJumpNextBreakpoint"]') .pause(10000) - .assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n348') - .assert.containsText('*[data-id="stepdetail"]', 'execution step:\n348') + .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n348', 60000) + .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n348', 60000) }, 'Should display solidity imported code while debugging github import': function (browser: NightwatchBrowser) { @@ -159,7 +159,7 @@ module.exports = { .waitForElementPresent('*[data-id="treeViewDivtreeViewItemarray"]') .click('*[data-id="treeViewDivtreeViewItemarray"]') .waitForElementPresent('*[data-id="treeViewDivtreeViewLoadMore"]') - .assert.containsText('*[data-id="solidityLocals"]', '9: 9 uint256') + .waitForElementContainsText('*[data-id="solidityLocals"]', '9: 9 uint256', 60000) .notContainsText('*[data-id="solidityLocals"]', '10: 10 uint256') }, @@ -207,7 +207,7 @@ module.exports = { => There is something going wrong with the nightwatch API here. As we are only testing if debugger is active, this is ok to keep that for now. */ - .assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n154') + .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000) .end() }, diff --git a/package.json b/package.json index 42510cda0e..439770b48a 100644 --- a/package.json +++ b/package.json @@ -53,37 +53,37 @@ "downloadsolc_assets": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.8.1+commit.df193b15.js -O ./apps/remix-ide/src/assets/js/soljson.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", - "nightwatch_parallel": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", - "nightwatch_local_firefox": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", - "nightwatch_local_chrome": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", - "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", - "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", - "nightwatch_local_usingWorker": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", - "nightwatch_local_libraryDeployment": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", - "nightwatch_local_solidityImport": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", - "nightwatch_local_recorder": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.test.js --env=chrome", - "nightwatch_local_transactionExecution": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", - "nightwatch_local_staticAnalysis": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.test.js --env=chrome", - "nightwatch_local_signingMessage": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", - "nightwatch_local_specialFunctions": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", - "nightwatch_local_solidityUnitTests": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.test.js --env=chrome", + "nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", + "nightwatch_local_firefox": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", + "nightwatch_local_chrome": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", + "nightwatch_local_ballot": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", + "nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", + "nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", + "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", + "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", + "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.test.js --env=chrome", + "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", + "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.test.js --env=chrome", + "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", + "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", + "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.test.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", - "nightwatch_local_terminal": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", - "nightwatch_local_gist": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.test.js --env=chrome", - "nightwatch_local_workspace": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome", - "nightwatch_local_defaultLayout": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome", - "nightwatch_local_pluginManager": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.test.js --env=chrome", - "nightwatch_local_publishContract": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/publishContract.test.js --env=chrome", - "nightwatch_local_generalSettings": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/generalSettings.test.js --env=chrome", - "nightwatch_local_fileExplorer": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileExplorer.test.js --env=chrome", - "nightwatch_local_debugger": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger.test.js --env=chrome", - "nightwatch_local_editor": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/editor.test.js --env=chrome", - "nightwatch_local_compiler": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/compiler_api.test.js --env=chrome", - "nightwatch_local_txListener": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/txListener.test.js --env=chrome", - "nightwatch_local_fileManager": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileManager_api.test.js --env=chrome", - "nightwatch_local_runAndDeploy": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy", - "nightwatch_local_url": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.test.js --env=chrome", - "nightwatch_local_verticalIconscontextmenu": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.js --env=chrome", + "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", + "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.test.js --env=chrome", + "nightwatch_local_workspace": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome", + "nightwatch_local_defaultLayout": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome", + "nightwatch_local_pluginManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.test.js --env=chrome", + "nightwatch_local_publishContract": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/publishContract.test.js --env=chrome", + "nightwatch_local_generalSettings": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/generalSettings.test.js --env=chrome", + "nightwatch_local_fileExplorer": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileExplorer.test.js --env=chrome", + "nightwatch_local_debugger": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger.spec.js --env=firefox", + "nightwatch_local_editor": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/editor.test.js --env=chrome", + "nightwatch_local_compiler": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/compiler_api.test.js --env=chrome", + "nightwatch_local_txListener": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/txListener.test.js --env=chrome", + "nightwatch_local_fileManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileManager_api.test.js --env=chrome", + "nightwatch_local_runAndDeploy": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy", + "nightwatch_local_url": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.test.js --env=chrome", + "nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.js --env=chrome", "onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint", "remixd": "nx build remixd && nx serve remixd --folder=./apps/remix-ide/contracts --remixide=http://127.0.0.1:8080", "selenium": "selenium-standalone start", @@ -91,7 +91,7 @@ "sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js", "test-browser": "npm-run-all -lpr selenium make-mock-compiler serve browsertest", "watch": "watchify apps/remix-ide/src/index.js -dv -p browserify-reload -o apps/remix-ide/build/app.js --exclude solc", - "reinstall": "rm ./node-modules/ -rf & rm package-lock.json & rm ./build/ -rf & npm install & npm run build", + "reinstall": "rm ./node-modules/ -rf && rm package-lock.json && rm ./build/ -rf && npm install & npm run build", "ganache-cli": "npx ganache-cli" }, "browserify": { From 7107ca92ca24a26138d47460f5c18313683fbb13 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 7 Apr 2021 11:46:48 +0100 Subject: [PATCH 13/24] Fixed linting --- apps/remix-ide-e2e/src/commands/verifyContracts.ts | 2 +- .../src/tests/{defaultLayout => defaultLayout.test.ts} | 0 apps/remix-ide-e2e/src/tests/{editor => editor.spec.ts} | 0 package.json | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename apps/remix-ide-e2e/src/tests/{defaultLayout => defaultLayout.test.ts} (100%) rename apps/remix-ide-e2e/src/tests/{editor => editor.spec.ts} (100%) diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index 02635cea9d..31edfc0983 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -1,4 +1,4 @@ -import { NightwatchBrowser } from 'nightwatch' +import { NightwatchBrowser } from 'nightwatch' import EventEmitter from 'events' class VerifyContracts extends EventEmitter { diff --git a/apps/remix-ide-e2e/src/tests/defaultLayout b/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/defaultLayout rename to apps/remix-ide-e2e/src/tests/defaultLayout.test.ts diff --git a/apps/remix-ide-e2e/src/tests/editor b/apps/remix-ide-e2e/src/tests/editor.spec.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/editor rename to apps/remix-ide-e2e/src/tests/editor.spec.ts diff --git a/package.json b/package.json index 439770b48a..ac41a7a94c 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "nightwatch_local_publishContract": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/publishContract.test.js --env=chrome", "nightwatch_local_generalSettings": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/generalSettings.test.js --env=chrome", "nightwatch_local_fileExplorer": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileExplorer.test.js --env=chrome", - "nightwatch_local_debugger": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger.spec.js --env=firefox", + "nightwatch_local_debugger": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger.spec.js --env=chrome", "nightwatch_local_editor": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/editor.test.js --env=chrome", "nightwatch_local_compiler": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/compiler_api.test.js --env=chrome", "nightwatch_local_txListener": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/txListener.test.js --env=chrome", From aa4ccc3fa9157db2e3087a50aefda2ae4ec91df0 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 7 Apr 2021 17:19:04 +0100 Subject: [PATCH 14/24] Updated more tests --- .env | 2 +- apps/remix-ide-e2e/src/commands/openFile.ts | 2 +- apps/remix-ide-e2e/src/tests/ballot.test.ts | 5 +-- .../src/tests/ballot_0_4_11.spec.ts | 5 +-- .../src/tests/compiler_api.test.ts | 5 +-- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 5 +-- .../src/tests/defaultLayout.test.ts | 5 +-- apps/remix-ide-e2e/src/tests/editor.spec.ts | 21 +++++------- .../{fileExplorer => fileExplorer.test.ts} | 15 ++++----- ...ileManager_api => fileManager_api.spec.ts} | 33 +++++++------------ ...eneralSettings => generalSettings.test.ts} | 5 +-- .../src/tests/{gist => gist.spec.ts} | 5 +-- ...ryDeployment => libraryDeployment.test.ts} | 6 ++-- package.json | 8 ++--- 14 files changed, 42 insertions(+), 80 deletions(-) rename apps/remix-ide-e2e/src/tests/{fileExplorer => fileExplorer.test.ts} (96%) rename apps/remix-ide-e2e/src/tests/{fileManager_api => fileManager_api.spec.ts} (87%) rename apps/remix-ide-e2e/src/tests/{generalSettings => generalSettings.test.ts} (99%) rename apps/remix-ide-e2e/src/tests/{gist => gist.spec.ts} (99%) rename apps/remix-ide-e2e/src/tests/{libraryDeployment => libraryDeployment.test.ts} (98%) diff --git a/.env b/.env index 8db17993d7..7cc6acaa7d 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -gist_token= +gist_token=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 account_passphrase= account_password= NODE_OPTIONS=--max-old-space-size=2048 \ No newline at end of file diff --git a/apps/remix-ide-e2e/src/commands/openFile.ts b/apps/remix-ide-e2e/src/commands/openFile.ts index 56a6f6ed9d..80e288ac6f 100644 --- a/apps/remix-ide-e2e/src/commands/openFile.ts +++ b/apps/remix-ide-e2e/src/commands/openFile.ts @@ -16,7 +16,7 @@ class OpenFile extends EventEmitter { // click on fileExplorer can toggle it. We go through settings to be sure FE is open function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) { browser.clickLaunchIcon('settings').clickLaunchIcon('fileExplorers') - .waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"') + .waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000) .click('li[data-id="treeViewLitreeViewItem' + name + '"') .pause(2000) .perform(() => { diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index e59531468d..c7cc775ace 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -2,7 +2,6 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' import examples from '../examples/example-contracts' const sources = [ @@ -80,9 +79,7 @@ module.exports = { .journalLastChildIncludes('Ballot.delegate(address)') .journalLastChildIncludes('data: 0x5c1...a733c') .end() - }, - - tearDown: sauce + } } const localsCheck = { diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts index 2d40044270..8755c69360 100644 --- a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts +++ b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts @@ -2,7 +2,6 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' import examples from '../examples/example-contracts' const sources = [ @@ -90,9 +89,7 @@ module.exports = { .journalLastChildIncludes('Ballot.delegate(address)') .journalLastChildIncludes('data: 0x5c1...a733c') .end() - }, - - tearDown: sauce + } } const ballotABI = `[ diff --git a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts index c12c210efb..4128a057bd 100644 --- a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts +++ b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts @@ -2,7 +2,6 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' import examples from '../examples/example-contracts' const sources = [ @@ -58,9 +57,7 @@ module.exports = { .clickLaunchIcon('solidity') .waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.', 60000) .end() - }, - - tearDown: sauce + } } const simpleContract = `pragma solidity >=0.4.22 <0.9.1; diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 736e5e6cf7..87a515f6ee 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { @@ -209,9 +208,7 @@ module.exports = { */ .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000) .end() - }, - - tearDown: sauce + } } const sources = [ diff --git a/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts b/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts index b4a13c43dd..c2eb4e5608 100644 --- a/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts +++ b/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -68,7 +67,5 @@ module.exports = { .click('#homeItem') .assert.containsText('div[title="home"]', 'Home') .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/editor.spec.ts b/apps/remix-ide-e2e/src/tests/editor.spec.ts index 2389b64860..82318df288 100644 --- a/apps/remix-ide-e2e/src/tests/editor.spec.ts +++ b/apps/remix-ide-e2e/src/tests/editor.spec.ts @@ -2,7 +2,6 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { @@ -37,7 +36,7 @@ module.exports = { .click('*[class="ace_content"]') .sendKeys('*[class="ace_text-input"]', 'error') .pause(2000) - .waitForElementVisible('.ace_error') + .waitForElementVisible('.ace_error', 60000) .checkAnnotations('error', 28) .clickLaunchIcon('udapp') .checkAnnotationsNotPresent('error') @@ -93,11 +92,11 @@ module.exports = { .openFile('sourcehighlight.js') .executeScript('remix.exeCurrent()') .editorScroll('down', 60) - .waitForElementPresent('.highlightLine32') + .waitForElementPresent('.highlightLine32', 60000) .checkElementStyle('.highlightLine32', 'background-color', 'rgb(8, 108, 181)') - .waitForElementPresent('.highlightLine40') + .waitForElementPresent('.highlightLine40', 60000) .checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)') - .waitForElementPresent('.highlightLine50') + .waitForElementPresent('.highlightLine50', 60000) .checkElementStyle('.highlightLine50', 'background-color', 'rgb(8, 108, 181)') }, @@ -110,7 +109,7 @@ module.exports = { .click('li[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .click('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') - .waitForElementNotPresent('.highlightLine32') + .waitForElementNotPresent('.highlightLine32', 60000) .checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)') .checkElementStyle('.highlightLine50', 'background-color', 'rgb(8, 108, 181)') }, @@ -123,13 +122,11 @@ module.exports = { .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .click('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .pause(2000) - .waitForElementNotPresent('.highlightLine32') - .waitForElementNotPresent('.highlightLine40') - .waitForElementNotPresent('.highlightLine50') + .waitForElementNotPresent('.highlightLine32', 60000) + .waitForElementNotPresent('.highlightLine40', 60000) + .waitForElementNotPresent('.highlightLine50', 60000) .end() - }, - - tearDown: sauce + } } const aceThemes = { diff --git a/apps/remix-ide-e2e/src/tests/fileExplorer b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts similarity index 96% rename from apps/remix-ide-e2e/src/tests/fileExplorer rename to apps/remix-ide-e2e/src/tests/fileExplorer.test.ts index aa54c740d9..e01796cee0 100644 --- a/apps/remix-ide-e2e/src/tests/fileExplorer +++ b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts @@ -1,11 +1,10 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' import * as path from 'path' const testData = { - testFile1: path.resolve(__dirname + '/editor.test.js'), // eslint-disable-line + testFile1: path.resolve(__dirname + '/editor.spec.js'), // eslint-disable-line testFile2: path.resolve(__dirname + '/fileExplorer.test.js'), // eslint-disable-line testFile3: path.resolve(__dirname + '/generalSettings.test.js') // eslint-disable-line } @@ -69,7 +68,7 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]') .rightClick('[data-path="Browser_E2E_Tests"]') .click('*[id="menuitemdelete"]') - .waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]') + .waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]', 60000) .pause(2000) .click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]') @@ -82,11 +81,11 @@ module.exports = { .pause(10000) .waitForElementVisible('*[data-id="fileExplorerNewFilepublishToGist"]') .click('*[data-id="fileExplorerNewFilepublishToGist"]') - .waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]') + .waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]', 60000) .pause(2000) .click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok') .pause(2000) - .waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]') + .waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]', 60000) .pause(2000) .click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok') .pause(2000) @@ -105,11 +104,9 @@ module.exports = { .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1) .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2) .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3) - .waitForElementVisible('[data-id="treeViewLitreeViewItemeditor.test.js"]') + .waitForElementVisible('[data-id="treeViewLitreeViewItemeditor.spec.js"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemfileExplorer.test.js"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemgeneralSettings.test.js"]') .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/fileManager_api b/apps/remix-ide-e2e/src/tests/fileManager_api.spec.ts similarity index 87% rename from apps/remix-ide-e2e/src/tests/fileManager_api rename to apps/remix-ide-e2e/src/tests/fileManager_api.spec.ts index 06817aef38..65dff6d8ea 100644 --- a/apps/remix-ide-e2e/src/tests/fileManager_api +++ b/apps/remix-ide-e2e/src/tests/fileManager_api.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -12,25 +11,22 @@ module.exports = { browser .addFile('file.js', { content: executeFile }) .executeScript('remix.exeCurrent()') - .pause(5000) - .journalLastChildIncludes('file.js') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'file.js', 60000) }, 'Should execute `exists` api from file manager external api': function (browser: NightwatchBrowser) { browser .addFile('exists.js', { content: executeExists }) .executeScript('remix.exeCurrent()') - .pause(2000) - .journalChildIncludes('exists.js true') - .journalChildIncludes('non-exists.js false') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'exists.js true', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', 'non-exists.js false', 60000) }, 'Should execute `open` api from file manager external api': function (browser: NightwatchBrowser) { browser .addFile('open.js', { content: executeOpen }) .executeScript('remix.exeCurrent()') - .pause(2000) - .journalLastChildIncludes('contracts/3_Ballot.sol') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'contracts/3_Ballot.sol', 60000) }, 'Should execute `writeFile` api from file manager external api': function (browser: NightwatchBrowser) { @@ -46,16 +42,14 @@ module.exports = { browser .addFile('readFile.js', { content: executeReadFile }) .executeScript('remix.exeCurrent()') - .pause(2000) - .journalLastChildIncludes('pragma solidity ^0.6.0') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity ^0.6.0', 60000) }, 'Should execute `copyFile` api from file manager external api': function (browser: NightwatchBrowser) { browser .addFile('copyFile.js', { content: executeCopyFile }) .executeScript('remix.exeCurrent()') - .pause(2000) - .journalLastChildIncludes('pragma solidity >=0.7.0 <0.9.0;') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity >=0.7.0 <0.9.0;', 60000) }, 'Should execute `rename` api from file manager external api': function (browser: NightwatchBrowser) { @@ -63,7 +57,7 @@ module.exports = { .addFile('renameFile.js', { content: executeRename }) .executeScript('remix.exeCurrent()') .pause(2000) - .waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]') + .waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000) }, 'Should execute `mkdir` api from file manager external api': function (browser: NightwatchBrowser) { @@ -71,15 +65,14 @@ module.exports = { .addFile('mkdirFile.js', { content: executeMkdir }) .executeScript('remix.exeCurrent()') .pause(2000) - .waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]') + .waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000) }, 'Should execute `readdir` api from file manager external api': function (browser: NightwatchBrowser) { browser .addFile('readdirFile.js', { content: executeReaddir }) .executeScript('remix.exeCurrent()') - .pause(2000) - .journalLastChildIncludes('Test_Folder isDirectory true') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'Test_Folder isDirectory true', 60000) }, 'Should execute `remove` api from file manager external api': function (browser: NightwatchBrowser) { @@ -87,7 +80,7 @@ module.exports = { .addFile('removeFile.js', { content: executeRemove }) .executeScript('remix.exeCurrent()') .pause(2000) - .waitForElementNotPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]') + .waitForElementNotPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000) }, // TODO: Fix remove root directory prefix for browser and localhost @@ -96,11 +89,9 @@ module.exports = { .addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder }) .executeScript('remix.exeCurrent()') .pause(2000) - .waitForElementNotPresent('[data-id="treeViewLitreeViewItemTest_Folder"]') + .waitForElementNotPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000) .end() - }, - - tearDown: sauce + } } const executeFile = ` diff --git a/apps/remix-ide-e2e/src/tests/generalSettings b/apps/remix-ide-e2e/src/tests/generalSettings.test.ts similarity index 99% rename from apps/remix-ide-e2e/src/tests/generalSettings rename to apps/remix-ide-e2e/src/tests/generalSettings.test.ts index ad0b1f2f1c..ad82be23a9 100644 --- a/apps/remix-ide-e2e/src/tests/generalSettings +++ b/apps/remix-ide-e2e/src/tests/generalSettings.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -129,9 +128,7 @@ module.exports = { .checkElementStyle(':root', '--info', remixIdeThemes.cyborg.info) .checkElementStyle(':root', '--warning', remixIdeThemes.cyborg.warning) .checkElementStyle(':root', '--danger', remixIdeThemes.cyborg.danger) - }, - - tearDown: sauce + } } const remixIdeThemes = { diff --git a/apps/remix-ide-e2e/src/tests/gist b/apps/remix-ide-e2e/src/tests/gist.spec.ts similarity index 99% rename from apps/remix-ide-e2e/src/tests/gist rename to apps/remix-ide-e2e/src/tests/gist.spec.ts index cefe41a2ad..249cfadc45 100644 --- a/apps/remix-ide-e2e/src/tests/gist +++ b/apps/remix-ide-e2e/src/tests/gist.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' const testData = { validGistId: '1859c97c6e1efc91047d725d5225888e', @@ -123,7 +122,5 @@ module.exports = { .waitForElementVisible(`div[title='default_workspace/${testData.validGistId}/ApplicationRegistry']`) .assert.containsText(`div[title='default_workspace/${testData.validGistId}/ApplicationRegistry'] > span`, 'ApplicationRegistry') .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/libraryDeployment b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts similarity index 98% rename from apps/remix-ide-e2e/src/tests/libraryDeployment rename to apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts index fd7a364e5d..0a759aa332 100644 --- a/apps/remix-ide-e2e/src/tests/libraryDeployment +++ b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -45,6 +44,7 @@ module.exports = { .click('*[data-id="settingsTabGenerateContractMetadataLabel"]') .clickLaunchIcon('solidity') .click('#compileTabView button[title="Compile"]') // that should generate the JSON artefact + .clickLaunchIcon('udapp') .verifyContracts(['test']) .clickLaunchIcon('udapp') .selectContract('lib') // deploy lib @@ -60,9 +60,7 @@ module.exports = { }) }) .end() - }, - - tearDown: sauce + } } function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFunction) { diff --git a/package.json b/package.json index ac41a7a94c..64635a6f47 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "nightwatch_local_ballot": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", "nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", - "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", + "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=firefox", "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.test.js --env=chrome", "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", @@ -69,7 +69,7 @@ "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.test.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", - "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.test.js --env=chrome", + "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=firefox", "nightwatch_local_workspace": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome", "nightwatch_local_defaultLayout": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome", "nightwatch_local_pluginManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.test.js --env=chrome", @@ -77,10 +77,10 @@ "nightwatch_local_generalSettings": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/generalSettings.test.js --env=chrome", "nightwatch_local_fileExplorer": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileExplorer.test.js --env=chrome", "nightwatch_local_debugger": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger.spec.js --env=chrome", - "nightwatch_local_editor": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/editor.test.js --env=chrome", + "nightwatch_local_editor": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/editor.spec.js --env=chrome", "nightwatch_local_compiler": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/compiler_api.test.js --env=chrome", "nightwatch_local_txListener": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/txListener.test.js --env=chrome", - "nightwatch_local_fileManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileManager_api.test.js --env=chrome", + "nightwatch_local_fileManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileManager_api.spec.js --env=chrome", "nightwatch_local_runAndDeploy": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy", "nightwatch_local_url": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.test.js --env=chrome", "nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.js --env=chrome", From 735c81fbb10d5bb2befd589c823d348ffe0a309c Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 8 Apr 2021 04:45:13 +0100 Subject: [PATCH 15/24] Fixed compiler tests --- .../src/commands/verifyContracts.ts | 5 ++++- .../{pluginManager => pluginManager.spec.ts} | 21 ++++++++----------- ...ublishContract => publishContract.test.ts} | 0 package.json | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) rename apps/remix-ide-e2e/src/tests/{pluginManager => pluginManager.spec.ts} (96%) rename apps/remix-ide-e2e/src/tests/{publishContract => publishContract.test.ts} (100%) diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index 31edfc0983..ae4ca93369 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -28,7 +28,10 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str .waitForElementVisible('*[data-id="treeViewLicompiler/version"]') .assert.containsText('*[data-id="treeViewLicompiler/version"]', `version:\n ${opts.version}`) .modalFooterCancelClick() - .perform(done) + .perform(() => { + done() + callback() + }) } else { compiledContractNames.forEach((name) => { browser.waitForElementContainsText('[data-id="compiledContracts"]', name, 60000) diff --git a/apps/remix-ide-e2e/src/tests/pluginManager b/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts similarity index 96% rename from apps/remix-ide-e2e/src/tests/pluginManager rename to apps/remix-ide-e2e/src/tests/pluginManager.spec.ts index c20ae179a8..bd2884e4e5 100644 --- a/apps/remix-ide-e2e/src/tests/pluginManager +++ b/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' const testData = { pluginName: 'remixIde', @@ -45,23 +44,23 @@ module.exports = { .click('*[data-id="pluginManagerComponentPluginManager"]') .scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]') .pause(2000) - .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]') + .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 60000) .scrollAndClick('*[data-id="pluginManagerComponentActivateButtonvyper"]') - .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]') + .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]', 60000) .scrollAndClick('*[data-id="pluginManagerComponentActivateButtonZoKrates"]') - .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonZoKrates"]') + .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonZoKrates"]', 60000) }, 'Should deactivate plugins': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]') .click('*[data-id="pluginManagerComponentPluginManager"]') - .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]') + .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 60000) .pause(2000) .scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtondebugger"]') - .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]') - .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]') + .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]', 60000) + .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]', 60000) .scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtonvyper"]') - .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtonvyper"]') + .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtonvyper"]', 60000) }, /* @@ -115,7 +114,7 @@ module.exports = { .click('*[data-id="localPluginRadioButtonsidePanel"]') .click('*[data-id="modalDialogModalFooter"]') .modalFooterOKClick() - .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonremixIde"]') + .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonremixIde"]', 60000) }, 'Should display error message for creating already existing plugin': function (browser: NightwatchBrowser) { @@ -153,7 +152,5 @@ module.exports = { }) }) .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/publishContract b/apps/remix-ide-e2e/src/tests/publishContract.test.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/publishContract rename to apps/remix-ide-e2e/src/tests/publishContract.test.ts diff --git a/package.json b/package.json index 64635a6f47..b01964e284 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "nightwatch_local_ballot": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", "nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", - "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=firefox", + "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.test.js --env=chrome", "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", @@ -72,7 +72,7 @@ "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=firefox", "nightwatch_local_workspace": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome", "nightwatch_local_defaultLayout": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome", - "nightwatch_local_pluginManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.test.js --env=chrome", + "nightwatch_local_pluginManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.spec.js --env=chrome", "nightwatch_local_publishContract": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/publishContract.test.js --env=chrome", "nightwatch_local_generalSettings": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/generalSettings.test.js --env=chrome", "nightwatch_local_fileExplorer": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileExplorer.test.js --env=chrome", From d4838bf6829a42a4615586ec1f797197efa4f325 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 8 Apr 2021 04:57:30 +0100 Subject: [PATCH 16/24] Update remixd tests --- apps/remix-ide-e2e/src/tests/{recorder => recorder.spec.ts} | 0 apps/remix-ide-e2e/src/tests/{remixd => remixd.test.ts} | 0 package.json | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename apps/remix-ide-e2e/src/tests/{recorder => recorder.spec.ts} (100%) rename apps/remix-ide-e2e/src/tests/{remixd => remixd.test.ts} (100%) diff --git a/apps/remix-ide-e2e/src/tests/recorder b/apps/remix-ide-e2e/src/tests/recorder.spec.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/recorder rename to apps/remix-ide-e2e/src/tests/recorder.spec.ts diff --git a/apps/remix-ide-e2e/src/tests/remixd b/apps/remix-ide-e2e/src/tests/remixd.test.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/remixd rename to apps/remix-ide-e2e/src/tests/remixd.test.ts diff --git a/package.json b/package.json index b01964e284..c3dbd31dee 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", - "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.test.js --env=chrome", + "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.spec.js --env=chrome", "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.test.js --env=chrome", "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", From c1b52c3547a09b84ef908454cc710dafa4ddbfb7 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 8 Apr 2021 11:20:56 +0100 Subject: [PATCH 17/24] Reduce number or parallel instances --- .circleci/config.yml | 8 ++++---- .../src/tests/{signingMessage => signingMessage.test.ts} | 0 package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename apps/remix-ide-e2e/src/tests/{signingMessage => signingMessage.test.ts} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8588a7d3cb..89aa91d1e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 20 + parallelism: 10 steps: - checkout - run: npm install @@ -96,7 +96,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 20 + parallelism: 10 steps: - checkout - run: npm install @@ -130,7 +130,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 20 + parallelism: 10 steps: - checkout - run: npm install @@ -170,7 +170,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 20 + parallelism: 10 steps: - checkout - run: npm install diff --git a/apps/remix-ide-e2e/src/tests/signingMessage b/apps/remix-ide-e2e/src/tests/signingMessage.test.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/signingMessage rename to apps/remix-ide-e2e/src/tests/signingMessage.test.ts diff --git a/package.json b/package.json index c3dbd31dee..c2281340af 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.spec.js --env=chrome", "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.test.js --env=chrome", - "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", + "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=firefox", "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.test.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", From 1935a458a7384977155dc761a499a73d4f446bc8 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 8 Apr 2021 16:54:41 +0100 Subject: [PATCH 18/24] Fixed solidity imports --- .../src/tests/{solidityImport => solidityImport.spec.ts} | 9 +++------ apps/remix-ide/src/app/ui/renderer.js | 2 +- package.json | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) rename apps/remix-ide-e2e/src/tests/{solidityImport => solidityImport.spec.ts} (91%) diff --git a/apps/remix-ide-e2e/src/tests/solidityImport b/apps/remix-ide-e2e/src/tests/solidityImport.spec.ts similarity index 91% rename from apps/remix-ide-e2e/src/tests/solidityImport rename to apps/remix-ide-e2e/src/tests/solidityImport.spec.ts index ab4e4331b1..e95519898a 100644 --- a/apps/remix-ide-e2e/src/tests/solidityImport +++ b/apps/remix-ide-e2e/src/tests/solidityImport.spec.ts @@ -73,13 +73,10 @@ module.exports = { .addFile('Untitled8.sol', sources[7]['Untitled8.sol']) .clickLaunchIcon('fileExplorers') .clickLaunchIcon('solidity') - .waitForElementPresent('[data-id="compiledErrors"] div:nth-child(3)', 45000) - .scrollAndClick('[data-id="compiledErrors"] div:nth-child(3)') // click on error which point to ERC20 code + .waitForElementVisible('[data-id="https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"]', 120000) + .scrollAndClick('[data-id="https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"]') // click on error which point to ERC20 code .pause(5000) - .getEditorValue((content) => { - browser.assert.ok(content.indexOf('contract ERC20 is Context, IERC20') !== -1, - 'current displayed content should be from the ERC20 source code') - }) + .waitForElementContainsText('#input', 'contract ERC20 is Context, IERC20', 60000) }, 'Test NPM Import (with unpkg.com)': function (browser: NightwatchBrowser) { diff --git a/apps/remix-ide/src/app/ui/renderer.js b/apps/remix-ide/src/app/ui/renderer.js index 21b98fbd85..35cf8395ec 100644 --- a/apps/remix-ide/src/app/ui/renderer.js +++ b/apps/remix-ide/src/app/ui/renderer.js @@ -131,7 +131,7 @@ Renderer.prototype.error = function (message, container, opt) { var $pre = $(opt.useSpan ? yo`` : yo`
`).html(message)
 
   const classList = opt.type === 'error' ? 'alert alert-danger' : 'alert alert-warning'
-  var $error = $(yo`
`).prepend($pre) + var $error = $(yo`
`).prepend($pre) $(container).append($error) $error.click((ev) => { diff --git a/package.json b/package.json index c2281340af..af5dab692f 100644 --- a/package.json +++ b/package.json @@ -60,11 +60,11 @@ "nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", - "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome", + "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.spec.js --env=chrome", "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.spec.js --env=chrome", "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.test.js --env=chrome", - "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=firefox", + "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.test.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", From db0fbd99e0ac64dc44ba831aadf07fb0096ebfc2 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 8 Apr 2021 16:57:16 +0100 Subject: [PATCH 19/24] Remove gist token --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 7cc6acaa7d..8db17993d7 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -gist_token=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 +gist_token= account_passphrase= account_password= NODE_OPTIONS=--max-old-space-size=2048 \ No newline at end of file From 4e4f1f3e90eb2da2342cfabcb568ccfedbe082ad Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 9 Apr 2021 08:32:55 +0100 Subject: [PATCH 20/24] Update config.yml file --- .circleci/config.yml | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 89aa91d1e0..159b51afbd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,8 +66,7 @@ jobs: steps: - checkout - run: npm install - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: name: Download Selenium command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com @@ -100,8 +99,7 @@ jobs: steps: - checkout - run: npm install - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: name: Download Selenium command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com @@ -134,8 +132,7 @@ jobs: steps: - checkout - run: npm install - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: name: Download Selenium command: ./node_modules/.bin/selenium-standalone install --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js @@ -143,12 +140,6 @@ jobs: name: Start Selenium command: ./node_modules/.bin/selenium-standalone start --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js background: true - - run: - name: Download Latest Firefox - command: sudo apt-get purge -y firefox && wget https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb - - run: - name: Install Firefox - command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb - run: ./apps/remix-ide/ci/browser_tests_firefox_1.sh - store_test_results: path: ./reports/tests @@ -174,8 +165,7 @@ jobs: steps: - checkout - run: npm install - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: name: Download Selenium command: ./node_modules/.bin/selenium-standalone install --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js @@ -183,12 +173,6 @@ jobs: name: Start Selenium command: ./node_modules/.bin/selenium-standalone start --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js background: true - - run: - name: Download Latest Firefox - command: sudo apt-get purge -y firefox && wget https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb - - run: - name: Install Firefox - command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb - run: ./apps/remix-ide/ci/browser_tests_firefox_2.sh - store_test_results: path: ./reports/tests @@ -214,8 +198,7 @@ jobs: steps: - checkout - run: npm install - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: name: Download Selenium command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com @@ -249,8 +232,7 @@ jobs: steps: - checkout - run: npm install - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: name: Deploy command: | @@ -278,8 +260,7 @@ jobs: - checkout - setup_remote_docker - run: npm install - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: ./apps/remix-ide/ci/copy_resources.sh - run: ./apps/remix-ide/ci/publishIpfs - run: ./apps/remix-ide/ci/build_and_publish_docker_images.sh @@ -303,9 +284,7 @@ jobs: steps: - checkout - run: npm install - - run: npm run lint - - run: npm run build:libs - - run: npm run build + - run: npx nx build remix-ide --with-deps - run: name: Deploy command: | From 3a6a7d110b30cf7a3c52a662fbd52ce0f662a122 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 9 Apr 2021 14:35:53 +0100 Subject: [PATCH 21/24] Updated remaining test --- .circleci/config.yml | 8 +- .../src/commands/noWorkerErrorFor.ts | 2 +- .../src/tests/publishContract.test.ts | 5 +- apps/remix-ide-e2e/src/tests/recorder.spec.ts | 4 +- apps/remix-ide-e2e/src/tests/remixd.test.ts | 4 +- apps/remix-ide-e2e/src/tests/runAndDeploy.ts | 4 +- .../src/tests/signingMessage.test.ts | 4 +- .../src/tests/solidityImport.spec.ts | 4 +- ...ityUnittests => solidityUnittests.spec.ts} | 77 ++++++++----------- ...cialFunctions => specialFunctions.test.ts} | 4 +- ...{staticAnalysis => staticAnalysis.spec.ts} | 4 +- .../src/tests/{terminal => terminal.test.ts} | 46 +++++------ ...Execution => transactionExecution.spec.ts} | 5 +- .../src/tests/txListener.test.ts | 5 +- .../src/tests/{url => url.spec.ts} | 5 +- ...{usingWebWorker => usingWebWorker.test.ts} | 5 +- ...lIconsPanel => verticalIconsPanel.spec.ts} | 5 +- .../tests/{workspace => workspace.test.ts} | 0 package.json | 12 +-- 19 files changed, 72 insertions(+), 131 deletions(-) rename apps/remix-ide-e2e/src/tests/{solidityUnittests => solidityUnittests.spec.ts} (77%) rename apps/remix-ide-e2e/src/tests/{specialFunctions => specialFunctions.test.ts} (99%) rename apps/remix-ide-e2e/src/tests/{staticAnalysis => staticAnalysis.spec.ts} (97%) rename apps/remix-ide-e2e/src/tests/{terminal => terminal.test.ts} (69%) rename apps/remix-ide-e2e/src/tests/{transactionExecution => transactionExecution.spec.ts} (99%) rename apps/remix-ide-e2e/src/tests/{url => url.spec.ts} (97%) rename apps/remix-ide-e2e/src/tests/{usingWebWorker => usingWebWorker.test.ts} (96%) rename apps/remix-ide-e2e/src/tests/{verticalIconsPanel => verticalIconsPanel.spec.ts} (96%) rename apps/remix-ide-e2e/src/tests/{workspace => workspace.test.ts} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 159b51afbd..e903625688 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 10 + parallelism: 15 steps: - checkout - run: npm install @@ -95,7 +95,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 10 + parallelism: 15 steps: - checkout - run: npm install @@ -128,7 +128,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 10 + parallelism: 15 steps: - checkout - run: npm install @@ -161,7 +161,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 10 + parallelism: 15 steps: - checkout - run: npm install diff --git a/apps/remix-ide-e2e/src/commands/noWorkerErrorFor.ts b/apps/remix-ide-e2e/src/commands/noWorkerErrorFor.ts index bc8abf0146..7a916f34b7 100644 --- a/apps/remix-ide-e2e/src/commands/noWorkerErrorFor.ts +++ b/apps/remix-ide-e2e/src/commands/noWorkerErrorFor.ts @@ -17,7 +17,7 @@ function noWorkerErrorFor (browser: NightwatchBrowser, version: string, callback browser .setSolidityCompilerVersion(version) .click('*[data-id="compilerContainerCompileBtn"]') - .waitForElementPresent('*[data-id="compilationFinishedWith_' + version + '"]', 10000) + .waitForElementPresent('*[data-id="compilationFinishedWith_' + version + '"]', 60000) .notContainsText('*[data-id="compiledErrors"]', 'worker error:undefined') .notContainsText('*[data-id="compiledErrors"]', 'Uncaught RangeError: Maximum call stack size exceeded') .notContainsText('*[data-id="compiledErrors"]', 'RangeError: Maximum call stack size exceeded') diff --git a/apps/remix-ide-e2e/src/tests/publishContract.test.ts b/apps/remix-ide-e2e/src/tests/publishContract.test.ts index 3148f0c346..83cc9dda04 100644 --- a/apps/remix-ide-e2e/src/tests/publishContract.test.ts +++ b/apps/remix-ide-e2e/src/tests/publishContract.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -68,7 +67,5 @@ module.exports = { .waitForElementPresent('*[data-id="contractDropdownIpfsCheckbox"]') .verify.elementPresent('*[data-id="contractDropdownIpfsCheckbox"]:checked') .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/recorder.spec.ts b/apps/remix-ide-e2e/src/tests/recorder.spec.ts index 9f8fd57df4..970a1179f9 100644 --- a/apps/remix-ide-e2e/src/tests/recorder.spec.ts +++ b/apps/remix-ide-e2e/src/tests/recorder.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -87,8 +86,7 @@ module.exports = { 'decoded input': { 'uint256 _po': { type: 'BigNumber', hex: '0x0a' } } }) .end() - }, - tearDown: sauce + } } const sources = [{ diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 4dce35ce1f..b7f00e76cb 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' const assetsTestContract = `import "./contract.sol"; contract Assets { @@ -85,8 +84,7 @@ module.exports = { .clickLaunchIcon('pluginManager') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_remixd"] button') .end() - }, - tearDown: sauce + } } function runTests (browser: NightwatchBrowser) { diff --git a/apps/remix-ide-e2e/src/tests/runAndDeploy.ts b/apps/remix-ide-e2e/src/tests/runAndDeploy.ts index 6b250f5e40..daf86a984c 100644 --- a/apps/remix-ide-e2e/src/tests/runAndDeploy.ts +++ b/apps/remix-ide-e2e/src/tests/runAndDeploy.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' const passphrase = process.env.account_passphrase const password = process.env.account_password @@ -197,8 +196,7 @@ module.exports = { .pause(2000) .journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]') .end() - }, - tearDown: sauce + } } const sources = [ diff --git a/apps/remix-ide-e2e/src/tests/signingMessage.test.ts b/apps/remix-ide-e2e/src/tests/signingMessage.test.ts index 39c0d24ac8..517a19191e 100644 --- a/apps/remix-ide-e2e/src/tests/signingMessage.test.ts +++ b/apps/remix-ide-e2e/src/tests/signingMessage.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -51,8 +50,7 @@ module.exports = { }) }) .end() - }, - tearDown: sauce + } } const sources = [ diff --git a/apps/remix-ide-e2e/src/tests/solidityImport.spec.ts b/apps/remix-ide-e2e/src/tests/solidityImport.spec.ts index e95519898a..17cf38ff0b 100644 --- a/apps/remix-ide-e2e/src/tests/solidityImport.spec.ts +++ b/apps/remix-ide-e2e/src/tests/solidityImport.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -88,8 +87,7 @@ module.exports = { .clickLaunchIcon('fileExplorers') .verifyContracts(['test13', 'ERC20'], { wait: 30000 }) .end() - }, - tearDown: sauce + } } const sources = [ diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts similarity index 77% rename from apps/remix-ide-e2e/src/tests/solidityUnittests rename to apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts index 284adb9efa..c55b2f60bb 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts @@ -2,7 +2,6 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { @@ -48,15 +47,13 @@ module.exports = { .click('*[data-id="testTabCheckAllTests"]') .clickElementAtPosition('.singleTestLabel', 1) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 80000) - .pause(5000) - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'MyTest (/tests/simple_storage_test.sol)') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Initial value should be100') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Value is set200') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Should fail for wrong value200') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Passing: 2') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Failing: 1') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'FAIL MyTest (/tests/simple_storage_test.sol)') + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'MyTest (/tests/simple_storage_test.sol)', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Initial value should be100', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Value is set200', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Should fail for wrong value200', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Passing: 2', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Failing: 1', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'FAIL MyTest (/tests/simple_storage_test.sol)', 120000) }, 'Should run advance unit test using natspec and experimental ABIEncoderV2 `ks2b_test.sol` ': function (browser: NightwatchBrowser) { @@ -68,18 +65,15 @@ module.exports = { .click('*[data-id="testTabCheckAllTests"]') .clickElementAtPosition('.singleTestLabel', 2) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .pause(5000) - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/ks2b_test.sol') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project exists') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong project owner') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong sender') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong value') - .pause(5000) - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project is fundable') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'owner is incorrect') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong sender') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong value') + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/ks2b_test.sol', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project exists', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong project owner', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong sender', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✘ Check wrong value', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '✓ Check project is fundable', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'owner is incorrect', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong sender', 120000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'wrong value', 120000) }, 'Should stop unit tests during test execution` ': function (browser: NightwatchBrowser) { @@ -90,14 +84,11 @@ module.exports = { .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .pause(5000) .click('*[data-id="testTabRunTestsTabStopAction"]') - // .pause(1000) - .assert.containsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/ks2b_test.sol') + .waitForElementContainsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping', 60000) + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/ks2b_test.sol', 120000) .notContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/4_Ballot_test.sol') .notContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/simple_storage_test.sol') - .pause(7000) - .assert.containsText('*[data-id="testTabTestsExecutionStopped"]', 'The test execution has been stopped') + .waitForElementContainsText('*[data-id="testTabTestsExecutionStopped"]', 'The test execution has been stopped', 60000) }, 'Should fail on compilation': function (browser: NightwatchBrowser) { @@ -109,10 +100,8 @@ module.exports = { .click('*[data-id="testTabCheckAllTests"]') .clickElementAtPosition('.singleTestLabel', 3) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'SyntaxError: No visibility specified') - .assert.containsText('*[data-id="testTabTestsExecutionStoppedError"]', 'The test execution has been stopped because of error(s) in your test file') + .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) }, 'Should fail on deploy': function (browser: NightwatchBrowser) { @@ -124,9 +113,7 @@ module.exports = { .click('*[data-id="testTabCheckAllTests"]') .clickElementAtPosition('.singleTestLabel', 4) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'contract deployment failed after trying twice') + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'contract deployment failed after trying twice', 120000) }, 'Should fail when parameters are to method in test contract': function (browser: NightwatchBrowser) { @@ -138,9 +125,7 @@ module.exports = { .click('*[data-id="testTabCheckAllTests"]') .clickElementAtPosition('.singleTestLabel', 5) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') - .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Method \'add\' can not have parameters inside a test contract') + .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'Method \'add\' can not have parameters inside a test contract', 120000) }, 'Changing current path': function (browser: NightwatchBrowser) { @@ -152,7 +137,7 @@ module.exports = { .click('*[data-id="testTabGenerateTestFolder"]') .clickElementAtPosition('.singleTestLabel', 0) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) + .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 60000) .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutput"]') .clearValue('*[data-id="uiPathInput"]') .setValue('*[data-id="uiPathInput"]', 'tests') @@ -161,9 +146,7 @@ module.exports = { 'Solidity Unittests': function (browser: NightwatchBrowser) { runTests(browser) - }, - - tearDown: sauce + } } function runTests (browser: NightwatchBrowser) { @@ -175,11 +158,11 @@ function runTests (browser: NightwatchBrowser) { .clickLaunchIcon('solidityUnitTesting') .pause(500) .scrollAndClick('#runTestsTabRunAction') - .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 10000) - .assert.containsText('#solidityUnittestsOutput', '/tests/4_Ballot_test.sol') - .assert.containsText('#solidityUnittestsOutput', '✓ Check winning proposal') - .assert.containsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value') + .waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000) + .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '/tests/4_Ballot_test.sol', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winning proposal', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value', 60000) .end() } diff --git a/apps/remix-ide-e2e/src/tests/specialFunctions b/apps/remix-ide-e2e/src/tests/specialFunctions.test.ts similarity index 99% rename from apps/remix-ide-e2e/src/tests/specialFunctions rename to apps/remix-ide-e2e/src/tests/specialFunctions.test.ts index 7b0975ac24..9056d43a63 100644 --- a/apps/remix-ide-e2e/src/tests/specialFunctions +++ b/apps/remix-ide-e2e/src/tests/specialFunctions.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -220,8 +219,7 @@ module.exports = { }) }) .end() - }, - tearDown: sauce + } } const sources = [ diff --git a/apps/remix-ide-e2e/src/tests/staticAnalysis b/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts similarity index 97% rename from apps/remix-ide-e2e/src/tests/staticAnalysis rename to apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts index 55f7f04ad6..a68a4a24ce 100644 --- a/apps/remix-ide-e2e/src/tests/staticAnalysis +++ b/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' const sources = [ { @@ -31,8 +30,7 @@ module.exports = { }, 'Static Analysis': function (browser: NightwatchBrowser) { runTests(browser) - }, - tearDown: sauce + } } function runTests (browser: NightwatchBrowser) { diff --git a/apps/remix-ide-e2e/src/tests/terminal b/apps/remix-ide-e2e/src/tests/terminal.test.ts similarity index 69% rename from apps/remix-ide-e2e/src/tests/terminal rename to apps/remix-ide-e2e/src/tests/terminal.test.ts index 3cb9f5351a..448642f4b5 100644 --- a/apps/remix-ide-e2e/src/tests/terminal +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -12,7 +11,7 @@ module.exports = { browser .waitForElementVisible('*[data-id="terminalCli"]', 10000) .executeScript('console.log(1 + 1)') - .journalLastChild('2') + .waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000) }, 'Should clear console': function (browser: NightwatchBrowser) { @@ -20,7 +19,7 @@ module.exports = { .waitForElementVisible('*[data-id="terminalCli"]') .journalChildIncludes('Welcome to Remix') .click('#clearConsole') - .assert.containsText('*[data-id="terminalJournal"]', '') + .waitForElementContainsText('*[data-id="terminalJournal"]', '', 60000) }, 'Should display auto-complete menu': function (browser: NightwatchBrowser) { @@ -35,11 +34,11 @@ module.exports = { browser .waitForElementVisible('*[data-id="terminalCli"]') .executeScript('remix.help()') - .journalChildIncludes('remix.loadgist(id)') - .journalChildIncludes('remix.loadurl(url)') - .journalChildIncludes('remix.execute(filepath)') - .journalChildIncludes('remix.exeCurrent()') - .journalChildIncludes('remix.help()') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.loadgist(id)', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.loadurl(url)', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.execute(filepath)', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.exeCurrent()', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.help()', 60000) }, 'Async/Await Script': function (browser: NightwatchBrowser) { @@ -47,9 +46,8 @@ module.exports = { .addFile('asyncAwait.js', { content: asyncAwait }) .openFile('asyncAwait.js') .executeScript('remix.execute(\'asyncAwait.js\')') - .journalLastChild('Waiting Promise') - .pause(5500) - .journalLastChild('result - Promise Resolved') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', 'result - Promise Resolved', 60000) }, 'Call Remix File Manager from a script': function (browser: NightwatchBrowser) { @@ -58,15 +56,13 @@ module.exports = { .openFile('asyncAwaitWithFileManagerAccess.js') .pause(5000) .executeScript('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')') - .pause(6000) - .journalLastChildIncludes('contract Ballot {') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) }, 'Call web3.eth.getAccounts() using JavaScript VM': function (browser: NightwatchBrowser) { browser .executeScript('web3.eth.getAccounts()') - .pause(2000) - .journalLastChildIncludes('[ "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", "0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB", "0x617F2E2fD72FD9D5503197092aC168c91465E7f2", "0x17F6AD8Ef982297579C203069C1DbfFE4348c372", "0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678", "0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7", "0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C", "0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC", "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c", "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C", "0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB", "0x583031D1113aD414F02576BD6afaBfb302140225", "0xdD870fA1b7C4700F2BD7f44238821C26f7392148" ]') + .waitForElementContainsText('*[data-id="terminalJournal"]', '[ "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", "0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB", "0x617F2E2fD72FD9D5503197092aC168c91465E7f2", "0x17F6AD8Ef982297579C203069C1DbfFE4348c372", "0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678", "0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7", "0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C", "0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC", "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c", "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C", "0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB", "0x583031D1113aD414F02576BD6afaBfb302140225", "0xdD870fA1b7C4700F2BD7f44238821C26f7392148" ]', 60000) }, 'Call web3.eth.getAccounts() using Web3 Provider': function (browser: NightwatchBrowser) { @@ -76,10 +72,9 @@ module.exports = { .click('*[data-id="settingsWeb3Mode"]') .modalFooterOKClick() .executeScript('web3.eth.getAccounts()') - .pause(2000) - .journalLastChildIncludes('[ "') // we check if an array is present, don't need to check for the content - .journalLastChildIncludes('" ]') - .journalLastChildIncludes('", "') + .waitForElementContainsText('*[data-id="terminalJournal"]', '[ "', 60000) // we check if an array is present, don't need to check for the content + .waitForElementContainsText('*[data-id="terminalJournal"]', '" ]', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', '", "', 60000) }, 'Call Remix File Resolver (external URL) from a script': function (browser: NightwatchBrowser) { @@ -89,8 +84,7 @@ module.exports = { .openFile('resolveExternalUrlAndSave.js') .pause(1000) .executeScript('remix.execute(\'resolveExternalUrlAndSave.js\')') - .pause(6000) - .journalLastChildIncludes('Implementation of the {IERC20} interface.') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'Implementation of the {IERC20} interface.', 60000) .openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol') }, @@ -101,8 +95,7 @@ module.exports = { .openFile('resolveUrl.js') .pause(1000) .executeScript('remix.execute(\'resolveUrl.js\')') - .pause(6000) - .journalLastChildIncludes('contract Ballot {') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) }, 'Call Remix File Resolver (internal URL) from a script and specify a path': function (browser: NightwatchBrowser) { @@ -112,13 +105,10 @@ module.exports = { .openFile('resolveExternalUrlAndSaveToaPath.js') .pause(1000) .executeScript('remix.execute(\'resolveExternalUrlAndSaveToaPath.js\')') - .pause(6000) - .journalLastChildIncludes('abstract contract ERC20Burnable') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'abstract contract ERC20Burnable', 60000) .openFile('.deps/github/newFile.sol') .end() - }, - - tearDown: sauce + } } const asyncAwait = ` diff --git a/apps/remix-ide-e2e/src/tests/transactionExecution b/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts similarity index 99% rename from apps/remix-ide-e2e/src/tests/transactionExecution rename to apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts index 25ea116696..17fb82c644 100644 --- a/apps/remix-ide-e2e/src/tests/transactionExecution +++ b/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -139,9 +138,7 @@ module.exports = { .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') .end() - }, - - tearDown: sauce + } } // @TODO test: bytes8[3][] type as input diff --git a/apps/remix-ide-e2e/src/tests/txListener.test.ts b/apps/remix-ide-e2e/src/tests/txListener.test.ts index 3324649e31..7a7b170d6e 100644 --- a/apps/remix-ide-e2e/src/tests/txListener.test.ts +++ b/apps/remix-ide-e2e/src/tests/txListener.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' import examples from '../examples/example-contracts' const sources = [ @@ -45,7 +44,5 @@ module.exports = { 'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' } }) .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/url b/apps/remix-ide-e2e/src/tests/url.spec.ts similarity index 97% rename from apps/remix-ide-e2e/src/tests/url rename to apps/remix-ide-e2e/src/tests/url.spec.ts index f732e53fa1..ec273cab4c 100644 --- a/apps/remix-ide-e2e/src/tests/url +++ b/apps/remix-ide-e2e/src/tests/url.spec.ts @@ -2,7 +2,6 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' import examples from '../examples/example-contracts' const sources = [ @@ -51,7 +50,5 @@ module.exports = { .click('[for="optimize"') .verify.attributeEquals('#runs', 'value', '200') .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/usingWebWorker b/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts similarity index 96% rename from apps/remix-ide-e2e/src/tests/usingWebWorker rename to apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts index b7728bdefc..163fb68af5 100644 --- a/apps/remix-ide-e2e/src/tests/usingWebWorker +++ b/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' const sources = [ { @@ -49,7 +48,5 @@ module.exports = { elem.checked = false }) .end() - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/verticalIconsPanel b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.spec.ts similarity index 96% rename from apps/remix-ide-e2e/src/tests/verticalIconsPanel rename to apps/remix-ide-e2e/src/tests/verticalIconsPanel.spec.ts index a4bbc0dab7..29eaf4a95b 100644 --- a/apps/remix-ide-e2e/src/tests/verticalIconsPanel +++ b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.spec.ts @@ -1,7 +1,6 @@ 'use strict' import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -import sauce from './sauce' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { @@ -29,7 +28,5 @@ module.exports = { .click('*[data-id="verticalIconsKindpluginManager"]') .scrollInto('*[data-id="pluginManagerComponentActivateButtondebugger"]') .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]') - }, - - tearDown: sauce + } } diff --git a/apps/remix-ide-e2e/src/tests/workspace b/apps/remix-ide-e2e/src/tests/workspace.test.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/workspace rename to apps/remix-ide-e2e/src/tests/workspace.test.ts diff --git a/package.json b/package.json index af5dab692f..91ea9b8ccd 100644 --- a/package.json +++ b/package.json @@ -62,14 +62,14 @@ "nightwatch_local_libraryDeployment": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", "nightwatch_local_solidityImport": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.spec.js --env=chrome", "nightwatch_local_recorder": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/recorder.spec.js --env=chrome", - "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.test.js --env=chrome", - "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.test.js --env=chrome", + "nightwatch_local_transactionExecution": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/transactionExecution.spec.js --env=chrome", + "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.js --env=chrome", "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", - "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.test.js --env=chrome", + "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", - "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=firefox", + "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=chrome", "nightwatch_local_workspace": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome", "nightwatch_local_defaultLayout": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome", "nightwatch_local_pluginManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/pluginManager.spec.js --env=chrome", @@ -82,8 +82,8 @@ "nightwatch_local_txListener": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/txListener.test.js --env=chrome", "nightwatch_local_fileManager": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/fileManager_api.spec.js --env=chrome", "nightwatch_local_runAndDeploy": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy", - "nightwatch_local_url": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.test.js --env=chrome", - "nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.js --env=chrome", + "nightwatch_local_url": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.spec.js --env=chrome", + "nightwatch_local_verticalIconscontextmenu": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.spec.js --env=chrome", "onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint", "remixd": "nx build remixd && nx serve remixd --folder=./apps/remix-ide/contracts --remixide=http://127.0.0.1:8080", "selenium": "selenium-standalone start", From 09846eb7a6a5dcba00470e1be2a5881b7e47dd96 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 9 Apr 2021 14:55:10 +0100 Subject: [PATCH 22/24] Remove unnecessary ci instance --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e903625688..286af83822 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 15 + parallelism: 12 steps: - checkout - run: npm install @@ -95,7 +95,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 15 + parallelism: 12 steps: - checkout - run: npm install @@ -128,7 +128,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 15 + parallelism: 12 steps: - checkout - run: npm install @@ -161,7 +161,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 15 + parallelism: 12 steps: - checkout - run: npm install From 6179978779d62dc55d89072554bcb0a0013aa5ef Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Sat, 10 Apr 2021 10:41:24 +0100 Subject: [PATCH 23/24] Made publish to ipfs and e2e tests parallel --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 286af83822..782db0463b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -345,11 +345,7 @@ workflows: - remix-libs - publish: requires: - - remix-ide-chrome-1 - - remix-ide-chrome-2 - - remix-ide-firefox-1 - - remix-ide-firefox-2 - - remix-ide-run-deploy + - remix-libs - deploy-remix-live: requires: - remix-ide-chrome-1 From c592798c4c69943237c886bff6802809caa1657f Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 12 Apr 2021 14:20:25 +0200 Subject: [PATCH 24/24] e2e and remix-lib test in parallel (#1106) --- .circleci/config.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 782db0463b..53a50ff692 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,15 @@ jobs: steps: - checkout - run: npm install + - run: + name: Remix Libs Linting + command: npm run lint:libs + - run: + name: Remix IDE Linting + command: npm run lint + - run: + name: Remix IDE e2e Linting + command: npm run lint remix-ide-e2e - run: npm run lint:libs - run: npm run lint - run: npm run lint remix-ide-e2e @@ -330,22 +339,22 @@ workflows: - lint - remix-ide-chrome-1: requires: - - remix-libs + - lint - remix-ide-chrome-2: requires: - - remix-libs + - lint - remix-ide-firefox-1: requires: - - remix-libs + - lint - remix-ide-firefox-2: requires: - - remix-libs + - lint - remix-ide-run-deploy: requires: - - remix-libs + - lint - publish: requires: - - remix-libs + - lint - deploy-remix-live: requires: - remix-ide-chrome-1