protractor
Advanced tools
Comparing version
@@ -7,7 +7,8 @@ { | ||
"author" : "Julie Ralph <ju.ralph@gmail.com>", | ||
"peerDependencies" : { | ||
"selenium-webdriver" : "~2.32.1" | ||
"dependencies" : { | ||
"selenium-webdriver" : ">2.32.1", | ||
"saucelabs" : "~0.1.0", | ||
"jasmine-node" : "~1.9.0" | ||
}, | ||
"devDependencies" : { | ||
"jasmine-node" : "~1.8.0", | ||
"expect.js" : "~0.2.0", | ||
@@ -20,4 +21,5 @@ "mocha" : "~1.10.0" | ||
}, | ||
"main" : "protractor.js", | ||
"version" : "0.2.1" | ||
"bin" : "bin/protractor", | ||
"main" : "lib/protractor.js", | ||
"version" : "0.3.0" | ||
} |
@@ -6,41 +6,74 @@ Protractor | ||
Protractor can be run as a standalone binary runner, or included into your tests as a library. Use Protractor as a library if you would like to manage WebDriver and your test setup yourself. | ||
To run the sample tests | ||
----------------------- | ||
Clone the github repository. Install the selenium-webdriver npm module | ||
Clone the github repository. | ||
npm install selenium-webdriver | ||
Start up a selenium server. By default, the tests expect the selenium server to be running at `http://localhost:4444/wd/hub`. | ||
Start up a selenium server. By default, the tests expect the selenium server to be running at http://localhost:4444/wd/hub. | ||
The example folder contains multiple versions of a simple test which runs against angularjs.org. | ||
Start the test application | ||
`onJasmineNodeSpec.js` and `onMocha.js` show how to use the Protractor library with jasmine-node and mocha. Run these with: | ||
cd testapp; scripts/web-server.js | ||
jasmine-node example/onJasmineNodeSpec.js | ||
mocha example/onMocha.js | ||
You can access the test app at | ||
You can also run the example tests using the Protractor runner. The runner accepts a configuration file, which runs the tests at `example/onProtractor.js`. | ||
http://localhost:8000/app/index.html | ||
bin/protractor example/protractorConf.js | ||
Run the tests with | ||
Using the Protractor runner | ||
--------------------------- | ||
jasmine-node spec | ||
mocha test | ||
The Protractor runner is a binary which accepts a config file. The Protractor runner runs tests written in Jasmine, but other adapters may be added in the future. | ||
To just use Protractor | ||
---------------------- | ||
Install protractor with | ||
Start a selenium server. | ||
npm install protractor | ||
Install the npm modules for protractor, which will install selenium-webdriver if it's not already there: | ||
Create a configuration file - an example is shown in `node_modules/protractor/conf.js`. | ||
cp node_modules/protractor/conf.js myConf.js | ||
Edit the configuration file to point to your tests. | ||
exports.config = { | ||
jasmineNodeOpts: { | ||
specFolders: ['myTest.js', 'myOtherTestFolder'] | ||
} | ||
} | ||
The configuration file must also specify a way of connection to webdriver. This can be | ||
* `seleniumAddress`: The address of a running selenium standalone server. | ||
* `seleniumServerJar`: The location of the selenium standalone .jar file on your machine. Protractor will use this to start up the selenium server. | ||
* `sauceUser` and `sauceKey`: The username and key for a [SauceLabs](http://www.saucelabs.com) account. Protractor will use this to run tests on SauceLabs. | ||
Run with | ||
node_modules/.bin/protractor myConf.js | ||
Or, if you installed protractor globally (using `npm install -g protractor`) | ||
protractor myConf.js | ||
Using the Protractor library | ||
---------------------------- | ||
Use the Protractor library if you would like to manage webdriverJs yourself. | ||
Install protractor with | ||
npm install protractor | ||
In your test file, set up protractor: | ||
In your test, set up a webdriver instance, then wrap it with protractor. | ||
var webdriver = require('selenium-webdriver'); | ||
var protractor = require('protractor'); | ||
// Configure and build your webdriver instance. | ||
var driver; | ||
// Set up driver as a webdriver however you'd like. | ||
var ptor = protractor.wrapDriver(driver); | ||
See spec/testAppSpec.js for examples of use. | ||
@@ -47,0 +80,0 @@ Appendix A: Setting up a standalone selenium server |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
32255
76.9%2
-33.33%11
175%819
76.13%91
56.9%3
200%3
Infinity%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed