playwright/packages/html-reporter/src/testCaseView.css
Simon Knott 1b457b1ff8
fix(html reporter): render annotation newlines (#32948)
Closes https://github.com/microsoft/playwright/issues/32925. Before this
change, newlines in annotation descriptions weren't respected. This
change makes them shown. Here's how it looks for this annotation:

```ts
test.info().annotations.push({
  type: 'user story',
  description: '\n- user goes to the page\n- user clicks the button\n- user sees the result',
});
```

Before:

<img width="1071" alt="Screenshot 2024-10-04 at 09 55 15"
src="https://github.com/user-attachments/assets/89e74ff5-ea83-48da-a33b-833423916d95">

After:

<img width="1031" alt="Screenshot 2024-10-04 at 09 51 08"
src="https://github.com/user-attachments/assets/0f2914e8-bd88-4970-aa68-6a5a9828295c">
2024-10-04 14:18:38 +02:00

78 lines
1.6 KiB
CSS

/*
Copyright (c) Microsoft Corporation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.test-case-column {
border-radius: 6px;
margin: 24px 0;
}
.test-case-column .tab-element.selected {
font-weight: 600;
border-bottom-color: var(--color-primer-border-active);
}
.test-case-column .tab-element {
border: none;
color: var(--color-fg-default);
border-bottom: 2px solid transparent;
}
.test-case-column .tab-element:hover {
color: var(--color-fg-default);
}
.test-case-title {
flex: none;
padding: 8px;
font-weight: 400;
font-size: 32px !important;
line-height: 1.25 !important;
}
.test-case-location,
.test-case-duration {
flex: none;
align-items: center;
padding: 0 8px 8px;
line-height: 24px;
}
.test-case-path {
flex: none;
align-items: center;
padding: 0 8px;
}
.test-case-annotation {
flex: none;
align-items: center;
padding: 0 8px;
line-height: 24px;
white-space: pre-wrap;
}
@media only screen and (max-width: 600px) {
.test-case-column {
border-radius: 0 !important;
margin: 0 !important;
}
}
.test-case-project-labels-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}