hiding the modal after the callback is called

pull/3094/head
yann300 5 years ago
parent c0aadabd56
commit 014a426282
  1. 9
      src/app/ui/modaldialog.js
  2. 1
      test-browser/commands/addFile.js
  3. 4
      test-browser/commands/verifyContracts.js

@ -49,18 +49,14 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
function okListener () {
removeEventListener()
hide()
if (ok && ok.fn && agreed) ok.fn()
hide()
}
function cancelListener () {
removeEventListener()
hide()
if (cancel && cancel.fn) cancel.fn()
if (container) {
container.class = `modal`
container = null
}
hide()
}
function modalKeyEvent (e) {
@ -83,6 +79,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
function hide () {
if (container) container.style.display = 'none'
if (container.parentElement) container.parentElement.removeChild(container)
container = null
}
function show () {

@ -14,6 +14,7 @@ class AddFile extends EventEmitter {
function addFile (browser, name, content, done) {
browser.clickLaunchIcon('udapp').clickLaunchIcon('fileExplorers').click('.newFile')
.waitForElementVisible('#modal-dialog')
.perform((client, done) => {
browser.execute(function (fileName) {
if (fileName !== 'Untitled.sol') {

@ -14,7 +14,7 @@ class VerifyContracts extends EventEmitter {
function getCompiledContracts (browser, callback) {
browser.clickLaunchIcon('solidity').execute(function () {
var contracts = document.querySelectorAll('#compileTabView select option')
var contracts = document.querySelectorAll('#compileTabView select#compiledContracts option')
if (!contracts) {
return null
} else {
@ -33,7 +33,7 @@ function verifyContracts (browser, compiledContractNames, callback) {
getCompiledContracts(browser, (result) => {
if (result.value) {
for (var contract in compiledContractNames) {
console.log(' - ' + compiledContractNames[contract])
console.log(' - ' + compiledContractNames[contract], result.value)
if (result.value.indexOf(compiledContractNames[contract]) === -1) {
browser.assert.fail('compiled contract ' + compiledContractNames + ' not found', 'info about error', '')
browser.end()

Loading…
Cancel
Save