6

I'm trying to depend on OHHTTPStubs as a framework, from a Swift UI Testing target in Xcode 7.

I built the .framework (via Carthage, but I'm not sure that's relevant?) and dragged it into the "Link binaries with libraries" section under the Build Phases tab of the UI test target.

But when I try and @import OHHTTPStubs in my .swift test case, Xcode tells me No such module 'OHHTTPStubs'.

This should be simple, what am I missing? Here's the project on Github.

Senseful
  • 86,719
  • 67
  • 308
  • 465
Robert Atkins
  • 23,528
  • 15
  • 68
  • 97
  • Do you have a bridging header as mentioned here: https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html ? And why are you using a swift ui testing target? As far as I've seen there should be also an Obj-C taget. (But didn't have the time to try it yet). – Jan Jun 20 '15 at 11:01
  • I don't believe I need a bridging header as I'm trying to include a framework that "defines module". And I'm using a Swift testing target because I want to use a Swift testing target—the whole point is to experiment with Swift in a "safe" way by isolating it to the test infrastructure. This *should* work, as far as I can see. – Robert Atkins Jun 21 '15 at 08:27
  • 1
    @RobertAtkins I read (http://stackoverflow.com/questions/32827592/is-it-possible-to-stub-http-requests-in-xcode-7-automated-ui-tests) that it is not possible to have OHHTTPStubs working on a UITest target since the test target runs in a "closed" instance. Is this true? I've also tried other framework like https://github.com/kylef/Mockingjay without success. – MatterGoal Oct 07 '15 at 12:31
  • Any update on this topic? @RobertAtkins – Csabi May 26 '17 at 10:20
  • Sorry no, gave up on this one long ago. – Robert Atkins May 26 '17 at 11:06

0 Answers0