From 018369d244569cde6e64469694cbe90759feaa8f Mon Sep 17 00:00:00 2001 From: rounak bhatia Date: Mon, 30 Nov 2026 15:09:13 +0530 Subject: [PATCH 1/3] SDK-8262: Note Swift Package Manager on Flutter 3.27-3.40, fix the log prefix Co-Authored-By: Claude Opus 5.5 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a18dee..18e9fb9 100644 --- a/README.md +++ b/README.md @@ -198,8 +198,9 @@ Tags are the standard Dart test tags: `testWidgets('...', (tester) async { ... } ## Good to know - 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. +- 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. - 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. -- 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. +- 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. ## Help From d070267b0701c88f46772511b09ec2fa9a5b5670 Mon Sep 17 00:00:00 2001 From: rounak bhatia Date: Mon, 30 Nov 2026 15:16:22 +0530 Subject: [PATCH 2/3] SDK-8262: Tell entry files to call BrowserStack.init() before any group() Co-Authored-By: Claude Opus 5.5 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 18e9fb9..47d5a06 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,8 @@ curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \ `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. + If one entry file runs your other test files (for example `group('login', login.main)`), call `BrowserStack.init()` once at the top of the entry file's `main()`, before any `group()`. A call made inside a `group()` only covers that group's tests; the device log warns about it. + 3. Make sure your app has the native test runners that `integration_test` needs on BrowserStack, as in this repo: - Android: an instrumentation test like `MainActivityTest.java`, and `testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"` in `android/app/build.gradle.kts`. - iOS: a `RunnerTests` target with `RunnerTests.m`. From 6e425be245d2b81b5af02740463824570d2776f6 Mon Sep 17 00:00:00 2001 From: rounak bhatia Date: Mon, 30 Nov 2026 15:18:51 +0530 Subject: [PATCH 3/3] SDK-8262: Show an entry file that calls BrowserStack.init() before its groups Co-Authored-By: Claude Opus 5.5 --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 47d5a06..bbbd7d0 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,25 @@ curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \ `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. - If one entry file runs your other test files (for example `group('login', login.main)`), call `BrowserStack.init()` once at the top of the entry file's `main()`, before any `group()`. A call made inside a `group()` only covers that group's tests; the device log warns about it. + 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()`: + + ```dart + // integration_test/all_tests.dart + import 'package:browserstack_dart_sdk/browserstack_dart_sdk.dart'; + import 'package:flutter_test/flutter_test.dart'; + + import 'login_test.dart' as login; + import 'checkout_test.dart' as checkout; + + void main() { + BrowserStack.init(); + + group('login', login.main); + group('checkout', checkout.main); + } + ``` + + 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. 3. Make sure your app has the native test runners that `integration_test` needs on BrowserStack, as in this repo: - Android: an instrumentation test like `MainActivityTest.java`, and `testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"` in `android/app/build.gradle.kts`.