Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

protractor

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protractor - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

bin/protractor

12

package.json

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc