<commit_before>Getting Started
===============

This guide describes how to get started writing Protractor tests.

WebDriverJS
-----------

When writing tests, it's important to remember that Protractor is a wrapper
around [WebDriverJS](https://code.google.com/p/selenium/wiki/WebDriverJs). It's
highly recommended to skim the intro to WebDriverJS before starting with
protractor.

Selenium-Webdriver is a browser automation framework. Tests are written
with the WebDriver API, which communicates with a Selenium server to control
the browser under test.

When writing tests, keep the following in mind:

-  The test code and scripts running in the browser are separated, and only
   communicate through the [WebDriver wire protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol).
-  WebDriver commands are scheduled on a control flow and return promises, not
   primitive values. See the [control flow doc](/control-flow.md) for more
   info.
-  To run tests, WebDriverJS needs to talk to a selenium standalone server
   running as a separate process.

Setup and Config
----------------

Install Protractor with

    npm install -g protractor

(or omit the -g if you'd prefer not to install globally). 

The example test expects a selenium standalone server to be running at 
localhost:4444. Protractor comes with a script to help download and install
the standalone server. Run

    node_modules/protractor/bin/install_selenium_standalone

This installs selenium standalone server and chromedriver to `./selenium`. Start
the server with

    ./selenium/start

Protractor is now available as a command line program which takes one argument,
a configuration file. 

    protractor node_modules/protractor/example/protractorConf.js

The configuration file tells Protractor what tests to run, how to connect to a
webdriver server, and various other options for reporting. See
[referenceConf.js](https://github.com/angular/protractor/blob/master/referenceConf.js)
for an example and explanation of the options. This simple configuration is

```javascript
// An example configuration file.
exports.config = {
  // The address of a running selenium server.
  seleniumAddress: 'http://localhost:4444/wd/hub',

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  // Spec patterns are relative to the location of the spec file. They may
  // include glob patterns.
  specs: ['example-spec.js'],<commit_msg>docs(getting-started): new conf for example tests.<commit_after>Getting Started
===============

This guide describes how to get started writing Protractor tests.

WebDriverJS
-----------

When writing tests, it's important to remember that Protractor is a wrapper
around [WebDriverJS](https://code.google.com/p/selenium/wiki/WebDriverJs). It's
highly recommended to skim the intro to WebDriverJS before starting with
protractor.

Selenium-Webdriver is a browser automation framework. Tests are written
with the WebDriver API, which communicates with a Selenium server to control
the browser under test.

When writing tests, keep the following in mind:

-  The test code and scripts running in the browser are separated, and only
   communicate through the [WebDriver wire protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol).
-  WebDriver commands are scheduled on a control flow and return promises, not
   primitive values. See the [control flow doc](/control-flow.md) for more
   info.
-  To run tests, WebDriverJS needs to talk to a selenium standalone server
   running as a separate process.

Setup and Config
----------------

Install Protractor with

    npm install -g protractor

(or omit the -g if you'd prefer not to install globally). 

The example test expects a selenium standalone server to be running at 
localhost:4444. Protractor comes with a script to help download and install
the standalone server. Run

    node_modules/protractor/bin/install_selenium_standalone

This installs selenium standalone server and chromedriver to `./selenium`. Start
the server with

    ./selenium/start

Protractor is now available as a command line program which takes one argument,
a configuration file. 

    protractor node_modules/protractor/example/conf.js

The configuration file tells Protractor what tests to run, how to connect to a
webdriver server, and various other options for reporting. See
[referenceConf.js](https://github.com/angular/protractor/blob/master/referenceConf.js)
for an example and explanation of the options. This simple configuration is

```javascript
// An example configuration file.
exports.config = {
  // The address of a running selenium server.
  seleniumAddress: 'http://localhost:4444/wd/hub',

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  // Spec patterns are relative to the location of the spec file. They may
  // include glob patterns.
  specs: ['example-spec.js'],
{'fraction_non_alphanumeric': 0.07871954902355546, 'fraction_numerical': 0.0032212603180994566, 'mean_word_length': 4.008064516129032, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5751470', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1244, 'n_words': 588}