From c77ae1e322d526d593541d61ac86cf6f8a8cb875 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 17:16:52 +0200 Subject: [PATCH 1/8] attempt fixing GoToVmTraceStep --- .../src/commands/goToVMTraceStep.ts | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index c9da6d8229..88b2be44fa 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,25 +10,11 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - if (!incr) incr = 0 - browser.execute(function () { - return document.querySelector('#stepdetail').innerHTML - }, [], function (result) { - if (typeof result.value === 'string' && (result.value.indexOf('vm trace step:') !== -1 && result.value.indexOf(step.toString()) !== -1)) { - done() - } else if (incr > 1000) { - browser.assert.fail('goToVMtraceStep fails', 'info about error', '') - done() - } else { - incr++ - browser.click('#intoforward') - .perform(() => { - setTimeout(() => { - goToVMtraceStep(browser, step, incr, done) - }, 200) + browser.execute(function () { document.getElementById('slider')['value'] = number - 1 }) // It only moves slider to 50 but vm traces are not updated + .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) + .perform(() => { + done() }) - } - }) } module.exports = GoToVmTraceStep From 602431dac2b3df4e3ca7ed67692a13407fd376d1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 17:18:29 +0200 Subject: [PATCH 2/8] Update goToVMTraceStep.ts --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index 88b2be44fa..e7218ad99e 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,7 +10,7 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { document.getElementById('slider')['value'] = number - 1 }) // It only moves slider to 50 but vm traces are not updated + browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) // It only moves slider to 50 but vm traces are not updated .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) .perform(() => { done() From 454ae4c5105cc922ab2a6b840761af1fd6d7974d Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 17:22:12 +0200 Subject: [PATCH 3/8] remove comment --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index e7218ad99e..6e14c8e3da 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,7 +10,7 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) // It only moves slider to 50 but vm traces are not updated + browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) .perform(() => { done() From cc667aaabf0c015be3b6b29b61bdfcd766aaa1cd Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 16:46:18 +0100 Subject: [PATCH 4/8] e2e linting --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index 6e14c8e3da..aba2c5cb43 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,11 +10,11 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) - .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) - .perform(() => { - done() - }) + browser.execute(function () { (document.getElementById('slider') as HTMLInputElement).value = (step - 1).toString() }) + .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) + .perform(() => { + done() + }) } module.exports = GoToVmTraceStep From 166858e1122dd8e54c07e37c90ee0881774560df Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 16:56:14 +0100 Subject: [PATCH 5/8] Include delay to PR --- apps/remix-ide-e2e/src/commands/debugTransaction.ts | 4 ++-- apps/remix-ide-e2e/src/commands/testFunction.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/debugTransaction.ts b/apps/remix-ide-e2e/src/commands/debugTransaction.ts index 37a63acb9f..67955ea38d 100644 --- a/apps/remix-ide-e2e/src/commands/debugTransaction.ts +++ b/apps/remix-ide-e2e/src/commands/debugTransaction.ts @@ -14,12 +14,12 @@ class debugTransaction extends EventEmitter { } function checkStyle (browser: NightwatchBrowser, index: number, callback: VoidFunction) { - browser.pause(2000).execute(function (index: number) { + browser.pause(5000).execute(function (index: number) { const debugBtn = document.querySelectorAll('*[data-shared="txLoggerDebugButton"]')[index] as HTMLInputElement debugBtn && debugBtn.click() }, [index], function () { - browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]').perform(() => callback()) + browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]', 60000).perform(() => callback()) }) } diff --git a/apps/remix-ide-e2e/src/commands/testFunction.ts b/apps/remix-ide-e2e/src/commands/testFunction.ts index 802bb3103e..e16d613718 100644 --- a/apps/remix-ide-e2e/src/commands/testFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testFunction.ts @@ -22,9 +22,10 @@ class TestFunction extends EventEmitter { }) }) .perform((done) => { - browser.waitForElementVisible(`[data-id="block_tx${txHash}"]`) + browser.waitForElementVisible(`[data-id="block_tx${txHash}"]`, 60000) .click(`[data-id="block_tx${txHash}"]`) - .waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`) + .waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`, 60000) + .pause(10000) // fetch and format transaction logs as key => pair object .elements('css selector', `*[data-shared="key_${txHash}"]`, (res) => { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) { From fc84e64be9eb13a884dadc845eb0be91191f8755 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 17:04:18 +0100 Subject: [PATCH 6/8] Remove duplicate linting steps --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53a50ff692..ab5e15436f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,10 +30,7 @@ jobs: 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 + command: npm run lint remix-ide-e2e remix-libs: docker: From 8b983b9a00b874ae3c54e92cc7b6b4be6e748630 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 17:35:21 +0100 Subject: [PATCH 7/8] Fix highlight line --- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 87a515f6ee..9d3b27fd0e 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -127,7 +127,7 @@ module.exports = { But the debugger uses now validSourcelocation, which means file is not -1. In that case the source highlight at 261 should be the same as for step 262 */ - .waitForElementPresent('.highlightLine7') + .waitForElementPresent('.highlightLine6') .goToVMTraceStep(266) .pause(1000) .checkVariableDebug('soliditylocals', localVariable_step266_ABIEncoder) // locals should not be initiated at this point, only idAsk should From 853b57292a6f311f6cda6faaeaf0bd988823096b Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 18:00:43 +0100 Subject: [PATCH 8/8] Fix trace step --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 2 +- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index aba2c5cb43..e84ab52367 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,7 +10,7 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { (document.getElementById('slider') as HTMLInputElement).value = (step - 1).toString() }) + browser.execute(function (step) { (document.getElementById('slider') as HTMLInputElement).value = (step - 1).toString() }, [step]) .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) .perform(() => { done() diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 9d3b27fd0e..87a515f6ee 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -127,7 +127,7 @@ module.exports = { But the debugger uses now validSourcelocation, which means file is not -1. In that case the source highlight at 261 should be the same as for step 262 */ - .waitForElementPresent('.highlightLine6') + .waitForElementPresent('.highlightLine7') .goToVMTraceStep(266) .pause(1000) .checkVariableDebug('soliditylocals', localVariable_step266_ABIEncoder) // locals should not be initiated at this point, only idAsk should