diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5fdfe90d..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2.1 - -executors: - changelog-linter: - working_directory: /home/circleci/project - docker: - - image: rcmachado/changelog:0.6.0 - -jobs: - changelog-lint: - executor: changelog-linter - steps: - - checkout - - run: - name: Lint changelog - command: | - diff CHANGELOG.md <(/changelog fmt CHANGELOG.md) --color -u - -workflows: - version: 2 - main: - jobs: - - changelog-lint diff --git a/CHANGELOG.md b/CHANGELOG.md index 38fdd2a8..59a2ac75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.8.1] - 2023-03-04 +### Fixed +- Content field not rendered properly on Chrome [#551](https://github.com/scanapi/scanapi/issues/551) + ## [2.8.1] - 2023-03-02 ### Fixed - Custom variable evaluated when defined on the path [#508](https://github.com/scanapi/scanapi/issues/508) @@ -255,7 +259,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix vars interpolation. -[Unreleased]: https://github.com/scanapi/scanapi/compare/v2.8.1...HEAD +[Unreleased]: https://github.com/scanapi/scanapi/compare/v2.8.2...HEAD +[2.8.2]: https://github.com/scanapi/scanapi/compare/v2.8.1...v2.8.2 [2.8.1]: https://github.com/scanapi/scanapi/compare/v2.8.0...v2.8.1 [2.8.0]: https://github.com/scanapi/scanapi/compare/v2.7.0...v2.8.0 [2.7.0]: https://github.com/scanapi/scanapi/compare/v2.6.2...v2.7.0 diff --git a/Dockerfile b/Dockerfile index bc54f3b5..27a73d0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ENV PATH="~/.local/bin:${PATH}" RUN pip install pip setuptools --upgrade -RUN pip install scanapi==2.8.1 +RUN pip install scanapi==2.8.2 COPY . /app diff --git a/poetry.lock b/poetry.lock index 01862833..142d44ea 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. [[package]] name = "alabaster" @@ -472,7 +472,7 @@ Click = [ ] sh = [ {version = ">=1.13.0", markers = "sys_platform != \"win32\""}, - {version = "1.14.2", optional = true, markers = "sys_platform != \"win32\""}, + {version = "1.14.2", optional = true, markers = "sys_platform != \"win32\" and extra == \"trusted-deps\""}, ] [package.extras] @@ -1147,20 +1147,20 @@ tests = ["coverage (>=3.7.1,<6.0.0)", "flake8", "pytest (>=4.6)", "pytest (>=4.6 [[package]] name = "rich" -version = "12.1.0" +version = "12.2.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" category = "main" optional = false -python-versions = ">=3.6.2,<4.0.0" +python-versions = ">=3.6.3,<4.0.0" files = [ - {file = "rich-12.1.0-py3-none-any.whl", hash = "sha256:b60ff99f4ff7e3d1d37444dee2b22fdd941c622dbc37841823ec1ce7f058b263"}, - {file = "rich-12.1.0.tar.gz", hash = "sha256:198ae15807a7c1bf84ceabf662e902731bf8f874f9e775e2289cab02bb6a4e30"}, + {file = "rich-12.2.0-py3-none-any.whl", hash = "sha256:c50f3d253bc6a9bb9c79d61a26d510d74abdf1b16881260fab5edfc3edfb082f"}, + {file = "rich-12.2.0.tar.gz", hash = "sha256:ea74bc9dad9589d8eea3e3fd0b136d8bf6e428888955f215824c2894f0da8b47"}, ] [package.dependencies] commonmark = ">=0.9.0,<0.10.0" pygments = ">=2.6.0,<3.0.0" -typing-extensions = {version = ">=3.7.4,<5.0", markers = "python_version < \"3.9\""} +typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] @@ -1498,15 +1498,14 @@ files = [ [[package]] name = "typing-extensions" -version = "3.10.0.0" -description = "Backported and Experimental Type Hints for Python 3.5+" +version = "4.5.0" +description = "Backported and Experimental Type Hints for Python 3.7+" category = "main" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, - {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, - {file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"}, + {file = "typing_extensions-4.5.0-py3-none-any.whl", hash = "sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4"}, + {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, ] [[package]] @@ -1569,4 +1568,4 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black ( [metadata] lock-version = "2.0" python-versions = ">=3.7.13,<4.0.0" -content-hash = "ad53469aebb9b3d724b197979ae5a7065e893e124ca7f56f209c35ec75965c8b" +content-hash = "573fd86eed0a933c9415ed853a629b8dfba61f4a90ef3335c2925d9f12d4a1e9" diff --git a/pyproject.toml b/pyproject.toml index 8d6bff36..a9cbf752 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "scanapi" -version = "2.8.1" +version = "2.8.2" description = "Automated Testing and Documentation for your REST API" authors = ["The ScanAPI Organization "] license = "MIT" @@ -19,7 +19,7 @@ requests = "2.26.0" appdirs = "^1.4.4" curlify2 = "^1.0.1" MarkupSafe = "2.0.1" -rich = "12.1.0" +rich = "12.2.0" PyYAML = "~6.0" Jinja2 = "~3.1.0" click = "8.0.3" diff --git a/scanapi/templates/report.html b/scanapi/templates/report.html index 26d2ed91..4a0ca211 100644 --- a/scanapi/templates/report.html +++ b/scanapi/templates/report.html @@ -677,24 +677,33 @@

Tests Summary

function tryParseJSON(string) { try { - var o = JSON.parse(string); + const o = JSON.parse(string); if (o && typeof o === "object") { return o; } } - catch (e) { console.log("Invalid JSON Body: " + e) } + catch (e) { console.log("Invalid JSON Body: " + e); } return false; - }; + } - for (var i = 0; i < all_json_bodies.length; i++) { - raw_json = all_json_bodies[i].innerText; - parsed_json = tryParseJSON(raw_json) + function decodeHtmlEntities(str) { + const txt = new DOMParser().parseFromString(str, "text/html"); + return txt.documentElement.textContent; + } + + for (const json_body of all_json_bodies) { + let raw_json = json_body.innerText; + if (!raw_json) { + // innerText is empty for hidden elements on Chrome. + raw_json = decodeHtmlEntities(json_body.innerHTML); + } + const parsed_json = tryParseJSON(raw_json); if (parsed_json) { - all_json_bodies[i].innerText = ''; - all_json_bodies[i].appendChild(renderjson(parsed_json)); - all_json_bodies[i].firstElementChild.setAttribute('data-content', raw_json); + json_body.innerText = ''; + json_body.appendChild(renderjson(parsed_json)); + json_body.firstElementChild.setAttribute('data-content', raw_json); } } /* @@ -743,7 +752,7 @@

Tests Summary

}) }) - /* + /* * Copying anchor URL. */