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' const selector = '.udapp_contractNames'
class SelectContract extends EventEmitter { class SelectContract extends EventEmitter {
command (this: NightwatchBrowser, contractName: string): NightwatchBrowser { command(this: NightwatchBrowser, contractName: string): NightwatchBrowser {
this.api.waitForElementVisible(selector).perform((done) => { this.api
selectContract(this.api, contractName, () => { .waitForElementVisible(selector)
done() .waitForElementPresent(`${selector} option[value="${contractName}"]`)
this.emit('complete') .click(`${selector} option[value="${contractName}"]`)
}) .perform(() => this.emit('complete'))
})
return this return this
} }
} }
function selectContract (browser: NightwatchBrowser, contractName: string, callback: VoidFunction) {
browser.click(`${selector} option[value="${contractName}"]`).perform(() => callback())
}
module.exports = SelectContract module.exports = SelectContract

@ -209,18 +209,16 @@ module.exports = {
.createContract('') .createContract('')
.getAddressAtPosition(0, (address) => { .getAddressAtPosition(0, (address) => {
addressRef = address addressRef = address
})
.perform((done) => {
browser.addFile('scripts/test_filtering_event.ts', { content: test_filtering_event.replace('<ADDRESS>', addressRef) }) 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) { 'Should display auto-complete menu #group4': function (browser: NightwatchBrowser) {

Loading…
Cancel
Save