0

Trying to figure out how to use the Predicate syntax in Ruby methods ...

Docs introduce the wildcard but forget to mention how to exactly use them in a query (or Ruby) so for a Calabash noob this is difficult. I tried this in Calabash iOS console:

query("* {text CONTAINS 'foo'}"

didn't work!

query("* marked:{text CONTAINS 'foo'}"

didn't work!

In Ruby it becomes more puzzling:

check_element_exists("* marked:# CONTAINS 'sometext'")

No go!

Can some Calabash genius enlighten me?

BadmintonCat
  • 9,416
  • 14
  • 78
  • 129

1 Answers1

1

The different samples you have posted all seems to be doing different things. I think it will be easier to help if you have a more concrete example of what you want to query for and what your view contains.

You have probably been by the Xamarin page

Grabbing a piece from one of my own files I have used it like this in a similar check

res = element_exists "* {text LIKE '*foo*'}"
Lasse
  • 1,153
  • 1
  • 10
  • 21
  • 1
    That did the trick! Thanks a lot! Had figured it out meanwhile and I'm using `not query("* {text LIKE '#{text}'}",).empty?`. – BadmintonCat Mar 01 '17 at 05:31