How to run IntellJ IDEA HTTP Client tests in terminal

已回答

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

2

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

2

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
Avatar
Кирилл Толкачев

Many Thanks Elena!

0

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

请先登录再写评论。