Skip to content

Commit 1f24eb2

Browse files
OrKoNDevtools-frontend LUCI CQ
authored andcommitted
[Recorder] Fix and re-enable flaky tests
Fixed some things and the tests appear not to be so flaky anymore. Fixed: 40188140, 40072140, 40279056, 40911162, 40911160 Change-Id: Ie7d600c0514d6dbffa94bfc6cf7b585567630dcc Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6072804 Commit-Queue: Simon Zünd <[email protected]> Reviewed-by: Simon Zünd <[email protected]> Auto-Submit: Alex Rudenko <[email protected]>
1 parent cc17322 commit 1f24eb2

File tree

4 files changed

+95
-17
lines changed

4 files changed

+95
-17
lines changed

front_end/panels/recorder/models/SchemaUtils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ export function createEmulateNetworkConditionsStep(conditions: {
3131
upload: number,
3232
latency: number,
3333
}): EmulateNetworkConditionsStep {
34-
return {type: StepType.EmulateNetworkConditions, ...conditions};
34+
return {
35+
type: StepType.EmulateNetworkConditions,
36+
download: conditions.download,
37+
upload: conditions.upload,
38+
latency: conditions.latency,
39+
};
3540
}
3641

3742
export function areSelectorsEqual(stepA: Step, stepB: Step): boolean {

test/e2e/recorder/recorder_test.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,85 @@
473473
}
474474
]
475475
},
476+
"Recorder should also record network conditions - 1": {
477+
"title": "New Recording",
478+
"steps": [
479+
{
480+
"type": "emulateNetworkConditions",
481+
"download": 50000,
482+
"upload": 50000,
483+
"latency": 2000
484+
},
485+
{
486+
"type": "setViewport",
487+
"width": 1280,
488+
"height": 720,
489+
"deviceScaleFactor": 1,
490+
"isMobile": false,
491+
"hasTouch": false,
492+
"isLandscape": false
493+
},
494+
{
495+
"type": "navigate",
496+
"url": "https://localhost:<test-port>/test/e2e/resources/recorder/recorder.html",
497+
"assertedEvents": [
498+
{
499+
"type": "navigation",
500+
"url": "https://localhost:<test-port>/test/e2e/resources/recorder/recorder.html",
501+
"title": ""
502+
}
503+
]
504+
},
505+
{
506+
"type": "click",
507+
"target": "main",
508+
"selectors": [
509+
[
510+
"aria/Test Button"
511+
],
512+
[
513+
"#test"
514+
],
515+
[
516+
"xpath///*[@id=\"test\"]"
517+
],
518+
[
519+
"pierce/#test"
520+
],
521+
[
522+
"text/Test Button"
523+
]
524+
]
525+
},
526+
{
527+
"type": "emulateNetworkConditions",
528+
"download": 180000,
529+
"upload": 84375,
530+
"latency": 562.5
531+
},
532+
{
533+
"type": "click",
534+
"target": "main",
535+
"selectors": [
536+
[
537+
"aria/Test Button"
538+
],
539+
[
540+
"#test"
541+
],
542+
[
543+
"xpath///*[@id=\"test\"]"
544+
],
545+
[
546+
"pierce/#test"
547+
],
548+
[
549+
"text/Test Button"
550+
]
551+
]
552+
}
553+
]
554+
},
476555
"Recorder should create an aria selector even if the element is within a shadow root - 1": {
477556
"title": "New Recording",
478557
"steps": [

test/e2e/recorder/recorder_test.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,17 @@ describe('Recorder', function() {
256256
assertRecordingMatchesSnapshot(recording);
257257
});
258258

259-
// TODO: remove flakiness from recording network conditions.
260-
it.skip('[crbug.com/1224832]: should also record network conditions', async () => {
259+
it('should also record network conditions', async () => {
261260
await startRecording('recorder/recorder.html', {
262-
networkCondition: 'Fast 3G',
261+
networkCondition: '3G',
263262
});
264263

265264
const {frontend, target} = getBrowserAndPages();
266265
await target.bringToFront();
267266
await target.click('#test');
268267
await frontend.bringToFront();
269-
await changeNetworkConditions('Slow 3G');
268+
await changeNetworkConditions('Slow 4G');
269+
await raf(frontend);
270270
await openRecorderPanel();
271271
await target.bringToFront();
272272
await target.click('#test');
@@ -295,7 +295,7 @@ describe('Recorder', function() {
295295
});
296296

297297
// Blocking Chromium PINS roll
298-
it.skip('[crbug.com/1482078] should capture keyboard events on non-text inputs', async () => {
298+
it('should capture keyboard events on non-text inputs', async () => {
299299
await startRecording('recorder/input.html', {untrustedEvents: true});
300300

301301
const {target} = getBrowserAndPages();
@@ -328,9 +328,7 @@ describe('Recorder', function() {
328328
assertRecordingMatchesSnapshot(recording);
329329
});
330330

331-
// skipped until we figure out why the keyup for Enter is not recorded in
332-
// 1% of the runs.
333-
it.skip('[crbug.com/1473597] should capture a change that causes navigation without blur or change', async () => {
331+
it('should capture a change that causes navigation without blur or change', async () => {
334332
await startRecording('recorder/programmatic-navigation-on-keydown.html');
335333

336334
const {target} = getBrowserAndPages();
@@ -425,8 +423,7 @@ describe('Recorder', function() {
425423
await waitFor('.section .screenshot');
426424
});
427425

428-
// Flaky test
429-
it.skip('[crbug.com/1443423]: should record interactions with popups', async () => {
426+
it('should record interactions with popups', async () => {
430427
await startRecording('recorder/recorder.html', {untrustedEvents: true});
431428

432429
const {target, browser} = getBrowserAndPages();

test/e2e/recorder/ui_test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ describe('Recorder', function() {
176176
await waitFor('.expanded');
177177
}
178178

179-
// Flaky test
180-
it.skip('[crbug.com/1443421]: should select through the selector picker', async () => {
179+
it('should select through the selector picker', async () => {
181180
const {target, frontend} = getBrowserAndPages();
182181
await frontend.bringToFront();
183182
await frontend.waitForSelector('pierce/.settings');
@@ -196,8 +195,7 @@ describe('Recorder', function() {
196195
assertRecordingMatchesSnapshot(recording);
197196
});
198197

199-
// Flaky test
200-
it.skip('[crbug.com/1443421]: should select through the selector picker twice', async () => {
198+
it('should select through the selector picker twice', async () => {
201199
const {target, frontend} = getBrowserAndPages();
202200
await frontend.bringToFront();
203201
await frontend.waitForSelector('pierce/.settings');
@@ -226,8 +224,7 @@ describe('Recorder', function() {
226224
assertRecordingMatchesSnapshot(recording);
227225
});
228226

229-
// Flaky test
230-
it.skip('[crbug.com/1443421]: should select through the selector picker during recording', async () => {
227+
it('should select through the selector picker during recording', async () => {
231228
const {target, frontend} = getBrowserAndPages();
232229
await frontend.bringToFront();
233230
await frontend.waitForSelector('pierce/.settings');

0 commit comments

Comments
 (0)