/
index.js
1192 lines (1153 loc) · 33.3 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright 2017 Google Inc. All rights reserved.
*
* 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.
*/
const jsBuilder = require('./JSBuilder.js');
const mdBuilder = require('./MDBuilder.js');
const Documentation = require('./Documentation.js');
const Message = require('../Message.js');
const {
MODULES_TO_CHECK_FOR_COVERAGE,
} = require('../../../test/coverage-utils.js');
const EXCLUDE_PROPERTIES = new Set([
'Browser.create',
'Frame.client',
'Headers.fromPayload',
'Page.client',
'Page.create',
'JSHandle.toString',
'TimeoutError.name',
/* These are not actual properties, but a TypeScript generic.
* DocLint incorrectly parses it as a property.
*/
'ElementHandle.ElementType',
'ElementHandle.HandleObjectType',
'JSHandle.HandleObjectType',
]);
/**
* @param {!Page} page
* @param {!Array<!Source>} mdSources
* @returns {!Promise<!Array<!Message>>}
*/
module.exports = async function lint(page, mdSources, jsSources) {
const mdResult = await mdBuilder(page, mdSources);
const jsResult = await jsBuilder(jsSources);
const jsDocumentation = filterJSDocumentation(jsResult.documentation);
const mdDocumentation = mdResult.documentation;
const jsErrors = jsResult.errors;
jsErrors.push(...checkDuplicates(jsDocumentation));
const mdErrors = mdResult.errors;
mdErrors.push(...compareDocumentations(mdDocumentation, jsDocumentation));
mdErrors.push(...checkDuplicates(mdDocumentation));
mdErrors.push(...checkSorting(mdDocumentation));
// Push all errors with proper prefixes
const errors = jsErrors.map((error) => '[JavaScript] ' + error);
errors.push(...mdErrors.map((error) => '[MarkDown] ' + error));
return errors.map((error) => Message.error(error));
};
/**
* @param {!Documentation} doc
* @returns {!Array<string>}
*/
function checkSorting(doc) {
const errors = [];
for (const cls of doc.classesArray) {
const members = cls.membersArray;
// Events should go first.
let eventIndex = 0;
for (
;
eventIndex < members.length && members[eventIndex].kind === 'event';
++eventIndex
);
for (
;
eventIndex < members.length && members[eventIndex].kind !== 'event';
++eventIndex
);
if (eventIndex < members.length)
errors.push(
`Events should go first. Event '${members[eventIndex].name}' in class ${cls.name} breaks order`
);
// Constructor should be right after events and before all other members.
const constructorIndex = members.findIndex(
(member) => member.kind === 'method' && member.name === 'constructor'
);
if (constructorIndex > 0 && members[constructorIndex - 1].kind !== 'event')
errors.push(`Constructor of ${cls.name} should go before other methods`);
// Events should be sorted alphabetically.
for (let i = 0; i < members.length - 1; ++i) {
const member1 = cls.membersArray[i];
const member2 = cls.membersArray[i + 1];
if (member1.kind !== 'event' || member2.kind !== 'event') continue;
if (member1.name > member2.name)
errors.push(
`Event '${member1.name}' in class ${cls.name} breaks alphabetic ordering of events`
);
}
// All other members should be sorted alphabetically.
for (let i = 0; i < members.length - 1; ++i) {
const member1 = cls.membersArray[i];
const member2 = cls.membersArray[i + 1];
if (member1.kind === 'event' || member2.kind === 'event') continue;
if (member1.kind === 'method' && member1.name === 'constructor') continue;
if (member1.name > member2.name) {
let memberName1 = `${cls.name}.${member1.name}`;
if (member1.kind === 'method') memberName1 += '()';
let memberName2 = `${cls.name}.${member2.name}`;
if (member2.kind === 'method') memberName2 += '()';
errors.push(
`Bad alphabetic ordering of ${cls.name} members: ${memberName1} should go after ${memberName2}`
);
}
}
}
return errors;
}
/**
* @param {!Documentation} jsDocumentation
* @returns {!Documentation}
*/
function filterJSDocumentation(jsDocumentation) {
const includedClasses = new Set(Object.keys(MODULES_TO_CHECK_FOR_COVERAGE));
// Filter private classes and methods.
const classes = [];
for (const cls of jsDocumentation.classesArray) {
if (includedClasses && !includedClasses.has(cls.name)) continue;
const members = cls.membersArray.filter(
(member) => !EXCLUDE_PROPERTIES.has(`${cls.name}.${member.name}`)
);
classes.push(new Documentation.Class(cls.name, members));
}
return new Documentation(classes);
}
/**
* @param {!Documentation} doc
* @returns {!Array<string>}
*/
function checkDuplicates(doc) {
const errors = [];
const classes = new Set();
// Report duplicates.
for (const cls of doc.classesArray) {
if (classes.has(cls.name))
errors.push(`Duplicate declaration of class ${cls.name}`);
classes.add(cls.name);
const members = new Set();
for (const member of cls.membersArray) {
if (members.has(member.kind + ' ' + member.name))
errors.push(
`Duplicate declaration of ${member.kind} ${cls.name}.${member.name}()`
);
members.add(member.kind + ' ' + member.name);
const args = new Set();
for (const arg of member.argsArray) {
if (args.has(arg.name))
errors.push(
`Duplicate declaration of argument ${cls.name}.${member.name} "${arg.name}"`
);
args.add(arg.name);
}
}
}
return errors;
}
// All the methods from our EventEmitter that we don't document for each subclass.
const EVENT_LISTENER_METHODS = new Set([
'emit',
'listenerCount',
'off',
'on',
'once',
'removeListener',
'addListener',
'removeAllListeners',
]);
/* Methods that are defined in code but are not documented */
const expectedNotFoundMethods = new Map([
['Browser', EVENT_LISTENER_METHODS],
['BrowserContext', EVENT_LISTENER_METHODS],
['CDPSession', EVENT_LISTENER_METHODS],
['Page', EVENT_LISTENER_METHODS],
['WebWorker', EVENT_LISTENER_METHODS],
]);
/**
* @param {!Documentation} actual
* @param {!Documentation} expected
* @returns {!Array<string>}
*/
function compareDocumentations(actual, expected) {
const errors = [];
const actualClasses = Array.from(actual.classes.keys()).sort();
const expectedClasses = Array.from(expected.classes.keys()).sort();
const classesDiff = diff(actualClasses, expectedClasses);
/* These have been moved onto PuppeteerNode but we want to document them under
* Puppeteer. See https://github.com/puppeteer/puppeteer/pull/6504 for details.
*/
const expectedPuppeteerClassMissingMethods = new Set([
'createBrowserFetcher',
'defaultArgs',
'executablePath',
'launch',
]);
for (const className of classesDiff.extra)
errors.push(`Non-existing class found: ${className}`);
for (const className of classesDiff.missing) {
if (className === 'PuppeteerNode') {
continue;
}
errors.push(`Class not found: ${className}`);
}
for (const className of classesDiff.equal) {
const actualClass = actual.classes.get(className);
const expectedClass = expected.classes.get(className);
const actualMethods = Array.from(actualClass.methods.keys()).sort();
const expectedMethods = Array.from(expectedClass.methods.keys()).sort();
const methodDiff = diff(actualMethods, expectedMethods);
for (const methodName of methodDiff.extra) {
if (
expectedPuppeteerClassMissingMethods.has(methodName) &&
actualClass.name === 'Puppeteer'
) {
continue;
}
errors.push(`Non-existing method found: ${className}.${methodName}()`);
}
for (const methodName of methodDiff.missing) {
const missingMethodsForClass = expectedNotFoundMethods.get(className);
if (missingMethodsForClass && missingMethodsForClass.has(methodName))
continue;
errors.push(`Method not found: ${className}.${methodName}()`);
}
for (const methodName of methodDiff.equal) {
const actualMethod = actualClass.methods.get(methodName);
const expectedMethod = expectedClass.methods.get(methodName);
if (!actualMethod.type !== !expectedMethod.type) {
if (actualMethod.type)
errors.push(
`Method ${className}.${methodName} has unneeded description of return type`
);
else
errors.push(
`Method ${className}.${methodName} is missing return type description`
);
} else if (actualMethod.hasReturn) {
checkType(
`Method ${className}.${methodName} has the wrong return type: `,
actualMethod.type,
expectedMethod.type
);
}
const actualArgs = Array.from(actualMethod.args.keys());
const expectedArgs = Array.from(expectedMethod.args.keys());
const argsDiff = diff(actualArgs, expectedArgs);
if (argsDiff.extra.length || argsDiff.missing.length) {
/* Doclint cannot handle the parameter type of the CDPSession send method.
* so we just ignore it.
*/
const isCdpSessionSend =
className === 'CDPSession' && methodName === 'send';
if (!isCdpSessionSend) {
const text = [
`Method ${className}.${methodName}() fails to describe its parameters:`,
];
for (const arg of argsDiff.missing)
text.push(`- Argument not found: ${arg}`);
for (const arg of argsDiff.extra)
text.push(`- Non-existing argument found: ${arg}`);
errors.push(text.join('\n'));
}
}
for (const arg of argsDiff.equal)
checkProperty(
`Method ${className}.${methodName}()`,
actualMethod.args.get(arg),
expectedMethod.args.get(arg)
);
}
const actualProperties = Array.from(actualClass.properties.keys()).sort();
const expectedProperties = Array.from(
expectedClass.properties.keys()
).sort();
const propertyDiff = diff(actualProperties, expectedProperties);
for (const propertyName of propertyDiff.extra) {
if (className === 'Puppeteer' && propertyName === 'product') {
continue;
}
errors.push(`Non-existing property found: ${className}.${propertyName}`);
}
for (const propertyName of propertyDiff.missing)
errors.push(`Property not found: ${className}.${propertyName}`);
const actualEvents = Array.from(actualClass.events.keys()).sort();
const expectedEvents = Array.from(expectedClass.events.keys()).sort();
const eventsDiff = diff(actualEvents, expectedEvents);
for (const eventName of eventsDiff.extra)
errors.push(
`Non-existing event found in class ${className}: '${eventName}'`
);
for (const eventName of eventsDiff.missing)
errors.push(`Event not found in class ${className}: '${eventName}'`);
}
/**
* @param {string} source
* @param {!Documentation.Member} actual
* @param {!Documentation.Member} expected
*/
function checkProperty(source, actual, expected) {
checkType(source + ' ' + actual.name, actual.type, expected.type);
}
/**
* @param {string} source
* @param {!string} actualName
* @param {!string} expectedName
*/
function namingMisMatchInTypeIsExpected(source, actualName, expectedName) {
/* The DocLint tooling doesn't deal well with generics in TypeScript
* source files. We could fix this but the longterm plan is to
* auto-generate documentation from TS. So instead we document here
* the methods that use generics that DocLint trips up on and if it
* finds a mismatch that matches one of the cases below it doesn't
* error. This still means we're protected from accidental changes, as
* if the mismatch doesn't exactly match what's described below
* DocLint will fail.
*/
const expectedNamingMismatches = new Map([
[
'Method CDPSession.send() method',
{
actualName: 'string',
expectedName: 'T',
},
],
[
'Method CDPSession.send() params',
{
actualName: 'Object',
expectedName: 'CommandParameters[T]',
},
],
[
'Method ElementHandle.click() options',
{
actualName: 'Object',
expectedName: 'ClickOptions',
},
],
[
'Method ElementHandle.clickablePoint() offset',
{
actualName: 'Object',
expectedName: 'Offset',
},
],
[
'Method ElementHandle.press() options',
{
actualName: 'Object',
expectedName: 'PressOptions',
},
],
[
'Method ElementHandle.press() key',
{
actualName: 'string',
expectedName: 'KeyInput',
},
],
[
'Method ElementHandle.drag() target',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method ElementHandle.dragAndDrop() target',
{
actualName: 'ElementHandle',
expectedName: 'ElementHandle<Element>',
},
],
[
'Method ElementHandle.dragEnter() data',
{
actualName: 'Object',
expectedName: 'Protocol.Input.DragData',
},
],
[
'Method ElementHandle.dragOver() data',
{
actualName: 'Object',
expectedName: 'Protocol.Input.DragData',
},
],
[
'Method ElementHandle.drop() data',
{
actualName: 'Object',
expectedName: 'Protocol.Input.DragData',
},
],
[
'Method ElementHandle.screenshot() options',
{
actualName: 'Object',
expectedName: 'ScreenshotOptions',
},
],
[
'Method Keyboard.down() key',
{
actualName: 'string',
expectedName: 'KeyInput',
},
],
[
'Method Keyboard.press() key',
{
actualName: 'string',
expectedName: 'KeyInput',
},
],
[
'Method Keyboard.up() key',
{
actualName: 'string',
expectedName: 'KeyInput',
},
],
[
'Method Mouse.down() options',
{
actualName: 'Object',
expectedName: 'MouseOptions',
},
],
[
'Method Mouse.drag() start',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.drag() target',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.dragAndDrop() start',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.dragAndDrop() target',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.dragAndDrop() target',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.dragEnter() target',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.dragEnter() data',
{
actualName: 'Object',
expectedName: 'Protocol.Input.DragData',
},
],
[
'Method Mouse.dragOver() target',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.dragOver() data',
{
actualName: 'Object',
expectedName: 'Protocol.Input.DragData',
},
],
[
'Method Mouse.drop() target',
{
actualName: 'Object',
expectedName: 'Point',
},
],
[
'Method Mouse.drop() data',
{
actualName: 'Object',
expectedName: 'Protocol.Input.DragData',
},
],
[
'Method Mouse.up() options',
{
actualName: 'Object',
expectedName: 'MouseOptions',
},
],
[
'Method Mouse.wheel() options',
{
actualName: 'Object',
expectedName: 'MouseWheelOptions',
},
],
[
'Method Tracing.start() options',
{
actualName: 'Object',
expectedName: 'TracingOptions',
},
],
[
'Method Frame.waitForSelector() options',
{
actualName: 'Object',
expectedName: 'WaitForSelectorOptions',
},
],
[
'Method Frame.waitForXPath() options',
{
actualName: 'Object',
expectedName: 'WaitForSelectorOptions',
},
],
[
'Method HTTPRequest.abort() errorCode',
{
actualName: 'string',
expectedName: 'ErrorCode',
},
],
[
'Method Frame.goto() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Frame.waitForNavigation() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Frame.setContent() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Puppeteer.defaultArgs() options',
{
actualName: 'Object',
expectedName: 'ChromeArgOptions',
},
],
[
'Method Page.goBack() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Page.goForward() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Page.goto() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Page.reload() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Page.setContent() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Page.waitForNavigation() options.waitUntil',
{
actualName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array',
expectedName:
'"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|Array<PuppeteerLifeCycleEvent>',
},
],
[
'Method Browser.createIncognitoBrowserContext() options',
{
actualName: 'Object',
expectedName: 'BrowserContextOptions',
},
],
[
'Method BrowserContext.overridePermissions() permissions',
{
actualName: 'Array<string>',
expectedName: 'Array<PermissionType>',
},
],
[
'Method Puppeteer.createBrowserFetcher() options',
{
actualName: 'Object',
expectedName: 'BrowserFetcherOptions',
},
],
[
'Method Page.authenticate() credentials',
{
actualName: 'Object',
expectedName: 'Credentials',
},
],
[
'Method Page.emulateMediaFeatures() features',
{
actualName: 'Array<Object>',
expectedName: 'Array<MediaFeature>',
},
],
[
'Method Page.emulate() options.viewport',
{
actualName: 'Object',
expectedName: 'Viewport',
},
],
[
'Method Page.emulateNetworkConditions() networkConditions',
{
actualName: 'Object',
expectedName: 'NetworkConditions',
},
],
[
'Method Page.setUserAgent() userAgentMetadata',
{
actualName: 'Object',
expectedName: 'Protocol.Emulation.UserAgentMetadata',
},
],
[
'Method Page.setViewport() options.viewport',
{
actualName: 'Object',
expectedName: 'Viewport',
},
],
[
'Method Page.setViewport() viewport',
{
actualName: 'Object',
expectedName: 'Viewport',
},
],
[
'Method Page.connect() options.defaultViewport',
{
actualName: 'Object',
expectedName: 'Viewport',
},
],
[
'Method Puppeteer.connect() options.defaultViewport',
{
actualName: 'Object',
expectedName: 'Viewport',
},
],
[
'Method Puppeteer.launch() options.defaultViewport',
{
actualName: 'Object',
expectedName: 'Viewport',
},
],
[
'Method Page.launch() options.defaultViewport',
{
actualName: 'Object',
expectedName: 'Viewport',
},
],
[
'Method Page.goBack() options',
{
actualName: 'Object',
expectedName: 'WaitForOptions',
},
],
[
'Method Page.goForward() options',
{
actualName: 'Object',
expectedName: 'WaitForOptions',
},
],
[
'Method Page.reload() options',
{
actualName: 'Object',
expectedName: 'WaitForOptions',
},
],
[
'Method Page.waitForNavigation() options',
{
actualName: 'Object',
expectedName: 'WaitForOptions',
},
],
[
'Method Page.pdf() options',
{
actualName: 'Object',
expectedName: 'PDFOptions',
},
],
[
'Method Page.createPDFStream() options',
{
actualName: 'Object',
expectedName: 'PDFOptions',
},
],
[
'Method Page.screenshot() options',
{
actualName: 'Object',
expectedName: 'ScreenshotOptions',
},
],
[
'Method Page.setContent() options',
{
actualName: 'Object',
expectedName: 'WaitForOptions',
},
],
[
'Method Page.setCookie() ...cookies',
{
actualName: '...Object',
expectedName: '...Protocol.Network.CookieParam',
},
],
[
'Method Page.emulateVisionDeficiency() type',
{
actualName: 'string',
expectedName: 'Protocol.Emulation.SetEmulatedVisionDeficiencyRequest',
},
],
[
'Method Accessibility.snapshot() options',
{
actualName: 'Object',
expectedName: 'SnapshotOptions',
},
],
[
'Method Browser.waitForTarget() options',
{
actualName: 'Object',
expectedName: 'WaitForTargetOptions',
},
],
[
'Method EventEmitter.emit() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method EventEmitter.listenerCount() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method EventEmitter.off() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method EventEmitter.on() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method EventEmitter.once() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method EventEmitter.removeListener() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method EventEmitter.addListener() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method EventEmitter.removeAllListeners() event',
{
actualName: 'string|symbol',
expectedName: 'EventType',
},
],
[
'Method Coverage.startCSSCoverage() options',
{
actualName: 'Object',
expectedName: 'CSSCoverageOptions',
},
],
[
'Method Coverage.startJSCoverage() options',
{
actualName: 'Object',
expectedName: 'JSCoverageOptions',
},
],
[
'Method Mouse.click() options.button',
{
actualName: '"left"|"right"|"middle"|"back"|"forward"',
expectedName: 'MouseButton',
},
],
[
'Method Frame.click() options.button',
{
actualName: '"left"|"right"|"middle"|"back"|"forward"',
expectedName: 'MouseButton',
},
],
[
'Method Page.click() options.button',
{
actualName: '"left"|"right"|"middle"|"back"|"forward"',
expectedName: 'MouseButton',
},
],
[
'Method HTTPRequest.continue() overrides',
{
actualName: 'Object',
expectedName: 'ContinueRequestOverrides',
},
],
[
'Method HTTPRequest.respond() response',
{
actualName: 'Object',
expectedName: 'ResponseForRequest',
},
],
[
'Method Frame.addScriptTag() options',
{
actualName: 'Object',
expectedName: 'FrameAddScriptTagOptions',
},
],
[
'Method Frame.addStyleTag() options',
{
actualName: 'Object',
expectedName: 'FrameAddStyleTagOptions',
},
],
[
'Method Frame.waitForFunction() options',
{
actualName: 'Object',
expectedName: 'FrameWaitForFunctionOptions',
},
],
[
'Method BrowserContext.overridePermissions() permissions',
{
actualName: 'Array<string>',
expectedName: 'Array<Object>',
},
],
[
'Method Puppeteer.connect() options',
{
actualName: 'Object',
expectedName: 'ConnectOptions',
},
],
[
'Method Page.deleteCookie() ...cookies',
{
actualName: '...Object',
expectedName: '...Protocol.Network.DeleteCookiesRequest',