XCTestHTMLReport icon indicating copy to clipboard operation
XCTestHTMLReport copied to clipboard

Line breaks in results

Open Hsilgos opened this issue 5 years ago • 3 comments

We connected gmock framework to XCTest and it represents error with line breaks and sometimes with call stack, for example:

AngleTest.cpp:25: error: -[Angle::angle_values_are_consistent] : Expected: angle_deg + 100 Which is: -300 To be equal to: deg->get_degrees() Which is: -400

We see such representation in xcode's log, in terminal and even in XCTestHTMLReport's log tab. But by some reason not on main page. Main page doesn't represent line breaks and we see it like this:

Assertion Failure: AngleTest.cpp:25: Expected: angle_deg + 100 Which is: -300 To be equal to: deg->get_degrees() Which is: -400 (0s)

Especially it's sad when there is a call stack.

Is there any way to represent the result on main page with line breaks as well?

Hsilgos avatar Dec 05 '19 10:12 Hsilgos

Hi. I'm very glad that project is alive again. Unfortunately this issue is not fixed yet. Locally I've fixed it with adding white-space: pre-wrap; to activity-assertion-failure

Like:

.activity.activity-assertion-failure > p {
    color: red;
    white-space: pre-wrap;
  }

Not sure how correct this fix

Hsilgos avatar Oct 18 '22 14:10 Hsilgos

Thanks @Hsilgos ! I added your suggested change to #297. Feel free to take a look and I'd be happy to merge it in.

tylervick avatar Oct 21 '22 21:10 tylervick

Hi, @tylervick

After short usage I've encountered a small problem. This style is applied to both elements: cell with arrow and detailed description. As result it looks like on screenshot. It's ok for our project as quick workaround, but probably should be improved for perfect solution. I'll try my idea with additional style soon and return with feedback here.

Screenshot 2022-10-18 at 20 58 23

Hsilgos avatar Oct 21 '22 21:10 Hsilgos