diff --git a/airgun/entities/contentview_new.py b/airgun/entities/contentview_new.py index 323a961ad..f726aa76e 100644 --- a/airgun/entities/contentview_new.py +++ b/airgun/entities/contentview_new.py @@ -1,13 +1,14 @@ from navmazing import NavigateToSibling -from wait_for import wait_for from airgun.entities.base import BaseEntity from airgun.navigation import NavigateStep, navigator from airgun.utils import retry_navigation -from airgun.views.contentview_new import ContentViewCreateView -from airgun.views.contentview_new import ContentViewTableView -from airgun.views.contentview_new import ContentViewEditView -from airgun.views.contentview_new import ContentViewVersionPublishView +from airgun.views.contentview_new import ( + ContentViewCreateView, + ContentViewEditView, + ContentViewTableView, + ContentViewVersionPublishView, +) class NewContentViewEntity(BaseEntity): @@ -97,4 +98,3 @@ def prerequisite(self, *args, **kwargs): def step(self, *args, **kwargs): """Click 'Publish new version' button""" self.parent.publish.click() - diff --git a/airgun/views/common.py b/airgun/views/common.py index f710db25d..7761fa4cb 100644 --- a/airgun/views/common.py +++ b/airgun/views/common.py @@ -1,4 +1,5 @@ import time +import wait_for from widgetastic.widget import ( Checkbox, ConditionalSwitchableView, diff --git a/airgun/views/contentview_new.py b/airgun/views/contentview_new.py index 323a5ef0b..7ea6ae836 100644 --- a/airgun/views/contentview_new.py +++ b/airgun/views/contentview_new.py @@ -1,39 +1,30 @@ from wait_for import wait_for from widgetastic.utils import ParametrizedLocator -from widgetastic.widget import Checkbox -from widgetastic.widget import ParametrizedView -from widgetastic.widget import Text -from widgetastic.widget import TextInput -from widgetastic.widget import View -from widgetastic_patternfly import BreadCrumb -from widgetastic_patternfly import Tab -from widgetastic_patternfly4 import Button -from widgetastic_patternfly4 import Dropdown -from widgetastic_patternfly4.ouia import Button as PF4Button -from widgetastic_patternfly4.ouia import ExpandableTable -from widgetastic_patternfly4.ouia import Switch -from widgetastic_patternfly4.ouia import PatternflyTable - -from airgun.views.common import BaseLoggedInView -from airgun.views.common import NewAddRemoveResourcesView -from airgun.views.common import SearchableViewMixinPF4 -from airgun.widgets import ActionsDropdown -from airgun.widgets import ConfirmationDialog -from airgun.widgets import EditableEntry -from airgun.widgets import PF4Search -from airgun.widgets import PF4ProgressBar -from airgun.widgets import ReadOnlyEntry -from airgun.views.common import BaseLoggedInView -from airgun.views.common import NewAddRemoveResourcesView -from airgun.views.common import SearchableViewMixinPF4 -from airgun.widgets import ActionsDropdown -from airgun.widgets import ConfirmationDialog -from airgun.widgets import EditableEntry -from airgun.widgets import PF4Search -from airgun.widgets import PF4ProgressBar -from airgun.widgets import ReadOnlyEntry - -from airgun.views.common import BaseLoggedInView, SearchableViewMixinPF4 +from widgetastic.widget import Checkbox, Text, TextInput, View +from widgetastic_patternfly import BreadCrumb, Tab +from widgetastic_patternfly4 import Button, Dropdown +from widgetastic_patternfly4.ouia import ( + Button as PF4Button, + ExpandableTable, + PatternflyTable, + Switch, +) + +from airgun.views.common import ( + BaseLoggedInView, + NewAddRemoveResourcesView, + SearchableViewMixinPF4, +) +from airgun.widgets import ( + ActionsDropdown, + ConfirmationDialog, + EditableEntry, + PF4ProgressBar, + PF4Search, + ReadOnlyEntry, +) + +LOCATION_NUM = 3 class ContentViewTableView(BaseLoggedInView, SearchableViewMixinPF4): @@ -106,7 +97,7 @@ def is_displayed(self): breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False) return ( breadcrumb_loaded - and len(self.breadcrumb.locations) <= 3 + and len(self.breadcrumb.locations) <= LOCATION_NUM and self.breadcrumb.locations[0] == 'Content Views' and self.breadcrumb.read() != 'New Content View' and self.publish.is_displayed @@ -228,8 +219,7 @@ def is_displayed(self): breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False) return ( breadcrumb_loaded - and len(self.breadcrumb.locations) > 3 + and len(self.breadcrumb.locations) > LOCATION_NUM and self.breadcrumb.locations[0] == 'Content Views' and self.breadcrumb.locations[2] == 'Versions' ) -