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.15.0 to 0.16.0

docs/using-mocha.md

2

docs/getting-started.md

@@ -83,3 +83,3 @@ Getting Started

By default, Protractor uses [Jasmine](http://pivotal.github.io/jasmine/) as its
test scaffolding. Protractor exposes several global variables.
test scaffolding. ([read about using mocha instead](https://github.com/angular/protractor/tree/master/docs/using-mocha.md)) Protractor exposes several global variables.

@@ -86,0 +86,0 @@ * `browser` this is the a wrapper around an instance of webdriver. Used for

@@ -27,2 +27,3 @@ /**

describe('params', 'Param object to be passed to the tests').
describe('framework', 'Test framework to use. jasmine or mocha.').
alias('browser', 'capabilities.browserName').

@@ -29,0 +30,0 @@ alias('name', 'capabilities.name').

@@ -7,7 +7,5 @@ var util = require('util');

var chrome = require('selenium-webdriver/chrome');
var minijn = require('minijasminenode');
var protractor = require('./protractor.js');
var SauceLabs = require('saucelabs');
var glob = require('glob');
require('../jasminewd')

@@ -32,2 +30,3 @@ var server;

params: {},
framework: 'jasmine',
jasmineNodeOpts: {

@@ -215,3 +214,3 @@ isVerbose: false,

*/
var runJasmineTests = function() {
var runTests = function() {
if (config.jasmineNodeOpts.specFolders) {

@@ -239,3 +238,2 @@ throw new Error('Using config.jasmineNodeOpts.specFolders is deprecated ' +

minijn.addSpecs(resolvedSpecs);
// TODO: This should not be tied to the webdriver promise loop, it should use

@@ -276,2 +274,41 @@ // another promise system instead.

// Do the framework setup here so that jasmine and mocha globals are
// available to the onPrepare function.
var minijn, mocha;
if (config.framework == 'jasmine') {
minijn = require('minijasminenode');
require('../jasminewd');
minijn.addSpecs(resolvedSpecs);
} else if (config.framework == 'mocha') {
var Mocha = require('mocha');
mocha = new Mocha({
ui: 'bdd',
reporter: 'list'
});
resolvedSpecs.forEach(function(file) {
mocha.addFile(file);
});
// Mocha doesn't set up the ui until the pre-require event, so
// wait until then to load mocha-webdriver adapters as well.
mocha.suite.on('pre-require', function() {
var mochaAdapters = require('selenium-webdriver/testing');
global.after = mochaAdapters.after;
global.afterEach = mochaAdapters.afterEach;
global.before = mochaAdapters.before;
global.beforeEach = mochaAdapters.beforeEach;
global.it = mochaAdapters.it;
global.it.only = global.iit = mochaAdapters.it.only;
global.it.skip = global.xit = mochaAdapters.xit;
});
mocha.loadFiles();
} else {
throw 'config.framework ' + config.framework +
' is not a valid framework.';
}
// Let the configuration configure the protractor instance before running

@@ -301,3 +338,21 @@ // the tests.

minijn.executeSpecs(options);
if (config.framework == 'jasmine') {
minijn.executeSpecs(options);
} else if (config.framework == 'mocha') {
mocha.run(function(failures) {
// Warning: hack to make it have the same signature as Jasmine 1.3.1.
if (originalOnComplete) {
originalOnComplete();
}
driver.quit().then(function() {
runDeferred.fulfill({
results: function() {
return {
failedCount: failures
};
}
});
});
});
}
});

@@ -315,7 +370,7 @@ });

return setUpSelenium().then(function() {
// cleanUp must be registered directly onto runJasmineTests, not onto
// cleanUp must be registered directly onto runTests, not onto
// the chained promise, so that cleanUp is still called in case of a
// timeout error. Timeout errors need to clear the control flow, which
// would mess up chaining promises.
return runJasmineTests().then(cleanUp);
return runTests().then(cleanUp);
});

@@ -322,0 +377,0 @@ };

@@ -15,3 +15,3 @@ {

"dependencies": {
"selenium-webdriver": "~2.37.0",
"selenium-webdriver": "~2.39.0",
"minijasminenode": ">=0.2.7",

@@ -25,4 +25,6 @@ "saucelabs": "~0.1.0",

"expect.js": "~0.2.0",
"jasmine-node": "~1.9.0",
"mocha": "~1.10.0",
"chai": "~1.8.1",
"chai-as-promised": "~4.1.0",
"jasmine-reporters": "~0.2.1",
"mocha": "~1.16.0",
"express": "~3.3.4",

@@ -41,6 +43,6 @@ "mustache": "~0.7.2"

"scripts": {
"test": "node lib/cli.js spec/basicConf.js; node lib/cli.js spec/altRootConf.js; node lib/cli.js spec/onPrepareConf.js; node_modules/.bin/minijasminenode jasminewd/spec/adapterSpec.js"
"test": "node lib/cli.js spec/basicConf.js; node lib/cli.js spec/altRootConf.js; node lib/cli.js spec/onPrepareConf.js; node lib/cli.js spec/mochaConf.js; node lib/cli.js spec/withLoginConf.js; node_modules/.bin/minijasminenode jasminewd/spec/adapterSpec.js"
},
"license" : "MIT",
"version": "0.15.0",
"version": "0.16.0",
"webdriverVersions": {

@@ -47,0 +49,0 @@ "selenium": "2.39.0",

@@ -34,3 +34,3 @@ Protractor

You will need a *configuration file* containing setup info and *test files* containing the actual test scripts. The config file specifies how the runner should start webdriver, where your test files are, and global setup options. The test files use Jasmine framework, but other adapters may be added in the future.
You will need a *configuration file* containing setup info and *test files* containing the actual test scripts. The config file specifies how the runner should start webdriver, where your test files are, and global setup options. The test files use Jasmine framework by default ([read about using mocha instead](https://github.com/angular/protractor/tree/master/docs/using-mocha.md)).

@@ -37,0 +37,0 @@ Create a configuration file - an example with detailed comments is shown in `node_modules/protractor/referenceConf.js`. Edit the configuration file to point to your test files.

@@ -101,2 +101,9 @@ // A reference configuration file.

},
// ----- The test framework -----
//
// Jasmine is fully supported as a test and assertion framework.
// Mocha has limited beta support. You will need to include your own
// assertion framework if working with mocha.
framework: 'jasmine',

@@ -103,0 +110,0 @@ // ----- Options to be passed to minijasminenode -----

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