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

uninitialized constant XPath::HTML error when using When I fill in "..." with "..." inside any "..." #210

Closed
danielsmakandra opened this issue Jun 6, 2024 · 2 comments · Fixed by #211
Assignees

Comments

@danielsmakandra
Copy link

I found a bug in a step definition:

I tried to use the When I fill in "..." with "..." inside any "..." step but got the following error message:

uninitialized constant XPath::HTML

    input = container.first(:xpath, XPath::HTML.fillable_field(field))
                                         ^^^^^^ (NameError)
features/movies/search_cucumber.feature:16:in `I fill in "Search movies" with "#{query}" inside any ".searchable"'

The step's code seems to use XPath::HTML from the xpath gem.

Xpath::HTML was removed in xpath >= 3.0.0 and thus the step fails.

@FLeinzi
Copy link
Contributor

FLeinzi commented Jun 6, 2024

Hi @danielsmakandra,

thanks for the hint. It's definitely broken. I will rewrite this step soon.

The "..." within "..." step works similar to the one above, but will only search inside the first match. So you may use a more specific selector.

Like this: I fill in "Search movies" with "#{query}" within ".parent .searchable"

@FLeinzi
Copy link
Contributor

FLeinzi commented Jun 7, 2024

I released a fix as version 4.6.2.

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 a pull request may close this issue.

2 participants