20
20
use Facebook \WebDriver \JavaScriptExecutor ;
21
21
use Facebook \WebDriver \WebDriver ;
22
22
use Facebook \WebDriver \WebDriverExpectedCondition ;
23
+ use PHPUnit \Framework \Attributes \DataProvider ;
23
24
use Symfony \Component \BrowserKit \AbstractBrowser ;
24
25
use Symfony \Component \BrowserKit \Cookie ;
25
26
use Symfony \Component \BrowserKit \CookieJar as BrowserKitCookieJar ;
@@ -56,6 +57,8 @@ public function testWaitForEmptyLocator(): void
56
57
$ client ->waitFor ('' );
57
58
}
58
59
60
+ #[DataProvider('waitForDataProvider ' )]
61
+
59
62
/**
60
63
* @dataProvider waitForDataProvider
61
64
*/
@@ -83,6 +86,7 @@ public static function waitForDataProvider(): iterable
83
86
yield 'xpath expression ' => ['locator ' => '//*[@id="hello"] ' ];
84
87
}
85
88
89
+ #[DataProvider('waitForDataProvider ' )]
86
90
/**
87
91
* @dataProvider waitForDataProvider
88
92
*/
@@ -95,6 +99,7 @@ public function testWaitForVisibility(string $locator): void
95
99
$ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text (null , true ));
96
100
}
97
101
102
+ #[DataProvider('waitForDataProvider ' )]
98
103
/**
99
104
* @dataProvider waitForDataProvider
100
105
*/
@@ -107,6 +112,7 @@ public function testWaitForInvisibility(string $locator): void
107
112
$ this ->assertSame ('' , $ crawler ->filter ('#hello ' )->text (null , true ));
108
113
}
109
114
115
+ #[DataProvider('waitForDataProvider ' )]
110
116
/**
111
117
* @dataProvider waitForDataProvider
112
118
*/
@@ -119,6 +125,7 @@ public function testWaitForElementToContain(string $locator): void
119
125
$ this ->assertSame ('Hello new content ' , $ crawler ->filter ('#hello ' )->text (null , true ));
120
126
}
121
127
128
+ #[DataProvider('waitForDataProvider ' )]
122
129
/**
123
130
* @dataProvider waitForDataProvider
124
131
*/
@@ -131,6 +138,7 @@ public function testWaitForElementToNotContain(string $locator): void
131
138
$ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text (null , true ));
132
139
}
133
140
141
+ #[DataProvider('waitForDataProvider ' )]
134
142
/**
135
143
* @dataProvider waitForDataProvider
136
144
*/
@@ -143,6 +151,7 @@ public function testWaitForEnabled(string $locator): void
143
151
$ this ->assertTrue ($ crawler ->filter ('#hello ' )->isEnabled ());
144
152
}
145
153
154
+ #[DataProvider('waitForDataProvider ' )]
146
155
/**
147
156
* @dataProvider waitForDataProvider
148
157
*/
@@ -155,6 +164,7 @@ public function testWaitForDisabled(string $locator): void
155
164
$ this ->assertFalse ($ crawler ->filter ('#hello ' )->isEnabled ());
156
165
}
157
166
167
+ #[DataProvider('waitForDataProvider ' )]
158
168
/**
159
169
* @dataProvider waitForDataProvider
160
170
*/
@@ -167,6 +177,7 @@ public function testWaitForAttributeToContain(string $locator): void
167
177
$ this ->assertSame ('42 ' , $ crawler ->filter ('#hello ' )->getAttribute ('data-old-price ' ));
168
178
}
169
179
180
+ #[DataProvider('waitForDataProvider ' )]
170
181
/**
171
182
* @dataProvider waitForDataProvider
172
183
*/
@@ -179,6 +190,7 @@ public function testWaitForAttributeToNotContain(string $locator): void
179
190
$ this ->assertSame ('36 ' , $ crawler ->filter ('#hello ' )->getAttribute ('data-old-price ' ));
180
191
}
181
192
193
+ #[DataProvider('waitForDataProvider ' )]
182
194
/**
183
195
* @dataProvider waitForDataProvider
184
196
*/
@@ -244,6 +256,7 @@ public static function waitForExceptionsProvider(): iterable
244
256
];
245
257
}
246
258
259
+ #[DataProvider('waitForExceptionsProvider ' )]
247
260
/**
248
261
* @dataProvider waitForExceptionsProvider
249
262
*/
@@ -288,6 +301,7 @@ public function testExecuteAsyncScript(): void
288
301
$ this ->assertSame ('P1 ' , $ innerText );
289
302
}
290
303
304
+ #[DataProvider('clientFactoryProvider ' )]
291
305
/**
292
306
* @dataProvider clientFactoryProvider
293
307
*/
@@ -319,6 +333,7 @@ public function testRefreshCrawler(): void
319
333
$ this ->assertSame ('Hello ' , $ refreshedCrawler ->filter ('h1 ' )->text (null , true ));
320
334
}
321
335
336
+ #[DataProvider('clientFactoryProvider ' )]
322
337
/**
323
338
* @dataProvider clientFactoryProvider
324
339
*/
@@ -337,6 +352,7 @@ public function testFollowLink(callable $clientFactory, string $type): void
337
352
$ this ->assertSame (self ::$ baseUri .'/basic.html#e12 ' , $ crawler ->getUri ());
338
353
}
339
354
355
+ #[DataProvider('clientFactoryProvider ' )]
340
356
/**
341
357
* @dataProvider clientFactoryProvider
342
358
*/
@@ -392,6 +408,7 @@ public function testSubmitForm(callable $clientFactory): void
392
408
$ this ->assertSame ('I1: n/a ' , $ crawler ->filter ('#result ' )->text (null , true ));
393
409
}
394
410
411
+ #[DataProvider('clientFactoryProvider ' )]
395
412
/**
396
413
* @dataProvider clientFactoryProvider
397
414
*/
@@ -418,6 +435,7 @@ public function testSubmitFormWithValues(callable $clientFactory): void
418
435
$ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text (null , true ));
419
436
}
420
437
438
+ #[DataProvider('clientFactoryProvider ' )]
421
439
/**
422
440
* @dataProvider clientFactoryProvider
423
441
*/
@@ -445,6 +463,7 @@ public function testHistory(callable $clientFactory): void
445
463
$ this ->assertSame (self ::$ baseUri .'/link.html ' , $ crawler ->getUri ());
446
464
}
447
465
466
+ #[DataProvider('clientFactoryProvider ' )]
448
467
/**
449
468
* @dataProvider clientFactoryProvider
450
469
*/
@@ -497,6 +516,7 @@ public function testCookie(callable $clientFactory, string $type): void
497
516
$ this ->assertNull ($ cookieJar ->get ('foo ' ));
498
517
}
499
518
519
+ #[DataProvider('clientFactoryProvider ' )]
500
520
/**
501
521
* @dataProvider clientFactoryProvider
502
522
*/
@@ -507,6 +527,7 @@ public function testServerPort(callable $clientFactory): void
507
527
$ this ->assertEquals ($ expectedPort , mb_substr (self ::$ baseUri , -4 ));
508
528
}
509
529
530
+ #[DataProvider('clientFactoryProvider ' )]
510
531
/**
511
532
* @dataProvider clientFactoryProvider
512
533
*/
@@ -596,6 +617,7 @@ public function testCreateHttpBrowserClientWithInvalidHttpClientOptions(): void
596
617
]);
597
618
}
598
619
620
+ #[DataProvider('providePrefersReducedMotion ' )]
599
621
/**
600
622
* @dataProvider providePrefersReducedMotion
601
623
*/
@@ -608,6 +630,7 @@ public function testPrefersReducedMotion(string $browser): void
608
630
$ this ->assertStringEndsWith ('#clicked ' , $ client ->getCurrentURL ());
609
631
}
610
632
633
+ #[DataProvider('providePrefersReducedMotion ' )]
611
634
/**
612
635
* @dataProvider providePrefersReducedMotion
613
636
*/
0 commit comments