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
{{ message }}
Repository navigation
Commit e11ab22
Browse filesBrowse the repository at this point in the historyBrowse files
`BrowserStack.init()` sets up the integration test binding, so call it before anything else in `main()`. If your tests call `IntegrationTestWidgetsFlutterBinding.ensureInitialized()`, remove that line or move it after `BrowserStack.init()`. If the binding is created first, fewer actions get an accessibility scan.
156
156
157
+
If you run several test files from one entry file, call `BrowserStack.init()` once at the top of the entry file's `main()`, before any `group()`:
Then build with `-t integration_test/all_tests.dart`. The `BrowserStack.init()` calls inside `login_test.dart` and `checkout_test.dart` can stay: after the first call, later calls do nothing. If `init()` only runs inside a `group()`, only that group's tests are reported, and the device log warns about it.
176
+
157
177
3. Make sure your app has the native test runners that `integration_test` needs on BrowserStack, as in this repo:
158
178
- Android: an instrumentation test like `MainActivityTest.java`, and `testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"` in `android/app/build.gradle.kts`.
159
179
- iOS: a `RunnerTests` target with `RunnerTests.m`.
@@ -198,8 +218,9 @@ Tags are the standard Dart test tags: `testWidgets('...', (tester) async { ... }
198
218
## Good to know
199
219
200
220
- iOS builds for BrowserStack are release builds, and in release builds `integration_test` doesn't pass `enterText` to your app. Call `tester.testTextInput.register()` at the start of tests that type text, as `integration_test/app_test.dart` does.
221
+
- On Flutter 3.27 to 3.40, keep Swift Package Manager off for the iOS build. It's off by default on these versions; if you turned it on, the iOS build can fail because the package's Swift package needs Flutter's `FlutterFramework` package, which Flutter adds in 3.41. Turn it off with `flutter config --no-enable-swift-package-manager`. Other Flutter versions aren't affected.
201
222
- Requests your app makes with Dart's own `HttpClient` don't go through the device's proxy. They won't show in network logs, and they can't reach [BrowserStack Local](https://www.browserstack.com/docs/app-automate/flutter/get-started-with-local-testing) unless your app sets the proxy itself. This doesn't affect Test Reporting or App Accessibility.
202
-
- The package logs what it does with the prefix `[BrowserStack]`. On Android these lines are in the device logs, which App Automate keeps when the build request has `"deviceLogs": true`. On iOS they are in each test's instrumentation log. If you contact BrowserStack support about a run, they may ask for these logs.
223
+
- The package logs what it does with the prefix `[BROWSERSTACK_SDK]`. On Android these lines are in the device logs, which App Automate keeps when the build request has `"deviceLogs": true`. On iOS they are in each test's instrumentation log. If you contact BrowserStack support about a run, they may ask for these logs.
0 commit comments