def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
target 'RunnerTests' do
inherit! :search_paths
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
2. Update the [import to the right `integration_test` casing](https://github.com/flutter/plugins/blob/master/packages/integration_test/example/ios/RunnerTests/RunnerTests.m#L1) to
3. Run the tests.
### Recommended fix
1. Convert the XCTest to XCUITests. This would be a breaking change for existing tests, including the one's in Flutter's repo.
2. In `+setUp`/`class func setUp` (not `-setUp` or `func setUp`) detect the popup and hit it when the app launches in the `INTEGRATION_TEST_IOS_RUNNER` macro
```swift
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let button = springboard.buttons['OK']
if button.exists {
button.tap()
}
\cc @dnfield based on CODEOWNERS.
I would work on this myself but I'm about to be on vacation for a week, so I want to leave a breadcrumb in case iOS 14 gets released in the meantime.
On iOS 14, an integration_test test will prompt the user to allow local network access when the observatory publishes:
The tests hang forever until you hit OK, so fails in a CI setup when there's no one to hit the button.
Steps to Reproduce
Fix up the iOS example to actually work.... https://github.com/flutter/plugins/tree/master/packages/integration_test/example/ios
RunnerTests
inherit! :search_paths
set up (not sure why the README says to add ause_framework!
...)CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, }
def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end
File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
target 'RunnerTests' do inherit! :search_paths end end
post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end
import <integration_test/IntegrationTestIosTest.h>
See cocoon for working example.
Update the example app to a
XCUITests
target.Change the README to