Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remarkablemark/webdriverjs-recipes
WebDriverJS Recipes (Selenium for Node.js)
https://github.com/remarkablemark/webdriverjs-recipes
chrome chromedriver firefox javascript nodejs selenium selenium-webdriver webdriver webdriverjs
Last synced: 18 days ago
JSON representation
WebDriverJS Recipes (Selenium for Node.js)
- Host: GitHub
- URL: https://github.com/remarkablemark/webdriverjs-recipes
- Owner: remarkablemark
- License: mit
- Created: 2016-08-19T04:23:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T22:28:31.000Z (6 months ago)
- Last Synced: 2024-05-22T23:32:06.980Z (6 months ago)
- Topics: chrome, chromedriver, firefox, javascript, nodejs, selenium, selenium-webdriver, webdriver, webdriverjs
- Language: JavaScript
- Homepage:
- Size: 973 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WebDriverJS Recipes
[![build](https://github.com/remarkablemark/webdriverjs-recipes/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/webdriverjs-recipes/actions/workflows/build.yml)
Recipes and examples of how to perform automation with [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs) ([Selenium](https://www.selenium.dev/) for [Node.js](https://nodejs.org/)).
See [API documentation](https://www.selenium.dev/selenium/docs/api/javascript/index.html) for more information on [selenium-webdriver](https://www.npmjs.com/package/selenium-webdriver).
## Prerequisites
[Node.js](https://nodejs.org/en/download/):
```sh
brew install node
```[nvm](https://github.com/nvm-sh/nvm#install--update-script):
```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
```[Yarn 1](https://classic.yarnpkg.com/en/docs/install/#mac-stable):
```sh
brew install yarn
```[Chrome](https://www.google.com/chrome/):
```sh
brew cask install google-chrome
```[ChromeDriver](https://chromedriver.chromium.org/downloads):
```sh
brew install chromedriver
```[Firefox](https://www.mozilla.org/en-US/firefox/new/):
```sh
brew cask install firefox
```[geckodriver](https://github.com/mozilla/geckodriver/releases):
```sh
brew cask install geckodriver
```## Install
Clone the repository:
```sh
git clone https://github.com/remarkablemark/webdriverjs-recipes.git && cd webdriverjs-recipes
```Use Node.js version:
```sh
nvm use
```Install the dependencies:
```sh
yarn
```## Available Scripts
In the project directory, you can run:
### `yarn async-await`
Automates a Firefox browser using [async/await](https://javascript.info/async-await). See [article](https://b.remarkabl.org/34tlEFy).
### `yarn build`
Builds driver with Firefox browser.
To build driver with Chrome browser:
```sh
SELENIUM_BROWSER=chrome yarn build
```### `yarn chrome-profile`
Launches Chrome profile page. See [article](https://b.remarkabl.org/2PcaLmy).
The profile data is saved at `./my_profile_path/`.
### `yarn cucumber`
Runs browser automation test written in [Cucumber](https://github.com/cucumber/cucumber-js). See [artcile](https://b.remarkabl.org/34pXj3b).
### `yarn find`
Finds elements. See [article](https://b.remarkabl.org/3dcXiCT).
### `yarn jest`
Runs browser automation test with [Jest](https://jestjs.io/).
### `yarn mocha`
Runs browser automation test with [Mocha](https://mochajs.org/). See [article](https://b.remarkabl.org/2bbW9M2).
### `yarn resources`
Gets the browser resource file URL's of a webpage. See [article](https://b.remarkabl.org/39OCH7f).
### `yarn screenshot`
Takes and saves a screenshot to `./screenshot.png`.
### `yarn wait-until`
Waits until condition is true.
## License
[MIT](LICENSE)