Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f06f7ff
updated dependencies
claudius-kienle Sep 9, 2022
1b4efe0
updated deps
claudius-kienle Sep 9, 2022
67ac392
updated
claudius-kienle Sep 9, 2022
68bed17
fixed config parsing
claudius-kienle Sep 9, 2022
c86c091
fixes
claudius-kienle Sep 9, 2022
1a22399
fixes
claudius-kienle Sep 10, 2022
f5cb057
fix
claudius-kienle Sep 10, 2022
a29d4d8
added white status bar, fixes
claudius-kienle Sep 11, 2022
3bb9ea2
shutdown simulator after screenshots taken
claudius-kienle Sep 11, 2022
965d71d
added regex escape for paranthesis
claudius-kienle Sep 11, 2022
94e1daf
fixed android bugs
claudius-kienle Sep 11, 2022
320d17b
fixed
claudius-kienle Sep 11, 2022
42fbae3
updated
claudius-kienle Sep 11, 2022
0a721a0
fix
claudius-kienle Sep 12, 2022
db7f67f
updated for integration testing
claudius-kienle Sep 14, 2022
5d5933a
updated to integration_test
claudius-kienle Sep 14, 2022
7e19e83
updated navbar
claudius-kienle Sep 14, 2022
8adbbf6
added missing import
claudius-kienle Sep 15, 2022
6129d9a
updated navbar black
claudius-kienle Sep 17, 2022
edffc29
updated tests
claudius-kienle Dec 20, 2022
9136c15
Updated some spec files
patreu22 Jan 20, 2023
379b365
Added iPad Pro (12.9-inch) (6th generation) as supported devices
patreu22 Jan 20, 2023
18b3fdc
Fixed wrong null checks
patreu22 Jan 20, 2023
fe487cc
Fixed wrong negation
patreu22 Jan 20, 2023
509d2ac
Updated to correct path
patreu22 Jan 20, 2023
485c287
Added Pixel 4 to supported devices
patreu22 Jan 27, 2023
c68fd6a
Merge pull request #1 from patreu22/android-fix
patreu22 Jan 27, 2023
28214d5
Merge pull request #1 from patreu22/master
claudius-kienle Feb 24, 2023
35a7a56
added testing_mode environment variable
claudius-kienle Oct 14, 2023
c78a7e0
added pixel 5
claudius-kienle Oct 14, 2023
baa6d65
fix ios
claudius-kienle Oct 14, 2023
2da96da
updated ios
claudius-kienle Oct 14, 2023
d69f2c6
update to dart 3
Mar 19, 2024
9ec5e74
ignore .flutter-plugins-dependencies
Mar 19, 2024
b1402c5
disable fake_process_manager
Mar 19, 2024
c1855d7
try to fix renaming bug if directories are on different filesystems
Mar 21, 2024
46998aa
accelerometer_rotation must be disabled before user_rotation is working
Mar 21, 2024
e881b32
migrated to flutter 3.19.6
claudius-kienle May 1, 2024
e083a80
Merge branch 'master' into master
claudius-kienle Jun 22, 2024
1a14c95
Merge pull request #2 from meltzow/master
claudius-kienle Jun 22, 2024
f1bfe5c
added new navbar
claudius-kienle Jun 22, 2024
4249922
added flutterDriveArgs to config
claudius-kienle Jul 3, 2024
cc79dd7
updated
claudius-kienle May 29, 2025
5c0f3e1
fix emulator for android
claudius-kienle Aug 16, 2025
772b533
update build version
claudius-kienle Dec 15, 2025
81cd5ea
updated build version
claudius-kienle Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
.idea/
*.iml

# VSCode
.vscode/

