-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #911 from cherrycl/issue-910
feat: Add test scenarios for support-cron-scheduler
- Loading branch information
Showing
20 changed files
with
722 additions
and
16 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
TAF/testScenarios/functionalTest/API/support-cron-scheduler/info/GET.robot
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,30 @@ | ||
*** Settings *** | ||
Resource TAF/testCaseModules/keywords/common/commonKeywords.robot | ||
Suite Setup Run Keywords Setup Suite | ||
... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token | ||
Suite Teardown Run Teardown Keywords | ||
Force Tags Skipped | ||
|
||
*** Variables *** | ||
${SUITE} Support Cron Scheduler Info GET Test Cases | ||
${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-info.log | ||
|
||
*** Test Cases *** | ||
InfoGET001 - Query ping | ||
When Query Ping | ||
Then Should Return Status Code "200" And timestamp | ||
And apiVersion Should be ${API_VERSION} | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
InfoGET002 - Query version | ||
When Query Version | ||
Then Should Return Status Code "200" And version | ||
And apiVersion Should be ${API_VERSION} | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
InfoGET003 - Query config | ||
When Query Config | ||
Then Should Return Status Code "200" And config | ||
And apiVersion Should be ${API_VERSION} | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
27 changes: 27 additions & 0 deletions
27
TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/DELETE.robot
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,27 @@ | ||
*** Settings *** | ||
Resource TAF/testCaseModules/keywords/common/commonKeywords.robot | ||
Suite Setup Run Keywords Setup Suite | ||
... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token | ||
Suite Teardown Run Teardown Keywords | ||
Force Tags Skipped | ||
|
||
*** Variables *** | ||
${SUITE} Support Cron Scheduler Job Delete Test Cases | ||
${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-delete.log | ||
|
||
*** Test Cases *** | ||
CronSchedJobDELETE001 - Delete job | ||
# Jobs contain combination with definition type CRON/INTERVAL and actions type REST/EDGEXMESSAGEBUS/DEVICECONTROL | ||
Given Create Multiple Jobs | ||
When Delete Job By Name | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And Job Has Been Deleted | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobDELETE001 - Delete job with invalid name | ||
When Delete Job By Invalid Name | ||
Then Should Return Status Code "404" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms |
62 changes: 62 additions & 0 deletions
62
TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/GET.robot
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,62 @@ | ||
*** Settings *** | ||
Resource TAF/testCaseModules/keywords/common/commonKeywords.robot | ||
Suite Setup Run Keywords Setup Suite | ||
... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token | ||
Suite Teardown Run Teardown Keywords | ||
Force Tags Skipped | ||
|
||
*** Variables *** | ||
${SUITE} Support Cron Scheduler Job Get Positive Test Cases | ||
${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-get-positive.log | ||
|
||
*** Test Cases *** | ||
CronSchedJobGET001 - Query all jobs | ||
Given Create Multiple Jobs | ||
When Query All Jobs | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And scheduleJobs Count Should Match totalCount | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedJobGET002 - Query all jobs by labels | ||
Given Create Multiple Jobs With Labels | ||
When Query All Jobs By Labels | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And scheduleJobs Count Should Be Correct | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedJobGET003 - Query all jobs by offset | ||
Given Create Multiple Jobs | ||
When Query All Jobs By Offset | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And scheduleJobs Count Should Match totalCount-offset | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedJobGET004 - Query all jobs by limit | ||
Given Create Multiple Jobs | ||
When Query All Jobs By Limit | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And scheduleJobs Count Should Match Limit | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedJobGET005 - Query job by name | ||
Given Create Multiple Jobs | ||
When Query Job By Name | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And Job Should Be Found | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobGET001 - Query job by name with non-existent job | ||
When Query Job By Name With Non-existent Job | ||
Then Should Return Status Code "404" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms |
78 changes: 78 additions & 0 deletions
78
TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/PATCH.robot
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,78 @@ | ||
*** Settings *** | ||
Resource TAF/testCaseModules/keywords/common/commonKeywords.robot | ||
Suite Setup Run Keywords Setup Suite | ||
... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token | ||
Suite Teardown Run Teardown Keywords | ||
Force Tags Skipped | ||
|
||
*** Variables *** | ||
${SUITE} Support Cron Scheduler Job PATCH Test Cases | ||
${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-patch.log | ||
|
||
*** Test Cases *** | ||
CronSchedJobPATCH001 - Update jobs | ||
# Update different field on each job | ||
Given Create Multiple Jobs | ||
When Update Jobs | ||
Then Should Return Status Code "207" | ||
And Should Return Content-Type "application/json" | ||
And Item Index All Should Contain Status Code "201" And id | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And Jobs Should Be Updated | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPATCH001 - Update job with empty definition type | ||
Given Create Multiple Jobs | ||
When Update Jobs With Empty Definition Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPATCH002 - Update job with empty definition scheduledef | ||
Given Create Multiple Jobs | ||
When Update Jobs With Empty Definition ScheduleDef | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPATCH003 - Update job with invalid definition type | ||
Given Create Multiple Jobs | ||
When Update Jobs With Invalid Definition Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPATCH004 - Update job with empty actions type | ||
Given Create Multiple Jobs | ||
When Update Jobs With Empty Actions Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPATCH005 - Update job with invalid actions type | ||
Given Create Multiple Jobs | ||
When Update Jobs With Invalid Actions Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPATCH006 - Update job with invalid admin state | ||
Given Create Multiple Jobs | ||
When Update Jobs With Invalid AdminState | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPATCH007 - Update job with startTimestamp > endTimestamp | ||
Given Create Multiple Jobs | ||
When Update Jobs With Incorrect Definition Timestamp | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs |
34 changes: 34 additions & 0 deletions
34
TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST-trigger.robot
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,34 @@ | ||
*** Settings *** | ||
Resource TAF/testCaseModules/keywords/common/commonKeywords.robot | ||
Suite Setup Run Keywords Setup Suite | ||
... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token | ||
Suite Teardown Run Teardown Keywords | ||
Force Tags Skipped | ||
|
||
*** Variables *** | ||
${SUITE} Support Cron Scheduler Job POST Trigger Test Cases | ||
${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-post-trigger.log | ||
|
||
*** Test Cases *** | ||
CronSchedJobTriggerPOST001 - Trigger job by manual | ||
Given Create Multiple Jobs | ||
When Trigger Job By Manual | ||
Then Should Return Status Code "202" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And Job Has Been Triggered | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobTriggerPOST001 - Trigger job by manual with non-existent job | ||
When Trigger Job By Manual With Non-existent Job | ||
Then Should Return Status Code "404" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobTriggerPOST002 - Trigger job by manual with the startTimestamp is not arrived yet | ||
Given Create Multiple Jobs | ||
When Trigger Job Which startTimestamp Is Not Arrived | ||
Then Should Return Status Code "500" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs |
68 changes: 68 additions & 0 deletions
68
TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST.robot
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,68 @@ | ||
*** Settings *** | ||
Resource TAF/testCaseModules/keywords/common/commonKeywords.robot | ||
Suite Setup Run Keywords Setup Suite | ||
... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token | ||
Suite Teardown Run Teardown Keywords | ||
Force Tags Skipped | ||
|
||
*** Variables *** | ||
${SUITE} Support Cron Scheduler Job POST Test Cases | ||
${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-post.log | ||
|
||
*** Test Cases *** | ||
CronSchedJobPOST001 - Create multiple jobs | ||
# Jobs contain combination with definition type CRON/INTERVAL and actions type REST/EDGEXMESSAGEBUS/DEVICECONTROL | ||
When Create Multiple Jobs | ||
Then Should Return Status Code "207" | ||
And Should Return Content-Type "application/json" | ||
And Item Index All Should Contain Status Code "201" And id | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
[Teardown] Delete Jobs | ||
|
||
ErrCronSchedJobPOST001 - Create job with empty name | ||
When Create Jobs With Empty Name | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobPOST002 - Create job with empty definition type | ||
When Create Jobs With Empty Definition Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobPOST003 - Create job with empty definition scheduledef | ||
When Create Jobs With Empty Definition ScheduleDef | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobPOST004 - Create job with invalid definition type | ||
When Create Jobs With Invalid Definition Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobPOST005 - Create job with empty actions type | ||
When Create Jobs With Empty Actions Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobPOST006 - Create job with invalid actions type | ||
When Create Jobs With Invalid Actions Type | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobPOST007 - Create job with invalid admin state | ||
When Create Jobs With Invalid AdminState | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
|
||
ErrCronSchedJobPOST008 - Create job with startTimestamp > endTimestamp | ||
When Create Jobs With Incorrect Definition Timestamp | ||
Then Should Return Status Code "400" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms |
77 changes: 77 additions & 0 deletions
77
...estScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-all.robot
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,77 @@ | ||
*** Settings *** | ||
Resource TAF/testCaseModules/keywords/common/commonKeywords.robot | ||
Suite Setup Run Keywords Setup Suite | ||
... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token | ||
Suite Teardown Run Teardown Keywords | ||
Force Tags Skipped | ||
|
||
*** Variables *** | ||
${SUITE} Support Cron Scheduler Action Record Get All Test Cases | ||
${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-action-record-get-all.log | ||
|
||
*** Test Cases *** | ||
CronSchedActionGET001 - Query all schedule action record | ||
Given Create Multiple Jobs | ||
And Wait For Running Schedule Job | ||
When Query All Schedule Action Record | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount | ||
And Job Name Should Be Matched With Created Jobs | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedActionGET002 - Query all schedule action record with start | ||
Given Create Multiple Jobs | ||
And Wait For Running Schedule Job | ||
When Query All Schedule Action Record With Start | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And Only Created Of ActionRecord Greater Start Should Be Found | ||
And Job Name Should Be Matched With Created Jobs | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedActionGET003 - Query all schedule action record with end | ||
Given Create Multiple Jobs | ||
And Wait For Running Schedule Job | ||
When Query All Schedule Action Record With End | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And Only Created Of ActionRecord Less Than End Should Be Found | ||
And Job Name Should Be Matched With Created Jobs | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedActionGET004 - Query all schedule action record with start/end | ||
Given Create Multiple Jobs | ||
And Wait For Running Schedule Job | ||
When Query All Schedule Action Record With Start/End | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And Only Created Of ActionRecord Between Start/End Should Be Found | ||
And Job Name Should Be Matched With Created Jobs | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedActionGET005 - Query all schedule action record with offset | ||
Given Create Multiple Jobs | ||
And Wait For Running Schedule Job | ||
When Query All Schedule Action Record With offset | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount-offset | ||
And Job Name Should Be Matched With Created Jobs | ||
[Teardown] Delete Jobs | ||
|
||
CronSchedActionGET006 - Query all schedule action record by start with limit | ||
Given Create Multiple Jobs | ||
And Wait For Running Schedule Job | ||
When Query All Schedule Action Record With Limit | ||
Then Should Return Status Code "200" | ||
And Should Return Content-Type "application/json" | ||
And Response Time Should Be Less Than "${default_response_time_threshold}"ms | ||
And totalCount Is Greater Than Zero And ActionRecord Count Should Match Limit | ||
And Job Name Should Be Matched With Created Jobs | ||
[Teardown] Delete Jobs |
Oops, something went wrong.