Fix click issue with test_env_status_new_session_remove_from_two.

The test in the title is failing in the log [1] because, after
deploying the environment with 2 apps, Selenium seems to struggle
interacting with 'Delete Component' button.

This patch simply refreshes the page before clicking on
'Delete Component'.

Also added various explicit waits (which does not reduce
performance much at all) but increases compatibility with slower
machines.

[1] https://murano-ci.mirantis.com/logs/41/425341/1/check/gate-murano-client-ubuntu/34b0037/

Change-Id: Ia6590bcd7eb6e576ee0e82e0771c746ae301dd02
This commit is contained in:
Felipe Monteiro 2017-02-03 02:37:29 +00:00
parent 18c8376541
commit 1b11876a95
2 changed files with 15 additions and 8 deletions

View File

@ -491,12 +491,12 @@ class ApplicationTestCase(ImageTestCase):
def delete_component(self, component_name=None):
if component_name:
component_id = self.get_element_id(component_name)
btn = self.driver.find_element_by_id(
'services__row_{0}__action_delete'.format(
btn = self.wait_element_is_clickable(
by.By.ID, 'services__row_{0}__action_delete'.format(
component_id))
else:
btn = self.driver.find_element_by_css_selector(
consts.DeleteComponent)
btn = self.wait_element_is_clickable(by.By.CSS_SELECTOR,
consts.DeleteComponent)
btn.click()
el = self.wait_element_is_clickable(by.By.LINK_TEXT,
'Delete Component', sec=30)
@ -552,13 +552,17 @@ class ApplicationTestCase(ImageTestCase):
self.select_and_click_action_for_app(action, app)
field_id = "{0}_0-name".format(app_id)
self.fill_field(by.By.ID, field_id, value=app_name)
self.driver.find_element_by_xpath(consts.ButtonSubmit).click()
self.driver.find_element_by_xpath(consts.InputSubmit).click()
self.wait_element_is_clickable(by.By.XPATH,
consts.ButtonSubmit).click()
self.wait_element_is_clickable(by.By.XPATH,
consts.InputSubmit).click()
self.select_from_list('osImage', self.image.id)
self.driver.find_element_by_xpath(consts.InputSubmit).click()
self.wait_element_is_clickable(by.By.XPATH,
consts.InputSubmit).click()
if env_id:
self.driver.find_element_by_xpath(consts.InputSubmit).click()
self.wait_element_is_clickable(by.By.XPATH,
consts.InputSubmit).click()
self.wait_element_is_clickable(by.By.ID, consts.AddComponent)
self.check_element_on_page(by.By.LINK_TEXT, app_name)
else:

View File

@ -414,6 +414,9 @@ class TestSuiteEnvironment(base.ApplicationTestCase):
env_id = self.get_element_id('quick-env-1')
self.add_app_to_env(self.mockapp_id, 'TestApp1', env_id)
self.driver.find_element_by_id('services__action_deploy_env').click()
self.go_to_submenu('Environments')
self.check_element_on_page(by.By.LINK_TEXT, 'quick-env-1')
self.driver.find_element(by.By.LINK_TEXT, 'quick-env-1').click()
self.check_element_on_page(by.By.XPATH,
c.Status.format('Ready'),
sec=90)