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