summaryrefslogtreecommitdiff
path: root/openstack_dashboard/test/integration_tests/pages/project/orchestration/stackspage.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack_dashboard/test/integration_tests/pages/project/orchestration/stackspage.py')
-rw-r--r--openstack_dashboard/test/integration_tests/pages/project/orchestration/stackspage.py99
1 files changed, 0 insertions, 99 deletions
diff --git a/openstack_dashboard/test/integration_tests/pages/project/orchestration/stackspage.py b/openstack_dashboard/test/integration_tests/pages/project/orchestration/stackspage.py
deleted file mode 100644
index 3b83d03..0000000
--- a/openstack_dashboard/test/integration_tests/pages/project/orchestration/stackspage.py
+++ /dev/null
@@ -1,99 +0,0 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from openstack_dashboard.test.integration_tests import config
14from openstack_dashboard.test.integration_tests.pages import basepage
15from openstack_dashboard.test.integration_tests.regions import forms
16from openstack_dashboard.test.integration_tests.regions import tables
17
18
19class StacksTable(tables.TableRegion):
20 name = "stacks"
21 SELECT_TEMPLATE_FORM_FIELDS = ("template_source", "template_upload",
22 "template_data", "template_url",
23 "environment_source", "environment_upload",
24 "environment_data")
25 LAUNCH_STACK_FORM_FIELDS = ("stack_name", "timeout_mins",
26 "enable_rollback", "password")
27
28 @tables.bind_table_action('launch')
29 def select_template(self, launch_button):
30 launch_button.click()
31 return forms.FormRegion(
32 self.driver, self.conf,
33 field_mappings=self.SELECT_TEMPLATE_FORM_FIELDS)
34
35 def launch_stack(self):
36 return forms.FormRegion(self.driver, self.conf,
37 field_mappings=self.LAUNCH_STACK_FORM_FIELDS)
38
39 @tables.bind_table_action('delete')
40 def delete_stack(self, delete_button):
41 delete_button.click()
42 return forms.BaseFormRegion(self.driver, self.conf)
43
44
45class StacksPage(basepage.BaseNavigationPage):
46 DEFAULT_TEMPLATE_SOURCE = 'raw'
47
48 CONFIG = config.get_config()
49 DEFAULT_PASSWORD = CONFIG.identity.admin_password
50 STACKS_TABLE_NAME_COLUMN = 'name'
51 STACKS_TABLE_STATUS_COLUMN = 'stack_status'
52
53 def __init__(self, driver, conf):
54 super(StacksPage, self).__init__(driver, conf)
55 self._page_title = "Stacks"
56
57 @property
58 def stacks_table(self):
59 return StacksTable(self.driver, self.conf)
60
61 def _get_row_with_stack_name(self, name):
62 return self.stacks_table.get_row(self.STACKS_TABLE_NAME_COLUMN, name)
63
64 def create_stack(self, stack_name, template_data,
65 template_source=DEFAULT_TEMPLATE_SOURCE,
66 environment_source=None,
67 environment_upload=None,
68 timeout_mins=None,
69 enable_rollback=None,
70 password=DEFAULT_PASSWORD):
71 select_template_form = self.stacks_table.select_template()
72 select_template_form.template_source.value = template_source
73 select_template_form.template_data.text = template_data
74 select_template_form.submit()
75 launch_stack_form = self.stacks_table.launch_stack()
76 launch_stack_form.stack_name.text = stack_name
77 launch_stack_form.password.text = password
78 launch_stack_form.submit()
79
80 def delete_stack(self, name):
81 row = self._get_row_with_stack_name(name)
82 row.mark()
83 confirm_delete_stacks_form = self.stacks_table.delete_stack()
84 confirm_delete_stacks_form.submit()
85
86 def is_stack_present(self, name):
87 return bool(self._get_row_with_stack_name(name))
88
89 def is_stack_create_complete(self, name):
90 def cell_getter():
91 row = self._get_row_with_stack_name(name)
92 return row and row.cells[self.STACKS_TABLE_STATUS_COLUMN]
93
94 return bool(self.stacks_table.wait_cell_status(cell_getter,
95 'Create Complete'))
96
97 def is_stack_deleted(self, name):
98 return self.stacks_table.is_row_deleted(
99 lambda: self._get_row_with_stack_name(name))