From a50ebd9522007ce662277de98a9c9973050b2c3b Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 14 Sep 2022 17:34:53 +0200 Subject: [PATCH 1/6] fix test --- apps/remix-ide-e2e/src/tests/ballot.test.ts | 49 ++++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index fc090988e1..e4522498f8 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -9,13 +9,18 @@ const sources = [ ] module.exports = { + "@disabled": true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done) }, '@sources': function () { return sources }, - 'Deploy Ballot': function (browser: NightwatchBrowser) { + 'Add Ballot #group2': function (browser: NightwatchBrowser) { + browser + .addFile('Untitled.sol', sources[0]['Untitled.sol']) + }, + 'Deploy Ballot #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .clickLaunchIcon('solidity') @@ -34,7 +39,7 @@ module.exports = { }) }, - 'Call method from Ballot to check return value': function (browser: NightwatchBrowser) { + 'Call method from Ballot to check return value #group1': function (browser: NightwatchBrowser) { browser .clickFunction('winnerName - call') // Test in terminal @@ -47,7 +52,7 @@ module.exports = { .assert.containsText('*[data-id="treeViewDiv0"]', 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000') }, - 'Debug Ballot / delegate': function (browser: NightwatchBrowser) { + 'Debug Ballot / delegate #group1': function (browser: NightwatchBrowser) { browser.pause(500) .debugTransaction(1) .waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') @@ -60,16 +65,24 @@ module.exports = { .checkVariableDebug('soliditylocals', localsCheck) }, - 'Access Ballot via at address': function (browser: NightwatchBrowser) { + 'Access Ballot via at address #group1': function (browser: NightwatchBrowser) { browser.clickLaunchIcon('udapp') .click('*[data-id="universalDappUiUdappClose"]') .addFile('ballot.abi', { content: ballotABI }) + .clickLaunchIcon('udapp') + .click({ + selector: '*[data-id="deployAndRunClearInstances"]', + abortOnFailure: false, + suppressNotFoundErrors: true, + }) // we are not changing the visibility for not checksumed contracts // .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3B', true, false) .clickLaunchIcon('filePanel') .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true) - .pause(500) - .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) + .waitForElementVisible({ + locateStrategy: 'xpath', + selector: "//*[@id='instance0x692a70D2e424a56D2C6C27aA97D1a86395877b3A']" + }) .clickInstance(0) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', @@ -79,19 +92,11 @@ module.exports = { }) }, - 'Deploy and use Ballot using external web3': function (browser: NightwatchBrowser) { + 'Deploy and use Ballot using external web3 #group2': function (browser: NightwatchBrowser) { browser .openFile('Untitled.sol') .clickLaunchIcon('udapp') - .switchEnvironment('External Http Provider') - .waitForElementPresent('[data-id="basic-http-provider-modal-footer-ok-react"]') - .execute(function () { - const modal = document.querySelector('[data-id="basic-http-provider-modal-footer-ok-react"]') as any - - modal.click() - }) - .pause(5000) - .waitForElementContainsText('#selectExEnvOptions button', 'External Http Provider') + .connectToExternalHttpProvider('http://localhost:8545', 'Custom') .clickLaunchIcon('solidity') .clickLaunchIcon('udapp') .pause(2000) @@ -105,7 +110,7 @@ module.exports = { .journalLastChildIncludes('data: 0x5c1...a733c') }, - 'Call method from Ballot to check return value using external web3': function (browser: NightwatchBrowser) { + 'Call method from Ballot to check return value using external web3 #group2': function (browser: NightwatchBrowser) { browser .clickFunction('winnerName - call') // Test in terminal @@ -118,9 +123,9 @@ module.exports = { .assert.containsText('*[data-id="treeViewDiv0"]', 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000') }, - 'Compile Ballot using config file': function (browser: NightwatchBrowser) { + 'Compile Ballot using config file #group2': function (browser: NightwatchBrowser) { browser - .addFile('cf.json', {content: configFile}) + .addFile('cf.json', { content: configFile }) .clickLaunchIcon('solidity') .waitForElementVisible('*[data-id="scConfigExpander"]') .click('*[data-id="scConfigExpander"]') @@ -133,12 +138,12 @@ module.exports = { .setValue('*[data-id="scConfigFilePathInput"]', 'cf.json') .sendKeys('*[data-id$="scConfigFilePathInput"]', browser.Keys.ENTER) .openFile('Untitled.sol') - .verifyContracts(['Ballot'], {wait: 2000, runs: '300'}) + .verifyContracts(['Ballot'], { wait: 2000, runs: '300' }) }, - 'Compile and deploy sample yul file': function (browser: NightwatchBrowser) { + 'Compile and deploy sample yul file #group2': function (browser: NightwatchBrowser) { browser - .addFile('sample.yul', {content: yulSample}) + .addFile('sample.yul', { content: yulSample }) .clickLaunchIcon('solidity') .waitForElementVisible('*[data-id="scConfigExpander"]') .click('*[data-id="scManualConfiguration"]') From 7ec3814da22887caf356a1f15d8649b732bcb982 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 14 Sep 2022 17:49:39 +0200 Subject: [PATCH 2/6] fix ballot --- .circleci/config.yml | 4 +-- .../src/tests/ballot_0_4_11.test.ts | 30 +++++++++++++------ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c13a22045..68067dc539 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -111,7 +111,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 80 + parallelism: 90 steps: - browser-tools/install-chrome - browser-tools/install-chromedriver @@ -197,7 +197,7 @@ jobs: - COMMIT_AUTHOR: "Circle CI" working_directory: ~/remix-project - parallelism: 80 + parallelism: 90 steps: - browser-tools/install-firefox - browser-tools/install-geckodriver 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 9a36ad67f4..c359cb0889 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 @@ -9,13 +9,14 @@ const sources = [ ] module.exports = { + '@disabled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, null, false) }, '@sources': function () { return sources }, - 'Compile Ballot with compiler version 0.4.11': function (browser: NightwatchBrowser) { + 'Compile Ballot with compiler version 0.4.11 #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .clickLaunchIcon('solidity') @@ -26,7 +27,7 @@ module.exports = { .testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['Ballot']) }, - 'Deploy Ballot': function (browser: NightwatchBrowser) { + 'Deploy Ballot #group1': function (browser: NightwatchBrowser) { browser.pause(500) .clickLaunchIcon('udapp') .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') @@ -42,7 +43,7 @@ module.exports = { }) }, - 'Debug Ballot / delegate': function (browser: NightwatchBrowser) { + 'Debug Ballot / delegate #group1': function (browser: NightwatchBrowser) { browser.pause(500) .debugTransaction(1) .pause(2000) @@ -55,26 +56,37 @@ module.exports = { .checkVariableDebug('callstackpanel', ['0x692a70D2e424a56D2C6C27aA97D1a86395877b3A']) }, - 'Access Ballot via at address': function (browser: NightwatchBrowser) { + 'Access Ballot via at address #group1': function (browser: NightwatchBrowser) { browser.clickLaunchIcon('udapp') .click('*[data-id="universalDappUiUdappClose"]') .addFile('ballot.abi', { content: ballotABI }) + .clickLaunchIcon('udapp') + .click({ + selector: '*[data-id="deployAndRunClearInstances"]', + abortOnFailure: false, + suppressNotFoundErrors: true, + }) // we are not changing the visibility for not checksumed contracts // .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3B', true, false) .clickLaunchIcon('filePanel') .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true) - .pause(500) - .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) + .waitForElementVisible({ + locateStrategy: 'xpath', + selector: "//*[@id='instance0x692a70D2e424a56D2C6C27aA97D1a86395877b3A']" + }) .clickInstance(0) .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', { - status: 'true Transaction mined and execution succeed', + status: 'false Transaction mined but execution failed', 'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' } }) }, - - 'Deploy and use Ballot using external web3': function (browser: NightwatchBrowser) { + 'Add Ballot #group2': function (browser: NightwatchBrowser) { + browser + .addFile('Untitled.sol', sources[0]['Untitled.sol']) + }, + 'Deploy and use Ballot using external web3 #group2': function (browser: NightwatchBrowser) { browser .openFile('Untitled.sol') .clickLaunchIcon('udapp') From 3a68afe6bb104483fbc2d7f992a7990a717be468 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 15 Sep 2022 11:16:05 +0200 Subject: [PATCH 3/6] fix --- apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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 c359cb0889..934a9026e2 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 @@ -90,25 +90,18 @@ module.exports = { browser .openFile('Untitled.sol') .clickLaunchIcon('udapp') - .switchEnvironment('External Http Provider') - .waitForElementPresent('[data-id="basic-http-provider-modal-footer-ok-react"]') - .execute(function () { - const modal = document.querySelector('[data-id="basic-http-provider-modal-footer-ok-react"]') as any - - modal.click() - }) + .connectToExternalHttpProvider('http://localhost:8545', 'Custom') .clickLaunchIcon('solidity') .clickLaunchIcon('udapp') .pause(2000) - .clearValue('input[placeholder="uint8 _numProposals"]') - .setValue('input[placeholder="uint8 _numProposals"]', '2') + .clearValue('input[placeholder="bytes32[] proposalNames"]') + .setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]') .click('*[data-id="Deploy - transact (not payable)"]') .clickInstance(0) .click('*[data-id="terminalClearConsole"]') .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' }) .journalLastChildIncludes('Ballot.delegate(address)') .journalLastChildIncludes('data: 0x5c1...a733c') - .end() } } From 87426c7f761fe6b03a213f4784728241393b46f1 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 15 Sep 2022 11:35:58 +0200 Subject: [PATCH 4/6] fix --- .../remix-ide-e2e/src/tests/ballot_0_4_11.test.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 934a9026e2..60804960a6 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 @@ -16,7 +16,7 @@ module.exports = { '@sources': function () { return sources }, - 'Compile Ballot with compiler version 0.4.11 #group1': function (browser: NightwatchBrowser) { + 'Set Ballot 0.4.11': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .clickLaunchIcon('solidity') @@ -24,6 +24,9 @@ module.exports = { .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') .verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked') + }, + 'Compile Ballot with compiler version 0.4.11 #group1': function (browser: NightwatchBrowser) { + browser .testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['Ballot']) }, @@ -82,20 +85,16 @@ module.exports = { 'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' } }) }, - 'Add Ballot #group2': function (browser: NightwatchBrowser) { - browser - .addFile('Untitled.sol', sources[0]['Untitled.sol']) - }, 'Deploy and use Ballot using external web3 #group2': function (browser: NightwatchBrowser) { browser - .openFile('Untitled.sol') + .clickLaunchIcon('udapp') .connectToExternalHttpProvider('http://localhost:8545', 'Custom') .clickLaunchIcon('solidity') .clickLaunchIcon('udapp') .pause(2000) - .clearValue('input[placeholder="bytes32[] proposalNames"]') - .setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]') + .clearValue('input[placeholder="uint8 _numProposals"]') + .setValue('input[placeholder="uint8 _numProposals"]', '2') .click('*[data-id="Deploy - transact (not payable)"]') .clickInstance(0) .click('*[data-id="terminalClearConsole"]') From 1b1ac6899d82bbca5a528afdff5055fbbafd92ce Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 15 Sep 2022 11:37:51 +0200 Subject: [PATCH 5/6] fix --- apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 60804960a6..a372660b9b 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 @@ -25,7 +25,7 @@ module.exports = { .click('[for="autoCompile"]') .verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked') }, - 'Compile Ballot with compiler version 0.4.11 #group1': function (browser: NightwatchBrowser) { + 'Compile Ballot with compiler version 0.4.11 #group1 #group2': function (browser: NightwatchBrowser) { browser .testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['Ballot']) }, From 05d3c68e5e5a058039ebf50c1eb05b38e7032646 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 15 Sep 2022 11:54:18 +0200 Subject: [PATCH 6/6] Update ballot_0_4_11.test.ts --- apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a372660b9b..8add772114 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 @@ -81,7 +81,7 @@ module.exports = { .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', { - status: 'false Transaction mined but execution failed', + status: 'true Transaction mined and execution succeed', 'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' } }) },