diff --git a/openstack_dashboard/test/integration_tests/tests/test_dashboard_help_redirection.py b/openstack_dashboard/test/integration_tests/tests/test_dashboard_help_redirection.py deleted file mode 100644 index 88e6f0293..000000000 --- a/openstack_dashboard/test/integration_tests/tests/test_dashboard_help_redirection.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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 TestDashboardHelp(helpers.TestCase): - - def test_dashboard_help_redirection(self): - """Verifies Help link redirects to the right URL.""" - - self.home_pg.go_to_help_page() - self.home_pg._wait_until( - lambda _: self.home_pg.is_nth_window_opened(2)) - self.home_pg.switch_window() - - self.assertEqual(self.CONFIG.dashboard.help_url, - self.home_pg.get_url_current_page(), - "help link did not redirect to the right URL") - - self.home_pg.close_window() - self.home_pg.switch_window() diff --git a/openstack_dashboard/test/integration_tests/tests/test_floatingip.py b/openstack_dashboard/test/integration_tests/tests/test_floatingips.py similarity index 100% rename from openstack_dashboard/test/integration_tests/tests/test_floatingip.py rename to openstack_dashboard/test/integration_tests/tests/test_floatingips.py diff --git a/openstack_dashboard/test/integration_tests/tests/test_image_create_delete.py b/openstack_dashboard/test/integration_tests/tests/test_images.py similarity index 100% rename from openstack_dashboard/test/integration_tests/tests/test_image_create_delete.py rename to openstack_dashboard/test/integration_tests/tests/test_images.py diff --git a/openstack_dashboard/test/integration_tests/tests/test_keypair.py b/openstack_dashboard/test/integration_tests/tests/test_keypairs.py similarity index 100% rename from openstack_dashboard/test/integration_tests/tests/test_keypair.py rename to openstack_dashboard/test/integration_tests/tests/test_keypairs.py diff --git a/openstack_dashboard/test/integration_tests/tests/test_network.py b/openstack_dashboard/test/integration_tests/tests/test_networks.py similarity index 100% rename from openstack_dashboard/test/integration_tests/tests/test_network.py rename to openstack_dashboard/test/integration_tests/tests/test_networks.py diff --git a/openstack_dashboard/test/integration_tests/tests/test_password_change.py b/openstack_dashboard/test/integration_tests/tests/test_password_change.py deleted file mode 100644 index 802faba7a..000000000 --- a/openstack_dashboard/test/integration_tests/tests/test_password_change.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 - -NEW_PASSWORD = "123" - - -class TestPasswordChange(helpers.TestCase): - - def _reset_password(self): - passwordchange_page = self.home_pg.go_to_settings_changepasswordpage() - passwordchange_page.reset_to_default_password(NEW_PASSWORD) - - def _login(self): - self.login_pg.login() - self.assertTrue(self.home_pg.is_logged_in, - "Failed to login with default password") - - def test_password_change(self): - """Changes the password, verifies it was indeed changed and resets to - default password. - """ - passwordchange_page = self.home_pg.go_to_settings_changepasswordpage() - - try: - passwordchange_page.change_password(self.TEST_PASSWORD, - NEW_PASSWORD) - - self.home_pg = self.login_pg.login(user=self.TEST_USER_NAME, - password=NEW_PASSWORD) - self.assertTrue(self.home_pg.is_logged_in, - "Failed to login with new password") - finally: - self._reset_password() - self._login() - - def test_show_message_after_logout(self): - """Ensure an informational message is shown on the login page after the - user is logged out. - """ - passwordchange_page = self.home_pg.go_to_settings_changepasswordpage() - - try: - passwordchange_page.change_password(self.TEST_PASSWORD, - NEW_PASSWORD) - self.assertTrue( - self.login_pg.is_logout_reason_displayed(), - "The logout reason message was not found on the login page") - finally: - self.login_pg.login(user=self.TEST_USER_NAME, - password=NEW_PASSWORD) - self._reset_password() - self._login() diff --git a/openstack_dashboard/test/integration_tests/tests/test_user_settings.py b/openstack_dashboard/test/integration_tests/tests/test_user_settings.py index ec056f360..607e1d880 100644 --- a/openstack_dashboard/test/integration_tests/tests/test_user_settings.py +++ b/openstack_dashboard/test/integration_tests/tests/test_user_settings.py @@ -14,8 +14,73 @@ from openstack_dashboard.test.integration_tests import helpers from openstack_dashboard.test.integration_tests.regions import messages -class TestUserSettings(helpers.TestCase): +class TestDashboardHelp(helpers.TestCase): + def test_dashboard_help_redirection(self): + """Verifies Help link redirects to the right URL.""" + self.home_pg.go_to_help_page() + self.home_pg._wait_until( + lambda _: self.home_pg.is_nth_window_opened(2)) + self.home_pg.switch_window() + + self.assertEqual(self.CONFIG.dashboard.help_url, + self.home_pg.get_url_current_page(), + "help link did not redirect to the right URL") + + self.home_pg.close_window() + self.home_pg.switch_window() + + +class TestPasswordChange(helpers.TestCase): + NEW_PASSWORD = "123" + + def _reset_password(self): + passwordchange_page = self.home_pg.go_to_settings_changepasswordpage() + passwordchange_page.reset_to_default_password(self.NEW_PASSWORD) + + def _login(self): + self.login_pg.login() + self.assertTrue(self.home_pg.is_logged_in, + "Failed to login with default password") + + def test_password_change(self): + """Changes the password, verifies it was indeed changed and resets to + default password. + """ + passwordchange_page = self.home_pg.go_to_settings_changepasswordpage() + + try: + passwordchange_page.change_password(self.TEST_PASSWORD, + self.NEW_PASSWORD) + + self.home_pg = self.login_pg.login(user=self.TEST_USER_NAME, + password=self.NEW_PASSWORD) + self.assertTrue(self.home_pg.is_logged_in, + "Failed to login with new password") + finally: + self._reset_password() + self._login() + + def test_show_message_after_logout(self): + """Ensure an informational message is shown on the login page after the + user is logged out. + """ + passwordchange_page = self.home_pg.go_to_settings_changepasswordpage() + + try: + passwordchange_page.change_password(self.TEST_PASSWORD, + self.NEW_PASSWORD) + self.assertTrue( + self.login_pg.is_logout_reason_displayed(), + "The logout reason message was not found on the login page") + finally: + self.login_pg.login(user=self.TEST_USER_NAME, + password=self.NEW_PASSWORD) + self._reset_password() + self._login() + + +class TestUserSettings(helpers.TestCase): def verify_user_settings_change(self, settings_page, changed_settings): language = settings_page.settings_form.language.value timezone = settings_page.settings_form.timezone.value diff --git a/openstack_dashboard/test/integration_tests/tests/test_user_create_delete.py b/openstack_dashboard/test/integration_tests/tests/test_users.py similarity index 100% rename from openstack_dashboard/test/integration_tests/tests/test_user_create_delete.py rename to openstack_dashboard/test/integration_tests/tests/test_users.py