more tests for scripts
This commit is contained in:
parent
76f9e73c94
commit
4620483cca
20
devops-service/features/api_v2/10_create/20_script.feature
Normal file
20
devops-service/features/api_v2/10_create/20_script.feature
Normal file
@ -0,0 +1,20 @@
|
||||
@script
|
||||
Feature: Add new script
|
||||
|
||||
Scenario: Add new script with user without privileges
|
||||
When I send PUT '/v2.0/script/cucumber_test_script' query with user without privileges
|
||||
Then response should be '401'
|
||||
|
||||
Scenario: Add new script without header 'Accept'
|
||||
When I send PUT '/v2.0/script/cucumber_test_script' query with body without header 'Accept'
|
||||
"""
|
||||
echo "cucumber test script"
|
||||
"""
|
||||
Then response should be '406'
|
||||
|
||||
Scenario: Add new script with id 'cucumber_test_script'
|
||||
When I send PUT '/v2.0/script/cucumber_test_script' query with body
|
||||
"""
|
||||
echo "cucumber test script"
|
||||
"""
|
||||
Then response should be '201'
|
||||
13
devops-service/features/api_v2/30_execute/20_script.feature
Normal file
13
devops-service/features/api_v2/30_execute/20_script.feature
Normal file
@ -0,0 +1,13 @@
|
||||
@script
|
||||
Feature: Run script
|
||||
|
||||
Scenario: Run script
|
||||
When I send POST '/v2.0/script/run/cucumber_test_script' query with JSON body
|
||||
"""
|
||||
{
|
||||
"nodes": [
|
||||
"devops-webapp_dev"
|
||||
]
|
||||
}
|
||||
"""
|
||||
Then response should be '200'
|
||||
16
devops-service/features/api_v2/90_delete/10_script.feature
Normal file
16
devops-service/features/api_v2/90_delete/10_script.feature
Normal file
@ -0,0 +1,16 @@
|
||||
@script
|
||||
Feature: Delete script
|
||||
|
||||
Scenario: Delete script with user without privileges
|
||||
When I send DELETE '/v2.0/script/cucumber_test_script' query with user without privileges
|
||||
Then response should be '401'
|
||||
|
||||
Scenario: Delete script without header 'Accept'
|
||||
When I send DELETE '/v2.0/script/cucumber_test_script' query without header 'Accept'
|
||||
Then response should be '406'
|
||||
|
||||
Scenario: Delete script with id 'cucumber_test_script'
|
||||
When I send DELETE '/v2.0/script/cucumber_test_script' query
|
||||
Then response should be '200'
|
||||
And the Content-Type header should include 'application/json'
|
||||
And the JSON response should be an object
|
||||
@ -58,6 +58,10 @@ When(/^I send DELETE '(.*)' query with user without privileges$/) do |path|
|
||||
delete_without_privileges(path, {}, DEFAULT_HEADERS)
|
||||
end
|
||||
|
||||
When(/^I send PUT '(.*)' query with body$/) do |path, body|
|
||||
res = put_body(path, body, DEFAULT_HEADERS)
|
||||
end
|
||||
|
||||
When(/^I send PUT '(.*)' query with JSON body$/) do |path, body|
|
||||
res = put_body(path, body, DEFAULT_HEADERS)
|
||||
end
|
||||
@ -66,6 +70,11 @@ When(/^I send PUT '(.*)' query with user without privileges$/) do |path|
|
||||
put_without_privileges(path, {}, DEFAULT_HEADERS)
|
||||
end
|
||||
|
||||
When(/^I send PUT '(.*)' query with body without header '(.*)'$/) do |path, hs, body|
|
||||
headers = DEFAULT_HEADERS.select{|h, v| h != hs}
|
||||
res = put_body(path, body, headers)
|
||||
end
|
||||
|
||||
When(/^I send PUT '(.*)' query with JSON body without header '(.*)'$/) do |path, hs, body|
|
||||
headers = DEFAULT_HEADERS.select{|h, v| h != hs}
|
||||
res = put_body(path, body, headers)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user