Skip to content

Commit 0eb970b

Browse files
committed
Exclude specific features for Redmine 4.2
1 parent c2d0d47 commit 0eb970b

File tree

4 files changed

+98
-6
lines changed

4 files changed

+98
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ that receive security updates.
3535
- Redmine 4.2.x
3636

3737
Nevertheless, you can also use this library for all older Redmine versions.
38-
In this case, however, be aware that some features may not yet be supported by your Redmine server.
38+
In this case, however, be aware that some features might not be supported by your Redmine server.
3939

4040
If a new Redmine version enables new features that are not yet supported with this library,
4141
you are welcome to [create an issue](https://github.com/kbsali/php-redmine-api/issues).

tests/Behat/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Behaviour tests
2+
3+
This folder contains BDD tests using Docker and Behat.
4+
5+
## How to run the tests
6+
7+
Pull the Redmine docker images and start them by running:
8+
9+
```bash
10+
docker compose up -d
11+
```
12+
13+
Now you can run the tests:
14+
15+
```bash
16+
docker compose exec php composer behat
17+
```
18+
19+
## Redmine specific features
20+
21+
Some Redmine features are specific for a Redmine version. There are two ways to handle this situations.
22+
23+
### Modified Rest-API Responses
24+
25+
It is possible that a new Redmine version returns new or changed elements in a response.
26+
This can be handled on the `step` layer:
27+
28+
```
29+
And the returned data "projects.0" property has only the following properties with Redmine version ">= 5.1.0"
30+
"""
31+
id
32+
name
33+
identifier
34+
description
35+
homepage
36+
status
37+
is_public
38+
inherit_members
39+
created_on
40+
updated_on
41+
"""
42+
But the returned data "projects.0" property has only the following properties with Redmine version "< 5.1.0"
43+
"""
44+
id
45+
name
46+
identifier
47+
description
48+
status
49+
is_public
50+
inherit_members
51+
created_on
52+
updated_on
53+
"""
54+
```
55+
56+
### Modified Rest-API Endpoints
57+
58+
A new Redmine version could be introduce new REST-API endpoints that are missing in the older version.
59+
This can be handled on the `scenario` or `feature` layer.
60+
61+
1. Tag features or scenarios e.g. with `@since50000`.
62+
63+
```
64+
@since50000
65+
Feature: Interacting with the new REST API endpoint
66+
[...]
67+
```
68+
69+
or
70+
71+
```
72+
@since50000
73+
Scenario: Using a new feature
74+
Given I have a "NativeCurlClient" client
75+
And I create a project with name "Test Project" and identifier "test-project"
76+
[...]
77+
```
78+
79+
2. Exclude the tag from the specific suite in the `behat.yml` (note the `~` prefix):
80+
81+
```
82+
default:
83+
suites:
84+
[...]
85+
redmine_40210:
86+
[...]
87+
filters:
88+
tags: "~@since50000"
89+
90+
```

tests/Behat/behat.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ default:
1818
contexts:
1919
- Redmine\Tests\Behat\Bootstrap\FeatureContext:
2020
redmineVersion: '4.2.10'
21+
filters:
22+
tags: "~@since50000"

tests/Behat/features/projects.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Feature: Interacting with the REST API for projects
167167
And the response has the content ""
168168
And the returned data is exactly ""
169169

170-
@project
170+
@project @since50000
171171
Scenario: Closing a project
172172
Given I have a "NativeCurlClient" client
173173
And I create a project with name "Test Project" and identifier "test-project"
@@ -181,7 +181,7 @@ Feature: Interacting with the REST API for projects
181181
| property | value |
182182
| status | 5 |
183183

184-
@project
184+
@project @since50000
185185
Scenario: Reopening a project
186186
Given I have a "NativeCurlClient" client
187187
And I create a project with name "Test Project" and identifier "test-project"
@@ -196,7 +196,7 @@ Feature: Interacting with the REST API for projects
196196
| property | value |
197197
| status | 1 |
198198

199-
@project
199+
@project @since50000
200200
Scenario: Archiving a project
201201
Given I have a "NativeCurlClient" client
202202
And I create a project with name "Test Project" and identifier "test-project"
@@ -206,7 +206,7 @@ Feature: Interacting with the REST API for projects
206206
And the response has the content ""
207207
And the returned data is true
208208

209-
@project @error
209+
@project @since50000 @error
210210
Scenario: Showing an archived project is not possible
211211
Given I have a "NativeCurlClient" client
212212
And I create a project with name "Test Project" and identifier "test-project"
@@ -217,7 +217,7 @@ Feature: Interacting with the REST API for projects
217217
And the response has the content ""
218218
And the returned data is false
219219

220-
@project
220+
@project @since50000
221221
Scenario: Unarchiving a project
222222
Given I have a "NativeCurlClient" client
223223
And I create a project with name "Test Project" and identifier "test-project"

0 commit comments

Comments
 (0)