You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module.exports={before(client){client.url('https://www.google.com/')},// '#hplogo' exists// '#foo' does not exist'present - success'(client){client.waitForElementPresent('#hplogo',5000);},'not present - success'(client){client.waitForElementNotPresent('#foo',5000);},'present - failure'(client){client.waitForElementPresent('#foo',5000);},'not present - failure'(client){client.waitForElementNotPresent('#hplogo',5000);},after(client){client.end();}};
And here is the output:
[My Test] Test Suite
======================
Running: present - success
✔ Element <#hplogo> was present after 7 milliseconds.
OK. 1 assertions passed. (10ms)
Running: not present - success
✔ Element <#foo> was not present after 5 milliseconds.
OK. 1 assertions passed. (7ms)
Running: present - failure
✖ Timed out while waiting for element <#foo> to be present for 5000 milliseconds. - expected "found" but got: "not found"
at Object.present - failure (/home/lloiser/projects/nightwatch-testing-repo/test/wait-test.js:18:12)
at Context.call (/home/lloiser/projects/nightwatch/lib/testsuite/context.js:213:32)
at TestCase.run (/home/lloiser/projects/nightwatch/lib/testsuite/testcase.js:49:31)
at Runnable.handleRunnable [as __runFn] (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:349:32)
at Runnable.run (/home/lloiser/projects/nightwatch/lib/testsuite/runnable.js:123:21)
at TestSuite.createRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:415:33)
at TestSuite.handleRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:419:17)
at createSession.then.then._ (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:348:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
FAILED: 1 assertions failed (5.075s)
Running: not present - failure
✖ Timed out while waiting for element <#hplogo> to be removed for 5000 milliseconds. - expected "not found" but got: "found"
at Object.not present - failure (/home/lloiser/projects/nightwatch-testing-repo/test/wait-test.js:21:12)
at Context.call (/home/lloiser/projects/nightwatch/lib/testsuite/context.js:213:32)
at TestCase.run (/home/lloiser/projects/nightwatch/lib/testsuite/testcase.js:49:31)
at Runnable.handleRunnable [as __runFn] (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:349:32)
at Runnable.run (/home/lloiser/projects/nightwatch/lib/testsuite/runnable.js:123:21)
at TestSuite.createRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:415:33)
at TestSuite.handleRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:419:17)
at createSession.then.then._ (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:348:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
FAILED: 1 assertions failed (7ms)
_________________________________________________
TEST FAILURE: 2 assertions failed, 2 passed. 8.269s
✖ wait-test
– present - failure (5.075s)
Timed out while waiting for element <#foo> to be present for 5000 milliseconds. - expected "found" but got: "not found"
at Object.present - failure (/home/lloiser/projects/nightwatch-testing-repo/test/wait-test.js:18:12)
at Context.call (/home/lloiser/projects/nightwatch/lib/testsuite/context.js:213:32)
at TestCase.run (/home/lloiser/projects/nightwatch/lib/testsuite/testcase.js:49:31)
at Runnable.handleRunnable [as __runFn] (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:349:32)
at Runnable.run (/home/lloiser/projects/nightwatch/lib/testsuite/runnable.js:123:21)
at TestSuite.createRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:415:33)
at TestSuite.handleRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:419:17)
at createSession.then.then._ (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:348:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
– not present - failure (7ms)
Timed out while waiting for element <#hplogo> to be removed for 5000 milliseconds. - expected "not found" but got: "found"
at Object.not present - failure (/home/lloiser/projects/nightwatch-testing-repo/test/wait-test.js:21:12)
at Context.call (/home/lloiser/projects/nightwatch/lib/testsuite/context.js:213:32)
at TestCase.run (/home/lloiser/projects/nightwatch/lib/testsuite/testcase.js:49:31)
at Runnable.handleRunnable [as __runFn] (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:349:32)
at Runnable.run (/home/lloiser/projects/nightwatch/lib/testsuite/runnable.js:123:21)
at TestSuite.createRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:415:33)
at TestSuite.handleRunnable (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:419:17)
at createSession.then.then._ (/home/lloiser/projects/nightwatch/lib/testsuite/testsuite.js:348:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
The output above can be interpreted as:
present - success succeeded after 10ms ✔️
not present - success succeeded after 7ms ✔️
present - failure failed after 5.075s ✔️
not present - failure failed after 7ms ❌
The text was updated successfully, but these errors were encountered:
As part of #2079 a fix was implemented in
waitForElementNotPresent
which is not correct:2c05fc1#diff-643e0b67e0938dc01d586a7a29374a9fR40
Here are my tests to highlight the problem:
And here is the output:
The output above can be interpreted as:
present - success
succeeded after 10ms ✔️not present - success
succeeded after 7ms ✔️present - failure
failed after 5.075s ✔️not present - failure
failed after 7ms ❌The text was updated successfully, but these errors were encountered: