Calabash how to use wildcards in Ruby methods?

137 Views Asked by At

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?

1

There are 1 best solutions below

1
Lasse On BEST ANSWER

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*'}"