| @@ 514-522 (lines=9) @@ | ||
| 511 | self::assertInstanceOf('Facebook\WebDriver\WebDriverElement', $element); |
|
| 512 | } |
|
| 513 | ||
| 514 | public function assertElementHasText($node, $text) |
|
| 515 | { |
|
| 516 | try { |
|
| 517 | $element = $this->byXpath(sprintf('//%s[contains(., "%s")]', $node, addslashes($text))); |
|
| 518 | self::assertWebDriverElement($element); |
|
| 519 | } catch (\Exception $e) { |
|
| 520 | $this->fail('The body did not contain the text: ' . $text); |
|
| 521 | } |
|
| 522 | } |
|
| 523 | ||
| 524 | public function assertPageHasText($text) |
|
| 525 | { |
|
| @@ 524-533 (lines=10) @@ | ||
| 521 | } |
|
| 522 | } |
|
| 523 | ||
| 524 | public function assertPageHasText($text) |
|
| 525 | { |
|
| 526 | try { |
|
| 527 | $element = $this->webdriver->byXpath(sprintf('//body[contains(., "%s")]', $text)); |
|
| 528 | // If the element is not found then an exception will be thrown |
|
| 529 | self::assertWebDriverElement($element); |
|
| 530 | } catch (\Exception $e) { |
|
| 531 | $this->fail('The body did not contain the text: ' . $text); |
|
| 532 | } |
|
| 533 | } |
|
| 534 | ||
| 535 | public function assertPageNotHasText($text) |
|
| 536 | { |
|