Commit dca07a60 authored by yann300's avatar yann300

hiding the modal after the callback is called

parent 70f71292
...@@ -49,18 +49,14 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => { ...@@ -49,18 +49,14 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
function okListener () { function okListener () {
removeEventListener() removeEventListener()
hide()
if (ok && ok.fn && agreed) ok.fn() if (ok && ok.fn && agreed) ok.fn()
hide()
} }
function cancelListener () { function cancelListener () {
removeEventListener() removeEventListener()
hide()
if (cancel && cancel.fn) cancel.fn() if (cancel && cancel.fn) cancel.fn()
if (container) { hide()
container.class = `modal`
container = null
}
} }
function modalKeyEvent (e) { function modalKeyEvent (e) {
...@@ -83,6 +79,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => { ...@@ -83,6 +79,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
function hide () { function hide () {
if (container) container.style.display = 'none' if (container) container.style.display = 'none'
if (container.parentElement) container.parentElement.removeChild(container) if (container.parentElement) container.parentElement.removeChild(container)
container = null
} }
function show () { function show () {
......
...@@ -14,6 +14,7 @@ class AddFile extends EventEmitter { ...@@ -14,6 +14,7 @@ class AddFile extends EventEmitter {
function addFile (browser, name, content, done) { function addFile (browser, name, content, done) {
browser.clickLaunchIcon('udapp').clickLaunchIcon('fileExplorers').click('.newFile') browser.clickLaunchIcon('udapp').clickLaunchIcon('fileExplorers').click('.newFile')
.waitForElementVisible('#modal-dialog')
.perform((client, done) => { .perform((client, done) => {
browser.execute(function (fileName) { browser.execute(function (fileName) {
if (fileName !== 'Untitled.sol') { if (fileName !== 'Untitled.sol') {
......
...@@ -14,7 +14,7 @@ class VerifyContracts extends EventEmitter { ...@@ -14,7 +14,7 @@ class VerifyContracts extends EventEmitter {
function getCompiledContracts (browser, callback) { function getCompiledContracts (browser, callback) {
browser.clickLaunchIcon('solidity').execute(function () { browser.clickLaunchIcon('solidity').execute(function () {
var contracts = document.querySelectorAll('#compileTabView select option') var contracts = document.querySelectorAll('#compileTabView select#compiledContracts option')
if (!contracts) { if (!contracts) {
return null return null
} else { } else {
...@@ -33,7 +33,7 @@ function verifyContracts (browser, compiledContractNames, callback) { ...@@ -33,7 +33,7 @@ function verifyContracts (browser, compiledContractNames, callback) {
getCompiledContracts(browser, (result) => { getCompiledContracts(browser, (result) => {
if (result.value) { if (result.value) {
for (var contract in compiledContractNames) { for (var contract in compiledContractNames) {
console.log(' - ' + compiledContractNames[contract]) console.log(' - ' + compiledContractNames[contract], result.value)
if (result.value.indexOf(compiledContractNames[contract]) === -1) { if (result.value.indexOf(compiledContractNames[contract]) === -1) {
browser.assert.fail('compiled contract ' + compiledContractNames + ' not found', 'info about error', '') browser.assert.fail('compiled contract ' + compiledContractNames + ' not found', 'info about error', '')
browser.end() browser.end()
......
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