AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
224 stars 20 forks source link

Setup httpyac in Test explorer #140 #141

Closed BramManuel closed 1 year ago

BramManuel commented 1 year ago

I have been working on it all weekend, it's a version 1, so I would love your opinion and feedback.

140

Future improvements

There are a couple of TODO's and future improvements

Demo

Note: The code-workspace file is not required if you have a .vscode folder.

Open Explorer

First we open the test explorer, the handler will look up all the tests in the workspace. We look for the following files (.http,.md,.adoc). OpenTestExplorer

Run All

From here, we can click the run all button to run all the found tests. Look at the top of the explorer, it lists all the run total succeeded and failed tests. RunAll

Show children HTTP regions

Then we open one file in the explorer to see all the HTTP regions that have been run. You see that some tests have failed, succeed or skipped. Tests that have been skipped have no tests within the region. ShowList

Go to Test

Let's take a look at a test that has succeeded. GoToTest

Show test fail reason

And let's have a look at a failed test. This test has 2 assertions. 1 of them fails. Here you see the output of a test: LookAtFailed

Give test a name

There are also a couple of file hooks implemented here we change the name of the HTTP region it immediately gets reflected to the explorer, the same goes for tests. GiveHttpRegionName

Create File

And we want to create and delete files, when we do the explorer should react to it: On Creation:

NewFile And on delete:

Delete File

DeleteFile

AnWeber commented 1 year ago

Hi I like your idea. I did not know about test explorer API. Great improvement 👍. I will have a look at it after my vacation

AnWeber commented 1 year ago

@BramManuel Awesome. I think the idea is great. I am currently review the code and also read the documentation of the api. I would also have a few improvements, for example to improve the performance. I will simply add notes to this PR. Is it ok with you, if I commit code directly into your pull request?

BramManuel commented 1 year ago

Yea, off course you can commit to the pr! I am here to learn, and typescript is new for me 😉 if I can help with something, let me know!

AnWeber commented 1 year ago

Thanks again for the PR and the tip about the interface. I will merge the PR as it is. My changes I will convert only afterwards, because I still want to implement the lazy loading.

li1234yun commented 1 year ago

https://github.com/AnWeber/vscode-httpyac/issues/140#issuecomment-1200333447