Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Proposal: Add TextQuery, TitleQuery to assert valid keys #1241

Closed
abotalov opened this Issue · 2 comments

3 participants

@abotalov
Collaborator

I propose to add BaseQuery, TextQuery, TitleQuery and use them instead of Query where necessary.

It would allow to assert keys more properly. Some keys that are supported by has_selector? aren't supported by has_text?.

Also I propose to fix #1179 by doing something like:

def matches?(actual)
  @actual = wrap(actual)
  @query = Capybara::TextQuery.new(*args)
  @actual.synchronize(@query.wait) do
    raise Capybara::ExpectationNotMet if @query.execute_for(@actual)
  end
end

i.e. move Finders#text_found? to TextQuery.

If Finders#text_found? will be moved to TextQuery the same should be done for Finders#resolve_query

@jnicklas
Owner

I've never liked Finders#resolve_query. I think I'm :+1: on this.

@twalpole
Collaborator

@abotalov Ok to close this since its basically in the latest changes?

@abotalov abotalov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.