Ensure closing of firefox window if setUp fails
In the functional integration test, test class opened a firefox window as part of setUp() but in case of failure of setUp(), the window remained open, as the tearDown() method is not called on failure of setUp(). This problem can be solved by adding the close command for firefox through addCleanup method which is excecuted irrespective of success of the setUp method. Change-Id: Ic576fa05b62afa08356f11825cbf442baaf9a4cb Closes-bug: 1487446
This commit is contained in:
@@ -68,6 +68,7 @@ class UITestCase(BaseDeps):
|
||||
super(UITestCase, self).setUp()
|
||||
|
||||
self.driver = webdriver.Firefox()
|
||||
self.addCleanup(self.driver.quit)
|
||||
self.driver.maximize_window()
|
||||
self.driver.get(cfg.common.horizon_url + '/murano/environments')
|
||||
self.driver.implicitly_wait(30)
|
||||
@@ -76,7 +77,6 @@ class UITestCase(BaseDeps):
|
||||
|
||||
def tearDown(self):
|
||||
super(UITestCase, self).tearDown()
|
||||
self.driver.quit()
|
||||
|
||||
for env in self.murano_client.environments.list():
|
||||
self.remove_environment(env.id)
|
||||
|
Reference in New Issue
Block a user