protractor
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32255
2
11
819
91
3
2
1
+ Addedjasmine-node@~1.9.0
+ Addedsaucelabs@~0.1.0
+ Addedselenium-webdriver@>2.32.1
+ Added@bazel/runfiles@6.3.1(transitive)
+ Added@xmldom/xmldom@0.8.10(transitive)
+ Addedcoffee-script@1.12.7(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedfileset@0.1.8(transitive)
+ Addedgaze@0.3.4(transitive)
+ Addedglob@3.2.11(transitive)
+ Addedimmediate@3.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjasmine-node@1.9.1(transitive)
+ Addedjasmine-reporters@2.5.2(transitive)
+ Addedjszip@3.10.1(transitive)
+ Addedlie@3.3.0(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.2.140.3.0(transitive)
+ Addedmkdirp@0.3.51.0.4(transitive)
+ Addedpako@1.0.11(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedrequirejs@2.3.7(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsaucelabs@0.1.1(transitive)
+ Addedselenium-webdriver@4.26.0(transitive)
+ Addedsetimmediate@1.0.5(transitive)
+ Addedsigmund@1.0.1(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedtmp@0.2.3(transitive)
+ Addedunderscore@1.13.7(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwalkdir@0.4.1(transitive)
+ Addedws@8.18.0(transitive)
- Removedselenium-webdriver@2.32.1(transitive)