Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.35.7"
}
1 change: 0 additions & 1 deletion .github/workflows/.env

This file was deleted.

15 changes: 7 additions & 8 deletions .github/workflows/publish-to-pub-on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: dart-lang/setup-dart@v1

- id: dotenv
uses: falti/dotenv-action@v0.2.8
with:
path: .github/workflows/.env
- id: fvm
name: Read pinned Flutter version from .fvmrc
run: echo "flutter_version=$(jq -r .flutter "$GITHUB_WORKSPACE/.fvmrc")" >> "$GITHUB_OUTPUT"

- uses: subosito/flutter-action@v2.5.0
with:
flutter-version: ${{ steps.dotenv.outputs.flutter_version }}
flutter-version: ${{ steps.fvm.outputs.flutter_version }}
channel: "stable"
cache: true
cache-key: flutter-macos-${{ steps.dotenv.outputs.flutter_version }}
cache-path: ${{ runner.tool_cache }}/flutter-${{ steps.dotenv.outputs.flutter_version }}
cache-key: flutter-macos-${{ steps.fvm.outputs.flutter_version }}
cache-path: ${{ runner.tool_cache }}/flutter-${{ steps.fvm.outputs.flutter_version }}

- name: Install Dependencies
run: flutter pub get
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/test-flutter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ jobs:
test:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- dir: .
name: package
- dir: example/simple_app
name: simple_app
- dir: example/multi_packages_app/app
Expand All @@ -23,20 +26,19 @@ jobs:
working-directory: ${{ matrix.dir }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- id: dotenv
uses: falti/dotenv-action@v0.2.8
with:
path: .github/workflows/.env
- id: fvm
name: Read pinned Flutter version from .fvmrc
run: echo "flutter_version=$(jq -r .flutter "$GITHUB_WORKSPACE/.fvmrc")" >> "$GITHUB_OUTPUT"

- uses: subosito/flutter-action@v2.5.0
with:
flutter-version: ${{ steps.dotenv.outputs.flutter_version }}
flutter-version: ${{ steps.fvm.outputs.flutter_version }}
channel: "stable"
cache: true
cache-key: flutter-macos-${{ steps.dotenv.outputs.flutter_version }}
cache-path: ${{ runner.tool_cache }}/flutter-${{ steps.dotenv.outputs.flutter_version }}
cache-key: flutter-macos-${{ steps.fvm.outputs.flutter_version }}
cache-path: ${{ runner.tool_cache }}/flutter-${{ steps.fvm.outputs.flutter_version }}

- name: Install Dependencies
run: flutter packages get
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/update-goldens.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Format and update goldens
on:
workflow_dispatch:

permissions:
contents: write

jobs:
update:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- id: dotenv
uses: falti/dotenv-action@v0.2.8
with:
path: .github/workflows/.env

- uses: subosito/flutter-action@v2.5.0
with:
flutter-version: ${{ steps.dotenv.outputs.flutter_version }}
channel: "stable"
cache: true
cache-key: flutter-macos-${{ steps.dotenv.outputs.flutter_version }}
cache-path: ${{ runner.tool_cache }}/flutter-${{ steps.dotenv.outputs.flutter_version }}

- name: Format
run: dart format lib test example

- name: Regenerate goldens
run: |
for dir in example/simple_app example/multi_packages_app/app example/multi_packages_app/theme; do
(cd "$dir" && flutter pub get && flutter test --update-goldens)
done

- name: Commit goldens
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A lib test example
git diff --cached --quiet || git commit -m "chore: format and update goldens"
git push
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ migrate_working_dir/
.dart_tool/
.packages
build/

# FVM Version Cache
.fvm/
3 changes: 3 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ doc/example.png

example/test/**/preview/

# FVM
.fvm/
.fvmrc
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dart.flutterSdkPath": ".fvm/versions/3.35.7"
}
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
## 0.11.0

First release as `adaptive_test_plus`, a drop-in compatible continuation of
`adaptive_test` 0.10.4. Golden file paths and existing APIs are unchanged.

- feat: `testAdaptiveThemedWidgets` runs each device in light and dark mode and
sets the platform brightness accordingly.
- feat: `AdaptiveTestConfiguration.themedDeviceVariant`.
- feat: `WindowConfigData.light()`, `dark()`, `withThemeMode()`.
- feat: localized goldens with `setLocalizedDeviceVariants`,
`WindowConfigData.locale` and `withLocale()`. The locale is applied to the
test platform dispatcher.
- feat: `setApplyThemeModeToPlatformBrightness` (opt-in) for
`testAdaptiveWidgets`.
- feat: `setGoldenFileNameFactory` with `GoldenFileNameFactories.flat`
(default) and `GoldenFileNameFactories.nested`.
- feat: `setCustomDescribeValue` to customize test descriptions.
- feat: `setSkipGoldenAssertion` to skip adaptive tests conditionally.
- feat: `expectGolden(onDeviceSetup: ...)` hook.
- feat: `awaitImages` waits for images appearing after other images loaded
(`maxPasses`).
- fix: `ViewPaddingImpl` value equality, so identical `WindowConfigData` are
equal.
- chore: rename package to `adaptive_test_plus`.
`package:adaptive_test_plus/adaptive_test.dart` is kept as an alias entry
point.
- chore: widen `cupertino_icons` constraint to `>=1.0.5 <3.0.0` to allow cupertino_icons 2.x.
- chore: widen `equatable` constraint to `>=2.0.5 <4.0.0` to allow equatable 3.x.
- chore: widen `package_config` constraint to `>=2.1.0 <4.0.0` to allow package_config 3.x.

## 0.10.4

- fix: catch flaky offstage widget finder errors in awaitImages
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright 2022 BAM
Copyright 2026 monawebapp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 49 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Uses the FVM-pinned Flutter when FVM is installed, the global one otherwise.
# Override with e.g. `make test FLUTTER=flutter DART=dart`.
ifneq ($(shell command -v fvm 2>/dev/null),)
FLUTTER ?= fvm flutter
DART ?= fvm dart
else
FLUTTER ?= flutter
DART ?= dart
endif

PACKAGES := . \
example/simple_app \
example/multi_packages_app/app \
example/multi_packages_app/theme

.PHONY: full-checks analyze test gen-golden deps

## Run analyze then test on the package and all example apps.
full-checks: analyze test

## Fetch dependencies for the package and all example apps.
deps:
@set -e; for pkg in $(PACKAGES); do \
echo "==> pub get: $$pkg"; \
(cd $$pkg && $(FLUTTER) pub get); \
done

## Check formatting and run the analyzer on the package and all example apps.
analyze: deps
@set -e; for pkg in $(PACKAGES); do \
echo "==> format: $$pkg"; \
(cd $$pkg && $(DART) format --set-exit-if-changed lib test); \
echo "==> analyze: $$pkg"; \
(cd $$pkg && $(FLUTTER) analyze --no-pub lib test); \
done

## Run the tests (including goldens) of the package and all example apps.
test: deps
@set -e; for pkg in $(PACKAGES); do \
echo "==> test: $$pkg"; \
(cd $$pkg && $(FLUTTER) test --no-pub --test-randomize-ordering-seed random); \
done

## Regenerate the golden files of the package and all example apps.
gen-golden: deps
@set -e; for pkg in $(PACKAGES); do \
echo "==> update goldens: $$pkg"; \
(cd $$pkg && $(FLUTTER) test --no-pub --update-goldens); \
done
Loading