Skip to content

sfali23/typings-webdriverio

Repository files navigation

Typings for WebdriverIO

The typescript typings for WebdriverIO.

Build Status

Installation notes:

Installing standalone mode

typings install npm~webdriverio -S

Example

/// <reference path="../typings/index.d.ts"/>

import webdriverio = require('webdriverio');
import {Browser} from 'webdriverio';

let options: any = {{ desiredCapabilities: { browserName: 'chrome' }};
let browser: Browser<any> = webdriverio.remote(options)
                                .init()
                                .url('http://webdriver.io/')
                                .getTitle()
                                .then((title: string) => {
                                    console.log('Title was: %s', title);
                                })
                                .end();

Installing WDIO mode

typings install env~webdriverio -GS

Example

NOTE: Following example is written using mocha framework.

/// <reference path="../typings/index.d.ts"/>

import assert = require('assert');
let browser = global.browser;

describe('webdriver.io page', function() {
    it('should have the right title - the fancy generator way', function () {
        browser.url('http://webdriver.io');
        var title = browser.getTitle();
        assert.equal(title, 'WebdriverIO - Selenium 2.0 javascript bindings for nodejs');
    });
});

Running test examples

Install dependencies

npm install

Install typings

cd test
typings install

Run examples in standalone mode

Open a separate terminal and start selenium standalone server

node_modules/.bin/selenium-standalone start

Run test

node_modules/.bin/mocha test/standalone/test.js

Run examples in WDIO mode

Running examples in mocha framework

cd test/wdio/mocha
../../../node_modules/.bin/wdio

Running examples in cucumber framework

cd test/wdio/cucumber
../../../node_modules/.bin/wdio

Examples

Standalone mode examples

WDIO mode examples using mocha

For WDIO mode examples using cucumber, see examples under ./test/wdio/cucumber

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published