fix flaky test

pull/2603/head^2
yann300 2 years ago committed by Aniket
parent 032e8df4a8
commit 718c7467ee
  1. 14
      apps/remix-ide-e2e/src/commands/clickFunction.ts

@ -4,8 +4,18 @@ import EventEmitter from 'events'
class ClickFunction extends EventEmitter { class ClickFunction extends EventEmitter {
command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser { command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser {
this.api.waitForElementPresent('.instance button[title="' + fnFullName + '"]') this.api.waitForElementPresent('.instance button[title="' + fnFullName + '"]')
.scrollInto('#runTabView input[title="' + expectedInput.types + '"]') .perform(function (client, done) {
.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, _ => _) client.execute(function () {
document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight
}, [], function () {
if (expectedInput) {
client
.scrollInto('#runTabView input[title="' + expectedInput.types + '"]')
.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, _ => _)
}
done()
})
})
.scrollAndClick('.instance button[title="' + fnFullName + '"]') .scrollAndClick('.instance button[title="' + fnFullName + '"]')
.pause(2000) .pause(2000)
.perform(() => { .perform(() => {

Loading…
Cancel
Save