pull/1/head
yann300 6 years ago
parent a4e5feb18b
commit 9248da33ca
  1. 2
      test-browser/commands/clickFunction.js
  2. 1
      test-browser/commands/renameFile.js
  3. 4
      test-browser/commands/signMessage.js
  4. 7
      test-browser/tests/generalTests.js

@ -14,7 +14,7 @@ class ClickFunction extends EventEmitter {
})
})
.click('.instance button[title="' + fnFullName + '"]')
.pause(500)
.pause(2000)
.perform(() => {
this.emit('complete')
})

@ -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 + '"]')

@ -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()

@ -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')
})
@ -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'])

Loading…
Cancel
Save