summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Jones <r1chardj0n3s@gmail.com>2016-02-02 14:54:10 +1100
committerRichard Jones <r1chardj0n3s@gmail.com>2016-02-11 07:05:22 +1100
commitaf505dacd1d8d64f602629fa2e334582c3a89d5b (patch)
tree183b63ccee7060255f0dc2fbdf1ad250d8e85516
parentb24069382d07cc7a7758316d807767f93dfcd7b9 (diff)
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
Notes
Notes (review): Code-Review+2: Timur Sufiev <tsufiev@mirantis.com> Code-Review+2: Rob Cresswell <rcresswe@cisco.com> Workflow+1: Rob Cresswell <rcresswe@cisco.com> Code-Review+2: Matthias Runge <mrunge@redhat.com> Workflow+1: Matthias Runge <mrunge@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 11 Feb 2016 12:05:05 +0000 Reviewed-on: https://review.openstack.org/274996 Project: openstack/horizon Branch: refs/heads/master
-rw-r--r--.gitignore1
-rw-r--r--openstack_dashboard/test/integration_tests/README.rst3
-rw-r--r--openstack_dashboard/test/integration_tests/config.py10
-rw-r--r--openstack_dashboard/test/integration_tests/helpers.py3
-rw-r--r--openstack_dashboard/test/integration_tests/horizon.conf4
5 files changed, 18 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 5ab2e48..bbc6363 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ openstack_dashboard/local/local_settings.py
21openstack_dashboard/local/local_settings.diff 21openstack_dashboard/local/local_settings.diff
22openstack_dashboard/local/.secret_key_store 22openstack_dashboard/local/.secret_key_store
23openstack_dashboard/test/.secret_key_store 23openstack_dashboard/test/.secret_key_store
24openstack_dashboard/test/integration_tests/local-horizon.conf
24openstack_dashboard/wsgi/horizon.wsgi 25openstack_dashboard/wsgi/horizon.wsgi
25doc/build/ 26doc/build/
26doc/source/sourcecode 27doc/source/sourcecode
diff --git a/openstack_dashboard/test/integration_tests/README.rst b/openstack_dashboard/test/integration_tests/README.rst
index dedf124..e9d72c2 100644
--- a/openstack_dashboard/test/integration_tests/README.rst
+++ b/openstack_dashboard/test/integration_tests/README.rst
@@ -8,7 +8,8 @@ Running the integration tests
8 8
9#. Set up an OpenStack server 9#. Set up an OpenStack server
10 10
11#. Update the configuration file at `horizon.conf` 11#. Update the configuration file at `horizon.conf` or add overrides
12 to that file in `local-horizon.conf` which is ignored by git.
12 13
13#. Run the tests. :: 14#. Run the tests. ::
14 15
diff --git a/openstack_dashboard/test/integration_tests/config.py b/openstack_dashboard/test/integration_tests/config.py
index a88abec..7f44250 100644
--- a/openstack_dashboard/test/integration_tests/config.py
+++ b/openstack_dashboard/test/integration_tests/config.py
@@ -78,6 +78,9 @@ SeleniumGroup = [
78 cfg.StrOpt('screenshots_directory', 78 cfg.StrOpt('screenshots_directory',
79 default="integration_tests_screenshots", 79 default="integration_tests_screenshots",
80 help="Output screenshot directory"), 80 help="Output screenshot directory"),
81 cfg.BoolOpt('maximize_browser',
82 default=True,
83 help="Is the browser size maximized for each test?"),
81] 84]
82 85
83ScenarioGroup = [ 86ScenarioGroup = [
@@ -122,7 +125,12 @@ def _get_config_files():
122 'integration_tests') 125 'integration_tests')
123 conf_file = os.environ.get('HORIZON_INTEGRATION_TESTS_CONFIG_FILE', 126 conf_file = os.environ.get('HORIZON_INTEGRATION_TESTS_CONFIG_FILE',
124 "%s/horizon.conf" % conf_dir) 127 "%s/horizon.conf" % conf_dir)
125 return [conf_file] 128 config_files = [conf_file]
129 local_config = os.environ.get('HORIZON_INTEGRATION_TESTS_LOCAL_CONFIG',
130 "%s/local-horizon.conf" % conf_dir)
131 if os.path.isfile(local_config):
132 config_files.append(local_config)
133 return config_files
126 134
127 135
128def get_config(): 136def get_config():
diff --git a/openstack_dashboard/test/integration_tests/helpers.py b/openstack_dashboard/test/integration_tests/helpers.py
index 24d2c53..0507d4a 100644
--- a/openstack_dashboard/test/integration_tests/helpers.py
+++ b/openstack_dashboard/test/integration_tests/helpers.py
@@ -85,7 +85,8 @@ class BaseTestCase(testtools.TestCase):
85 self.driver = webdriver.WebDriverWrapper( 85 self.driver = webdriver.WebDriverWrapper(
86 desired_capabilities=desired_capabilities 86 desired_capabilities=desired_capabilities
87 ) 87 )
88 self.driver.maximize_window() 88 if self.CONFIG.selenium.maximize_browser:
89 self.driver.maximize_window()
89 self.driver.implicitly_wait(self.CONFIG.selenium.implicit_wait) 90 self.driver.implicitly_wait(self.CONFIG.selenium.implicit_wait)
90 self.driver.set_page_load_timeout( 91 self.driver.set_page_load_timeout(
91 self.CONFIG.selenium.page_timeout) 92 self.CONFIG.selenium.page_timeout)
diff --git a/openstack_dashboard/test/integration_tests/horizon.conf b/openstack_dashboard/test/integration_tests/horizon.conf
index 9c3dc99..174fc1b 100644
--- a/openstack_dashboard/test/integration_tests/horizon.conf
+++ b/openstack_dashboard/test/integration_tests/horizon.conf
@@ -29,6 +29,10 @@ implicit_wait=10
29# (integer value) 29# (integer value)
30explicit_wait=300 30explicit_wait=300
31 31
32# Maximize the browser window at the start of each test?
33# (boolean)
34maximize_browser=yes
35
32[image] 36[image]
33# http accessible image (string value) 37# http accessible image (string value)
34http_image=http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz 38http_image=http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz