Browse Source

Add heat-dashboard integration tests

This patch adds basic tests to verify that heat-dashboard is
installed and could be opened.

heat-dashboard-integration-tests job is added in a
non-voting mode.

Depends-On: https://review.openstack.org/634712
Change-Id: I2550d6fcd1ce4e05502f247e227aaec05e762fcb
Ivan Kolodyazhny 2 months ago
parent
commit
e4a8ab4a11

+ 25
- 0
.zuul.yaml View File

@@ -1,3 +1,26 @@
1
+- job:
2
+    name: heat-dashboard-integration-tests
3
+    parent: horizon-integration-tests
4
+    required-projects:
5
+      - name: openstack/horizon
6
+      - name: openstack/heat
7
+      - name: openstack/python-heatclient
8
+      - name: openstack/heat-dashboard
9
+    roles:
10
+      - zuul: openstack-infra/devstack
11
+      - zuul: openstack/horizon
12
+    irrelevant-files:
13
+      - ^.*\.rst$
14
+      - ^doc/.*$
15
+      - ^releasenotes/.*$
16
+    vars:
17
+      devstack_plugins:
18
+        heat: https://git.openstack.org/openstack/heat
19
+        heat-dashboard: https://git.openstack.org/openstack/heat-dashboard
20
+      devstack_services:
21
+        horizon: true
22
+      tox_envlist: integration
23
+
1 24
 - project:
2 25
     templates:
3 26
       - check-requirements
@@ -10,6 +33,8 @@
10 33
     check:
11 34
       jobs:
12 35
         - horizon-openstack-tox-python3-django111
36
+        - heat-dashboard-integration-tests:
37
+            voting: false
13 38
     gate:
14 39
       jobs:
15 40
         - horizon-openstack-tox-python3-django111

+ 5
- 0
bindep.txt View File

@@ -0,0 +1,5 @@
1
+# selenium tests
2
+firefox [selenium]
3
+xvfb [selenium platform:dpkg]
4
+# already part of xorg-x11-server on openSUSE
5
+xorg-x11-server-Xvfb [selenium platform:redhat]

+ 0
- 0
heat_dashboard/test/integration/__init__.py View File


+ 5
- 0
heat_dashboard/test/integration/horizon.conf View File

@@ -0,0 +1,5 @@
1
+[plugin]
2
+is_plugin=True
3
+plugin_page_path=heat_dashboard.test.integration.pages
4
+plugin_page_structure='{"Project": {"Orchestration": {"_": ["Stacks", "Resource Types", "Template Versions", "Template Generator"]}}}'
5
+

+ 0
- 0
heat_dashboard/test/integration/pages/__init__.py View File


+ 0
- 0
heat_dashboard/test/integration/pages/project/__init__.py View File


+ 0
- 0
heat_dashboard/test/integration/pages/project/orchestration/__init__.py View File


+ 21
- 0
heat_dashboard/test/integration/pages/project/orchestration/resourcetypespage.py View File

@@ -0,0 +1,21 @@
1
+#
2
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+#    not use this file except in compliance with the License. You may obtain
4
+#    a copy of the License at
5
+#
6
+#         http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+#    Unless required by applicable law or agreed to in writing, software
9
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+#    License for the specific language governing permissions and limitations
12
+#    under the License.
13
+
14
+
15
+from openstack_dashboard.test.integration_tests.pages import basepage
16
+
17
+
18
+class ResourcetypesPage(basepage.BaseNavigationPage):
19
+    def __init__(self, driver, conf):
20
+        super(ResourcetypesPage, self).__init__(driver, conf)
21
+        self._page_title = "Resource Types"

+ 21
- 0
heat_dashboard/test/integration/pages/project/orchestration/stackspage.py View File

@@ -0,0 +1,21 @@
1
+#
2
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+#    not use this file except in compliance with the License. You may obtain
4
+#    a copy of the License at
5
+#
6
+#         http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+#    Unless required by applicable law or agreed to in writing, software
9
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+#    License for the specific language governing permissions and limitations
12
+#    under the License.
13
+
14
+
15
+from openstack_dashboard.test.integration_tests.pages import basepage
16
+
17
+
18
+class StacksPage(basepage.BaseNavigationPage):
19
+    def __init__(self, driver, conf):
20
+        super(StacksPage, self).__init__(driver, conf)
21
+        self._page_title = "Stacks"

+ 21
- 0
heat_dashboard/test/integration/pages/project/orchestration/templategeneratorpage.py View File

@@ -0,0 +1,21 @@
1
+#
2
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+#    not use this file except in compliance with the License. You may obtain
4
+#    a copy of the License at
5
+#
6
+#         http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+#    Unless required by applicable law or agreed to in writing, software
9
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+#    License for the specific language governing permissions and limitations
12
+#    under the License.
13
+
14
+
15
+from openstack_dashboard.test.integration_tests.pages import basepage
16
+
17
+
18
+class TemplategeneratorPage(basepage.BaseNavigationPage):
19
+    def __init__(self, driver, conf):
20
+        super(TemplategeneratorPage, self).__init__(driver, conf)
21
+        self._page_title = "Template Generator"

