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

How do I wait for elements to be visible / not visible? #13

Open
cressie176 opened this issue Apr 23, 2014 · 1 comment
Open

How do I wait for elements to be visible / not visible? #13

cressie176 opened this issue Apr 23, 2014 · 1 comment
Assignees

Comments

@cressie176
Copy link

Is it possible to get dalek to wait until an element is visble / invisible? We found the action.waitWhileVisible method in the source but aren't sure whether this feature is implemented (it has a big TODO indicating not)

@asciidisco asciidisco self-assigned this Apr 25, 2014
@asciidisco
Copy link
Member

Unfortunately that feature hasn't made it in the code yet, but I can tell you a workaround (using jQuery on the example to keep the code short, but you can totally do this with vanilla javascript)

'my test': function (test) {
  test.open('http://mypage.com')
    // waits until the element is visible / timeouts after 10 sec.
    .waitFor(function () {
      return !!$('#my-element').is(':visible');
    }, [], 10000)
    // continue with your normal dalek stuff
    .assert.text('#my-element', 'Now you see me!')
    .done();
}

Hope that helps, please ask if you have further questions.

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

No branches or pull requests

2 participants