Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 7 alert support #234

Open
nerdsRob opened this issue Aug 8, 2013 · 24 comments
Open

iOS 7 alert support #234

nerdsRob opened this issue Aug 8, 2013 · 24 comments

Comments

@nerdsRob
Copy link

nerdsRob commented Aug 8, 2013

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')

@ondrejhanslik
Copy link
Contributor

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

@ondrejhanslik
Copy link
Contributor

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.

@ghost ghost assigned ondrejhanslik Sep 14, 2013
@ondrejhanslik
Copy link
Contributor

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].

@oradyvan
Copy link

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?

@ondrejhanslik
Copy link
Contributor

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.

@oradyvan
Copy link

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

@moredip
Copy link
Owner

moredip commented Sep 29, 2013

@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.

@oradyvan
Copy link

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

@RayAnd
Copy link

RayAnd commented Oct 10, 2013

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

@lvalencia
Copy link

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

@lukeredpath
Copy link
Contributor

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.

@athenatk
Copy link

@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!

@lukeredpath
Copy link
Contributor

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

@seanoshea
Copy link
Contributor

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

@seanoshea
Copy link
Contributor

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?

@djeito
Copy link

djeito commented Nov 27, 2013

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

@seanoshea
Copy link
Contributor

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.

@ondrejhanslik
Copy link
Contributor

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)

@seanoshea
Copy link
Contributor

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

@dgmora
Copy link

dgmora commented Mar 23, 2014

Hi guys,

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

@seanoshea
Copy link
Contributor

@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

@dgmora
Copy link

dgmora commented Apr 10, 2014

@seanoshea Thanks, couldn't find that before!

@cindyl92
Copy link

@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.

@RayAnd
Copy link

RayAnd commented Apr 23, 2014

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.

@ondrejhanslik ondrejhanslik removed their assignment Jul 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests