These are chat archives for rosshinkley/nightmare

14th
Jul 2017
Mario David
@mariomddavid_twitter
Jul 14 2017 06:38

hi, i have a little question. I want to use wait() not until some element is visible, but until some element is not visible any more (there is some loading indicator in there...). I tried using something like this, but it did not to work out very well:

    .wait(function() {
      if ($('div.modal.in')[0] === undefined) {
        return true
      } else {
        return false
      }
    })

Also wait(fn) is not documented (i think i read it somewhere).

Is there a way to wait until a certain element on the page disappeared?

Ross Hinkley
@rosshinkley
Jul 14 2017 12:17
I'll be around later today
@mariomddavid_twitter
Davide De Gennaro
@dege88
Jul 14 2017 12:49
@py4object according to the tests exists should return immediately a bool: https://github.com/segmentio/nightmare/blob/master/test/index.js#L712
Davide De Gennaro
@dege88
Jul 14 2017 12:54
@mariomddavid_twitter try to use something like
.wait(() => $('div.modal.in').length === 0)
Hugo Grochau
@hugogrochau
Jul 14 2017 15:37
Nightmare looks awesome! Does anyone know if it's still maintained? The github repo hasn't been updated in 5 months and there are a lot of issues and PRs