From 1cf484afcc375bffa09db65c0b34822309003968 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 15 Aug 2022 15:23:13 +0200 Subject: [PATCH] fix jumpTo --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 1 + libs/remix-debug/src/debugger/stepManager.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index 5a3ae6ae82..54d8ab64dc 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -11,6 +11,7 @@ class GoToVmTraceStep extends EventEmitter { function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { browser.execute(function (step) { (document.getElementById('slider') as HTMLInputElement).value = (step - 1).toString() }, [step]) + .waitForElementVisible('*[data-id="slider"]') .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) .execute((step) => { (document.querySelector('*[data-id="slider"]') as any).internal_onmouseup({ target: { value: step }}) diff --git a/libs/remix-debug/src/debugger/stepManager.ts b/libs/remix-debug/src/debugger/stepManager.ts index 07693ca62f..004d1bc3f3 100644 --- a/libs/remix-debug/src/debugger/stepManager.ts +++ b/libs/remix-debug/src/debugger/stepManager.ts @@ -15,7 +15,7 @@ export class DebuggerStepManager { this.event = new EventManager() this.debugger = _debugger this.traceManager = traceManager - this.currentStepIndex = 0 + this.currentStepIndex = -1 this.traceLength = 0 this.codeTraceLength = 0 this.revertionPoint = null @@ -34,13 +34,18 @@ export class DebuggerStepManager { this.traceLength = newLength this.codeTraceLength = this.calculateCodeLength() } - this.jumpTo(0) + setTimeout(() => { + this.jumpTo(0) // wait for the ui to render + }, 500) + }) }) this.debugger.callTree.event.register('callTreeReady', () => { if (this.debugger.callTree.functionCallStack.length) { - this.jumpTo(this.debugger.callTree.functionCallStack[0]) + setTimeout(() => { + this.jumpTo(this.debugger.callTree.functionCallStack[0]) // wait for the ui to be render + }, 500) } })