npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jasmine-webdriver-controller

v0.1.1

Published

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

Downloads

6

Readme

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