selenium-webdriver-controller

0.0.1 • Public • Published

npm-selenium-webdriver-controller

Augments Selenium WebDriver interface, great for continuous integration

Usage

setup

  //Register coffee-script compiler
  require('coffee-script/register');
  require('coffee-errors');
 
  var path = require('path');
  var chai = require('chai');
  var should = require('should');
  var webDriver = require('selenium-webdriver-controller');
 
  //Register Webdriver path
  //If empty use default path
  webDriver.addEnviromentPath(/*path-to-web-drivers*/);
 
  //Setup Chai Promised handler
  chai.use(require('chai-as-promised'));
 
  //Setup Expect, Should globally
  global.expect = chai.expect;
  global.should = chai.should;
 
  //initialize browser
  global.browser = webDriver.chrome();
 
  //set browser settings
  browser.timeout(10000);
 
  //set browser base url
  browser.baseUrl('http://localhost:3000/');
 
  //setup and teardown browser instance
  browser.beforeMochaStarts(before);
  browser.afterMochaEnds(after);

get page title

  browser.getTitle();

get current url

  browser.get.current.url();

get element using css selector

  browser.element.find.css('.post .meta');

get element by link context

  browser.element.find.link('My Link');

get element using JavaScript

  browser.element.find.script('return document.getElementById("wrapper")');

Resources

Inspired By

Authors

License

(The MIT License)

Copyright (c) 2014 Carlos Marte <opensource@carlosmarte.me>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This file was generated on February 2015.

Readme

Keywords

none

Package Sidebar

Install

npm i selenium-webdriver-controller

Weekly Downloads

0

Version

0.0.1

License

ISC

Last publish

Collaborators

  • thinkeloquent2