Skip to content

Commit 5bdd302

Browse files
authored
Merge branch 'master' into move-appjs-to-appts
2 parents c81b8db + 144fd63 commit 5bdd302

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ import EventEmitter from 'events'
44
const selector = '.udapp_contractNames'
55

66
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'))
1413
return this
1514
}
1615
}
1716

18-
function selectContract (browser: NightwatchBrowser, contractName: string, callback: VoidFunction) {
19-
browser.click(`${selector} option[value="${contractName}"]`).perform(() => callback())
20-
}
21-
2217
module.exports = SelectContract

apps/remix-ide-e2e/src/tests/terminal.test.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,16 @@ module.exports = {
209209
.createContract('')
210210
.getAddressAtPosition(0, (address) => {
211211
addressRef = address
212-
})
213-
.perform((done) => {
214212
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')
216220
})
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+
224222
},
225223

226224
'Should display auto-complete menu #group4': function (browser: NightwatchBrowser) {

0 commit comments

Comments
 (0)