Skip to content

Commit

Permalink
docs(examples): add example protractor project
Browse files Browse the repository at this point in the history
closes #72
  • Loading branch information
JamieMason committed Feb 2, 2017
1 parent eaca084 commit 7547614
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/protractor/README.md
@@ -0,0 +1,21 @@
# Jasmine Matchers Protractor Example

## System Dependencies

Protractor requires you to have the [Java SDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) manually installed beforehand.

## Running Tests

1. Run `npm start` to start the Selenium Server which Protractor will send requests to.
1. Leave the Server running then open another Terminal Session in another window.
1. In the new Terminal window, run `npm test`.
1. Return to the Server Terminal and hit Ctrl+C to stop the Server.

## Configuration

Jasmine Matchers is loaded by adding `node_modules/jasmine-expect/index.js` as the first item in the
`specs` array in `./conf.js`.

## Further Reading

For more information, please see the [Protractor Tutorial](http://www.protractortest.org/#/tutorial) and [Protractor Gitter Chat](https://gitter.im/angular/protractor).
8 changes: 8 additions & 0 deletions examples/protractor/conf.js
@@ -0,0 +1,8 @@
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [
'node_modules/jasmine-expect/index.js',
'src/**/*.e2e.spec.js'
]
};
12 changes: 12 additions & 0 deletions examples/protractor/package.json
@@ -0,0 +1,12 @@
{
"devDependencies": {
"jasmine-expect": "*",
"protractor": "5.1.0"
},
"private": true,
"scripts": {
"postinstall": "webdriver-manager update",
"start": "webdriver-manager start",
"test": "protractor conf.js"
}
}
14 changes: 14 additions & 0 deletions examples/protractor/src/calculator.e2e.spec.js
@@ -0,0 +1,14 @@
describe('Protractor Example', function () {
describe('Protractor', function () {
it('should be configured correctly', function () {
browser.get('http://juliemr.github.io/protractor-demo/');
expect(browser.getTitle()).toEqual('Super Calculator');
});
});
describe('Jasmine Matchers', function () {
it('should be configured correctly', function () {
expect(function () {}).toBeFunction();
expect(666).toBeNumber();
});
});
});
7 changes: 7 additions & 0 deletions package.json
Expand Up @@ -102,6 +102,13 @@
"browser",
"jasmine"
]
},
{
"files": "examples/protractor/**/*.js",
"envs": [
"protractor",
"jasmine"
]
}
],
"rules": {
Expand Down

0 comments on commit 7547614

Please sign in to comment.