Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Automate new UI for MTA #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions mta/entities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from wait_for import wait_for
from widgetastic.widget import Text
from widgetastic.widget import View
from widgetastic_patternfly import Button
from widgetastic_patternfly import Input
from widgetastic_patternfly4 import Button

from mta.base.application.implementations.web_ui import MTANavigateStep
from mta.base.application.implementations.web_ui import ViaWebUI
Expand All @@ -18,35 +18,33 @@
class BlankStateView(View):
"""This view represent web-console without any project i.e. blank state"""

ROOT = ".//div[contains(@class, 'blank-slate')]"
ROOT = ".//div[contains(@class, 'pf-c-empty-state__content')]"

title = Text(locator=".//h1")
title = Text(locator=".//h4")
welcome_help = Text(locator=".//div[@class='welcome-help-text']")
new_project_button = Button("New Project")
new_project_button = Button("Create project")
documentation = Text(locator=".//a[contains(text(), 'documentation')]")

@property
def is_displayed(self):
return (
self.title.is_displayed
and self.title.text == "Welcome to the Web Console."
and self.title.text == "Welcome to the Migration Toolkit for Applications"
and self.new_project_button.is_displayed
)


class BaseLoggedInPage(View):
"""This is base view for MTA"""

header = Text(locator=".//img[@id='header-logo']")
header = Text(locator=".//img[@alt='brand']")
home_navigation = HOMENavigation("//ul")
navigation = MTANavigation('//ul[@class="list-group"]')

setting = DropdownMenu(
locator=".//li[contains(@class, 'dropdown') and .//span[@class='pficon pficon-user']]"
)
help = DropdownMenu(
locator=".//li[contains(@class, 'dropdown') and .//span[@class='pficon pficon-help']]"
)
help = Button(id="aboutButton")

# only if no project available
blank_state = View.nested(BlankStateView)
Expand All @@ -69,12 +67,12 @@ class BaseWebUICollection(BaseCollection):
class AllProjectView(BaseLoggedInPage):
"""This view represent Project All View"""

title = Text(".//div[contains(@class, 'projects-bar')]/h1")
title = Text(".//div[contains(@class, 'pf-c-content')]/h1")
search = Input("searchValue")
sort = SortSelector("class", "btn btn-default dropdown-toggle")

projects = ProjectList(locator=".//div[contains(@class, 'projects-list')]")
new_project_button = Button("New Project")
new_project_button = Button("Create project")

@View.nested
class no_matches(View): # noqa
Expand Down
Loading