Closed zedtux closed 6 years ago
I don't use fastlane.
build_for_testing
implies that you are using XCTest or XCUITest to test your application. You are not using either - you are using Cucumber + Calabash.
You should just build
because your tests are Cucumber test not XCTest or XCUITest.
Thank you @jmoody for your quick reply.
I'm not using build
because the code signing part isn't yet done and build
is failing due to that. This workaround I'm using is temporary.
Do you think it is coming from here?
I recommend trying automatic code signing.
You can use build-for-testing
, but you need to create an XCUITest target whose target application is the -cal target.
You can use build-for-testing, but you need to create an XCUITest target whose target application is the -cal target.
Isn't what the SO answer I pointed in my issue is doing?
Maybe?
As I mentioned, I don't use fastlane.
I think you should figure out your code signing problem and use build
Okay, now I got what you meant by build-for-testing
... đ.
So I configured the signing stuff, and I found how to build with build-for-testing
. Now the problem I have is that calabash Launcher is not waiting long enough to run my tests. During the loading of my app, it crashes with Could not connect to the Calabash Server @ http://127.0.0.1:37265/.
but my app is still loading my react-native app, and I believe this cause this crash.
Am I wrong ? If I'm right, is there a way to increase the timeout for the Launcher?
Oh, I wasn't targeting the right scheme đ. Now it's working, the test are executed against the app đ.
In the case, someone using Fastlane is facing this issue, here is my :ios
Fastfile
part :
platform :ios do
desc 'Runs all the tests'
lane :tests do
begin
# Build the app
xcodebuild(
clean: true,
scheme: 'Companion-cal',
project: './ios/Companion.xcodeproj',
xcargs: ' build-for-testing'
)
# Run cucumber
sh 'cd .. && $(which bundle) exec cucumber -p ios'
ensure
kill_simulator
kill_react_native_packager
end
end
private_lane :kill_simulator do
puts 'đŁ Killing iOS Simulator ...'
sh 'killall "Simulator"; exit 0'
end
private_lane :kill_react_native_packager do
puts 'đŁ Killing Packager on port 8081 ...'
sh "lsof -n -i4TCP:8081 | sed '1 d' | awk '{print $2}' | xargs kill -9; exit 0"
end
end
I'm building a new react-native app (version 0.55) and followed the wiki to create the -cal target but when I run the tests using Fastlane (where I'm using
scan
in order to build the app, and then I'm running the calabash tests with$(which bundle) exec cucumber -p ios
) it is failing at the building step with the following error:Here is the
:ios
part of myFastfile
:Looking on SO I found this answer which seem to fix my issue. Is it something I did wrong or should the wiki be updated?
Thank you.