Skip to content

Commit ee50502

Browse files
Playwright - html padding-right 15px to simulate TestCafe scrollbar (fixes CI screenshot mismatches)
1 parent d70c77d commit ee50502

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

FINISH_REVIEW.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ These components have expanded forEach that need to be collapsed:
6868
- `scheduler/common/` — various files with expanded forEach
6969
- `accessibility/*.matrix.spec.ts` — matrix expansion (OK — mirrors TC testAccessibility pattern)
7070

71-
### Screenshot Dimension Mismatches (CI vs Local)
72-
- TestCafe headless Chrome has 15px scrollbar, Playwright headless has 0px
73-
- ViewOffset uses viewport 1185 (project chromium-1185) to match TC etalons
74-
- Other components use viewport 1200 + `::-webkit-scrollbar` CSS
75-
- Some tests fail on CI but pass locally due to font rendering differences
71+
### Screenshot Dimension Mismatches (CI vs Local) — SOLVED
72+
- **Root cause:** TestCafe headless Chrome has 15px classic scrollbar, Playwright headless Chromium has 0px overlay scrollbar. This made content 15px wider in Playwright, breaking all etalon comparisons.
73+
- **Solution:** `html { padding-right: 15px !important; box-sizing: border-box !important; }` in `container.html`. This simulates the scrollbar space, making body content = 1200 - 16 margin - 15 padding = 1169px — matching TestCafe layout.
74+
- **Known workaround:** This is an intentional CSS hack to match TestCafe headless Chrome behavior. Playwright headless Chromium uses overlay scrollbar (0px) which cannot be changed via CSS. The padding-right approach reserves the same 15px space without affecting visual layout.
75+
- ViewOffset additionally uses viewport 1185 (project chromium-1185) for tests with etalons that depend on full-page width.
7676

7777
### Accessibility Matrix Tests
7878
TC uses `testAccessibility()` which generates N tests per option combination at runtime.

e2e/testcafe-devextreme/tests/container.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222
.dx-scheduler .dx-scrollable-scroll { visibility: hidden !important; }
2323
body:has(#tabPanel) { min-height: 500px; }
2424

25-
/* Match TestCafe headless Chrome scrollbar behavior:
26-
scrollbar appears only on overflow, width 15px when present */
27-
::-webkit-scrollbar { width: 15px !important; }
28-
::-webkit-scrollbar-track { background: transparent !important; }
29-
::-webkit-scrollbar-thumb { background: transparent !important; }
25+
/* Simulate TestCafe headless Chrome 15px scrollbar.
26+
Playwright headless Chromium has overlay scrollbar (0px width),
27+
but TestCafe etalons were captured with 15px classic scrollbar.
28+
padding-right on html reserves 15px, making body content 1169px
29+
instead of 1184px — matching TestCafe layout. */
30+
html { padding-right: 15px !important; box-sizing: border-box !important; }
3031
</style>
3132
</head>
3233
<body class="dx-surface">

0 commit comments

Comments
 (0)