Coder Social home page Coder Social logo

selenium-controller's Introduction

Selenium Controller Build Status codecov Codacy Badge

Selenium controller is a Node.js application that can be used to test web applications or execute repetitive tasks using Javascript code and selenium-webdriver.

Installation

Before anything make sure Chrome webdriver is installed and setup correctly.

Clone the repo and run npm install:

$ git clone https://github.com/visola/selenium-controller.git
$ cd selenium-controller/
$ npm install

Starting using it!

Long Description

The idea is that you have folders with Node modules that export Action classes. Each action executes some specific task. It might receive some arguments and or depend on some properties. You pass the actions you want to execute to the command either by arguments through the command line or via a script file, line-by-line.

An example would be something like:

$ node index \
  -a samples/react-to-do/actions \
  -a samples/shared-actions \
  -f samples/react-to-do/properties.yml \
  -e GoToReactToDo \
  -e "TakeScreenshot('home.png')" \
  -e "CreateToDo('Buy Milk')" \
  -e "TakeScreenshot('buy-milk.png')"

This command is doing the following:

  • -a samples/react-to-do/actions and -a samples/shared-actions - Load action classes from these directories
  • -f react-to-do/properties.yml - Read environment properties from this file
  • -e GoToReactToDo, -e "TakeScreenshot('home.png')" ... - Execute these actions

This command would output the following:

Properties are: {"timeout":10000,"url":"http://todomvc.com/examples/react"}
Mapping action file: CreateToDo -> /Users/visola/git/selenium-controller/samples/react-to-do/actions/CreateToDo.js
Mapping action file: GoToReactToDo -> /Users/visola/git/selenium-controller/samples/react-to-do/actions/GoToReactToDo.js
Mapping action file: TakeScreenshot -> /Users/visola/git/selenium-controller/samples/shared-actions/TakeScreenshot.js
Executing the following actions: GoToReactToDo, TakeScreenshot, CreateToDo, TakeScreenshot
Executing action: 'GoToReactToDo' with arguments: []
Executed 'GoToReactToDo' in 1392 ms
Executing action: 'TakeScreenshot' with arguments: ["home.png"]
Screenshot saved at: home.png
Executed 'TakeScreenshot' in 409 ms
Executing action: 'CreateToDo' with arguments: ["Buy Milk"]
Executed 'CreateToDo' in 162 ms
Executing action: 'TakeScreenshot' with arguments: ["buy-milk.png"]
Screenshot saved at: buy-milk.png
Executed 'TakeScreenshot' in 307 ms
Finished executing all actions in 2275 ms

Samples

react-to-do

Some sample actions that uses React To Do as an example. There's also a sample script that executes the same actions as the sample command in the long description. You could achieve the same results using the following command:

node index \
  -a samples/react-to-do/actions \
  -a samples/shared-actions \
  -f samples/react-to-do/properties.yml \
  -s ./samples/react-to-do/script.js

selenium-controller's People

Contributors

visola avatar

Watchers

 avatar James Cloos avatar

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.