Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
55 changes: 55 additions & 0 deletions .maestro/pull_2117.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
appId: com.example.example
name: Pull 2117 (swiping from -> to)
---
- tapOn:
text: Swipe Test (from_to)
- assertVisible:
text: "Selected: Item 1"
- swipe:
from:
id: "scrollWheel"
to: 50%, 47% # x, y
- assertVisible:
text: "Selected: Item 2"
- swipe:
from:
id: "scrollWheel"
to: 50%, 47% # x, y
- assertVisible:
text: "Selected: Item 3"
- swipe:
from:
id: "scrollWheel"
to: 50%, 47% # x, y
- assertVisible:
text: "Selected: Item 4"
- swipe:
from:
id: "scrollWheel"
to: 50%, 47% # x, y
- assertVisible:
text: "Selected: Item 5"
- swipe:
from:
id: "scrollWheel"
to: 50%, 58% # x, y
- assertVisible:
text: "Selected: Item 4"
- swipe:
from:
id: "scrollWheel"
to: 50%, 58% # x, y
- assertVisible:
text: "Selected: Item 3"
- swipe:
from:
id: "scrollWheel"
to: 50%, 58% # x, y
- assertVisible:
text: "Selected: Item 2"
- swipe:
from:
id: "scrollWheel"
to: 50%, 58% # x, y
- assertVisible:
text: "Selected: Item 1"
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ and runs flows in the [e2e/workspaces/demo_app][workspace] workspace (among othe

[workspace]: https://github.com/mobile-dev-inc/maestro/tree/main/e2e/workspaces/demo_app
[manifest]: https://github.com/mobile-dev-inc/maestro/blob/main/e2e/manifest.txt


### Up and Running

1. `brew install flutter` (or follow [the official guide](https://docs.flutter.dev/get-started/install/macos/mobile-ios#install-the-flutter-sdk))
2. Get dependencies: `flutter pub get`
3. Build android: `flutter build apk`
4. Build ios: `flutter build ios --debug --simulator`
5. Build ios and launch in simulator: `flutter run`
6. Maestro tests are found under [.maestro](.maestro)
2 changes: 1 addition & 1 deletion android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
android {
namespace = "com.example.example"
compileSdk = flutter.compileSdkVersion
ndkVersion = "26.1.10909125"
ndkVersion = "26.3.11579264"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
3 changes: 3 additions & 0 deletions ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
Expand Down Expand Up @@ -54,11 +55,13 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
9 changes: 9 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:demo_app/input_screen.dart';
import 'package:demo_app/issue_1619_repro.dart';
import 'package:demo_app/issue_1677_repro.dart';
import 'package:demo_app/nesting_screen.dart';
import 'package:demo_app/swiping_screen_from_to.dart';
import 'package:demo_app/swiping_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down Expand Up @@ -100,6 +101,14 @@ class _MyHomePageState extends State<MyHomePage> {
},
child: const Text('Swipe Test'),
),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const SwipingScreenFromTo()),
);
},
child: const Text('Swipe Test (from_to)'),
),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
Expand Down
80 changes: 80 additions & 0 deletions lib/swiping_screen_from_to.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

class SwipingScreenFromTo extends StatefulWidget {
const SwipingScreenFromTo({super.key});

@override
State<SwipingScreenFromTo> createState() => _SwipingScreenFromToState();
}

class _SwipingScreenFromToState extends State<SwipingScreenFromTo> {
int selectedIndex = 0;
final List<String> items = ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5'];

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
body: SafeArea(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => Navigator.of(context).pop(),
),
const SizedBox(width: 16),
Text(
'Select an Item',
style: Theme.of(context).textTheme.headlineSmall,
),
],
),
),
Expanded(
child: Center(
child: Container(
height: 200,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(16),
),
child: Semantics(
identifier: 'scrollWheel',
child: CupertinoPicker(
itemExtent: 40,
onSelectedItemChanged: (int index) {
setState(() {
selectedIndex = index;
});
},
children: items.map((String item) {
return Center(
child: Text(
item,
style: const TextStyle(fontSize: 20),
),
);
}).toList(),
),
),
),
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Selected: ${items[selectedIndex]}',
style: Theme.of(context).textTheme.titleLarge,
),
),
],
),
),
);
}
}
Loading