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
This commit is contained in:
Ivan Kolodyazhny 2019-02-04 12:03:04 -08:00
parent d17cae6e77
commit e4a8ab4a11
15 changed files with 178 additions and 1 deletions

View File

@ -1,3 +1,26 @@
- job:
name: heat-dashboard-integration-tests
parent: horizon-integration-tests
required-projects:
- name: openstack/horizon
- name: openstack/heat
- name: openstack/python-heatclient
- name: openstack/heat-dashboard
roles:
- zuul: openstack-infra/devstack
- zuul: openstack/horizon
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
vars:
devstack_plugins:
heat: https://git.openstack.org/openstack/heat
heat-dashboard: https://git.openstack.org/openstack/heat-dashboard
devstack_services:
horizon: true
tox_envlist: integration
- project: - project:
templates: templates:
- check-requirements - check-requirements
@ -10,6 +33,8 @@
check: check:
jobs: jobs:
- horizon-openstack-tox-python3-django111 - horizon-openstack-tox-python3-django111
- heat-dashboard-integration-tests:
voting: false
gate: gate:
jobs: jobs:
- horizon-openstack-tox-python3-django111 - horizon-openstack-tox-python3-django111

5
bindep.txt Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,41 @@
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from openstack_dashboard.test.integration_tests import helpers
class TestHeatDashboardInstalled(helpers.TestCase):
def test_alarms_page_opened(self):
stacks_page = self.home_pg.go_to_project_orchestration_stackspage()
self.assertEqual(stacks_page.page_title,
'Stacks - OpenStack Dashboard')
def test_resource_types_page_opened(self):
resource_types_page = (
self.home_pg.go_to_project_orchestration_resourcetypespage())
self.assertEqual(resource_types_page.page_title,
'Resource Types - OpenStack Dashboard')
def test_template_versions_page_opened(self):
template_versions_page = (
self.home_pg.go_to_project_orchestration_templateversionspage())
self.assertEqual(template_versions_page.page_title,
'Template Versions - OpenStack Dashboard')
def test_template_generator_page_opened(self):
template_generator_page = (
self.home_pg.go_to_project_orchestration_templategeneratorpage())
# TODO(e0ne): fix page title once Heat dashaboard will be updated
self.assertEqual(template_generator_page.page_title,
'Horizon - OpenStack Dashboard')

View File

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

View File

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

13
tox.ini
View File

@ -24,7 +24,18 @@ commands =
[unit_tests] [unit_tests]
commands = commands =
pip install -r requirements.txt pip install -r requirements.txt
python manage.py test heat_dashboard.test --settings=heat_dashboard.test.settings python manage.py test heat_dashboard.test --settings=heat_dashboard.test.settings --exclude-tag integration
[testenv:integration]
# Run integration tests only
passenv = AVCONV_INSTALLED
setenv =
PYTHONHASHSEED=0
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=1
HORIZON_INTEGRATION_TESTS_CONFIG_FILE=heat_dashboard/test/integration/horizon.conf
basepython = python2.7
commands = python manage.py test heat_dashboard.test.integration --settings=heat_dashboard.test.settings --tag integration
[testenv:pep8] [testenv:pep8]
commands = flake8 {posargs} commands = flake8 {posargs}