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

Fix: multiwiki_assignment_spec failure #6088

Conversation

Formasitchijoh
Copy link
Contributor

@Formasitchijoh Formasitchijoh commented Jan 4, 2025

What this PR does

This PR addresses the recent failure in the multiwiki_assignment_spec where Capybara was unable to find the button "Assign all" because it possible was not available. The issue is resolved by utilizing Capybara's default wait mechanism, ensuring that the button is present and enabled before interacting with it.

Notes:

The other errors that occurred along with this issue, such as the missing content ("Heyder Cansa" and "Wp/kiu/Hey"), have not occurred recently.
This improvement is due to the increased Capybara wait time, which accounted for the longer period required for the element to become available, thus preventing interaction failures.

Screenshot 2025-01-04 at 05 21 09

@Formasitchijoh
Copy link
Contributor Author

This failure is due to the issue in the student_role_spec which i have fixed here, after merging that i will rebuild this and it should work

@@ -60,8 +60,9 @@
first('textarea').set(
"Terre\nhttps://fr.wikipedia.org/wiki/Anglais"
)
expect(page).to have_button('Assign all')
click_button 'Assign all'
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this will make a difference, as click_button already incorporates Capybara 'wait' behavior. If the button renders in time, it will work either way, and if it takes more than the wait time to render, it will fail at the expect(page)...

Copy link
Contributor Author

@Formasitchijoh Formasitchijoh Jan 4, 2025

Choose a reason for hiding this comment

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

Your right, I thought ensuring the button is found within the #user element, before it is interacted with
when i tested locally running Capybara in headless mode i realized the Assign all button appeared and close very fast

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