How to use the @serenity-js/core/lib/model.ScenarioDetails 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 / serenity-bdd / spec / stage / crew / serenity-bdd-reporter / SerenityBDDReporter / reporting_scene_sequences.spec.ts View on Github external
});

    // see examples/cucumber/features/reporting_results/reports_scenario_outlines.feature for more context
    const
        category = new Category('Reporting results'),
        name     = new Name('Reports scenario outlines'),
        path     = new Path(`reporting_results/reports_scenario_outlines.feature`),
        template = new Description(`
            When  makes a contribution of:
              | value      |
              | time       |
              | talent     |
              | great code |
            Then they help bring serenity to fellow devs
        `),
        sequence = new ScenarioDetails(name, category, new FileSystemLocation(
            path,
            7,
        )),
        scenario1 = new ScenarioDetails(name, category, new FileSystemLocation(
            path,
            25,
        )),
        scenario2 = new ScenarioDetails(name, category, new FileSystemLocation(
            path,
            26,
        ))
    ;

    /**
     * @test {SerenityBDDReporter}
     * @test {SceneSequenceDetected}
github jan-molak / serenity-js / packages / protractor / spec / adapter / ProtractorFrameworkAdapter.spec.ts View on Github external
.reduce((previous, current) => previous.then(() => {

                    const scenario = sample(current);

                    const details = new ScenarioDetails(
                        new Name(scenario.name),
                        new Category(scenario.category),
                        new FileSystemLocation(new Path(scenario.path)),
                    );

                    this.serenityInstance.announce(new SceneStarts(
                        details,
                        this.serenityInstance.currentTime(),
                    ));

                    // ... an actual test operunner would now execute the test and then announce the outcome

                    this.serenityInstance.announce(
                        new SceneFinished(details, scenario.outcome, this.serenityInstance.currentTime()),
                    );
github jan-molak / serenity-js / packages / cucumber / spec / listeners / CucumberEventProtocolAdapter.spec.ts View on Github external
it('correctly recognises undefined steps', () => {

        emitAllFrom(require('./samples/scenario-with-undefined-steps.json'));

        const expectedScenarioDetails = new ScenarioDetails(
            new Name('Undefined steps'),
            new Category('Event Protocol'),
            new FileSystemLocation(
                new Path('features/undefined-steps.feature'),
                3,
                3,
            ),
        );

        return serenity.waitForNextCue().then(() => {

            PickEvent.from(recorder.events)
                .next(SceneStarts, e => expect(e.value).to.equal(expectedScenarioDetails))
                .next(TestRunnerDetected, e => expect(e.value).to.equal(new Name('Cucumber')))
                .next(SceneTagged, e => expect(e.tag).to.equal(new FeatureTag('Event Protocol')))
                .next(TaskStarts, e => expect(e.value.name).to.equal(new Name('Given I have an undefined step')))
github jan-molak / serenity-js / packages / serenity-bdd / spec / stage / crew / serenity-bdd-reporter / SerenityBDDReporter.spec.ts View on Github external
describe('SerenityBDDReporter', () => {

    const
        startTime = Timestamp.fromJSON('2018-05-25T00:00:00.123Z'),
        scenarioDuration = Duration.ofMilliseconds(142);

    const defaultCardScenario = new ScenarioDetails(
        new Name('Paying with a default card'),
        new Category('Online Checkout'),
        new FileSystemLocation(
            new Path(`payments/checkout.feature`),
        ),
    );

    const voucherScenario = new ScenarioDetails(
        new Name('Paying with a voucher'),
        new Category('Online Checkout'),
        new FileSystemLocation(
            new Path(`payments/checkout.feature`),
        ),
    );

    let stage: Stage,
        stageManager: sinon.SinonStubbedInstance,
        reporter: SerenityBDDReporter;

    beforeEach(() => {
        const env = create();

        stageManager    = env.stageManager;
        stage           = env.stage;
github jan-molak / serenity-js / packages / serenity-bdd / spec / stage / crew / serenity-bdd-reporter / SerenityBDDReporter / reporting_scene_sequences.spec.ts View on Github external
When  makes a contribution of:
              | value      |
              | time       |
              | talent     |
              | great code |
            Then they help bring serenity to fellow devs
        `),
        sequence = new ScenarioDetails(name, category, new FileSystemLocation(
            path,
            7,
        )),
        scenario1 = new ScenarioDetails(name, category, new FileSystemLocation(
            path,
            25,
        )),
        scenario2 = new ScenarioDetails(name, category, new FileSystemLocation(
            path,
            26,
        ))
    ;

    /**
     * @test {SerenityBDDReporter}
     * @test {SceneSequenceDetected}
     * @test {SceneTemplateDetected}
     * @test {SceneParametersDetected}
     * @test {ScenarioParameters}
     * @test {SceneStarts}
     * @test {SceneFinished}
     * @test {ExecutionSuccessful}
     * @test {TestRunFinished}
     */
github jan-molak / serenity-js / packages / jasmine / src / SerenityReporterForJasmine.ts View on Github external
private scenarioDetailsOf(spec: SpecResult): ScenarioDetails {
        return new ScenarioDetails(
            new Name(this.currentScenarioNameFor(spec.description)),
            new Category(this.currentFeatureName()),
            FileSystemLocation.fromJSON(spec.location as any),
        );
    }
github jan-molak / serenity-js / packages / serenity-bdd / spec / stage / crew / samples.ts View on Github external
import { FileSystemLocation, Path } from '@serenity-js/core/lib/io';
import { Category, Name, Photo, ScenarioDetails } from '@serenity-js/core/lib/model';

export const defaultCardScenario = new ScenarioDetails(
    new Name('Paying with a default card'),
    new Category('Online Checkout'),
    new FileSystemLocation(
        new Path(`payments/checkout.feature`),
    ),
);

export const voucherScenario = new ScenarioDetails(
    new Name('Paying with a voucher'),
    new Category('Online Checkout'),
    new FileSystemLocation(
        new Path(`payments/checkout.feature`),
    ),
);

export const photo = new Photo('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEW01FWbeM52AAAACklEQVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg==');
github jan-molak / serenity-js / packages / cucumber / src / notifier / Notifier.ts View on Github external
private detailsOf(scenario: FeatureFileNode, feature: Feature): ScenarioDetails {
        return new ScenarioDetails(
            scenario.name,
            new Category(feature.name.value),
            scenario.location,
        );
    }