-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into OD-18438_Class_timetable_report_filtering
- Loading branch information
Showing
131 changed files
with
1,773 additions
and
509 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
190 changes: 190 additions & 0 deletions
190
api-test/src/test/resources/ish/oncourse/api/test/tag/special.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
@parallel=false | ||
Feature: Main feature for all requests for special tags (tag/special) | ||
|
||
Background: Authorize first | ||
* configure headers = { Authorization: 'admin' } | ||
* url 'https://127.0.0.1:8182/a/v1' | ||
* def ishPath = 'tag/special' | ||
* def ishSpecialGetPath = 'tag/special' | ||
|
||
|
||
Scenario: (-) Create valid special tags group | ||
|
||
* def newTagGroup = | ||
""" | ||
{"childTags":[{"id":null,"name":"third course type","type":"Tag","status":"Private","system":false,"urlPath":null,"content":"","weight":3,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]},{"id":null,"name":"second course type","type":"Tag","status":"Show on website","system":false,"urlPath":null,"content":"","weight":2,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]},{"id":null,"name":"first course type","type":"Tag","status":"Private","system":false,"urlPath":null,"content":"","weight":1,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]}],"specialType":"Course extended types"} | ||
""" | ||
|
||
Given path ishPath | ||
And request newTagGroup | ||
When method POST | ||
Then status 204 | ||
|
||
Given path ishSpecialGetPath+"?entityName=Course" | ||
When method GET | ||
Then status 200 | ||
And match karate.sizeOf(response.childTags) == 3 | ||
And match response contains | ||
""" | ||
{ | ||
"specialType": "Course extended types", | ||
"childTags": [ | ||
{ | ||
"id": #ignore, | ||
"name": "first course type", | ||
"status": "Private", | ||
"type": "Tag", | ||
"system": true, | ||
"urlPath": null, | ||
"content": null, | ||
"color": "74add1", | ||
"weight": 1, | ||
"taggedRecordsCount": 0, | ||
"childrenCount": 0, | ||
"created": #ignore, | ||
"modified": #ignore, | ||
"requirements": [], | ||
"childTags": [] | ||
}, | ||
{ | ||
"id": #ignore, | ||
"name": "second course type", | ||
"status": "Show on website", | ||
"type": "Tag", | ||
"system": true, | ||
"urlPath": null, | ||
"content": null, | ||
"color": "74add1", | ||
"weight": 2, | ||
"taggedRecordsCount": 0, | ||
"childrenCount": 0, | ||
"created": #ignore, | ||
"modified": #ignore, | ||
"requirements": [], | ||
"childTags": [] | ||
}, | ||
{ | ||
"id": #ignore, | ||
"name": "third course type", | ||
"status": "Private", | ||
"type": "Tag", | ||
"system": true, | ||
"urlPath": null, | ||
"content": null, | ||
"color": "74add1", | ||
"weight": 3, | ||
"taggedRecordsCount": 0, | ||
"childrenCount": 0, | ||
"created": #ignore, | ||
"modified": #ignore, | ||
"requirements": [], | ||
"childTags": [] | ||
}] | ||
} | ||
""" | ||
|
||
* def secondTypeId = get[0] response.childTags[?(@.name == 'second course type')].id | ||
* def thirdTypeId = get[0] response.childTags[?(@.name == 'third course type')].id | ||
|
||
* def updateGroup = | ||
""" | ||
{"childTags":[{"id":"#(thirdTypeId)","name":"third course type","type":"Tag","status":"Private","system":false,"urlPath":null,"content":"","weight":3,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]},{"id":"#(secondTypeId)","name":"second course type","type":"Tag","status":"Show on website","system":false,"urlPath":null,"content":"","weight":2,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]}],"specialType":"Course extended types"} | ||
""" | ||
|
||
|
||
Given path ishPath | ||
And request updateGroup | ||
When method POST | ||
Then status 204 | ||
|
||
# >>> Assertion: | ||
Given path ishSpecialGetPath+"?entityName=Course" | ||
When method GET | ||
Then status 200 | ||
And match response contains | ||
""" | ||
{ | ||
"specialType": "Course extended types", | ||
"childTags": [ | ||
{ | ||
"id": #ignore, | ||
"name": "second course type", | ||
"status": "Show on website", | ||
"type": "Tag", | ||
"system": true, | ||
"urlPath": null, | ||
"content": null, | ||
"color": "74add1", | ||
"weight": 2, | ||
"taggedRecordsCount": 0, | ||
"childrenCount": 0, | ||
"created": #ignore, | ||
"modified": #ignore, | ||
"requirements": [], | ||
"childTags": [] | ||
}, | ||
{ | ||
"id": #ignore, | ||
"name": "third course type", | ||
"status": "Private", | ||
"type": "Tag", | ||
"system": true, | ||
"urlPath": null, | ||
"content": null, | ||
"color": "74add1", | ||
"weight": 3, | ||
"taggedRecordsCount": 0, | ||
"childrenCount": 0, | ||
"created": #ignore, | ||
"modified": #ignore, | ||
"requirements": [], | ||
"childTags": [] | ||
} | ||
] | ||
} | ||
""" | ||
|
||
Scenario: (-) Remove special tag group | ||
|
||
* def newTagGroup = | ||
""" | ||
{"childTags":[],"specialType":"Course extended types"} | ||
""" | ||
|
||
Given path ishPath | ||
And request newTagGroup | ||
When method POST | ||
Then status 204 | ||
|
||
# >>> Assertion: | ||
Given path ishSpecialGetPath+"?entityName=Course" | ||
When method GET | ||
Then status 204 | ||
|
||
|
||
Scenario: (-) Add wrong special tag group | ||
|
||
* def newTagGroup = | ||
""" | ||
{"childTags":[{"id":null,"name":"third course type","type":"Tag","status":"Private","system":false,"urlPath":null,"content":"","weight":1,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]},{"id":null,"name":"second course type","type":"Tag","status":"Show on website","system":false,"urlPath":null,"content":"","weight":1,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]},{"id":null,"name":"first course type","type":"Tag","status":"Private","system":false,"urlPath":null,"content":"","weight":1,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]}],"specialType":null} | ||
""" | ||
|
||
Given path ishPath | ||
And request newTagGroup | ||
When method POST | ||
Then status 400 | ||
And match response.errorMessage == "You can edit only special tags with this endpoint" | ||
|
||
|
||
Scenario: (-) Add wrong tag group with childs of childs | ||
|
||
* def newTagGroup = | ||
""" | ||
{"childTags":[{"id":null,"name":"third course type","type":"Tag","status":"Private","system":false,"urlPath":null,"content":"","weight":1,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[{"id":null,"name":"second course type","type":"Tag","status":"Show on website","system":false,"urlPath":null,"content":"","weight":1,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]},{"id":null,"name":"first course type","type":"Tag","status":"Private","system":false,"urlPath":null,"content":"","weight":1,"taggedRecordsCount":0,"created":null,"modified":null,"color":"74add1","requirements":[],"childTags":[]}]}],"specialType":"Course extended types"} | ||
""" | ||
|
||
Given path ishPath | ||
And request newTagGroup | ||
When method POST | ||
Then status 400 | ||
And match response.errorMessage == "Special tags cannot have second level of hierarchy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.