44
55namespace PhpList \WebFrontend \Tests \Integration \Auth ;
66
7+ use PHPUnitRetry \RetryAnnotationTrait ;
8+ use PHPUnitRetry \RetryTrait ;
79use Symfony \Component \Panther \PantherTestCase ;
8- use Symfony \Component \Panther \Client ;
910
11+ /**
12+ * @retryAttempts 5
13+ * @retryIfException Facebook\WebDriver\Exception\NoSuchWindowException
14+ * @retryDelaySeconds 10
15+ */
1016class LoginTest extends PantherTestCase
1117{
12- protected static ?Client $ client = null ;
18+ use RetryAnnotationTrait;
19+ use RetryTrait;
1320
14- public function setUp (): void
21+ public function testLoginPageFormFieldsAreVisible (): void
1522 {
16- parent ::setUp ();
17- self ::$ client = static ::createPantherClient ([
23+ $ client = static ::createPantherClient ([
1824 'browser ' => static ::CHROME ,
25+ 'connection_timeout_in_ms ' => 10000 ,
1926 ]);
20- }
21-
22- public function tearDown (): void
23- {
24- self ::$ client ?->quit();
25- parent ::tearDown ();
26- }
27-
28- public function testLoginPageFormFieldsAreVisible (): void
29- {
30- self ::$ client ->request ('GET ' , '/app_test.php/login ' );
27+ $ client ->request ('GET ' , '/app_test.php/login ' );
3128
3229 $ this ->assertPageTitleContains ('phpList - Login ' );
3330
@@ -45,9 +42,13 @@ public function testLoginPageFormFieldsAreVisible(): void
4542
4643 public function testLoginFormSubmission (): void
4744 {
48- self ::$ client ->request ('GET ' , '/app_test.php/login ' );
45+ $ client = static ::createPantherClient ([
46+ 'browser ' => static ::CHROME ,
47+ 'connection_timeout_in_ms ' => 20000 ,
48+ ]);
49+ $ client ->request ('GET ' , '/app_test.php/login ' );
4950
50- self :: $ client ->submitForm ('Sign in ' , [
51+ $ client ->submitForm ('Sign in ' , [
5152 'username ' => 'invalid_user ' ,
5253 'password ' => 'invalid_password '
5354 ]);
0 commit comments