| @@ 547-555 (lines=9) @@ | ||
| 544 | self::assertInstanceOf('Facebook\WebDriver\WebDriverElement', $element); |
|
| 545 | } |
|
| 546 | ||
| 547 | public function assertElementHasText($node, $text) |
|
| 548 | { |
|
| 549 | try { |
|
| 550 | $element = $this->byXpath(sprintf('//%s[contains(., "%s")]', $node, addslashes($text))); |
|
| 551 | self::assertWebDriverElement($element); |
|
| 552 | } catch (\Exception $e) { |
|
| 553 | $this->fail('The body did not contain the text: ' . $text); |
|
| 554 | } |
|
| 555 | } |
|
| 556 | ||
| 557 | public function assertPageHasText($text) |
|
| 558 | { |
|
| @@ 557-566 (lines=10) @@ | ||
| 554 | } |
|
| 555 | } |
|
| 556 | ||
| 557 | public function assertPageHasText($text) |
|
| 558 | { |
|
| 559 | try { |
|
| 560 | $element = $this->webdriver->byXpath(sprintf('//body[contains(., "%s")]', $text)); |
|
| 561 | // If the element is not found then an exception will be thrown |
|
| 562 | self::assertWebDriverElement($element); |
|
| 563 | } catch (\Exception $e) { |
|
| 564 | $this->fail('The body did not contain the text: ' . $text); |
|
| 565 | } |
|
| 566 | } |
|
| 567 | ||
| 568 | public function assertPageNotHasText($text) |
|
| 569 | { |
|