From 0be1832cb81e443ab560bbb90293f8466f3ccb7b Mon Sep 17 00:00:00 2001 From: upchuk Date: Tue, 14 Aug 2018 13:06:16 +0200 Subject: [PATCH 01/50] GH-498 - Fixing ConfigContext backup strategy. --- src/Drupal/DrupalExtension/Context/ConfigContext.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Context/ConfigContext.php b/src/Drupal/DrupalExtension/Context/ConfigContext.php index e858fee7..5e2eefe5 100644 --- a/src/Drupal/DrupalExtension/Context/ConfigContext.php +++ b/src/Drupal/DrupalExtension/Context/ConfigContext.php @@ -107,6 +107,13 @@ public function setConfig($name, $key, $value) { $backup = $this->getDriver()->configGet($name, $key); $this->getDriver()->configSet($name, $key, $value); - $this->config[$name][$key] = $backup; + if (!array_key_exists($name, $this->config)) { + $this->config[$name][$key] = $backup; + return; + } + + if (!array_key_exists($key, $this->config[$name])) { + $this->config[$name][$key] = $backup; + } } } From 245fec6b96c80ebbabf3dac32a1642c6b1842353 Mon Sep 17 00:00:00 2001 From: upchuk Date: Tue, 14 Aug 2018 13:14:39 +0200 Subject: [PATCH 02/50] GH-498: Fixing indentation issue. --- src/Drupal/DrupalExtension/Context/ConfigContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Drupal/DrupalExtension/Context/ConfigContext.php b/src/Drupal/DrupalExtension/Context/ConfigContext.php index 5e2eefe5..e302093e 100644 --- a/src/Drupal/DrupalExtension/Context/ConfigContext.php +++ b/src/Drupal/DrupalExtension/Context/ConfigContext.php @@ -108,12 +108,12 @@ public function setConfig($name, $key, $value) $backup = $this->getDriver()->configGet($name, $key); $this->getDriver()->configSet($name, $key, $value); if (!array_key_exists($name, $this->config)) { - $this->config[$name][$key] = $backup; - return; + $this->config[$name][$key] = $backup; + return; } if (!array_key_exists($key, $this->config[$name])) { - $this->config[$name][$key] = $backup; + $this->config[$name][$key] = $backup; } } } From b3f239cd37de476cd8b44f467f0cb09a6e12569e Mon Sep 17 00:00:00 2001 From: Taylor Will Date: Mon, 20 Aug 2018 12:18:07 -0400 Subject: [PATCH 03/50] login_form_selector update --- src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php b/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php index f711e782..30ebe956 100644 --- a/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php +++ b/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php @@ -145,7 +145,7 @@ public function configure(ArrayNodeDefinition $builder) scalarNode('success_message_selector')->end()-> scalarNode('warning_message_selector')->end()-> scalarNode('login_form_selector')-> - defaultValue('form#user-login')-> + defaultValue('form#user-login,form#user-login-form')-> end()-> scalarNode('logged_in_selector')-> defaultValue('body.logged-in,body.user-logged-in')-> From a9e16b9218dfc2968c2fd20d5d4ee0187eb7387f Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Fri, 31 Aug 2018 14:35:37 -0700 Subject: [PATCH 04/50] Add gherkin-lint to the build process. - Fixes #504 - Fixes inconsistencies in the `.feature` files included for testing. --- .gherkin-lintignore | 1 + .gherkin-lintrc | 36 +++++++++++++++++++++++++ .gitignore | 1 + composer.json | 1 + features/api.feature | 45 +++++++------------------------ features/api_background.feature | 6 ++--- features/blackbox.feature | 36 ++++++++++++------------- features/d6.feature | 11 ++------ features/d8.feature | 10 +++---- features/drush.feature | 12 ++++----- features/field_handlers.feature | 2 +- features/mail.feature | 1 - features/messages.feature | 4 +-- features/subcontexts/find.feature | 16 +++++------ package.json | 5 ++++ 15 files changed, 99 insertions(+), 88 deletions(-) create mode 100644 .gherkin-lintignore create mode 100644 .gherkin-lintrc diff --git a/.gherkin-lintignore b/.gherkin-lintignore new file mode 100644 index 00000000..20b8ca6d --- /dev/null +++ b/.gherkin-lintignore @@ -0,0 +1 @@ +features/i18n/*/*.feature diff --git a/.gherkin-lintrc b/.gherkin-lintrc new file mode 100644 index 00000000..50ae29b5 --- /dev/null +++ b/.gherkin-lintrc @@ -0,0 +1,36 @@ +{ + "no-files-without-scenarios" : "on", + "no-unnamed-features": "on", + "no-unnamed-scenarios": "on", + "no-dupe-scenario-names": "on", + "no-dupe-feature-names": "on", + "no-partially-commented-tag-lines": "on", + "indentation": [ + "on", { + "Feature": 0, + "Background": 2, + "Scenario": 2, + "Examples": 4, + "example": 6, + "Step": 4 + } + ], + "no-trailing-spaces": "on", + "new-line-at-eof": ["on", "yes"], + "no-multiple-empty-lines": "on", + "no-empty-file": "on", + "no-scenario-outlines-without-examples": "on", + "name-length": [ + "on", { + "Feature": 100, + "Scenario": 120, + "Step": "off" + } + ], + "no-restricted-tags": ["on", {"tags": ["@watch", "@wip"]}], + "use-and": "on", + "no-duplicate-tags": "on", + "no-superfluous-tags": "on", + "no-homogenous-tags": "off", + "one-space-between-tags": "on" +} diff --git a/.gitignore b/.gitignore index 4d3f649c..49877fd3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ composer.lock vendor /drupal* behat.yml +/package-lock.json /node_modules diff --git a/composer.json b/composer.json index 734f9465..2705f769 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,7 @@ "parallel-lint src spec features fixtures", "phpcs --standard=./phpcs-ruleset.xml -p", "phpcs --standard=./phpcs-drupal-ruleset.xml -p", + "npm test", "phpspec run -f pretty --no-interaction" ] }, diff --git a/features/api.feature b/features/api.feature index db239b58..6c4c84f4 100644 --- a/features/api.feature +++ b/features/api.feature @@ -1,5 +1,5 @@ @api -Feature: DrupalContext +Feature: DrupalContext general testing In order to prove the Drupal context is working properly As a developer I need to use the step definitions of this context @@ -13,33 +13,19 @@ Feature: DrupalContext Then I should see the text "Member for" @drushTest @d7 - Scenario: Target links within table rows + Scenario: Target links within table rows for Drush and Drupal 7 Given I am logged in as a user with the "administrator" role When I am at "admin/structure/types" And I click "manage fields" in the "Article" row Then I should be on "admin/structure/types/manage/article/fields" And I should see text matching "Add new field" - @d8 - Scenario: Target links within table rows - Given I am logged in as a user with the "administrator" role - When I am at "admin/structure/types" - And I click "Manage fields" in the "Article" row - Then I should be on "admin/structure/types/manage/article/fields" - And I should see text matching "Add field" - @drushTest @d7 - Scenario: Find a heading in a region + Scenario: Find a heading in a region for Drupal 7 Given I am not logged in When I am on the homepage Then I should see the heading "User login" in the "left sidebar" region - @d8 - Scenario: Find a heading in a region - Given I am not logged in - When I am on the homepage - Then I should see the heading "Search" in the "left sidebar" region - @drushTest @d7 @d8 Scenario: Clear cache Given the cache has been cleared @@ -104,7 +90,7 @@ Feature: DrupalContext Then I should see the link "Joe User" @d7 - Scenario: Create users with roles + Scenario: Create users with roles for Drupal 7 Given users: | name | mail | roles | | Joe User | joe@example.com | administrator | @@ -114,17 +100,6 @@ Feature: DrupalContext Then I should see the text "administrator" in the "Joe User" row And I should not see the text "administrator" in the "Jane User" row - @d8 - Scenario: Create users with roles - Given users: - | name | mail | roles | - | Joe User | joe@example.com | administrator | - | Jane User | jane@example.com | | - And I am logged in as a user with the "administrator" role - When I visit "admin/people" - Then I should see the text "Administrator" in the "Joe User" row - And I should not see the text "administrator" in the "Jane User" row - @d7 @d8 Scenario: Login as a user created during this scenario Given users: @@ -140,7 +115,7 @@ Feature: DrupalContext Then I should see the heading "My tag" @d7 - Scenario: Create many terms + Scenario: Create many terms for Drupal 7 Given "tags" terms: | name | | Tag one | @@ -151,7 +126,7 @@ Feature: DrupalContext And I should see "Tag two" @d8 - Scenario: Create many terms + Scenario: Create many terms for Drupal 8 Given "tags" terms: | name | | Tag one | @@ -162,7 +137,7 @@ Feature: DrupalContext And I should see "Tag two" @d7 - Scenario: Create terms using vocabulary title rather than machine name. + Scenario: Create terms using vocabulary title rather than machine name for Drupal 7. Given "Tags" terms: | name | | Tag one | @@ -173,7 +148,7 @@ Feature: DrupalContext And I should see "Tag two" @d8 - Scenario: Create terms using vocabulary title rather than machine name. + Scenario: Create terms using vocabulary title rather than machine name for Drupal 8. Given "Tags" terms: | name | | Tag one | @@ -248,7 +223,7 @@ Feature: DrupalContext Then I should see the link "Joe User" @d7 - Scenario: Term hooks are functioning + Scenario: Term hooks are functioning for Drupal 7 Given "tags" terms: | Label | | Tag one | @@ -259,7 +234,7 @@ Feature: DrupalContext And I should see "Tag two" @d8 - Scenario: Term hooks are functioning + Scenario: Term hooks are functioning for Drupal 8 Given "tags" terms: | Label | | Tag one | diff --git a/features/api_background.feature b/features/api_background.feature index 3d911995..4d232987 100644 --- a/features/api_background.feature +++ b/features/api_background.feature @@ -1,5 +1,5 @@ @d6 @d7 @d8 @api -Feature: DrupalContext +Feature: DrupalContext with background steps Test DrupalContext in combination with Backgrounds Background: @@ -8,12 +8,12 @@ Feature: DrupalContext | Tag one | | Tag two | - Given users: + And users: | name | | User one | | User two | - Given "article" content: + And "article" content: | title | | Node one | | Node two | diff --git a/features/blackbox.feature b/features/blackbox.feature index 62c6b729..a7218419 100644 --- a/features/blackbox.feature +++ b/features/blackbox.feature @@ -68,21 +68,21 @@ Feature: Test DrupalContext And I should see the "div" element with the "class" attribute set to "class3" in the "left header" region Scenario: Error messages - Given I am on "user.html" - When I press "Log in" - Then I should see the error message "Password field is required" - And I should not see the error message "Sorry, unrecognized username or password" - And I should see the following error messages: - | error messages | - | Username or email field is required. | - | Password field is required | - And I should not see the following error messages: - | error messages | - | Sorry, unrecognized username or password | - | Unable to send e-mail. Contact the site administrator if the problem persists | - - @javascript - Scenario: Zombie driver is functional - Given I am on the homepage - When I click "Download & Extend" - Then I should see the link "Distributions" + Given I am on "user.html" + When I press "Log in" + Then I should see the error message "Password field is required" + And I should not see the error message "Sorry, unrecognized username or password" + And I should see the following error messages: + | error messages | + | Username or email field is required. | + | Password field is required | + And I should not see the following error messages: + | error messages | + | Sorry, unrecognized username or password | + | Unable to send e-mail. Contact the site administrator if the problem persists | + + @javascript + Scenario: Zombie driver is functional + Given I am on the homepage + When I click "Download & Extend" + Then I should see the link "Distributions" diff --git a/features/d6.feature b/features/d6.feature index b79e7e1e..5ca7933e 100644 --- a/features/d6.feature +++ b/features/d6.feature @@ -3,27 +3,23 @@ Feature: Environment check Scenario: Frontpage Given I am not logged in - And I am on the homepage + And I am on the homepage Then I should see "User login" Scenario: assertAnonymousUser Given I am an anonymous user - @api Scenario: assertAuthenticatedByRole Given I am logged in as a user with the "authenticated" role - @api Scenario: assertAuthenticatedByRoleWithGivenFields Given I am logged in as a user with the "authenticated" role and I have the following fields: | name | test | - @api Scenario: createNode Given I am viewing a story with the title "test" Then I should see "test" - @api Scenario: createNodes Given article content: | title | author | status | created | @@ -31,12 +27,10 @@ Feature: Environment check When I am viewing a content with the title "My title" Then I should see "My title" - @api Scenario: createTerm Given I am viewing a tags term with the name "example tag" Then I should see "example tag" - @api Scenario: createUsers Given I am logged in as a user with the "administer users" permission And users: @@ -45,9 +39,8 @@ Feature: Environment check | user bar | baz@bar.com | When I visit "admin/user/user" Then I should see "user foo" - And I should see "user bar" + And I should see "user bar" - @api Scenario: create node with terms. Given tags terms: | name | diff --git a/features/d8.feature b/features/d8.feature index 6cefd974..96d94bb5 100644 --- a/features/d8.feature +++ b/features/d8.feature @@ -1,22 +1,22 @@ @d8 @api -Feature: DrupalContext +Feature: DrupalContext for Drupal 8 In order to prove the Drupal context is working properly for Drupal 8 As a developer I need to use the step definitions of this context - Scenario: Create and log in as a user + Scenario: Create and log in as a user for Drupal 8 Given I am logged in as a user with the "authenticated user" role When I click "My account" Then I should see the text "Member for" - Scenario: Target links within table rows + Scenario: Target links within table rows for Drupal 8 Given I am logged in as a user with the "administrator" role When I am at "admin/structure/types" And I click "Manage fields" in the "Article" row Then I should be on "admin/structure/types/manage/article/fields" And I should see the link "Add field" - Scenario: Create users with roles + Scenario: Create users with roles for Drupal 8 Given users: | name | mail | roles | | Joe User | joe@example.com | Administrator | @@ -26,7 +26,7 @@ Feature: DrupalContext Then I should see the text "Administrator" in the "Joe User" row And I should not see the text "administrator" in the "Jane Doe" row - Scenario: Find a heading in a region + Scenario: Find a heading in a region for Drupal 8 Given I am not logged in When I am on the homepage Then I should see the heading "Search" in the "left sidebar" region diff --git a/features/drush.feature b/features/drush.feature index ccc79cff..81aece17 100644 --- a/features/drush.feature +++ b/features/drush.feature @@ -7,15 +7,15 @@ Feature: Drush-specific steps Scenario: drush command with text matching: drush output correct status Given I run drush "st" Then drush output should contain "Drupal version" - Then drush output should contain "Site URI" - Then drush output should match "/.*Site\sURI\s+:.*/" - Then drush output should contain "Database driver" - Then drush output should contain "Successful" - Then drush output should not contain "NonExistantWord" + And drush output should contain "Site URI" + And drush output should match "/.*Site\sURI\s+:.*/" + And drush output should contain "Database driver" + And drush output should contain "Successful" + And drush output should not contain "NonExistantWord" Scenario: drush command with arguments: re-enable toolbar Given I run drush "en" "toolbar -y" - And I run drush "en" "toolbar -y" + And I run drush "en" "toolbar -y" Then drush output should contain "toolbar is already enabled." Scenario: Create and view a node with fields using the Drush driver diff --git a/features/field_handlers.feature b/features/field_handlers.feature index da8448cf..17160180 100644 --- a/features/field_handlers.feature +++ b/features/field_handlers.feature @@ -134,7 +134,7 @@ Feature: FieldHandlers But I should not see the link "Tag three" And I should see "Page one" And I should see "Page two" - But I should not see "Page three" + And I should not see "Page three" And I should see "Belgium" And I should see "Brussel" And I should see "1000" diff --git a/features/mail.feature b/features/mail.feature index 4890ee30..53c1f24b 100644 --- a/features/mail.feature +++ b/features/mail.feature @@ -49,7 +49,6 @@ Feature: MailContext | subject | | test 1 | - Scenario: No mail is sent Then no mail has been sent diff --git a/features/messages.feature b/features/messages.feature index 802bbd7d..7ed6aeb1 100644 --- a/features/messages.feature +++ b/features/messages.feature @@ -7,7 +7,7 @@ Feature: Ensure that messages are working properly on local installs Given I am on "/user/login" When I fill in "a fake user" for "Username" And I fill in "a fake password" for "Password" - When I press "Log in" + And I press "Log in" Then I should see the error message "Unrecognized username or password" @javascript @@ -15,5 +15,5 @@ Feature: Ensure that messages are working properly on local installs Given I am on "/user/login" When I fill in "a fake user" for "Username" And I fill in "a fake password" for "Password" - When I press "Log in" + And I press "Log in" Then I should see the error message "Unrecognized username or password" diff --git a/features/subcontexts/find.feature b/features/subcontexts/find.feature index 91af75f0..034ae522 100644 --- a/features/subcontexts/find.feature +++ b/features/subcontexts/find.feature @@ -54,15 +54,15 @@ Feature: Ability to find Drupal sub-contexts """ Scenario: Step-definitions in sub-contexts are available - When I run "behat --no-colors -dl" - Then the output should contain: + When I run "behat --no-colors -dl" + Then the output should contain: """ Then /^I should have a subcontext definition$/ """ - Scenario: Subcontext can be instantiated - When I run "behat --no-colors" - Then the output should contain: - """ - TODO: write pending definition - """ + Scenario: Subcontext can be instantiated + When I run "behat --no-colors" + Then the output should contain: + """ + TODO: write pending definition + """ diff --git a/package.json b/package.json index 20df6400..6fe1995c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,10 @@ { "devDependencies": { + "gherkin-lint": "^2.12.0", "zombie": "^2.5" + }, + "scripts": { + "gherkin-lint": "gherkin-lint features", + "test": "npm run gherkin-lint" } } From 5a797b7b7ba18cbcd1a62a6df9b220e83777cea5 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Thu, 20 Sep 2018 09:53:09 -0700 Subject: [PATCH 05/50] Fix coding standards. - Fixes #507 - Pins coder to 8.2.x as 8.3.x has issues. --- composer.json | 2 +- .../Context/RawDrupalContext.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 2705f769..6c9243f9 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "phpspec/phpspec": "~2.0 || ~4.0", "behat/mink-zombie-driver": "^1.2", "jakub-onderka/php-parallel-lint": "^0.9.2", - "drupal/coder": "^8.2" + "drupal/coder": "~8.2.12" }, "scripts": { "test": [ diff --git a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php index 3d2593e4..b8b9ae18 100644 --- a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php @@ -404,17 +404,17 @@ public function parseEntityFields($entity_type, \stdClass $entity) // Reset the multicolumn field if the field name does not contain a column. if (strpos($field, ':') === false) { $multicolumn_field = ''; - } // Start tracking a new multicolumn field if the field name contains a ':' - // which is preceded by at least 1 character. - elseif (strpos($field, ':', 1) !== false) { + } elseif (strpos($field, ':', 1) !== false) { + // Start tracking a new multicolumn field if the field name contains a ':' + // which is preceded by at least 1 character. list($multicolumn_field, $multicolumn_column) = explode(':', $field); - } // If a field name starts with a ':' but we are not yet tracking a - // multicolumn field we don't know to which field this belongs. - elseif (empty($multicolumn_field)) { + } elseif (empty($multicolumn_field)) { + // If a field name starts with a ':' but we are not yet tracking a + // multicolumn field we don't know to which field this belongs. throw new \Exception('Field name missing for ' . $field); - } // Update the column name if the field name starts with a ':' and we are - // already tracking a multicolumn field. - else { + } else { + // Update the column name if the field name starts with a ':' and we are + // already tracking a multicolumn field. $multicolumn_column = substr($field, 1); } From a5addfa1c474f8811a6427babe21a56d74503246 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Mon, 1 Oct 2018 23:59:15 +0300 Subject: [PATCH 06/50] Provide TagTrait to replace ScenarioTagTrait. Fixes #509. --- .../DrupalExtension/Context/MinkContext.php | 14 ++-- src/Drupal/DrupalExtension/FeatureTrait.php | 46 +++++++++++ .../DrupalExtension/ScenarioTagTrait.php | 2 +- src/Drupal/DrupalExtension/ScenarioTrait.php | 43 ++++++++++ src/Drupal/DrupalExtension/TagTrait.php | 82 +++++++++++++++++++ src/Drupal/DrupalExtension/TagTraitHelper.php | 25 ++++++ 6 files changed, 205 insertions(+), 7 deletions(-) create mode 100644 src/Drupal/DrupalExtension/FeatureTrait.php create mode 100644 src/Drupal/DrupalExtension/ScenarioTrait.php create mode 100644 src/Drupal/DrupalExtension/TagTrait.php create mode 100644 src/Drupal/DrupalExtension/TagTraitHelper.php diff --git a/src/Drupal/DrupalExtension/Context/MinkContext.php b/src/Drupal/DrupalExtension/Context/MinkContext.php index 69b15725..e1d75532 100644 --- a/src/Drupal/DrupalExtension/Context/MinkContext.php +++ b/src/Drupal/DrupalExtension/Context/MinkContext.php @@ -5,7 +5,7 @@ use Behat\Behat\Context\TranslatableContext; use Behat\Mink\Exception\UnsupportedDriverActionException; use Behat\MinkExtension\Context\MinkContext as MinkExtension; -use Drupal\DrupalExtension\ScenarioTagTrait; +use Drupal\DrupalExtension\TagTrait; /** * Extensions to the Mink Extension. @@ -13,7 +13,7 @@ class MinkContext extends MinkExtension implements TranslatableContext { - use ScenarioTagTrait; + use TagTrait; /** * Returns list of definition translation resources paths. @@ -95,8 +95,11 @@ public function assertEnterField($field, $value) public function beforeJavascriptStep($event) { /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ - $tags = $this->getCurrentScenarioTags($event); - if (!in_array('javascript', $tags)) { + // Make sure the feature is registered in case this hook fires before + // ::registerFeature() which is also a @BeforeStep. Behat doesn't + // support ordering hooks. + $this->getTagTraitHelper()->registerFeature($event); + if (!$this->hasTag('javascript')) { return; } $text = $event->getStep()->getText(); @@ -113,8 +116,7 @@ public function beforeJavascriptStep($event) public function afterJavascriptStep($event) { /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ - $tags = $this->getCurrentScenarioTags($event); - if (!in_array('javascript', $tags)) { + if (!$this->hasTag('javascript')) { return; } $text = $event->getStep()->getText(); diff --git a/src/Drupal/DrupalExtension/FeatureTrait.php b/src/Drupal/DrupalExtension/FeatureTrait.php new file mode 100644 index 00000000..13b500ec --- /dev/null +++ b/src/Drupal/DrupalExtension/FeatureTrait.php @@ -0,0 +1,46 @@ +currentFeature = $scope->getFeature(); + } + + /** + * @return \Behat\Gherkin\Node\FeatureNode + */ + protected function getFeature() + { + return $this->currentFeature; + } +} diff --git a/src/Drupal/DrupalExtension/ScenarioTagTrait.php b/src/Drupal/DrupalExtension/ScenarioTagTrait.php index a54b0f05..5420c9b0 100644 --- a/src/Drupal/DrupalExtension/ScenarioTagTrait.php +++ b/src/Drupal/DrupalExtension/ScenarioTagTrait.php @@ -14,7 +14,7 @@ * * The solution is documented in this issue: https://github.com/Behat/Behat/issues/703#issuecomment-86687563 * - * @package Drupal\DrupalExtension + * @deprecated Use \Drupal\DrupalExtension\TagTrait instead. */ trait ScenarioTagTrait { diff --git a/src/Drupal/DrupalExtension/ScenarioTrait.php b/src/Drupal/DrupalExtension/ScenarioTrait.php new file mode 100644 index 00000000..4979e45b --- /dev/null +++ b/src/Drupal/DrupalExtension/ScenarioTrait.php @@ -0,0 +1,43 @@ +currentScenario = $scope->getScenario(); + } + + /** + * @return \Behat\Gherkin\Node\ScenarioInterface + */ + protected function getScenario() + { + return $this->currentScenario; + } +} diff --git a/src/Drupal/DrupalExtension/TagTrait.php b/src/Drupal/DrupalExtension/TagTrait.php new file mode 100644 index 00000000..46117191 --- /dev/null +++ b/src/Drupal/DrupalExtension/TagTrait.php @@ -0,0 +1,82 @@ +getTagTraitHelper()->registerScenario($scope); + } + + if ($scope instanceof BeforeStepScope) { + $this->getTagTraitHelper()->registerFeature($scope); + } + } + + /** + * Returns the helper class as a singleton. + * + * @return \Drupal\DrupalExtension\TagTraitHelper + */ + protected function getTagTraitHelper() + { + if (empty($this->tagTraitHelper)) { + $this->tagTraitHelper = new TagTraitHelper(); + } + return $this->tagTraitHelper; + } + + /** + * Returns all tags for the current scenario and feature. + * + * @return string[] + */ + protected function getTags() + { + $featureTags = $this->getTagTraitHelper()->getFeature()->getTags(); + $scenarioTags = $this->getTagTraitHelper()->getScenario()->getTags(); + return array_unique(array_merge($featureTags, $scenarioTags)); + } + + /** + * Checks whether the current scenario or feature has the given tag. + * + * @param string $tag + * + * @return bool + */ + protected function hasTag($tag) + { + return in_array($tag, $this->getTags()); + } +} diff --git a/src/Drupal/DrupalExtension/TagTraitHelper.php b/src/Drupal/DrupalExtension/TagTraitHelper.php new file mode 100644 index 00000000..dd26cc44 --- /dev/null +++ b/src/Drupal/DrupalExtension/TagTraitHelper.php @@ -0,0 +1,25 @@ +$name(...$arguments); + } +} From 3cc58028033bfce7320f473c335621f173e520bf Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Tue, 2 Oct 2018 00:43:46 +0300 Subject: [PATCH 07/50] Add a test. --- features/blackbox.feature | 6 +++++ features/bootstrap/FeatureContext.php | 34 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/features/blackbox.feature b/features/blackbox.feature index a7218419..be28ae70 100644 --- a/features/blackbox.feature +++ b/features/blackbox.feature @@ -86,3 +86,9 @@ Feature: Test DrupalContext Given I am on the homepage When I click "Download & Extend" Then I should see the link "Distributions" + + @scenariotag + Scenario: Check tags on feature and scenario + Then the "scenariotag" tag should be present + And the "blackbox" tag should be present + But the "nonexisting" tag should not be present diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 196b4894..53458df6 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -5,6 +5,7 @@ use Drupal\DrupalExtension\Context\RawDrupalContext; use Drupal\DrupalExtension\Hook\Scope\BeforeNodeCreateScope; use Drupal\DrupalExtension\Hook\Scope\EntityScope; +use Drupal\DrupalExtension\TagTrait; use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; @@ -16,6 +17,9 @@ * conflicts. */ class FeatureContext extends RawDrupalContext { + + use TagTrait; + /** * Hook into node creation to test `@beforeNodeCreate` * @@ -419,6 +423,36 @@ public function itShouldFail($success) } } + /** + * Checks if the current scenario or feature has the given tag. + * + * @Then the :tag tag should be present + * + * @param string $tag + * The tag to check. + */ + public function shouldHaveTag($tag) + { + if (!$this->hasTag($tag)) { + throw new \Exception("Expected tag $tag was not found in the scenario or feature."); + } + } + + /** + * Checks if the current scenario or feature does not have the given tag. + * + * @Then the :tag tag should not be present + * + * @param string $tag + * The tag to check. + */ + public function shouldNotHaveTag($tag) + { + if ($this->hasTag($tag)) { + throw new \Exception("Expected tag $tag was found in the scenario or feature."); + } + } + private function getExitCode() { return $this->process->getExitCode(); From d6fcacdd020c8d46aa1b37a42902d4b40b414649 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Tue, 2 Oct 2018 10:12:21 +0200 Subject: [PATCH 08/50] Start supporting Drupal 7 on PHP 7.1. --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b989be53..372163eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,9 +25,6 @@ matrix: env: DRUPAL_VERSION=6 - php: 7.1 env: DRUPAL_VERSION=6 - allow_failures: - - php: 7.1 - env: DRUPAL_VERSION=7 # Enable Travis containers. sudo: false From 686877e177651846e64e2682a95e4f99e1a2c80c Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 3 Oct 2018 15:41:33 +0300 Subject: [PATCH 09/50] Support PHP 5.5. --- src/Drupal/DrupalExtension/TagTraitHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/TagTraitHelper.php b/src/Drupal/DrupalExtension/TagTraitHelper.php index dd26cc44..ae37207d 100644 --- a/src/Drupal/DrupalExtension/TagTraitHelper.php +++ b/src/Drupal/DrupalExtension/TagTraitHelper.php @@ -20,6 +20,6 @@ class TagTraitHelper */ public function __call($name, $arguments) { - return $this->$name(...$arguments); + return call_user_func_array([$this, $name], $arguments); } } From 1ddcaee7170561a256f45eee50bc015c42e772b2 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 3 Oct 2018 15:50:59 +0300 Subject: [PATCH 10/50] Start testing on PHP 7.2. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 372163eb..7afa6b30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 env: global: @@ -25,6 +26,8 @@ matrix: env: DRUPAL_VERSION=6 - php: 7.1 env: DRUPAL_VERSION=6 + - php: 7.2 + env: DRUPAL_VERSION=6 # Enable Travis containers. sudo: false From c20e0916bea0d46d52eb82f0c847d0d00c3e5d91 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 3 Oct 2018 16:54:46 +0300 Subject: [PATCH 11/50] Patch Features to work with PHP 7.2 on Drupal 7. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7afa6b30..5d72ec4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,6 +76,9 @@ before_script: # @todo Re-enable behat drush endpoint testing. # @see https://github.com/jhedstrom/drupalextension/issues/458 - test ${DRUPAL_VERSION} -eq 6 || test ${DRUPAL_VERSION} -eq 8 || (test ${DRUPAL_VERSION} -eq 7 && drush help behat) + # Patch Features to work with PHP 7.2 on Drupal 7. + # @see https://www.drupal.org/project/features/issues/2931464 + - test \! ${DRUPAL_VERSION} -eq 7 || curl -s https://www.drupal.org/files/issues/2018-03-12/features-support_php_72-2931464-10.patch | patch -p1 -d ${TRAVIS_BUILD_DIR}/${MODULE_PATH}/features/ # Only revert features on Drupal 7. - test \! ${DRUPAL_VERSION} -eq 7 || drush --yes fr behat_test # Disable the page cache on Drupal 8. From 6a7199023976ccf10dd067cd13e385ab2741b4cd Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 3 Oct 2018 18:05:59 +0300 Subject: [PATCH 12/50] Factor out the TagTraitHelper. --- .../DrupalExtension/Context/MinkContext.php | 2 +- src/Drupal/DrupalExtension/TagTrait.php | 53 ++----------------- src/Drupal/DrupalExtension/TagTraitHelper.php | 25 --------- 3 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 src/Drupal/DrupalExtension/TagTraitHelper.php diff --git a/src/Drupal/DrupalExtension/Context/MinkContext.php b/src/Drupal/DrupalExtension/Context/MinkContext.php index e1d75532..b7bf9e1c 100644 --- a/src/Drupal/DrupalExtension/Context/MinkContext.php +++ b/src/Drupal/DrupalExtension/Context/MinkContext.php @@ -98,7 +98,7 @@ public function beforeJavascriptStep($event) // Make sure the feature is registered in case this hook fires before // ::registerFeature() which is also a @BeforeStep. Behat doesn't // support ordering hooks. - $this->getTagTraitHelper()->registerFeature($event); + $this->registerFeature($event); if (!$this->hasTag('javascript')) { return; } diff --git a/src/Drupal/DrupalExtension/TagTrait.php b/src/Drupal/DrupalExtension/TagTrait.php index 46117191..b703459d 100644 --- a/src/Drupal/DrupalExtension/TagTrait.php +++ b/src/Drupal/DrupalExtension/TagTrait.php @@ -2,59 +2,12 @@ namespace Drupal\DrupalExtension; -use Behat\Behat\Hook\Scope\BeforeFeatureScope; -use Behat\Behat\Hook\Scope\BeforeScenarioScope; -use Behat\Behat\Hook\Scope\BeforeStepScope; -use Behat\Behat\Hook\Scope\StepScope; -use Behat\Gherkin\Node\ScenarioInterface; -use Behat\Testwork\Hook\Scope\HookScope; - /** * Helper methods to check the tags that are present on a feature or scenario. */ trait TagTrait { - - /** - * @var \Drupal\DrupalExtension\TagTraitHelper - */ - protected $tagTraitHelper; - - /** - * Tracks the scopes that can be tagged. - * - * Tags can be put on features as well as scenarios. This hook will fire - * when a new feature or scenario is being executed and will keep track of - * both so that the tags can be inspected during the test. - * - * @param \Behat\Testwork\Hook\Scope\HookScope $scope - * - * @BeforeScenario - * @BeforeStep - */ - public function registerTagContainingScopes(HookScope $scope) - { - if ($scope instanceof BeforeScenarioScope) { - $this->getTagTraitHelper()->registerScenario($scope); - } - - if ($scope instanceof BeforeStepScope) { - $this->getTagTraitHelper()->registerFeature($scope); - } - } - - /** - * Returns the helper class as a singleton. - * - * @return \Drupal\DrupalExtension\TagTraitHelper - */ - protected function getTagTraitHelper() - { - if (empty($this->tagTraitHelper)) { - $this->tagTraitHelper = new TagTraitHelper(); - } - return $this->tagTraitHelper; - } + use FeatureTrait, ScenarioTrait; /** * Returns all tags for the current scenario and feature. @@ -63,8 +16,8 @@ protected function getTagTraitHelper() */ protected function getTags() { - $featureTags = $this->getTagTraitHelper()->getFeature()->getTags(); - $scenarioTags = $this->getTagTraitHelper()->getScenario()->getTags(); + $featureTags = $this->getFeature()->getTags(); + $scenarioTags = $this->getScenario()->getTags(); return array_unique(array_merge($featureTags, $scenarioTags)); } diff --git a/src/Drupal/DrupalExtension/TagTraitHelper.php b/src/Drupal/DrupalExtension/TagTraitHelper.php deleted file mode 100644 index ae37207d..00000000 --- a/src/Drupal/DrupalExtension/TagTraitHelper.php +++ /dev/null @@ -1,25 +0,0 @@ - Date: Mon, 15 Oct 2018 10:50:33 +0300 Subject: [PATCH 13/50] Warn users when the message table is not correctly formatted. --- .../Context/MessageContext.php | 71 +++++++++++++++---- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/src/Drupal/DrupalExtension/Context/MessageContext.php b/src/Drupal/DrupalExtension/Context/MessageContext.php index 9b10c75a..1d41cff8 100644 --- a/src/Drupal/DrupalExtension/Context/MessageContext.php +++ b/src/Drupal/DrupalExtension/Context/MessageContext.php @@ -41,14 +41,17 @@ public function assertErrorVisible($message) /** * Checks if the current page contains the given set of error messages * - * @param $messages - * array An array of texts to be checked + * @param array $messages + * An array of texts to be checked. The first row should consist of the + * string "Error messages". * * @Then I should see the following error message(s): */ public function assertMultipleErrors(TableNode $messages) { + $this->assertValidMessageTable($messages, 'error messages'); foreach ($messages->getHash() as $key => $value) { + $value = array_change_key_case($value); $message = trim($value['error messages']); $this->assertErrorVisible($message); } @@ -74,14 +77,17 @@ public function assertNotErrorVisible($message) /** * Checks if the current page does not contain the given set error messages * - * @param $messages - * array An array of texts to be checked + * @param array $messages + * An array of texts to be checked. The first row should consist of the + * string "Error messages". * * @Then I should not see the following error messages: */ public function assertNotMultipleErrors(TableNode $messages) { + $this->assertValidMessageTable($messages, 'error messages'); foreach ($messages->getHash() as $key => $value) { + $value = array_change_key_case($value); $message = trim($value['error messages']); $this->assertNotErrorVisible($message); } @@ -108,14 +114,17 @@ public function assertSuccessMessage($message) /** * Checks if the current page contains the given set of success messages * - * @param $message - * array An array of texts to be checked + * @param array $message + * An array of texts to be checked. The first row should consist of the + * string "Success messages". * * @Then I should see the following success messages: */ public function assertMultipleSuccessMessage(TableNode $messages) { + $this->assertValidMessageTable($messages, 'success messages'); foreach ($messages->getHash() as $key => $value) { + $value = array_change_key_case($value); $message = trim($value['success messages']); $this->assertSuccessMessage($message); } @@ -141,14 +150,17 @@ public function assertNotSuccessMessage($message) /** * Checks if the current page does not contain the given set of success messages * - * @param $message - * array An array of texts to be checked + * @param array $message + * An array of texts to be checked. The first row should consist of the + * string "Success messages". * * @Then I should not see the following success messages: */ public function assertNotMultipleSuccessMessage(TableNode $messages) { + $this->assertValidMessageTable($messages, 'success messages'); foreach ($messages->getHash() as $key => $value) { + $value = array_change_key_case($value); $message = trim($value['success messages']); $this->assertNotSuccessMessage($message); } @@ -175,14 +187,17 @@ public function assertWarningMessage($message) /** * Checks if the current page contains the given set of warning messages * - * @param $message - * array An array of texts to be checked + * @param array $message + * An array of texts to be checked. The first row should consist of the + * string "Warning messages". * * @Then I should see the following warning messages: */ public function assertMultipleWarningMessage(TableNode $messages) { + $this->assertValidMessageTable($messages, 'warning messages'); foreach ($messages->getHash() as $key => $value) { + $value = array_change_key_case($value); $message = trim($value['warning messages']); $this->assertWarningMessage($message); } @@ -208,14 +223,17 @@ public function assertNotWarningMessage($message) /** * Checks if the current page does not contain the given set of warning messages * - * @param $message - * array An array of texts to be checked + * @param array $message + * An array of texts to be checked. The first row should consist of the + * string "Warning messages". * * @Then I should not see the following warning messages: */ public function assertNotMultipleWarningMessage(TableNode $messages) { + $this->assertValidMessageTable($messages, 'warning messages'); foreach ($messages->getHash() as $key => $value) { + $value = array_change_key_case($value); $message = trim($value['warning messages']); $this->assertNotWarningMessage($message); } @@ -256,6 +274,35 @@ public function assertNotMessage($message) ); } + /** + * Checks whether the given list of messages is valid. + * + * This checks whether the list has only one column and has the correct + * header. + * + * @param \Behat\Gherkin\Node\TableNode $messages + * The list of messages. + * @param string $expected_header + * The header that should be present in the list. + */ + protected function assertValidMessageTable(TableNode $messages, $expected_header) + { + // Check that the table only contains a single column. + $header_row = $messages->getRow(0); + + $column_count = count($header_row); + if ($column_count != 1) { + throw new \RuntimeException("The list of $expected_header should only contain 1 column. It has $column_count columns."); + } + + // Check that the correct header is used. + $actual_header = reset($header_row); + if (strtolower(trim($actual_header)) !== $expected_header) { + $capitalized_header = ucfirst($expected_header); + throw new \RuntimeException("The list of $expected_header should have the header '$capitalized_header'."); + } + } + /** * Internal callback to check for a specific message in a given context. * From 6654a015b66c1d34e16f306a8495f42b7145e180 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Fri, 26 Oct 2018 12:55:40 -0700 Subject: [PATCH 14/50] Merge pull request #514 from jonpugh/patch-2 Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS Signed-off-by: Jonathan Hedstrom --- doc/environment.rst | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/doc/environment.rst b/doc/environment.rst index 81e5a523..0912cfa3 100644 --- a/doc/environment.rst +++ b/doc/environment.rst @@ -11,7 +11,7 @@ If you intend to run your tests on different environments these settings should not be committed to ``behat.yml``. Instead they should be exported in an environment variable. Before running tests Behat will check the ``BEHAT_PARAMS`` environment variable and add these settings to the ones that are present in -``behat.yml``. This variable should contain a JSON object with your settings. +``behat.yml``. This variable should contain a JSON object with your settings. Example JSON object: @@ -38,5 +38,47 @@ object into a single line and surround with single quotes: $ export BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"http://myproject.localhost"},"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"/var/www/myproject"}}}}' +You must also remove (or comment out) the entries that you use in behat.yml for the values in BEHAT_PARAMS to take affect. + +.. code-block:: yml + + default: + suites: + default: + contexts: + - FeatureContext + - Drupal\DrupalExtension\Context\DrupalContext + - Drupal\DrupalExtension\Context\MinkContext + - Drupal\DrupalExtension\Context\MessageContext + - Drupal\DrupalExtension\Context\DrushContext + extensions: + Behat\MinkExtension: + goutte: ~ + selenium2: ~ + # Must comment out for BEHAT_PARAMS to be effective. + # base_url: http://seven.l + Drupal\DrupalExtension: + # Anything used in BEHAT_PARAMS must be removed or commented. + # drupal: + # drupal_root: /var/www + # drush: + # alias: '@site' + blackbox: ~ + + # You can use profiles if you wish to allow users to run tests locally. + # Usage: + # bin/behat --profile=local + local: + extensions: + Behat\MinkExtension: + base_url: 'localhost' + Drupal\DrupalExtension: + drush: + alias: '@self' + drupal: + drupal_root: '../web' + + + There is also a `Drush extension `_ that can help you generate these environment variables. From a8bb5b2c6004d3fe5cc5b3b91cc59a6d21e6eb32 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Mon, 26 Nov 2018 15:30:36 -0800 Subject: [PATCH 15/50] Remove patch to Features module that has been committed. - Fixes #519 --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d72ec4d..7afa6b30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,9 +76,6 @@ before_script: # @todo Re-enable behat drush endpoint testing. # @see https://github.com/jhedstrom/drupalextension/issues/458 - test ${DRUPAL_VERSION} -eq 6 || test ${DRUPAL_VERSION} -eq 8 || (test ${DRUPAL_VERSION} -eq 7 && drush help behat) - # Patch Features to work with PHP 7.2 on Drupal 7. - # @see https://www.drupal.org/project/features/issues/2931464 - - test \! ${DRUPAL_VERSION} -eq 7 || curl -s https://www.drupal.org/files/issues/2018-03-12/features-support_php_72-2931464-10.patch | patch -p1 -d ${TRAVIS_BUILD_DIR}/${MODULE_PATH}/features/ # Only revert features on Drupal 7. - test \! ${DRUPAL_VERSION} -eq 7 || drush --yes fr behat_test # Disable the page cache on Drupal 8. From 7f3b38865fe1279a93f84f7368d55c59bc010541 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 18 Dec 2018 11:13:58 -0800 Subject: [PATCH 16/50] Update composer path. - Also retry on composer install which is prone to memory issues. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7afa6b30..463ef0eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ php: env: global: - - PATH=$PATH:/home/travis/.composer/vendor/bin + - PATH=$PATH:/home/travis/.config/composer/vendor/bin - TRAVIS_NODE_VERSION="4.0.0" matrix: - DRUPAL_VERSION=6 @@ -39,7 +39,7 @@ install: # @see https://github.com/jhedstrom/drupalextension/issues/413 # @todo Re-enable behat drush endpoint testing. # @see https://github.com/jhedstrom/drupalextension/issues/458 - - test ${DRUPAL_VERSION} -ne 8 || composer require --prefer-source drush/drush:~9.0 symfony/dependency-injection:3.4.4 + - test ${DRUPAL_VERSION} -ne 8 || COMPOSER_MEMORY_LIMIT=-1 travis_retry composer require drush/drush:~9.0 symfony/dependency-injection:3.4.4 - composer install # Install drush globally. - (test ${DRUPAL_VERSION} -ne 8 && composer global require drush/drush:~8.0 drupal/drupal-driver) || composer global require drush/drush:~9.0 From 50475521207f7bc247090498fc1296cf260c46ae Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 18 Dec 2018 10:43:43 -0800 Subject: [PATCH 17/50] Corresponding list handler fixes for the Drupal Driver. - Changes to test compatiblity with https://github.com/jhedstrom/DrupalDriver/issues/168 --- features/field_handlers.feature | 13 +++++++------ .../behat_test/behat_test.features.field_base.inc | 6 +++--- .../field.storage.node.field_post_select.yml | 8 ++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/features/field_handlers.feature b/features/field_handlers.feature index 17160180..b0f4b539 100644 --- a/features/field_handlers.feature +++ b/features/field_handlers.feature @@ -19,7 +19,7 @@ Feature: FieldHandlers | field_post_reference | Page one, Page two | | field_post_date | 2015-02-08 17:45:00 | | field_post_links | Link 1 - http://example.com, Link 2 - http://example.com | - | field_post_select | One, Two | + | field_post_select | Select value one, Select value two | | field_post_address | country: BE - locality: Brussel - thoroughfare: Louisalaan 1 - postal_code: 1000 | Then I should see "Post title" And I should see "PLACEHOLDER BODY" @@ -28,8 +28,9 @@ Feature: FieldHandlers And I should see "Sunday, February 8, 2015" And I should see the link "Link 1" And I should see the link "Link 2" - And I should see "One" - And I should see "Two" + And I should see "Select value one" + And I should see "Select value two" + And I should not see "Select value three" And I should see "Belgium" And I should see "Brussel" And I should see "1000" @@ -52,15 +53,15 @@ Feature: FieldHandlers | reference | Page one, Page two | | date | 2015-02-08 17:45:00 | | links | Link 1 - http://example.com, Link 2 - http://example.com | - | select | One, Two | + | select | Select value one, Select value two | | address | country: BE - locality: Brussel - thoroughfare: Louisalaan 1 - postal_code: 1000 | Then I should see "Page one" And I should see "Page two" And I should see "Sunday, February 8, 2015" And I should see the link "Link 1" And I should see the link "Link 2" - And I should see "One" - And I should see "Two" + And I should see "Select value one" + And I should see "Select value two" And I should see "Belgium" And I should see "Brussel" And I should see "1000" diff --git a/fixtures/drupal7/modules/behat_test/behat_test.features.field_base.inc b/fixtures/drupal7/modules/behat_test/behat_test.features.field_base.inc index 1e39d628..23ab188f 100644 --- a/fixtures/drupal7/modules/behat_test/behat_test.features.field_base.inc +++ b/fixtures/drupal7/modules/behat_test/behat_test.features.field_base.inc @@ -193,9 +193,9 @@ function behat_test_field_default_field_bases() { 'module' => 'list', 'settings' => array( 'allowed_values' => array( - 1 => 'One', - 2 => 'Two', - 3 => 'Three', + 1 => 'Select value one', + 2 => 'Select value two', + 3 => 'Select value three', ), 'allowed_values_function' => '', ), diff --git a/fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_select.yml b/fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_select.yml index 415c6e13..35f51e7b 100644 --- a/fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_select.yml +++ b/fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_select.yml @@ -12,17 +12,17 @@ settings: allowed_values: - value: '1' - label: One + label: Select value one - value: '2' - label: Two + label: Select value two - value: '3' - label: Three + label: Select value three allowed_values_function: '' module: options locked: false -cardinality: 1 +cardinality: -1 translatable: true indexes: { } persist_with_no_fields: false From 3836ccb7fce9a16d26197ee7df13744f0a5799a8 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 19 Dec 2018 09:24:54 -0800 Subject: [PATCH 18/50] Prep for Beta 2. --- CHANGELOG.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8975a4fb..9e433668 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [4.0.0 beta2] 2018-12-19 +### Added + * [#514](https://github.com/jhedstrom/drupalextension/pull/514) Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS. + * [#504](https://github.com/jhedstrom/drupalextension/issues/504) Added Gherkin linting. + * [#507](https://github.com/jhedstrom/drupalextension/pull/511) Test Drupal 7 on PHP 7. + * [#516](https://github.com/jhedstrom/drupalextension/pull/516) Warn users when message table is not correctly formatted. +### Changed + * [#510](https://github.com/jhedstrom/drupalextension/pull/510) Provide TagTrait to replace ScenarioTagTrait. + * [#512](https://github.com/jhedstrom/drupalextension/pull/512) Start testing on PHP 7.2. + * [#521](https://github.com/jhedstrom/drupalextension/pull/521) Updated tests to work with DrupalDriver string field handlers change. +### Fixed + * [#522](https://github.com/jhedstrom/drupalextension/pull/522) Composer path changed on travis. + * [#520](https://github.com/jhedstrom/drupalextension/pull/520) Removes patch applied to Features module that was committed. + * [#502](https://github.com/jhedstrom/drupalextension/pull/502) RawDrupalContext::loggedIn() can return false positive. + * [#507](https://github.com/jhedstrom/drupalextension/issues/507) PHP coding standards update. + * [#499](https://github.com/jhedstrom/drupalextension/pull/499) Fix config context backup strategy. ## [4.0.0 beta1] 2018-04-17 ### Added * [#479](https://github.com/jhedstrom/drupalextension/issues/479): Provide more verbose exception when AJAX fails. @@ -77,7 +93,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#437](https://github.com/jhedstrom/drupalextension/pull/437): Radio button selector fix. * [#439](https://github.com/jhedstrom/drupalextension/pull/439): Symfony 3 compatibility follow-up fix. -[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta1...HEAD +[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...HEAD +[4.0.0 beta2]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta1...v4.0.0beta2 [4.0.0 beta1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha4...v4.0.0beta1 [4.0.0 alpha4]:https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha3...v4.0.0alpha4 [4.0.0 alpha3]:https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha2...v4.0.0alpha3 From 880e9c56b34c9bdacc7678030998b6a1456c42f7 Mon Sep 17 00:00:00 2001 From: digitole Date: Tue, 8 Jan 2019 11:15:29 +0100 Subject: [PATCH 19/50] Adding the option to specify a custom login/logout path in your behat.yml --- doc/blackbox.rst | 2 ++ .../Manager/DrupalAuthenticationManager.php | 9 +++++---- .../DrupalExtension/ServiceContainer/DrupalExtension.php | 8 ++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/blackbox.rst b/doc/blackbox.rst index f6a3477a..8da54136 100644 --- a/doc/blackbox.rst +++ b/doc/blackbox.rst @@ -89,6 +89,8 @@ customized the label visible to users, you can change that text as follows: Drupal\DrupalExtension: text: + login_url: "/user" + logout_url: "/user/logout" log_out: "Sign out" log_in: "Sign in" password_field: "Enter your password" diff --git a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php index 9f9f98b1..642f6a45 100644 --- a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php +++ b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php @@ -47,7 +47,7 @@ public function logIn(\stdClass $user) // Ensure we aren't already logged in. $this->fastLogout(); - $this->getSession()->visit($this->locatePath('/user')); + $this->getSession()->visit($this->locatePath($this->getDrupalText('login_url'))); $element = $this->getSession()->getPage(); $element->fillField($this->getDrupalText('username_field'), $user->name); $element->fillField($this->getDrupalText('password_field'), $user->pass); @@ -75,7 +75,7 @@ public function logIn(\stdClass $user) */ public function logout() { - $this->getSession()->visit($this->locatePath('/user/logout')); + $this->getSession()->visit($this->locatePath($this->getDrupalText('logout_url'))); $this->userManager->setCurrentUser(false); } @@ -104,8 +104,9 @@ public function loggedIn() } // Some themes do not add that class to the body, so lets check if the - // login form is displayed on /user/login. - $session->visit($this->locatePath('/user/login')); + // login form is displayed on the page with the login form (defaults to + // /user/login) + $session->visit($this->locatePath($this->getDrupalText('login_url'))); if ($page->has('css', $this->getDrupalSelector('login_form_selector'))) { $this->fastLogout(); return false; diff --git a/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php b/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php index 30ebe956..98e78ca6 100644 --- a/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php +++ b/src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php @@ -116,6 +116,8 @@ public function configure(ArrayNodeDefinition $builder) arrayNode('text')-> info( 'Text strings, such as Log out or the Username field can be altered via behat.yml if they vary from the default values.' . PHP_EOL + . ' login_url: "/user"' . PHP_EOL + . ' logout_url: "/user/logout"' . PHP_EOL . ' log_out: "Sign out"' . PHP_EOL . ' log_in: "Sign in"' . PHP_EOL . ' password_field: "Enter your password"' . PHP_EOL @@ -123,6 +125,12 @@ public function configure(ArrayNodeDefinition $builder) )-> addDefaultsIfNotSet()-> children()-> + scalarNode('login_url')-> + defaultValue('/user')-> + end()-> + scalarNode('logout_url')-> + defaultValue('/user/logout')-> + end()-> scalarNode('log_in')-> defaultValue('Log in')-> end()-> From ed4c70abf55830073ba1025cbee7085e7590d267 Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Tue, 5 Feb 2019 00:32:47 +0200 Subject: [PATCH 20/50] Provide a step to check that a button is not in a region. --- .../DrupalExtension/Context/MarkupContext.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Drupal/DrupalExtension/Context/MarkupContext.php b/src/Drupal/DrupalExtension/Context/MarkupContext.php index 08179f7b..fb6afc2c 100644 --- a/src/Drupal/DrupalExtension/Context/MarkupContext.php +++ b/src/Drupal/DrupalExtension/Context/MarkupContext.php @@ -58,6 +58,30 @@ public function assertRegionButton($button, $region) } } + /** + * Asserts that a button does not exists in a region. + * + * @Then I should not see the button :button in the :region( region) + * @Then I should not see the :button button in the :region( region) + * + * @param $button + * string The id|name|title|alt|value of the button + * @param $region + * string The region in which the button should not be found + * + * @throws \Exception + * If region is not found or the button is found within the region. + */ + public function assertNotRegionButton($button, $region) + { + $regionObj = $this->getRegion($region); + + $buttonObj = $regionObj->findButton($button); + if (!empty($buttonObj)) { + throw new \Exception(sprintf("The button '%s' was found in the region '%s' on the page %s but should not", $button, $region, $this->getSession()->getCurrentUrl())); + } + } + /** * @Then I( should) see the :tag element in the :region( region) */ From 2002f6e5170d936dbda73e637a800f06d231357b Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Tue, 5 Feb 2019 13:20:59 +0200 Subject: [PATCH 21/50] Provide a test for the assert_not_button_in_region. --- features/blackbox.feature | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/blackbox.feature b/features/blackbox.feature index be28ae70..1d0f6dd1 100644 --- a/features/blackbox.feature +++ b/features/blackbox.feature @@ -41,6 +41,10 @@ Feature: Test DrupalContext Given I am on the homepage Then I should see the "Search" button in the "navigation" + Scenario: Button not in region + Given I am on the homepage + Then I should not see the "Search" button in the "content" region + Scenario: Find an element in a region Given I am on the homepage Then I should see the "h1" element in the "left header" From 7c7c9a5f5fa1e22a061f2d9c7ed1d3f855af0067 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Tue, 5 Feb 2019 15:46:08 +0100 Subject: [PATCH 22/50] Throw a helpful exception if the AJAX timeout is missing due to a common mistake in the configuration. --- src/Drupal/DrupalExtension/Context/MinkContext.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Context/MinkContext.php b/src/Drupal/DrupalExtension/Context/MinkContext.php index b7bf9e1c..188220c7 100644 --- a/src/Drupal/DrupalExtension/Context/MinkContext.php +++ b/src/Drupal/DrupalExtension/Context/MinkContext.php @@ -152,7 +152,11 @@ function isAjaxing(instance) { ); }()); JS; - $result = $this->getSession()->wait(1000 * $this->getMinkParameter('ajax_timeout'), $condition); + $ajax_timeout = $this->getMinkParameter('ajax_timeout'); + if ($ajax_timeout === null) { + throw new \Exception('No AJAX timeout has been defined. Please verify that "Drupal\MinkExtension" is configured in behat.yml (and not "Behat\MinkExtension").'); + } + $result = $this->getSession()->wait(1000 * $ajax_timeout, $condition); if (!$result) { if ($event) { /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ From 4dcf5037efdf3dcc3587e1583bcd58bba0373fe2 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 6 Feb 2019 09:28:40 +0100 Subject: [PATCH 23/50] Suggest to use our overridden MinkContext throughout our documentation. --- CHANGELOG.md | 3 +++ README.md | 2 +- behat.yml.dist | 8 ++++---- doc/environment.rst | 8 ++++---- features/subcontexts/find.feature | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e433668..ddfc79c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Changed + * [#528](https://github.com/jhedstrom/drupalextension/pull/528) Show a more helpful failure when running `@javascript` + scenarios with incorrect configuration. ## [4.0.0 beta2] 2018-12-19 ### Added * [#514](https://github.com/jhedstrom/drupalextension/pull/514) Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS. diff --git a/README.md b/README.md index 6e9c1934..e2084564 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ the [Full documentation](https://behat-drupal-extension.readthedocs.org) contexts: - Drupal\DrupalExtension\Context\DrupalContext extensions: - Behat\MinkExtension: + Drupal\MinkExtension: goutte: ~ base_url: http://example.org/ # Replace with your site's URL Drupal\DrupalExtension: diff --git a/behat.yml.dist b/behat.yml.dist index 000eaeb6..de166ba5 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -44,7 +44,7 @@ drupal6: filters: tags: "@d6" extensions: - Behat\MinkExtension: + Drupal\MinkExtension: base_url: http://127.0.0.1:8888 Drupal\DrupalExtension: api_driver: "drupal" @@ -67,7 +67,7 @@ drupal7: filters: tags: "@d7" extensions: - Behat\MinkExtension: + Drupal\MinkExtension: base_url: http://127.0.0.1:8888 Drupal\DrupalExtension: api_driver: "drupal" @@ -92,7 +92,7 @@ drush: filters: tags: "@drushTest" extensions: - Behat\MinkExtension: + Drupal\MinkExtension: base_url: http://127.0.0.1:8888 Drupal\DrupalExtension: api_driver: "drush" @@ -119,7 +119,7 @@ drupal8: filters: tags: "@d8&&~@d8wip" extensions: - Behat\MinkExtension: + Drupal\MinkExtension: base_url: http://127.0.0.1:8888 Drupal\DrupalExtension: api_driver: "drupal" diff --git a/doc/environment.rst b/doc/environment.rst index 0912cfa3..86ce948d 100644 --- a/doc/environment.rst +++ b/doc/environment.rst @@ -19,7 +19,7 @@ Example JSON object: { "extensions": { - "Behat\\MinkExtension": { + "Drupal\\MinkExtension": { "base_url": "http://myproject.localhost" }, "Drupal\\DrupalExtension": { @@ -36,7 +36,7 @@ object into a single line and surround with single quotes: .. code-block:: bash - $ export BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"http://myproject.localhost"},"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"/var/www/myproject"}}}}' + $ export BEHAT_PARAMS='{"extensions":{"Drupal\\MinkExtension":{"base_url":"http://myproject.localhost"},"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"/var/www/myproject"}}}}' You must also remove (or comment out) the entries that you use in behat.yml for the values in BEHAT_PARAMS to take affect. @@ -52,7 +52,7 @@ You must also remove (or comment out) the entries that you use in behat.yml for - Drupal\DrupalExtension\Context\MessageContext - Drupal\DrupalExtension\Context\DrushContext extensions: - Behat\MinkExtension: + Drupal\MinkExtension: goutte: ~ selenium2: ~ # Must comment out for BEHAT_PARAMS to be effective. @@ -70,7 +70,7 @@ You must also remove (or comment out) the entries that you use in behat.yml for # bin/behat --profile=local local: extensions: - Behat\MinkExtension: + Drupal\MinkExtension: base_url: 'localhost' Drupal\DrupalExtension: drush: diff --git a/features/subcontexts/find.feature b/features/subcontexts/find.feature index 034ae522..3e71042b 100644 --- a/features/subcontexts/find.feature +++ b/features/subcontexts/find.feature @@ -43,7 +43,7 @@ Feature: Ability to find Drupal sub-contexts default: contexts: [Drupal\DrupalExtension\Context\DrupalContext] extensions: - Behat\MinkExtension: + Drupal\MinkExtension: goutte: ~ selenium2: ~ base_url: http://drupal.org From 0f6ed6ae6b905760ec36dfb66a81fb2a3cbae6fb Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 6 Feb 2019 09:29:57 +0100 Subject: [PATCH 24/50] Only throw the helpful exception in the case the unhelpful one was already being thrown. --- src/Drupal/DrupalExtension/Context/MinkContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Drupal/DrupalExtension/Context/MinkContext.php b/src/Drupal/DrupalExtension/Context/MinkContext.php index 188220c7..dc7200de 100644 --- a/src/Drupal/DrupalExtension/Context/MinkContext.php +++ b/src/Drupal/DrupalExtension/Context/MinkContext.php @@ -153,11 +153,11 @@ function isAjaxing(instance) { }()); JS; $ajax_timeout = $this->getMinkParameter('ajax_timeout'); - if ($ajax_timeout === null) { - throw new \Exception('No AJAX timeout has been defined. Please verify that "Drupal\MinkExtension" is configured in behat.yml (and not "Behat\MinkExtension").'); - } $result = $this->getSession()->wait(1000 * $ajax_timeout, $condition); if (!$result) { + if ($ajax_timeout === null) { + throw new \Exception('No AJAX timeout has been defined. Please verify that "Drupal\MinkExtension" is configured in behat.yml (and not "Behat\MinkExtension").'); + } if ($event) { /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ $event_data = ' ' . json_encode([ From d3db9fcdf28871c7e8d4f180d82bf4bd2306bc4d Mon Sep 17 00:00:00 2001 From: Ilias Dimopoulos Date: Wed, 6 Feb 2019 12:17:20 +0200 Subject: [PATCH 25/50] Change the name of the region for an existing one. --- features/blackbox.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/blackbox.feature b/features/blackbox.feature index 1d0f6dd1..25c3706a 100644 --- a/features/blackbox.feature +++ b/features/blackbox.feature @@ -43,7 +43,7 @@ Feature: Test DrupalContext Scenario: Button not in region Given I am on the homepage - Then I should not see the "Search" button in the "content" region + Then I should not see the "Search" button in the "right header" region Scenario: Find an element in a region Given I am on the homepage From 2938b26dbcf6e9223a6a9917217d729ade9e91cb Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 6 Feb 2019 12:51:41 +0200 Subject: [PATCH 26/50] Update changelog. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e433668..a69b5873 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Added + * [#527](https://github.com/jhedstrom/drupalextension/pull/527) Provide a step to check that a button is not in a region. ## [4.0.0 beta2] 2018-12-19 ### Added * [#514](https://github.com/jhedstrom/drupalextension/pull/514) Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS. From 94d3967b4f8b4f7b786863fda55c75abbed7d3d4 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 17 Jul 2019 09:51:17 -0700 Subject: [PATCH 27/50] Prep for 4.0.0. --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df6d3e20..9184f3f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [4.0.0] 2019-07-17 ### Changed * [#528](https://github.com/jhedstrom/drupalextension/pull/528) Show a more helpful failure when running `@javascript` scenarios with incorrect configuration. @@ -98,7 +99,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#437](https://github.com/jhedstrom/drupalextension/pull/437): Radio button selector fix. * [#439](https://github.com/jhedstrom/drupalextension/pull/439): Symfony 3 compatibility follow-up fix. -[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...HEAD +[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0...HEAD +[4.0.0]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...v4.0.0 [4.0.0 beta2]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta1...v4.0.0beta2 [4.0.0 beta1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha4...v4.0.0beta1 [4.0.0 alpha4]:https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha3...v4.0.0alpha4 From 901ddcc56014505bee1dd8e7815d240c2c85b9f6 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 17 Jul 2019 11:33:23 -0700 Subject: [PATCH 28/50] Drupal 8 now requires PHP 7 or greater. - Closes #541 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 463ef0eb..695b8663 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ matrix: env: DRUPAL_VERSION=8 - php: 5.6 env: DRUPAL_VERSION=6 + - php: 5.6 + env: DRUPAL_VERSION=8 - php: 7.0 env: DRUPAL_VERSION=6 - php: 7.1 From 59c8eca2dacd9040faab6bfbee6466493736afbb Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 17 Jul 2019 11:39:48 -0700 Subject: [PATCH 29/50] Pin symfony/translation to v3.4 - Fixes compatibility issue with 4.0 --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6c9243f9..7ad0e5d7 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "behat/mink-selenium2-driver": "~1.1", "drupal/drupal-driver": "^2.0.0", "symfony/dependency-injection": "~3.0", - "symfony/event-dispatcher": "~3.0" + "symfony/event-dispatcher": "~3.0", + "symfony/translation": "^3.4" }, "require-dev": { "phpspec/phpspec": "~2.0 || ~4.0", From e08e1af5e09a1921103f92f9d41ad1f34126e010 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 17 Jul 2019 12:16:24 -0700 Subject: [PATCH 30/50] Pin symfony/browserkit to v3. --- CHANGELOG.md | 2 ++ composer.json | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df6d3e20..541d9e9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). scenarios with incorrect configuration. ### Added * [#527](https://github.com/jhedstrom/drupalextension/pull/527) Provide a step to check that a button is not in a region. +### Fixed + * [#542](https://github.com/jhedstrom/drupalextension/pull/542) Fix issue with certain symfony 4 components being pulled in. ## [4.0.0 beta2] 2018-12-19 ### Added * [#514](https://github.com/jhedstrom/drupalextension/pull/514) Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS. diff --git a/composer.json b/composer.json index 7ad0e5d7..8b95b039 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ "behat/mink-goutte-driver": "~1.0", "behat/mink-selenium2-driver": "~1.1", "drupal/drupal-driver": "^2.0.0", + "symfony/browserkit": "^3.4", "symfony/dependency-injection": "~3.0", "symfony/event-dispatcher": "~3.0", "symfony/translation": "^3.4" From 23f8657cd2b7407402fe69bbe82b961a951118a7 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 17 Jul 2019 12:33:16 -0700 Subject: [PATCH 31/50] Fix typo in browser-kit. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8b95b039..183caacf 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "behat/mink-goutte-driver": "~1.0", "behat/mink-selenium2-driver": "~1.1", "drupal/drupal-driver": "^2.0.0", - "symfony/browserkit": "^3.4", + "symfony/browser-kit": "^3.4", "symfony/dependency-injection": "~3.0", "symfony/event-dispatcher": "~3.0", "symfony/translation": "^3.4" From f1a38348b1b9f72aa0f74cb1543560a5577d61d2 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 17 Jul 2019 14:20:37 -0700 Subject: [PATCH 32/50] Disable drush endpoint testing for now. See #458. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 695b8663..f4167e18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,7 +77,7 @@ before_script: - drush cc drush # @todo Re-enable behat drush endpoint testing. # @see https://github.com/jhedstrom/drupalextension/issues/458 - - test ${DRUPAL_VERSION} -eq 6 || test ${DRUPAL_VERSION} -eq 8 || (test ${DRUPAL_VERSION} -eq 7 && drush help behat) + # - test ${DRUPAL_VERSION} -eq 6 || test ${DRUPAL_VERSION} -eq 8 || (test ${DRUPAL_VERSION} -eq 7 && drush help behat) # Only revert features on Drupal 7. - test \! ${DRUPAL_VERSION} -eq 7 || drush --yes fr behat_test # Disable the page cache on Drupal 8. From 6ff38973833774d677140ddce6c9a6135b8c67dd Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 17 Jul 2019 14:47:55 -0700 Subject: [PATCH 33/50] Comment out failing drush endpoint test. --- features/drush.feature | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/features/drush.feature b/features/drush.feature index 81aece17..f64eed98 100644 --- a/features/drush.feature +++ b/features/drush.feature @@ -18,9 +18,11 @@ Feature: Drush-specific steps And I run drush "en" "toolbar -y" Then drush output should contain "toolbar is already enabled." - Scenario: Create and view a node with fields using the Drush driver - Given I am viewing an "Article": - | title | My article with fields! | - | body | A placeholder | - Then I should see the heading "My article with fields!" - And I should see the text "A placeholder" +# @todo Re-enable behat drush endpoint testing. +# @see https://github.com/jhedstrom/drupalextension/issues/458 +# Scenario: Create and view a node with fields using the Drush driver +# Given I am viewing an "Article": +# | title | My article with fields! | +# | body | A placeholder | +# Then I should see the heading "My article with fields!" +# And I should see the text "A placeholder" From 4c8565e15c8438238dc2d2151aae78e4cbe13d20 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Thu, 18 Jul 2019 09:54:33 -0700 Subject: [PATCH 34/50] Remove Zombie JS from Travis. - Adds gherkin-lint to feature files on Travis - Adds a Contributing section to the README - Removes zombie js testing - Closes #545 - Closes #544 - Closes #543 --- .gitignore | 1 + .travis.yml | 3 +-- CHANGELOG.md | 3 +++ README.md | 5 +++++ package.json | 3 +-- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 49877fd3..4dd0756a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ vendor behat.yml /package-lock.json /node_modules +/.docksal diff --git a/.travis.yml b/.travis.yml index f4167e18..332ca59d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,8 +53,6 @@ install: - npm install before_script: - # Set NODE_PATH for zombie driver. - - export NODE_PATH="`pwd`/node_modules" # Define the module path according to the Drupal version being tested. - test ${DRUPAL_VERSION} -ne 8 || export MODULE_PATH="drupal/modules" - test ${DRUPAL_VERSION} -eq 8 || export MODULE_PATH="drupal/sites/all/modules" && mkdir -p ${MODULE_PATH} @@ -92,6 +90,7 @@ before_script: script: - composer test + - npm test - vendor/bin/behat -fprogress --strict - vendor/bin/behat -fprogress --profile=drupal${DRUPAL_VERSION} --strict # Do not test the Drush profile unless Drupal 7 was installed. diff --git a/CHANGELOG.md b/CHANGELOG.md index 541d9e9a..e3def24d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed * [#528](https://github.com/jhedstrom/drupalextension/pull/528) Show a more helpful failure when running `@javascript` scenarios with incorrect configuration. + * [#545](https://github.com/jhedstrom/drupalextension/issue/545) Remove Zombie JS testing on Travis. ### Added * [#527](https://github.com/jhedstrom/drupalextension/pull/527) Provide a step to check that a button is not in a region. + * [#543](https://github.com/jhedstrom/drupalextension/issue/543) Run gherkin-lint against feature files on Travis. + * [#544](https://github.com/jhedstrom/drupalextension/issue/544) Added a 'Contributing' section to the README. ### Fixed * [#542](https://github.com/jhedstrom/drupalextension/pull/542) Fix issue with certain symfony 4 components being pulled in. ## [4.0.0 beta2] 2018-12-19 diff --git a/README.md b/README.md index e2084564..d44ddeb1 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,11 @@ the [Full documentation](https://behat-drupal-extension.readthedocs.org) See [CHANGELOG](CHANGELOG.md). +## Contributing + +Features and bug fixes are welcome! First-time contributors can jump in with the +issues tagged [good first issue](https://github.com/jhedstrom/drupalextension/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). + ### Backwards incompatible changes Starting with 3.3.0 Behat Drupal Extension depends on Behat 3.2.0 which diff --git a/package.json b/package.json index 6fe1995c..f875eb3d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "devDependencies": { - "gherkin-lint": "^2.12.0", - "zombie": "^2.5" + "gherkin-lint": "^2.12.0" }, "scripts": { "gherkin-lint": "gherkin-lint features", From 64582d5c9d014f270409f1acaa982a7059085f71 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Thu, 18 Jul 2019 10:34:45 -0700 Subject: [PATCH 35/50] Remove remainder of zombie JS. --- behat.yml.dist | 2 -- composer.json | 1 - features/blackbox.feature | 6 ------ 3 files changed, 9 deletions(-) diff --git a/behat.yml.dist b/behat.yml.dist index de166ba5..d12d882d 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -13,9 +13,7 @@ default: extensions: Drupal\MinkExtension: goutte: ~ - zombie: ~ base_url: http://127.0.0.1:8888/blackbox - javascript_session: zombie Drupal\DrupalExtension: blackbox: ~ region_map: diff --git a/composer.json b/composer.json index 183caacf..d8273ea7 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,6 @@ }, "require-dev": { "phpspec/phpspec": "~2.0 || ~4.0", - "behat/mink-zombie-driver": "^1.2", "jakub-onderka/php-parallel-lint": "^0.9.2", "drupal/coder": "~8.2.12" }, diff --git a/features/blackbox.feature b/features/blackbox.feature index 25c3706a..06246470 100644 --- a/features/blackbox.feature +++ b/features/blackbox.feature @@ -85,12 +85,6 @@ Feature: Test DrupalContext | Sorry, unrecognized username or password | | Unable to send e-mail. Contact the site administrator if the problem persists | - @javascript - Scenario: Zombie driver is functional - Given I am on the homepage - When I click "Download & Extend" - Then I should see the link "Distributions" - @scenariotag Scenario: Check tags on feature and scenario Then the "scenariotag" tag should be present From 019cd972581928cb0da4310f5da4fd4cc6a33681 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Thu, 18 Jul 2019 10:55:17 -0700 Subject: [PATCH 36/50] Remove remaining JS steps. --- features/i18n/es/blackbox.feature | 6 ------ features/messages.feature | 8 -------- 2 files changed, 14 deletions(-) diff --git a/features/i18n/es/blackbox.feature b/features/i18n/es/blackbox.feature index b265f4b4..b73006a6 100644 --- a/features/i18n/es/blackbox.feature +++ b/features/i18n/es/blackbox.feature @@ -98,9 +98,3 @@ Característica: Test DrupalContext | error messages | | Sorry, unrecognized username or password | | Unable to send e-mail. Contact the site administrator if the problem persists | - - @javascript - Escenario: El driver Zombie funciona adecuadamente - Dado estoy en la página de inicio - Cuando hago click en "Download & Extend" - Entonces debo ver el enlace "Distributions" diff --git a/features/messages.feature b/features/messages.feature index 7ed6aeb1..b7cfd1e4 100644 --- a/features/messages.feature +++ b/features/messages.feature @@ -9,11 +9,3 @@ Feature: Ensure that messages are working properly on local installs And I fill in "a fake password" for "Password" And I press "Log in" Then I should see the error message "Unrecognized username or password" - - @javascript - Scenario: JS messages - Given I am on "/user/login" - When I fill in "a fake user" for "Username" - And I fill in "a fake password" for "Password" - And I press "Log in" - Then I should see the error message "Unrecognized username or password" From c8f1ff60e9347559b191da8708e0abbb404e3fa6 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Mon, 22 Jul 2019 10:44:00 -0700 Subject: [PATCH 37/50] SnippetAcceptingContext is depreacted. - Closes #537 --- doc/_static/snippets/FeatureContext.php.inc | 3 +-- .../DrupalExtension/Context/ContextClass/ClassGenerator.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/_static/snippets/FeatureContext.php.inc b/doc/_static/snippets/FeatureContext.php.inc index 66d61362..838c51eb 100644 --- a/doc/_static/snippets/FeatureContext.php.inc +++ b/doc/_static/snippets/FeatureContext.php.inc @@ -2,14 +2,13 @@ use Behat\Behat\Tester\Exception\PendingException; use Drupal\DrupalExtension\Context\RawDrupalContext; -use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; /** * Defines application features from the specific context. */ -class FeatureContext extends RawDrupalContext implements SnippetAcceptingContext { +class FeatureContext extends RawDrupalContext { /** * Initializes context. diff --git a/src/Drupal/DrupalExtension/Context/ContextClass/ClassGenerator.php b/src/Drupal/DrupalExtension/Context/ContextClass/ClassGenerator.php index 50f5611e..b61e3734 100644 --- a/src/Drupal/DrupalExtension/Context/ContextClass/ClassGenerator.php +++ b/src/Drupal/DrupalExtension/Context/ContextClass/ClassGenerator.php @@ -18,7 +18,6 @@ class ClassGenerator implements BehatClassGenerator Date: Mon, 22 Jul 2019 11:02:07 -0700 Subject: [PATCH 38/50] Update CHANGELOG for #537. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3def24d..5922c699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#544](https://github.com/jhedstrom/drupalextension/issue/544) Added a 'Contributing' section to the README. ### Fixed * [#542](https://github.com/jhedstrom/drupalextension/pull/542) Fix issue with certain symfony 4 components being pulled in. + * [#537](https://github.com/jhedstrom/drupalextension/pull/537) Remove usage of deprecated `SnippetAcceptingContext`. + ## [4.0.0 beta2] 2018-12-19 ### Added * [#514](https://github.com/jhedstrom/drupalextension/pull/514) Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS. From e9a1cb25e383d6473a28a58500525e3f6ceab6a0 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 23 Jul 2019 16:13:52 -0700 Subject: [PATCH 39/50] Deprecate subcontexts in Drupal Behat Extension 4.0.0. - Closes #518. --- .../DrupalExtension/Context/Environment/Reader/Reader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php b/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php index 88ada656..49c7a1ac 100644 --- a/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php +++ b/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php @@ -13,6 +13,7 @@ use Drupal\DrupalDriverManager; use Drupal\Driver\SubDriverFinderInterface; +use Drupal\DrupalExtension\Context\DrupalSubContextInterface; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use RegexIterator; @@ -159,6 +160,7 @@ private function findSubContextClasses() // Additional subcontext locations may be specified manually in behat.yml. if (isset($this->parameters['subcontexts']['paths'])) { + @trigger_error('The `subcontexts.paths` parameter is deprecated in Drupal Behat Extension 4.0.0 and will be removed in 4.1.0. Normal Behat contexts should be used instead and loaded via behat.yml.', E_USER_DEPRECATED); $paths = array_merge($paths, $this->parameters['subcontexts']['paths']); } @@ -173,7 +175,8 @@ private function findSubContextClasses() $classes = get_declared_classes(); foreach ($classes as $class) { $reflect = new \ReflectionClass($class); - if (!$reflect->isAbstract() && $reflect->implementsInterface('Drupal\DrupalExtension\Context\DrupalSubContextInterface')) { + if (!$reflect->isAbstract() && $reflect->implementsInterface(DrupalSubContextInterface::class)) { + @trigger_error('Sub-contexts are deprecated in Drupal Behat Extension 4.0.0 and will be removed in 4.1.0. Class ' . $class . ' is a subcontext. This logic should be moved to a normal Behat context and loaded via behat.yml.', E_USER_DEPRECATED); $class_names[] = $class; } } From 7ce2f79e56e784d08ba1dfbe41c7941f509ee78d Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 23 Jul 2019 16:31:16 -0700 Subject: [PATCH 40/50] Update CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5922c699..c98653e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#528](https://github.com/jhedstrom/drupalextension/pull/528) Show a more helpful failure when running `@javascript` scenarios with incorrect configuration. * [#545](https://github.com/jhedstrom/drupalextension/issue/545) Remove Zombie JS testing on Travis. + * [#518](https://github.com/jhedstrom/drupalextension/issue/518) Subcontexts are deprecated and will be removed in v4.1.0. ### Added * [#527](https://github.com/jhedstrom/drupalextension/pull/527) Provide a step to check that a button is not in a region. * [#543](https://github.com/jhedstrom/drupalextension/issue/543) Run gherkin-lint against feature files on Travis. From 75993f17c7e2fe05b70ccf43640520838e31cecc Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 24 Jul 2019 11:39:00 -0700 Subject: [PATCH 41/50] Only trigger deprecation of paths if not empty. --- .../DrupalExtension/Context/Environment/Reader/Reader.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php b/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php index 49c7a1ac..eb158ccc 100644 --- a/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php +++ b/src/Drupal/DrupalExtension/Context/Environment/Reader/Reader.php @@ -160,7 +160,12 @@ private function findSubContextClasses() // Additional subcontext locations may be specified manually in behat.yml. if (isset($this->parameters['subcontexts']['paths'])) { - @trigger_error('The `subcontexts.paths` parameter is deprecated in Drupal Behat Extension 4.0.0 and will be removed in 4.1.0. Normal Behat contexts should be used instead and loaded via behat.yml.', E_USER_DEPRECATED); + if (!empty($this->parameters['subcontexts']['paths'])) { + @trigger_error( + 'The `subcontexts.paths` parameter is deprecated in Drupal Behat Extension 4.0.0 and will be removed in 4.1.0. Normal Behat contexts should be used instead and loaded via behat.yml.', + E_USER_DEPRECATED + ); + } $paths = array_merge($paths, $this->parameters['subcontexts']['paths']); } From 8cae9dab0e0149ff429eb53df05b189894b5c268 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 24 Jul 2019 14:45:09 -0700 Subject: [PATCH 42/50] Prep for 4.0 rc1. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a7e40c6..bc241e43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,7 +108,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#439](https://github.com/jhedstrom/drupalextension/pull/439): Symfony 3 compatibility follow-up fix. [Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0...HEAD -[4.0.0]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...v4.0.0 +[4.0.0 rc1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...v4.0.0rc1 [4.0.0 beta2]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta1...v4.0.0beta2 [4.0.0 beta1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha4...v4.0.0beta1 [4.0.0 alpha4]:https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha3...v4.0.0alpha4 From 3e458319323adda6aaef1b171da1dea6a0165d4f Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Wed, 24 Jul 2019 14:46:02 -0700 Subject: [PATCH 43/50] More prep for rc1. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc241e43..8815978e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [4.0.0] 2019-07-17 +## [4.0.0 rc1] 2019-07-24 ### Changed * [#528](https://github.com/jhedstrom/drupalextension/pull/528) Show a more helpful failure when running `@javascript` scenarios with incorrect configuration. From 6b18f32d3fc2c8d5671314d65d0eff9a336a7442 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Thu, 25 Jul 2019 09:56:48 -0700 Subject: [PATCH 44/50] Fix release link to v4 rc1. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8815978e..526a0fc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -107,7 +107,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#437](https://github.com/jhedstrom/drupalextension/pull/437): Radio button selector fix. * [#439](https://github.com/jhedstrom/drupalextension/pull/439): Symfony 3 compatibility follow-up fix. -[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0...HEAD +[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0rc1...HEAD [4.0.0 rc1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...v4.0.0rc1 [4.0.0 beta2]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta1...v4.0.0beta2 [4.0.0 beta1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha4...v4.0.0beta1 From 4bd61052a1166d590ba899ba87cd25b0284730d4 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Fri, 27 Sep 2019 12:23:29 -0700 Subject: [PATCH 45/50] Prep for 4.0.0. --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 526a0fc4..8ba786b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [4.0.0] 2019-09-27 ## [4.0.0 rc1] 2019-07-24 ### Changed * [#528](https://github.com/jhedstrom/drupalextension/pull/528) Show a more helpful failure when running `@javascript` @@ -107,7 +108,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#437](https://github.com/jhedstrom/drupalextension/pull/437): Radio button selector fix. * [#439](https://github.com/jhedstrom/drupalextension/pull/439): Symfony 3 compatibility follow-up fix. -[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0rc1...HEAD +[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0...HEAD +[4.0.0]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0rc1...v4.0.0 [4.0.0 rc1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...v4.0.0rc1 [4.0.0 beta2]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta1...v4.0.0beta2 [4.0.0 beta1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0alpha4...v4.0.0beta1 From 907c1c18863102bc819fc0b7fb100c9a839b4a12 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Fri, 27 Sep 2019 12:32:38 -0700 Subject: [PATCH 46/50] Fix travis. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 332ca59d..2af9daf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.5 - 5.6 - 7.0 - 7.1 @@ -18,8 +17,6 @@ env: matrix: exclude: - - php: 5.5 - env: DRUPAL_VERSION=8 - php: 5.6 env: DRUPAL_VERSION=6 - php: 5.6 @@ -34,6 +31,9 @@ matrix: # Enable Travis containers. sudo: false +services: + - mysql + install: - composer self-update # For Drupal 8 install the behat drush endpoint. From 4a2395ef09b996da34978a414401a3d86c29161a Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Fri, 27 Sep 2019 13:00:30 -0700 Subject: [PATCH 47/50] Open 4.1 branch alias in master. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d8273ea7..319a848d 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ }, "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "4.1.x-dev" } } } From cc333bdb2b921c4cb4295c94e5b53e8551a86271 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 8 Oct 2019 13:35:07 -0700 Subject: [PATCH 48/50] Remove requirement for specific event dispatcher. - Closes #552 --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 319a848d..4d846a9a 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,6 @@ "drupal/drupal-driver": "^2.0.0", "symfony/browser-kit": "^3.4", "symfony/dependency-injection": "~3.0", - "symfony/event-dispatcher": "~3.0", "symfony/translation": "^3.4" }, "require-dev": { From d9f3b2c24c1ed8ec410d8433f36f6906e153a4d2 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 8 Oct 2019 13:51:13 -0700 Subject: [PATCH 49/50] Remove testing on 5.6 and Drupal 6. --- .travis.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2af9daf9..89c4d520 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.6 - 7.0 - 7.1 - 7.2 @@ -11,23 +10,9 @@ env: - PATH=$PATH:/home/travis/.config/composer/vendor/bin - TRAVIS_NODE_VERSION="4.0.0" matrix: - - DRUPAL_VERSION=6 - DRUPAL_VERSION=7 - DRUPAL_VERSION=8 -matrix: - exclude: - - php: 5.6 - env: DRUPAL_VERSION=6 - - php: 5.6 - env: DRUPAL_VERSION=8 - - php: 7.0 - env: DRUPAL_VERSION=6 - - php: 7.1 - env: DRUPAL_VERSION=6 - - php: 7.2 - env: DRUPAL_VERSION=6 - # Enable Travis containers. sudo: false From 6b3664a193976eea06a6cfcc72fbaeac7c88ca57 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 8 Oct 2019 14:13:07 -0700 Subject: [PATCH 50/50] Update CHANGELOG. Signed-off-by: Jonathan Hedstrom --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ba786b5..78d753cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [4.0.1] 2019-10-08 +### Fixed + * [#552](https://github.com/jhedstrom/drupalextension/issue/552) Remove hard-coded symfony/event-dispatcher requirement. +### Changed + * [#553](https://github.com/jhedstrom/drupalextension/pull/553) Remove testing on PHP 5.6 and Drupal 6 ## [4.0.0] 2019-09-27 ## [4.0.0 rc1] 2019-07-24 ### Changed @@ -108,7 +113,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * [#437](https://github.com/jhedstrom/drupalextension/pull/437): Radio button selector fix. * [#439](https://github.com/jhedstrom/drupalextension/pull/439): Symfony 3 compatibility follow-up fix. -[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0...HEAD +[Unreleased]: https://github.com/jhedstrom/drupalextension/compare/v4.0.1...HEAD +[4.0.1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0...v4.0.1 [4.0.0]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0rc1...v4.0.0 [4.0.0 rc1]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta2...v4.0.0rc1 [4.0.0 beta2]: https://github.com/jhedstrom/drupalextension/compare/v4.0.0beta1...v4.0.0beta2