Issue
I have just started using Calabash and I am trying to test an Android app running under Genymotion.
When I run the simple test to start the application and view the initial screen, I can see the screen display in the Genymotion emulator but when I use the query command
puts(query('*'))
I dont see any of the expected content (for example the screen header) in the returned result.
Instead I see only:
[{"id"=>nil, "enabled"=>true, "contentDescription"=>nil, "visible"=>true, "tag"=>nil, "description"=>"com.android.internal.policy.impl.PhoneWindow$DecorView{52824ec0 V.E..... R
....... 0,0-1080,1920}", "class"=>"com.android.internal.policy.impl.PhoneWindow$DecorView", "rect"=>{"center_y"=>960, "center_x"=>540, "height"=>1920, "y"=>0, "width"=>1080, "x"=>0}}
, {"id"=>nil, "enabled"=>true, "contentDescription"=>nil, "visible"=>true, "tag"=>nil, "description"=>"android.widget.LinearLayout{528127a0 V.E..... ........ 0,0-1080,1920}", "class"
=>"android.widget.LinearLayout", "rect"=>{"center_y"=>960, "center_x"=>540, "height"=>1920, "y"=>0, "width"=>1080, "x"=>0}}, {"id"=>"content", "enabled"=>true, "contentDescription"=>
nil, "visible"=>true, "tag"=>nil, "description"=>"android.widget.FrameLayout{5280cab8 V.E..... ........ 0,0-1080,1920 #1020002 android:id/content}", "class"=>"android.widget.FrameLay
out", "rect"=>{"center_y"=>960, "center_x"=>540, "height"=>1920, "y"=>0, "width"=>1080, "x"=>0}}, {"id"=>"NoResourceEntry-100", "enabled"=>true, "contentDescription"=>"Web View", "vi
sible"=>true, "tag"=>nil, "description"=>"org.apache.cordova.engine.SystemWebView{52821914 VFEDH.C. .F...... 0,0-1080,1920 #64}", "class"=>"org.apache.cordova.engine.SystemWebView",
"rect"=>{"center_y"=>960, "center_x"=>540, "height"=>1920, "y"=>0, "width"=>1080, "x"=>0}}]
What am I doing wrong?
Solution
What you're seeing is the layout of the Android app that was generated by Cordova. Cordova displays everything from your app inside the SystemWebView, so you want to look in there to find your HTML. You can see the html of the whole page in the web view with this query
query("SystemWebView css:'*'")
See this wiki page for more detail on how to test web views with Calabash.
Answered By - Randy Jones
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.