Skip to content

Commit

Permalink
Merge pull request #24 from scanapi/23
Browse files Browse the repository at this point in the history
Improve demo-api example
  • Loading branch information
camilamaia authored Jun 11, 2021
2 parents 03cd369 + 82699cd commit a4dc84e
Show file tree
Hide file tree
Showing 25 changed files with 3,579 additions and 4,153 deletions.
2 changes: 1 addition & 1 deletion demo-api/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export BASE_URL="http://demo.scanapi.dev/"
export BASE_URL="http://demo.scanapi.dev/api/v1/"
export USER="guest"
export PASSWORD="demoapi123"
8 changes: 8 additions & 0 deletions demo-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ $ scanapi run scanapi.yaml
```

The report will be available at `scanapi-report.html`

If you also want to test the csv report, run:

```shell
$ scanapi run -t csv_template.jinja -o scanapi-report.csv
```

The `csv` report will be available at `scanapi-report.csv`
24 changes: 24 additions & 0 deletions demo-api/csv_template.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"project_name"{{- "," -}}
"generated_at"{{- "," -}}
"total_successes"{{- "," -}}
"total_failures"{{- "," -}}
"total_errors"{{- "," -}}
"started_at"{{- "," -}}
"total_time"{{- "," -}}
"url"{{- "," -}}
"all_tests_passed"{{- "," -}}
"test_name"
{% for result in results -%}
{% for test in result.tests_results -%}
"{{ project_name }}"{{- "," -}}
"{{ now }}"{{- "," -}}
{{ session.successes }}{{- "," -}}
{{ session.failures }}{{- "," -}}
{{ session.errors }}{{- "," -}}
"{{ session.started_at }}"{{- "," -}}
"{{ session.elapsed_time() }}"{{- "," -}}
"{{ result.response.request.url }}"{{- "," -}}
{{ result.no_failure }}{{- "," -}}
"{{ test.name }}"
{% endfor %}
{%- endfor %}
56 changes: 56 additions & 0 deletions demo-api/scanapi-report.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"project_name","generated_at","total_successes","total_failures","total_errors","started_at","total_time","url","all_tests_passed","test_name"
"Snippets API","2021-06-11 16:08:42",2,0,0,"2021-06-11 16:08:42.404744","0:00:00.716611","http://demo.scanapi.dev/api/v1/health/",True,"snippets-api::health::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",2,0,0,"2021-06-11 16:08:42.404744","0:00:00.716671","http://demo.scanapi.dev/api/v1/health/",True,"snippets-api::health::body_equals_ok"
"Snippets API","2021-06-11 16:08:42",5,0,0,"2021-06-11 16:08:42.404744","0:00:01.639416","http://demo.scanapi.dev/api/v1/rest-auth/login/",True,"snippets-api::get_token::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",5,0,0,"2021-06-11 16:08:42.404744","0:00:01.639474","http://demo.scanapi.dev/api/v1/rest-auth/login/",True,"snippets-api::get_token::key_in_content"
"Snippets API","2021-06-11 16:08:42",5,0,0,"2021-06-11 16:08:42.404744","0:00:01.639519","http://demo.scanapi.dev/api/v1/rest-auth/login/",True,"snippets-api::get_token::response_time_is_under_a_second"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049335","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::status_code_is_201"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049375","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::response_time_is_under_a_second"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049404","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::url_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049431","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::id_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049463","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::highlight_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049546","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::owner_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049590","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::title_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049684","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::code_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049743","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::linenos_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049778","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::language_in_content"
"Snippets API","2021-06-11 16:08:42",16,0,0,"2021-06-11 16:08:42.404744","0:00:02.049805","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::create::style_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561183","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561226","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::response_time_is_under_a_second"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561261","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::url_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561297","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::id_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561378","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::highlight_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561412","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::owner_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561439","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::title_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561466","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::code_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561492","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::linenos_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561517","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::language_in_content"
"Snippets API","2021-06-11 16:08:42",27,0,0,"2021-06-11 16:08:42.404744","0:00:02.561543","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::details::style_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073326","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073384","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::response_time_is_under_a_second"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073425","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::url_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073468","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::id_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073507","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::highlight_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073546","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::owner_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073584","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::title_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073624","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::code_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073664","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::linenos_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073703","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::language_in_content"
"Snippets API","2021-06-11 16:08:42",38,0,0,"2021-06-11 16:08:42.404744","0:00:03.073741","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::update_with_patch::style_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585101","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585135","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::response_time_is_under_a_second"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585156","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::url_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585176","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::id_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585196","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::highlight_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585215","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::owner_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585237","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::title_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585257","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::code_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585277","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::linenos_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585296","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::language_in_content"
"Snippets API","2021-06-11 16:08:42",49,0,0,"2021-06-11 16:08:42.404744","0:00:03.585330","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::snippet_update_with_put::style_in_content"
"Snippets API","2021-06-11 16:08:42",50,0,0,"2021-06-11 16:08:42.404744","0:00:04.099079","http://demo.scanapi.dev/api/v1/snippets/232/",True,"snippets-api::snippets::delete::status_code_is_204"
"Snippets API","2021-06-11 16:08:42",51,0,0,"2021-06-11 16:08:42.404744","0:00:04.710953","http://demo.scanapi.dev/api/v1/snippets/",True,"snippets-api::snippets::list_all::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",53,0,0,"2021-06-11 16:08:42.404744","0:00:05.157615","http://demo.scanapi.dev/api/v1/users/",True,"snippets-api::users::list_all::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",53,0,0,"2021-06-11 16:08:42.404744","0:00:05.157654","http://demo.scanapi.dev/api/v1/users/",True,"snippets-api::users::list_all::response_time_is_under_a_second"
"Snippets API","2021-06-11 16:08:42",55,0,0,"2021-06-11 16:08:42.404744","0:00:05.631883","http://demo.scanapi.dev/api/v1/users/2/",True,"snippets-api::users::details::status_code_is_200"
"Snippets API","2021-06-11 16:08:42",55,0,0,"2021-06-11 16:08:42.404744","0:00:05.631921","http://demo.scanapi.dev/api/v1/users/2/",True,"snippets-api::users::details::response_time_is_under_a_second"
Loading

0 comments on commit a4dc84e

Please sign in to comment.