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

Some README.md examples don't work #26

Open
edmulraney opened this issue Oct 23, 2015 · 0 comments
Open

Some README.md examples don't work #26

edmulraney opened this issue Oct 23, 2015 · 0 comments

Comments

@edmulraney
Copy link

Might be worth updating the README to include installing the 'should' library otherwise some examples will fail.

Some examples try to call should.equal on the result object of support.isElementPresent(...).

Example:

this.Then(/^I should not see a "([^"]*)" link$/, function(link, callback) {
    support.isElementPresent(this, link, function(result){
      result.should.equal(false);
      setTimeout(callback, 1000);
    });
  });

Alternatively you could remove the should stuff and just use:

 this.Then(/^I should not see a "([^"]*)" link$/, function(link, callback) {
    support.isElementPresent(this, link, function(result){
      if(result) {
        setTimeout(callback, 1000);
      } else {
        callback(new Error('Element not present'));
      }
    });
  });
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

1 participant