fix e2e tests

pull/5370/head
yann300 5 years ago
parent 0771890ac5
commit 7e4c81d1c1
  1. 1364
      package-lock.json
  2. 2
      src/app/tabs/runTab/settings.js
  3. 16
      test-browser/commands/selectAccount.js
  4. 1
      test-browser/tests/ballot.js
  5. 2
      test-browser/tests/libraryDeployment.js
  6. 1
      test-browser/tests/recorder.js
  7. 5
      test-browser/tests/signingMessage.js
  8. 1
      test-browser/tests/specialFunctions.js
  9. 1
      test-browser/tests/transactionExecution.js

1364
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -97,7 +97,7 @@ class SettingsUI {
</span> </span>
</label> </label>
<div class="${css.account}"> <div class="${css.account}">
<select name="txorigin" class="form-control ${css.select} custom-select" id="txorigin"></select> <select data-id="runTabSelectAccount" name="txorigin" class="form-control ${css.select} custom-select" id="txorigin"></select>
${copyToClipboard(() => document.querySelector('#runTabView #txorigin').value)} ${copyToClipboard(() => document.querySelector('#runTabView #txorigin').value)}
<i id="remixRunSignMsg" class="fas fa-edit ${css.icon}" aria-hidden="true" onclick=${this.signMessage.bind(this)} title="Sign a message using this account key"></i> <i id="remixRunSignMsg" class="fas fa-edit ${css.icon}" aria-hidden="true" onclick=${this.signMessage.bind(this)} title="Sign a message using this account key"></i>
</div> </div>

@ -0,0 +1,16 @@
const EventEmitter = require('events')
class SelectAccount extends EventEmitter {
command (account) {
if (account) {
this.api
.click(`select[data-id="runTabSelectAccount"] [value="${account}"]`)
.perform(() => {
this.emit('complete')
})
} else this.emit('complete')
return this
}
}
module.exports = SelectAccount

@ -20,6 +20,7 @@ module.exports = {
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot']) .testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c')
.setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]') .setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]')
.click('#runTabView button[class^="instanceButton"]') .click('#runTabView button[class^="instanceButton"]')
.waitForElementPresent('.instance:nth-of-type(2)') .waitForElementPresent('.instance:nth-of-type(2)')

@ -11,6 +11,8 @@ module.exports = {
}, },
'Add Lib Test File': function (browser) { 'Add Lib Test File': function (browser) {
browser.addFile('Untitled5.sol', sources[0]['browser/Untitled5.sol']) browser.addFile('Untitled5.sol', sources[0]['browser/Untitled5.sol'])
.clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
}, },
'Test Auto Deploy Lib': function (browser) { 'Test Auto Deploy Lib': function (browser) {
let addressRef let addressRef

@ -13,6 +13,7 @@ module.exports = {
var addressRef var addressRef
browser.addFile('scenario.json', {content: records}) browser.addFile('scenario.json', {content: records})
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
.click('div[class^="cardContainer"] i[class^="arrow"]') .click('div[class^="cardContainer"] i[class^="arrow"]')
.click('#runTabView .runtransaction') .click('#runTabView .runtransaction')
.waitForElementPresent('.instance:nth-of-type(2)') .waitForElementPresent('.instance:nth-of-type(2)')

@ -11,7 +11,10 @@ module.exports = {
}, },
'Test Signature': function (browser) { 'Test Signature': function (browser) {
let hash, signature let hash, signature
browser.clickLaunchIcon('udapp').signMessage('test message', (h, s) => { browser
.clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
.signMessage('test message', (h, s) => {
hash = h hash = h
signature = s signature = s
console.log('hash', hash) console.log('hash', hash)

@ -13,6 +13,7 @@ module.exports = {
browser.waitForElementVisible('#icon-panel', 10000) browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('receiveAndFallback.sol', sources[0]['browser/receiveAndFallback.sol'], ['CheckSpecials']) // compile .testContracts('receiveAndFallback.sol', sources[0]['browser/receiveAndFallback.sol'], ['CheckSpecials']) // compile
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
.selectContract('CheckSpecials') .selectContract('CheckSpecials')
.createContract('') // deploy .createContract('') // deploy
.clickInstance(0) .clickInstance(0)

@ -13,6 +13,7 @@ module.exports = {
'Execute Simple Contract and Test Terminal': function (browser) { 'Execute Simple Contract and Test Terminal': function (browser) {
browser.testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['TestContract']) browser.testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['TestContract'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
.click('#runTabView button[class^="instanceButton"]') .click('#runTabView button[class^="instanceButton"]')
.waitForElementPresent('.instance:nth-of-type(2)') .waitForElementPresent('.instance:nth-of-type(2)')
.click('.instance:nth-of-type(2) > div > button') .click('.instance:nth-of-type(2) > div > button')

Loading…
Cancel
Save