Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bfulop/selenium-tests
Crossbrowsertesting Selenium tests with NodeJS
https://github.com/bfulop/selenium-tests
Last synced: 11 days ago
JSON representation
Crossbrowsertesting Selenium tests with NodeJS
- Host: GitHub
- URL: https://github.com/bfulop/selenium-tests
- Owner: bfulop
- Created: 2016-10-03T13:54:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-03T13:54:42.000Z (over 8 years ago)
- Last Synced: 2024-11-21T14:41:37.045Z (2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Using Selenium testing with [crossbrowsertesting.com](http://crossborwsertesting.com)
_Thanks for Chase at Crossborwsertesting for providing me the base for this snippet!_
A sample script to show how to interact with the Selenium driver AND Crossborwsertesting's Rest API to take screenshots while passing commands to the browser.
I'm using NodeJS with the excellent [webdriverio](http://webdriver.io) module to interact with Selenium.
The main routine is using the ES6 generator function with an external runner file (`runner.js`) to iterate through the `yield` points in the generator. webdriverio commands return promises and generator function with the runner let's me write a very linear looking, but fundamentally asynchronous operations.
At key points in the execution, I'm taking screenshots of the browser, using the Crossbrowsertesting Rest API.
**NOTE**
This is just a starting point, to demonstrate how to use Selenium, NodeJS and the CBT Rest API.
##To use
`npm install`
Put your crossborwsertesting credentials in `secrets.json`:
```
{
"user": "[email protected]",
"key": "yourkey"
}
```I've put a few browser definitions in `browser.json`. You can add more by using the [wizard](https://app.crossbrowsertesting.com/selenium/run) on the Selenium testing tab.
Then finally:
`node wdio_test`