does waitforAttribute work with Page Objects?
bradwbradw opened this issue · 2 comments
I'm trying to use it to wait for a button do be enabled
.waitForAttribute("@continueButton", "disabled", function(disabled) {
return !disabled;
});
but getting Error while running getAttribute command: Converting circular structure to JSON
when i use the regular css selector, as in :
.waitForAttribute(".cart .continueButton", "disabled", function(disabled) {
return !disabled;
});
It works as expected.
But i'd prefer to use the page object syntax, as described in http://nightwatchjs.org/guide#page-objects
Is there a plan to add support for page objects?
Uhm yes it should, there's a test for it:
nightwatch-custom-commands-assertions/tests/runTests.js
Lines 34 to 37 in 01798d4
Which version of nightwatch.js are you using?
@bradwbradw You could try elements.continueButton.selector
instead of "@continueButton"
.
Assuming you declared continueButton
in an elements object.