add commands

pull/1647/head
filip mertens 3 years ago
parent 7afb2f2dd0
commit dd5b756ba8
  1. 2
      apps/remix-ide-e2e/src/commands/addFile.ts
  2. 14
      apps/remix-ide-e2e/src/commands/clearConsole.ts
  3. 14
      apps/remix-ide-e2e/src/commands/clearTransactions.ts
  4. 33
      apps/remix-ide-e2e/src/tests/debugger.spec.ts
  5. 2
      apps/remix-ide-e2e/src/types/index.d.ts

@ -30,7 +30,7 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC
.sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER)
// .pause(2000)
.waitForElementVisible(`li[data-id="treeViewLitreeViewItem${name}"]`, 60000)
.setEditorValue(content.content).pause(10000)
.setEditorValue(content.content).pause(2000)
// .pause(1000)
.perform(function () {
done()

@ -0,0 +1,14 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class clearConsole extends EventEmitter {
command (this: NightwatchBrowser): NightwatchBrowser {
this.api.waitForElementVisible('*[data-id="terminalCli"]').click('#clearConsole').perform((done) => {
done()
this.emit('complete')
})
return this
}
}
module.exports = clearConsole

@ -0,0 +1,14 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class clearTransactions extends EventEmitter {
command (this: NightwatchBrowser): NightwatchBrowser {
this.api.clickLaunchIcon('udapp').waitForElementPresent('*[data-id="universalDappUiUdappClose"]').click('*[data-id="universalDappUiUdappClose"]').perform((done) => {
done()
this.emit('complete')
})
return this
}
}
module.exports = clearTransactions

@ -12,7 +12,7 @@ module.exports = {
return sources
},
'Should launch debugger': function (browser: NightwatchBrowser) {
'Should launch debugger': !function (browser: NightwatchBrowser) {
browser.addFile('blah.sol', sources[0]['blah.sol'])
.clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000)
@ -21,7 +21,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
},
'Should debug failing transaction': function (browser: NightwatchBrowser) {
'Should debug failing transaction': !function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
@ -36,7 +36,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="solidityLocals"]', '999', 60000)
},
'Should debug transaction using slider': function (browser: NightwatchBrowser) {
'Should debug transaction using slider': !function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.waitForElementVisible('*[data-id="slider"]')
// eslint-disable-next-line dot-notation
@ -48,7 +48,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000)
},
'Should step back and forward transaction': function (browser: NightwatchBrowser) {
'Should step back and forward transaction': !function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]')
.scrollAndClick('*[data-id="buttonNavigatorIntoBack"]')
@ -61,7 +61,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n51', 60000)
},
'Should jump through breakpoints': function (browser: NightwatchBrowser) {
'Should jump through breakpoints': !function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.execute(() => {
(window as any).addRemixBreakpoint(11)
@ -80,7 +80,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n352', 60000)
},
'Should display solidity imported code while debugging github import': function (browser: NightwatchBrowser) {
'Should display solidity imported code while debugging github import': !function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('solidity')
.testContracts('externalImport.sol', sources[1]['externalImport.sol'], ['ERC20'])
@ -101,7 +101,7 @@ module.exports = {
})
},
'Should display correct source highlighting while debugging a contract which has ABIEncoderV2': function (browser: NightwatchBrowser) {
'Should display correct source highlighting while debugging a contract which has ABIEncoderV2': !function (browser: NightwatchBrowser) {
/*
localVariable_step266_ABIEncoder and localVariable_step717_ABIEncoder
still contains unwanted values (related to decoding calldata types)
@ -142,7 +142,7 @@ module.exports = {
.clickInstance(2)
},
'Should load more solidity locals array': function (browser: NightwatchBrowser) {
'Should load more solidity locals array': !function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('solidity')
.testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals'])
@ -150,10 +150,11 @@ module.exports = {
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 40000)
.createContract('')
.pause(2000)
.clickInstance(3)
.clearConsole()
.clickInstance(0)
.clickFunction('t - transact (not payable)')
.pause(2000)
.debugTransaction(6)
.debugTransaction(0)
.waitForElementVisible('*[data-id="slider"]')
// .setValue('*[data-id="slider"]', '5000') // Like this, setValue doesn't work properly for input type = range
// eslint-disable-next-line dot-notation
@ -162,8 +163,11 @@ module.exports = {
.waitForElementPresent('*[data-id="treeViewDivtreeViewItemarray"]')
.click('*[data-id="treeViewDivtreeViewItemarray"]')
.waitForElementPresent('*[data-id="treeViewDivtreeViewLoadMore"]')
.waitForElementVisible('*[data-id="solidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', '9: 9 uint256', 60000)
.notContainsText('*[data-id="solidityLocals"]', '10: 10 uint256')
.clearTransactions()
.clearConsole()
},
'Should debug using generated sources': function (browser: NightwatchBrowser) {
@ -173,9 +177,10 @@ module.exports = {
.testContracts('withGeneratedSources.sol', sources[4]['withGeneratedSources.sol'], ['A'])
.clickLaunchIcon('udapp')
.createContract('')
.clickInstance(4)
.clearConsole()
.clickInstance(0)
.clickFunction('f - transact (not payable)', { types: 'uint256[] ', values: '[]' })
.debugTransaction(8)
.debugTransaction(0)
.pause(2000)
.click('*[data-id="debuggerTransactionStartButton"]') // stop debugging
.click('*[data-id="debugGeneratedSourcesLabel"]') // select debug with generated sources
@ -187,7 +192,7 @@ module.exports = {
.click('*[data-id="debuggerTransactionStartButton"]')
},
'Should call the debugger api: getTrace': function (browser: NightwatchBrowser) {
'Should call the debugger api: getTrace': !function (browser: NightwatchBrowser) {
browser
.addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()')
@ -195,7 +200,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000)
},
'Should call the debugger api: debug': function (browser: NightwatchBrowser) {
'Should call the debugger api: debug': !function (browser: NightwatchBrowser) {
browser
.addFile('test_jsDebug.js', { content: jsDebug })
.executeScript('remix.exeCurrent()')

@ -59,6 +59,8 @@ declare module 'nightwatch' {
currentWorkspaceIs(name: string): NightwatchBrowser
addLocalPlugin(this: NightwatchBrowser, profile: Profile & LocationProfile & ExternalProfile): NightwatchBrowser
acceptAndRemember (this: NightwatchBrowser, remember: boolean, accept: boolean): NightwatchBrowser
clearConsole (this: NightwatchBrowser): NightwatchBrowser
clearTransactions (this: NightwatchBrowser): NightwatchBrowser
}
export interface NightwatchBrowser {

Loading…
Cancel
Save