client: ruby-2.1.5/gems/calabash-cucumber-0.16.3 server: "version":"0.16.2"
I added some debugging around map(). A normal query returns this:
{:query=>"button marked:'Other options'", :method=>:query, :args=>[{:isEnabled=>1}], :r=>{"status_bar_orientation"=>"down", "results"=>["*****"], "outcome"=>"SUCCESS"}}
I don't know how to interpret *****.
In map.rb's assert_map_results "*****" is a failure case, so it's obviously bad.
In the simulator log, I see things like
Oct 12 17:37:57 TimBs-MacBook-Pro.local[36121]: -[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x7f7f6fe4f730 Oct 12 17:37:57 TimBs-MacBook-Pro.local[36121]: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x7f7f6fe4f730'
which I presume is it trying to decide whether it can apply isEnabled to the string "*****" instead of an object that behaves like a map.
Why on earth did they choose something so uninformative and pigging hard to web-search for?
Update: I originally had
element = "button marked:'game hot icon norm'"
element_exists(element) && query(element, :isEnabled).first.eql?(1)
but found a reference to
query("button isEnabled:1")
which I misread and adapted as query("button", isEnabled:1). This didn't help, but wasn't the cause of the "*****" results. Unfortunately, going back to a known good state, and gradually working back to the problem state, never caused the issue to re-appear, despite git saying there was no real difference. I can only suspect a dirty build.
This means you tried to call a unknown selector on an Objective-C object.
In this case, something is calling objectForKey:
on an instance of NSString
.
What is the query or gesture you are trying to run?
Is it:
query("button marked:'Other options'", [{:isEnabled => 1}])
If so, then the problem is that NSButton
does not respond to isEnabled:
(notice the trailing :
). That is the accessor. The setter is: setEnabled:
.
If you are trying to filter by enabled-ness:
query("button marked:'Other options'", :isEnabled)
If you are trying to set the enabled state:
query("button marked:'Other options'", [{:setEnabled => 1}])
Why on earth did they choose something so uninformative and pigging hard to web-search for?
It is difficult to change because Calabash is stuck in 0.x and uses semantic versioning so the API cannot be changed until a 1.x version. I believe (but I can't recall) Calabash 2.0 gives a better notice.