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
Run flutter test --update-goldens and compare the generated goldens
Expected results
Generated Goldens will be the same width as specified by the provided Device config
Actual results
Golden generated using autoHeight: true has a different width than the provided Device config
Code sample
widget_test.dart
// This is a basic Flutter widget test.//// To perform an interaction with a widget in your test, use the WidgetTester// utility in the flutter_test package. For example, you can send tap and scroll// gestures. You can also use WidgetTester to find child widgets in the widget// tree, read text, and verify that the values of widget properties are correct.import'package:flutter/material.dart';
import'package:flutter_test/flutter_test.dart';
import'package:golden_toolkit/golden_toolkit.dart';
import'package:golden_toolkit_auto_height_bug/main.dart';
voidmain() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.await tester.pumpWidget(constMyApp());
// Verify that our counter starts at 0.expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
group('goldens', () {
const iphone10 =Device(
size:Size(375, 812),
devicePixelRatio:3.0,
name:'iPhone_X',
);
setUpAll(loadAppFonts);
testGoldens('autoHeight: false', (tester) async {
await tester.pumpWidgetBuilder(
constMyApp(),
wrapper:materialAppWrapper(),
surfaceSize:constSize(3000, 3000),
);
awaitmultiScreenGolden(
tester,
'counter.autoHeight_false',
devices: [iphone10],
autoHeight:false,
);
});
testGoldens('autoHeight: true', (tester) async {
await tester.pumpWidgetBuilder(
constMyApp(),
wrapper:materialAppWrapper(),
surfaceSize:constSize(3000, 3000),
);
awaitmultiScreenGolden(
tester,
'counter.autoHeight_true',
devices: [iphone10],
autoHeight:true,
);
});
});
}
Screenshots
Screenshots
autoHeight: false
autoHeight: true
Flutter Doctor Verbose output
Doctor output
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F82 darwin-x64, locale en-US) • Flutter version 3.10.5 on channel stable at /Users/supposedlysam/fvm/versions/3.10.5 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 796c8ef792 (5 weeks ago), 2023-06-13 15:51:02 -0700 • Engine revision 45f6e00911 • Dart version 3.0.5 • DevTools version 2.23.1[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1) • Android SDK at /Users/supposedlysam/Library/Android/sdk • Platform android-34, build-tools 33.0.0-rc1 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted.[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E300c • CocoaPods version 1.12.1[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome[✓] Android Studio (version 2022.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)[✓] VS Code (version 1.80.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.68.0[✓] VS Code (version 1.81.0-insider) • VS Code at /Users/supposedlysam/Applications/Visual Studio Code - Insiders.app/Contents • Flutter extension version 3.68.0[✓] Connected device (3 available) • macOS (desktop) • macos • darwin-x64 • macOS 13.4.1 22F82 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.198[✓] Network resources • All expected network resources are available.• No issues found!
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Steps to reproduce
flutter create golden_toolkit_auto_height_bug
golden_toolkit
as a dev dependency (min version 0.15.0)test/widget_test.dart
with providedgroup
flutter test --update-goldens
and compare the generated goldensExpected results
Generated Goldens will be the same width as specified by the provided
Device
configActual results
Golden generated using
autoHeight: true
has a different width than the providedDevice
configCode sample
widget_test.dart
Screenshots
Screenshots
Flutter Doctor Verbose output
Doctor output
The text was updated successfully, but these errors were encountered: