Add manila-ui integration tests

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

manila-ui-integration-tests job is added in a
non-voting mode.

Depends-On: https://review.openstack.org/634712
Change-Id: I67e876a5cb26637b62225fc854a906dc1a714e76
This commit is contained in:
Ivan Kolodyazhny 2019-02-06 00:28:44 -08:00
parent 13d0c11966
commit 019526b5f8
31 changed files with 502 additions and 2 deletions

View File

@ -11,6 +11,8 @@
jobs:
- manila-ui-dsvm:
voting: false
- manila-ui-integration-tests:
voting: false
- horizon-openstack-tox-python3-django111
- horizon-openstack-tox-py27dj19
- horizon-openstack-tox-py27dj110
@ -33,3 +35,29 @@
- openstack/manila-ui
- openstack/python-manilaclient
- openstack/manila-tempest-plugin
- job:
name: manila-ui-integration-tests
parent: horizon-integration-tests
required-projects:
- name: openstack/horizon
- name: openstack/manila
- name: openstack/python-manilaclient
- name: openstack/manila-ui
- name: openstack/manila-tempest-plugin
roles:
- zuul: openstack-infra/devstack
- zuul: openstack/horizon
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
vars:
devstack_plugins:
manila: git://git.openstack.org/openstack/manila
manila-ui: git://git.openstack.org/openstack/manila-ui
devstack_services:
horizon: true
tls-proxy: false
tox_envlist: integration

6
bindep.txt Normal file
View File

@ -0,0 +1,6 @@
# 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

@ -94,6 +94,7 @@ requests==2.18.4
requestsexceptions==1.4.0
rfc3986==1.1.0
rjsmin==1.0.12
selenium==2.50.1
semantic-version==2.6.0
simplejson==3.13.2
six==1.10.0
@ -138,3 +139,4 @@ XStatic-smart-table==1.4.13.2
XStatic-Spin==1.2.5.2
XStatic-term.js==0.0.7.0
XStatic-tv4==1.2.7.0
xvfbwrapper==0.1.3

View File

View File

@ -0,0 +1,4 @@
[plugin]
is_plugin=True
plugin_page_path=manila_ui.tests.integration.pages
plugin_page_structure='{"Project": {"Share": {"_": ["Shares", "Share Snapshots", "Share Networks", "Security Services", "Share Groups", "Share Group Snapshots"]}}, "Admin": {"Share": {"_": ["Shares", "Share Snapshots", "Share Types", "Share Networks", "Security Services", "Share Servers", "Share Instances", "Share Groups", "Share Group Snapshots", "Share Group Types"]}}}'

View File

@ -0,0 +1,20 @@
#
# 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 manila_ui.tests.integration.pages.project.share import \
securityservicespage
class SecurityservicesPage(securityservicespage.SecurityservicesPage):
pass

View File

@ -0,0 +1,20 @@
#
# 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 manila_ui.tests.integration.pages.project.share import \
sharegroupsnapshotspage as sg_snapshots_page
class SharegroupsnapshotsPage(sg_snapshots_page.SharegroupsnapshotsPage):
pass

View File

@ -0,0 +1,19 @@
#
# 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 manila_ui.tests.integration.pages.project.share import sharegroupspage
class SharegroupsPage(sharegroupspage.SharegroupsPage):
pass

View File

@ -0,0 +1,20 @@
#
# 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 manila_ui.tests.integration.pages.project.share import \
sharegroupsnapshotspage as sg_snapshots_page
class SharegroupssnapshotsPage(sg_snapshots_page.SharegroupssnapshotsPage):
pass

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 SharegrouptypesPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SharegrouptypesPage, self).__init__(driver, conf)
self._page_title = "Share Group 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 ShareinstancesPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(ShareinstancesPage, self).__init__(driver, conf)
self._page_title = "Share Instances"

View File

@ -0,0 +1,19 @@
#
# 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 manila_ui.tests.integration.pages.project.share import sharenetworkspage
class SharenetworksPage(sharenetworkspage.SharenetworksPage):
pass

View File

@ -0,0 +1,19 @@
#
# 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 ShareserversPage(basepage.BaseNavigationPage):
pass

View File

@ -0,0 +1,19 @@
#
# 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 manila_ui.tests.integration.pages.project.share import sharesnapshotspage
class SharesnapshotsPage(sharesnapshotspage.SharesnapshotsPage):
pass

View File

@ -0,0 +1,19 @@
#
# 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 manila_ui.tests.integration.pages.project.share import sharespage
class SharesPage(sharespage.SharesPage):
pass

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 SharetypesPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SharetypesPage, self).__init__(driver, conf)
self._page_title = "Share 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 SecurityservicesPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SecurityservicesPage, self).__init__(driver, conf)
self._page_title = "Security Services"

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 SharegroupsnapshotsPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SharegroupsnapshotsPage, self).__init__(driver, conf)
self._page_title = "Share Group Snapshots"

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 SharegroupsPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SharegroupsPage, self).__init__(driver, conf)
self._page_title = "Share Groups"

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 SharenetworksPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SharenetworksPage, self).__init__(driver, conf)
self._page_title = "Share Networks"

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 SharesnapshotsPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SharesnapshotsPage, self).__init__(driver, conf)
self._page_title = "Share Snapshots"

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 SharesPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(SharesPage, self).__init__(driver, conf)
self._page_title = "Shares"

View File

