Skip to content

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Jun 28, 2019

Allow to use all DomCrawler assertions introduced in Symfony 4.3 with Panther.

Example:

<?php

class AssertionsTest extends PantherTestCase
{
    public function testDomCrawlerAssertions(): void
    {
        self::createPantherClient()->request('GET', '/basic.html');
        $this->assertSelectorExists('.p-1');
        $this->assertSelectorNotExists('#notexist');
        $this->assertSelectorTextContains('body', 'P1');
        $this->assertSelectorTextSame('.p-1', 'P1');
        $this->assertSelectorTextNotContains('.p-1', 'not contained');
        $this->assertPageTitleSame('A basic page');
        $this->assertPageTitleContains('A basic');
        $this->assertInputValueNotSame('in', '');
        $this->assertInputValueSame('in', 'test');
    }
}

Requires symfony/symfony#32207.

@dunglas
Copy link
Member Author

dunglas commented Aug 21, 2019

Needs symfony/symfony#33278

@dunglas dunglas force-pushed the support-assertions branch from d934d3c to 1c2013a Compare August 21, 2019 20:47
@dunglas dunglas merged commit b9225b0 into symfony:master Aug 21, 2019
@dunglas dunglas deleted the support-assertions branch August 21, 2019 21:06
dunglas added a commit that referenced this pull request Dec 28, 2020
* Add support for DomCrawler PHPUnit assertions

* Support all versions of WebTestCase

* Fix test

* CS

* Fix PHPStan

* Fix CS
nicolas-grekas pushed a commit that referenced this pull request Jan 18, 2021
* Add support for DomCrawler PHPUnit assertions

* Support all versions of WebTestCase

* Fix test

* CS

* Fix PHPStan

* Fix CS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant