Calabash handling “Complete action using” dialog

前端 未结 1 471
甜味超标
甜味超标 2020-12-20 01:32

I want to test sharing functionality of an app but I have no idea how to handle android dialog \"Complete action using\" (Facebook, Gmail etc.)
When I use query(\"

相关标签:
1条回答
  • 2020-12-20 02:31

    It's not a very elegant solution but you can simulate screen touches using adb. There is an answer that covers it here - simulating touch using ADB

    Edit: Adding some details on using adb to dump a file of all of the UI elements.

    In the android sdk in the platforms/android-L folder there is a tool called uiautomater.jar that adb can use to run tests (though I've never used it for that) and to dump an xml file of the visible elements.

    adb shell uiautomator dump test.xml

    will create the xml file (on the device not your computer) that you could then look through in your code to check for the pop up you want. If you want to interact with the pop up then you can use the coordinates given in the xml dump to pick which one you want and use an adb touch event to click it.

    Not a pretty solution but hopefully not too difficult to work into your tests :)

    0 讨论(0)
提交回复
热议问题