Giter Site home page Giter Site logo

rohinegi548 / automationwithwebdriverjsmochachai Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 691 KB

Sample UI Automation using WebdriverJS, Mocha ChaiJS and Allure reporting framework.

JavaScript 100.00%
mocha-chai mocha-allure-reporter webdriverjs mocha-chaijs javascript-framework selenium-javascript javascript-tests mocha-reporter test-report interactive-reporting

automationwithwebdriverjsmochachai's Introduction

AutomationWithWebdriverJSMochaChai

Sample UI Automation using WebdriverJS, Mocha ChaiJS and Allure reporting framework.

Installation
Pre-requisites to run this on your system:
  Node.js (install from nodejs.org)
  npm (comes with nodejs)
  selenium webdriver( $ npm install selenium-webdriver --save )
  mocha ( $ npm install mocha --save )
  chai ( $ npm install chai --save )
  allure reporting ( $ npm install mocha-allure-reporter --save )
  
Clone repository on your system and do changes as per your requirements.
After that you can fire command in terminal:

$ npm test

This will execute your tests sequentially:
  -first mvn clean will clean all required directory so tha for each run fresh reports get generated
  -mocha ./tests/login.js --no-timeouts -R mocha-allure-reporter will run your tests with not timeout boundation and generate
   allure-results directory after execution completes
  -mvn site with generate allure report in target/site/maven-allure-plugin/index.html with all your failed/passed screenshots.
  
  Benefits of using --no-timeouts: for mocha default timeout is 2 seconds, so whether your tests take more than 2 sec time 
    if you don't set this option,  your test will only execute for 2 seconds and this will cause of failing of your test unexpectedly. So its a good option to try.
    
Package.json: This is actually works like pom in maven, you mention all dependencies and configuration in it, also you can use this to run your test by one command: npm test as I have used, using 'scripts' option:

"scripts": {
    "test": "mvn clean ; mocha ./tests/Login.js --no-timeouts -R mocha-allure-reporter ; mvn site"
  },
  
You can view report by opening this index.html in firefor or using jetty server in chrome.

Sample report screenshots:




automationwithwebdriverjsmochachai's People

Contributors

rohinegi548 avatar

Watchers

 avatar

Forkers

marcelkweens

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.