Skip to content

remarkablemark/webdriverjs-recipes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebDriverJS Recipes

build

Recipes and examples of how to perform automation with WebDriverJS (Selenium for Node.js).

See API documentation for more information on selenium-webdriver.

Prerequisites

Node.js:

brew install node

nvm:

curl -o- https://raw.github.com/nvm-sh/nvm/v0.39.3/install.sh | bash

Yarn 1:

brew install yarn

Chrome:

brew cask install google-chrome

ChromeDriver:

brew install chromedriver

Firefox:

brew cask install firefox

geckodriver:

brew cask install geckodriver

Install

Clone the repository:

git clone https://github.com/remarkablemark/webdriverjs-recipes.git && cd webdriverjs-recipes

Use Node.js version:

nvm use

Install the dependencies:

yarn

Available Scripts

In the project directory, you can run:

yarn async-await

Automates a Firefox browser using async/await. See article.

yarn build

Builds driver with Firefox browser.

To build driver with Chrome browser:

SELENIUM_BROWSER=chrome yarn build

yarn chrome-profile

Launches Chrome profile page. See article.

The profile data is saved at ./my_profile_path/.

yarn cucumber

Runs browser automation test written in Cucumber. See artcile.

yarn find

Finds elements. See article.

yarn jest

Runs browser automation test with Jest.

yarn mocha

Runs browser automation test with Mocha. See article.

yarn resources

Gets the browser resource file URL's of a webpage. See article.

yarn screenshot

Takes and saves a screenshot to ./screenshot.png.

yarn wait-until

Waits until condition is true.

License

MIT