Handling pajamas radio button component
We had a scenario arise where all tests in package-and-qa broke due to gitlab-org/gitlab!88790 (diffs) updating the radio buttons.
Thanks Andrey for gitlab-org/gitlab!89496 (merged) to fix the issue quickly.
I encountered the same last week in an MR and proposed gitlab-org/gitlab@8ebfd1bb as an alternative approach to fixing the problem there.
This MR had a second scenario where choose('some label text')
was Unable to find radio button that is not disabled
.
This is 2 places where updating radio buttons have caused issues, so expecting that we will see more. If radio buttons implementation is final, we should probably try to standardize how we handle pajamas radio buttons as it seems there's multiple ways to work around it.
choose_element(:some_element) -> choose_element(:some_element, click_by_js=true)
choose('some label text') -> find('label', text: 'some label text').click
Is this actually an issue with the component itself that we should be considering fixing rather than 'working around' If the component is okay, are we happy to use the 2 approaches suggested or could we do better?