File tree Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -4,19 +4,14 @@ import EventEmitter from 'events'
4
4
const selector = '.udapp_contractNames'
5
5
6
6
class SelectContract extends EventEmitter {
7
- command ( this : NightwatchBrowser , contractName : string ) : NightwatchBrowser {
8
- this . api . waitForElementVisible ( selector ) . perform ( ( done ) => {
9
- selectContract ( this . api , contractName , ( ) => {
10
- done ( )
11
- this . emit ( 'complete' )
12
- } )
13
- } )
7
+ command ( this : NightwatchBrowser , contractName : string ) : NightwatchBrowser {
8
+ this . api
9
+ . waitForElementVisible ( selector )
10
+ . waitForElementPresent ( `${ selector } option[value="${ contractName } "]` )
11
+ . click ( `${ selector } option[value="${ contractName } "]` )
12
+ . perform ( ( ) => this . emit ( 'complete' ) )
14
13
return this
15
14
}
16
15
}
17
16
18
- function selectContract ( browser : NightwatchBrowser , contractName : string , callback : VoidFunction ) {
19
- browser . click ( `${ selector } option[value="${ contractName } "]` ) . perform ( ( ) => callback ( ) )
20
- }
21
-
22
17
module . exports = SelectContract
Original file line number Diff line number Diff line change @@ -209,18 +209,16 @@ module.exports = {
209
209
. createContract ( '' )
210
210
. getAddressAtPosition ( 0 , ( address ) => {
211
211
addressRef = address
212
- } )
213
- . perform ( ( done ) => {
214
212
browser . addFile ( 'scripts/test_filtering_event.ts' , { content : test_filtering_event . replace ( '<ADDRESS>' , addressRef ) } )
215
- . perform ( ( ) => done ( ) )
213
+ . executeScriptInTerminal ( 'remix.execute(\'scripts/test_filtering_event.ts\')' )
214
+ . pause ( 1000 )
215
+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '1' )
216
+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , 'true' )
217
+ . executeScriptInTerminal ( 'remix.execute(\'scripts/test_filtering_event.ts\')' ) // re-emit the event
218
+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '2' )
219
+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , 'false' )
216
220
} )
217
- . executeScriptInTerminal ( 'remix.execute(\'scripts/test_filtering_event.ts\')' )
218
- . pause ( 1000 )
219
- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '1' )
220
- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , 'true' )
221
- . executeScriptInTerminal ( 'remix.execute(\'scripts/test_filtering_event.ts\')' ) // re-emit the event
222
- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '2' )
223
- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , 'false' )
221
+
224
222
} ,
225
223
226
224
'Should display auto-complete menu #group4' : function ( browser : NightwatchBrowser ) {
You can’t perform that action at this time.
0 commit comments