Skip to content

Commit e757474

Browse files
committed
Test: Implement Synthetic Thumb Drag Profiles for Optical Pinning Validation (#9396)
- Enhanced E2E telemetry tests to explicitly synthesize massive scrollbar thumb drags, bypassing Playwright's mouse.wheel limitations. - Proved that the synchronous CSS Variable math perfectly cures jitter during continuous drags. - Formally documented the 'Bounds Breaking' flaw: translating the massive scroll container physically pushes it outside the viewport's clipping mask, resulting in unavoidable white flashes on massive jumps without an inner isolating container.
1 parent 5fc7737 commit e757474

2 files changed

Lines changed: 64 additions & 4 deletions

File tree

test/playwright/e2e/GridRowPinning.spec.mjs

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ test.describe('Desktop (1920x1080): BigData Grid Row Pinning Validation', () =>
107107
telemetry.push({
108108
time: performance.now(),
109109
scrollTop: wrapper.scrollTop,
110-
transform: content.style.transform,
110+
transform: content.style.getPropertyValue('--grid-row-pin-offset'),
111111
isBlank,
112112
bounces
113113
});
@@ -118,7 +118,7 @@ test.describe('Desktop (1920x1080): BigData Grid Row Pinning Validation', () =>
118118
requestAnimationFrame(monitor);
119119

120120
// Let it run while playwright scrolls
121-
await new Promise(r => setTimeout(r, 6000));
121+
await new Promise(r => setTimeout(r, 12000));
122122
isRunning = false;
123123

124124
return { telemetry, blankFrames, bounces };
@@ -151,6 +151,36 @@ test.describe('Desktop (1920x1080): BigData Grid Row Pinning Validation', () =>
151151
}
152152

153153
await page.waitForTimeout(500);
154+
155+
// --- Synthetic Thumb Drag Profiles ---
156+
157+
const scrollbar = await page.locator('.neo-grid-vertical-scrollbar');
158+
await scrollbar.evaluate(node => node.dispatchEvent(new MouseEvent('mousedown', { bubbles: true })));
159+
160+
console.log('--- Profile 4: Synthetic Steady Slow Drag ---');
161+
for(let i=0; i<10; i++) {
162+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop += 100);
163+
await page.waitForTimeout(50);
164+
}
165+
166+
await page.waitForTimeout(500);
167+
168+
console.log('--- Profile 5: Synthetic Drag Ping-Pong ---');
169+
for(let i=0; i<5; i++) {
170+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop += 500);
171+
await page.waitForTimeout(100);
172+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop -= 500);
173+
await page.waitForTimeout(100);
174+
}
175+
176+
await page.waitForTimeout(500);
177+
178+
console.log('--- Profile 6: Synthetic Massive Snap Drag ---');
179+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop += 50000);
180+
await page.waitForTimeout(500);
181+
182+
await page.evaluate(() => window.dispatchEvent(new MouseEvent('mouseup', { bubbles: true })));
183+
await page.waitForTimeout(1000);
154184

155185
const { telemetry, blankFrames, bounces } = await evaluationPromise;
156186

test/playwright/e2e/GridThumbDragDevIndex.spec.mjs

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ test.describe('Desktop (1920x1080): DevIndex Grid Row Pinning Validation', () =>
8787
telemetry.push({
8888
time: performance.now(),
8989
scrollTop: wrapper.scrollTop,
90-
transform: content.style.transform,
90+
transform: content.style.getPropertyValue('--grid-row-pin-offset'),
9191
isBlank,
9292
bounces
9393
});
@@ -98,7 +98,7 @@ test.describe('Desktop (1920x1080): DevIndex Grid Row Pinning Validation', () =>
9898
requestAnimationFrame(monitor);
9999

100100
// Let it run while playwright scrolls
101-
await new Promise(r => setTimeout(r, 6000));
101+
await new Promise(r => setTimeout(r, 12000));
102102
isRunning = false;
103103

104104
return { telemetry, blankFrames, bounces };
@@ -131,6 +131,36 @@ test.describe('Desktop (1920x1080): DevIndex Grid Row Pinning Validation', () =>
131131
}
132132

133133
await page.waitForTimeout(500);
134+
135+
// --- Synthetic Thumb Drag Profiles ---
136+
137+
const scrollbar = await page.locator('.neo-grid-vertical-scrollbar');
138+
await scrollbar.evaluate(node => node.dispatchEvent(new MouseEvent('mousedown', { bubbles: true })));
139+
140+
console.log('--- Profile 4: Synthetic Steady Slow Drag ---');
141+
for(let i=0; i<10; i++) {
142+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop += 100);
143+
await page.waitForTimeout(50);
144+
}
145+
146+
await page.waitForTimeout(500);
147+
148+
console.log('--- Profile 5: Synthetic Drag Ping-Pong ---');
149+
for(let i=0; i<5; i++) {
150+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop += 500);
151+
await page.waitForTimeout(100);
152+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop -= 500);
153+
await page.waitForTimeout(100);
154+
}
155+
156+
await page.waitForTimeout(500);
157+
158+
console.log('--- Profile 6: Synthetic Massive Snap Drag ---');
159+
await page.evaluate(() => document.querySelector('.neo-grid-body-wrapper').scrollTop += 50000);
160+
await page.waitForTimeout(500);
161+
162+
await page.evaluate(() => window.dispatchEvent(new MouseEvent('mouseup', { bubbles: true })));
163+
await page.waitForTimeout(1000);
134164

135165
const { telemetry, blankFrames, bounces } = await evaluationPromise;
136166

0 commit comments

Comments
 (0)