testium-core
Juggling the bits and pieces to run integration tests
Last updated 22 days ago by groupon .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install testium-core 
SYNC missed versions from official npm registry.

Testium: Core Build Status

Juggling the bits and pieces to run integration tests.

This project is a safe and inclusive place for contributors of all kinds. See the Code of Conduct for details.

Install

npm install --save testium-core

Usage

Starting Up

The following boots up phantomjs/selenium, an application and a slim proxy to handle response code normalization etc.:

var initTestium = require('testium-core');
initTestium()
  .then(function(testium) {
    // Use testium.config to set up your integration tests.
    // At the end of it all call `testium.close` to quit all child processes.
    testium.close();
  });

testium.config

This contains all the configuration needed and exposed by testium. The initial data is loaded from config files using rc. It's extended during startup, e.g. by generating proxy.targetUrl. The following settings are important when consuming the config:

  • selenium.serverUrl: The url of the selenium server.
  • proxy.targetUrl: The base url to use when talking to the app.
  • proxy.commandUrl: The url to use when sending meta-requests to the proxy, e.g. marking a new page. This should be rarely used directly.
testium.config.get(path, defaultValue)

Retrieve a config setting using its path, e.g. "app.port". If the setting does not exist and no defaultValue is provided, an error will be thrown.

testium.config.has(path)

Returns true if the config has a valid setting at the given path.

testium.close()

Quits all child processes created during startup.

testium.getNewPageUrl(path, options)

Generates a URL that should be loaded to navigate to a new page. The advantage of using this method is that it allows to send custom headers and it properly tracks the headers and status code of the response.

testium.getInitialUrl()

Generates a URL that should be loaded before navigating to any other page. This allows setting cookies before the first proper page load and can work around some confusing errors.

Current Tags

  • 3.0.2                                ...           latest (22 days ago)

34 Versions

  • 3.0.2                                ...           22 days ago
  • 3.0.1                                ...           5 months ago
  • 3.0.0                                ...           9 months ago
  • 2.0.0                                ...           10 months ago
  • 1.12.1                                ...           a year ago
  • 1.12.0                                ...           a year ago
  • 1.11.0                                ...           2 years ago
  • 1.10.0                                ...           2 years ago
  • 1.9.0                                ...           2 years ago
  • 1.8.1                                ...           2 years ago
  • 1.8.0                                ...           2 years ago
  • 1.7.3                                ...           2 years ago
  • 1.7.2                                ...           3 years ago
  • 1.7.1                                ...           3 years ago
  • 1.7.0                                ...           4 years ago
  • 1.6.0                                ...           4 years ago
  • 1.5.0                                ...           4 years ago
  • 1.4.8                                ...           4 years ago
  • 1.4.7                                ...           4 years ago
  • 1.4.6                                ...           4 years ago
  • 1.4.5                                ...           5 years ago
  • 1.4.4                                ...           5 years ago
  • 1.4.3                                ...           5 years ago
  • 1.4.2                                ...           5 years ago
  • 1.4.1                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 12
Dependencies (14)
Dev Dependencies (20)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |