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

Conversation

rvykydal
Copy link
Contributor

Originally the check always passed.

@@ -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]")

@@ -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)

@@ -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

@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]")

@rvykydal
Copy link
Contributor Author

This PR was migrated to the new repository: rhinstaller/anaconda-webui#49

@rvykydal rvykydal closed this Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants