parent
e739723762
commit
1bb64cd210
@ -0,0 +1,72 @@ |
||||
const https = require('https') |
||||
|
||||
var userName = process.argv[2] |
||||
var accessKey = process.argv[3] |
||||
var tunnelName = process.argv[4] |
||||
|
||||
function removeTunnel () { |
||||
const requestPath = `/rest/v1/${userName}/tunnels` |
||||
console.log(requestPath) |
||||
callSauce(requestPath, 'GET', function (error, result) { |
||||
if (error) { |
||||
console.log(error) |
||||
} else { |
||||
var data = JSON.parse(result) |
||||
for (var k in data) { |
||||
retrieveTunnel(data[k], function (error, result) { |
||||
if (error) { |
||||
console.log(error) |
||||
} else if (result.identtifier === tunnelName) { |
||||
deleteTunnel(result.id, function () { |
||||
console.log('tunnel deleted ' + data[k] + ' ' + tunnelName) |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function retrieveTunnel (tunnelid, callback) { |
||||
const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}` |
||||
callSauce(requestPath, 'GET', function (error, result) { |
||||
if (error) { |
||||
callback(error) |
||||
} else { |
||||
callback(null, {'identtifier': JSON.parse(result).tunnel_identifier, 'id': tunnelid}) |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function deleteTunnel (tunnelid, callback) { |
||||
const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}` |
||||
callSauce(requestPath, 'DELETE', callback) |
||||
} |
||||
|
||||
function callSauce (requestPath, type, callback) { |
||||
function responseCallback (res) { |
||||
res.setEncoding('utf8') |
||||
console.log('Response: ', res.statusCode, JSON.stringify(res.headers)) |
||||
res.on('data', function onData (chunk) { |
||||
console.log('BODY: ' + chunk) |
||||
callback(null, chunk) |
||||
}) |
||||
res.on('end', function onEnd () {}) |
||||
} |
||||
|
||||
var req = https.request({ |
||||
hostname: 'saucelabs.com', |
||||
path: requestPath, |
||||
method: type, |
||||
auth: userName + ':' + accessKey |
||||
}, responseCallback) |
||||
|
||||
req.on('error', function onError (e) { |
||||
console.log('problem with request: ' + e.message) |
||||
callback(e.message) |
||||
}) |
||||
req.write('') |
||||
req.end() |
||||
} |
||||
|
||||
removeTunnel() |
@ -1 +0,0 @@ |
||||
require('./vmdebugger') |
@ -1,7 +1,173 @@ |
||||
'use strict' |
||||
require('./vmdebugger/loadTraceNotFound') |
||||
require('./vmdebugger/loadTraceFound') |
||||
require('./vmdebugger/stepping') |
||||
require('./vmdebugger/slider') |
||||
require('./vmdebugger/sticker') |
||||
require('./vmdebugger/panels') |
||||
var init = require('./init') |
||||
var sauce = require('./sauce') |
||||
|
||||
module.exports = { |
||||
beforeEach: function (browser, done) { |
||||
try { |
||||
init(browser, done) |
||||
} catch (e) { |
||||
var mes = 'error ' + e.message |
||||
console.log(mes) |
||||
done(mes) |
||||
} |
||||
}, |
||||
|
||||
'vmdebugger': function (browser) { |
||||
loadTrace(browser) |
||||
browser.click('#unload') |
||||
loadTraceNotFound(browser) |
||||
browser.click('#unload') |
||||
panels(browser) |
||||
browser.click('#unload') |
||||
slider(browser) |
||||
browser.click('#unload') |
||||
stepping(browser) |
||||
browser.click('#unload') |
||||
sticker(browser) |
||||
browser.end() |
||||
}, |
||||
|
||||
tearDown: sauce |
||||
} |
||||
|
||||
function loadTrace (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942zcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.assert.containsText('#txhash', '<not found>') |
||||
return browser |
||||
} |
||||
|
||||
function loadTraceNotFound (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.expect.element('#txhash').text.to.equal('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
browser.expect.element('#txfrom').text.to.equal('0x00101c5bfa3fc8bad02c9f5fd65b069306251915') |
||||
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
browser.click('#unload') |
||||
.waitForElementNotVisible('#vmdebugger', 1000) |
||||
return browser |
||||
} |
||||
|
||||
function panels (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#nextcall') |
||||
.assertStack('0x\n0x60\n0x65\n0x38\n0x55\n0x60fe47b1') |
||||
.assertStorageChanges('0x00 0x38') |
||||
.assertCallData('0x60fe47b10000000000000000000000000000000000000000000000000000000000000038') |
||||
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.assertStackValue(1, '0x60') |
||||
.assertMemoryValue(6, '0xc0 60 60 60 40 52 60 40 51 60 20 80 60 45 83 39 81 ????R??Q????E?9?') |
||||
.assertMemoryValue(7, '0xe0 01 60 40 52 80 80 51 90 60 20 01 90 91 90 50 50 ???R??Q???????PP') |
||||
.assertMemoryValue(8, '0x100 5b 80 60 01 01 60 00 60 00 50 81 90 55 50 5b 50 ?????????P??UP?P') |
||||
.click('#intoforward') // CREATE
|
||||
.assertStack('') |
||||
.assertStorageChanges('') |
||||
.assertMemory('') |
||||
.assertCallData('0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055') |
||||
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5\n(Contract Creation - Step 63)') |
||||
return browser |
||||
} |
||||
|
||||
function slider (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
/* |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.LEFT_ARROW) |
||||
*/ |
||||
.assertCurrentSelectedItem('041 PUSH 60fe47b1') |
||||
return browser |
||||
} |
||||
|
||||
function stepping (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.assertCurrentSelectedItem('004 MSTORE') |
||||
.click('#intoforward') |
||||
.click('#intoback') |
||||
.click('#intoback') |
||||
.assertCurrentSelectedItem('002 PUSH 40') |
||||
.click('#nextcall') |
||||
.assertCurrentSelectedItem('181 CREATE') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#overforward') |
||||
.assertCurrentSelectedItem('058 RETURN') |
||||
.click('#intoforward') |
||||
.click('#overback') |
||||
.assertCurrentSelectedItem('181 CREATE') |
||||
return browser |
||||
} |
||||
|
||||
function sticker (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
/* |
||||
.fireEvent('#slider', browser.debugerKeyCode.Right, 4, function () { |
||||
browser.assertSticker('6', '6', '', '3', '84476', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.click('#nextcall') |
||||
.assertSticker('63', '63', '', '32000', '79283', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.click('#intoforward') |
||||
.click('#overforward') |
||||
.assertSticker('108', '44', '', '0', '27145', '(Contract Creation - Step 63)') |
||||
.click('#intoforward') |
||||
.assertSticker('109', '64', '', '3', '25145', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.end() |
||||
}) |
||||
*/ |
||||
.assertSticker('6', '6', '', '3', '84476', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.click('#nextcall') |
||||
.assertSticker('63', '63', '', '32000', '79283', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.click('#intoforward') |
||||
.click('#overforward') |
||||
.assertSticker('108', '44', '', '0', '27145', '(Contract Creation - Step 63)') |
||||
.click('#intoforward') |
||||
.assertSticker('109', '64', '', '3', '25145', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
return browser |
||||
} |
||||
|
@ -1,31 +0,0 @@ |
||||
'use strict' |
||||
var init = require('../init') |
||||
var sauce = require('../sauce') |
||||
|
||||
module.exports = { |
||||
beforeEach: function (browser, done) { |
||||
try { |
||||
init(browser, done) |
||||
} catch (e) { |
||||
var mes = 'error ' + e.message |
||||
console.log(mes) |
||||
done(mes) |
||||
} |
||||
}, |
||||
|
||||
'Load Trace - found': function (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.expect.element('#txhash').text.to.equal('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
browser.expect.element('#txfrom').text.to.equal('0x00101c5bfa3fc8bad02c9f5fd65b069306251915') |
||||
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
browser.click('#unload') |
||||
.waitForElementNotVisible('#vmdebugger', 1000) |
||||
.end() |
||||
}, |
||||
tearDown: sauce |
||||
} |
@ -1,25 +0,0 @@ |
||||
'use strict' |
||||
var init = require('../init') |
||||
var sauce = require('../sauce') |
||||
|
||||
module.exports = { |
||||
beforeEach: function (browser, done) { |
||||
try { |
||||
init(browser, done) |
||||
} catch (e) { |
||||
var mes = 'error ' + e.message |
||||
console.log(mes) |
||||
done(mes) |
||||
} |
||||
}, |
||||
|
||||
'Load Trace - not found': function (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942zcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.assert.containsText('#txhash', '<not found>') |
||||
.end() |
||||
}, |
||||
tearDown: sauce |
||||
} |
@ -1,40 +0,0 @@ |
||||
'use strict' |
||||
var init = require('../init') |
||||
var sauce = require('../sauce') |
||||
|
||||
module.exports = { |
||||
beforeEach: function (browser, done) { |
||||
try { |
||||
init(browser, done) |
||||
} catch (e) { |
||||
var mes = 'error ' + e.message |
||||
console.log(mes) |
||||
done(mes) |
||||
} |
||||
}, |
||||
|
||||
'Panels': function (browser, done) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#nextcall') |
||||
.assertStack('0x\n0x60\n0x65\n0x38\n0x55\n0x60fe47b1') |
||||
.assertStackValue(1, '0x60') |
||||
.assertStorageChanges('0x00 0x38') |
||||
.assertMemoryValue(6, '0xc0 60 60 60 40 52 60 40 51 60 20 80 60 45 83 39 81 ????R??Q????E?9?') |
||||
.assertMemoryValue(7, '0xe0 01 60 40 52 80 80 51 90 60 20 01 90 91 90 50 50 ???R??Q???????PP') |
||||
.assertMemoryValue(8, '0x100 5b 80 60 01 01 60 00 60 00 50 81 90 55 50 5b 50 ?????????P??UP?P') |
||||
.assertCallData('0x60fe47b10000000000000000000000000000000000000000000000000000000000000038') |
||||
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.click('#intoforward') // CREATE
|
||||
.assertStack('') |
||||
.assertStorageChanges('') |
||||
.assertMemory('') |
||||
.assertCallData('0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055') |
||||
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5\n(Contract Creation - Step 63)') |
||||
.end() |
||||
}, |
||||
tearDown: sauce |
||||
} |
@ -1,37 +0,0 @@ |
||||
'use strict' |
||||
var init = require('../init') |
||||
var sauce = require('../sauce') |
||||
|
||||
module.exports = { |
||||
beforeEach: function (browser, done) { |
||||
try { |
||||
init(browser, done) |
||||
} catch (e) { |
||||
var mes = 'error ' + e.message |
||||
console.log(mes) |
||||
done(mes) |
||||
} |
||||
}, |
||||
|
||||
'Slider': function (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.LEFT_ARROW) |
||||
.assertCurrentSelectedItem('041 PUSH 60fe47b1') |
||||
.end() |
||||
}, |
||||
tearDown: sauce |
||||
} |
@ -1,43 +0,0 @@ |
||||
'use strict' |
||||
var init = require('../init') |
||||
var sauce = require('../sauce') |
||||
|
||||
module.exports = { |
||||
beforeEach: function (browser, done) { |
||||
try { |
||||
init(browser, done) |
||||
} catch (e) { |
||||
var mes = 'error ' + e.message |
||||
console.log(mes) |
||||
done(mes) |
||||
} |
||||
}, |
||||
|
||||
'Stepping': function (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.assertCurrentSelectedItem('004 MSTORE') |
||||
.click('#intoforward') |
||||
.click('#intoback') |
||||
.click('#intoback') |
||||
.assertCurrentSelectedItem('002 PUSH 40') |
||||
.click('#nextcall') |
||||
.assertCurrentSelectedItem('181 CREATE') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.click('#overforward') |
||||
.assertCurrentSelectedItem('058 RETURN') |
||||
.click('#intoforward') |
||||
.click('#overback') |
||||
.assertCurrentSelectedItem('181 CREATE') |
||||
.end() |
||||
}, |
||||
tearDown: sauce |
||||
} |
@ -1,39 +0,0 @@ |
||||
'use strict' |
||||
var init = require('../init') |
||||
var sauce = require('../sauce') |
||||
|
||||
module.exports = { |
||||
beforeEach: function (browser, done) { |
||||
try { |
||||
init(browser, done) |
||||
} catch (e) { |
||||
var mes = 'error ' + e.message |
||||
console.log(mes) |
||||
done(mes) |
||||
} |
||||
}, |
||||
|
||||
'Sticker': function (browser) { |
||||
browser |
||||
.clearValue('#txinput') |
||||
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') |
||||
.click('#load') |
||||
.waitForElementVisible('#vmdebugger', 1000) |
||||
.click('#intoforward') |
||||
.click('#intoforward') |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.sendKeys('#slider', browser.Keys.RIGHT_ARROW) |
||||
.assertSticker('6', '6', '', '3', '84476', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.click('#nextcall') |
||||
.assertSticker('63', '63', '', '32000', '79283', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.click('#intoforward') |
||||
.click('#overforward') |
||||
.assertSticker('108', '44', '', '0', '27145', '(Contract Creation - Step 63)') |
||||
.click('#intoforward') |
||||
.assertSticker('109', '64', '', '3', '25145', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') |
||||
.end() |
||||
}, |
||||
tearDown: sauce |
||||
} |
@ -1 +0,0 @@ |
||||
module.exports = '0x60606040526000357c01000000000000000000000000000000000000000000000000000000009004806360fe47b11460415780636d4ce63c14605757603f565b005b605560048080359060200190919050506089565b005b606260048050506078565b6040518082815260200191505060405180910390f35b600060006000505490506086565b90565b80600060005081905550602d6040516045806100f083390180828152602001915050604051809103906000f0600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550602281016000600050819055505b505660606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055505b50600a80603b6000396000f360606040526008565b00' |
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@ |
||||
module.exports = |
||||
{'blockHash':'0xd1d34932f8733e0485b7d9bf8500c4046d650f20ed7792508c304304fa7bbfac','blockNumber':89,'from':'0x00101c5bfa3fc8bad02c9f5fd65b069306251915','gas':105967,'gasPrice':'20000000000','hash':'0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51','input':'0x60fe47b10000000000000000000000000000000000000000000000000000000000000038','nonce':3,'to':'0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5','transactionIndex':0,'value':'0'} |
Loading…
Reference in new issue