How to use the @serenity-js/core/lib/model.Description function in @serenity-js/core

To help you get started, we’ve selected a few @serenity-js/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jan-molak / serenity-js / packages / protractor / src / stage / Photographer.ts View on Github external
.when(InteractionFinished,   ({ value, outcome }: InteractionFinished) => {
                // todo: clean up
                if (this.stage.theShowHasStarted() && outcome.isWorseThan(ImplementationPending)) {

                    const id = CorrelationId.create();

                    this.stage.manager.notifyOf(new AsyncOperationAttempted(
                        new Description(`[${ this.constructor.name }] Taking screenshot of '${ value.name.value }'...`),
                        id,
                    ));

                    BrowseTheWeb.as(this.stage.theActorInTheSpotlight()).takeScreenshot()
                        .then(screenshot => {
                            this.stage.manager.notifyOf(new ArtifactGenerated(
                                value.name,
                                Photo.fromBase64(screenshot),
                            ));

                            this.stage.manager.notifyOf(new AsyncOperationCompleted(
                                new Description(`[${ this.constructor.name }] Took screenshot of '${ value.name.value }'`),
                                id,
                            ));
                        })
                        .catch(error => {
github jan-molak / serenity-js / packages / cucumber / spec / gherkin / feature-files / FeatureFileMapper.spec.ts View on Github external
it('associates the background with the feature', parse('backgrounds.feature', map => {
            const feature = map.get(Feature).onLine(1);

            expect(feature.background).to.equal(
                new Background(
                    new FileSystemLocation(fixtures.join(new Path('backgrounds.feature')), 3, 3),
                    new Name('The one that provides some context'),
                    new Description('Once upon a time, there was a test suite.'),
                    [
                        new Step(
                            new FileSystemLocation(fixtures.join(new Path('backgrounds.feature')), 7, 5),
                            new Name('Given a prerequisite'),
                        ),
                    ],
            ));
        }));
github jan-molak / serenity-js / packages / cucumber / spec / gherkin / feature-files / FeatureFileMapper.spec.ts View on Github external
it('maps a scenario with a single-line description', parse('names_and_descriptions.feature', map => {
            const scenario = map.get(Scenario).onLine(8);

            expect(scenario.name).to.equal(new Name('The one with a description'));
            expect(scenario.description).to.equal(new Description('Description of a scenario'));
        }));
github jan-molak / serenity-js / packages / cucumber / spec / gherkin / feature-files / FeatureFileMapper.spec.ts View on Github external
it('maps the scenario template', parse('scenario_outlines.feature', map => {
            const
                scenario = map.get(ScenarioOutline).onLine(3),
                path = fixtures.join(new Path('scenario_outlines.feature'));

            expect(scenario).to.equal(new ScenarioOutline(
                new FileSystemLocation(path, 3, 3),
                new Name('The one with examples'),
                new Description('Description of the scenario with examples'),
                [
                    new Step(
                        new FileSystemLocation(path, 7, 5),
                        new Name('Given step with a '),
                    ),
                ],
                {
                    14: new ScenarioParameters(
                        new Name('Name of the example set'),
                        new Description('Description of the example set'),
                        { parameter: 'value one' },
                    ),
                    15: new ScenarioParameters(
                        new Name('Name of the example set'),
                        new Description('Description of the example set'),
                        { parameter: 'value two' },
github jan-molak / serenity-js / packages / serenity-bdd / spec / stage / crew / serenity-bdd-reporter / SerenityBDDReporter / describing_scene.spec.ts View on Github external
it('captures information about scenario background', () => {
        given(reporter).isNotifiedOfFollowingEvents(
            new SceneStarts(defaultCardScenario),
                new SceneBackgroundDetected(new Name('Background title'), new Description('Background description')),
            new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
            new TestRunFinished(),
        );

        const report: SerenityBDDReport = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);

        expect(report.backgroundTitle).to.equal('Background title');
        expect(report.backgroundDescription).to.equal('Background description');
    });
github jan-molak / serenity-js / packages / cucumber / spec / gherkin / feature-files / FeatureFileMapper.spec.ts View on Github external
it('maps a scenario with a multi-line description', parse('names_and_descriptions.feature', map => {
            const scenario = map.get(Scenario).onLine(14);

            expect(scenario.name).to.equal(new Name('The one with a multi-line description'));
            expect(scenario.description).to.equal(new Description('A multi-line\n\ndescription\nof a scenario'));
        }));
    });
github jan-molak / serenity-js / packages / protractor / src / stage / Photographer.ts View on Github external
.then(screenshot => {
                            this.stage.manager.notifyOf(new ArtifactGenerated(
                                value.name,
                                Photo.fromBase64(screenshot),
                            ));

                            this.stage.manager.notifyOf(new AsyncOperationCompleted(
                                new Description(`[${ this.constructor.name }] Took screenshot of '${ value.name.value }'`),
                                id,
                            ));
                        })
                        .catch(error => {
github jan-molak / serenity-js / packages / cucumber / src / gherkin / feature-files / FeatureFileMapper.ts View on Github external
outline.examples.filter(e => e.tableHeader !== undefined).forEach(examples => {

                        const
                            exampleSetName = new Name(examples.name),
                            exampleSetDescription = examples.description && new Description(examples.description),
                            variableCells = examples.tableHeader.cells;

                        examples.tableBody.forEach(values => {
                            const
                                valueCells = values.cells,
                                steps = background ? background.steps : [];

                            outline.steps.forEach(scenarioOutlineStep => {
                                const
                                    interpolatedStepText = this.interpolate(scenarioOutlineStep.text, variableCells, valueCells),
                                    interpolatedStepArgument = this.interpolateStepArgument(scenarioOutlineStep.argument, variableCells, valueCells);

                                steps.push(new Step(
                                    new FileSystemLocation(
                                        path,
                                        scenarioOutlineStep.location.line,
github jan-molak / serenity-js / packages / cucumber / spec / gherkin / feature-files / FeatureFileMapper.spec.ts View on Github external
new Description('Description of the scenario with more examples'),
                [
                    new Step(
                        new FileSystemLocation(path, 21, 5),
                        new Name('Given step with a '),
                    ),
                ],
                {
                    28: new ScenarioParameters(
                            new Name('Name of the first set of examples'),
                            new Description('Description of the first set of examples'),
                            { parameter: 'value one' },
                        ),
                    29: new ScenarioParameters(
                            new Name('Name of the first set of examples'),
                            new Description('Description of the first set of examples'),
                            { parameter: 'value two' },
                        ),
                    36: new ScenarioParameters(
                            new Name('Name of the second set of examples'),
                            new Description('Description of the second set of examples'),
                            { parameter: 'value three' },
                        ),
                    37: new ScenarioParameters(
                            new Name('Name of the second set of examples'),
                            new Description('Description of the second set of examples'),
                            { parameter: 'value four' },
                        ),
                },
            ));
        }));
    });
github jan-molak / serenity-js / packages / cucumber / src / gherkin / feature-files / FeatureFileMapper.ts View on Github external
}, {});

                            parameters[values.location.line] = new ScenarioParameters(
                                exampleSetName,
                                exampleSetDescription,
                                scenarioParameters,
                            );

                            map.set(new Scenario(
                                new FileSystemLocation(
                                    path,
                                    values.location.line,
                                    values.location.column,
                                ),
                                new Name(outline.name),
                                outline.description && new Description(outline.description),
                                steps,
                                this.tagsFrom(document.feature.tags, outline.tags, examples.tags),
                                new FileSystemLocation(
                                    path,
                                    outline.location.line,
                                    outline.location.column,
                                ),
                            )).onLine(values.location.line);
                        });
                    });