Unverified Commit d76a5b6b authored by David Disu's avatar David Disu Committed by GitHub

Merge pull request #1041 from ethereum/optimise-e2e

Optimise e2e
parents 25031843 61799787
This diff is collapsed.
......@@ -18,11 +18,11 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC
.clickLaunchIcon('fileExplorers')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory
.click('.newFile')
.waitForElementVisible('*[data-id="treeViewLitreeViewItem/blank"]')
.waitForElementContainsText('*[data-id="treeViewLitreeViewItem/blank"]', '', 60000)
.sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', name)
.sendKeys('*[data-id="treeViewLitreeViewItem/blank"] .remixui_items', browser.Keys.ENTER)
.pause(2000)
.waitForElementVisible(`li[data-id="treeViewLitreeViewItem${name}"]`)
.waitForElementVisible(`li[data-id="treeViewLitreeViewItem${name}"]`, 60000)
.setEditorValue(content.content)
.pause(1000)
.perform(function () {
......
......@@ -22,7 +22,6 @@ function checkDebug (browser: NightwatchBrowser, id: string, debugValue: Nightwa
return elem.innerText
}, [id], function (result) {
console.log(id + ' ' + result.value)
let value
try {
value = JSON.parse(<string>result.value)
......
......@@ -6,7 +6,7 @@ class ClickInstance extends EventEmitter {
index = index + 2
const selector = '.instance:nth-of-type(' + index + ') > div > button'
this.api.waitForElementPresent(selector).scrollAndClick(selector).perform(() => { this.emit('complete') })
this.api.waitForElementContainsText(selector, '', 60000).scrollAndClick(selector).perform(() => { this.emit('complete') })
return this
}
}
......
......@@ -14,7 +14,6 @@ function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number
browser.execute(function () {
return document.querySelector('#stepdetail').innerHTML
}, [], function (result) {
console.log('goToVMtraceStep', result)
if (typeof result.value === 'string' && (result.value.indexOf('vm trace step:') !== -1 && result.value.indexOf(step.toString()) !== -1)) {
done()
} else if (incr > 1000) {
......
......@@ -17,7 +17,7 @@ function noWorkerErrorFor (browser: NightwatchBrowser, version: string, callback
browser
.setSolidityCompilerVersion(version)
.click('*[data-id="compilerContainerCompileBtn"]')
.waitForElementPresent('*[data-id="compilationFinishedWith_' + version + '"]', 10000)
.waitForElementPresent('*[data-id="compilationFinishedWith_' + version + '"]', 60000)
.notContainsText('*[data-id="compiledErrors"]', 'worker error:undefined')
.notContainsText('*[data-id="compiledErrors"]', 'Uncaught RangeError: Maximum call stack size exceeded')
.notContainsText('*[data-id="compiledErrors"]', 'RangeError: Maximum call stack size exceeded')
......
......@@ -16,7 +16,7 @@ class OpenFile extends EventEmitter {
// click on fileExplorer can toggle it. We go through settings to be sure FE is open
function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) {
browser.clickLaunchIcon('settings').clickLaunchIcon('fileExplorers')
.waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"')
.waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000)
.click('li[data-id="treeViewLitreeViewItem' + name + '"')
.pause(2000)
.perform(() => {
......
import { NightwatchBrowser, NightwatchCallbackResult } from 'nightwatch'
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class VerifyContracts extends EventEmitter {
......@@ -13,11 +13,11 @@ class VerifyContracts extends EventEmitter {
}
}
function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number, version?: string }, callback: (result: NightwatchCallbackResult<any>) => void) {
function verifyContracts (browser: NightwatchBrowser, compiledContractNames: string[], opts: { wait: number, version?: string }, callback: VoidFunction) {
browser
.clickLaunchIcon('solidity')
.pause(opts.wait)
.waitForElementPresent('*[data-id="compiledContracts"] option')
.waitForElementPresent('*[data-id="compiledContracts"] option', 60000)
.perform((done) => {
if (opts.version) {
browser
......@@ -28,45 +28,18 @@ function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number,
.waitForElementVisible('*[data-id="treeViewLicompiler/version"]')
.assert.containsText('*[data-id="treeViewLicompiler/version"]', `version:\n ${opts.version}`)
.modalFooterCancelClick()
.perform(done)
} else done()
})
.execute(function () {
const contracts = document.querySelectorAll('*[data-id="compiledContracts"] option') as NodeListOf<HTMLInputElement>
if (!contracts) {
return null
.perform(() => {
done()
callback()
})
} else {
const ret = []
for (let c = 0; c < contracts.length; c++) {
ret.push(contracts[c].value)
}
return ret
compiledContractNames.forEach((name) => {
browser.waitForElementContainsText('[data-id="compiledContracts"]', name, 60000)
})
done()
callback()
}
}, [], function (result) {
callback(result)
})
}
function verifyContracts (browser: NightwatchBrowser, compiledContractNames: string[], opts: { wait: number, version?: string }, callback: VoidFunction) {
getCompiledContracts(browser, opts, (result: NightwatchCallbackResult<any>) => {
if (result.value) {
for (const contract in compiledContractNames) {
console.log(' - ' + compiledContractNames[contract], result.value)
if (result.value.indexOf(compiledContractNames[contract]) === -1) {
browser.assert.fail('compiled contract ' + compiledContractNames + ' not found', 'info about error', '')
browser.end()
return
}
}
} else {
browser.assert.fail('compiled contract ' + compiledContractNames + ' not found - none found', 'info about error', '')
browser.end()
}
console.log('contracts all found ' + compiledContractNames)
callback()
})
}
module.exports = VerifyContracts
......@@ -2,22 +2,23 @@ import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class WaitForElementContainsText extends EventEmitter {
command (this: NightwatchBrowser, id: string, value: string): NightwatchBrowser {
let incr = 0
command (this: NightwatchBrowser, id: string, value: string, timeout = 10000): NightwatchBrowser {
let waitId // eslint-disable-line
const runid = setInterval(() => {
this.api.getText(id, (result) => {
if (typeof result.value === 'string' && value.indexOf(result.value || '') !== -1) {
if (typeof result.value === 'string' && result.value.indexOf(value) !== -1) {
clearInterval(runid)
clearTimeout(waitId)
this.api.assert.ok(true, `WaitForElementContainsText ${id} contains ${value}`)
this.emit('complete')
} else incr++
if (incr > 50) {
clearInterval(runid)
this.api.assert.fail(`WaitForElementContainsText - expected ${value} but got ${result.value}`)
// throw new Error(`WaitForElementContainsText ${id} ${value}`)
}
})
}, 200)
waitId = setTimeout(() => {
clearInterval(runid)
this.api.assert.fail(`TimeoutError: An error occurred while running .waitForElementContainsText() command on ${id} after ${timeout} milliseconds`)
}, timeout)
return this
}
}
......
......@@ -2,7 +2,6 @@
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
import examples from '../examples/example-contracts'
const sources = [
......@@ -25,7 +24,7 @@ module.exports = {
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c')
.setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]')
.click('*[data-id="Deploy - transact (not payable)"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000)
.click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
......@@ -39,12 +38,10 @@ module.exports = {
browser.pause(500)
.click('*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]')
.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
// .clickLaunchIcon('debugger')
.click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.pause(2000)
.waitForElementVisible('#stepdetail')
.goToVMTraceStep(144)
// .pause(1000)
.checkVariableDebug('soliditystate', stateCheck)
.checkVariableDebug('soliditylocals', localsCheck)
},
......@@ -57,7 +54,7 @@ module.exports = {
.clickLaunchIcon('fileExplorers')
.addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true)
.pause(500)
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000)
.click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
......@@ -82,9 +79,7 @@ module.exports = {
.journalLastChildIncludes('Ballot.delegate(address)')
.journalLastChildIncludes('data: 0x5c1...a733c')
.end()
},
tearDown: sauce
}
}
const localsCheck = {
......
......@@ -2,7 +2,6 @@
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
import examples from '../examples/example-contracts'
const sources = [
......@@ -34,7 +33,7 @@ module.exports = {
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c')
.setValue('input[placeholder="uint8 _numProposals"]', '2')
.click('*[data-id="Deploy - transact (not payable)"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000)
.click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
......@@ -65,7 +64,7 @@ module.exports = {
.clickLaunchIcon('fileExplorers')
.addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true)
.pause(500)
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000)
.click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
......@@ -90,9 +89,7 @@ module.exports = {
.journalLastChildIncludes('Ballot.delegate(address)')
.journalLastChildIncludes('data: 0x5c1...a733c')
.end()
},
tearDown: sauce
}
}
const ballotABI = `[
......
......@@ -2,7 +2,6 @@
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
import examples from '../examples/example-contracts'
const sources = [
......@@ -22,8 +21,7 @@ module.exports = {
browser
.addFile('test_jsCompile.js', { content: jsCompile })
.executeScript('remix.exeCurrent()')
.pause(5000)
.journalChildIncludes('"languageversion": "0.6.8+commit.0bbfe453"')
.waitForElementContainsText('*[data-id="terminalJournal"]', '"languageversion": "0.6.8+commit.0bbfe453"', 60000)
.click('*[data-id="terminalClearConsole"]')
},
......@@ -31,8 +29,7 @@ module.exports = {
browser
.addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization })
.executeScript('remix.exeCurrent()')
.pause(10000)
.journalChildIncludes('\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}')
.waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}', 60000)
.click('*[data-id="terminalClearConsole"]')
},
......@@ -40,8 +37,7 @@ module.exports = {
browser
.addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault })
.executeScript('remix.exeCurrent()')
.pause(10000)
.journalChildIncludes('\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}')
.waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}', 60000)
.click('*[data-id="terminalClearConsole"]')
},
......@@ -56,16 +52,12 @@ module.exports = {
'Should produce a stack too deep error': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('fileExplorers')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"')
.setSolidityCompilerVersion('soljson-v0.8.1+commit.df193b15.js')
.addFile('ContractStackLimit.sol', { content: contractStackLimit })
.clickLaunchIcon('solidity')
.pause(10000)
.waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.')
.waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.', 60000)
.end()
},
tearDown: sauce
}
}
const simpleContract = `pragma solidity >=0.4.22 <0.9.1;
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
......@@ -19,7 +18,7 @@ module.exports = {
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000)
.click('*[title="Deploy - transact (not payable)"]')
.debugTransaction(0)
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER')
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
},
'Should debug failing transaction': function (browser: NightwatchBrowser) {
......@@ -33,8 +32,8 @@ module.exports = {
.debugTransaction(1)
.pause(2000)
.scrollAndClick('*[data-id="solidityLocals"]')
.assert.containsText('*[data-id="solidityLocals"]', 'toast')
.assert.containsText('*[data-id="solidityLocals"]', '999')
.waitForElementContainsText('*[data-id="solidityLocals"]', 'toast', 60000)
.waitForElementContainsText('*[data-id="solidityLocals"]', '999', 60000)
},
'Should debug transaction using slider': function (browser: NightwatchBrowser) {
......@@ -45,8 +44,8 @@ module.exports = {
.setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW))
.pause(2000)
.click('*[data-id="dropdownPanelSolidityLocals"]')
.assert.containsText('*[data-id="solidityLocals"]', 'no locals')
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n51')
.waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000)
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000)
},
'Should step back and forward transaction': function (browser: NightwatchBrowser) {
......@@ -54,12 +53,12 @@ module.exports = {
.waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]')
.scrollAndClick('*[data-id="buttonNavigatorIntoBack"]')
.pause(2000)
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n50')
.assert.containsText('*[data-id="stepdetail"]', 'execution step:\n50')
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n50', 60000)
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n50', 60000)
.click('*[data-id="buttonNavigatorIntoForward"]')
.pause(2000)
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n51')
.assert.containsText('*[data-id="stepdetail"]', 'execution step:\n51')
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000)
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n51', 60000)
},
'Should jump through breakpoints': function (browser: NightwatchBrowser) {
......@@ -69,12 +68,12 @@ module.exports = {
.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.pause(2000)
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n0')
.assert.containsText('*[data-id="stepdetail"]', 'execution step:\n0')
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n0', 60000)
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n0', 60000)
.click('*[data-id="buttonNavigatorJumpNextBreakpoint"]')
.pause(10000)
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n348')
.assert.containsText('*[data-id="stepdetail"]', 'execution step:\n348')
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n348', 60000)
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n348', 60000)
},
'Should display solidity imported code while debugging github import': function (browser: NightwatchBrowser) {
......@@ -159,7 +158,7 @@ module.exports = {
.waitForElementPresent('*[data-id="treeViewDivtreeViewItemarray"]')
.click('*[data-id="treeViewDivtreeViewItemarray"]')
.waitForElementPresent('*[data-id="treeViewDivtreeViewLoadMore"]')
.assert.containsText('*[data-id="solidityLocals"]', '9: 9 uint256')
.waitForElementContainsText('*[data-id="solidityLocals"]', '9: 9 uint256', 60000)
.notContainsText('*[data-id="solidityLocals"]', '10: 10 uint256')
},
......@@ -188,8 +187,7 @@ module.exports = {
browser
.addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()')
.pause(5000)
.journalChildIncludes('result { "gas": "0x5863", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'result { "gas": "0x5863", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":', 60000)
},
'Should call the debugger api: debug': function (browser: NightwatchBrowser) {
......@@ -208,11 +206,9 @@ module.exports = {
=> There is something going wrong with the nightwatch API here.
As we are only testing if debugger is active, this is ok to keep that for now.
*/
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n154')
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000)
.end()
},
tearDown: sauce
}
}
const sources = [
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -68,7 +67,5 @@ module.exports = {
.click('#homeItem')
.assert.containsText('div[title="home"]', 'Home')
.end()
},
tearDown: sauce
}
}
......@@ -2,7 +2,6 @@
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
......@@ -37,7 +36,7 @@ module.exports = {
.click('*[class="ace_content"]')
.sendKeys('*[class="ace_text-input"]', 'error')
.pause(2000)
.waitForElementVisible('.ace_error')
.waitForElementVisible('.ace_error', 60000)
.checkAnnotations('error', 28)
.clickLaunchIcon('udapp')
.checkAnnotationsNotPresent('error')
......@@ -93,11 +92,11 @@ module.exports = {
.openFile('sourcehighlight.js')
.executeScript('remix.exeCurrent()')
.editorScroll('down', 60)
.waitForElementPresent('.highlightLine32')
.waitForElementPresent('.highlightLine32', 60000)
.checkElementStyle('.highlightLine32', 'background-color', 'rgb(8, 108, 181)')
.waitForElementPresent('.highlightLine40')
.waitForElementPresent('.highlightLine40', 60000)
.checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)')
.waitForElementPresent('.highlightLine50')
.waitForElementPresent('.highlightLine50', 60000)
.checkElementStyle('.highlightLine50', 'background-color', 'rgb(8, 108, 181)')
},
......@@ -110,7 +109,7 @@ module.exports = {
.click('li[data-id="treeViewLitreeViewItemcontracts"]')
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
.click('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
.waitForElementNotPresent('.highlightLine32')
.waitForElementNotPresent('.highlightLine32', 60000)
.checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)')
.checkElementStyle('.highlightLine50', 'background-color', 'rgb(8, 108, 181)')
},
......@@ -123,13 +122,11 @@ module.exports = {
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
.click('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
.pause(2000)
.waitForElementNotPresent('.highlightLine32')
.waitForElementNotPresent('.highlightLine40')
.waitForElementNotPresent('.highlightLine50')
.waitForElementNotPresent('.highlightLine32', 60000)
.waitForElementNotPresent('.highlightLine40', 60000)
.waitForElementNotPresent('.highlightLine50', 60000)
.end()
},
tearDown: sauce
}
}
const aceThemes = {
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
import * as path from 'path'
const testData = {
testFile1: path.resolve(__dirname + '/editor.test.js'), // eslint-disable-line
testFile1: path.resolve(__dirname + '/editor.spec.js'), // eslint-disable-line
testFile2: path.resolve(__dirname + '/fileExplorer.test.js'), // eslint-disable-line
testFile3: path.resolve(__dirname + '/generalSettings.test.js') // eslint-disable-line
}
......@@ -69,7 +68,7 @@ module.exports = {
.waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]')
.rightClick('[data-path="Browser_E2E_Tests"]')
.click('*[id="menuitemdelete"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]', 60000)
.pause(2000)
.click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok')
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]')
......@@ -82,11 +81,11 @@ module.exports = {
.pause(10000)
.waitForElementVisible('*[data-id="fileExplorerNewFilepublishToGist"]')
.click('*[data-id="fileExplorerNewFilepublishToGist"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]', 60000)
.pause(2000)
.click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok')
.pause(2000)
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]', 60000)
.pause(2000)
.click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok')
.pause(2000)
......@@ -105,11 +104,9 @@ module.exports = {
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1)
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2)
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3)
.waitForElementVisible('[data-id="treeViewLitreeViewItemeditor.test.js"]')
.waitForElementVisible('[data-id="treeViewLitreeViewItemeditor.spec.js"]')
.waitForElementVisible('[data-id="treeViewLitreeViewItemfileExplorer.test.js"]')
.waitForElementVisible('[data-id="treeViewLitreeViewItemgeneralSettings.test.js"]')
.end()
},
tearDown: sauce
}
}
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -12,25 +11,22 @@ module.exports = {
browser
.addFile('file.js', { content: executeFile })
.executeScript('remix.exeCurrent()')
.pause(5000)
.journalLastChildIncludes('file.js')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'file.js', 60000)
},
'Should execute `exists` api from file manager external api': function (browser: NightwatchBrowser) {
browser
.addFile('exists.js', { content: executeExists })
.executeScript('remix.exeCurrent()')
.pause(2000)
.journalChildIncludes('exists.js true')
.journalChildIncludes('non-exists.js false')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'exists.js true', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'non-exists.js false', 60000)
},
'Should execute `open` api from file manager external api': function (browser: NightwatchBrowser) {
browser
.addFile('open.js', { content: executeOpen })
.executeScript('remix.exeCurrent()')
.pause(2000)
.journalLastChildIncludes('contracts/3_Ballot.sol')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contracts/3_Ballot.sol', 60000)
},
'Should execute `writeFile` api from file manager external api': function (browser: NightwatchBrowser) {
......@@ -46,16 +42,14 @@ module.exports = {
browser
.addFile('readFile.js', { content: executeReadFile })
.executeScript('remix.exeCurrent()')
.pause(2000)
.journalLastChildIncludes('pragma solidity ^0.6.0')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity ^0.6.0', 60000)
},
'Should execute `copyFile` api from file manager external api': function (browser: NightwatchBrowser) {
browser
.addFile('copyFile.js', { content: executeCopyFile })
.executeScript('remix.exeCurrent()')
.pause(2000)
.journalLastChildIncludes('pragma solidity >=0.7.0 <0.9.0;')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity >=0.7.0 <0.9.0;', 60000)
},
'Should execute `rename` api from file manager external api': function (browser: NightwatchBrowser) {
......@@ -63,7 +57,7 @@ module.exports = {
.addFile('renameFile.js', { content: executeRename })
.executeScript('remix.exeCurrent()')
.pause(2000)
.waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]')
.waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000)
},
'Should execute `mkdir` api from file manager external api': function (browser: NightwatchBrowser) {
......@@ -71,15 +65,14 @@ module.exports = {
.addFile('mkdirFile.js', { content: executeMkdir })
.executeScript('remix.exeCurrent()')
.pause(2000)
.waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]')
.waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000)
},
'Should execute `readdir` api from file manager external api': function (browser: NightwatchBrowser) {
browser
.addFile('readdirFile.js', { content: executeReaddir })
.executeScript('remix.exeCurrent()')
.pause(2000)
.journalLastChildIncludes('Test_Folder isDirectory true')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Test_Folder isDirectory true', 60000)
},
'Should execute `remove` api from file manager external api': function (browser: NightwatchBrowser) {
......@@ -87,7 +80,7 @@ module.exports = {
.addFile('removeFile.js', { content: executeRemove })
.executeScript('remix.exeCurrent()')
.pause(2000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]')
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000)
},
// TODO: Fix remove root directory prefix for browser and localhost
......@@ -96,11 +89,9 @@ module.exports = {
.addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder })
.executeScript('remix.exeCurrent()')
.pause(2000)
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemTest_Folder"]')
.waitForElementNotPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 60000)
.end()
},
tearDown: sauce
}
}
const executeFile = `
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -129,9 +128,7 @@ module.exports = {
.checkElementStyle(':root', '--info', remixIdeThemes.cyborg.info)
.checkElementStyle(':root', '--warning', remixIdeThemes.cyborg.warning)
.checkElementStyle(':root', '--danger', remixIdeThemes.cyborg.danger)
},
tearDown: sauce
}
}
const remixIdeThemes = {
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
const testData = {
validGistId: '1859c97c6e1efc91047d725d5225888e',
......@@ -123,7 +122,5 @@ module.exports = {
.waitForElementVisible(`div[title='default_workspace/${testData.validGistId}/ApplicationRegistry']`)
.assert.containsText(`div[title='default_workspace/${testData.validGistId}/ApplicationRegistry'] > span`, 'ApplicationRegistry')
.end()
},
tearDown: sauce
}
}
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -45,6 +44,7 @@ module.exports = {
.click('*[data-id="settingsTabGenerateContractMetadataLabel"]')
.clickLaunchIcon('solidity')
.click('#compileTabView button[title="Compile"]') // that should generate the JSON artefact
.clickLaunchIcon('udapp')
.verifyContracts(['test'])
.clickLaunchIcon('udapp')
.selectContract('lib') // deploy lib
......@@ -60,9 +60,7 @@ module.exports = {
})
})
.end()
},
tearDown: sauce
}
}
function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFunction) {
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
const testData = {
pluginName: 'remixIde',
......@@ -45,23 +44,23 @@ module.exports = {
.click('*[data-id="pluginManagerComponentPluginManager"]')
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]')
.pause(2000)
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 60000)
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtonvyper"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]', 60000)
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtonZoKrates"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonZoKrates"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonZoKrates"]', 60000)
},
'Should deactivate plugins': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
.click('*[data-id="pluginManagerComponentPluginManager"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 60000)
.pause(2000)
.scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]')
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]', 60000)
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]', 60000)
.scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtonvyper"]')
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtonvyper"]')
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtonvyper"]', 60000)
},
/*
......@@ -115,7 +114,7 @@ module.exports = {
.click('*[data-id="localPluginRadioButtonsidePanel"]')
.click('*[data-id="modalDialogModalFooter"]')
.modalFooterOKClick()
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonremixIde"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonremixIde"]', 60000)
},
'Should display error message for creating already existing plugin': function (browser: NightwatchBrowser) {
......@@ -153,7 +152,5 @@ module.exports = {
})
})
.end()
},
tearDown: sauce
}
}
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -68,7 +67,5 @@ module.exports = {
.waitForElementPresent('*[data-id="contractDropdownIpfsCheckbox"]')
.verify.elementPresent('*[data-id="contractDropdownIpfsCheckbox"]:checked')
.end()
},
tearDown: sauce
}
}
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -87,8 +86,7 @@ module.exports = {
'decoded input': { 'uint256 _po': { type: 'BigNumber', hex: '0x0a' } }
})
.end()
},
tearDown: sauce
}
}
const sources = [{
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
const assetsTestContract = `import "./contract.sol";
contract Assets {
......@@ -85,8 +84,7 @@ module.exports = {
.clickLaunchIcon('pluginManager')
.scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_remixd"] button')
.end()
},
tearDown: sauce
}
}
function runTests (browser: NightwatchBrowser) {
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
const passphrase = process.env.account_passphrase
const password = process.env.account_password
......@@ -197,8 +196,7 @@ module.exports = {
.pause(2000)
.journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]')
.end()
},
tearDown: sauce
}
}
const sources = [
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -51,8 +50,7 @@ module.exports = {
})
})
.end()
},
tearDown: sauce
}
}
const sources = [
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -73,13 +72,10 @@ module.exports = {
.addFile('Untitled8.sol', sources[7]['Untitled8.sol'])
.clickLaunchIcon('fileExplorers')
.clickLaunchIcon('solidity')
.waitForElementPresent('[data-id="compiledErrors"] div:nth-child(3)', 45000)
.scrollAndClick('[data-id="compiledErrors"] div:nth-child(3)') // click on error which point to ERC20 code
.waitForElementVisible('[data-id="https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"]', 120000)
.scrollAndClick('[data-id="https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol"]') // click on error which point to ERC20 code
.pause(5000)
.getEditorValue((content) => {
browser.assert.ok(content.indexOf('contract ERC20 is Context, IERC20') !== -1,
'current displayed content should be from the ERC20 source code')
})
.waitForElementContainsText('#input', 'contract ERC20 is Context, IERC20', 60000)
},
'Test NPM Import (with unpkg.com)': function (browser: NightwatchBrowser) {
......@@ -91,8 +87,7 @@ module.exports = {
.clickLaunchIcon('fileExplorers')
.verifyContracts(['test13', 'ERC20'], { wait: 30000 })
.end()
},
tearDown: sauce
}
}
const sources = [
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -220,8 +219,7 @@ module.exports = {
})
})
.end()
},
tearDown: sauce
}
}
const sources = [
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
const sources = [
{
......@@ -31,8 +30,7 @@ module.exports = {
},
'Static Analysis': function (browser: NightwatchBrowser) {
runTests(browser)
},
tearDown: sauce
}
}
function runTests (browser: NightwatchBrowser) {
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -12,7 +11,7 @@ module.exports = {
browser
.waitForElementVisible('*[data-id="terminalCli"]', 10000)
.executeScript('console.log(1 + 1)')
.journalLastChild('2')
.waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000)
},
'Should clear console': function (browser: NightwatchBrowser) {
......@@ -20,7 +19,7 @@ module.exports = {
.waitForElementVisible('*[data-id="terminalCli"]')
.journalChildIncludes('Welcome to Remix')
.click('#clearConsole')
.assert.containsText('*[data-id="terminalJournal"]', '')
.waitForElementContainsText('*[data-id="terminalJournal"]', '', 60000)
},
'Should display auto-complete menu': function (browser: NightwatchBrowser) {
......@@ -35,11 +34,11 @@ module.exports = {
browser
.waitForElementVisible('*[data-id="terminalCli"]')
.executeScript('remix.help()')
.journalChildIncludes('remix.loadgist(id)')
.journalChildIncludes('remix.loadurl(url)')
.journalChildIncludes('remix.execute(filepath)')
.journalChildIncludes('remix.exeCurrent()')
.journalChildIncludes('remix.help()')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.loadgist(id)', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.loadurl(url)', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.execute(filepath)', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.exeCurrent()', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'remix.help()', 60000)
},
'Async/Await Script': function (browser: NightwatchBrowser) {
......@@ -47,9 +46,8 @@ module.exports = {
.addFile('asyncAwait.js', { content: asyncAwait })
.openFile('asyncAwait.js')
.executeScript('remix.execute(\'asyncAwait.js\')')
.journalLastChild('Waiting Promise')
.pause(5500)
.journalLastChild('result - Promise Resolved')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'result - Promise Resolved', 60000)
},
'Call Remix File Manager from a script': function (browser: NightwatchBrowser) {
......@@ -58,15 +56,13 @@ module.exports = {
.openFile('asyncAwaitWithFileManagerAccess.js')
.pause(5000)
.executeScript('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')')
.pause(6000)
.journalLastChildIncludes('contract Ballot {')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000)
},
'Call web3.eth.getAccounts() using JavaScript VM': function (browser: NightwatchBrowser) {
browser
.executeScript('web3.eth.getAccounts()')
.pause(2000)
.journalLastChildIncludes('[ "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", "0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB", "0x617F2E2fD72FD9D5503197092aC168c91465E7f2", "0x17F6AD8Ef982297579C203069C1DbfFE4348c372", "0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678", "0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7", "0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C", "0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC", "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c", "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C", "0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB", "0x583031D1113aD414F02576BD6afaBfb302140225", "0xdD870fA1b7C4700F2BD7f44238821C26f7392148" ]')
.waitForElementContainsText('*[data-id="terminalJournal"]', '[ "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", "0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB", "0x617F2E2fD72FD9D5503197092aC168c91465E7f2", "0x17F6AD8Ef982297579C203069C1DbfFE4348c372", "0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678", "0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7", "0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C", "0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC", "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c", "0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C", "0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB", "0x583031D1113aD414F02576BD6afaBfb302140225", "0xdD870fA1b7C4700F2BD7f44238821C26f7392148" ]', 60000)
},
'Call web3.eth.getAccounts() using Web3 Provider': function (browser: NightwatchBrowser) {
......@@ -76,10 +72,9 @@ module.exports = {
.click('*[data-id="settingsWeb3Mode"]')
.modalFooterOKClick()
.executeScript('web3.eth.getAccounts()')
.pause(2000)
.journalLastChildIncludes('[ "') // we check if an array is present, don't need to check for the content
.journalLastChildIncludes('" ]')
.journalLastChildIncludes('", "')
.waitForElementContainsText('*[data-id="terminalJournal"]', '[ "', 60000) // we check if an array is present, don't need to check for the content
.waitForElementContainsText('*[data-id="terminalJournal"]', '" ]', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', '", "', 60000)
},
'Call Remix File Resolver (external URL) from a script': function (browser: NightwatchBrowser) {
......@@ -89,8 +84,7 @@ module.exports = {
.openFile('resolveExternalUrlAndSave.js')
.pause(1000)
.executeScript('remix.execute(\'resolveExternalUrlAndSave.js\')')
.pause(6000)
.journalLastChildIncludes('Implementation of the {IERC20} interface.')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Implementation of the {IERC20} interface.', 60000)
.openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol')
},
......@@ -101,8 +95,7 @@ module.exports = {
.openFile('resolveUrl.js')
.pause(1000)
.executeScript('remix.execute(\'resolveUrl.js\')')
.pause(6000)
.journalLastChildIncludes('contract Ballot {')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000)
},
'Call Remix File Resolver (internal URL) from a script and specify a path': function (browser: NightwatchBrowser) {
......@@ -112,13 +105,10 @@ module.exports = {
.openFile('resolveExternalUrlAndSaveToaPath.js')
.pause(1000)
.executeScript('remix.execute(\'resolveExternalUrlAndSaveToaPath.js\')')
.pause(6000)
.journalLastChildIncludes('abstract contract ERC20Burnable')
.waitForElementContainsText('*[data-id="terminalJournal"]', 'abstract contract ERC20Burnable', 60000)
.openFile('.deps/github/newFile.sol')
.end()
},
tearDown: sauce
}
}
const asyncAwait = `
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -139,9 +138,7 @@ module.exports = {
.click('#runTabView button[class^="instanceButton"]')
.waitForElementPresent('.instance:nth-of-type(2)')
.end()
},
tearDown: sauce
}
}
// @TODO test: bytes8[3][] type as input
......
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
import examples from '../examples/example-contracts'
const sources = [
......@@ -26,7 +25,7 @@ module.exports = {
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c')
.setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]')
.click('*[data-id="Deploy - transact (not payable)"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]')
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000)
.click('*[data-id="universalDappUiTitleExpander"]')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' })
.testFunction('last',
......@@ -45,7 +44,5 @@ module.exports = {
'decoded input': { 'address to': '0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB' }
})
.end()
},
tearDown: sauce
}
}
......@@ -2,7 +2,6 @@
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
import examples from '../examples/example-contracts'
const sources = [
......@@ -51,7 +50,5 @@ module.exports = {
.click('[for="optimize"')
.verify.attributeEquals('#runs', 'value', '200')
.end()
},
tearDown: sauce
}
}
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
const sources = [
{
......@@ -49,7 +48,5 @@ module.exports = {
elem.checked = false
})
.end()
},
tearDown: sauce
}
}
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
......@@ -29,7 +28,5 @@ module.exports = {
.click('*[data-id="verticalIconsKindpluginManager"]')
.scrollInto('*[data-id="pluginManagerComponentActivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]')
},
tearDown: sauce
}
}
......@@ -30,7 +30,7 @@ declare module "nightwatch" {
editorScroll(direction: 'up' | 'down', numberOfTimes: number): NightwatchBrowser,
renamePath(path: string, newFileName: string, renamedPath: string): NightwatchBrowser,
rightClick(cssSelector: string): NightwatchBrowser,
waitForElementContainsText(id: string, value: string): NightwatchBrowser,
waitForElementContainsText(id: string, value: string, timeout?: number): NightwatchBrowser,
getModalBody(callback: (value: string, cb: VoidFunction) => void): NightwatchBrowser,
modalFooterCancelClick(): NightwatchBrowser,
selectContract(contractName: string): NightwatchBrowser,
......
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npm run remixd &
sleep 5
npm run build:e2e
TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings)
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npm run remixd &
sleep 5
npm run build:e2e
TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings)
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=firefox || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi
......@@ -131,7 +131,7 @@ Renderer.prototype.error = function (message, container, opt) {
var $pre = $(opt.useSpan ? yo`<span></span>` : yo`<pre></pre>`).html(message)
const classList = opt.type === 'error' ? 'alert alert-danger' : 'alert alert-warning'
var $error = $(yo`<div class="sol ${opt.type} ${classList}"><div class="close" data-id="renderer"><i class="fas fa-times"></i></div></div>`).prepend($pre)
var $error = $(yo`<div class="sol ${opt.type} ${classList}" data-id="${opt.errFile}"><div class="close" data-id="renderer"><i class="fas fa-times"></i></div></div>`).prepend($pre)
$(container).append($error)
$error.click((ev) => {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment