how to select a picture from UIImagePickerController using Frank Cucumber?

痞子三分冷 提交于 2019-12-11 06:44:48

问题


I was trying to use BDD technique to check the import picture process using Frank in the iPhone Simulator.

The problem is that I cannot call the last step of selecting an image from UIImagePickerControllerSourceTypePhotoLibrary source (launching the UIImagePickerController was very easy using "touch"-commands on a button).

It always stuck in the progress when I can see the saved images in the Simulator. The Frank Symbiote said the object I wanna touch is a "PLAlbumViewCell" object.


回答1:


I just sorted this out today, basically PLAlbumView inherits from UITableView so I created a custom step definition to select the first photo.

When /^I select the first photo$/ do
  frankly_map( "tableView", "touchx:y:", '10', '10' )
end



回答2:


images = frankly_map( "view:'PUPhotosGridCell'", 'tag' )
  if images.count > 0
    touch ("view:'PUPhotosGridCell' first")
  end

I have used above lines of code to select first image from UIImagePickerController.



来源:https://stackoverflow.com/questions/9412603/how-to-select-a-picture-from-uiimagepickercontroller-using-frank-cucumber

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!