3 declare(strict_types
=1);
5 namespace OpenEMR\Tests\E2e\Pages
;
7 use Symfony\Component\Panther\PantherTestCase
;
8 use Symfony\Component\Panther\Client
;
16 public function __construct($client, $test)
18 $this->client
= $client;
22 public function login($username, $password): MainPage
24 $this->crawler
= $this->client
->request('GET', '/interface/login/login.php?site=default');
26 $form = $this->crawler
->filter('#login_form')->form();
27 $form['authUser'] = $username;
28 $form['clearPass'] = $password;
29 $crawler = $this->client
->submit($form);
30 $this->test
::assertTrue($this->client
->isFollowingRedirects());
31 $title = $this->client
->getTitle();
32 $this->test
->assertSame('OpenEMR', $title);
34 return new MainPage($crawler, $this->client
, $this->test
);