问题
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