Merge pull request #1114 from ethereum/yann300-patch-30

attempt fixing GoToVmTraceStep
pull/1111/head
yann300 4 years ago committed by GitHub
commit d0b7b58de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .circleci/config.yml
  2. 4
      apps/remix-ide-e2e/src/commands/debugTransaction.ts
  3. 22
      apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts
  4. 5
      apps/remix-ide-e2e/src/commands/testFunction.ts

@ -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:

@ -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())
})
}

@ -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)) {
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()
} 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)
})
}
})
})
}
module.exports = GoToVmTraceStep

@ -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) {

Loading…
Cancel
Save