4
4
5
5
namespace PhpList \WebFrontend \Tests \Integration \Auth ;
6
6
7
+ use PHPUnitRetry \RetryAnnotationTrait ;
8
+ use PHPUnitRetry \RetryTrait ;
7
9
use Symfony \Component \Panther \PantherTestCase ;
8
- use Symfony \Component \Panther \Client ;
9
10
11
+ /**
12
+ * @retryAttempts 5
13
+ * @retryIfException Facebook\WebDriver\Exception\NoSuchWindowException
14
+ * @retryDelaySeconds 10
15
+ */
10
16
class LoginTest extends PantherTestCase
11
17
{
12
- protected static ?Client $ client = null ;
18
+ use RetryAnnotationTrait;
19
+ use RetryTrait;
13
20
14
- public function setUp (): void
21
+ public function testLoginPageFormFieldsAreVisible (): void
15
22
{
16
- parent ::setUp ();
17
- self ::$ client = static ::createPantherClient ([
23
+ $ client = static ::createPantherClient ([
18
24
'browser ' => static ::CHROME ,
25
+ 'connection_timeout_in_ms ' => 10000 ,
19
26
]);
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 ' );
31
28
32
29
$ this ->assertPageTitleContains ('phpList - Login ' );
33
30
@@ -45,9 +42,13 @@ public function testLoginPageFormFieldsAreVisible(): void
45
42
46
43
public function testLoginFormSubmission (): void
47
44
{
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 ' );
49
50
50
- self :: $ client ->submitForm ('Sign in ' , [
51
+ $ client ->submitForm ('Sign in ' , [
51
52
'username ' => 'invalid_user ' ,
52
53
'password ' => 'invalid_password '
53
54
]);
0 commit comments