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

Eliminate :contains #665

Merged
merged 4 commits into from
Jul 18, 2024
Merged

Eliminate :contains #665

merged 4 commits into from
Jul 18, 2024

Conversation

martinpitt
Copy link
Member

No description provided.

The `do_deployment_action` already clicks that very "Roll back" button
that this line asserted. This just looks like a leftover from some test
refactoring.
Unfortunately this happens deep in the PatternFly component, inside of
cockpit-components-listing-table.jsx, so we can't easily add classes/IDs
to it. But it's always the same 3 tabs anyway, so use constants instead.
Give the kebab menu items a `data-action` attribute and select on this
instead.
Similarly to the previous commit, add `data-action` attributes to the
card actions and select on them.
@martinpitt martinpitt changed the title Eliminate :contains Eliminate :contains and sizzle Jul 18, 2024
@martinpitt martinpitt marked this pull request as ready for review July 18, 2024 15:41
@martinpitt martinpitt marked this pull request as draft July 18, 2024 16:02
@martinpitt
Copy link
Member Author

Huh, that failure rather feels like a regression from #664, but tests passed there? 🤔 But I can reproduce it, will have a look tomorrow.

jelly
jelly previously approved these changes Jul 18, 2024
Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

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

Assuming this goes green, nice!

I was looking at this briefly, and finding something for the dropdownitem seemed annoying, but data-action actually seems nice!

The tab solution is alright, not superb, but it doesn't seem like our table supports setting any id / description on the tab. Maybe something to consider but then again asserting that the tab position is 1,2,3 is already great! (And also a test of sorts)

@@ -629,7 +632,7 @@ const OStreeSource = ({ ostreeState, refreshRemotes, onChangeBranch, onChangeRem
const Dialogs = useDialogs();

const actions = [
<DropdownItem key="rebase"
<DropdownItem key="rebase" data-action="rebase"
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice if the key leaked through to the DOM right ;-)

Copy link
Member Author

Choose a reason for hiding this comment

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

heh yea, but it's only a React detail..

Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

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

Hmm what we just merged is flaky? That's strange!

@martinpitt
Copy link
Member Author

Ah no, much simpler -- become_superuser() requires :contains(), so it's dropping sizzle that broke it. I'll fix that tomorrow.

@martinpitt
Copy link
Member Author

I dropped the "remove sizzle" commit for now. I'll make test/common free of :contains tomorrow, and can then drop sizzle for good.

@martinpitt martinpitt changed the title Eliminate :contains and sizzle Eliminate :contains Jul 18, 2024
@martinpitt martinpitt marked this pull request as ready for review July 18, 2024 17:12
@martinpitt martinpitt requested a review from jelly July 18, 2024 17:12
@jelly
Copy link
Member

jelly commented Jul 18, 2024

I dropped the "remove sizzle" commit for now. I'll make test/common free of :contains tomorrow, and can then drop sizzle for good.

Aaaah, that explains a lot :) Was there a clue in the logs? :)

Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

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

Hurray!

@jelly jelly merged commit bdf2c24 into cockpit-project:main Jul 18, 2024
6 checks passed
@martinpitt martinpitt deleted the contains branch July 19, 2024 03:57
@martinpitt
Copy link
Member Author

The clue was to stare at

self.wait_in_text("div[role=dialog]:contains('Switch to administrative access')", f"Password for {user}:")

for a few seconds and realize the :contains 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants