Skip to content

Commit

Permalink
Merge pull request #2110 from ethereum/refactorBrowserTests
Browse files Browse the repository at this point in the history
Refactor browser tests
  • Loading branch information
yann300 committed Jun 25, 2019
2 parents a4e5feb + 9248da3 commit fdf51b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test-browser/commands/clickFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ClickFunction extends EventEmitter {
})
})
.click('.instance button[title="' + fnFullName + '"]')
.pause(500)
.pause(2000)
.perform(() => {
this.emit('complete')
})
Expand Down
1 change: 1 addition & 0 deletions test-browser/commands/renameFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function renameFile (browser, path, newFileName, renamedPath, done) {
})
.click('body') // blur
.waitForElementVisible('#modal-footer-ok', 2000)
.pause(2000)
.click('#modal-footer-ok')
.waitForElementNotPresent('[data-path="' + path + '"]')
.waitForElementPresent('[data-path="' + renamedPath + '"]')
Expand Down
4 changes: 2 additions & 2 deletions test-browser/commands/signMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ function signMsg (browser, msg, cb) {
.setValue('textarea[id="prompt_text"]', msg, () => {
browser.modalFooterOKClick().perform(
(client, done) => {
browser.getText('span[id="remixRunSignMsgHash"]', (v) => { hash = v; done() })
browser.waitForElementPresent('span[id="remixRunSignMsgHash"]').getText('span[id="remixRunSignMsgHash"]', (v) => { hash = v; done() })
}
)
.perform(
(client, done) => {
browser.getText('span[id="remixRunSignMsgSignature"]', (v) => { signature = v; done() })
browser.waitForElementPresent('span[id="remixRunSignMsgSignature"]').getText('span[id="remixRunSignMsgSignature"]', (v) => { signature = v; done() })
}
)
.modalFooterOKClick()
Expand Down
7 changes: 6 additions & 1 deletion test-browser/tests/generalTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ module.exports = {
browser.signMessage('test message', (h, s) => {
hash = h
signature = s
console.log('hash', hash)
console.log('signature', signature)
browser.assert.ok(typeof hash.value === 'string', 'type of hash.value must be String')
browser.assert.ok(typeof signature.value === 'string', 'type of signature.value must be String')
})
Expand All @@ -89,7 +91,10 @@ module.exports = {
// skip 'instance' part of e.g. 'instance0x692a70d2e424a56d2c6c27aa97d1a86395877b3a'
const address = result.value.slice('instance'.length)
console.log('Test Signature', result)
browser.clickFunction('ecrecovery - call', {types: 'bytes32 hash, bytes sig', values: `"${hash.value}","${signature.value}"`})
var inputs = `"${hash.value}","${signature.value}"`
console.log('Test Signature Input', inputs)
browser.clickFunction('ecrecovery - call', { types: 'bytes32 hash, bytes sig', values: inputs })
.pause(5000)
.verifyCallReturnValue(
address,
['0: address: 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'])
Expand Down

0 comments on commit fdf51b0

Please sign in to comment.