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

[6.15.z] Check that breadcrumb is displayed #1286

Conversation

Satellite-QE
Copy link
Contributor

Cherrypick of PR: #1281

error occurred in 6.15.z

@Satellite-QE Satellite-QE added 6.15.z Auto_Cherry_Picked GHA has automatically cherrypicked this PR No-CherryPick PR doesnt need CherryPick to previous branches labels Mar 14, 2024
Copy link
Contributor

@LadislavVasina1 LadislavVasina1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, this does totally nothing.
Correct me if I am wrong.
It just returns bool and nothing is done with it.

Can't you just use self.browser.wait_for_element(self.breadcrumb, exception=False)

@dosas
Copy link
Collaborator

dosas commented Mar 19, 2024

@LadislavVasina1 That is not correct it does not do nothing, it waits for the element to be displayed.

No, it makes much more sense to use the abstraction (https://github.com/SatelliteQE/airgun/blob/master/airgun/views/os.py#L81). That is why it is there.

What I generally do not understand is why a test should continue (exception=False) when an element is not found or why there is no implicit check for this. Since this makes tests very brittle.
#1247

@LadislavVasina1
Copy link
Contributor

LadislavVasina1 commented Mar 19, 2024

@dosas exception false is just from this implementation, that your implementation actually uses

class ContentHostDetailsView(BaseLoggedInView):
breadcrumb = BreadCrumb()
unregister = Text(".//button[@ng-click='openModal()']")
dialog = ConfirmationDialog()
@property
def is_displayed(self):
breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
return (
breadcrumb_loaded
and self.breadcrumb.locations[0] == 'Content Hosts'
and len(self.breadcrumb.locations) > 1
)

See: #1281 (comment)

@LadislavVasina1
Copy link
Contributor

exception false is set because you want to get True or False from this property and do with this information whatever you want

@omkarkhatavkar
Copy link
Collaborator

@dosas please see my comment here #1281 (comment)

@dosas
Copy link
Collaborator

dosas commented Mar 28, 2024

Closed in favor of #1299

@omkarkhatavkar
Copy link
Collaborator

Closing this as per @dosas last comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Auto_Cherry_Picked GHA has automatically cherrypicked this PR No-CherryPick PR doesnt need CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants