You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@gaaclarke Both this e2e and the newer integration_test documentation for iOS setup is the same everywhere ... and it is all unclear and very very brief.
Related issue here, where documentation is followed, but the IntegrationTestIosTest.h file not found: #72876
Hi,
I tried to create an instrumented version of my app to send it to Firebase but it didn't work, and as I'm not an iOS developer, I'm kind of lost here.
The first issue I encountered was the #72876. I resolved this issue by writing the following code in my RunnerTests.m :
Then I was able to do Product > Test, but the test failed with an unrecognized selector error. I suspect that Xcode did not link my integration test target file in the process.
I was able to run
flutter build ios integration_test/foo_test.dart
but I don't know what to do after that in order to create the . xctestrun file necessary to run or upload the instrumented app to Firebase Test Lab.
@dnfield, @jiahaog you seemed to have work on this plugin, have you a better idea on what we would need to do here ? I could make a PR to the Readme in order to improve the doc if I can make it work on my side.
It did the setup for the project I'm working on this Monday.
Not beeing an iOS dev I too found the documentation, succinct :)
Here are some pointer that helped me, in addition to the doc at https://pub.dev/packages/integration_test :
I ignored the part about "linking all of the plugins dynamically" (but my Podfile already contained the use_framework! bit)
I ran flutter build ios integration_test/foo_test.dart as instructed
I added a "Unit Testing Bundle" target in XCode, as instructed (initially went with a "UI Testing Bundle" as it sounded closer to what i wanted, but after checking out the example here https://github.com/flutter/plugins/tree/master/packages/integration_test/example it appeared I was wrong). I named mine "Integration Test"
Once you do this the code specified in the doc works fine (you need to change RunnerTests to the name you gave the "Unit Testing Bundle" Target you created just before )
I follow your tutorial @clement-buchart and it worked perfectly! Thank you very much.
I also chose UI Testing Bundle the first time, that's why it certainly didn't worked!
Do you mind if I make a PR using what you said, so that it can profit to every one?
Thanks @clement-buchart for debugging this for us all. I also made that fundamental mistake of selecting in Xcode the "UI Testing Bundle" (because the official documentation doe not specify which sort of test in Xcode).
This is the sort of detail we need for iOS in the official documentation 👍
It did the setup for the project I'm working on this Monday.
Not beeing an iOS dev I too found the documentation, succinct :)
Here are some pointer that helped me, in addition to the doc at pub.dev/packages/integration_test :
* I ignored the part about "linking all of the plugins dynamically" (but my Podfile already contained the use_framework! bit)
* I ran flutter build ios integration_test/foo_test.dart as instructed
* I added a "Unit Testing Bundle" target in XCode, as instructed (initially went with a "UI Testing Bundle" as it sounded closer to what i wanted, but after checking out the example here [https://github.com/flutter/plugins/tree/master/packages/integration_test/example](https://github.com/flutter/plugins/tree/master/packages/integration_test/example?rgh-link-date=2021-01-21T16%3A37%3A06Z) it appeared I was wrong). I named mine "Integration Test"
* I then hit the import problem. The key here was to setup build configuration as blaugold mention in #72876. You can do this in the _Info_ tab of the Runner project in Xcode. By default the Test target config is _None_, you need to use the same than the main flutter project.

* Once you do this the code specified in the doc works fine (you need to change RunnerTests to the name you gave the "Unit Testing Bundle" Target you created just before )
* I set the iOS Deployment Target to iOS 13.0 in the _Build Settings_ tab of the "Unit Testing Bundle" target in Xcode

That for the set-up, then to run the tests (using firebase test lab), I do :
In flutter directory :
You can of course change the third command to run the tests on a device or just use Xcode GUI to run the tests.
All this was done on a M1 Mac Mini, if anyone is wondering if that's possible.
While this did help me I was unable to make it work with flavors. Flutter uses iOS schemes as flavors and I had a separate scheme integration for our test flavor. Here's how I managed to create the test artifacts and run it on Firebase Test Lab
output="../build/ios_integ"
product="Build/Products"
dev_target="14.3"
#First generate the test flavor build
flutter build ios --release --flavor integration -t integration_test/main_test.dart
#Generate iOS XCTest Package
pushd ios
xcodebuild -workspace Runner.xcworkspace -scheme integration -configuration Release-integration -derivedDataPath $output -sdk iphoneos build-for-testing
popd
cd build/ios_integ/Build/Products
zip -r "ios_tests.zip" "Release-integration-iphoneos" "integration_iphoneos$dev_target-arm64-armv7.xctestrun"
gcloud firebase test ios run --test "ios_tests.zip" --device model=iphone11pro,version=14.1,locale=en_US,orientation=portrait --xcode-version=12.3 --timeout 2m
First thing to note here is that while building you have to make sure that you pass the correct scheme via -scheme and also the correct configuration which would be Release-<SCHEME_NAME> based on what the name of your scheme is.
Also for some reason the zip command for me kept zipping the artifacts in a subdirectory /Build/Products, causing the tests to fail on Test Lab. That's why I had to use the cd command to get into the directory first.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
gaaclarke commentedon Jan 10, 2020
cc @mklim @collinjackson
SiTianyu commentedon May 14, 2020
Yes, I have same trouble on here.
gaaclarke commentedon May 14, 2020
@SiTianyu I have a working example here: https://github.com/flutter/packages/tree/master/packages/pigeon/e2e_tests/test_objc
I don't know if that will help you.
workerbee22 commentedon Jan 8, 2021
@gaaclarke Both this e2e and the newer
integration_testdocumentation for iOS setup is the same everywhere ... and it is all unclear and very very brief.Related issue here, where documentation is followed, but the IntegrationTestIosTest.h file not found: #72876
letsar commentedon Jan 21, 2021
Hi,
I tried to create an instrumented version of my app to send it to Firebase but it didn't work, and as I'm not an iOS developer, I'm kind of lost here.
The first issue I encountered was the #72876. I resolved this issue by writing the following code in my RunnerTests.m :
Then I was able to do Product > Test, but the test failed with an unrecognized selector error. I suspect that Xcode did not link my integration test target file in the process.
I was able to run
but I don't know what to do after that in order to create the
. xctestrunfile necessary to run or upload the instrumented app to Firebase Test Lab.@dnfield, @jiahaog you seemed to have work on this plugin, have you a better idea on what we would need to do here ? I could make a PR to the Readme in order to improve the doc if I can make it work on my side.
clement-buchart commentedon Jan 21, 2021
Hello,
It did the setup for the project I'm working on this Monday.
Not beeing an iOS dev I too found the documentation, succinct :)
Here are some pointer that helped me, in addition to the doc at https://pub.dev/packages/integration_test :
That for the set-up, then to run the tests (using firebase test lab), I do :
In flutter directory :
flutter build ios integration_test/my_test.dart -releaseIn ios directory
xcodebuild -workspace Runner.xcworkspace -scheme Runner -config Flutter/Release.xcconfig -derivedDataPath /tmp/build -sdk iphoneos build-for-testingzip -r MyTests.zip /tmp/build/Build/Products/Release-iphoneos /tmp/build/Build/Products/Runner_iphoneos14.3-arm64.xctestrungcloud firebase test ios run --test MyTests.zip --device model=iphone11pro,version=14.1,locale=fr_FR,orientation=portraitYou need to build the tests with
-config Flutter/Release.xcconfigto run them on iOS >= 14 because of https://flutter.dev/docs/development/ios-14You can of course change the third command to run the tests on a device or just use Xcode GUI to run the tests.
All this was done on a M1 Mac Mini, if anyone is wondering if that's possible.
letsar commentedon Jan 21, 2021
Thanks @clement-buchart for this amazing answer, I need to try the last commands :-)
letsar commentedon Jan 21, 2021
I follow your tutorial @clement-buchart and it worked perfectly! Thank you very much.
I also chose UI Testing Bundle the first time, that's why it certainly didn't worked!
Do you mind if I make a PR using what you said, so that it can profit to every one?
clement-buchart commentedon Jan 21, 2021
workerbee22 commentedon Jan 21, 2021
Thanks @clement-buchart for debugging this for us all. I also made that fundamental mistake of selecting in Xcode the "UI Testing Bundle" (because the official documentation doe not specify which sort of test in Xcode).
This is the sort of detail we need for iOS in the official documentation 👍
adityadroid commentedon Apr 2, 2021
While this did help me I was unable to make it work with flavors. Flutter uses iOS schemes as flavors and I had a separate scheme
integrationfor our test flavor. Here's how I managed to create the test artifacts and run it on Firebase Test LabFirst thing to note here is that while building you have to make sure that you pass the correct scheme via
-schemeand also the correct configuration which would beRelease-<SCHEME_NAME>based on what the name of your scheme is.Also for some reason the zip command for me kept zipping the artifacts in a subdirectory
/Build/Products, causing the tests to fail on Test Lab. That's why I had to use thecdcommand to get into the directory first.github-actions commentedon Aug 3, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.