Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit bd42b72

Browse files
committed
Fix linter warnings for the Parse methods
1 parent ed20b92 commit bd42b72

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

common/element_handle_options.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func NewElementHandleBaseOptions(defaultTimeout time.Duration) *ElementHandleBas
135135
}
136136
}
137137

138+
// Parse parses the ElementHandleBaseOptions from the given opts.
138139
func (o *ElementHandleBaseOptions) Parse(ctx context.Context, opts sobek.Value) error {
139140
if !sobekValueExists(opts) {
140141
return nil
@@ -162,6 +163,7 @@ func NewElementHandleBasePointerOptions(defaultTimeout time.Duration) *ElementHa
162163
}
163164
}
164165

166+
// Parse parses the ElementHandleBasePointerOptions from the given opts.
165167
func (o *ElementHandleBasePointerOptions) Parse(ctx context.Context, opts sobek.Value) error {
166168
rt := k6ext.Runtime(ctx)
167169
if err := o.ElementHandleBaseOptions.Parse(ctx, opts); err != nil {
@@ -192,6 +194,7 @@ func NewElementHandleCheckOptions(defaultTimeout time.Duration) *ElementHandleCh
192194
}
193195
}
194196

197+
// Parse parses the ElementHandleCheckOptions from the given opts.
195198
func (o *ElementHandleCheckOptions) Parse(ctx context.Context, opts sobek.Value) error {
196199
return o.ElementHandleBasePointerOptions.Parse(ctx, opts)
197200
}
@@ -267,6 +270,7 @@ func NewElementHandleClickOptions(defaultTimeout time.Duration) *ElementHandleCl
267270
}
268271
}
269272

273+
// Parse parses the ElementHandleClickOptions from the given opts.
270274
func (o *ElementHandleClickOptions) Parse(ctx context.Context, opts sobek.Value) error {
271275
rt := k6ext.Runtime(ctx)
272276
if err := o.ElementHandleBasePointerOptions.Parse(ctx, opts); err != nil {
@@ -311,6 +315,7 @@ func NewElementHandleDblclickOptions(defaultTimeout time.Duration) *ElementHandl
311315
}
312316
}
313317

318+
// Parse parses the ElementHandleDblclickOptions from the given opts.
314319
func (o *ElementHandleDblclickOptions) Parse(ctx context.Context, opts sobek.Value) error {
315320
rt := k6ext.Runtime(ctx)
316321
if err := o.ElementHandleBasePointerOptions.Parse(ctx, opts); err != nil {
@@ -351,6 +356,7 @@ func NewElementHandleHoverOptions(defaultTimeout time.Duration) *ElementHandleHo
351356
}
352357
}
353358

359+
// Parse parses the ElementHandleHoverOptions from the given opts.
354360
func (o *ElementHandleHoverOptions) Parse(ctx context.Context, opts sobek.Value) error {
355361
rt := k6ext.Runtime(ctx)
356362
if err := o.ElementHandleBasePointerOptions.Parse(ctx, opts); err != nil {
@@ -380,6 +386,7 @@ func NewElementHandlePressOptions(defaultTimeout time.Duration) *ElementHandlePr
380386
}
381387
}
382388

389+
// Parse parses the ElementHandlePressOptions from the given opts.
383390
func (o *ElementHandlePressOptions) Parse(ctx context.Context, opts sobek.Value) error {
384391
rt := k6ext.Runtime(ctx)
385392
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -416,6 +423,7 @@ func NewElementHandleScreenshotOptions(defaultTimeout time.Duration) *ElementHan
416423
}
417424
}
418425

426+
// Parse parses the ElementHandleScreenshotOptions from the given opts.
419427
func (o *ElementHandleScreenshotOptions) Parse(ctx context.Context, opts sobek.Value) error {
420428
rt := k6ext.Runtime(ctx)
421429
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -456,6 +464,7 @@ func NewElementHandleSetCheckedOptions(defaultTimeout time.Duration) *ElementHan
456464
}
457465
}
458466

467+
// Parse parses the ElementHandleSetCheckedOptions from the given opts.
459468
func (o *ElementHandleSetCheckedOptions) Parse(ctx context.Context, opts sobek.Value) error {
460469
rt := k6ext.Runtime(ctx)
461470

@@ -482,6 +491,7 @@ func NewElementHandleTapOptions(defaultTimeout time.Duration) *ElementHandleTapO
482491
}
483492
}
484493

