From 032e8df4a8ebe7648709f83b97446e216b2b2e48 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 11 Jul 2022 12:02:22 +0200 Subject: [PATCH] fix e2e flaky test --- apps/remix-ide-e2e/src/commands/clickFunction.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/clickFunction.ts b/apps/remix-ide-e2e/src/commands/clickFunction.ts index e84be6a0d0..e19426db6a 100644 --- a/apps/remix-ide-e2e/src/commands/clickFunction.ts +++ b/apps/remix-ide-e2e/src/commands/clickFunction.ts @@ -4,16 +4,8 @@ import EventEmitter from 'events' class ClickFunction extends EventEmitter { command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser { this.api.waitForElementPresent('.instance button[title="' + fnFullName + '"]') - .perform(function (client, done) { - client.execute(function () { - document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight - }, [], function () { - if (expectedInput) { - client.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, _ => _) - } - done() - }) - }) + .scrollInto('#runTabView input[title="' + expectedInput.types + '"]') + .setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, _ => _) .scrollAndClick('.instance button[title="' + fnFullName + '"]') .pause(2000) .perform(() => {