diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-08-14 10:07:02 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-08-14 23:05:50 +0800 |
commit | c00d0daeb528598e0f49484718fb7e91c40a1127 (patch) | |
tree | 6e32d6ce15d53779ca88505accb9f6747f7072a2 /test | |
parent | e2be22a4b722df608cb764042cc8ade6664414d8 (diff) | |
download | tangerine-wallet-browser-c00d0daeb528598e0f49484718fb7e91c40a1127.tar tangerine-wallet-browser-c00d0daeb528598e0f49484718fb7e91c40a1127.tar.gz tangerine-wallet-browser-c00d0daeb528598e0f49484718fb7e91c40a1127.tar.bz2 tangerine-wallet-browser-c00d0daeb528598e0f49484718fb7e91c40a1127.tar.lz tangerine-wallet-browser-c00d0daeb528598e0f49484718fb7e91c40a1127.tar.xz tangerine-wallet-browser-c00d0daeb528598e0f49484718fb7e91c40a1127.tar.zst tangerine-wallet-browser-c00d0daeb528598e0f49484718fb7e91c40a1127.zip |
Improve error handling in assertElementNotPresent of test/e2e/beta/helpers.js
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/beta/helpers.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/e2e/beta/helpers.js b/test/e2e/beta/helpers.js index 828f87db7..d90cd5d66 100644 --- a/test/e2e/beta/helpers.js +++ b/test/e2e/beta/helpers.js @@ -122,12 +122,14 @@ async function closeAllWindowHandlesExcept (driver, exceptions, windowHandles) { } async function assertElementNotPresent (webdriver, driver, by) { + let dataTab try { - const dataTab = await findElement(driver, by, 4000) - if (dataTab) { - assert(false, 'Data tab should not be present') - } + dataTab = await findElement(driver, by, 4000) } catch (err) { - assert(err instanceof webdriver.error.NoSuchElementError) + console.log(err) + assert(err instanceof webdriver.error.NoSuchElementError || err instanceof webdriver.error.TimeoutError) + } + if (dataTab) { + assert(false, 'Data tab should not be present') } } |