Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 7dc63e0

Browse files
committed
docs(developers): add basic DEVELOPER.md and update README
1 parent dbc8d5a commit 7dc63e0

File tree

2 files changed

+138
-37
lines changed

2 files changed

+138
-37
lines changed

DEVELOPER.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Building and Testing Protractor
2+
3+
This document describes building, testing, and releasing Protractor, and provides an overview of
4+
the repository layout.
5+
6+
## Prerequisite software
7+
8+
The prerequisite software (Node.js, npm, git, jdk) are the same as for angular. See
9+
https://github.com/angular/angular/blob/master/DEVELOPER.md#prerequisite-software
10+
11+
## Getting the sources
12+
13+
Fork Protractor from github, then clone your fork with
14+
15+
```
16+
git clone [email protected]:<github username>/protractor.git
17+
18+
# Go to the Protractor directory:
19+
cd protractor
20+
21+
# Add the main protractor repository as an upstream remote to your repository:
22+
git remote add upstream https://github.com/angular/protractor.git
23+
```
24+
25+
## Installing and Building
26+
27+
All Protractor dependencies come from npm. Install with
28+
29+
```
30+
npm Install
31+
```
32+
33+
This will also trigger our build step. The build step runs the TypeScript compiler
34+
and copies necessary files into the output `built` directory. To run the build step
35+
independently, run:
36+
37+
```
38+
npm run prepublish
39+
```
40+
41+
You can see the other available npm scripts in `package.json`. Note that most of these
42+
scripts just call our `gulp` commands, which can be seen in `gulpfile.js`.
43+
44+
## Formatting
45+
46+
Protractor uses clang-format to format the source code. If the source code is not properly formatted,
47+
the CI will fail and the PR can not be merged.
48+
49+
You can automatically format your code by running:
50+
51+
```
52+
npm run format
53+
```
54+
55+
## Code layout
56+
57+
`docs/` contains markdown documentation files.
58+
`lib/` contains the actual Protractor code.
59+
`scripts/` contains scripts used for CI setup and running tests.
60+
`spec/` contains e2e and unit tests and configuration files for tests.
61+
`testapp/` contains the code for the Angular applications that e2e tests run against.
62+
`website/` contains code for generating Protractor API documentation and the website at protractortest.org
63+
64+
Most of the code is written in TypeScript, with the exception of a few js files.
65+
66+
`lib/debugger` is for element explorer, `browser.pause`, and `browser.explore`
67+
`lib/driverProviders` controls how WebDriver instances are created
68+
`lib/frameworks` contains adapters for test frameworks such as Jasmine and Mocha
69+
`lib/selenium-webdriver` and `lib/webdriver-js-extender` are used ONLY for API documentation generation.
70+
71+
## Lightning Code Walkthrough
72+
73+
TBD.
74+
75+
## Testing
76+
77+
Run `npm test` to run the full test suite. This assumes that you have the testapp and a
78+
selenium server running. Start these as separate processes with:
79+
80+
```
81+
webdriver-manager update
82+
webdriver-manager start
83+
```
84+
85+
and
86+
87+
```
88+
npm start
89+
```
90+
91+
This suite is described in `scripts/test.js`. It uses some small helper functions to run commands
92+
as child processes and capture the results, so that we can run protractor commands which should
93+
result in failures and verify that we get the expected number and type of failures.
94+
95+
The suite contains unit tests, end to end tests using the built binary, and interactive tests.
96+
Interactive tests are for testing `browser.pause` and element explorer.
97+
98+
End to end tests all have configuration files which live in `spec/`. Many tests do not need
99+
an actual Selenium server backing them, and use the `mockSelenium` configuration, which saves
100+
time by not connecting to a real selenium server.
101+
102+
## Important dependencies
103+
104+
Protractor has very close dependencies with several other projects under the Angular umbrella:
105+
106+
`jasminewd2` is an extension of the Jasmine test framework that adds utilities for
107+
working with selenium-webdriver. github.com/angular/jasminewd
108+
109+
`blocking-proxy` is a separate binary, which handles traffic between a test script and
110+
webdriver. It can be turned on via a protractor configuration file, and in the future
111+
all logic to wait for Angular will be handled through the blocking proxy.
112+
github.com/angular/blocking-proxy
113+
114+
`webdriver-js-extender` extends selenium-webdriver to add Appium commands.
115+
github.com/angular/webdriver-js-extender
116+
117+
## Continuous Integration
118+
119+
PRs or changes submitted to master will automatically trigger contiuous integration on two
120+
different services - Travis, and Circle CI.
121+
122+
Travis runs e2e tests via SauceLabs against a variety of browsers. The essential browsers run a
123+
more complete test suite. We also run a set of smoke tests against a larger set of browsers,
124+
which is allowed to fail. This is due to flakiness in IE, Safari and older browser versions.
125+
126+
Circle CI runs a slightly modified version of `npm test` in a single VM. It installs
127+
the browsers it needs locally. Circle CI runs unit tests and a set of e2e tests against Chrome.
128+
129+
## Releasing
130+
131+
See `release.md` for full instructions.

