Skip to content

Commit

Permalink
more clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Nov 24, 2023
1 parent 64b2786 commit f391663
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 107 deletions.
4 changes: 2 additions & 2 deletions dev/e2e_app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdk 33
namespace "pl.leancode.patrol.example"
namespace "pl.leancode.patrol.e2e_app"

kotlinOptions {
jvmTarget = "1.8"
Expand All @@ -38,7 +38,7 @@ android {
}

defaultConfig {
applicationId "pl.leancode.patrol.example"
applicationId "pl.leancode.patrol.e2e_app"
minSdk 21
targetSdk 33
versionCode flutterVersionCode.toInteger()
Expand Down
2 changes: 1 addition & 1 deletion dev/e2e_app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="pl.leancode.patrol.example">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Expand Down
2 changes: 1 addition & 1 deletion dev/e2e_app/integration_test/common.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:e2e_app/main.dart' as app_main;
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';
import 'package:patrol_example/main.dart' as app_main;

export 'package:flutter_test/flutter_test.dart';
export 'package:patrol/patrol.dart';
Expand Down
14 changes: 7 additions & 7 deletions dev/e2e_app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:e2e_app/loading_screen.dart';
import 'package:e2e_app/location_screen.dart';
import 'package:e2e_app/notifications_screen.dart';
import 'package:e2e_app/overlay_screen.dart';
import 'package:e2e_app/permissions_screen.dart';
import 'package:e2e_app/scrolling_screen.dart';
import 'package:e2e_app/webview_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_timezone/flutter_timezone.dart';
import 'package:patrol_example/loading_screen.dart';
import 'package:patrol_example/location_screen.dart';
import 'package:patrol_example/notifications_screen.dart';
import 'package:patrol_example/overlay_screen.dart';
import 'package:patrol_example/permissions_screen.dart';
import 'package:patrol_example/scrolling_screen.dart';
import 'package:patrol_example/webview_screen.dart';
import 'package:timezone/data/latest.dart' as tz_data;
import 'package:timezone/timezone.dart' as tz;

Expand Down
2 changes: 1 addition & 1 deletion dev/e2e_app/lib/scrolling_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:e2e_app/keys.dart';
import 'package:flutter/material.dart';
import 'package:patrol_example/keys.dart';

class ScrollingScreen extends StatelessWidget {
const ScrollingScreen({super.key});
Expand Down
4 changes: 2 additions & 2 deletions dev/e2e_app/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: example
name: e2e_app
description: A new Flutter project.
publish_to: none
version: 1.0.0+1
Expand Down Expand Up @@ -31,6 +31,6 @@ flutter:
patrol:
app_name: Patrol example
android:
package_name: pl.leancode.patrol.example
package_name: pl.leancode.patrol.e2e_app
ios:
bundle_id: pl.leancode.patrol.Example
18 changes: 0 additions & 18 deletions packages/patrol/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ android {
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: "true"
}
Expand All @@ -61,26 +60,9 @@ android {

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}

flavorDimensions "default"

productFlavors {
dev {
dimension "default"
resValue "string", "app_name", "DEV Challenge"
applicationIdSuffix ".dev"
}

prod {
dimension "default"
resValue "string", "app_name", "Challenge"
}
}
}

flutter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:label="@string/app_name"
android:label="Patrol example"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
<activity
Expand Down
71 changes: 0 additions & 71 deletions packages/patrol/example/integration_test/done_test.dart

This file was deleted.

65 changes: 65 additions & 0 deletions packages/patrol/example/integration_test/main_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';
import 'package:patrol_challenge/main.dart';
import 'package:patrol_challenge/pages/quiz/form_page.dart';
import 'package:patrol_challenge/ui/components/button/elevated_button.dart';
import 'package:patrol_challenge/ui/style/colors.dart';

void main() {
patrolTest('main flow', ($) async {
await $.pumpWidgetAndSettle(const MyApp());

await $('Go to the quiz').tap();

await $('Start').tap();

await $(TextField).enterText('text');

final colors = [PTColors.lcYellow, PTColors.lcBlack, PTColors.lcWhite];

for (final color in colors) {
await $(SelectableBox)
.which<SelectableBox>((box) => box.color == color)
.scrollTo()
.tap();
}

await $('Ready!').tap();

// Why doesn't it work?
// await $(ElevatedButton).$(Center).$('Fluttercon').tap();

await $(PTElevatedButton)
.which<PTElevatedButton>((widget) => widget.caption == 'Fluttercon')
.tap();

await $(ListTile).containing($(Icons.flutter_dash)).$('click').tap();

await $(ElevatedButton)
.which<ElevatedButton>(
(widget) => widget.enabled,
)
.at(2)
.scrollTo()
.tap();

if (await $.native.isPermissionDialogVisible()) {
await $.native.grantPermissionWhenInUse();
}

await $.native.pressHome();
await $.native.openNotifications();

// wait for notification to show up
await Future<void>.delayed(const Duration(seconds: 5));

await $.native.openNotifications();

await $.native.tapOnNotificationByIndex(0);

await $.pumpAndSettle();

expect($('Congratulations!'), findsOneWidget);
});
}
6 changes: 3 additions & 3 deletions packages/patrol/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ dev_dependencies:
flutter_test:
sdk: flutter
leancode_lint: ^6.0.0
patrol: ^2.3.1
patrol:
path: ..

flutter_launcher_icons:
android: 'launcher_icon'
Expand Down Expand Up @@ -60,8 +61,7 @@ flutter:
weight: 600

patrol:
flavor: dev
android:
package_name: com.example.patrol_challenge
ios:
bundle_id: pl.leancode.patrol.challenge.dev
bundle_id: pl.leancode.patrol.challenge

0 comments on commit f391663

Please sign in to comment.