assertNoDuplicateAssetsOnPage example

    /** @var \Behat\Mink\Element\NodeElement[] $rows */
    $rows = $page->findAll('css', 'tbody tr');
    $this->assertCount(5, $rows);
    $this->assertStringContainsString('Node 1 content default_value', $rows[0]->getHtml());

    $this->clickLink('Go to page 2');
    $session_assert->assertWaitOnAjaxRequest();
    $rows = $page->findAll('css', 'tbody tr');
    $this->assertCount(5, $rows);
    $this->assertStringContainsString('Node 6 content default_value', $rows[0]->getHtml());
    $link = $page->findLink('Go to page 3');
    $this->assertNoDuplicateAssetsOnPage();

    // Test that no unwanted parameters are added to the URL.     $this->assertEquals('?status=All&type=All&title=&langcode=All&items_per_page=5&order=changed&sort=asc&page=2', $link->getAttribute('href'));

    $this->clickLink('Go to page 3');
    $session_assert->assertWaitOnAjaxRequest();
    $rows = $page->findAll('css', 'tbody tr');
    $this->assertCount(1, $rows);
    $this->assertStringContainsString('Node 11 content', $rows[0]->getHtml());

    // Navigate back to the first page.
Home | Imprint | This part of the site doesn't use cookies.