Socket
Socket
Sign inDemoInstall

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.1.1 to 0.1.2

externalhttpspec.js

12

package.json

@@ -5,13 +5,13 @@ {

"homepage" : "https://github.com/juliemr/protractor",
"keywords" : ["angular", "test", "testing", "webdriver", "selenium"],
"keywords" : ["angular", "test", "testing", "webdriver", "webdriverjs", "selenium"],
"author" : "Julie Ralph <ju.ralph@gmail.com>",
"dependencies" : {
"selenium-webdriver" : "2.30.x"
"peerDependencies" : {
"selenium-webdriver" : "~2.32.1"
},
"repository" : {
"type": "git",
"url": "git://github.com/juliemr/protractor.git"
"type" : "git",
"url" : "git://github.com/juliemr/protractor.git"
},
"main" : "protractor.js",
"version" : "0.1.1"
"version" : "0.1.2"
}

@@ -11,3 +11,3 @@ var url = require('url');

var PROTRACTOR_URL_LABEL = '_WAITFORMODULES';
var DEFER_LABEL = 'NG_DEFER_BOOTSTRAP!';

@@ -49,7 +49,6 @@ var waitForAngular = function() {

get: function(destination) {
var parsed = url.parse(destination);
parsed.hash = (parsed.hash ? parsed.hash : '#') + PROTRACTOR_URL_LABEL;
var modifiedUrl = url.format(parsed);
driver.get(modifiedUrl);
// At this point, Angular will pause for us, until angular.resumeBootstrapWithExtraModules is called.
driver.get('about:blank');
driver.executeScript('window.name += "' + DEFER_LABEL + '";' +
'window.location.href = "' + destination + '"');
// At this point, Angular will pause for us, until angular.resumeBootstrap is called.

@@ -63,3 +62,3 @@ for (var i = 0; i < moduleScripts.length; ++i) {

// Continue to bootstrap Angular.
angular.resumeBootstrapWithExtraModules(arguments[0]);
angular.resumeBootstrap(arguments[0]);
callback();

@@ -71,41 +70,48 @@ }, moduleNames);

exports.By = {
/** Usage:
* driver.findElement(protractor.By.binding(), "{{myBinding}}");
*/
binding: function() {
return {
using: 'js',
value: function() {
var bindings = document.getElementsByClassName('ng-binding');
var matches = [];
var binding = arguments[0];
for (var i = 0; i < bindings.length; ++i) {
if (angular.element(bindings[i]).data().$binding[0].exp == binding) {
matches.push(bindings[i]);
}
}
return matches[0]; // We can only return one with webdriver.findElement.
var ProtractorBy = function() {}
var WebdriverBy = function() {};
WebdriverBy.prototype = require('selenium-webdriver').By;
util.inherits(ProtractorBy, WebdriverBy);
ProtractorBy.prototype.binding = function() {
return {
using: 'js',
value: function() {
var bindings = document.getElementsByClassName('ng-binding');
var matches = [];
var binding = arguments[0];
for (var i = 0; i < bindings.length; ++i) {
if (angular.element(bindings[i]).data().$binding[0].exp == binding) {
matches.push(bindings[i]);
}
}
};
},
select: function(model) {
return {
using: 'css selector',
value: 'select[ng-model=' + model + ']'
};
},
selectedOption: function(model) {
return {
using: 'css selector',
value: 'select[ng-model=' + model + '] option[selected]'
};
},
repeater: null,
input: function(model) {
return {
using: 'css selector',
value: 'input[ng-model=' + model + ']'
};
}
return matches[0]; // We can only return one with webdriver.findElement.
}
};
};
ProtractorBy.prototype.select = function(model) {
return {
using: 'css selector',
value: 'select[ng-model=' + model + ']'
};
};
ProtractorBy.prototype.selectedOption = function(model) {
return {
using: 'css selector',
value: 'select[ng-model=' + model + '] option[selected]'
};
};
ProtractorBy.prototype.input = function(model) {
return {
using: 'css selector',
value: 'input[ng-model=' + model + ']'
};
}
ProtractorBy.prototype.repeater = null;
exports.By = new ProtractorBy();
Protractor
==========
Protractor is an end to end test framework for Angular applications built on top of webdriver. It is still quite in progress.
Protractor is an end to end test framework for Angular applications built on top of [webdriverJS](https://code.google.com/p/selenium/wiki/WebDriverJs). It is still quite in progress.

@@ -9,11 +9,11 @@ To run the sample tests

Install the selenium-webdriver npm module
Clone the github repository. Install the selenium-webdriver npm module
npm install selenium-webdriver
[Start up a selenium server.](http://code.google.com/p/selenium/wiki/WebDriverJs#With_Node) 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.
Start the test application
testapp/scripts/web-server.js
cd testapp; scripts/web-server.js

@@ -27,1 +27,33 @@ You can access the test app at

node httpspec.js
To just use Protractor
----------------------
Start a selenium server.
Install the npm modules for selenium-webdriver and protractor:
npm install selenium-webdriver
npm install protractor
In your test file, set up protractor:
var webdriver = require('selenium-webdriver');
var protractor = require('./protractor.js');
// Configure and build your webdriver instance.
var ptor = protractor.wrapDriver(driver);
See httpspec.js for examples of use.
Appendix A: Setting up a standalone selenium server
---------------------------------------------------
WebdriverJS does not natively include the selenium server - you must start a standalone selenium server.
Download the selenium server. All you need is the latest [selenium-server-standalone.](https://code.google.com/p/selenium/downloads/list)
To use with chrome browsers, [download chromedriver](https://code.google.com/p/chromedriver/downloads/list)
[More information about chromedriver](https://code.google.com/p/selenium/wiki/ChromeDriver)
Start the selenium standalone with
java -jar selenium-server-standalone-2.x.x.jar
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