parent
6a09650f54
commit
732c21efd9
@ -0,0 +1,48 @@ |
||||
{ |
||||
"src_folders" : ["./test-browser"], |
||||
"output_folder" : "./test-browser/reports", |
||||
"custom_commands_path" : "", |
||||
"custom_assertions_path" : "", |
||||
"globals_path" : "", |
||||
"page_objects_path" : "", |
||||
|
||||
"selenium" : { |
||||
"start_process" : false, |
||||
"server_path" : "", |
||||
"log_path" : "", |
||||
"host" : "127.0.0.1", |
||||
"port" : 4444, |
||||
"cli_args" : { |
||||
"webdriver.chrome.driver" : "", |
||||
"webdriver.ie.driver" : "", |
||||
"webdriver.firefox.profile" : "" |
||||
} |
||||
}, |
||||
|
||||
"test_settings" : { |
||||
"default" : { |
||||
"launch_url" : "http://localhost", |
||||
"selenium_host" : "127.0.0.1", |
||||
"selenium_port" : 4444, |
||||
"silent" : true, |
||||
"screenshots" : { |
||||
"enabled" : false, |
||||
"path" : "" |
||||
}, |
||||
"desiredCapabilities" : { |
||||
"browserName" : "firefox", |
||||
"javascriptEnabled" : true, |
||||
"acceptSslCerts" : true |
||||
} |
||||
}, |
||||
|
||||
"chrome" : { |
||||
"desiredCapabilities" : { |
||||
"browserName" : "firefox", |
||||
"javascriptEnabled" : true, |
||||
"acceptSslCerts" : true |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,9 +1,9 @@ |
||||
'use strict' |
||||
var Debugger = require('./Ethdebugger') |
||||
|
||||
function init () { |
||||
var ethdebugger = new Debugger() |
||||
document.getElementById('app').appendChild(ethdebugger.render()) |
||||
var container = document.getElementById('app') |
||||
container.vmdebugger = new Debugger() |
||||
container.appendChild(container.vmdebugger.render()) |
||||
} |
||||
|
||||
init() |
||||
|
@ -1,7 +1,58 @@ |
||||
module.exports = { |
||||
'Page Load': function (browser) { |
||||
beforeEach: function (browser, done) { |
||||
init(browser, done) |
||||
}, |
||||
|
||||
'Load Trace - not found': function (browser) { |
||||
browser |
||||
.url('http://127.0.0.1:8080') |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942zcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.assert.containsText('#txhash', '<not found>') |
||||
.end() |
||||
}, |
||||
|
||||
'Load Trace - found': function (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.assert.containsText('#txhash', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.assert.containsText('#txfrom', '0x00101c5bfa3fc8bad02c9f5fd65b069306251915') |
||||
.assert.containsText('#txto', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.end() |
||||
} |
||||
|
||||
} |
||||
|
||||
function init (browser, callback) { |
||||
browser |
||||
.url('http://127.0.0.1:8080') |
||||
injectScript('./test/resources/testWeb3.js', browser, function () { |
||||
callback() |
||||
}) |
||||
} |
||||
|
||||
function readFile (filename, callback) { |
||||
var fs = require('fs') |
||||
try { |
||||
console.log('reading ' + filename) |
||||
fs.readFile(filename, 'utf8', callback) |
||||
} catch (e) { |
||||
console.log(e) |
||||
callback(e) |
||||
} |
||||
} |
||||
|
||||
function injectScript (file, browser, callback) { |
||||
readFile(file, function (error, result) { |
||||
if (!error) { |
||||
browser.execute(function (data) { |
||||
eval.call(null, data) // eslint-disable-line
|
||||
}, [result], function () { |
||||
callback() |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue