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

Support for XCUITest ? #2

Open
Shashikant86 opened this issue Nov 16, 2017 · 5 comments
Open

Support for XCUITest ? #2

Shashikant86 opened this issue Nov 16, 2017 · 5 comments

Comments

@Shashikant86
Copy link

This is quick question not an issue.

DO you think this approach will wok to stub the Xcode UI Tests as well ?

@JanGorman Let me know what you think ?

@JanGorman
Copy link
Owner

Hey,

yes, this will work for any kind of tests since it globally swaps out url handling with its own implementation. Just call Hippolyte.shared.start() at the beginning and you should be good.

@Shashikant86
Copy link
Author

Shashikant86 commented Nov 16, 2017

I tried & it doesn't seems to be working.. Do you have any example that worked for UI tests ? Do we need to do specific configuration in order to get that working. I will probably create demo project and send it to you as an example.

@JanGorman
Copy link
Owner

JanGorman commented Nov 16, 2017

Interesting… I never tried it with UI tests, a quick sample project would be helpful. But now that I think about it some more it indeed might be an issue because the ui tests launch the app differently. So maybe passing launch arguments and then doing something in the application target to stub might be needed. Not ideal. If you can provide a sample great, I'll further investigate too later today

@Shashikant86
Copy link
Author

Yes UI Tests are designed as black box and there is no access to app code directly. The Swifter framework works with UI Tests but shame its not updated for Swift 4. It launch web server in the UI test process itself on localhost:8080 More info here http://swiftpearls.com/dynamic-ui-testing-http-mocking.html
It would be great if we can do something for Hippolyte as well :)

@JanGorman
Copy link
Owner

Interesting approach that – for those cases we've used a separate small web app written in Sinatra but embedding is pretty clever. Somehow Swifter flew under my radar

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

2 participants