Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement native scrollTo for iOS #2343

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 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
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test_linux_task:
kvm: "true"
env:
PATH: $HOME/.pub-cache/bin:$HOME/fvm/default/bin:$CIRRUS_WORKING_DIR/fvm:${PATH}
FLUTTER_VERSION: "3.22.0"
FLUTTER_VERSION: "3.24.0"
EMULATOR_API_LEVEL: "34"
EMULATOR_ABI: google_apis_playstore;x86_64
EMULATOR_IMAGE: system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_ABI}
Expand Down Expand Up @@ -66,7 +66,7 @@ test_macos_task:
image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
env:
PATH: $HOME/.pub-cache/bin:$HOME/fvm/default/bin:${PATH}
FLUTTER_VERSION: "3.22.0"
FLUTTER_VERSION: "3.24.0"
timeout_in: 30m

set_up_fvm_script: |
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/check-semver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
name: Check semver
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
flutter-version: ['3.24.x']
flutter-channel: ['stable']

steps:
- name: Clone repository
uses: actions/checkout@v4
Expand All @@ -24,10 +30,11 @@ jobs:
echo "last_version=$last_version" >> $GITHUB_ENV
echo "::set-output name=last_version::$last_version"

- name: Set up Dart
uses: dart-lang/setup-dart@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
sdk: stable
flutter-version: ${{ matrix.flutter-version }}
channel: ${{ matrix.flutter-channel }}

- name: Install dart-apitool
run: dart pub global activate dart_apitool
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/patrol-prepare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-13]
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/patrol-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/patrol_devtools_extension-prepare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/patrol_finders-prepare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/patrol_finders-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prepare-e2e_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-13]
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']

defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-android-device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']
os: ['Android API']
include:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ios-device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']
device_model: ['iphone14pro']
os_version: ['16.6']
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ios-simulator-webview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ["3.22.x"]
flutter-version: ["3.24.x"]
flutter-channel: ["stable"]
device_model: [iPhone 14]
os: [iOS]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ios-simulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ["3.22.x"]
flutter-version: ["3.24.x"]
flutter-channel: ["stable"]
device_model:
[iPhone SE (3rd generation), iPhone 14, iPad (10th generation)]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.22.x']
flutter-version: ['3.24.x']
flutter-channel: ['stable']
device_model: [macOS]
os: [macOS]
Expand Down
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 @@ -23,7 +23,7 @@ if (flutterVersionName == null) {
}

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

kotlinOptions {
Expand All @@ -36,7 +36,7 @@ android {

defaultConfig {
applicationId "pl.leancode.patrol.e2e_app"
minSdk 21
minSdk 24
targetSdk 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
49 changes: 23 additions & 26 deletions dev/e2e_app/integration_test/webview_leancode_test.dart
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
import 'dart:io' as io;

import 'common.dart';

void main() {
patrol('interacts with the LeanCode website in a webview', ($) async {
await createApp($);

await $('Open webview (LeanCode)').scrollTo().tap();
await $.pump(Duration(seconds: 8));

try {
await $.native.tap(Selector(text: 'Accept cookies'));
} on PatrolActionException catch (_) {
// ignore
}
await $.pumpAndSettle();

await $.native.enterTextByIndex(
'test@leancode.pl',
index: 0,
keyboardBehavior: KeyboardBehavior.showAndDismiss,
);
await $.native.tap(Selector(text: 'Subscribe'));
});

patrol('interacts with the LeanCode website in a webview native2', ($) async {
await createApp($);

Expand All @@ -32,20 +13,36 @@ void main() {
try {
await $.native2.tap(
NativeSelector(
android: AndroidSelector(text: 'Accept cookies'),
ios: IOSSelector(label: 'Accept cookies'),
android: AndroidSelector(text: 'ACCEPT ALL COOKIES'),
ios: IOSSelector(label: 'ACCEPT ALL COOKIES'),
),
);
} on PatrolActionException catch (_) {
// ignore
}
await $.pumpAndSettle();

await $.native2.enterTextByIndex(
'test@leancode.pl',
index: 0,
if (io.Platform.isIOS) {
await $.native2.scrollTo(
NativeSelector(
ios: IOSSelector(placeholderValue: 'Type your email'),
),
maxScrolls: 20,
);
}

await $.pump(Duration(seconds: 5));

await $.native2.enterText(
NativeSelector(
android: AndroidSelector(className: 'android.widget.EditText'),
ios: IOSSelector(placeholderValue: 'Type your email'),
),
text: 'test@leancode.pl',
keyboardBehavior: KeyboardBehavior.showAndDismiss,
tapLocation: Offset(0.5, 0.5),
);

await $.native2.tap(
NativeSelector(
android: AndroidSelector(text: 'Subscribe'),
Expand Down
12 changes: 12 additions & 0 deletions dev/e2e_app/integration_test/webview_stackoverflow_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ void main() {

// bug: using `Email` and `Password` selectors doesn't work (#1554)
await $.native.enterTextByIndex('test@leancode.pl', index: 0);

await $.native.swipe(
from: Offset(0.5, 0.5),
to: Offset(0.5, 0.1),
);

await $.native.enterTextByIndex('ny4ncat', index: 1);
await $.native.tap(Selector(text: 'Log in'));
},
Expand Down Expand Up @@ -52,6 +58,12 @@ void main() {

// bug: using `Email` and `Password` selectors doesn't work (#1554)
await $.native2.enterTextByIndex('test@leancode.pl', index: 0);

await $.native.swipe(
from: Offset(0.5, 0.5),
to: Offset(0.5, 0.1),
);

await $.native2.enterTextByIndex('ny4ncat', index: 1);
await $.native2.tap(
NativeSelector(
Expand Down
3 changes: 3 additions & 0 deletions dev/e2e_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class _ExampleHomePageState extends State<ExampleHomePage> {
@override
Widget build(BuildContext context) {
_appLinks.uriLinkStream.listen((uri) {
if (!context.mounted) {
return;
}
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (_) => ApplinkScreen(
Expand Down
Loading
Loading