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