Skip to content

Commit

Permalink
test: add test for queue actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Nov 22, 2023
1 parent 4310a21 commit a9dd7c9
Show file tree
Hide file tree
Showing 22 changed files with 553 additions and 248 deletions.
5 changes: 5 additions & 0 deletions cypress/fixtures/list/single-queue-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Queue",
"cronExpression": "0 0 3 ? * MON",
"sequence": ["uvUPBToQHD9", "PPgVeqiSXpz"]
}
34 changes: 34 additions & 0 deletions cypress/fixtures/list/single-queue-job-configurations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"pager": {
"page": 1,
"total": 11,
"pageSize": 50,
"pageCount": 1
},
"jobConfigurations": [
{
"name": "Job 1",
"created": "2023-11-16T13:20:38.208",
"jobType": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"jobParameters": {
"type": "REPORT"
},
"lastExecutedStatus": "NOT_STARTED",
"configurable": true,
"id": "uvUPBToQHD9"
},
{
"name": "Job 2",
"created": "2023-11-16T13:20:48.433",
"jobType": "DISABLE_INACTIVE_USERS",
"jobParameters": {
"inactiveMonths": 1,
"reminderDaysBefore": 2
},
"lastExecutedStatus": "NOT_STARTED",
"configurable": true,
"id": "PPgVeqiSXpz"
}
]
}
27 changes: 27 additions & 0 deletions cypress/fixtures/list/single-queue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"name": "Queue",
"type": "Sequence",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "uvUPBToQHD9",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED"
},
{
"id": "PPgVeqiSXpz",
"name": "Job 2",
"type": "DISABLE_INACTIVE_USERS",
"status": "SCHEDULED"
}
]
}
]
66 changes: 66 additions & 0 deletions cypress/fixtures/network/41/queue_actions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[
{
"path": "/api/41/systemSettings/helpPageLink",
"featureName": "Queue actions",
"static": false,
"count": 3,
"nonDeterministic": false,
"method": "GET",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 200,
"responseBody": "{\"helpPageLink\":\"https://dhis2.github.io/dhis2-docs/master/en/user/html/dhis2_user_manual_en.html\"}",
"responseSize": 99,
"responseHeaders": {
"server": "nginx/1.23.0",
"content-type": "application/json;charset=UTF-8",
"transfer-encoding": "chunked",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"cache-control": "no-cache, private",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
},
{
"path": "/api/41/scheduler/queueable",
"featureName": "Queue actions",
"static": false,
"count": 1,
"nonDeterministic": false,
"method": "GET",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 200,
"responseBody": "[]",
"responseSize": 2,
"responseHeaders": {
"server": "nginx/1.23.0",
"content-type": "application/json;charset=UTF-8",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[
{
"path": "/api/41/systemSettings/helpPageLink",
"featureName": "Queues can be enabled and disabled",
"static": false,
"count": 2,
"nonDeterministic": false,
"method": "GET",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 200,
"responseBody": "{\"helpPageLink\":\"https://dhis2.github.io/dhis2-docs/master/en/user/html/dhis2_user_manual_en.html\"}",
"responseSize": 99,
"responseHeaders": {
"server": "nginx/1.23.0",
"content-type": "application/json;charset=UTF-8",
"transfer-encoding": "chunked",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"cache-control": "no-cache, private",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
},
{
"path": "/api/41/jobConfigurations/uvUPBToQHD9/enable",
"featureName": "Queues can be enabled and disabled",
"static": false,
"count": 1,
"nonDeterministic": false,
"method": "POST",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"content-length": "0",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 204,
"responseBody": "\"\"",
"responseSize": 2,
"responseHeaders": {
"server": "nginx/1.23.0",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
},
{
"path": "/api/41/jobConfigurations/uvUPBToQHD9/disable",
"featureName": "Queues can be enabled and disabled",
"static": false,
"count": 1,
"nonDeterministic": false,
"method": "POST",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"content-length": "0",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 204,
"responseBody": "\"\"",
"responseSize": 2,
"responseHeaders": {
"server": "nginx/1.23.0",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
}
]
Loading

0 comments on commit a9dd7c9

Please sign in to comment.