nightwatch-custom-commands-assertions icon indicating copy to clipboard operation
nightwatch-custom-commands-assertions copied to clipboard

does waitforAttribute work with Page Objects?

Open bradwbradw opened this issue 8 years ago • 2 comments

I'm trying https://github.com/maxgalbu/nightwatch-custom-commands-assertions/blob/master/docs/waitForAttribute.md

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?

bradwbradw avatar Aug 15 '16 20:08 bradwbradw

Uhm yes it should, there's a test for it:

https://github.com/maxgalbu/nightwatch-custom-commands-assertions/blob/01798d4ce91556fbb89b90467698ed3310ac3003/tests/runTests.js#L34-L37

Which version of nightwatch.js are you using?

maxgalbu avatar Aug 16 '16 09:08 maxgalbu

@bradwbradw You could try elements.continueButton.selector instead of "@continueButton".

Assuming you declared continueButton in an elements object.

romarioraffington avatar Aug 20 '16 02:08 romarioraffington