handle any html element receiving click event

pull/3958/head^2
Joseph Izang 1 year ago committed by Aniket
parent e2019edd19
commit 96651b4265
  1. 39
      apps/remix-ide-e2e/src/commands/clickFunction.ts
  2. 2
      libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx
  3. 1
      package.json
  4. 34
      yarn.lock

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

@ -323,7 +323,7 @@ export function ContractGUI(props: ContractGUIProps) {
setProxyAddress(address)
}
console.log({dataId: buttonOptions.dataId})
return (
<div
className={`udapp_contractProperty ${

@ -197,6 +197,7 @@
"regenerator-runtime": "0.13.7",
"remark-gfm": "^3.0.1",
"rss-parser": "^3.12.0",
"selenium-standalone": "^8.2.3",
"signale": "^1.4.0",
"sol2uml": "^2.4.3",
"string-similarity": "^4.0.4",

@ -5036,12 +5036,7 @@
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
"@sindresorhus/is@^4.0.0":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.2.0.tgz#667bfc6186ae7c9e0b45a08960c551437176e1ca"
integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==
"@sindresorhus/is@^4.6.0":
"@sindresorhus/is@^4.0.0", "@sindresorhus/is@^4.6.0":
version "4.6.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f"
integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==
@ -5525,7 +5520,17 @@
dependencies:
"@types/node" "*"
"@types/cacheable-request@^6.0.1", "@types/cacheable-request@^6.0.2":
"@types/cacheable-request@^6.0.1":
version "6.0.3"
resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183"
integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==
dependencies:
"@types/http-cache-semantics" "*"
"@types/keyv" "^3.1.4"
"@types/node" "*"
"@types/responselike" "^1.0.0"
"@types/cacheable-request@^6.0.2":
version "6.0.2"
resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9"
integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==
@ -5750,6 +5755,13 @@
dependencies:
"@types/node" "*"
"@types/keyv@^3.1.4":
version "3.1.4"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6"
integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==
dependencies:
"@types/node" "*"
"@types/lodash@^4.14.172":
version "4.14.176"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.176.tgz#641150fc1cda36fbfa329de603bbb175d7ee20c0"
@ -14704,9 +14716,9 @@ got@12.1.0:
responselike "^2.0.0"
got@^11.8.2:
version "11.8.3"
resolved "https://registry.yarnpkg.com/got/-/got-11.8.3.tgz#f496c8fdda5d729a90b4905d2b07dbd148170770"
integrity sha512-7gtQ5KiPh1RtGS9/Jbv1ofDpBFuq42gyfEib+ejaRBJuj/3tQFeR5+gw57e4ipaU8c/rCjvX6fkQz2lyDlGAOg==
version "11.8.6"
resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a"
integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==
dependencies:
"@sindresorhus/is" "^4.0.0"
"@szmarczak/http-timer" "^4.0.5"
@ -18213,7 +18225,7 @@ lodash.keys@^3.0.0:
lodash.mapvalues@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c"
integrity sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=
integrity sha512-JPFqXFeZQ7BfS00H58kClY7SPVeHertPE0lNuCyZ26/XlN8TvakYD7b9bGyNmXbT/D3BbtPAAmq90gPWqLkxlQ==
lodash.memoize@^4.1.2:
version "4.1.2"

Loading…
Cancel
Save