+ 21
- 0
heat_dashboard/test/integration/pages/project/orchestration/templateversionspage.py View File

@@ -0,0 +1,21 @@
1
+#
2
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+#    not use this file except in compliance with the License. You may obtain
4
+#    a copy of the License at
5
+#
6
+#         http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+#    Unless required by applicable law or agreed to in writing, software
9
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+#    License for the specific language governing permissions and limitations
12
+#    under the License.
13
+
14
+
15
+from openstack_dashboard.test.integration_tests.pages import basepage
16
+
17
+
18
+class TemplateversionsPage(basepage.BaseNavigationPage):
19
+    def __init__(self, driver, conf):
20
+        super(TemplateversionsPage, self).__init__(driver, conf)
21
+        self._page_title = "Template Versions"

+ 41
- 0
heat_dashboard/test/integration/test_basic.py View File

@@ -0,0 +1,41 @@
1
+#
2
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+#    not use this file except in compliance with the License. You may obtain
4
+#    a copy of the License at
5
+#
6
+#         http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+#    Unless required by applicable law or agreed to in writing, software
9
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+#    License for the specific language governing permissions and limitations
12
+#    under the License.
13
+
14
+
15
+from openstack_dashboard.test.integration_tests import helpers
16
+
17
+
18
+class TestHeatDashboardInstalled(helpers.TestCase):
19
+    def test_alarms_page_opened(self):
20
+        stacks_page = self.home_pg.go_to_project_orchestration_stackspage()
21
+        self.assertEqual(stacks_page.page_title,
22
+                         'Stacks - OpenStack Dashboard')
23
+
24
+    def test_resource_types_page_opened(self):
25
+        resource_types_page = (
26
+            self.home_pg.go_to_project_orchestration_resourcetypespage())
27
+        self.assertEqual(resource_types_page.page_title,
28
+                         'Resource Types - OpenStack Dashboard')
29
+
30
+    def test_template_versions_page_opened(self):
31
+        template_versions_page = (
32
+            self.home_pg.go_to_project_orchestration_templateversionspage())
33
+        self.assertEqual(template_versions_page.page_title,
34
+                         'Template Versions - OpenStack Dashboard')
35
+
36
+    def test_template_generator_page_opened(self):
37
+        template_generator_page = (
38
+            self.home_pg.go_to_project_orchestration_templategeneratorpage())
39
+        # TODO(e0ne): fix page title once Heat dashaboard will be updated
40
+        self.assertEqual(template_generator_page.page_title,
41
+                         'Horizon - OpenStack Dashboard')

+ 2
- 0
lower-constraints.txt View File

@@ -104,6 +104,7 @@ restructuredtext-lint==1.1.1
104 104
 rfc3986==0.3.1
105 105
 rjsmin==1.0.12
106 106
 Routes==2.3.1
107
+selenium==2.50.1
107 108
 semantic-version==2.3.1
108 109
 simplejson==3.5.1
109 110
 six==1.10.0
@@ -151,3 +152,4 @@ xstatic-angular-vis===4.16.0.0
151 152
 xstatic-filesaver===1.3.2.0
152 153
 xstatic-js-yaml===3.8.1.0
153 154
 xstatic-json2yaml===0.1.1.0
155
+xvfbwrapper==0.1.3

+ 4
- 0
test-requirements.txt View File

@@ -15,3 +15,7 @@ flake8-import-order==0.12 # LGPLv3
15 15
 mock>=2.0.0 # BSD
16 16
 nodeenv>=0.9.4 # BSD
17 17
 testtools>=2.2.0 # MIT
18
+
19
+# integration tests requirements
20
+selenium>=2.50.1 # Apache-2.0
21
+xvfbwrapper>=0.1.3 #license: MIT

+ 12
- 1
tox.ini View File

@@ -24,7 +24,18 @@ commands =
24 24
 [unit_tests]
25 25
 commands =
26 26
   pip install -r requirements.txt
27
-  python manage.py test heat_dashboard.test --settings=heat_dashboard.test.settings
27
+  python manage.py test heat_dashboard.test --settings=heat_dashboard.test.settings --exclude-tag integration
28
+
29
+[testenv:integration]
30
+# Run integration tests only
31
+passenv = AVCONV_INSTALLED
32
+setenv =
33
+  PYTHONHASHSEED=0
34
+  INTEGRATION_TESTS=1
35
+  SELENIUM_HEADLESS=1
36
+  HORIZON_INTEGRATION_TESTS_CONFIG_FILE=heat_dashboard/test/integration/horizon.conf
37
+basepython = python2.7
38
+commands = python manage.py test heat_dashboard.test.integration --settings=heat_dashboard.test.settings --tag integration
28 39
 
29 40
 [testenv:pep8]
30 41
 commands = flake8 {posargs}

Loading…
Cancel
Save