Commit 69a95431 authored by ioedeveloper's avatar ioedeveloper

Undo ModalFooterClick Changes

parent dc060971
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
const EventEmitter = require('events') const EventEmitter = require('events')
class ModalFooterClick extends EventEmitter { class ModalFooterOKClick extends EventEmitter {
command (cssSelector) { command () {
this.api.waitForElementVisible(cssSelector).perform((client, done) => { this.api.waitForElementVisible('#modal-footer-ok').perform((client, done) => {
this.api.execute(function () { this.api.execute(function () {
document.querySelector(cssSelector).click() document.querySelector('#modal-footer-ok').click()
}, [], (result) => { }, [], (result) => {
done() done()
this.emit('complete') this.emit('complete')
...@@ -14,4 +14,4 @@ class ModalFooterClick extends EventEmitter { ...@@ -14,4 +14,4 @@ class ModalFooterClick extends EventEmitter {
} }
} }
module.exports = ModalFooterClick module.exports = ModalFooterOKClick
...@@ -60,7 +60,7 @@ module.exports = { ...@@ -60,7 +60,7 @@ module.exports = {
'Deploy and use Ballot using external web3': function (browser) { 'Deploy and use Ballot using external web3': function (browser) {
browser browser
.click('#selectExEnvOptions #web3-mode') .click('#selectExEnvOptions #web3-mode')
.modalFooterClick('#modal-footer-ok') .modalFooterOKClick()
.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')
......
...@@ -23,7 +23,7 @@ module.exports = { ...@@ -23,7 +23,7 @@ module.exports = {
.waitForElementVisible('#icon-panel', 10000) .waitForElementVisible('#icon-panel', 10000)
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.click('#publishToGist') .click('#publishToGist')
.modalFooterClick('#modal-footer-ok') .modalFooterOKClick()
.getModalBody((value, done) => { .getModalBody((value, done) => {
const reg = /gist.github.com\/([^.]+)/ const reg = /gist.github.com\/([^.]+)/
const id = value.match(reg) const id = value.match(reg)
...@@ -33,7 +33,7 @@ module.exports = { ...@@ -33,7 +33,7 @@ module.exports = {
} else { } else {
let gistid = id[1] let gistid = id[1]
browser browser
.modalFooterClick('#modal-footer-cancel') .modalFooterCancelClick()
.executeScript(`remix.loadgist('${gistid}')`) .executeScript(`remix.loadgist('${gistid}')`)
.switchFile('browser/gists') .switchFile('browser/gists')
.switchFile(`browser/gists/${gistid}`) .switchFile(`browser/gists/${gistid}`)
...@@ -44,8 +44,8 @@ module.exports = { ...@@ -44,8 +44,8 @@ module.exports = {
}, },
'Load Gist Modal': function (browser) { 'Load Gist Modal': function (browser) {
browser browser
.waitForElementVisible('#icon-panel', 10000) .waitForElementVisible('#icon-panel')
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('home')
.scrollAndClick('div.file > div.btn-group > button:nth-child(1)') .scrollAndClick('div.file > div.btn-group > button:nth-child(1)')
.waitForElementVisible('h6.modal-title') .waitForElementVisible('h6.modal-title')
.assert.containsText('h6.modal-title', 'Load a Gist') .assert.containsText('h6.modal-title', 'Load a Gist')
...@@ -62,10 +62,10 @@ module.exports = { ...@@ -62,10 +62,10 @@ module.exports = {
.scrollAndClick('div.file > div.btn-group > button:nth-child(1)') .scrollAndClick('div.file > div.btn-group > button:nth-child(1)')
.waitForElementVisible('#prompt_text') .waitForElementVisible('#prompt_text')
.setValue('#prompt_text', testData.invalidGistId) .setValue('#prompt_text', testData.invalidGistId)
.modalFooterClick('#modal-footer-ok') .modalFooterOKClick()
.waitForElementVisible('div.modal-body > div') .waitForElementVisible('div.modal-body > div')
.assert.containsText('div.modal-body > div', 'Gist load error: Not Found') .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) { 'Import From Gist For Valid Gist ID': function (browser) {
...@@ -75,7 +75,7 @@ module.exports = { ...@@ -75,7 +75,7 @@ module.exports = {
.scrollAndClick('div.file > div.btn-group > button:nth-child(1)') .scrollAndClick('div.file > div.btn-group > button:nth-child(1)')
.waitForElementVisible('#prompt_text') .waitForElementVisible('#prompt_text')
.setValue('#prompt_text', testData.validGistId) .setValue('#prompt_text', testData.validGistId)
.modalFooterClick('#modal-footer-ok') .modalFooterOKClick()
.switchFile(`browser/gists/${testData.validGistId}`) .switchFile(`browser/gists/${testData.validGistId}`)
.switchFile(`browser/gists/${testData.validGistId}/ApplicationRegistry`) .switchFile(`browser/gists/${testData.validGistId}/ApplicationRegistry`)
.waitForElementVisible(`div[title='browser/gists/${testData.validGistId}/ApplicationRegistry']`) .waitForElementVisible(`div[title='browser/gists/${testData.validGistId}/ApplicationRegistry']`)
......
...@@ -21,7 +21,7 @@ module.exports = { ...@@ -21,7 +21,7 @@ module.exports = {
if (value.indexOf('dweb:/ipfs') === -1) browser.assert.fail('ipfs deploy failed', '', '') if (value.indexOf('dweb:/ipfs') === -1) browser.assert.fail('ipfs deploy failed', '', '')
done() done()
}) })
.modalFooterClick('#modal-footer-ok') .modalFooterOKClick()
}, },
'Publish on Swarm': function (browser) { 'Publish on Swarm': function (browser) {
browser browser
......
...@@ -38,7 +38,7 @@ module.exports = { ...@@ -38,7 +38,7 @@ module.exports = {
.click('.instance:nth-of-type(2) > div > button') .click('.instance:nth-of-type(2) > div > button')
.clickFunction('set - transact (not payable)', {types: 'uint256 _p', values: '34'}) .clickFunction('set - transact (not payable)', {types: 'uint256 _p', values: '34'})
.click('i.savetransaction') .click('i.savetransaction')
.modalFooterClick('#modal-footer-ok') .modalFooterOKClick()
.getEditorValue(function (result) { .getEditorValue(function (result) {
var parsed = JSON.parse(result) var parsed = JSON.parse(result)
browser.assert.equal(JSON.stringify(parsed.transactions[0].record.parameters), JSON.stringify(scenario.transactions[0].record.parameters)) browser.assert.equal(JSON.stringify(parsed.transactions[0].record.parameters), JSON.stringify(scenario.transactions[0].record.parameters))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment