Skip to content

alexKazarin/SeleniumSimpleSample_JS

Repository files navigation

Travis CI: Build Status

This project is simple example of HowTo organize Selenium-tests on JavaScript.

You will need:

How to run:

After you have installed all necessary elements, clone this repo and execute in terminal

$ npm run test

How to create your personal project step by step:

Initialise npm project:

$ npm init

Install dependencies:

  • javascript test framework (ex. Mocha)

$ npm install --save-dev mocha

  • module for webdriver support

$ npm install --save-dev selenium-webdriver

  • module for assertions support

$ npm install --save-dev chai

  • module to work with file system (screenshots buffer)

$ npm install --save-dev fs

Download webdriver and put it into project:

  • used Chromedriver (ex. in repo last available v2.27 for Linux x64)

Create npm-command "test" in package.json:

"scripts": {
    "test": "node_modules/mocha/bin/mocha src/tests/Tests.js"
  },

Start coding tests! (or view this repo tests and its comments)

Common structure:

Read about pObject pattern

About

Selenium-tests on JavaScript. Any questions/recommendations - create Issues!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •