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

Closed
abotalov opened this Issue Feb 6, 2014 · 2 comments

Comments

Projects
None yet
3 participants
Collaborator

abotalov commented Feb 6, 2014

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 jnicklas#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

Collaborator

jnicklas commented Feb 7, 2014

I've never liked Finders#resolve_query. I think I'm 👍 on this.

Collaborator

twalpole commented Jul 1, 2014

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

@abotalov abotalov closed this Jul 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment