diff --git a/behat.yml b/behat.yml index 97236cbb..2131da86 100644 --- a/behat.yml +++ b/behat.yml @@ -3,9 +3,3 @@ default: Behat\MinkExtension: base_url: http://127.0.0.1:8000 goutte: ~ - - suites: - default: - contexts: - - FeatureContext - - Behat\MinkExtension\Context\MinkContext diff --git a/features/blog.feature b/features/blog.feature index 5fa1ed60..50775202 100644 --- a/features/blog.feature +++ b/features/blog.feature @@ -3,12 +3,14 @@ Feature: Blog Scenario: Given I am on "/blog" Then the response status code should be 200 - And the ".nav li.active a" element should contain "Blog" + And the page title should be "Blog" + And the active menu link should be "Blog" Scenario: Given I am on "/blog/simplifying-drupal-migrations-with-xautoload" Then the response status code should be 200 - And the ".nav li.active a" element should contain "Blog" + And the page title should be "Simplifying Drupal Migrations with xautoload" + And the active menu link should be "Blog" Scenario: Given I am on "/" diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 2ec02da8..34063ddd 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -1,14 +1,16 @@ assertElementContains('.navbar .active a', $text); + } + + /** + * @Then the page title should be :text + */ + public function thePageTitleShouldBe($text) + { + return $this->assertElementContainsText('title', $text); + } + + /** + * @Then the page title should not be :text + */ + public function thePageTitleShouldNotBe($text) + { + return $this->assertElementNotContainsText('title', $text); + } } diff --git a/features/contact.feature b/features/contact.feature index e9e21a1c..fc291e2f 100644 --- a/features/contact.feature +++ b/features/contact.feature @@ -3,4 +3,4 @@ Feature: Contact page Scenario: Given I am on "/contact" Then the response status code should be 200 - And the ".nav li.active a" element should contain "Contact" + And the active menu link should be "Contact" diff --git a/features/experience.feature b/features/experience.feature index fd0bb453..1cdb7f52 100644 --- a/features/experience.feature +++ b/features/experience.feature @@ -3,4 +3,5 @@ Feature: Experience page Scenario: Given I am on "/experience" Then the response status code should be 200 - And the ".nav li.active a" element should contain "Experience" + And the page title should be "Experience" + And the active menu link should be "Experience" diff --git a/features/home.feature b/features/home.feature index 252fce8f..a1164ea1 100644 --- a/features/home.feature +++ b/features/home.feature @@ -6,7 +6,7 @@ Feature: Home Scenario: Given I am on the homepage Then the response status code should be 200 - And the ".nav li.active a" element should contain "About" And I should see "I’m a Web Developer and System Administrator based in Wales, UK." - And the "title" element should contain "Web Developer, System Administrator - PHP, Drupal, Symfony, Linux | Oliver Davies" - And the "title" element should not contain "About | Oliver Davies" + And the active menu link should be "About" + And the page title should be "Web Developer, System Administrator - PHP, Drupal, Symfony, Linux | Oliver Davies" + And the page title should not be "About | Oliver Davies"