Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "I should see a :label field" methods for Drupal 8 #30

Merged
merged 5 commits into from
Aug 23, 2016

Conversation

becw
Copy link
Member

@becw becw commented Aug 9, 2016

  • Updates the "BeforeScenario" and "AfterScenario" hooks so that they don't throw unnecessary exceptions
  • I tested the "I should see a :label field" tests work under Drupal 8
  • I also tested the markup tests under Drupal 8, which mostly work (one does not yet, so I've left an exception in there)

Also, re: #29, I updated the README -- turns out, the contexts added to behat.yml shouldn't have the .php extension :)

To test this, you can go into your project's vendor/palantirnet/palantir-behat-extension and check out this branch, then run tests like:

  Scenario: This should pass for a plain Drupal install
    Given I am logged in as an "administrator"
    When I visit "node/add/page"
    Then I should see a "Body" field
    And I should not see a "Nonexistent" field

  Scenario: This should fail for a plain Drupal install because the field doesn't exist
    Given I am logged in as an "administrator"
    When I visit "node/add/page"
    Then I should see a "Nonexistent" field

  Scenario: This should fail for a plain Drupal install because the field exists
    Given I am logged in as an "administrator"
    When I visit "node/add/page"
    Then I should not see a "Body" field

@becw becw force-pushed the before-after-notupdated-exceptions branch from 9ccbc8c to 6177850 Compare August 9, 2016 22:33
@becw becw changed the title Don't throw NotUpdatedExceptions in BeforeScenario and AfterScenario hooks Update "I should see a :label field" methods for Drupal 8 Aug 9, 2016
@labbydev
Copy link

@becw even after adding the extension in composer

        {
            "type": "vcs",
            "url": "[email protected]:palantirnet/palantir-behat-extension.git"
        }

and re-running composer install I'm not see vendor/palantirnet/palantir-behat-extension. Is there something I'm missing?

@becw
Copy link
Member Author

becw commented Aug 11, 2016

@labbydev did you also add it to the dependencies section of your composer.json?

@cpatrone
Copy link

@labbydev , @becw
Having the repository defined as you have in your composer.json file and running from the command line "composer require palantirnet/palantir-behat-extension:dev-drupal8 --dev" should install the D8 branch of the extension (adding in require-dev section in composer.json the corresponding line). Please Beck correct me if I'm wrong ...

@zendoodles
Copy link
Contributor

@labbydev @becw Don't we prefer https over the ssh? I forget why, but I remember running into trouble with the git@ version of these.

        {
            "type": "vcs",
            "url": "https://github.com/palantirnet/palantir-behat-extension.git"
        }

So... with ^ that in your composer.json, to add it to the require-dev section of composer.json so you can test this branch you would run

composer require palantirnet/palantir-behat-extension:dev-before-after-notupdated-exceptions --dev

(Note the branch is not drupal8. It is this branch.)

@labbydev
Copy link

@becw This works great except that these two extensions conflict with one another:

Drupal\DrupalExtension\Context\MarkupContext::assertRegionButton()
Palantirnet\PalantirBehatExtension\Context\MarkupContext::assertRegionButton()

@labbydev
Copy link

labbydev commented Aug 15, 2016

We should remove this rule from our Markup Context so that it fixes the duplication:

Step "I should see the button :button in the :region( region)" is already defined in Drupal\DrupalExtension\Context\MarkupContext::assertRegionButton()

Or we should add directions to just use our Markup Context instead of the Drupal one. But either way it should be addressed.

@labbydev labbydev assigned becw and unassigned labbydev and cpatrone Aug 15, 2016
@becw
Copy link
Member Author

becw commented Aug 15, 2016

@zendoodles I haven't had those problems with https vs git protocols recently, and it seems like it's working for @cpatrone as well; however, if it's still an issue, perhaps you can submit a patch to the README?

@becw
Copy link
Member Author

becw commented Aug 15, 2016

We don't have the line in our markup context; our markup context extends the other markup context, and then the way that our behat.yml is set up means that it is like... instantiated twice (one Drupal\DrupalExtension\Context\MarkupContext and one Palantirnet\PalantirBehatExtension\Context\MarkupContext). So I guess we need to make instructions not to have both in the behat.yml for a project.

@labbydev
Copy link

@becw I added this information as Issue #32 I think this PR should be good to merge.

(I'm considering the issue temporary documentation until we have time to update the README)

@becw becw merged commit 8893b7f into drupal8 Aug 23, 2016
@becw becw deleted the before-after-notupdated-exceptions branch August 23, 2016 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants