Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jasmine-webdriver-controller

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-webdriver-controller

Adds methods to jasmine that enable it to send commands to a webdriver server

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jasmine-webdriver-controller

Adds methods to jasmine that enable it to send commands to a webdriver server. This allows for component oriented testing from jasmine.

Overview

  • Specs that return a promise are wrapped in a timeout detector. If the promise isn't resolved in 5 seconds or the promise fails, the test will fail. A spec must return a webdriver promise for this functionality to work.
  • A collection of helper methods are attached to each spec.
  • A global Driver object is created to communicate with the webdriver server.

Selectors

The documentation for the selector factories in WebdriverJS is poor. Here's an example:

By.id("user")

I think you can also pass strings and DOM element pointers as selectors, but I'm not clear on how/if this works.

Helper Methods

All of the available methods are added to the this object for each spec. They can be accessed from within a jasmine test as this.method-name().

getDeferred()

getDeferred() => webdriver.promise.Deferred

A convenience factory for WebdriverJS Deferred objects. These objects contain a promise and the methods to resolve the promise.

See https://code.google.com/p/selenium/wiki/WebDriverJs#Deferred_Objects for a complete explaination of Deferred.

waitForElement(selector)

waitForElement(selector) => webdriver.promise.Promise

Waits until the element selected by the selector exists in the DOM.

parameters:
  • selector -- a valid Webdriver selector

waitForVisible(selector)

waitForVisible(selector) => webdriver.promise.Promise

Waits until the element selected by the selector is visible in the DOM. For an element to be visible, all of the following must be true:

  • It exists in the DOM
  • It does not have the CSS visibility: hidden applied to it
  • It does not have the CSS display: none applied to it
  • It has a non-zero height and width
parameters:
  • selector -- a valid Webdriver selector

waitForNotVisible(selector)

waitForNotVisible(selector) => webdriver.promise.Promise

Waits until the element selected by the selector is not visible in the DOM. For an element to not be visible, at least one of the following must be true:

  • It does not exist in the DOM
  • It has the CSS visibility: hidden applied to it
  • It has the CSS display: none applied to it
  • It has a zero height or width
parameters:
  • selector -- a valid Webdriver selector

click(selector)

click(selector) => webdriver.promise.Promise

Clicks the element selected by the selector.

parameters:
  • selector -- a valid Webdriver selector

mouseOver(selector)

mouseOver(selector) => webdriver.promise.Promise

Hovers the mouse cursor over the element selected by the selector.

parameters:
  • selector -- a valid Webdriver selector

sendKeys(selector, keys)

sendKeys(selector, keys) => webdriver.promise.Promise

Gives focus to the element selected by the selector, then sends keystrokes.

parameters
  • selector

    a valid Webdriver selector

  • keys

    a string of keys to be sent

Contributors

Keywords

FAQs

Package last updated on 07 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc