-
-
Save alexandre-daubois/734abe40c73a1342293b7dee71a7f5ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Tests; | |
use Symfony\Component\Panther\PantherTestCase; | |
/** | |
* @see https://github.com/symfony/panther#a-polymorphic-feline | |
*/ | |
class E2eTest extends PantherTestCase | |
{ | |
public function testMyApp(): void | |
{ | |
$client = static::createPantherClient(); // Or static::createPantherClient(['browser' => static::FIREFOX]) for example | |
$client->request('GET', '/mypage'); | |
$this->assertPageTitleContains('My Title'); | |
$this->assertSelectorTextContains('#main', 'My body'); | |
$this->assertSelectorIsEnabled('.search'); | |
$this->assertSelectorIsDisabled('[type="submit"]'); | |
// ... | |
$client->waitForStaleness('.popin'); | |
$client->waitForVisibility('.loader'); | |
$client->waitForElementToContain('.total', '25 €'); | |
// ... | |
$this->assertSelectorWillExist('.popin'); | |
$this->assertSelectorWillNotExist('.popin'); | |
$this->assertSelectorWillBeVisible('.loader'); | |
$this->assertSelectorWillNotBeVisible('.loader'); | |
$this->assertSelectorWillContain('.total', '€25'); | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment