Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape special characters in SimpleReport **Subject section only** #2283

Closed
Au6ojlut opened this issue May 14, 2023 Discussed in #2279 · 1 comment · Fixed by #2284
Closed

Escape special characters in SimpleReport **Subject section only** #2283

Au6ojlut opened this issue May 14, 2023 Discussed in #2279 · 1 comment · Fixed by #2284

Comments

@Au6ojlut
Copy link
Contributor

Discussed in #2279

Originally posted by Au6ojlut May 10, 2023
In case of multi-line text condition the report looks a bit ugly

+----------------------------------------------------+-------------------------------------------------+------------+------------+
| Element                                            | Subject                                         | Status     | ms.        |
+----------------------------------------------------+-------------------------------------------------+------------+------------+
| open                                               | about:blank                                     | PASS       | 100        |
| #any-long-ugly-selector-should-be-entirely-visible | should have(text "Not big
but
multiline")       | PASS       | 100        |
| close                                              |                                                 | PASS       | 100        |
+----------------------------------------------------+-------------------------------------------------+------------+------------+

so, the idea is to escape all special characters in report, so it become smth like

  +----------------------------------------------------+---------------------------------------------------+------------+------------+
| Element                                            | Subject                                           | Status     | ms.        |
+----------------------------------------------------+---------------------------------------------------+------------+------------+
| open                                               | about:blank                                       | PASS       | 100        |
| #any-long-ugly-selector-should-be-entirely-visible | should have(text "Not big\nbut\nmultiline")       | PASS       | 100        |
| close                                              |                                                   | PASS       | 100        |
+----------------------------------------------------+---------------------------------------------------+------------+------------+

The replace rule is very simple

\n -> \\n
\t -> \\t
\r -> \\r
\f -> \\f
and so on
```</div>
Au6ojlut added a commit to Au6ojlut/selenide that referenced this issue May 14, 2023
For example, in case of new line in subject the report schema is broken and all report start looks ugly.

We need to escape characters before the line length computing.
Au6ojlut added a commit to Au6ojlut/selenide that referenced this issue May 14, 2023
For example, in case of new line in subject the report schema is broken and all the report starts look ugly.

We need to escape characters before the line length computing.
@asolntsev asolntsev self-assigned this May 14, 2023
@asolntsev asolntsev added this to the 6.15.0 milestone May 14, 2023
Au6ojlut added a commit to Au6ojlut/selenide that referenced this issue May 14, 2023
Also escape '\u00A0' aka "no-break space"
asolntsev pushed a commit that referenced this issue May 23, 2023
For example, in case of new line in subject the report schema is broken and all the report starts look ugly.

We need to escape characters before the line length computing.
asolntsev pushed a commit that referenced this issue May 23, 2023
Also escape '\u00A0' aka "no-break space"
@asolntsev asolntsev linked a pull request May 28, 2023 that will close this issue
3 tasks
@asolntsev
Copy link
Member

Fixed in PR #2284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants