From 014a4262825165153b9442f4069bb782907f9bda Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 11 Jul 2019 10:33:54 +0200 Subject: [PATCH] hiding the modal after the callback is called --- src/app/ui/modaldialog.js | 9 +++------ test-browser/commands/addFile.js | 1 + test-browser/commands/verifyContracts.js | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/ui/modaldialog.js b/src/app/ui/modaldialog.js index f64cc69c16..ef881b94d4 100644 --- a/src/app/ui/modaldialog.js +++ b/src/app/ui/modaldialog.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 () { diff --git a/test-browser/commands/addFile.js b/test-browser/commands/addFile.js index 332d93327e..5c5564d666 100644 --- a/test-browser/commands/addFile.js +++ b/test-browser/commands/addFile.js @@ -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') { diff --git a/test-browser/commands/verifyContracts.js b/test-browser/commands/verifyContracts.js index 842487476a..c35870180f 100644 --- a/test-browser/commands/verifyContracts.js +++ b/test-browser/commands/verifyContracts.js @@ -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()