Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

chore: initialize integration test using uuv_flutter, #3 #11

Merged
merged 1 commit into from
Mar 3, 2024
Merged
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
50 changes: 39 additions & 11 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,46 @@ on:

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Build apk
run: flutter build apk --debug
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app_debug
path: build/app/outputs/flutter-apk/app-debug.apk

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [ 34 ]
target: [ playstore ]
needs: [ build ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Build apk
run: flutter build apk --debug
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app_debug
path: build/app/outputs/flutter-apk/app-debug.apk
- name: Retrieve dependencies
run: dart pub get
- name: Generate tests
run: dart run build_runner build --delete-conflicting-outputs
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run Flutter Driver tests
uses: reactivecircus/android-emulator-runner@v2
with:
target: ${{ matrix.target }}
api-level: ${{ matrix.api-level }}
arch: x86_64
profile: Nexus 6
script: flutter test integration_test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
integration_test/*_test.dart
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ To retrieve <your-wsl-ip> execute the following command from your wsl machine :
ip add | grep "eth0
```

### Generating translation
### Generate translation
```shell
flutter clean
flutter pub get
```
```

### Generate integration tests
```shell
dart run build_runner build --delete-conflicting-outputs
```

### Run integration tests
```shell
flutter test integration_test
```
9 changes: 8 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
targets:
$default:
sources:
- integration_test/** # By default, build runner will not generate code in the integration folder
- test/** # so we override paths for code generation here
- lib/**
- $package$
builders:
bdd_widget_test|featureBuilder:
enabled: false
uuv_flutter|generateTests:
options:
enabled: true
13 changes: 13 additions & 0 deletions integration_test/panoramax.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Panoramax mobile App

Scenario: Homepage
Given the app is running
Then I should see a title named {'Your sequences'}
And I should see a button named {'Create a new sequence'}

Scenario: Capture page
Given the app is running
When I tap on a button named {'Create a new sequence'}
Then I should see a button named {'Take a picture'}
And I should see a button named {'Switch camera'}
And I should see a button named {'Create a new sequence with captured pictures'}
6 changes: 6 additions & 0 deletions integration_test/step/the_app_is_running.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:panoramax_mobile/main.dart';

Future<void> theAppIsRunning(WidgetTester tester) async {
await tester.pumpWidget(const PanoramaxApp());
}
95 changes: 87 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.2"
bdd_widget_test:
dependency: transitive
description:
name: bdd_widget_test
sha256: a5acecd2eed66c12cb20fae0f664b64a35c82dd7cc103c15da6d460a62821112
url: "https://pub.dev"
source: hosted
version: "1.6.4"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -213,10 +221,10 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76"
sha256: "595a29b55ce82d53398e1bcc2cba525d7bd7c59faeb2d2540e9d42c390cfeeeb"
url: "https://pub.dev"
source: hosted
version: "1.7.2"
version: "1.6.4"
cross_file:
dependency: transitive
description:
Expand Down Expand Up @@ -249,6 +257,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.2"
diacritic:
dependency: transitive
description:
name: diacritic
sha256: "96db5db6149cbe4aa3cfcbfd170aca9b7648639be7e48025f9d458517f807fe4"
url: "https://pub.dev"
source: hosted
version: "0.1.5"
equatable:
dependency: "direct main"
description:
Expand Down Expand Up @@ -277,10 +293,10 @@ packages:
dependency: transitive
description:
name: file
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
version: "6.1.4"
fixnum:
dependency: transitive
description:
Expand All @@ -294,6 +310,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_driver:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_exif_plugin:
dependency: "direct main"
description:
Expand All @@ -302,6 +323,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
flutter_finder_usercentric:
dependency: transitive
description:
name: flutter_finder_usercentric
sha256: "7005c1230fa6d1b7b186cb32769eaaf21b497c980671973540190667d63931a9"
url: "https://pub.dev"
source: hosted
version: "0.0.1-beta"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -349,6 +378,11 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.0"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
geolocator:
dependency: "direct main"
description:
Expand Down Expand Up @@ -453,6 +487,11 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.2"
integration_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
intl:
dependency: "direct main"
description:
Expand Down Expand Up @@ -621,6 +660,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.1"
patrol_finders:
dependency: transitive
description:
name: patrol_finders
sha256: ac33527cc1b63e3aa131dbd7107cfda8ee2df0fb4a4a423c067174a2e60db77b
url: "https://pub.dev"
source: hosted
version: "2.0.2"
permission_handler:
dependency: "direct main"
description:
Expand Down Expand Up @@ -673,10 +720,10 @@ packages:
dependency: transitive
description:
name: platform
sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
url: "https://pub.dev"
source: hosted
version: "3.1.3"
version: "3.1.2"
plugin_platform_interface:
dependency: transitive
description:
Expand All @@ -693,6 +740,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.5.1"
process:
dependency: transitive
description:
name: process
sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09"
url: "https://pub.dev"
source: hosted
version: "4.2.4"
pub_semver:
dependency: transitive
description:
Expand Down Expand Up @@ -882,6 +937,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
sync_http:
dependency: transitive
description:
name: sync_http
sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
term_glyph:
dependency: transitive
description:
Expand Down Expand Up @@ -938,6 +1001,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.3.3"
uuv_flutter:
dependency: "direct dev"
description:
name: uuv_flutter
sha256: f12e43346b04d86d341c589c9af52e826d7183fe8bbf9ab8c0878002bc1027dd
url: "https://pub.dev"
source: hosted
version: "0.0.1-beta.1"
vector_math:
dependency: transitive
description:
Expand All @@ -950,10 +1021,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "11.10.0"
watcher:
dependency: transitive
description:
Expand All @@ -978,6 +1049,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.4.0"
webdriver:
dependency: transitive
description:
name: webdriver
sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
webkit_inspection_protocol:
dependency: transitive
description:
Expand Down
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
integration_test:
sdk: flutter
test: ^1.3.0
build_runner: ^2.4.7
uuv_flutter: ^0.0.1-beta.1


# The "flutter_lints" package below contains a set of recommended lints to
Expand Down