Socket
Socket
Sign inDemoInstall

protractor-cucumber-framework

Package Overview
Dependencies
209
Maintainers
3
Versions
97
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.0 to 3.0.0

protractor-cucumber-framework-test.78357.json

53

lib/resultsCapturer.js

@@ -14,3 +14,2 @@ let q = require('q');

function registerHandlers() {
let scenarioDuration = 0;
let scenarioFailed = false;

@@ -24,23 +23,5 @@ let stepResults = buildStepResults();

this.registerHandler('BeforeScenario', function (scenario, callback) {
scenarioDuration = 0;
callback();
});
this.registerHandler('AfterScenario', function (scenario, callback) {
let feature = getter(scenario, 'feature');
let scenarioInfo = {
name: getter(scenario, 'name'),
category: getter(feature, 'name'),
durationMillis: isCucumber2() ? scenarioDuration : (Math.round(scenarioDuration / 1e6))
};
stepResults.description = scenarioInfo.name;
if (scenarioFailed) {
++state.results.failedCount;
state.runner.emit('testFail', scenarioInfo);
} else {
state.runner.emit('testPass', scenarioInfo);
}
if (scenarioFailed) ++state.results.failedCount;
stepResults.description = getter(scenario, 'name');
state.results.specResults.push(stepResults);

@@ -55,6 +36,8 @@ stepResults = buildStepResults();

this.registerHandler('StepResult', function(stepResult, callback) {
let failureMessage;
let step = getter(stepResult, 'step');
let scenario = getter(step, 'scenario');
let feature = getter(scenario, 'feature');
if (!scenario.uri) scenario.uri = feature.uri;
let emitterEvent = 'testPass';
scenarioDuration += getter(stepResult, 'duration');
switch (getter(stepResult, 'status')) {

@@ -65,8 +48,8 @@ case Cucumber.Status.PASSED:

case Cucumber.Status.FAILED:
emitterEvent = 'testFail';
scenarioFailed = true;
failureMessage = getter(stepResult, 'failureException');
stepResults.assertions.push({
passed: false,
errorMsg: failureMessage.message,
stackTrace: failureMessage.stack
errorMsg: getter(stepResult, 'failureException').message,
stackTrace: getter(stepResult, 'failureException').stack
});

@@ -76,2 +59,3 @@ break;

if (state.strict) {
emitterEvent = 'testFail';
scenarioFailed = true;

@@ -86,3 +70,11 @@ stepResults.assertions.push({

stepResults.duration += getter(stepResult, 'duration');
let duration = getter(stepResult, 'duration');
if (isCucumber1()) duration = Math.round(duration / 1e6);
state.runner.emit(emitterEvent, {
name: `${getter(step, 'keyword')}${getter(step, 'name') || ''}`,
category: `${getter(feature, 'name')}: ${getter(scenario, 'name')}`,
durationMillis: duration
});
callback();

@@ -110,4 +102,5 @@ });

function isCucumber2() {
return !!Cucumber.defineSupportCode;
function isCucumber1() {
return !Cucumber.defineSupportCode;
}
{
"name": "protractor-cucumber-framework",
"version": "2.3.0",
"version": "3.0.0",
"description": "Protractor framework for Cucumber.js",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc