How to use the @serenity-js/local-server.ManageALocalServer.runningAHttpsListener function in @serenity-js/local-server

To help you get started, we’ve selected a few @serenity-js/local-server 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 / spec / screenplay / questions / Cookie.spec.ts View on Github external
describe('when working with secure cookies', () => {

        const Sid = Actor.named('Secure Sid').whoCan(
            BrowseTheWeb.using(protractor.browser),
            ManageALocalServer.runningAHttpsListener(cookieCutterApp, {
                cert:               certificates.cert,
                key:                certificates.key,
                requestCert:        true,
                rejectUnauthorized: false,
            }),
        );

        beforeEach(() => Sid.attemptsTo(StartLocalServer.onRandomPort()));
        afterEach(() => Sid.attemptsTo(StopLocalServer.ifRunning()));
        afterEach(() => Sid.attemptsTo(DeleteCookies.all()));

        /** @test {Cookie} */
        /** @test {Cookie#isSecure} */
        it('allows the actor to confirm that a cookie is not secure', () => Sid.attemptsTo(
            Navigate.to(cookieCutterURLFor('/cookie?name=favourite&value=chocolate-chip')),
            Ensure.that(Cookie.isSecure('favourite'), equals(false)),

@serenity-js/local-server

Serenity/JS Screenplay Pattern library for managing local Node.js test servers, including Express, Koa, Hapi, and Restify, to support comprehensive integration testing

Apache-2.0
Latest version published 6 days ago

Package Health Score

78 / 100
Full package analysis