From 32a0c4f2180e9b5fbf33b6fa1d881594cbedf9a5 Mon Sep 17 00:00:00 2001 From: Anastasia Kuznetsova Date: Fri, 16 May 2014 15:50:42 +0400 Subject: [PATCH] Fix broken tests for web UI Change-Id: I0d22f9787fbe9f51f754c7ce773e5ea6d8d0fd81 --- muranodashboard-tests/base.py | 9 ++++++++- muranodashboard-tests/sanity_check.py | 24 +++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/muranodashboard-tests/base.py b/muranodashboard-tests/base.py index 5560cda..2f06324 100644 --- a/muranodashboard-tests/base.py +++ b/muranodashboard-tests/base.py @@ -574,4 +574,11 @@ class UITestCase(BaseDeps): def select_and_click_action_for_app(self, action, app): self.driver.find_element_by_xpath( - "//*[@href='/murano/catalog/{0}/{1}']".format(action, app)).click() + "//*[@href='/horizon/murano/catalog/{0}/{1}']" + .format(action, app)).click() + + def modify_package(self, param, value): + self.fill_field(by.By.ID, 'id_{0}'.format(param), value) + self.driver.find_element_by_xpath( + self.elements.get('button', 'InputSubmit')).click() + self.driver.refresh() diff --git a/muranodashboard-tests/sanity_check.py b/muranodashboard-tests/sanity_check.py index 37e2d65..c83d632 100644 --- a/muranodashboard-tests/sanity_check.py +++ b/muranodashboard-tests/sanity_check.py @@ -883,7 +883,7 @@ class UISanityTests(UITestCase): self.assertTrue(self.check_element_on_page( by.By.XPATH, './/*[@data-display="PostgreSQL"]')) - def test_027_modify_description(self): + def test_041_modify_description(self): """ Test check ability to change description of the package @@ -897,13 +897,10 @@ class UISanityTests(UITestCase): self.select_action_for_package('PostgreSQL', 'modify_package') - self.fill_field(by.By.ID, 'id_description', 'New Description') - self.driver.find_element_by_xpath( - self.elements.get('button', 'InputSubmit')).click() + self.modify_package('description', 'New Description') self.navigate_to('Application_Catalog') self.go_to_submenu('Applications') - self.check_element_on_page( ".//*[@class='app-description']", 'New Description') @@ -923,8 +920,7 @@ class UISanityTests(UITestCase): 'modify_package') self.fill_field(by.By.ID, 'id_tags', 'TEST_TAG') - self.driver.find_element_by_xpath( - self.elements.get('button', 'InputSubmit')).click() + self.modify_package('tags', 'TEST_TAG') app_id = self.get_element_id('PostgreSQL') @@ -997,7 +993,7 @@ class UISanityTests(UITestCase): self.assertTrue(self.check_package_parameter( 'PostgreSQL', '3', 'True')) - def test_032_check_opportunity_to_delete_package(self): + def test_040_check_opportunity_to_delete_package(self): """ Test check ability to delete package from database @@ -1064,8 +1060,14 @@ class UISanityTests(UITestCase): 2. Choose some application and click on 'More info' 3. Verify info about application """ + self.navigate_to('Manage') + self.go_to_submenu('Package Definitions') + + app_id = self.get_element_id('PostgreSQL') + + self.navigate_to('Application_Catalog') self.go_to_submenu('Applications') - self.select_and_click_action_for_app('details', 'PostgreSQL') + self.select_and_click_action_for_app('details', app_id) self.assertIn('PostgreSQL is a powerful', self.driver.page_source) self.driver.find_element_by_link_text('Requirements').click() @@ -1152,7 +1154,6 @@ class UISanityTests(UITestCase): self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, 'PostgreSQL')) - @testtools.skip("Wait for https://review.openstack.org/#/c/90249/") def test_039_check_statistics_panel(self): """ Test checks that 'Statictics' panel is operable @@ -1161,5 +1162,6 @@ class UISanityTests(UITestCase): 1. Navigate to 'Application Catalog > Statistics' panel """ self.go_to_submenu('Statistics') - self.driver.find_element_by_link_text('Murano Engine Servers').click() self.driver.find_element_by_link_text('Murano API Servers').click() + self.driver.find_element_by_link_text( + 'Murano Instance Statistics').click()