Skip to content

reporter: beautify markdown reporter#96

Merged
barbosa merged 3 commits intomasterfrom
feature/beautify-markdown
Mar 22, 2020
Merged

reporter: beautify markdown reporter#96
barbosa merged 3 commits intomasterfrom
feature/beautify-markdown

Conversation

@barbosa
Copy link
Copy Markdown
Member

@barbosa barbosa commented Jan 3, 2020

The current state can be seen at the comment below.

fixes #60

@barbosa
Copy link
Copy Markdown
Member Author

barbosa commented Jan 3, 2020

ScanAPI Report

GET https://api.loadsmart.com/health

Request

Headers

Header Value
Content-Type application/json
Accept application/json

Response

Metadata

status code 200
redirect False

Headers

Header Value
Content-Type application/json
Accept application/json

Content

{
    "key": "value",
    "fla": "mengo"
}

GET https://api.loadsmart.com/health

Request

Headers

Header Value
Content-Type application/json
Accept application/json

Response

Metadata

status code 200
redirect False

Headers

Header Value
Content-Type application/json
Accept application/json

Content

{
    "key": "value",
    "fla": "mengo"
}

GET https://api.loadsmart.com/health

Request

Headers

Header Value
Content-Type application/json
Accept application/json

Response

Metadata

status code 200
redirect False

Headers

Header Value
Content-Type application/json
Accept application/json

Content

{
    "key": "value",
    "fla": "mengo"
}

{% for response in responses %}
{% set request = response.request %}
## Request: {{ request.method }} {{ request.url }}
## {{ request.method }} {{ request.url }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to not display the full URL but just the path instead. Good for the 👀.
Something we can do is to pass BASE_URL to the template and strip it from request.url.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly agree! We can show the base url only once in the top of the file.

| | |
|-------------|----------------------------|
| status code | {{ response.status_code }} |
| redirect | {{ response.is_redirect }} |
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of having tables for HTTP headers but I'm not so sure yet if this is the best way to display the pieces of information above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the tables too. I think it is a good way. On Postman, for example, it is a table too

image

@djalmaaraujo
Copy link
Copy Markdown
Contributor

@barbosa @camilamaia I don't remember if the markdown table is officially a markdown feature or a Github flavored-like markdown. If it's a GitHub flavor, we need to make sure to reflect on the project README that we generate a GitHub-lib markdown. Which is ok to me, since everybody uses Github.

@barbosa
Copy link
Copy Markdown
Member Author

barbosa commented Feb 2, 2020

@djalmaaraujo True. Good point. This is GitHub flavored.

Although tables are not part of the Markdown spec, nowadays the majority of the converters (MD to HTML) support that.

I like the idea of adding that note to the README file.

@barbosa barbosa self-assigned this Feb 2, 2020
@barbosa barbosa force-pushed the feature/beautify-markdown branch from 5afdf52 to 4176c52 Compare March 21, 2020 23:14
@barbosa barbosa marked this pull request as ready for review March 21, 2020 23:14
@barbosa barbosa requested a review from camilamaia March 21, 2020 23:14
@barbosa
Copy link
Copy Markdown
Member Author

barbosa commented Mar 21, 2020

@camilamaia I believe this is enough for now. Later we can make this better.

@camilamaia
Copy link
Copy Markdown
Member

@barbosa would you mind to add an entry to the CHANGELOG.md, please?

@barbosa
Copy link
Copy Markdown
Member Author

barbosa commented Mar 22, 2020

@camilamaia done 👍

@barbosa barbosa merged commit f13b15b into master Mar 22, 2020
@barbosa barbosa deleted the feature/beautify-markdown branch March 22, 2020 20:38
@camilamaia camilamaia mentioned this pull request May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make markdown report pretty

3 participants