494+
// Parse parses the ElementHandleTapOptions from the given opts.
485495
func (o *ElementHandleTapOptions) Parse(ctx context.Context, opts sobek.Value) error {
486496
rt := k6ext.Runtime(ctx)
487497
if err := o.ElementHandleBasePointerOptions.Parse(ctx, opts); err != nil {
@@ -511,6 +521,7 @@ func NewElementHandleTypeOptions(defaultTimeout time.Duration) *ElementHandleTyp
511521
}
512522
}
513523

524+
// Parse parses the ElementHandleTypeOptions from the given opts.
514525
func (o *ElementHandleTypeOptions) Parse(ctx context.Context, opts sobek.Value) error {
515526
rt := k6ext.Runtime(ctx)
516527
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -543,6 +554,7 @@ func NewElementHandleWaitForElementStateOptions(defaultTimeout time.Duration) *E
543554
}
544555
}
545556

557+
// Parse parses the ElementHandleWaitForElementStateOptions from the given opts.
546558
func (o *ElementHandleWaitForElementStateOptions) Parse(ctx context.Context, opts sobek.Value) error {
547559
rt := k6ext.Runtime(ctx)
548560
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {

common/frame_options.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ func NewFrameBaseOptions(defaultTimeout time.Duration) *FrameBaseOptions {
205205
}
206206
}
207207

208+
// Parse parses the frame base options.
208209
func (o *FrameBaseOptions) Parse(ctx context.Context, opts sobek.Value) error {
209210
rt := k6ext.Runtime(ctx)
210211
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -228,6 +229,7 @@ func NewFrameCheckOptions(defaultTimeout time.Duration) *FrameCheckOptions {
228229
}
229230
}
230231

232+
// Parse parses the frame check options.
231233
func (o *FrameCheckOptions) Parse(ctx context.Context, opts sobek.Value) error {
232234
if err := o.ElementHandleBasePointerOptions.Parse(ctx, opts); err != nil {
233235
return err
@@ -243,6 +245,7 @@ func NewFrameClickOptions(defaultTimeout time.Duration) *FrameClickOptions {
243245
}
244246
}
245247

248+
// Parse parses the frame click options.
246249
func (o *FrameClickOptions) Parse(ctx context.Context, opts sobek.Value) error {
247250
if err := o.ElementHandleClickOptions.Parse(ctx, opts); err != nil {
248251
return err
@@ -258,6 +261,7 @@ func NewFrameDblClickOptions(defaultTimeout time.Duration) *FrameDblclickOptions
258261
}
259262
}
260263

264+
// Parse parses the frame dblclick options.
261265
func (o *FrameDblclickOptions) Parse(ctx context.Context, opts sobek.Value) error {
262266
if err := o.ElementHandleDblclickOptions.Parse(ctx, opts); err != nil {
263267
return err
@@ -273,6 +277,7 @@ func NewFrameFillOptions(defaultTimeout time.Duration) *FrameFillOptions {
273277
}
274278
}
275279

280+
// Parse parses the frame fill options.
276281
func (o *FrameFillOptions) Parse(ctx context.Context, opts sobek.Value) error {
277282
if err := o.ElementHandleBaseOptions.Parse(ctx, opts); err != nil {
278283
return err
@@ -289,6 +294,7 @@ func NewFrameGotoOptions(defaultReferer string, defaultTimeout time.Duration) *F
289294
}
290295
}
291296

297+
// Parse parses the frame goto options.
292298
func (o *FrameGotoOptions) Parse(ctx context.Context, opts sobek.Value) error {
293299
rt := k6ext.Runtime(ctx)
294300
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -317,6 +323,7 @@ func NewFrameHoverOptions(defaultTimeout time.Duration) *FrameHoverOptions {
317323
}
318324
}
319325

326+
// Parse parses the frame hover options.
320327
func (o *FrameHoverOptions) Parse(ctx context.Context, opts sobek.Value) error {
321328
if err := o.ElementHandleHoverOptions.Parse(ctx, opts); err != nil {
322329
return err
@@ -331,6 +338,7 @@ func NewFrameInnerHTMLOptions(defaultTimeout time.Duration) *FrameInnerHTMLOptio
331338
}
332339
}
333340

341+
// Parse parses the frame innerHTML options.
334342
func (o *FrameInnerHTMLOptions) Parse(ctx context.Context, opts sobek.Value) error {
335343
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
336344
return err
@@ -344,6 +352,7 @@ func NewFrameInnerTextOptions(defaultTimeout time.Duration) *FrameInnerTextOptio
344352
}
345353
}
346354

355+
// Parse parses the frame innerText options.
347356
func (o *FrameInnerTextOptions) Parse(ctx context.Context, opts sobek.Value) error {
348357
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
349358
return err
@@ -357,6 +366,7 @@ func NewFrameInputValueOptions(defaultTimeout time.Duration) *FrameInputValueOpt
357366
}
358367
}
359368

369+
// Parse parses the frame inputValue options.
360370
func (o *FrameInputValueOptions) Parse(ctx context.Context, opts sobek.Value) error {
361371
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
362372
return err
@@ -370,6 +380,7 @@ func NewFrameIsCheckedOptions(defaultTimeout time.Duration) *FrameIsCheckedOptio
370380
}
371381
}
372382

