How to run IntellJ IDEA HTTP Client tests in terminal

Answered

Hi

I want to find a solution for run http spec (see below) in terminal (inCI/CD). Is it possible?

user-confirmations.http

 

POST {{confirmations-api-endpoint}}/user/confirmations
Content-Type: application/json
Accept: application/json

{
"firstName": "Vasya",
"lastName": "Pupkin",
"mobilePhone": "+19998885533",
"email": "vaso.pupkin@pupkinworld.com"
}

> {%
client.test("Should return confirmationId", function() {
client.assert(response.status === 200, "Response status is not 200");
client.assert(response.body.confirmationId, "confirmationId is required");

client.global.set("confirmationId", response.body.confirmationId);
});
%}

###

In IntellJ Idea it looks like:

Need a similar feature, but for Jenkins/GitlabCI/etc

4 comments
Comment actions Permalink

Hello. As far as I know, it is not possible, using IDEA command line tools. Regarding other tools, it is better to ask at stackoverflow.com.

0
Comment actions Permalink

Please vote for https://youtrack.jetbrains.com/issue/WI-42002 to be notified on any progress with this feature

2
Comment actions Permalink

I was looking for this feature too
JetBrains products didn't seem to have obvious solution but this open source jar works pretty well in my opinion
https://github.com/restcli/restcli

0

Please sign in to leave a comment.