Skip to content

Commit

Permalink
Update the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
becw committed Oct 20, 2015
1 parent 1bf85c5 commit d457abf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
The Palantir Behat Drupal Extension provides additional step definitions for testing Drupal sites using [Behat](http://behat.org),
[Mink Extension](https://github.com/Behat/MinkExtension).

## Usage

## What can I do with this?

* Add `Palantirnet\PalantirBehatExtension\Context\NodeContext` to your `behat.yml` for extra steps for general Drupal tasks like viewing and editing nodes by title
* Extend `Palantirnet\PalantirBehatExtension\Context\MarkupContext` in your project and use the `assertRegionElementText` method to encapsulate complex markup in a custom context rather than in the Gherkin acceptance criteria
* Add `Palantirnet\PalantirBehatExtension\Context\DrupalCommentContext` to your `behat.yml` for extra steps to test commenting
* Add `Palantirnet\PalantirBehatExtension\Context\DrupalOrganicGroupsContext` to your `behat.yml` for extra steps to test access to Organic Groups
* Add `Palantirnet\PalantirBehatExtension\Context\EntityDataContext` to your `behat.yml` for extra steps to test field data and properties on nodes, terms, and users directly, without relying on output (... or write a simpletest...)
* Add `Palantirnet\PalantirBehatExtension\Context\DrupalAutoNodetitleContext` to your `behat.yml` and tag scenarios with `@disableAutoNodetitle` to bypass automatic title generation; sometimes this is required in order to have predictable test content
* Add `Palantirnet\PalantirBehatExtension\Context\DrupalWorkbenchModerationContext` to your `behat.yml` and tag scenarios with `@disableWorkbenchModeration` to bypass moderation

## How do I add this to my project?

If you are already using the `Drupal\DrupalExtension` Behat extension, it is very easy to add these contexts--and if not, go set that up before attempting to use these custom contexts.

Expand Down
1 change: 1 addition & 0 deletions features/node.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Feature: Some Example Tests
When I view the "page" content "My Test Page"
Then I should get a "200" HTTP response

@disableWorkbenchModeration @disableAutoNodetitle
Scenario: Verify I can view and edit a node
Given a "page" with the title "My Test Page"
And I am logged in as a user with the "bypass node access" permission
Expand Down

0 comments on commit d457abf

Please sign in to comment.