Add configuration mechanism to turn off browser maximisation
Having the window maximise during a test run makes it difficult to work with other windows, especially on a single-monitor computer. This patch removes the maximisation call. This patch also adds a "local" configuration mechanism to allow developers to have local configuration of the integration test environment without it affecting the git repository. Change-Id: I8a7acbe40deaec5cca904526e3f3c8bc3357744c Closes-Bug: 1540719
This commit is contained in:
parent
b24069382d
commit
af505dacd1
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,6 +21,7 @@ openstack_dashboard/local/local_settings.py
|
||||
openstack_dashboard/local/local_settings.diff
|
||||
openstack_dashboard/local/.secret_key_store
|
||||
openstack_dashboard/test/.secret_key_store
|
||||
openstack_dashboard/test/integration_tests/local-horizon.conf
|
||||
openstack_dashboard/wsgi/horizon.wsgi
|
||||
doc/build/
|
||||
doc/source/sourcecode
|
||||
|
@ -8,7 +8,8 @@ Running the integration tests
|
||||
|
||||
#. Set up an OpenStack server
|
||||
|
||||
#. Update the configuration file at `horizon.conf`
|
||||
#. Update the configuration file at `horizon.conf` or add overrides
|
||||
to that file in `local-horizon.conf` which is ignored by git.
|
||||
|
||||
#. Run the tests. ::
|
||||
|
||||
|
@ -78,6 +78,9 @@ SeleniumGroup = [
|
||||
cfg.StrOpt('screenshots_directory',
|
||||
default="integration_tests_screenshots",
|
||||
help="Output screenshot directory"),
|
||||
cfg.BoolOpt('maximize_browser',
|
||||
default=True,
|
||||
help="Is the browser size maximized for each test?"),
|
||||
]
|
||||
|
||||
ScenarioGroup = [
|
||||
@ -122,7 +125,12 @@ def _get_config_files():
|
||||
'integration_tests')
|
||||
conf_file = os.environ.get('HORIZON_INTEGRATION_TESTS_CONFIG_FILE',
|
||||
"%s/horizon.conf" % conf_dir)
|
||||
return [conf_file]
|
||||
config_files = [conf_file]
|
||||
local_config = os.environ.get('HORIZON_INTEGRATION_TESTS_LOCAL_CONFIG',
|
||||
"%s/local-horizon.conf" % conf_dir)
|
||||
if os.path.isfile(local_config):
|
||||
config_files.append(local_config)
|
||||
return config_files
|
||||
|
||||
|
||||
def get_config():
|
||||
|
@ -85,7 +85,8 @@ class BaseTestCase(testtools.TestCase):
|
||||
self.driver = webdriver.WebDriverWrapper(
|
||||
desired_capabilities=desired_capabilities
|
||||
)
|
||||
self.driver.maximize_window()
|
||||
if self.CONFIG.selenium.maximize_browser:
|
||||
self.driver.maximize_window()
|
||||
self.driver.implicitly_wait(self.CONFIG.selenium.implicit_wait)
|
||||
self.driver.set_page_load_timeout(
|
||||
self.CONFIG.selenium.page_timeout)
|
||||
|
@ -29,6 +29,10 @@ implicit_wait=10
|
||||
# (integer value)
|
||||
explicit_wait=300
|
||||
|
||||
# Maximize the browser window at the start of each test?
|
||||
# (boolean)
|
||||
maximize_browser=yes
|
||||
|
||||
[image]
|
||||
# http accessible image (string value)
|
||||
http_image=http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz
|
||||
|
Loading…
Reference in New Issue
Block a user