383+
// Parse parses the frame isChecked options.
373384
func (o *FrameIsCheckedOptions) Parse(ctx context.Context, opts sobek.Value) error {
374385
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
375386
return err
@@ -383,6 +394,7 @@ func NewFrameIsDisabledOptions(defaultTimeout time.Duration) *FrameIsDisabledOpt
383394
}
384395
}
385396

397+
// Parse parses the frame isDisabled options.
386398
func (o *FrameIsDisabledOptions) Parse(ctx context.Context, opts sobek.Value) error {
387399
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
388400
return err
@@ -396,6 +408,7 @@ func NewFrameIsEditableOptions(defaultTimeout time.Duration) *FrameIsEditableOpt
396408
}
397409
}
398410

411+
// Parse parses the frame isEditable options.
399412
func (o *FrameIsEditableOptions) Parse(ctx context.Context, opts sobek.Value) error {
400413
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
401414
return err
@@ -409,6 +422,7 @@ func NewFrameIsEnabledOptions(defaultTimeout time.Duration) *FrameIsEnabledOptio
409422
}
410423
}
411424

425+
// Parse parses the frame isEnabled options.
412426
func (o *FrameIsEnabledOptions) Parse(ctx context.Context, opts sobek.Value) error {
413427
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
414428
return err
@@ -421,6 +435,7 @@ func NewFrameIsHiddenOptions() *FrameIsHiddenOptions {
421435
return &FrameIsHiddenOptions{}
422436
}
423437

438+
// Parse parses FrameIsHiddenOptions from sobek.Value.
424439
func (o *FrameIsHiddenOptions) Parse(ctx context.Context, opts sobek.Value) error {
425440
o.Strict = parseStrict(ctx, opts)
426441
return nil
@@ -431,6 +446,7 @@ func NewFrameIsVisibleOptions() *FrameIsVisibleOptions {
431446
return &FrameIsVisibleOptions{}
432447
}
433448

449+
// Parse parses FrameIsVisibleOptions from sobek.Value.
434450
func (o *FrameIsVisibleOptions) Parse(ctx context.Context, opts sobek.Value) error {
435451
o.Strict = parseStrict(ctx, opts)
436452
return nil
@@ -456,6 +472,7 @@ func NewFrameSelectOptionOptions(defaultTimeout time.Duration) *FrameSelectOptio
456472
}
457473
}
458474

475+
// Parse parses the frame selectOption options.
459476
func (o *FrameSelectOptionOptions) Parse(ctx context.Context, opts sobek.Value) error {
460477
if err := o.ElementHandleBaseOptions.Parse(ctx, opts); err != nil {
461478
return err
@@ -471,6 +488,7 @@ func NewFrameSetContentOptions(defaultTimeout time.Duration) *FrameSetContentOpt
471488
}
472489
}
473490

491+
// Parse parses the frame setContent options.
474492
func (o *FrameSetContentOptions) Parse(ctx context.Context, opts sobek.Value) error {
475493
rt := k6ext.Runtime(ctx)
476494

@@ -516,6 +534,7 @@ func NewFrameTapOptions(defaultTimeout time.Duration) *FrameTapOptions {
516534
}
517535
}
518536

537+
// Parse parses the frame tap options.
519538
func (o *FrameTapOptions) Parse(ctx context.Context, opts sobek.Value) error {
520539
rt := k6ext.Runtime(ctx)
521540
if err := o.ElementHandleBasePointerOptions.Parse(ctx, opts); err != nil {
@@ -545,6 +564,7 @@ func NewFrameTextContentOptions(defaultTimeout time.Duration) *FrameTextContentO
545564
}
546565
}
547566

567+
// Parse parses the frame textContent options.
548568
func (o *FrameTextContentOptions) Parse(ctx context.Context, opts sobek.Value) error {
549569
if err := o.FrameBaseOptions.Parse(ctx, opts); err != nil {
550570
return err
@@ -572,6 +592,7 @@ func NewFrameUncheckOptions(defaultTimeout time.Duration) *FrameUncheckOptions {
572592
}
573593
}
574594

595+
// Parse parses the frame uncheck options.
575596
func (o *FrameUncheckOptions) Parse(ctx context.Context, opts sobek.Value) error {
576597
if err := o.ElementHandleBasePointerOptions.Parse(ctx, opts); err != nil {
577598
return err
@@ -627,6 +648,7 @@ func NewFrameWaitForLoadStateOptions(defaultTimeout time.Duration) *FrameWaitFor
627648
}
628649
}
629650

651+
// Parse parses the frame waitForLoadState options.
630652
func (o *FrameWaitForLoadStateOptions) Parse(ctx context.Context, opts sobek.Value) error {
631653
rt := k6ext.Runtime(ctx)
632654
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -649,6 +671,7 @@ func NewFrameWaitForNavigationOptions(defaultTimeout time.Duration) *FrameWaitFo
649671
}
650672
}
651673

674+
// Parse parses the frame waitForNavigation options.
652675
func (o *FrameWaitForNavigationOptions) Parse(ctx context.Context, opts sobek.Value) error {
653676
rt := k6ext.Runtime(ctx)
654677
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -678,6 +701,7 @@ func NewFrameWaitForSelectorOptions(defaultTimeout time.Duration) *FrameWaitForS
678701
}
679702
}
680703