@ -0,0 +1,101 @@
#
# 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 TestManilaDashboardInstalled(helpers.TestCase):
def test_shares_page_opened(self):
shares_page = self.home_pg.go_to_project_share_sharespage()
self.assertEqual(shares_page.page_title,
'Shares - OpenStack Dashboard')
def test_share_snapshots_page_opened(self):
s_snaps_page = self.home_pg.go_to_project_share_sharesnapshotspage()
self.assertEqual(s_snaps_page.page_title,
'Share Snapshots - OpenStack Dashboard')
def test_share_networks_page_opened(self):
s_networks_page = self.home_pg.go_to_project_share_sharenetworkspage()
self.assertEqual(s_networks_page.page_title,
'Share Networks - OpenStack Dashboard')
def test_security_services_page_opened(self):
sec_serv_page = self.home_pg.go_to_project_share_securityservicespage()
self.assertEqual(sec_serv_page.page_title,
'Security Services - OpenStack Dashboard')
def test_share_groups_page_opened(self):
share_groups_page = self.home_pg.go_to_project_share_sharegroupspage()
self.assertEqual(share_groups_page.page_title,
'Share Groups - OpenStack Dashboard')
def test_share_group_snapthots_page_opened(self):
sg_s_page = self.home_pg.go_to_project_share_sharegroupsnapshotspage()
self.assertEqual(sg_s_page.page_title,
'Share Group Snapshots - OpenStack Dashboard')
class TestManilaAdminDashboardInstalled(helpers.AdminTestCase):
def test_shares_page_opened(self):
shares_page = self.home_pg.go_to_admin_share_sharespage()
self.assertEqual(shares_page.page_title,
'Shares - OpenStack Dashboard')
def test_share_snapshots_page_opened(self):
s_snapshots_page = self.home_pg.go_to_admin_share_sharesnapshotspage()
# TODO(e0ne): fix page title and test
self.assertEqual(s_snapshots_page.page_title,
'Shares - OpenStack Dashboard')
def test_share_snapshot_types_page_opened(self):
share_types_page = (
self.home_pg.go_to_admin_share_sharetypespage())
self.assertEqual(share_types_page.page_title,
'Share Types - OpenStack Dashboard')
def test_share_networks_page_opened(self):
s_networks_page = self.home_pg.go_to_admin_share_sharenetworkspage()
self.assertEqual(s_networks_page.page_title,
'Share Networks - OpenStack Dashboard')
def test_security_services_page_opened(self):
sec_serv_page = self.home_pg.go_to_admin_share_securityservicespage()
self.assertEqual(sec_serv_page.page_title,
'Security Services - OpenStack Dashboard')
def test_share_servers_page_opened(self):
share_serv_page = self.home_pg.go_to_admin_share_shareserverspage()
self.assertEqual(share_serv_page.page_title,
'Share Servers - OpenStack Dashboard')
def test_share_instences_page_opened(self):
sec_serv_page = self.home_pg.go_to_admin_share_shareinstancespage()
self.assertEqual(sec_serv_page.page_title,
'Share Instances - OpenStack Dashboard')
def test_share_groups_page_opened(self):
share_groups_page = self.home_pg.go_to_admin_share_sharegroupspage()
self.assertEqual(share_groups_page.page_title,
'Share Groups - OpenStack Dashboard')
def test_share_group_snapthots_page_opened(self):
sg_s_page = self.home_pg.go_to_admin_share_sharegroupsnapshotspage()
self.assertEqual(sg_s_page.page_title,
'Share Group Snapshots - OpenStack Dashboard')
def test_share_group_types_page_opened(self):
sg_types_page = self.home_pg.go_to_admin_share_sharegrouptypespage()
self.assertEqual(sg_types_page.page_title,
'Share Group Types - OpenStack Dashboard')

View File

@ -331,7 +331,7 @@ function run_tests {
function run_tests_subset {
project=`echo $testargs | awk -F. '{print $1}'`
${command_wrapper} python $root/manage.py test --settings=$project.tests.settings $testopts $testargs
${command_wrapper} python $root/manage.py test --settings=$project.tests.settings --exclude-tag integration $testopts $testargs
}
function run_tests_all {
@ -344,7 +344,7 @@ function run_tests_all {
${command_wrapper} python -m coverage.__main__ erase
coverage_run="python -m coverage.__main__ run -p"
fi
${command_wrapper} ${coverage_run} $root/manage.py test manila_ui --settings=manila_ui.tests.settings $testopts
${command_wrapper} ${coverage_run} $root/manage.py test manila_ui --settings=manila_ui.tests.settings --exclude-tag integration $testopts
# get results of the Horizon tests
MANILA_UI_RESULT=$?

View File

@ -13,3 +13,6 @@ testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0
# integration tests requirements
selenium>=2.50.1 # Apache-2.0
xvfbwrapper>=0.1.3 #license: MIT

12
tox.ini
View File

@ -27,6 +27,18 @@ commands =
pip install {env:HORIZON_REPO:git+git://git.openstack.org/openstack/horizon}
{[testenv]commands}
RIZON_INTEGRATION_TESTS_CONFIG_FILE=manila_ui/tests/integration/horizon.conf
[testenv:integration]
# Run integration tests only
passenv = AVCONV_INSTALLED
setenv =
PYTHONHASHSEED=0
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=1
HORIZON_INTEGRATION_TESTS_CONFIG_FILE=manila_ui/tests/integration/horizon.conf
basepython = python2.7
commands = {envpython} {toxinidir}/manage.py test manila_ui --settings=manila_ui.tests.settings --tag integration
[testenv:pep8]
basepython = python3
commands = flake8