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

Added negative assertions for the TaxonomyTrait steps. #172

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 81 additions & 5 deletions tests/behat/features/taxonomy.feature
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
@d9 @d10
Feature: Check that TaxonomyTrait works for or D9

Background:
@api
Scenario: Assert "Given vocabulary :vid with name :name exists"
Given no "tags" terms:
| T1 |
And "tags" terms:
| name |
| T1 |

@api
Scenario: Assert "Given vocabulary :vid with name :name exists"
Given I am logged in as a user with the "administrator" role
And I am logged in as a user with the "administrator" role
And vocabulary tags with name "Tags" exists
And taxonomy term "T1" from vocabulary "tags" exists
When I visit "tags" vocabulary term "T1"
Expand All @@ -19,3 +17,81 @@ Feature: Check that TaxonomyTrait works for or D9
When I edit "tags" vocabulary term "T1"
Then I see the text "Edit term"
And I see the text "T1"

@trait:TaxonomyTrait
Scenario: Assert "Given vocabulary :vid with name :name exists" fail with an error
Given some behat configuration
And scenario steps:
"""
Given vocabulary "non_existing_topics" with name "Non Existing Topics" exists
"""
When I run "behat --no-colors"
Then it should fail with an error:
"""
"non_existing_topics" vocabulary does not exist
"""

@trait:TaxonomyTrait
Scenario: Assert "Given vocabulary :vid with name :name exists" fail with an error
Given some behat configuration
And scenario steps:
"""
Given vocabulary "tags" with name "Tags Fake" exists
"""
When I run "behat --no-colors"
Then it should fail with an error:
"""
"tags" vocabulary name is not "Tags Fake"
"""

@trait:TaxonomyTrait
Scenario: Assert "Given taxonomy term :name from vocabulary :vocabulary_id exists" fail with an error
Given some behat configuration
And scenario steps:
"""
Given taxonomy term "Tag Random 1" from vocabulary "tags" exists
"""
When I run "behat --no-colors"
Then it should fail with an error:
"""
Taxonomy term "Tag Random 1" from vocabulary "tags" does not exist
"""

@trait:TaxonomyTrait
Scenario: Assert "Given taxonomy term :name from vocabulary :vocabulary_id exists" fail with an exception
Given some behat configuration
And scenario steps:
"""
Given taxonomy term "Tag Random 1" from vocabulary "tags_random" exists
"""
When I run "behat --no-colors"
Then it should fail with an exception:
"""
"tags_random" vocabulary does not exist
"""

@trait:TaxonomyTrait
Scenario: Assert "When I visit :vocabulary vocabulary term :name" fail with an exception
Given some behat configuration
And scenario steps:
"""
When I visit "tags" vocabulary term "Random Tag"
"""
When I run "behat --no-colors"
Then it should fail with an exception:
"""
Unable to find tags term "Random Tag"
"""

@trait:TaxonomyTrait
Scenario: Assert "When I edit :vocabulary vocabulary term :name" fail with an exception
Given some behat configuration
And scenario steps:
"""
When I edit "tags" vocabulary term "Random Tag"
"""
When I run "behat --no-colors"
Then it should fail with an exception:
"""
Unable to find tags term "Random Tag"
"""