-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add basic integration test (#979)
- Loading branch information
Showing
5 changed files
with
125 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,72 @@ jobs: | |
files: ./coverage/lcov.info | ||
flags: appainter | ||
|
||
integration-test: | ||
name: Integration test | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
type: [macos, windows, linux] | ||
include: | ||
- type: macos | ||
os: macos-latest | ||
|
||
- type: windows | ||
os: windows-latest | ||
|
||
- type: linux | ||
os: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: Get project Flutter version 🏷️ | ||
id: fvm-config | ||
uses: kuhnroyal/[email protected] | ||
|
||
- name: Setup Flutter 💻 | ||
uses: subosito/[email protected] | ||
id: setup-flutter | ||
with: | ||
flutter-version: ${{ steps.fvm-config.outputs.FLUTTER_VERSION }} | ||
cache: true | ||
cache-key: ${{ runner.os }}-flutter-${{ steps.fvm-config.outputs.FLUTTER_VERSION }}-${{ hashFiles('**/pubspec.lock') }} | ||
|
||
- name: Cache Pub 💾 | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ env.PUB_CACHE }} | ||
**/.dart_tool | ||
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pub- | ||
- name: Patch for Linux build 🩹 | ||
if: ${{ matrix.type == 'linux' }} | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y ninja-build libgtk-3-dev | ||
- name: Write Google service info file for MacOS 📝 | ||
if: ${{ matrix.type == 'macos' }} | ||
run: printf "${{ secrets.GOOGLE_SERVICE_INFO_MACOS }}" > macos/Runner/GoogleService-Info.plist | ||
|
||
- name: Run tests 🧪 | ||
shell: bash | ||
run: | | ||
flutter pub get | ||
flutter pub run build_runner build --delete-conflicting-outputs | ||
flutter build ${{ matrix.type }} --no-tree-shake-icons --target=integration_test/app_test.dart | ||
if [ "${{ matrix.type }}" == "linux" ]; then | ||
xvfb-run flutter test integration_test -d ${{ matrix.type }} | ||
else | ||
flutter test integration_test -d ${{ matrix.type }} | ||
fi | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:appainter/basic_theme/basic_theme.dart'; | ||
import 'package:appainter/main.dart' as app; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('end-to-end test', () { | ||
testWidgets('render correctly', (tester) async { | ||
await tester.binding.setSurfaceSize(const Size(2400, 850)); | ||
await app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.byType(BasicThemeEditor), findsOneWidget); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters