diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index 50116dec42..8df05cba92 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -15,21 +15,15 @@ class addAtAddressInstance extends EventEmitter { function addInstance (browser: NightwatchBrowser, address: string, isValidFormat: boolean, isValidChecksum: boolean, callback: VoidFunction) { browser.clickLaunchIcon('udapp').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () { - browser.click('button[id^="runAndDeployAtAdressButton"]') - .execute(function () { - const ret = document.querySelector('div[class^="modal-body"] div').innerHTML - const modal = document.querySelector('#modal-footer-ok') as HTMLElement - - modal.click() - return ret - }, [], function (result) { - if (!isValidFormat) { - browser.assert.equal(result.value, 'Invalid address.') - } else if (!isValidChecksum) { - browser.assert.equal(result.value, 'Invalid checksum address.') - } - callback() - }) + if (!isValidFormat || !isValidChecksum) browser.assert.elementPresent('button[id^="runAndDeployAtAdressButton"]:disabled') + else { + browser.click('button[id^="runAndDeployAtAdressButton"]') + .execute(function () { + const modal = document.querySelector('#modal-footer-ok') as HTMLElement + modal.click() + }) + } + callback() }) } diff --git a/apps/remix-ide/index.html b/apps/remix-ide/index.html index 095c829e7e..27e1742864 100644 --- a/apps/remix-ide/index.html +++ b/apps/remix-ide/index.html @@ -32,6 +32,22 @@ + + +