Comments (19)
@wordofchristian I was just thinking the same! Did you start on it already?
from kif.
Yep here's a gist https://gist.github.com/1934198
from kif.
The podspec doesn't do everything. You would still need to create the testing target and set it to use the generated .xcconfig file for its configuration.
The KIF pod would be added to a new dependency group in the Podfile
target :integration do
dependency 'KIF', '~> 0.1'
end
This generates an Pods-integration.xcconfig
file. in the Pods project. I had to add to my main project before I could set my test target to use it. Not sure if this is a bug or what.
from kif.
@wordofchristian It’s not a bug, in so many words, rather a current limitation ;) I.e. currently CocoaPods only configures your main target. In the future it will be possible to configure all targets.
Btw, you probably want to specify the target as :integration, :exclusive => true
, so that it doesn’t include any other dependencies defined in the default target (outside of the target block), if you have any.
Going to try the spec now!
from kif.
@alloy Won't the integration test target need to include the same dependencies that your normal target has?
from kif.
Just started and I stand corrected.
I had expected that KIF would use a bundle in the same way that Xcode sets-up a unit-testing target, in which case you want exclusive, but in this case the runner app is completely isolated from the app target.
from kif.
Right, for a unit testing target you would want the exclusive => true option.
On Tuesday, February 28, 2012 at 11:22 AM, Eloy Durán wrote:
Just started and I stand corrected.
I had expected that KIF would use a bundle in the same way that Xcode sets-up a unit-testing target, in which case you want exclusive, but in this case the runner app is completely isolated from the app target.
Reply to this email directly or view it on GitHub:
#114 (comment)
from kif.
@wordofchristian Ok, I’ve updated your version and verified it works with the KIF example app. Shall I push it to the main specs repo under your name?
from kif.
For now it’s labeled as version 0.0.1, but it would be great if you guys can tag a version in the repo so that it actually maps to something, rather than a arbitrary commit hash. Or, if you want to wait, send us a message once you do, or a pull request :)
Finally, like @wordofchristian said, if you add a copy of the podspec to the root of your repo, then people can install the bleeding-edge version directly from your repo. I can create a pull request for this if you’d like?
from kif.
Also, until it's part of the KIF repo or the CocoaPods/Specs repo you can just define it in your Podfile.
Here's my example Podfile.
platform :ios
dependency 'SVProgressHUD', '~> 0.6'
target :test, :exclusive => true do
dependency 'Kiwi', '~> 1.0'
end
#just for KIF
target :integration do
# If no podspec is available anywhere, you can define one right in your Podfile
dependency do |s|
s.name = 'KIF'
s.version = '0.0.1'
s.platform = :ios
s.source = {:git => 'https://github.com/square/KIF',
:commit => '7d78430cdb7a0e9067cb57bb82ecbd651b6ed8c7' }
s.source_files = 'Classes', 'Additions'
s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) RUN_KIF_TESTS=1' }
end
end
from kif.
@alloy any reason this wasn't added? I can't find any other issues. Is there something I can help with?
from kif.
@cdmwebs No, I simply forgot :) You have push access to the spec repo, right? If so, can you update my gist for the current state of KIF and push it?
from kif.
@alloy I doubt I have push access, but I can certainly send a PR. I'll check our spec out and send one.
from kif.
@cdmwebs Cool, thanks.
from kif.
Just added to Specs: CocoaPods/Specs@59d8453
Who could we ask @square to tag this repo so we can start using that instead? It's currently just tracking master, which is fine with me, but it seems like others might want that.
//cc @mikethole
from kif.
@cdmwebs Thanks!
from kif.
@wordofchristian looks like this can be closed now.
from kif.
using this
#just for KIF
target :integration do
# If no podspec is available anywhere, you can define one right in your Podfile
dependency do |s|
s.name = 'KIF'
s.version = '0.0.1'
s.platform = :ios
s.source = {:git => 'https://github.com/square/KIF',
:commit => '7d78430cdb7a0e9067cb57bb82ecbd651b6ed8c7' }
s.source_files = 'Classes', 'Additions'
s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) RUN_KIF_TESTS=1' }
end
end
do I have to follow the KIF integration target generation tutorial or it should be created by cocoapods? will the KIF lib be packaged with the main application on release?
from kif.
For posterity, for an existing iPhone app with CocoaPods, the directions are a bit different than the README steps.
In my existing Podfile, add the ``target` block:
platform :ios, '4.0'
...
# Just for KIF (targets are case sensitive)
target :Integration do
pod 'KIF'
end
blow away the Pods/ directory, do a pod install
(which takes a while), then duplicate a target in the XCode (like the README) and rename it to match the target in the Podfile, in this case Integration
. However, under Build Phases > Link Binary With Libraries, make sure libPods-Integration.a is there, but not libPods.a (if libPods.a is there, you get duplicate symbols).
After that, the tests worked. As a note, since I had to make sure to explicitly call makeKeyAndVisible before the startTestingWithCompletionBlock call in didFinishLaunchingWithOptions.
from kif.
Related Issues (20)
- KIF types each character twice HOT 1
- tapView() not working on SwiftUI views in Xcode 12 with KIF 3.8.6 HOT 3
- Xcode 13.4: NSFunctionExpression with selector is forbidden. HOT 11
- KIF-based UI tests crashes in Xcode 13.4 HOT 2
- Question: Does KIF require a mac? HOT 5
- Xcode 14 "Failed to select from Picker" HOT 6
- iOS16 press on keyboard doesn't work HOT 5
- KIF causes exception on using WKWebView HOT 2
- KIF with SwiftUI element HOT 2
- Tappable SwiftUI view that is not tapped by KIF HOT 5
- How to tap on system photo picker #help-wanted HOT 1
- Problems with async test HOT 6
- Way to use Quick6 Nimble11 with KIF UI testing framework
- Screen edge pan gesture is not recognized HOT 8
- [Question/Help] How to write E2E UI Integrations tests? HOT 2
- Is KIF real rendering? HOT 2
- iOS 17 - Entering text using a KIFUITestActor into a text field is broken HOT 2
- [Requirement] Privacy manifest for new sensitive APIs HOT 2
- Black screenshots on test failures on ios 17. HOT 6
- Possibility of intergrating with Swift Test HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kif.