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

webui: fix waiting for disabled button in some tests #5327

Closed
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
2 changes: 1 addition & 1 deletion ui/webui/test/check-basic
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class TestBasic(anacondalib.VirtInstallMachineCase):
i.open(step="installation-method")

# Back button should be disabled on the first screen
b.wait_visible(f"#installation-back-btn:not([aria-disabled={True}]")
b.wait_visible("#installation-back-btn:not([aria-disabled=false]")
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not allign now with the comment in the line above.

Copy link
Contributor Author

@rvykydal rvykydal Nov 16, 2023

Choose a reason for hiding this comment

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

I think it actually does (and I tested it), I was surprised by that as well, but:

value = "false" if disabled else "true"

Copy link
Contributor

@KKoukiou KKoukiou Nov 17, 2023

Choose a reason for hiding this comment

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

I was just confused by the double negation.

Can you please iron it out a bit:

b.wait_visible(f"#installation-back-btn[aria-disabled=true]")


# For live media in the review screen language details should still be displayed
i.reach(i.steps.REVIEW, hidden_steps=[i.steps.ACCOUNTS])
Expand Down
8 changes: 4 additions & 4 deletions ui/webui/test/check-storage
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class TestStorage(anacondalib.VirtInstallMachineCase, StorageHelpers):
s.modify_storage()
# Run the tool
b.click("#modify-storage-modal-modify-btn")
b.wait_visible(f"#modify-storage-modal-modify-btn:not([aria-disabled={True}]")
b.wait_visible(f"#storage-modified-modal-rescan-btn")
b.wait_visible("#modify-storage-modal-modify-btn:not([aria-disabled=false]")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is pretty useless. Before clicking the button should be always enabled, then get disabled and then re-enabled. So now you 're checking either the pre-disabled state, or the post-disabled state. this is not deterministic, I think we can drop it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is checking the disabled state (I read it disabled is not false)

b.wait_visible("#storage-modified-modal-rescan-btn")
b.click("#storage-modified-modal-ignore-btn")
# The disk is still selected
s.check_single_disk_destination(disk, "16.1 GB")
Expand All @@ -120,8 +120,8 @@ class TestStorage(anacondalib.VirtInstallMachineCase, StorageHelpers):

s.modify_storage()
b.click("#modify-storage-modal-modify-btn")
b.wait_visible(f"#modify-storage-modal-modify-btn:not([aria-disabled={True}]")
b.wait_visible(f"#storage-modified-modal-rescan-btn")
b.wait_visible("#modify-storage-modal-modify-btn:not([aria-disabled=false]")
b.wait_visible("#storage-modified-modal-rescan-btn")
b.click("#storage-modified-modal-rescan-btn")
# The disk is still selected
s.check_single_disk_destination(disk, "16.1 GB")
Expand Down