704+
// Parse parses the frame waitForSelector options.
681705
func (o *FrameWaitForSelectorOptions) Parse(ctx context.Context, opts sobek.Value) error {
682706
rt := k6ext.Runtime(ctx)
683707

common/keyboard_options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func NewKeyboardOptions() *KeyboardOptions {
1818
}
1919
}
2020

21+
// Parse parses the keyboard options.
2122
func (o *KeyboardOptions) Parse(ctx context.Context, opts sobek.Value) error {
2223
rt := k6ext.Runtime(ctx)
2324
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {

common/mouse_options.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func NewMouseClickOptions() *MouseClickOptions {
3636
}
3737
}
3838

39+
// Parse parses the mouse click options.
3940
func (o *MouseClickOptions) Parse(ctx context.Context, opts sobek.Value) error {
4041
rt := k6ext.Runtime(ctx)
4142
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -68,6 +69,7 @@ func NewMouseDblClickOptions() *MouseDblClickOptions {
6869
}
6970
}
7071

72+
// Parse parses the mouse double click options.
7173
func (o *MouseDblClickOptions) Parse(ctx context.Context, opts sobek.Value) error {
7274
rt := k6ext.Runtime(ctx)
7375
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -100,6 +102,7 @@ func NewMouseDownUpOptions() *MouseDownUpOptions {
100102
}
101103
}
102104

105+
// Parse parses the mouse down/up options.
103106
func (o *MouseDownUpOptions) Parse(ctx context.Context, opts sobek.Value) error {
104107
rt := k6ext.Runtime(ctx)
105108
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -122,6 +125,7 @@ func NewMouseMoveOptions() *MouseMoveOptions {
122125
}
123126
}
124127

128+
// Parse parses the mouse move options.
125129
func (o *MouseMoveOptions) Parse(ctx context.Context, opts sobek.Value) error {
126130
rt := k6ext.Runtime(ctx)
127131
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {

common/page_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func NewPageEmulateMediaOptions(defaultMedia MediaType, defaultColorScheme Color
4040
}
4141
}
4242

43+
// Parse parses the page emulate media options.
4344
func (o *PageEmulateMediaOptions) Parse(ctx context.Context, opts sobek.Value) error {
4445
rt := k6ext.Runtime(ctx)
4546
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -65,6 +66,7 @@ func NewPageReloadOptions(defaultWaitUntil LifecycleEvent, defaultTimeout time.D
6566
}
6667
}
6768

69+
// Parse parses the page reload options.
6870
func (o *PageReloadOptions) Parse(ctx context.Context, opts sobek.Value) error {
6971
rt := k6ext.Runtime(ctx)
7072
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {
@@ -97,6 +99,7 @@ func NewPageScreenshotOptions() *PageScreenshotOptions {
9799
}
98100
}
99101

102+
// Parse parses the page screenshot options.
100103
func (o *PageScreenshotOptions) Parse(ctx context.Context, opts sobek.Value) error {
101104
rt := k6ext.Runtime(ctx)
102105
if opts != nil && !sobek.IsUndefined(opts) && !sobek.IsNull(opts) {

0 commit comments

Comments
 (0)