-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expect assertions break using before/after methods #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you tried referencing the element by its css selector directly? Does that produce the same error? |
The following works: Keeping it within the |
Thanks, I see the issue, will fix soon. |
Posted a fix here |
I'm seeing this issue occurring again. Running nightwatch v0.9.0. This test fails: login_modal.expect.element('@modal').to.not.be.visible.before(browser.globals.timeout);
header_login.expect.element('@login_button').to.not.be.present;
header_login.expect.element('@logout_button').to.be.visible; with output: This test works: browser.pause(browser.globals.timeout);
login_modal.expect.element('@modal').to.not.be.visible;
header_login.expect.element('@login_button').to.not.be.present;
header_login.expect.element('@logout_button').to.be.visible; Trying CSS selectors instead of page objects makes no difference to this. |
Are you sure it's the same issue? There have been no changes in the area and your test doesn't seem to be doing exactly the same thing. |
Btw, you can avoid |
Have you changed anything in your setup? Like selenium or browser version? On Thursday, 26 May 2016, Simon W [email protected] wrote:
|
This is in a different project to my original issue, although I don't believe it was ever solved in that one either. I'm running node v0.12.9, selenium server 2.53.0, and chrome webdriver from this package, v2.21.2. Also tested this under node 4.4.3, without change. |
And in nightwatch 0.8.18 it works as expected? |
Is it possible to see the verbose log output for the failing test in 0.9.0? |
No, doesn't work in nightwatch 0.8,18 either. Since raising the issue originally I can't definitively tell you it has worked - this is for a work project and I swapped teams for a while so dropped the work we're doing with Nightwatch. I don't think this is something that has been broken in a recent release. I've had to blank a few values in the output as this is client work and I'd rather avoid posting up their URLs, and also removed my login info. Output here: https://gist.github.com/munkyjunky/70d3105f9d1a86db6e3e07c106d2cc57 |
Ok, from the output here is looks like the element is not visible so for some reason nightwatch is incorrectly reporting that it is. I'll look into it, can you open a separate issue please? |
Opened new issue #997 |
Addition of the
after
method to my assertions causes an error to be thrown.Code:
Error:
Removing the
after
method prevents this error from occurring, however my test fails (as expected in that case, as the element is not visible). What I'm trying to achieve with my test:Changing the section declaration for just an element causes the same error. I suspect this error is happening as I'm expecting a section of a page to become visible that at the initial time of assertion is not on the page. Switching to
browser.waitForElementVisible
allows me to complete the test, so I think this is an issue within theexpect
API.Can't post the full test due to this being a work project.
The text was updated successfully, but these errors were encountered: