Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPII-1889: Initial review of gpii-webdriver... #1

Merged
merged 116 commits into from Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
05f9d80
Initial commit
the-t-in-rtf Jul 19, 2016
4a1bd7a
Initial commit of work in progress.
the-t-in-rtf Jul 20, 2016
a8b4778
Initial working implementation and basic tests.
the-t-in-rtf Jul 20, 2016
83093b9
Added tests (and verified support for) keyboard input, browser naviga…
the-t-in-rtf Jul 20, 2016
62e8210
Wired all existing tests into `all-tests.js`.
the-t-in-rtf Jul 20, 2016
0590d5b
Added notes based on initial testing in Windows.
the-t-in-rtf Jul 20, 2016
98ff278
Fixed test broken by directory reorg.
the-t-in-rtf Jul 20, 2016
a6cf6d2
Continued fleshing out initial work. Now able to parse browser QUnit…
the-t-in-rtf Jul 21, 2016
a6b8867
Spiked using new QUnit logging harness from within node.
the-t-in-rtf Jul 21, 2016
fa6db01
Continued expanding test coverage for most wrapped methods.
the-t-in-rtf Jul 21, 2016
0e4e36e
Added tests for `sleep` and `wait` functions.
the-t-in-rtf Jul 21, 2016
5904b1e
Added screenshot tests and tests for missing elements.
the-t-in-rtf Jul 21, 2016
dda6866
Spiked allowing "promise-y" uses of the grade.
the-t-in-rtf Jul 22, 2016
312ffaf
Created a utility to run tests across multiple browsers. Fixed faili…
the-t-in-rtf Jul 25, 2016
0f72590
Fixed "resolve file URL" utility to work properly with Windows paths.
the-t-in-rtf Jul 25, 2016
0d3315f
Initial documentation spike.
the-t-in-rtf Jul 25, 2016
acb73bd
Removed old TODOs and comments.
the-t-in-rtf Jul 25, 2016
a9edc9a
Fixed "environment" typo.
the-t-in-rtf Jul 25, 2016
108ec74
Updated QUnit harness to fire internal events we can listen to in IoC…
the-t-in-rtf Jul 25, 2016
331d626
Added notes for later work on IPC bridge.
the-t-in-rtf Jul 25, 2016
59a441d
Continued documentation spike. Moved `actions` and `navigate` helpers…
the-t-in-rtf Jul 25, 2016
a7a5a8c
Continued doc spike. Added `wait` timeout tests.
the-t-in-rtf Jul 26, 2016
8911f8c
Simplified sync/async logic and collapsed the "base" grade into `gpi…
the-t-in-rtf Jul 26, 2016
b1d06a2
Confirmed a working approach that handles truly asynchronous function…
the-t-in-rtf Jul 26, 2016
40fd7c9
Added tests to confirm that `gpii.webdriver.syncInit` can also be use…
the-t-in-rtf Jul 26, 2016
cbf98c9
Updated docs to reflect recent `syncInit` changes.
the-t-in-rtf Jul 26, 2016
9aa577d
Documented additional options for `gpii.webdriver`.
the-t-in-rtf Jul 26, 2016
b1fe027
Added inline (JSDocs) documentation and notes for remaining documenta…
the-t-in-rtf Jul 26, 2016
c569aee
Added JSDocs for most functions.
the-t-in-rtf Jul 26, 2016
564e01f
Added code coverage reporting using `istanbul`.
the-t-in-rtf Jul 26, 2016
b86c6b1
Finished failure mode tests. Converted to using `webdriver.promise` …
the-t-in-rtf Jul 27, 2016
9c5a28a
Updated resolver tests to handle Windows path problems.
the-t-in-rtf Jul 27, 2016
3995347
Updated resolver tests to handle Windows path problems.
the-t-in-rtf Jul 27, 2016
843de69
Updated resolver tests to handle Windows path problems.
the-t-in-rtf Jul 27, 2016
9746030
Added logging capabilities to assist in troubleshooting windows probl…
the-t-in-rtf Jul 27, 2016
c52220d
Added additional text input tests.
the-t-in-rtf Jul 27, 2016
9f5a0ce
Added a mechanism to pass browser-specific options (capabilities) on …
the-t-in-rtf Jul 27, 2016
f473263
Added documentation for `browserOptions`.
the-t-in-rtf Jul 27, 2016
7b3ffab
Converted to using `Builder.withCapabilities` instead of `forBrowser`…
the-t-in-rtf Jul 27, 2016
3a02c2d
Added tests for `dumpLogs` function. Improved reliability of `getCap…
the-t-in-rtf Jul 27, 2016
41f528f
Added tests to demonstrate how to automatically run aXe accessibility…
the-t-in-rtf Jul 27, 2016
ec902fa
Disabled twitchy "driver" log tests, as they do not work across brows…
the-t-in-rtf Jul 28, 2016
c4d8172
Merged work in original repo with new branch.
the-t-in-rtf Jul 28, 2016
2df8ddb
Made Giovanni's suggested changes to `Vagrantfile` to hopefully addre…
the-t-in-rtf Jul 28, 2016
5c10241
Update QI config to work with `chromedriver` package rather than `web…
the-t-in-rtf Jul 28, 2016
a4b58a1
Improved `actionsHelper` input format and documentation.
the-t-in-rtf Jul 28, 2016
1dc75f3
Generalized aXe accessibility checking and added second set of checks…
the-t-in-rtf Aug 1, 2016
e40801c
Standardized test fixtures and utilities under `gpii.test.webdriver` …
the-t-in-rtf Aug 1, 2016
7fd9b21
Fixed a broken link and updated wording regarding `BROWSERS` environm…
the-t-in-rtf Aug 1, 2016
6ad0e78
Improved tests that previously relied on the "autofocus" attribute, w…
the-t-in-rtf Aug 1, 2016
02cc823
Updated `allBrowsers` harness for use with non-IoC tests.
the-t-in-rtf Aug 2, 2016
37bfa24
Added detailed instructions for running the tests under Windows.
the-t-in-rtf Aug 2, 2016
37f7b03
Added provisional docs on running using the Edge browser in Windows.
the-t-in-rtf Aug 2, 2016
a93efbf
Improved `getCurrentUrl` to work across browsers on Windows.
the-t-in-rtf Aug 2, 2016
a4e651e
Made `getCurrentUrl` use a real URL to hopefully resolve problems wit…
the-t-in-rtf Aug 2, 2016
06aeb52
Updated "refresh" tests to work across all browsers (including IE).
the-t-in-rtf Aug 2, 2016
ce58f1e
Enabled firefox as a default browser in Windows.
the-t-in-rtf Aug 2, 2016
91d3ca3
Added option to hopefully fix IE dumpLogs tests.
the-t-in-rtf Aug 2, 2016
83465dc
Second fix for dumpLogs flakiness.
the-t-in-rtf Aug 2, 2016
2d1f5d1
Removed ineffective "fixes" for IE dumpLogs problems.
the-t-in-rtf Aug 2, 2016
b664be3
Added code to skip dumpLogs tests in IE explicitly.
the-t-in-rtf Aug 2, 2016
fd7f6c1
Added jqUnit.test wrapper to "promises" dumpLogs test IE workaround.
the-t-in-rtf Aug 2, 2016
c3b769d
Added jqUnit.test wrapper to IE workaround in IoC dumpLogs tests.
the-t-in-rtf Aug 2, 2016
409f7d8
Fixed bad variable name preventing IE workaround for working for IoC …
the-t-in-rtf Aug 2, 2016
ad8adb9
Fixed additional goof in IE workaround check.
the-t-in-rtf Aug 2, 2016
c9c9b80
Created a generalized mechanism for running client-side functions usi…
the-t-in-rtf Aug 2, 2016
54ee5ec
Removed outdated TODOs following recent work.
the-t-in-rtf Aug 2, 2016
e78d177
GPII-1887: Updated dependencies to minimize deprecation warnings and…
the-t-in-rtf Aug 2, 2016
3343ab8
GPII-1887: Updated dependencies based on output of `npm outdated`.
the-t-in-rtf Aug 2, 2016
88d3628
GPII-1889: Added `testEnvironment` for tests that run against a `gpi…
the-t-in-rtf Aug 3, 2016
463cfcb
GPII-1913: Restructured capabilities setting while researching GPII-1…
the-t-in-rtf Aug 9, 2016
21253ec
GPII-1913: Added notes and TODOs regarding the lack of support for Fi…
the-t-in-rtf Aug 9, 2016
44198af
NOJIRA: Fixed linting infrastructure and lint errors revealed.
the-t-in-rtf Aug 9, 2016
6671dae
NOJIRA: Added trailing semicolon.
the-t-in-rtf Aug 9, 2016
f7178f0
NOJIRA: Updated gpii-express version.
the-t-in-rtf Aug 9, 2016
afd04af
NOJIRA: Removed unnecessary call to `fluid.loadTestingSupport()` to …
the-t-in-rtf Aug 9, 2016
cd0c152
NOJIRA: Added explicit test for `click` function (it's used indirectl…
the-t-in-rtf Aug 9, 2016
7152e44
NOJIRA: Moved screenshot save function to helper functions (so that …
the-t-in-rtf Aug 9, 2016
d724a8a
GPII-1889: Simplified keyboard navigation and text input tests based …
the-t-in-rtf Aug 17, 2016
650225f
GPII-1889: Fixed link in README.
the-t-in-rtf Aug 17, 2016
4842274
GPII-1988: Documented QI config files with added comments.
the-t-in-rtf Aug 25, 2016
4b4e405
NOJIRA: Minor update of dependencies for latest PR, based on output …
the-t-in-rtf Aug 25, 2016
db27b68
NOJIRA: Updated QI config to use "lts" version of node.
the-t-in-rtf Aug 31, 2016
189254a
GPII-1815: Updated to use standard Vagrantfile.
the-t-in-rtf Oct 27, 2016
cccba4b
GPII-2105: Update transforms for compatibility with upcoming 2.0 rele…
the-t-in-rtf Oct 27, 2016
abdee48
GPII-1913: Preliminary updated to selenium-webdriver 3.0.
the-t-in-rtf Nov 9, 2016
61ae406
GPII-2128: Added hooks to pass configuration options to aXe/aXs.
the-t-in-rtf Nov 16, 2016
2d9342e
GPII-2128: Added tests for passing configuration options to aXe/aXs.
the-t-in-rtf Nov 16, 2016
a759c83
NOJIRA: Added TODO note for npm 3 work to be done.
the-t-in-rtf Nov 16, 2016
2529650
Merge branch 'GPII-1889' into GPII-1913
the-t-in-rtf Nov 16, 2016
362b299
NOJIRA: Updated dependencies.
the-t-in-rtf Nov 21, 2016
7e1d3d9
Removed untested code where possible and added istanbul hints for exp…
the-t-in-rtf Nov 21, 2016
4f59184
GPII-1913: Updated to released version of `gpii-express`.
the-t-in-rtf Nov 24, 2016
3e2f101
NOJIRA: Added `.yarn.lock` to `.gitignore`.
the-t-in-rtf Nov 24, 2016
b454037
NOJIRA: Updated outdated firefox settings.
the-t-in-rtf Nov 24, 2016
becc872
GPII-2161: Committed `yarn.lock`.
the-t-in-rtf Nov 25, 2016
e06300a
NOJIRA: Updated QI config to use yarn.
the-t-in-rtf Dec 7, 2016
679b3e1
NOJIRA: Fixed branch version in .qi.yml
the-t-in-rtf Dec 7, 2016
3e9a587
NOJIRA: Simplified QI config per feedback from the team.
the-t-in-rtf Dec 7, 2016
36e2ddc
NOJIRA: Simplified QI config to remove unneeded PATH variable.
the-t-in-rtf Dec 8, 2016
38ab2d5
NOJIRA: Routine update of all dependencies while working on PR feedb…
the-t-in-rtf Dec 9, 2016
e699d5b
GPII-1889: Converted all requires with double-dots into fluid.requir…
the-t-in-rtf Dec 9, 2016
439bff2
GPII-1889: Removed stray comment.
the-t-in-rtf Dec 9, 2016
9121927
GPII-1889: Fixed linting error.
the-t-in-rtf Dec 9, 2016
4d81014
GPII-1889: Fixed linting errors.
the-t-in-rtf Dec 9, 2016
cb25098
GPII-1889: Moved `globals` comment to the head of the file.
the-t-in-rtf Dec 9, 2016
b6d1180
GPII-1889: Refactored “fluid” tests so our fixtures are linted.
the-t-in-rtf Dec 9, 2016
1fd3252
GPII-1889: Removed previous workaround for “no tests found” problem.
the-t-in-rtf Dec 9, 2016
5a2a1c1
GPII-2179: Pin to a published version of infusion that includes the p…
the-t-in-rtf Dec 19, 2016
34b5431
KETTLE-51: Upgrading kettle to pick up utf8 fixes.
the-t-in-rtf Jan 6, 2017
f1e0f47
NOJIRA: Updated dependencies, notably to pick up chromedriver “space…
the-t-in-rtf Jan 24, 2017
aa30519
NOJIRA: Updated to 3.0.0 dev release of infusion.
the-t-in-rtf Jan 27, 2017
7677039
NOJIRA: Updated gpii-express to released version. Updated outdated …
the-t-in-rtf Jan 27, 2017
a37b3a4
GPII-1889: Added docs for accessibility checks.
the-t-in-rtf Feb 8, 2017
2a32d8c
GPII-1889: (Finally) wrote the helper function docs.
the-t-in-rtf Feb 8, 2017
cab5e9d
GPII-1889: Fleshed out the docs for `mapToObject` a bit.
the-t-in-rtf Feb 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
81 changes: 81 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,81 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be upated to use our shared definition

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, somehow I ended up in another branch (likely to isolate the early selenium 3.x work). I will merge in those changes, which include migrating to the standard ESLint config.

"env": {
"browser": true,
"node": false
},
"globals": {
"fluid_2_0_0": true
},
"rules": {
"block-scoped-var": "error",
"comma-style": [
"error",
"last"
],
"curly": [
"error",
"all"
],
"dot-notation": [
"error",
{
"allowKeywords": false
}
],
"eol-last": "error",
"eqeqeq": [
"error",
"allow-null"
],
"indent": ["error", 4],
"new-cap": ["error", { "properties": false }],
"no-caller": "error",
"no-cond-assign": [
"error",
"except-parens"
],
"no-debugger": "error",
"no-empty": ["error", {"allowEmptyCatch": true}],
"no-eval": "error",
"no-extend-native": "error",
"no-extra-parens": "off",
"no-irregular-whitespace": "error",
"no-iterator": "error",
"no-loop-func": "error",
"no-multi-str": "error",
"no-new": "error",
"no-plusplus": 0,
"no-proto": "error",
"no-script-url": "error",
"no-sequences": "error",
"no-trailing-spaces": "error",
"no-undef": "error",
"no-unused-vars": "error",
"no-with": "error",
"quotes": [
"error",
"double"
],
"semi": [
0,
"always"
],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never"}],
"space-infix-ops": "error",
"space-unary-ops": [
"error", {
"words": true,
"nonwords": false,
"overrides": {
"typeof": false
}
}],
"strict": ["error", "safe"],
"valid-typeof": "error",
"wrap-iife": [
"error",
"inside"
]
}
}
38 changes: 38 additions & 0 deletions .gitignore
@@ -0,0 +1,38 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
.vagrant
24 changes: 24 additions & 0 deletions .qi.yml
@@ -0,0 +1,24 @@
# A configuration file for our Quality Infrastructure builds: https://wiki.gpii.net/w/Quality_Infrastructure

email: tony@raisingthefloor.org
env_runtime: linux-desktop

apps:
- app_name: gpii-webdriver
app_start_service: false
git_repository: https://github.com/the-t-in-rtf/gpii-webdriver.git
git_branch: GPII-1889
software_stack: nodejs
software_stack_version: lts
folder:
dest: /app/gpii-express
run_in: fedora
deploy: false
setup:
- sudo dnf -y install java-1.8.0-openjdk-devel.x86_64
- npm install
test_cmds:
- export PATH=$PATH:/home/vagrant/sync/node_modules/chromedriver/bin/chromedriver/
- xhost +
- export DISPLAY=:0
- BROWSERS=chrome npm test
18 changes: 18 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,18 @@
/* eslint-env node */
"use strict";

module.exports = function (grunt) {
grunt.initConfig({
eslint: {
src: ["./src/**/*.js", "./tests/**/*.js", "./*.js"]
},
jsonlint: {
src: ["./src/**/*.json", "./tests/**/*.json"]
}
});

grunt.loadNpmTasks("fluid-grunt-eslint");
grunt.loadNpmTasks("grunt-jsonlint");

grunt.registerTask("lint", "Apply jshint and jsonlint", ["eslint", "jsonlint"]);
};
1 change: 0 additions & 1 deletion README

This file was deleted.

113 changes: 113 additions & 0 deletions README.md
@@ -0,0 +1,113 @@
# gpii-webdriver

This package provides a series of [Fluid components](http://docs.fluidproject.org/infusion/development/UnderstandingInfusionComponents.html)
to assist in writing tests that use the [WebDriver API](https://www.w3.org/TR/2013/WD-webdriver-20130117/) to control a
real browser and to examine the browser's state.

The main goals of this package are to:

1. Make it possible to test complex keyboard navigation.
2. Make it possible to test browser navigation (moving back and forward in the browser's history, and reloading the page).
3. Provide the ability to write tests that need to be aware of both the server and browser state.
4. Do all of the above across a range of browsers.

# Keyboard Navigation

Many approaches to testing keyboard navigation send individual keystrokes directly to a single named component and
examine the results. While this does confirm the behavior of the component, it does not provide a good means of testing
navigation between components. Sending keys directly to a known component also assumes that the component can already
be reached using keyboard navigation.

With this package, you can test sending keys directly to a component, navigation between components, and using keyboard
navigation to focus on an element. This allows for much more realistic user-focused test scenarios like:

1. Hitting "Tab" once to display a "Skip to Content" control.
2. Hitting "Enter" to skip to the main content.
3. Hitting "Tab" to focus on a search control in the content area.
4. Typing search terms into the search control.
5. Hitting "Enter" to perform a search.

Using this package, the above scenario can be tested even if javascript is completely disabled.

# Browser Navigation

This package provides the ability to change the browser's state in exactly the same manner as would happen if a user hit
the "back", "next", and "refresh" buttons or shortcut keys. You might use this to:

1. Confirm that the parts of your page that should preserve their state on a refresh actually do so.
2. Confirm that the parts of your page that should reset their state on a refresh actually do so.
3. Confirm that a warning is displayed when a user attempts to refresh or navigate away after entering form data.

# Passing Code between the Server and Browser

This package makes use of the IPC bridge built into WebDriverJS to send code to the browser, have that code be executed,
and to receive the results of the code's execution. Among many other things, this allows you to:

1. Inspect the current browser DOM.
2. Check the value of a named element.
3. Pass in scripts to be executed in the browser before the tests are run, for example, scripts to report test or code coverage information.

# Running the Tests

To run the tests locally, you will need to [install the drivers for each browser](http://www.seleniumhq.org/download/)
you want to test. Once you have done this, you can use the command `npm test` to run the tests.

You can also use the command `vagrant up` to provision a linux box and run the Chrome and Firefox tests there.

# Using this Package to Write Your Own Tests

To make use of this package in your own tests, you will typically need to add code like the following:

```
var fluid = require("infusion");
var gpii = fluid.registerNamespace("gpii");
require("gpii-webdriver");
gpii.webdriver.loadTestingSupport();
```

Note that although the last line is not required to simply use the webdriver itself, you'll need it if you want to use
the caseHolder, testEnvironment or cross-browser test runner including with this package.

# Running Under Windows

# Internet Explorer

There is a known problem with [very slow text input](https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/5116)
when using the 64-bit IEDriverServer. If you are on a 64-bit Windows machine and seeing extreme
slowness in tests that supply text input, you should:

1. [Download the 32-bit version of IEDriverServer](http://www.seleniumhq.org/download/).
2. Unzip and launch the server.
3. Set your `SELENIUM_REMOTE_URL` environment variable to `http://localhost:5555`.
4. Set your `BROWSERS` environment to `ie`.

Note that once you do this, the `BROWSERS` and `SELENIUM_BROWSER` variables will no longer be meaningful, and tests will
only run in Internet Explorer. The fourth step above simply avoids running the IE tests multiple times (once expecting
to run using Chrome, once expecting to run using Internet Explorer, etc.).

# Edge

Edge is currently not verified working with any combination of Selenium and the WebDriver server, but it should be
possible to use it with instructions like the following:

1. [Download and install the Microsoft WebDriver package](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/).
2. Launch the server.
3. Set your `SELENIUM_REMOTE_URL` environment to `http://localhost:17556/`.
4. Set your `BROWSERS` environment variable to `edge`.

This will cause the tests to only be run in the Edge browser. See above for more details.

# Firefox

Firefox 47 and below will work with this package. Firefox 48.0 and higher do not work for now. For more information,
see [GPII-1913](https://issues.gpii.net/browse/GPII-1913).

# More Information

For more information, check out the individual docs for:

* [The driver component](./docs/webdriver.md)
* [The helper functions](./docs/helper-functions.md)
* [The browser-side QUnit harness](./docs/qunit-harness.md)
* [The test fixtures included with this package](./docs/fixtures.md)
* [The multi-browser test runner](./docs/allBrowsers.md)
15 changes: 15 additions & 0 deletions Vagrantfile
@@ -0,0 +1,15 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# This file loads a generic Vagrantfile that will build the environment
# specified in the .qi.yml file.
#
# DO NOT MODIFY THIS FILE
#
# if you want to change the VMs specifications go to README.md

VAGRANT_VMENV_PATH = `node -e "require('vagrant-vmenv')"`.delete!("\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems problematic to me. We should just install the module locally as a result of npm install - as well as avoiding the failure due to faulty use of "require" this will also remove the requirement for the funny message. This approach may well of course lead to problems if the "node_modules" directory ends up being aliased inside and outside the VM. One solution to this may be to perform the activity inside a "monorepo" style nested project which simply holds the vagrant-vmenv dependency itself. Either way, this dependency needs to be installed locally, not globally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the concerns, and have created a ticket against the QI project, where this needs to be addressed:

https://issues.gpii.net/browse/GPII-2170

puts "\nCan not find the vagrant-vmenv module, please install it:\n" +
"npm install -g https://github.com/amatas/vagrant-vmenv.git" if $?.to_i != 0

require_relative( VAGRANT_VMENV_PATH + '/Vagrantfile.rb')
71 changes: 71 additions & 0 deletions docs/allBrowsers.md
@@ -0,0 +1,71 @@
# `gpii.test.webdriver.allBrowsers`

This grade helps you run your tests against a range of browsers. The defaults are designed for use with
[Fluid IoC tests](http://docs.fluidproject.org/infusion/development/IoCTestingFramework.html#how-to-use-the-ioc-testing-framework).
By default, a new test environment is generated for each browser, and then queued up using `fluid.test.runTests`.

## Component options

| Option | Type | Description |
| ------------------------- | ---------- | ----------- |
| `baseTestEnvironment` | `{String}` | The base testEnvironment that we will extend and configure to use a particular browser. |
| `browsers` | `{Array}` | The list of browsers to run the tests against (see below for the order of precedence). |

## Component Invokers

### `{that}.runTestsInSingleBrowser(browser)`

An invoker which runs the tests in a single `browser`. By default, this generates a test environment for each browser,
based on `baseTestEnvironment` (see above), and then runs the tests using `fluid.tests.runTests`. See below for details
on using this grade with non-IoC tests.

## Configuring the List of Browsers

This grade will run tests against a list of browsers, which is defined based on whichever of the following is found
first:

1. The `BROWSERS` environment variable (see below).
2. `that.options.browsers` (see above)
3. `gpii.test.webdriver.allBrowsers.defaultPlatformBrowsers`, the platform-specific list of "verified working" browsers (see below).

The `BROWSERS` environment variable should be a space or comma-delimited list of browsers, as in the following example
for a unix-like system:

```
export BROWSERS="firefox chrome"
```

If you're working with Windows PowerShell, the syntax is something like:

```
$env:BROWSERS = "chrome"
```

Note that you can run the tests for a single browser by setting `BROWSERS` to a single value, as in the previous example.

## Using this Grade with IoC Tests

To use this grade with IoC tests, you must define a base `testEnvironment`, and then instantiate this grade as in the
following example:

```
fluid.defaults("my.tests.testRunner", {
gradeNames: ["gpii.test.webdriver.allBrowsers"],
baseTestEnvironment: "gpii.tests.webdriver.executeScript.args.environment"
});

my.tests.testRunner();
```

## Using this Grade with Non-IoC Tests

If you want to use this grade to run tests that do not use the Fluid IoC test framework, override the
`runTestsInSingleBrowser` invoker (see above) with your own function that runs the tests for a single browser. See
the "syncInit" and "dumpLogs" tests in this package for examples.

# `gpii.test.webdriver.allBrowsers.defaultPlatformBrowsers`

A static list of the default (confirmed working) browsers, by platform. Only OS X, Windows, and Linux have any browsers
at all, as the other platforms [are not supported by Selenium itself](http://www.seleniumhq.org/about/platforms.jsp).
The "firefox" and "edge" browsers are not yet confirmed working on Windows. See the README for details on running
tests with "ie", which works, but cannot currently be run in combination with any other browser.
25 changes: 25 additions & 0 deletions docs/fixtures.md
@@ -0,0 +1,25 @@
# `gpii.test.webdriver.caseHolder`

This caseHolder does three key things:

1. It tells the test environment to create a driver, and waits for the driver to be ready before starting the tests.
2. It automatically prepends the current browser to the `name` of each test module and test sequence.
3. It tells the test environment to clean up the driver after each test sequence is complete.

Note that the wiring that creates and cleans up the driver assumes that your caseholder will be loaded from an
instance of `gpii.test.webdriver.testEnvironment` (see below).

## Component Options

| Option | Type | Description |
| --------------- | -------- | ----------- |
| `browser` | `{String}` | A [browser supported by the WebDriver API](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/capabilities_exports_Browser.html), in lower case.|
| `sequenceStart` | `Object` | A series of test sequence steps to execute at the beginning of each test sequence. |
| `sequenceEnd` | `Object` | A series of test sequence steps to execute at the end of each test sequence. |
| `rawModules` | `Object` | The raw test modules to "evolve" as outlined above. |


# `gpii.test.webdriver.testEnvironment`

A Fluid IoC test environment that creates a webdriver instance when its `constructFixtures` event is fired. Provides
all of the required events and listeners to work with a `gpii.test.webdriver.caseHolder` instance (see above).