| @@ 15-21 (lines=7) @@ | ||
| 12 | /** |
|
| 13 | * @Then all images should have an alt attribute |
|
| 14 | */ |
|
| 15 | public function allImagesShouldHaveAnAltAttribute() |
|
| 16 | { |
|
| 17 | $images = $this->getSession()->getPage()->findAll('xpath', '//img[not(@alt)]'); |
|
| 18 | if ($images !== null) { |
|
| 19 | throw new \Exception("There are images without an alt attribute"); |
|
| 20 | } |
|
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * @Then the title should not be longer than :arg1 |
|
| @@ 37-43 (lines=7) @@ | ||
| 34 | /** |
|
| 35 | * @Then all tables should have a table header |
|
| 36 | */ |
|
| 37 | public function allTablesShouldHaveATableHeader() |
|
| 38 | { |
|
| 39 | $tables = $this->getSession()->getPage()->findAll('xpath', '//table/*[not(th)]'); |
|
| 40 | if ($tables !== null) { |
|
| 41 | throw new \Exception("There are tables without a table header"); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * @Then all tables should have at least one data row |
|
| @@ 48-54 (lines=7) @@ | ||
| 45 | /** |
|
| 46 | * @Then all tables should have at least one data row |
|
| 47 | */ |
|
| 48 | public function allTablesShouldHaveAtLeastOneDataRow() |
|
| 49 | { |
|
| 50 | $tables = $this->getSession()->getPage()->findAll('xpath', '//table/*[not(td)]'); |
|
| 51 | if ($tables !== null) { |
|
| 52 | throw new \Exception("There are tables without a data row"); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||