Merge pull request #5647 from ethereum/terminaltest

Terminaltest
pull/5644/head^2
bunsenstraat 2 weeks ago committed by GitHub
commit 144fd639af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 17
      apps/remix-ide-e2e/src/commands/selectContract.ts
  2. 18
      apps/remix-ide-e2e/src/tests/terminal.test.ts

@ -4,19 +4,14 @@ import EventEmitter from 'events'
const selector = '.udapp_contractNames'
class SelectContract extends EventEmitter {
command (this: NightwatchBrowser, contractName: string): NightwatchBrowser {
this.api.waitForElementVisible(selector).perform((done) => {
selectContract(this.api, contractName, () => {
done()
this.emit('complete')
})
})
command(this: NightwatchBrowser, contractName: string): NightwatchBrowser {
this.api
.waitForElementVisible(selector)
.waitForElementPresent(`${selector} option[value="${contractName}"]`)
.click(`${selector} option[value="${contractName}"]`)
.perform(() => this.emit('complete'))
return this
}
}
function selectContract (browser: NightwatchBrowser, contractName: string, callback: VoidFunction) {
browser.click(`${selector} option[value="${contractName}"]`).perform(() => callback())
}
module.exports = SelectContract

@ -209,18 +209,16 @@ module.exports = {
.createContract('')
.getAddressAtPosition(0, (address) => {
addressRef = address
})
.perform((done) => {
browser.addFile('scripts/test_filtering_event.ts', { content: test_filtering_event.replace('<ADDRESS>', addressRef) })
.perform(() => done())
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')')
.pause(1000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '1')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'true')
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')') // re-emit the event
.waitForElementContainsText('*[data-id="terminalJournal"]', '2')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'false')
})
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')')
.pause(1000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '1')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'true')
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')') // re-emit the event
.waitForElementContainsText('*[data-id="terminalJournal"]', '2')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'false')
},
'Should display auto-complete menu #group4': function (browser: NightwatchBrowser) {

Loading…
Cancel
Save