E2E iOS Documentation unclear #48600
Copy link
Copy link
Closed
Labels
f: integration_testThe flutter/packages/integration_test pluginThe flutter/packages/integration_test pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
Document: https://github.com/flutter/plugins/blob/master/packages/e2e/README.md
- The docs say "Create a test target" but it doesn't specify if it should be a UI test target or Unit Test target.
- It isn't specified when you should have to call
flutter build ios -t, anytime the test dart file is edited? Anytime any code changes anywhere?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
f: integration_testThe flutter/packages/integration_test pluginThe flutter/packages/integration_test pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
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.