From: Jozef Zigmund <jzigmund(a)redhat.com>
---
src/features/deployment.feature | 35 ++++++++++++--------------
src/features/step_definitions/pool_steps.rb | 7 +++++
src/spec/factories/catalog_entry.rb | 36 ++++++++++++++++++++++++++-
3 files changed, 58 insertions(+), 20 deletions(-)
diff --git a/src/features/deployment.feature b/src/features/deployment.feature
index b7b28ab..62ed272 100644
--- a/src/features/deployment.feature
+++ b/src/features/deployment.feature
@@ -28,6 +28,8 @@ Feature: Manage Deployments
#working in a testable scenario.
Scenario: Launch new deployment
Given a pool "mockpool" exists
+ And "mockpool" has catalog "test"
+ And "test" has catalog_entry "test_catalog_entry"
And there is "front_hwp1" conductor hardware profile
And there is "front_hwp2" conductor hardware profile
And there is mock provider account "my_mock_provider"
@@ -35,8 +37,7 @@ Feature: Manage Deployments
When I am viewing the pool "mockpool"
And I follow "new_deployment_button"
Then I should see "New Deployment"
- And show me the page
- When I fill in "deployable_url" with
"http://localhost/deployables/deployable1.xml"
+ When I select "test_catalog_entry" from "catalog_entry_id"
When I fill in "deployment_name" with "mynewdeployment"
When I press "next_button"
Then I should see "Are you sure you wish to deploy"
@@ -48,6 +49,8 @@ Feature: Manage Deployments
Scenario: Launch new deployment over XHR
Given a pool "mockpool" exists
+ And "mockpool" has catalog "test"
+ And "test" has catalog_entry "test_catalog_entry"
And there is "front_hwp1" conductor hardware profile
And there is "front_hwp2" conductor hardware profile
When I am viewing the pool "mockpool"
@@ -55,7 +58,7 @@ Feature: Manage Deployments
And I follow "new_deployment_button"
Then I should get back a partial
Then I should see "New Deployment"
- When I fill in "deployable_url" with
"http://localhost/deployables/deployable1.xml"
+ When I select "test_catalog_entry" from "catalog_entry_id"
When I fill in "deployment_name" with "mynewdeployment"
When I press "next_button"
Then I should see "Are you sure you wish to deploy"
@@ -149,18 +152,6 @@ Feature: Manage Deployments
When I stop "mockdeployment" deployment
Then I should get back JSON object with success and errors
- Scenario: Provider invalid deployable xml URL when launching a deployment
- Given a pool "mockpool" exists
- When I am viewing the pool "mockpool"
- And I follow "new_deployment_button"
- Then I should see "New Deployment"
- When I fill in "deployable_url" with
"http://invalid.deployable.url/"
- And I fill in "deployment_name" with "mynewdeployment"
- And I press "next_button"
- Then I should see "New Deployment"
- And I should see "Deployment Details"
- And I should see "failed to get the deployable definition"
-
Scenario: Show deployment switch to deployment properties and back
Given there is a deployment named "testdeployment" belonging to
"testdeployable" owned by "testuser"
When I am on the deployments page
@@ -205,11 +196,13 @@ Feature: Manage Deployments
Scenario: Launch a deployment which is not launchable
Given a pool "mockpool" exists
+ And "mockpool" has catalog "test"
+ And "test" has catalog_entry "test_catalog_entry"
And there is "front_hwp1" conductor hardware profile
When I am viewing the pool "mockpool"
And I follow "New Deployment"
Then I should see "New Deployment"
- When I fill in "deployable_url" with
"http://localhost/deployables/deployable1.xml"
+ When I select "test_catalog_entry" from "catalog_entry_id"
When I fill in "deployment_name" with "mynewdeployment"
When I press "Next"
Then I should see "Are you sure you wish to deploy"
@@ -218,6 +211,8 @@ Feature: Manage Deployments
Scenario: Verify that the launch parameters are displayed
Given a pool "mockpool" exists
+ And "mockpool" has catalog "test"
+ And "test" has catalog_entry with parameters
"test_catalog_entry"
And there is "front_hwp1" conductor hardware profile
And there is "front_hwp2" conductor hardware profile
And there is mock provider account "my_mock_provider"
@@ -225,7 +220,7 @@ Feature: Manage Deployments
When I am viewing the pool "mockpool"
And I follow "New Deployment"
Then I should see "New Deployment"
- When I fill in "deployable_url" with
"http://localhost/deployables/deployable_with_launch_parameters.xml"
+ When I select "test_catalog_entry" from "catalog_entry_id"
And I fill in "deployment_name" with
"deployment_with_launch_parameters"
And I press "Next"
Then I should see "Configure launch-time parameters"
@@ -234,6 +229,8 @@ Feature: Manage Deployments
Scenario: Verify that the launch parameters are required
Given a pool "mockpool" exists
+ And "mockpool" has catalog "test"
+ And "test" has catalog_entry with parameters
"test_catalog_entry"
And there is "front_hwp1" conductor hardware profile
And there is "front_hwp2" conductor hardware profile
And there is mock provider account "my_mock_provider"
@@ -241,7 +238,7 @@ Feature: Manage Deployments
When I am viewing the pool "mockpool"
And I follow "New Deployment"
Then I should see "New Deployment"
- When I fill in "deployable_url" with
"http://localhost/deployables/deployable_with_launch_parameters.xml"
+ When I select "test_catalog_entry" from "catalog_entry_id"
And I fill in "deployment_name" with
"deployment_with_launch_parameters"
And I press "Next"
Then I should see "Configure launch-time parameters"
@@ -250,5 +247,5 @@ Feature: Manage Deployments
When I fill in
"deployment_launch_parameters_assembly_with_launch_parameters_service_with_launch_parameters_launch_parameter_1"
with "value_1"
And I press "submit_params"
Then I should see "Are you sure you wish to deploy"
- When I press "launch_deployment"
+ When I press "launch_deployment"
Then I should see "launch_parameter_2 cannot be blank"
diff --git a/src/features/step_definitions/pool_steps.rb
b/src/features/step_definitions/pool_steps.rb
index af9aa53..ceca4b2 100644
--- a/src/features/step_definitions/pool_steps.rb
+++ b/src/features/step_definitions/pool_steps.rb
@@ -134,3 +134,10 @@ Given /^"([^"]*)" has catalog_entry
"([^"]*)"$/ do |catalog_name, catalog_entry_
catalog_entry.catalog = catalog
catalog_entry.save!
end
+
+Given /^"([^"]*)" has catalog_entry with parameters
"([^"]*)"$/ do |catalog_name, catalog_entry_name|
+ catalog_entry = FactoryGirl.create :catalog_entry_with_parameters, :name =>
catalog_entry_name
+ catalog = Catalog.find_by_name(catalog_name)
+ catalog_entry.catalog = catalog
+ catalog_entry.save!
+end
\ No newline at end of file
diff --git a/src/spec/factories/catalog_entry.rb b/src/spec/factories/catalog_entry.rb
index 162103a..e98b282 100644
--- a/src/spec/factories/catalog_entry.rb
+++ b/src/spec/factories/catalog_entry.rb
@@ -19,9 +19,43 @@
FactoryGirl.define do
factory :catalog_entry do
sequence(:name) { |n| "catalog_entry#{n}" }
- xml "<?xml version=\"1.0\"?><deplyable
name='my'></deployable>"
+ xml "<?xml version=\"1.0\"?>
+ <deployable name='my'>
+ <description>This is my testing image</description>
+ <assemblies>
+ <assembly name='frontend' hwp='front_hwp1'>
+ <image id='85653387-88b2-46b0-b7b2-c779d2af06c7'
build='c5fc000b-829a-4bb5-9df1-bb228da2c7ec'></image>
+ </assembly>
+ <assembly name='backend' hwp='front_hwp2'>
+ <image id='85653387-88b2-46b0-b7b2-c779d2af06c7'
build='c5fc000b-829a-4bb5-9df1-bb228da2c7ec'>
+ </assemblies>
+ </deployable>"
description "catalog entry description"
association :catalog, :factory => :catalog
association :owner, :factory => :user
end
+
+ factory :catalog_entry_with_parameters, :parent => :catalog_entry do
+ xml "<?xml version=\"1.0\"?>
+ <deployable name='deployable_with_launch_parameters'>
+ <description>A Deployable with launch parameters</description>
+ <assemblies>
+ <assembly name='assembly_with_launch_parameters'
hwp='front_hwp1'>
+ <image id='34c87aa0-3405-42f8-820e-309054029295'/>
+ <services>
+ <service name='service_with_launch_parameters'>
+ <executable url='executable_url'/>
+ <files>
+ <file url='file_url'/>
+ </files>
+ <parameters>
+ <parameter name='launch_parameter_1'
type='scalar'/>
+ <parameter name='launch_parameter_2'
type='scalar'/>
+ </parameters>
+ </service>
+ </services>
+ </assembly>
+ </assemblies>
+ </deployable>"
+ end
end
--
1.7.6.4