Merge pull request #18 from koji-1009/refactor/test

chore: Integration test on Web
This commit is contained in:
Koji Wakamiya 2025-12-14 13:20:34 +09:00 committed by GitHub
commit 392b07c76f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 11 deletions

View File

@ -8,13 +8,14 @@ on:
jobs: jobs:
drive_android: drive_android:
name: Android
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
permissions: permissions:
contents: read contents: read
strategy: strategy:
matrix: matrix:
api-level: [29, 35] api-level: [29]
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@ -41,12 +42,12 @@ jobs:
drive_ios: drive_ios:
name: iOS name: iOS
runs-on: macos-latest runs-on: macos-latest
timeout-minutes: 25 timeout-minutes: 20
permissions: permissions:
contents: read contents: read
strategy: strategy:
matrix: matrix:
simulator: [{os: "18.6", model: "iPhone SE (3rd generation)"}, {os: "26.1", model: "iPhone SE (3rd generation)"}] simulator: [{os: "18.6", model: "iPhone SE (3rd generation)"}]
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@ -82,3 +83,23 @@ jobs:
- name: Run Flutter Integration tests - name: Run Flutter Integration tests
working-directory: example working-directory: example
run: flutter test integration_test -d macos run: flutter test integration_test -d macos
drive_web:
name: Web
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0
with:
channel: stable
cache: true
- name: Setup chromedriver
run: |
npx @puppeteer/browsers install chromedriver@stable
chromedriver --port=4444 &
- name: Run Flutter Integration tests
working-directory: example
run: flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d web-server \

View File

@ -1,10 +1,9 @@
import 'package:flutter/foundation.dart' import 'package:flutter/foundation.dart';
show kIsWeb, defaultTargetPlatform, TargetPlatform;
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:image/image.dart' as img;
import 'package:integration_test/integration_test.dart'; import 'package:integration_test/integration_test.dart';
import 'package:platform_image_converter/platform_image_converter.dart'; import 'package:platform_image_converter/platform_image_converter.dart';
import 'package:image/image.dart' as img;
void main() { void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@ -281,7 +280,7 @@ void main() {
quality: 100, quality: 100,
), ),
throwsA(isA<UnsupportedError>()), throwsA(isA<UnsupportedError>()),
reason: 'WebP output is only supported on Android', reason: 'WebP output is only supported on Android and Web.',
); );
} }
}); });
@ -318,7 +317,7 @@ void main() {
quality: 50, quality: 50,
), ),
throwsA(isA<UnsupportedError>()), throwsA(isA<UnsupportedError>()),
reason: 'WebP output is only supported on Android', reason: 'WebP output is only supported on Android and Web.',
); );
} }
}, },
@ -373,7 +372,7 @@ void main() {
quality: 100, quality: 100,
), ),
throwsA(isA<UnsupportedError>()), throwsA(isA<UnsupportedError>()),
reason: 'WebP output is only supported on Android', reason: 'WebP output is only supported on Android and Web.',
); );
} }
}); });
@ -415,7 +414,7 @@ void main() {
format: OutputFormat.webp, format: OutputFormat.webp,
), ),
throwsA(isA<UnsupportedError>()), throwsA(isA<UnsupportedError>()),
reason: 'WebP output should be unsupported on Web, iOS, and macOS', reason: 'WebP output is not supported on this platform.',
); );
} }
}); });

View File

@ -1,3 +1,5 @@
import 'package:integration_test/integration_test_driver.dart'; import 'package:integration_test/integration_test_driver.dart';
Future<void> main() => integrationDriver(); void main() async {
await integrationDriver();
}