Last active
November 6, 2021 15:35
-
-
Save andreasneuber/e1feafe52cebd4a73a8cd32ec2d944c9 to your computer and use it in GitHub Desktop.
Codeception - grab all urls with specific segment from a page
This file contains hidden or 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
private function extract_all_page_links( AcceptanceTester $I ): array { | |
$I->amOnPage( '/example/' ); | |
$url = $this->base_url . 'example/'; | |
$aLinks = $I->grabMultiple( "//a[contains(@href,'{$url}' )]", 'href' ); | |
return array_unique( $aLinks ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment