Skip to content

Commit b894916

Browse files
authored
cherry-pick(#28198): feat(recorder): UX updates for assertion tools (#28202)
- No locator editor. - No value editor for `toHaveValue`. - Visual feedback for `toBeVisible`/`toHaveValue`. - UI tweaks.
1 parent 59e8f48 commit b894916

File tree

6 files changed

+104
-161
lines changed

6 files changed

+104
-161
lines changed

docs/src/release-notes-csharp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toc_max_heading_level: 2
88

99
### Test Generator Update
1010

11-
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/8c3d6fac-5381-4aaf-920f-6e22b964eec6)
11+
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/e8d67e2e-f36d-4301-8631-023948d3e190)
1212

1313
New tools to generate assertions:
1414
- "Assert visibility" tool generates [`method: LocatorAssertions.toBeVisible`].

docs/src/release-notes-java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toc_max_heading_level: 2
88

99
### Test Generator Update
1010

11-
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/8c3d6fac-5381-4aaf-920f-6e22b964eec6)
11+
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/e8d67e2e-f36d-4301-8631-023948d3e190)
1212

1313
New tools to generate assertions:
1414
- "Assert visibility" tool generates [`method: LocatorAssertions.toBeVisible`].

docs/src/release-notes-js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import LiteYouTube from '@site/src/components/LiteYouTube';
1010

1111
### Test Generator Update
1212

13-
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/8c3d6fac-5381-4aaf-920f-6e22b964eec6)
13+
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/e8d67e2e-f36d-4301-8631-023948d3e190)
1414

1515
New tools to generate assertions:
1616
- "Assert visibility" tool generates [`method: LocatorAssertions.toBeVisible`].

docs/src/release-notes-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toc_max_heading_level: 2
88

99
### Test Generator Update
1010

11-
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/8c3d6fac-5381-4aaf-920f-6e22b964eec6)
11+
![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/e8d67e2e-f36d-4301-8631-023948d3e190)
1212

1313
New tools to generate assertions:
1414
- "Assert visibility" tool generates [`method: LocatorAssertions.toBeVisible`].

packages/playwright-core/src/server/injected/highlight.css

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ x-pw-dialog {
4444
display: flex;
4545
flex-direction: column;
4646
position: absolute;
47-
width: 500px;
48-
height: 200px;
47+
width: 400px;
48+
height: 150px;
4949
z-index: 10;
50+
font-size: 13px;
5051
}
5152

5253
x-pw-dialog-body {
@@ -217,6 +218,15 @@ x-pw-tool-item.cancel > x-div {
217218
mask-image: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='currentColor'><path d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");
218219
}
219220

221+
x-pw-tool-item.succeeded > x-div {
222+
/* codicon: pass */
223+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' fill='currentColor'><path d='M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z'/><path fill-rule='evenodd' clip-rule='evenodd' d='M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z'/></svg>") !important;
224+
mask-image: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' fill='currentColor'><path d='M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z'/><path fill-rule='evenodd' clip-rule='evenodd' d='M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z'/></svg>") !important;
225+
background-color: #388a34 !important;
226+
-webkit-mask-size: 18px !important;
227+
mask-size: 18px !important;
228+
}
229+
220230
x-pw-overlay {
221231
position: absolute;
222232
top: 0;
@@ -238,13 +248,15 @@ x-pw-overlay x-pw-tool-item {
238248
}
239249

240250
textarea.text-editor {
241-
font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;
251+
font-family: system-ui,Ubuntu,Droid Sans,sans-serif;
242252
flex: auto;
243253
border: none;
244-
margin: 6px;
254+
margin: 6px 10px;
245255
color: #333;
246-
outline: 1px solid transparent !important;
256+
outline: 1px solid transparent!important;
247257
resize: none;
258+
padding: 0;
259+
font-size: 13px;
248260
}
249261

250262
textarea.text-editor.does-not-match {

0 commit comments

Comments
 (0)