Calabash (ANDROID) - passing in compound statement values, how?

89 views Asked by At

in my gherkin feature I would like to find a certain element that satisfies a logical and. for instance... Then I touch elementWithAnother .

My step def would look for an element that matches two criteria, in this instance it would be the text value and the contentDesciption.

so something like:

Then /^I touch elementWithAnother "([^\"]*)" $/ do |text|text| tap_when_element_exists("RadioButton contentDescription:'#{text}'" && "android.widget.Button {text CONTAINS[c] '#{text}'}"

the logic of this is to touch a radiobutton that matches both conditions (not OR).

Any ideas?

1

There are 1 answers

0
Lasse On

Is it an option just to wrap it in an if sentence?

if (element_exists "RadioButton contentDescription:'#{text}'" && element_exists "android.widget.Button {text CONTAINS[c] '#{text}'}")
   tap_mark '#{text}'
end