Repository: ManageIQ/integration_tests

Issue:
Unexpected popup in server_roles fixture
The server_roles fixture attempts to explicitly navigate to the current server's settings page before clicking any checkboxen, but the call to do that (`settings_pg.click_on_current_server_tree_node()`) occasionally fails because a popup appears. We'll need to make sure the popup can be safely ignored, and conditionally ignore it if it appears.

Until this is fixed, a workaround is to assume that navigation with the `cnf_configuration_pg` fixture will land on the current server settings page:

``` diff
diff --git a/fixtures/server_roles.py b/fixtures/server_roles.py
index dfcb574..2b99836 100644
--- a/fixtures/server_roles.py
+++ b/fixtures/server_roles.py
@@ -94,7 +94,9 @@ def server_roles(fixtureconf, cfme_data, cnf_configuration_pg):

     # Nav to the settings tab
     settings_pg = cnf_configuration_pg.click_on_settings()
-    server_settings_pg = settings_pg.click_on_current_server_tree_node()
+    #server_settings_pg = settings_pg.click_on_current_server_tree_node()
+    from pages.configuration_subpages.settings_subpages.server_settings import ServerSettings
+    server_settings_pg = ServerSettings(settings_pg.testsetup)
     # sst is a configuration_subpages.settings_subpages.server_settings_subpages.
     #   server_settings_tab.ServerSettingsTab
     sst = server_settings_pg.click_on_server_tab()
```



Discussion:
Worked for me.
Tested on FF - and I didn't get stopped or see the popup.
Maybe lucky this time as it's hard to get a reproducible situation. But I'd vote for merging this change


Resolving patch:
diff --git a/fixtures/server_roles.py b/fixtures/server_roles.py
--- a/fixtures/server_roles.py
+++ b/fixtures/server_roles.py
@@ -17,6 +17,7 @@
     'web_services',
 )
 
+
 @pytest.fixture
 def server_roles(fixtureconf, cfme_data, cnf_configuration_pg):
     """Set the server roles based on a list of roles attached to the test using this fixture
@@ -94,7 +95,11 @@ def test_appliance_roles(server_roles):
 
     # Nav to the settings tab
     settings_pg = cnf_configuration_pg.click_on_settings()
-    server_settings_pg = settings_pg.click_on_current_server_tree_node()
+    # Workaround to rudely bypass a popup that sometimes appears for
+    # unknown reasons.
+    # See also: https://github.com/RedHatQE/cfme_tests/issues/168
+    from pages.configuration_subpages.settings_subpages.server_settings import ServerSettings
+    server_settings_pg = ServerSettings(settings_pg.testsetup)
     # sst is a configuration_subpages.settings_subpages.server_settings_subpages.
     #   server_settings_tab.ServerSettingsTab
     sst = server_settings_pg.click_on_server_tab()
@@ -105,10 +110,9 @@ def test_appliance_roles(server_roles):
         sst.save()
         sst._wait_for_results_refresh()
     else:
-        logger.info('Server roles already match configured fixture roles, not changing server roles')
+        logger.info('Server roles match configured fixture roles, not changing server roles')
 
     # If this assert fails, check roles names for typos or other minor differences
     Assert.equal(sorted(sst.selected_server_role_names), sorted(roles_list))
 
     return sst.selected_server_role_names
-


Test patch: