Undo ModalFooterClick Changes

pull/1/head
ioedeveloper 5 years ago
parent 7f2780081c
commit d8ef0bee08
  1. 17
      test-browser/commands/modalFooterCancelClick.js
  2. 17
      test-browser/commands/modalFooterClick.js
  3. 17
      test-browser/commands/modalFooterOKClick.js
  4. 2
      test-browser/tests/ballot.js
  5. 14
      test-browser/tests/gist.js
  6. 2
      test-browser/tests/publishContract.js
  7. 2
      test-browser/tests/recorder.js

@ -0,0 +1,17 @@
const EventEmitter = require('events')
class ModalFooterOKClick extends EventEmitter {
command () {
this.api.waitForElementVisible('#modal-footer-cancel').perform((client, done) => {
this.api.execute(function () {
document.querySelector('#modal-footer-cancel').click()
}, [], (result) => {
done()
this.emit('complete')
})
})
return this
}
}
module.exports = ModalFooterOKClick

@ -1,17 +0,0 @@
const EventEmitter = require('events')
class ModalFooterClick extends EventEmitter {
command (cssSelector) {
this.api.waitForElementVisible(cssSelector).perform((client, done) => {
this.api.execute(function () {
document.querySelector(cssSelector).click()
}, [], (result) => {
done()
this.emit('complete')
})
})
return this
}
}
module.exports = ModalFooterClick

@ -0,0 +1,17 @@
const EventEmitter = require('events')
class ModalFooterOKClick extends EventEmitter {
command () {
this.api.waitForElementVisible('#modal-footer-ok').perform((client, done) => {
this.api.execute(function () {
document.querySelector('#modal-footer-ok').click()
}, [], (result) => {
done()
this.emit('complete')
})
})
return this
}
}
module.exports = ModalFooterOKClick

@ -60,7 +60,7 @@ module.exports = {
'Deploy and use Ballot using external web3': function (browser) {
browser
.click('#selectExEnvOptions #web3-mode')
.modalFooterClick('#modal-footer-ok')
.modalFooterOKClick()
.clickLaunchIcon('solidity')
.testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'])
.clickLaunchIcon('udapp')

@ -23,7 +23,7 @@ module.exports = {
.waitForElementVisible('#icon-panel', 10000)
.clickLaunchIcon('fileExplorers')
.click('#publishToGist')
.modalFooterClick('#modal-footer-ok')
.modalFooterOKClick()
.getModalBody((value, done) => {
const reg = /gist.github.com\/([^.]+)/
const id = value.match(reg)
@ -33,7 +33,7 @@ module.exports = {
} else {
let gistid = id[1]
browser
.modalFooterClick('#modal-footer-cancel')
.modalFooterCancelClick()
.executeScript(`remix.loadgist('${gistid}')`)
.switchFile('browser/gists')
.switchFile(`browser/gists/${gistid}`)
@ -44,8 +44,8 @@ module.exports = {
},
'Load Gist Modal': function (browser) {
browser
.waitForElementVisible('#icon-panel', 10000)
.clickLaunchIcon('fileExplorers')
.waitForElementVisible('#icon-panel')
.clickLaunchIcon('home')
.scrollAndClick('div.file > div.btn-group > button:nth-child(1)')
.waitForElementVisible('h6.modal-title')
.assert.containsText('h6.modal-title', 'Load a Gist')
@ -62,10 +62,10 @@ module.exports = {
.scrollAndClick('div.file > div.btn-group > button:nth-child(1)')
.waitForElementVisible('#prompt_text')
.setValue('#prompt_text', testData.invalidGistId)
.modalFooterClick('#modal-footer-ok')
.modalFooterOKClick()
.waitForElementVisible('div.modal-body > div')
.assert.containsText('div.modal-body > div', 'Gist load error: Not Found')
.modalFooterClick('#modal-footer-ok')
.modalFooterOKClick()
},
'Import From Gist For Valid Gist ID': function (browser) {
@ -75,7 +75,7 @@ module.exports = {
.scrollAndClick('div.file > div.btn-group > button:nth-child(1)')
.waitForElementVisible('#prompt_text')
.setValue('#prompt_text', testData.validGistId)
.modalFooterClick('#modal-footer-ok')
.modalFooterOKClick()
.switchFile(`browser/gists/${testData.validGistId}`)
.switchFile(`browser/gists/${testData.validGistId}/ApplicationRegistry`)
.waitForElementVisible(`div[title='browser/gists/${testData.validGistId}/ApplicationRegistry']`)

@ -21,7 +21,7 @@ module.exports = {
if (value.indexOf('dweb:/ipfs') === -1) browser.assert.fail('ipfs deploy failed', '', '')
done()
})
.modalFooterClick('#modal-footer-ok')
.modalFooterOKClick()
},
'Publish on Swarm': function (browser) {
browser

@ -38,7 +38,7 @@ module.exports = {
.click('.instance:nth-of-type(2) > div > button')
.clickFunction('set - transact (not payable)', {types: 'uint256 _p', values: '34'})
.click('i.savetransaction')
.modalFooterClick('#modal-footer-ok')
.modalFooterOKClick()
.getEditorValue(function (result) {
var parsed = JSON.parse(result)
browser.assert.equal(JSON.stringify(parsed.transactions[0].record.parameters), JSON.stringify(scenario.transactions[0].record.parameters))

Loading…
Cancel
Save