Skip to content

Commit 96651b4

Browse files
joeizangAniket-Engg
authored andcommitted
handle any html element receiving click event
1 parent e2019ed commit 96651b4

File tree

4 files changed

+53
-23
lines changed

4 files changed

+53
-23
lines changed

apps/remix-ide-e2e/src/commands/clickFunction.ts

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
1-
import { NightwatchBrowser, NightwatchClickFunctionExpectedInput } from 'nightwatch'
1+
import {
2+
NightwatchBrowser,
3+
NightwatchClickFunctionExpectedInput
4+
} from 'nightwatch'
25
import EventEmitter from 'events'
36

47
class ClickFunction extends EventEmitter {
5-
command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser {
6-
this.api.waitForElementPresent('.instance button[data-title="' + fnFullName + '"]')
8+
command(
9+
this: NightwatchBrowser,
10+
fnFullName: string,
11+
expectedInput?: NightwatchClickFunctionExpectedInput
12+
): NightwatchBrowser {
13+
this.api
14+
.waitForElementPresent('.instance *[data-title="' + fnFullName + '"]')
715
.perform(function (client, done) {
8-
client.execute(function () {
9-
document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight
10-
}, [], function () {
11-
if (expectedInput) {
12-
client.setValue('#runTabView input[data-title="' + expectedInput.types + '"]', expectedInput.values, _ => _)
16+
client.execute(
17+
function () {
18+
document.querySelector('#runTabView').scrollTop =
19+
document.querySelector('#runTabView').scrollHeight
20+
},
21+
[],
22+
function () {
23+
if (expectedInput) {
24+
client.setValue(
25+
'#runTabView input[data-title="' + expectedInput.types + '"]',
26+
expectedInput.values,
27+
(_) => _
28+
)
29+
}
30+
done()
1331
}
14-
done()
15-
})
32+
)
1633
})
17-
.scrollAndClick('.instance button[data-title="' + fnFullName + '"]')
34+
.scrollAndClick('.instance *[data-title="' + fnFullName + '"]')
1835
.pause(2000)
1936
.perform(() => {
2037
this.emit('complete')

libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export function ContractGUI(props: ContractGUIProps) {
323323

324324
setProxyAddress(address)
325325
}
326-
console.log({dataId: buttonOptions.dataId})
326+
327327
return (
328328
<div
329329
className={`udapp_contractProperty ${

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
"regenerator-runtime": "0.13.7",
198198
"remark-gfm": "^3.0.1",
199199
"rss-parser": "^3.12.0",
200+
"selenium-standalone": "^8.2.3",
200201
"signale": "^1.4.0",
201202
"sol2uml": "^2.4.3",
202203
"string-similarity": "^4.0.4",

yarn.lock

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5036,12 +5036,7 @@
50365036
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
50375037
integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
50385038

5039-
"@sindresorhus/is@^4.0.0":
5040-
version "4.2.0"
5041-
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.2.0.tgz#667bfc6186ae7c9e0b45a08960c551437176e1ca"
5042-
integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==
5043-
5044-
"@sindresorhus/is@^4.6.0":
5039+
"@sindresorhus/is@^4.0.0", "@sindresorhus/is@^4.6.0":
50455040
version "4.6.0"
50465041
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f"
50475042
integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==
@@ -5525,7 +5520,17 @@
55255520
dependencies:
55265521
"@types/node" "*"
55275522

5528-
"@types/cacheable-request@^6.0.1", "@types/cacheable-request@^6.0.2":
5523+
"@types/cacheable-request@^6.0.1":
5524+
version "6.0.3"
5525+
resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183"
5526+
integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==
5527+
dependencies:
5528+
"@types/http-cache-semantics" "*"
5529+
"@types/keyv" "^3.1.4"
5530+
"@types/node" "*"
5531+
"@types/responselike" "^1.0.0"
5532+
5533+
"@types/cacheable-request@^6.0.2":
55295534
version "6.0.2"
55305535
resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9"
55315536
integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==
@@ -5750,6 +5755,13 @@
57505755
dependencies:
57515756
"@types/node" "*"
57525757

5758+
"@types/keyv@^3.1.4":
5759+
version "3.1.4"
5760+
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6"
5761+
integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==
5762+
dependencies:
5763+
"@types/node" "*"
5764+
57535765
"@types/lodash@^4.14.172":
57545766
version "4.14.176"
57555767
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.176.tgz#641150fc1cda36fbfa329de603bbb175d7ee20c0"
@@ -14704,9 +14716,9 @@ [email protected]:
1470414716
responselike "^2.0.0"
1470514717

1470614718
got@^11.8.2:
14707-
version "11.8.3"
14708-
resolved "https://registry.yarnpkg.com/got/-/got-11.8.3.tgz#f496c8fdda5d729a90b4905d2b07dbd148170770"
14709-
integrity sha512-7gtQ5KiPh1RtGS9/Jbv1ofDpBFuq42gyfEib+ejaRBJuj/3tQFeR5+gw57e4ipaU8c/rCjvX6fkQz2lyDlGAOg==
14719+
version "11.8.6"
14720+
resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a"
14721+
integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==
1471014722
dependencies:
1471114723
"@sindresorhus/is" "^4.0.0"
1471214724
"@szmarczak/http-timer" "^4.0.5"
@@ -18213,7 +18225,7 @@ lodash.keys@^3.0.0:
1821318225
lodash.mapvalues@^4.6.0:
1821418226
version "4.6.0"
1821518227
resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c"
18216-
integrity sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=
18228+
integrity sha512-JPFqXFeZQ7BfS00H58kClY7SPVeHertPE0lNuCyZ26/XlN8TvakYD7b9bGyNmXbT/D3BbtPAAmq90gPWqLkxlQ==
1821718229

1821818230
lodash.memoize@^4.1.2:
1821918231
version "4.1.2"

0 commit comments

Comments
 (0)