Skip to content

Commit

Permalink
Merge branch 'main' into OD-18438_Class_timetable_report_filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
GFilipovich authored Mar 31, 2024
2 parents b66a168 + 4e32ef4 commit 9e0a06c
Show file tree
Hide file tree
Showing 131 changed files with 1,773 additions and 509 deletions.
24 changes: 12 additions & 12 deletions api-doc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ Feature: Main feature for all GET requests with path 'list/entity/courseClass'
"tags":[230],
"documents":"#ignore",
"isTraineeship":false,
"customFields":{}
"customFields":{},
"specialTagId":null
}
"""

Expand Down Expand Up @@ -203,6 +204,7 @@ Feature: Main feature for all GET requests with path 'list/entity/courseClass'
"tags":[],
"documents":[],
"isTraineeship":false,
"customFields":{}
"customFields":{},
"specialTagId":null
}
"""
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"minimumSessionsToComplete":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -157,7 +158,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
{"shared":true,"thumbnail":null,"access":"Private","added":"#ignore","description":"Private description","createdOn":"#ignore","tags":[],"attachmentRelations":"#ignore","modifiedOn":"#ignore","removed":false,"attachedRecordsCount":"#ignore","versions":[{"fileName":"defaultPrivateDocument.txt","thumbnail":null,"size":"22 b","added":"#ignore","createdBy":"onCourse Administrator","id":200,"mimeType":"text\/plain","url":null,"content":null, current:true}],"name":"defaultPrivateDocument","id":200,"urlWithoutVersionId":null}
],
"isTraineeship": false,
"customFields": {}
"customFields": {},
"specialTagId":null
}
"""

Expand Down Expand Up @@ -194,7 +196,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"qualificationId":3,
"isTraineeship":true,
"currentlyOffered":false,
"feeHelpClass":false
"feeHelpClass":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -263,7 +266,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"successAndQueuedEnrolmentsCount":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -343,7 +347,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"successAndQueuedEnrolmentsCount":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -406,7 +411,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"successAndQueuedEnrolmentsCount":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -471,7 +477,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"successAndQueuedEnrolmentsCount":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -535,7 +542,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"successAndQueuedEnrolmentsCount":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -599,7 +607,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"successAndQueuedEnrolmentsCount":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand All @@ -616,7 +625,7 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
# <---> Login as notadmin
* configure headers = { Authorization: 'UserWithRightsCreate'}


# <--->

* def newClass =
Expand Down Expand Up @@ -670,7 +679,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"minimumSessionsToComplete":null,
"tags":[231],
"documents":[{"id":200}],
"isTraineeship":false
"isTraineeship":false,
"specialTagId":null
}
"""

Expand Down Expand Up @@ -759,7 +769,8 @@ Feature: Main feature for all POST requests with path 'list/entity/courseClass'
"documents":"#ignore",
"isTraineeship": false,
"customFields": {},
"feeHelpClass":false
"feeHelpClass":false,
"specialTagId":null
}
"""

Expand Down
190 changes: 190 additions & 0 deletions api-test/src/test/resources/ish/oncourse/api/test/tag/special.feature
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"
2 changes: 2 additions & 0 deletions api-test/src/test/resources/test-dataset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@

<Preference CREATEDON="2023-04-11 10:00:00.759000000" MODIFIEDON="2023-04-11 10:00:00.759000000" NAME="payment.gateway.type" UNIQUEKEY="payment.gateway.type" VALUESTRING="WINDCAVE" ID="870"/>

<Preference CREATEDON="2023-04-11 10:00:00.759000000" MODIFIEDON="2023-04-11 10:00:00.759000000" NAME="ish.display.extendedSearchTypes" UNIQUEKEY="ish.display.extendedSearchTypes" VALUESTRING="true" ID="871"/>



<!-- COURSE -->
Expand Down
Loading

0 comments on commit 9e0a06c

Please sign in to comment.