Open marbetschar opened 8 years ago
The MGSwipeButton does not seem to be visible by default to Accessibility; which is explained in https://developer.apple.com/videos/wwdc/2015/?id=406 at 39:00
But I'm unable to "activate" the Accessibility for them :(
I've tried deleteButton.accessibilityElementsHidden = false
but without success.
Any suggestions?
Got the wrong property - but nevertheless:
Setting deleteButton.isAccessibilityElement = true
also doesn't have any effect at all.
Any news on this one...?
Is this framework even maintained anymore?
Yes, the project is maintained. I have been busy lately but I will check all the issues/pull request and release a new version soon.
Yeeeeehaaaaaaa!! Good news!!!!!!! :)
I've already started digging around for another project; but switching would cause a major rework of our app since we are heavily relying on your fabulous MGSwipeTableCell.
As upon now I haven't had a closer look at the other issues of this project; but I assume (and understand) UITesting might not got the highest priority in requested features.
Regardless of this, we created fairly complex user interactions based on swipe routines and hoped we are able to implement high level testing routines with the new UI Testing in Xcode. As UITests are not yet working with MGSwipeTableCell, this causes us to put a huge amount into manual testing.
Be able to implement MGSwipeTableCell into UITest's would be a huge benefit on our end - so it'll be very nice to see it as soon as somehow possible.
Feel free to get back to me, if I'm able to help in anything. I've already tried to fix it by myself, but my Objective-C / Cocoapods knowledge seems not to be good enough to wrap my head around the entire problem (started with plain Swift).
Any news in this one?
Can you send me a test project?
Unfortunately I can't find the Time - but it should easy to create one: Just Setup a clean project with a tableView and Swipe functionalities. Them try to Access These by using UI Tests
Any News on this?
+1 for this feature
I managed to tap the button with this code:
XCUICoordinate *cordinate = [[self.app.tables.cells elementBoundByIndex:0] coordinateWithNormalizedOffset:CGVectorMake([UIScreen mainScreen].bounds.size.width-5, 0)];
[cordinate tap];
@eventomer does this even work if you have multiple buttons? How would you distinguish between a "More" and "Delete" Button for example?
+1 looking for a solution to this
+1 I face the same problem. On the the one side I'm unfortunately not able to test the UI of my app automatically on the other fastlanes snapshot is not integratable.
Do you see any way to make UI Tests workable? Maybe you could give a small hint how to integrate accessibility features.
+1 I am also running into this issue. To workaround this issue I am using a tap on coordinate function.
I am running into a very similar problem when testing using Appium. Appium for whatever reason causes a nil hitTest event that MGSwipe reads as a reason to hide the buttons. So if you change the method:
-(UIView *) hitTest:(CGPoint)point withEvent:(UIEvent *)event
to have this at the beginning then the problem is fixed:
if (event == nil){
return nil;
}
I can submit a fix if needed.
Made a pull request to hopefully fix this: https://github.com/MortimerGoro/MGSwipeTableCell/pull/208
Please, @MortimerGoro, help us with this issue.
@rafaelmersant could you see if my fix works for you?
@rafaelmersant does @tateexon 's fix work for you? I'll push a new version soon
@tateexon your fix does not work for me when I tried it with XCTest.
Interesting, I will have to put together a test with XCTest, was assuming apple used the same libraries underneath for UIAutomation and xcuitest and my assumption was wrong. I will debug into this later this week and see if I can come up with anything. I will be moving to over next month so I am assuming I will be running into this issue and will be needing it fixed when I get there.
edit: I was unable to figure out why xcuitest behaves the way it does with this library. Will be a while before I can try another deep dive so if anyone else wants to try to debug it, go ahead.
Finally I had some time to work on this issue. The problem seems that the default UITableViewCell implementation doesn't really use/return all cell.contentView subviews in the accessibility protocol implementation. I have overridden UIAccessibilityContainer protocol to use contentView when the cell is swipped and fallback to default implementation when a cell is not in a swipped state.
I have tested with the Accessibility Inspector and a new XCTest project and both seems to work well now.
Let me know if it works in your projects now ;)
The commit is the master branch by now, I want to work on other issue before pushing 1.5.6 to CocoaPods
In the first screenshot, when I swipe to left, appium recognizes the Block button in iOS (XCUITest)enter image description here. But in the second screenshot, appium does not recognize the Block button. How to solve this?
What I observed is, if I do Pull to refresh and then swipe, then Appium Inspector will recognize the button. But without Pull to refresh and swiping on the cell, Appium does not recognize the button. But when I execute the code, Appium does not recognize the button even after refreshing the screen and swiping on the cell
Hi!
I'm currently trying to build some tests using the new UITest feature in Xcode 7. Unfortunately I'm not able to figure out how to access the MGSwipeButton from it. What's wrong?
In cellForRowAtIndexPath:
And afterwards, if I try to record the test Xcode generates the following code:
Which - of course - just closes the swipeable button area when run.
So how to access the MGSwipeButton's in UITests?