moredip/Frank

iOS 7 alert support

Opened this issue · 24 comments

Hey Guys, are there any plans to support iOS 7 in the near future? At the moment we are having problems localizing alerts on the screen.
Both commands below do not return any element of the view, even though the alert is displayed properly.

frankly_map("view: '_UIModalItemAlertContentView' view:'UILabel', "accessibilityLabel")

frankly_map('alertView', 'message')

I guess we should wait until the iOS 7 functionality is completed. Especially alerts are still a bit buggy.

I am planning to go a bit deeper but from my last tests, it seems that Apple is somehow blocking the access to private classes. I am planning to inspect this.

The old alertView selector won't work since UIAlertView is not part of the view hierachy any more on iOS 7. Also, there are no buttons (UIButton). Everything is implemented through tables.

I will push a fix next week. To summarize the issue:

Apple decided to make the modal window a system window. System windows are not returned by -[UIApplication windows]

The view hierarchy is still visible in Symbiote because Symbiote uses only -[UIApplication keyWindow]. However, Shelley uses only -[UIApplication windows].

Hi Ondrej,

As I can see your recent pull request is not enough for solving the issue with alert views - they are still out of scope by Shelly engine though visible via Symbiote. Do you have any plans to continue working on this issue?

Yes, but I am still deciding how to do it. Shelley can either check whether FEX_windows is available on UIApplication or I can duplicate the whole code in Shelley.

Could you please take a look at these pull requests? I think I've found some sort of solution for this issue.

#248
TestingWithFrank/Shelley#11

@ondrejhanslik I really like @oradyvan's approach. Basically a delegate protocol which Frank implements and provides to the selector engine. Seems nice and clean. I am planning to pull it in but of course would love to get your thoughts on it.

Thank you guys, I just updated both pull requests, please take a look.

Hi guys,

What about Shelley change?

Was it applied?

We are in company really heavy rely on Frank automation testing and with iOS 7 it's now really broken )

What is the thoughts about upcoming Frank releases?

Regards,
Andrey

I'm in the same boat as Andrey.
Any progress on the new iOS7 changes?

I must have missed this, but I've taken a similar but (I think) simpler approach here:
#250

This is a backwards compatible change to the selector engine protocol and passes along the windows using the new FEX_windows category method.

I've updated the Igor selector engine to support this here:
lukeredpath/igor@74d7e95

With these changes, I was able to get my UIAlertView tests working by replacing references from UIAlertView to _UIModalItemRepresentationView.

@lukeredpath; will you be doing the change to Shelley? I've posted this question on the Google group but have received no answer as to when the fix for the old UIAlertViews will be provided. I've pulled your fix and I tried ondrejhanslik's fix but none work. I guess these solutions are only partially completed?

Thanks!

@athenatk probably not as I don't really use Shelley.

With #250 and TestingWithFrank/Shelley#16, I assume that this bug is now fixable (pending travis supporting Xcode 5 for TestingWithFrank/Shelley#15)

TestingWithFrank/Shelley#17, TestingWithFrank/Shelley#16 & TestingWithFrank/Shelley#15 just got merged which opens up the possibilities of iterating through multiple windows to find the UIAlertView. Should this repo be updated to use the latest Shelley, or should the fix for this bug go into the https://github.com/TestingWithFrank/Frank repo?

sorry for the newbie question, but, how can I do to touch an alert view button?

A variation of https://gist.github.com/seanoshea/7613671 seems to be working fine for me after updating to the latest version of Frank and Shelley.

I can't seem to access the frankly_os_version function though. Do I need to update my gems or something to get that working? Apologies for the n00b-ish question - a lot of this ruby stuff is pretty new to me.

You need to make a release build (using the rake) and then you can install the gem from the resulting package (I think the command is igem install --local)

#260 allows the title of a UIAlertView be queryable. Need to work on the message being queryable and clicking on the buttons too.

Hi guys,

are there any news or plans in making the alert views clickable for iOS7?

@dgmora ... the following could work for you:

When /^I touch the alert button marked "([^\"]*)"$/ do |mark|
  quote = get_selector_quote(mark)
 if frankly_os_version > "7.0"
    touch_with_sleep( "view:'_UIModalItemTableViewCell' marked:#{quote}#{mark}#{quote}" )
  else
    touch_with_sleep( "view:'UIAlertButton' marked:#{quote}#{mark}#{quote}" )
  end
end

@seanoshea Thanks, couldn't find that before!

@seanoshea Do you have source code for touch_with_sleep method by any chance? I got the NoMethodError when I tried to use your code.

this is a custom function we use in our code. It's basically just a wrapper around touch. So you should be able safe replace that with touch.