Make feature test app teardown more reliable, and tests faster

- don't spin up app and chromedriver between each test
    - catching signals also tears down the app
    - do layout reset between tests, but assume that tests will not leave a modal opened.

 Use selenium built-in waiting function and fix flakiness around clicking the alertify OK button

    - we think the OK button does not have its event bound when it is created.

If you see more flakiness around clicking the alertify OK button, let us know. The element is clickable but we have to arbitrarily wait for the event to be bound and that timing may vary system to system.

The feature tests are about 7 seconds faster now.

Tira & Joao
This commit is contained in:
Atira Odhner
2017-03-01 13:20:06 +00:00
committed by Dave Page
parent 59c6be534d
commit e89c54c15d
7 changed files with 71 additions and 50 deletions

View File

@@ -40,7 +40,6 @@ class ConnectsToServerFeatureTest(BaseFeatureTest):
def tearDown(self):
self.page.remove_server(self.server)
self.app_starter.stop_app()
connection = test_utils.get_db_connection(self.server['db'],
self.server['username'],

View File

@@ -1,4 +1,3 @@
from selenium import webdriver
from selenium.webdriver import ActionChains
from regression import test_utils
@@ -44,7 +43,6 @@ class TemplateSelectionFeatureTest(BaseFeatureTest):
def tearDown(self):
self.page.find_by_xpath("//button[contains(.,'Cancel')]").click()
self.page.remove_server(self.server)
self.app_starter.stop_app()
connection = test_utils.get_db_connection(self.server['db'],
self.server['username'],
self.server['db_password'],