Socket
Socket
Sign inDemoInstall

@serenity-js/serenity-bdd

Package Overview
Dependencies
Maintainers
1
Versions
292
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serenity-js/serenity-bdd - npm Package Compare versions

Comparing version 3.0.0-rc.41 to 3.0.0-rc.42

13

CHANGELOG.md

@@ -6,2 +6,15 @@ # Change Log

# [3.0.0-rc.42](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.41...v3.0.0-rc.42) (2023-02-12)
### Bug Fixes
* **core:** event TestRunFinished now incidates the Outcome of the test suite ([a941056](https://github.com/serenity-js/serenity-js/commit/a9410566891e543101b935a80db9c7daea0c9944)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
* **playwright-test:** default to using file name as feature name when describe blocks are absent ([1295b04](https://github.com/serenity-js/serenity-js/commit/1295b04adcd12a9d7eaef795e1080bb1c5a9056d)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
* **serenity-bdd:** prevent invalid Serenity BDD JSON reports from being sent to processing ([e59d4da](https://github.com/serenity-js/serenity-js/commit/e59d4da0646c103db37631ecc33ecd66ae18d05e)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
# [3.0.0-rc.41](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.40...v3.0.0-rc.41) (2023-02-07)

@@ -8,0 +21,0 @@

11

lib/stage/crew/serenity-bdd-reporter/processors/transformations/scenarioDetailsOf.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.scenarioDetailsOf = void 0;
const tiny_types_1 = require("tiny-types");
const mappers_1 = require("../mappers");

@@ -10,9 +11,11 @@ /**

return (context) => {
context.report.name = details.name.value;
context.report.title = details.name.value;
const name = (0, tiny_types_1.ensure)('scenario name', details.name.value, (0, tiny_types_1.isNotBlank)());
const category = (0, tiny_types_1.ensure)('scenario category', details.category.value, (0, tiny_types_1.isNotBlank)());
context.report.name = name;
context.report.title = name;
context.report.manual = false;
context.report.testSteps = [];
context.report.userStory = {
id: (0, mappers_1.dashify)(details.category.value),
storyName: details.category.value,
id: (0, mappers_1.dashify)(category),
storyName: category,
path: isFeatureFile(details.location.path)

@@ -19,0 +22,0 @@ ? details.location.path.value

@@ -6,2 +6,3 @@ "use strict";

const events_1 = require("@serenity-js/core/lib/events");
const model_1 = require("@serenity-js/core/lib/model");
const processors_1 = require("./processors");

@@ -100,7 +101,15 @@ /**

else if (event instanceof events_1.TestRunFinishes) {
this.processors
.process(this.eventQueues)
.forEach(result => {
this.stage.announce(new events_1.ArtifactGenerated(result.sceneId, result.name, result.artifact, this.stage.currentTime()));
});
const id = model_1.CorrelationId.create();
this.stage.announce(new events_1.AsyncOperationAttempted(new model_1.Name(this.constructor.name), new model_1.Description(`Generating Serenity BDD JSON reports...`), id, this.stage.currentTime()));
try {
this.processors
.process(this.eventQueues)
.forEach(result => {
this.stage.announce(new events_1.ArtifactGenerated(result.sceneId, result.name, result.artifact, this.stage.currentTime()));
});
this.stage.announce(new events_1.AsyncOperationCompleted(id, this.stage.currentTime()));
}
catch (error) {
this.stage.announce(new events_1.AsyncOperationFailed(error, id, this.stage.currentTime()));
}
}

@@ -107,0 +116,0 @@ }

{
"name": "@serenity-js/serenity-bdd",
"version": "3.0.0-rc.41",
"version": "3.0.0-rc.42",
"description": "Serenity BDD reporter for Serenity/JS",

@@ -48,5 +48,5 @@ "author": {

"dependencies": {
"@serenity-js/assertions": "3.0.0-rc.41",
"@serenity-js/core": "3.0.0-rc.41",
"@serenity-js/rest": "3.0.0-rc.41",
"@serenity-js/assertions": "3.0.0-rc.42",
"@serenity-js/core": "3.0.0-rc.42",
"@serenity-js/rest": "3.0.0-rc.42",
"ansi-regex": "^5.0.1",

@@ -68,9 +68,9 @@ "axios": "^1.2.2",

"if-env": "^1.0.4",
"memfs": "^3.4.12",
"memfs": "^3.4.13",
"mocha": "^10.2.0",
"nyc": "15.1.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"typescript": "^4.9.5"
},
"gitHead": "e74f8f4989f18fe37edde3f8500b2084289d385b"
"gitHead": "ebe1ca57bb98f09bc4554f32e87f44a0dbce2c22"
}
import { Path } from '@serenity-js/core/lib/io';
import { ScenarioDetails } from '@serenity-js/core/lib/model';
import { ensure, isNotBlank } from 'tiny-types';

@@ -12,9 +13,12 @@ import { dashify } from '../mappers';

return (context: Context): Context => {
context.report.name = details.name.value;
context.report.title = details.name.value;
const name = ensure('scenario name', details.name.value, isNotBlank());
const category = ensure('scenario category', details.category.value, isNotBlank());
context.report.name = name;
context.report.title = name;
context.report.manual = false;
context.report.testSteps = [];
context.report.userStory = {
id: dashify(details.category.value),
storyName: details.category.value,
id: dashify(category),
storyName: category,
path: isFeatureFile(details.location.path)

@@ -21,0 +25,0 @@ ? details.location.path.value

import { DomainEventQueues, Stage, StageCrewMember } from '@serenity-js/core';
import { ArtifactGenerated, DomainEvent, TestRunFinishes } from '@serenity-js/core/lib/events';
import { CorrelationId } from '@serenity-js/core/lib/model';
import { ArtifactGenerated, AsyncOperationAttempted, AsyncOperationCompleted, AsyncOperationFailed, DomainEvent, TestRunFinishes } from '@serenity-js/core/lib/events';
import { CorrelationId, Description, Name } from '@serenity-js/core/lib/model';

@@ -103,13 +103,35 @@ import { EventQueueProcessors } from './processors';

else if (event instanceof TestRunFinishes) {
const id = CorrelationId.create();
this.processors
.process(this.eventQueues)
.forEach(result => {
this.stage.announce(new ArtifactGenerated(
result.sceneId,
result.name,
result.artifact,
this.stage.currentTime(),
));
});
this.stage.announce(new AsyncOperationAttempted(
new Name(this.constructor.name),
new Description(`Generating Serenity BDD JSON reports...`),
id,
this.stage.currentTime(),
));
try {
this.processors
.process(this.eventQueues)
.forEach(result => {
this.stage.announce(new ArtifactGenerated(
result.sceneId,
result.name,
result.artifact,
this.stage.currentTime(),
));
});
this.stage.announce(new AsyncOperationCompleted(
id,
this.stage.currentTime(),
));
}
catch (error) {
this.stage.announce(new AsyncOperationFailed(
error,
id,
this.stage.currentTime(),
));
}
}

@@ -116,0 +138,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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