| @@ 8-23 (lines=16) @@ | ||
| 5 | ||
| 6 | use Magium\AbstractTestCase; |
|
| 7 | ||
| 8 | class Displayed extends AbstractSelectorAssertion |
|
| 9 | { |
|
| 10 | ||
| 11 | const ASSERTION = 'Element\Displayed'; |
|
| 12 | ||
| 13 | public function assert() |
|
| 14 | { |
|
| 15 | $this->getTestCase()->assertElementExists($this->selector, $this->by); |
|
| 16 | AbstractTestCase::assertTrue( |
|
| 17 | $this->webDriver->{$this->by}($this->selector)->isDisplayed(), |
|
| 18 | sprintf('The element: %s, is not displayed and it should have been', $this->selector) |
|
| 19 | ); |
|
| 20 | ||
| 21 | } |
|
| 22 | ||
| 23 | } |
|
| 24 | ||
| @@ 8-22 (lines=15) @@ | ||
| 5 | ||
| 6 | use Magium\AbstractTestCase; |
|
| 7 | ||
| 8 | class NotDisplayed extends AbstractSelectorAssertion |
|
| 9 | { |
|
| 10 | ||
| 11 | const ASSERTION = 'Element\NotDisplayed'; |
|
| 12 | ||
| 13 | public function assert() |
|
| 14 | { |
|
| 15 | $this->getTestCase()->assertElementExists($this->selector, $this->by); |
|
| 16 | AbstractTestCase::assertFalse( |
|
| 17 | $this->webDriver->{$this->by}($this->selector)->isDisplayed(), |
|
| 18 | sprintf('The element: %s, is displayed and it should not have been', $this->selector) |
|
| 19 | ); |
|
| 20 | } |
|
| 21 | ||
| 22 | } |
|
| 23 | ||