Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8248 from lina-nikiforova/test_pull_splitter_pers…
Browse files Browse the repository at this point in the history
…istence

[1LP][RFR] added is_displayed for UtilizationView, fixed is_displayed for ServiceCatalogsDefaultView and added TimedOutError to exception for test_pull_splitter_persistence
  • Loading branch information
izapolsk committed Dec 7, 2018
2 parents cc33d93 + a46b59a commit f9516e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions cfme/optimize/utilization.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ def in_utilization(self):
"Utilization",
]

@property
def is_displayed(self):
# region = CFME Region: Region 0 [0]'
region = self.extra.appliance.region()
return (
self.in_utilization and
self.title.text == 'Region "{}" Utilization Trend Summary'.format(region)
)


@attr.s
class Utilization(BaseEntity):
Expand Down
2 changes: 1 addition & 1 deletion cfme/services/service_catalogs/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ServiceCatalogsDefaultView(ServicesCatalogsView):
@property
def is_displayed(self):
return (
self.in_explorer and
self.in_service_catalogs and
self.title.text == 'All Services' and
self.service_catalogs.is_opened)

Expand Down
6 changes: 4 additions & 2 deletions cfme/tests/webui/test_splitter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from xml.sax.saxutils import quoteattr, unescape

import pytest
from wait_for import TimedOutError

# from cfme.cloud.instance import Instance
# from cfme.infrastructure.config_management import ConfigManager
Expand Down Expand Up @@ -52,7 +53,7 @@
def test_pull_splitter_persistence(request, appliance, model_object, destination):
"""
Polarion:
assignee: mmojzis
assignee: anikifor
caseimportance: low
initialEstimate: 1/20h
"""
Expand All @@ -72,9 +73,10 @@ def test_pull_splitter_persistence(request, appliance, model_object, destination
navigate_to(appliance.server, 'Dashboard')
try:
navigate_to(model_object, destination)
except (TypeError, CannotScrollException):
except (TypeError, CannotScrollException, TimedOutError):
# this exception is expected here since
# some navigation commands try to use accordion when it is hidden by splitter
# and accordion is often part of is_displayed check
pass

# Then we check hidden position splitter
Expand Down
3 changes: 3 additions & 0 deletions cfme/utils/appliance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,9 @@ def server_region_string(self):
return "{} Region: Region {} [{}]".format(
self.product_name, r, r)

def region(self):
return "Region {}".format(self.server.zone.region.number)

@cached_property
def company_name(self):
return self.advanced_settings["server"]["company"]
Expand Down

0 comments on commit f9516e1

Please sign in to comment.