-
Notifications
You must be signed in to change notification settings - Fork 183
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
Migrate E2E tests to BDD with Behat #378
Conversation
…iple redmine versions
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v2.x #378 +/- ##
=========================================
Coverage 97.63% 97.63%
Complexity 563 563
=========================================
Files 29 29
Lines 1609 1609
=========================================
Hits 1571 1571
Misses 38 38 ☔ View full report in Codecov by Sentry. |
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
- | Generic High Entropy Secret | 118902a | tests/Behat/features/wiki.feature | View secret | |
- | Generic High Entropy Secret | 118902a | tests/Behat/features/wiki.feature | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
I've finished the migration to Behat and was able to add more tests about the returned data and status codes from Redmine server. This will become important for #367. To run the Behat tests one can simply execute stdout from running behat$ docker compose exec php composer run behat
> behat --config tests/Behat/behat.yml
Feature: Interacting with the REST API for attachments
In order to interact with REST API for attachments
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Uploading an attachment # features/attachments.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
upload
"""
And the returned data "upload" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "upload" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
token
"""
And the returned data "upload" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| token | 1.7b962f8af22e26802b87abfa0b07b21dbd03b984ec8d6888dabd3f69cff162f8 |
Scenario: Showing the details of an attachment # features/attachments.feature:28
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
When I show the attachment with the id "1" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheAttachmentWithTheId()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
attachment
"""
And the returned data "attachment" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "attachment" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
filename
filesize
content_type
description
content_url
author
created_on
"""
And the returned data "attachment" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| filename | testfile.txt |
| filesize | 65 |
| content_type | text/plain |
| description | null |
| content_url | http://redmine-%redmine_id%:3000/attachments/download/1/testfile.txt |
And the returned data "attachment.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "attachment.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Feature: Interacting with the REST API for groups
In order to interact with REST API for groups
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Creating a group with minimal parameters # features/groups.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I create a group with name "Test Group" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithName()
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| id | 4 |
| name | Test Group |
Scenario: Listing of zero groups # features/groups.feature:22
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I list all groups # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllGroups()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
groups
"""
And the returned data "groups" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "groups" property contains "0" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
Scenario: Listing of one group # features/groups.feature:34
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a group with name "Test Group" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithName()
When I list all groups # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllGroups()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
groups
"""
And the returned data "groups" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "groups" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "groups.0" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "groups.0" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "groups.0" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 4 |
| name | Test Group |
Scenario: Showing a specific group # features/groups.feature:57
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a group with name "Test Group" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithName()
When I show the group with id "4" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheGroupWithId()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
group
"""
And the returned data "group" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "group" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "group" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 4 |
| name | Test Group |
Scenario: Updating a group # features/groups.feature:78
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a group with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithTheFollowingData()
| property | value |
| name | Test Group |
When I update the group with id "4" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUpdateTheGroupWithIdWithTheFollowingData()
| property | value |
| name | new group name |
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
Feature: Interacting with the REST API for projects
In order to interact with REST API for projects
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Creating a project with minimal parameters # features/projects.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
id
name
identifier
description
homepage
status
is_public
inherit_members
created_on
updated_on
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| id | 1 |
| name | Test Project |
| identifier | test-project |
Scenario: Creating a project with multiple parameters # features/projects.feature:31
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I create a project with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithTheFollowingData()
| property | value |
| name | Test Project |
| identifier | test-project |
| description | project description |
| homepage | https://example.com |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| id | 1 |
| name | Test Project |
| identifier | test-project |
| description | project description |
| homepage | https://example.com |
| is_public | true |
| inherit_members | false |
Scenario: Showing a specific project # features/projects.feature:52
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
project
"""
And the returned data "project" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "project" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
identifier
description
homepage
status
is_public
inherit_members
trackers
issue_categories
created_on
updated_on
"""
And the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Test Project |
| identifier | test-project |
| description | null |
| homepage | |
| status | 1 |
| is_public | true |
| inherit_members | false |
| trackers | [] |
| issue_categories | [] |
Scenario: Listing of zero projects # features/projects.feature:91
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I list all projects # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllProjects()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
projects
total_count
offset
limit
"""
And the returned data "projects" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "projects" property contains "0" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| total_count | 0 |
| offset | 0 |
| limit | 25 |
Scenario: Listing of one project # features/projects.feature:111
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I list all projects # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllProjects()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| total_count | 1 |
| offset | 0 |
| limit | 25 |
And the returned data "projects" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "projects" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "projects.0" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "projects.0" property has only the following properties with Redmine version ">= 5.1.0" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingPropertiesWithRedmineVersion()
"""
id
name
identifier
description
homepage
status
is_public
inherit_members
created_on
updated_on
"""
But the returned data "projects.0" property has only the following properties with Redmine version "< 5.1.0" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingPropertiesWithRedmineVersion()
"""
id
name
identifier
description
status
is_public
inherit_members
created_on
updated_on
"""
Scenario: Updating a project # features/projects.feature:152
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I update the project with identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUpdateTheProjectWithIdentifierWithTheFollowingData()
| property | value |
| name | new project name |
| homepage | https://example.com |
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
Scenario: Closing a project # features/projects.feature:164
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I close the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCloseTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| status | 5 |
Scenario: Reopening a project # features/projects.feature:177
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I close the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCloseTheProjectWithIdentifier()
When I reopen the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iReopenTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| status | 1 |
Scenario: Archiving a project # features/projects.feature:191
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I archive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iArchiveTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
Scenario: Showing an archived project is not possible # features/projects.feature:200
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I archive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iArchiveTheProjectWithIdentifier()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the response has the status code "403" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is false # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsFalse()
Scenario: Unarchiving a project # features/projects.feature:210
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I archive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iArchiveTheProjectWithIdentifier()
When I unarchive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUnarchiveTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| status | 1 |
Feature: Interacting with the REST API for wikis
In order to interact with REST API for wiki
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Creating a wiki page # features/wiki.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | [] |
And the returned data "author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "author.@attributes" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author.@attributes" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "author.@attributes" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Creating a wiki page with attachment upload # features/wiki.feature:44
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
When I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
| uploads | [{"token":"1.7b962f8af22e26802b87abfa0b07b21dbd03b984ec8d6888dabd3f69cff162f8","filename":"filename.txt","content-type":"text/plain"}] |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | [] |
And the returned data "author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "author.@attributes" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author.@attributes" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "author.@attributes" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Showing a wiki page # features/wiki.feature:86
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
When I show the wiki page with name "Test Page" and project identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheWikiPageWithNameAndProjectIdentifier()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
wiki_page
"""
And the returned data "wiki_page" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
attachments
"""
And the returned data "wiki_page" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | null |
| attachments | [] |
And the returned data "wiki_page.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.author" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "wiki_page.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Showing a wiki page with uploaded attachment # features/wiki.feature:129
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
| uploads | [{"token":"1.7b962f8af22e26802b87abfa0b07b21dbd03b984ec8d6888dabd3f69cff162f8","filename":"filename.txt","content-type":"text/plain"}] |
When I show the wiki page with name "Test Page" and project identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheWikiPageWithNameAndProjectIdentifier()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
wiki_page
"""
And the returned data "wiki_page" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
attachments
"""
And the returned data "wiki_page" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | null |
And the returned data "wiki_page.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.author" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "wiki_page.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
And the returned data "wiki_page.attachments" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.attachments" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "wiki_page.attachments.0" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.attachments.0" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
filename
filesize
content_type
description
content_url
author
created_on
"""
And the returned data "wiki_page.attachments.0" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| filename | filename.txt |
| filesize | 65 |
| content_type | text/plain |
| description | |
| content_url | http://redmine-%redmine_id%:3000/attachments/download/1/filename.txt |
And the returned data "wiki_page.attachments.0.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.attachments.0.author" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "wiki_page.attachments.0.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Updating a wiki page # features/wiki.feature:207
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
When I update the wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUpdateTheWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # First Wiki page with changes |
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
Scenario: Deleting a wiki page # features/wiki.feature:221
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
When I delete the wiki page with name "Test Page" and project identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iDeleteTheWikiPageWithNameAndProjectIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
Feature: Interacting with the REST API for attachments
In order to interact with REST API for attachments
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Uploading an attachment # features/attachments.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
upload
"""
And the returned data "upload" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "upload" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
token
"""
And the returned data "upload" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| token | 1.7b962f8af22e26802b87abfa0b07b21dbd03b984ec8d6888dabd3f69cff162f8 |
Scenario: Showing the details of an attachment # features/attachments.feature:28
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
When I show the attachment with the id "1" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheAttachmentWithTheId()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
attachment
"""
And the returned data "attachment" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "attachment" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
filename
filesize
content_type
description
content_url
author
created_on
"""
And the returned data "attachment" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| filename | testfile.txt |
| filesize | 65 |
| content_type | text/plain |
| description | null |
| content_url | http://redmine-%redmine_id%:3000/attachments/download/1/testfile.txt |
And the returned data "attachment.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "attachment.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Feature: Interacting with the REST API for groups
In order to interact with REST API for groups
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Creating a group with minimal parameters # features/groups.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I create a group with name "Test Group" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithName()
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| id | 4 |
| name | Test Group |
Scenario: Listing of zero groups # features/groups.feature:22
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I list all groups # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllGroups()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
groups
"""
And the returned data "groups" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "groups" property contains "0" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
Scenario: Listing of one group # features/groups.feature:34
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a group with name "Test Group" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithName()
When I list all groups # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllGroups()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
groups
"""
And the returned data "groups" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "groups" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "groups.0" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "groups.0" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "groups.0" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 4 |
| name | Test Group |
Scenario: Showing a specific group # features/groups.feature:57
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a group with name "Test Group" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithName()
When I show the group with id "4" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheGroupWithId()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
group
"""
And the returned data "group" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "group" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "group" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 4 |
| name | Test Group |
Scenario: Updating a group # features/groups.feature:78
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a group with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAGroupWithTheFollowingData()
| property | value |
| name | Test Group |
When I update the group with id "4" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUpdateTheGroupWithIdWithTheFollowingData()
| property | value |
| name | new group name |
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
Feature: Interacting with the REST API for projects
In order to interact with REST API for projects
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Creating a project with minimal parameters # features/projects.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
id
name
identifier
description
homepage
status
is_public
inherit_members
created_on
updated_on
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| id | 1 |
| name | Test Project |
| identifier | test-project |
Scenario: Creating a project with multiple parameters # features/projects.feature:31
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I create a project with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithTheFollowingData()
| property | value |
| name | Test Project |
| identifier | test-project |
| description | project description |
| homepage | https://example.com |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| id | 1 |
| name | Test Project |
| identifier | test-project |
| description | project description |
| homepage | https://example.com |
| is_public | true |
| inherit_members | false |
Scenario: Showing a specific project # features/projects.feature:52
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
project
"""
And the returned data "project" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "project" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
identifier
description
homepage
status
is_public
inherit_members
trackers
issue_categories
created_on
updated_on
"""
And the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Test Project |
| identifier | test-project |
| description | null |
| homepage | |
| status | 1 |
| is_public | true |
| inherit_members | false |
| trackers | [] |
| issue_categories | [] |
Scenario: Listing of zero projects # features/projects.feature:91
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
When I list all projects # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllProjects()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
projects
total_count
offset
limit
"""
And the returned data "projects" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "projects" property contains "0" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| total_count | 0 |
| offset | 0 |
| limit | 25 |
Scenario: Listing of one project # features/projects.feature:111
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I list all projects # Redmine\Tests\Behat\Bootstrap\FeatureContext::iListAllProjects()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| total_count | 1 |
| offset | 0 |
| limit | 25 |
And the returned data "projects" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "projects" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "projects.0" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "projects.0" property has only the following properties with Redmine version ">= 5.1.0" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingPropertiesWithRedmineVersion()
"""
id
name
identifier
description
homepage
status
is_public
inherit_members
created_on
updated_on
"""
But the returned data "projects.0" property has only the following properties with Redmine version "< 5.1.0" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingPropertiesWithRedmineVersion()
"""
id
name
identifier
description
status
is_public
inherit_members
created_on
updated_on
"""
Scenario: Updating a project # features/projects.feature:152
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I update the project with identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUpdateTheProjectWithIdentifierWithTheFollowingData()
| property | value |
| name | new project name |
| homepage | https://example.com |
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
Scenario: Closing a project # features/projects.feature:164
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I close the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCloseTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| status | 5 |
Scenario: Reopening a project # features/projects.feature:177
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I close the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCloseTheProjectWithIdentifier()
When I reopen the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iReopenTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| status | 1 |
Scenario: Archiving a project # features/projects.feature:191
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I archive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iArchiveTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
Scenario: Showing an archived project is not possible # features/projects.feature:200
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I archive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iArchiveTheProjectWithIdentifier()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the response has the status code "403" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is false # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsFalse()
Scenario: Unarchiving a project # features/projects.feature:210
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I archive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iArchiveTheProjectWithIdentifier()
When I unarchive the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUnarchiveTheProjectWithIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is true # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsTrue()
When I show the project with identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheProjectWithIdentifier()
Then the returned data "project" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| status | 1 |
Feature: Interacting with the REST API for wikis
In order to interact with REST API for wiki
As a user
I want to make sure the Redmine server replies with the correct response
Scenario: Creating a wiki page # features/wiki.feature:6
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
When I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | [] |
And the returned data "author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "author.@attributes" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author.@attributes" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "author.@attributes" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Creating a wiki page with attachment upload # features/wiki.feature:44
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
When I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
| uploads | [{"token":"1.7b962f8af22e26802b87abfa0b07b21dbd03b984ec8d6888dabd3f69cff162f8","filename":"filename.txt","content-type":"text/plain"}] |
Then the response has the status code "201" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/xml" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data is an instance of "SimpleXMLElement" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsAnInstanceOf()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
"""
And the returned data has proterties with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasProtertiesWithTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | [] |
And the returned data "author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "author.@attributes" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "author.@attributes" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "author.@attributes" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Showing a wiki page # features/wiki.feature:86
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
When I show the wiki page with name "Test Page" and project identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheWikiPageWithNameAndProjectIdentifier()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
wiki_page
"""
And the returned data "wiki_page" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
attachments
"""
And the returned data "wiki_page" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | null |
| attachments | [] |
And the returned data "wiki_page.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.author" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "wiki_page.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Showing a wiki page with uploaded attachment # features/wiki.feature:129
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUploadTheContentOfTheFileWithTheFollowingData()
| property | value |
| filename | testfile.txt |
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
| uploads | [{"token":"1.7b962f8af22e26802b87abfa0b07b21dbd03b984ec8d6888dabd3f69cff162f8","filename":"filename.txt","content-type":"text/plain"}] |
When I show the wiki page with name "Test Page" and project identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iShowTheWikiPageWithNameAndProjectIdentifier()
Then the response has the status code "200" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has the content type "application/json" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContentType()
And the returned data has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataHasOnlyTheFollowingProperties()
"""
wiki_page
"""
And the returned data "wiki_page" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
title
text
version
author
comments
created_on
updated_on
attachments
"""
And the returned data "wiki_page" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| title | Test+Page |
| text | # My first wiki page |
| version | 1 |
| comments | null |
And the returned data "wiki_page.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.author" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "wiki_page.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
And the returned data "wiki_page.attachments" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.attachments" property contains "1" items # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsItems()
And the returned data "wiki_page.attachments.0" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.attachments.0" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
filename
filesize
content_type
description
content_url
author
created_on
"""
And the returned data "wiki_page.attachments.0" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| filename | filename.txt |
| filesize | 65 |
| content_type | text/plain |
| description | |
| content_url | http://redmine-%redmine_id%:3000/attachments/download/1/filename.txt |
And the returned data "wiki_page.attachments.0.author" property is an array # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyIsAnArray()
And the returned data "wiki_page.attachments.0.author" property has only the following properties # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyHasOnlyTheFollowingProperties()
"""
id
name
"""
And the returned data "wiki_page.attachments.0.author" property contains the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataPropertyContainsTheFollowingData()
| property | value |
| id | 1 |
| name | Redmine Admin |
Scenario: Updating a wiki page # features/wiki.feature:207
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
When I update the wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iUpdateTheWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # First Wiki page with changes |
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
Scenario: Deleting a wiki page # features/wiki.feature:221
Given I have a "NativeCurlClient" client # Redmine\Tests\Behat\Bootstrap\FeatureContext::iHaveAClient()
And I create a project with name "Test Project" and identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAProjectWithNameAndIdentifier()
And I create a wiki page with name "Test Page" and project identifier "test-project" with the following data # Redmine\Tests\Behat\Bootstrap\FeatureContext::iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData()
| property | value |
| text | # My first wiki page |
When I delete the wiki page with name "Test Page" and project identifier "test-project" # Redmine\Tests\Behat\Bootstrap\FeatureContext::iDeleteTheWikiPageWithNameAndProjectIdentifier()
Then the response has the status code "204" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheStatusCode()
And the response has an empty content type # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasAnEmptyContentType()
And the response has the content "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theResponseHasTheContent()
And the returned data is exactly "" # Redmine\Tests\Behat\Bootstrap\FeatureContext::theReturnedDataIsExactly()
48 scenarios (48 passed)
460 steps (460 passed)
0m21.89s (14.35Mb)
48 scenarios (48 passed)
460 steps (460 passed)
0m21.89s (14.35Mb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that's pretty impressive, Well done! 💯 👏 👏
Writing the end2end tests for #377 I caught myself copy and pasting test code for fundamental processes like creating a project. Also testing the server responses was not as intuitive as I thought. The testing code looks pretty ugly and will become more and more unmaintainable.
That's why I've looked for a better solution and found Behat.
Behat and BDD
This PR introduces BDD (behavior driven development) using Behat. The existing end2end tests will be migrated to the Gherkin syntax. The code above now looks like this: