nightmare-wait-for-url
Adds .waitForUrl() to your Nightmare scripts.
tl;dr
- Install by executing
npm install nightmare-wait-for-url
oryarn add nightmare-wait-for-url
. - Import by adding
require('nightmare-wait-for-url')
. - Use by adding
.waitForUrl(url)
to your Nightmare chain, whereurl
is aString
or aRegExp
.
Getting started
Installation
Add nigthmare-wait-for-url by executing npm install nightmare-wait-for-url
or yarn add nightmare-wait-for-url
.
Usage
Here's an example of basic usage:
const Nightmare = ;; const nightmare = nightmare type'#search_form_input_homepage' 'Alexander the great' ;
.waitForUrl(string)
Waits for the navigation to include the provided string.
Example:
nightmare type'#search_form_input_homepage' 'Alexander the great' ;
.waitForUrl(regex)
Waits for the navigation to match the provided regular expression.
Example:
nightmare type'#search_form_input_homepage' 'Alexander the great' ;
waitTimeout
Throws an exception if the .waitForUrl()
didn't return true within the set timeframe.
More on waitTimeout in Nightmare's README.
License
The MIT License.
Author
Alexander Liljengård alexander@paxxmedia.se |
|
Wojciech Maj kontakt@wojtekmaj.pl http://wojtekmaj.pl |
Thank you
This project wouldn't be possible without awesome work of Alexander Liljengård alexander@paxxmedia.se who created its initial version. Thank you!