README.md

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
Protractor [![Build Status](https://travis-ci.org/angular/protractor.svg?branch=master)](https://travis-ci.org/angular/protractor) [![CircleCI Status](https://circleci.com/gh/angular/protractor.svg?style=shield)](https://circleci.com/gh/angular/protractor) [![Join the chat at https://gitter.im/angular/protractor](https://badges.gitter.im/angular/protractor.svg)](https://gitter.im/angular/protractor)
22
==========
33

4-
[Protractor](http://angular.github.io/protractor) is an end-to-end test framework for [AngularJS](http://angularjs.org/) applications. Protractor is a [Node.js](http://nodejs.org/) program built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs). Protractor runs tests against your application running in a real browser, interacting with it as a user would.
4+
[Protractor](http://angular.github.io/protractor) is an end-to-end test framework for [Angular](http://angular.io/) and [AngularJS](http://angularjs.org) applications. Protractor is a [Node.js](http://nodejs.org/) program built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs). Protractor runs tests against your application running in a real browser, interacting with it as a user would.
55

66
Compatibility
77
-------------
88

9-
Protractor 4 is compatible with nodejs v4 and newer. If you absolutely need to use nodejs at 0.12, use Protractor@2.
9+
Protractor 5 is compatible with nodejs v6 and newer.
1010

11-
Protractor works with Angular versions greater than 1.0.6/1.1.4, and is compatible with Angular 2 applications. Note that for Angular 2 apps, the `binding` and `model` locators are not supported. We recommend using `by.css`.
11+
Protractor works with AngularJS versions greater than 1.0.6/1.1.4, and is compatible with Angular applications. Note that for Angular apps, the `binding` and `model` locators are not supported. We recommend using `by.css`.
1212

1313

1414
Getting Started
1515
---------------
16-
17-
The Protractor documentation for users is located in the [protractor/docs](https://github.com/angular/protractor/tree/master/docs) folder.
16+
See the [Protractor Website](http://www.protractortest.org) for most documentation.
1817

1918
To get set up and running quickly:
20-
- The [Protractor Website](http://angular.github.io/protractor)
21-
- Work through the [Tutorial](http://angular.github.io/protractor/#/tutorial)
22-
- Take a look at the [Table of Contents](http://angular.github.io/protractor/#/toc)
19+
- Work through the [Tutorial](http://www.protractortest.org/#/tutorial)
20+
- See the [API](http://www.protractortest.org/#/api)
2321

2422
Once you are familiar with the tutorial, you’re ready to move on. To modify your environment, see the Protractor Setup docs. To start writing tests, see the Protractor Tests docs.
2523

@@ -36,32 +34,4 @@ Please ask usage and debugging questions on [StackOverflow](http://stackoverflow
3634

3735
For Contributors
3836
----------------
39-
Clone the github repository:
40-
41-
git clone https://github.com/angular/protractor.git
42-
cd protractor
43-
npm install
44-
./bin/webdriver-manager update
45-
cd website
46-
npm install
47-
cd ..
48-
49-
Start up a selenium server. By default, the tests expect the selenium server to be running at `http://localhost:4444/wd/hub`. A selenium server can be started with [webdriver-manager](https://github.com/angular/webdriver-manager) which is included in
50-
[bin/webdriver-manager](https://github.com/angular/protractor/blob/master/bin/webdriver-manager).
51-
52-
webdriver-manager update
53-
webdriver-manager start
54-
55-
Protractor's test suite runs against the included test application.
56-
57-
Install the test application dependencies with:
58-
59-
npm run install_testapp
60-
61-
Start that up with
62-
63-
npm start
64-
65-
Then run the tests with
66-
67-
npm test
37+
See DEVELOPER.md

0 commit comments

Comments
 (0)