0

When i try to do a GetRequest using the Serenity JS REST code, I am getting the error as TestCompromisedError: The API call has failed

Caused by: Error: unable to get local issuer certificate>
at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)>
at TLSSocket.emit (node:events:390:28)>
at TLSSocket._finishInit (node:_tls_wrap:944:8)>
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)

Below is the code snippet:

const apiActor = await actorCalled('Tester').whoCan(CallAnApi.at('https://abcd.com'));
await apiActor.attemptsTo(
Send.a(GetRequest.to('/resources/').using({
        headers: {
            Accept: '/',
           Cookie: 'some-cookie',
            Connection: 'keep-alive',

        }
    }),
   ),
  Ensure.that(LastResponse.status(), equals(200)),
 );

Is the above code is correct? if i use the http url without any cookie its working fine and i am able to get the response 200. How to handle the https url with cookie for SerenityJS rest?

James Z
  • 12,209
  • 10
  • 24
  • 44

0 Answers0