# Flutter
/android
/ios
Expand All @@ -31,3 +34,4 @@ example/android/fastlane
# code coverage
coverage/
bin/*.exe
.flutter-plugins*
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,12 @@ _Screenshots_ uses a configuration file to configure a run.
The default config filename is `screenshots.yaml`:
````yaml
# A list of screen capture tests
driver: test_driver/integration_test.dart

tests:
# Note: flutter driver expects a pair of files eg, main1.dart and main1_test.dart
- test_driver/main1.dart
- test_driver/main2.dart
- integration_test/main1.dart
- integration_test/main2.dart

# Interim location of screenshots from tests
staging: /tmp/screenshots
Expand Down Expand Up @@ -242,8 +244,8 @@ _orientation_ parameter notes:
In addition to using the default flutter driver mode, tests can also be specified using flutter driver parameters. For example:
```
tests:
- --target=test_driver/main1.dart --driver=test_driver/main1_test1.dart
- --target=test_driver/main2.dart --driver=test_driver/main2_test1.dart
- --target=integration_test/main1.dart --driver=test_driver/main1_test1.dart
- --target=integration_test/main2.dart --driver=test_driver/main2_test1.dart
```

# Record/Compare Mode
Expand Down
22 changes: 22 additions & 0 deletions example/integration_test/main_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:example/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:screenshots/src/capture_screen.dart';

void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets("end-to-end test", (WidgetTester tester) async {
runApp(const MyApp());

await tester.pumpAndSettle();

await screenshot(binding, tester, '0');

await tester.tap(find.text('1'));
await tester.pumpAndSettle();

await screenshot(binding, tester, '1');
});
}
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
41 changes: 41 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# 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
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
13 changes: 3 additions & 10 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.17.0
intl: ^0.18.1

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand All @@ -40,9 +40,10 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter

flutter_driver:
sdk: flutter
integration_test:
sdk: flutter

test: ^1.17.0

Expand All @@ -55,14 +56,6 @@ dev_dependencies:

screenshots:
path: ..
tool_mobile:
tool_base:

dependency_overrides:
tool_mobile:
path: ../../tool_mobile
tool_base:
path: ../../tool_base

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
8 changes: 5 additions & 3 deletions example/screenshots.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Screen capture tests
# Note: flutter driver expects a pair of files eg, main.dart and main_test.dart
driver: test_driver/integration_test.dart

tests:
- test_driver/main.dart
- integration_test/main_test.dart

# Interim location of screenshots from tests before processing
staging: /tmp/screenshots
Expand Down Expand Up @@ -30,9 +32,9 @@ frame: true
# Run mode can be one of 'normal' (default), 'recording', 'comparison' or 'archive'.

# If run mode is 'recording' or 'comparison', a directory is required for recorded images.
recording: /tmp/screenshots_record
# recording: /tmp/screenshots_record

# If not intending to upload screenshots, images can be stored in an archive dir.
# This over-rides output to fastlane dirs.
# If run mode is 'archive', a directory is required for archived images.
archive: /tmp/screenshots_archive
# archive: /tmp/screenshots_archive
10 changes: 6 additions & 4 deletions example/screenshots_android.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Screen capture tests
# Note: flutter driver expects a pair of files eg, main.dart and main_test.dart
driver: test_driver/integration_test.dart

tests:
- test_driver/main.dart
- integration_test/main_test.dart

# Interim location of screenshots from tests before processing
staging: /tmp/screenshots
Expand All @@ -15,9 +17,9 @@ locales:
devices:
android:
Nexus 6P:
orientation:
- Portrait
- LandscapeRight
# orientation:
# - Portrait
# - LandscapeRight

# Frame screenshots
frame: true
9 changes: 9 additions & 0 deletions example/test_driver/integration_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'package:integration_test/integration_test_driver_extended.dart';
import 'package:screenshots/src/screenshot_handler.dart';

Future<void> main() async {
await integrationDriver(
onScreenshot: (String screenshotName, List<int> screenshotBytes,
[args]) async =>
screenshotHandler(screenshotName, screenshotBytes));
}
28 changes: 0 additions & 28 deletions example/test_driver/main.dart

This file was deleted.

56 changes: 0 additions & 56 deletions example/test_driver/main_test.dart

This file was deleted.

3 changes: 2 additions & 1 deletion flavors/test_driver/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'package:flavors/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_driver/driver_extension.dart';

import '../lib/main.dart';

void main() {
enableFlutterDriverExtension();
runApp(Center(child: Flavor()));
Expand Down
6 changes: 5 additions & 1 deletion lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ void main() async {

print(code);

await File("lib/generated/screens/screens.dart").writeAsString(code);
final screens = File("lib/generated/screens/screens.dart");
if (!await screens.exists()) {
await screens.create(recursive: true);
}
await screens.writeAsString(code);
}

Future<String> generateScreens(File file) async {
Expand Down
Loading