Skip to content
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

does waitforAttribute work with Page Objects? #18

Open
bradwbradw opened this issue Aug 15, 2016 · 2 comments
Open

does waitforAttribute work with Page Objects? #18

bradwbradw opened this issue Aug 15, 2016 · 2 comments

Comments

@bradwbradw
Copy link

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?

@maxgalbu
Copy link
Owner

maxgalbu commented Aug 16, 2016

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

browser.url(baseurl+"/waitForAttribute");
pageObject.waitForAttribute("@waitForXpath", "class", function (divclass) {
return divclass === "myclass";
});

Which version of nightwatch.js are you using?

@romarioraffington
Copy link

romarioraffington commented Aug 20, 2016

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

Assuming you declared continueButton in an elements object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants