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

textStartsWith and textContains do not work on iOS #1536

Open
sezabass opened this issue Jul 13, 2023 · 1 comment
Open

textStartsWith and textContains do not work on iOS #1536

sezabass opened this issue Jul 13, 2023 · 1 comment
Labels
bug Something isn't working package: patrol Related to the patrol package (native automation, test bundling) platform: ios iOS is affected

Comments

@sezabass
Copy link

sezabass commented Jul 13, 2023

Steps to reproduce

  1. Open "Files" application on iOS with await $.native.openApp(appId: 'com.apple.DocumentsApp');
  2. Tap anything with a Selector passing the text argument and the files appId - it will find the element on the screen. e.g:
    await $.native.tap(Selector(text: 'Browse'), appId: 'com.apple.DocumentsApp');
  3. Tap anything with a Selector passing the textStartsWith argument and the files appId - it will not find the element. e.g:
    await $.native.tap(Selector(textStartsWith: 'Browse'), appId: 'com.apple.DocumentsApp');

My assumption reading the logs is that it ignores the textStartsWith parameter and only takes the text parameter into consideration.
I've even tried it with textContains and it doesn't work as well.

It works perfectly on Android.

Logs

Logs
2023-07-13 17:57:51.765935-0300 RunnerUITests-Runner[48509:3435770] PatrolServer: INFO: tapping on view with text "" in app com.apple.DocumentsApp...
2023-07-13 17:57:51.766523-0300 RunnerUITests-Runner[48509:3435770] PatrolServer: INFO: waiting for existence of view with text ""
    t =    20.04s Waiting 10.0s for Any to exist
    t =    21.07s     Checking `Expect predicate `exists == 1` for object Any`
    t =    21.07s         Checking existence of `Any`
    t =    21.11s         Capturing element debug description
    t =    22.15s     Checking `Expect predicate `exists == 1` for object Any`
    t =    22.15s         Checking existence of `Any`
    t =    22.17s         Capturing element debug description
    t =    23.21s     Checking `Expect predicate `exists == 1` for object Any`
    t =    23.21s         Checking existence of `Any`
    t =    23.25s         Capturing element debug description
    t =    24.28s     Checking `Expect predicate `exists == 1` for object Any`
    t =    24.28s         Checking existence of `Any`
    t =    24.33s         Capturing element debug description
    t =    25.36s     Checking `Expect predicate `exists == 1` for object Any`
    t =    25.36s         Checking existence of `Any`
    t =    25.39s         Capturing element debug description
    t =    26.42s     Checking `Expect predicate `exists == 1` for object Any`
    t =    26.42s         Checking existence of `Any`
    t =    26.46s         Capturing element debug description
    t =    27.50s     Checking `Expect predicate `exists == 1` for object Any`
    t =    27.50s         Checking existence of `Any`
    t =    27.55s         Capturing element debug description
    t =    28.58s     Checking `Expect predicate `exists == 1` for object Any`
    t =    28.58s         Checking existence of `Any`
    t =    28.62s         Capturing element debug description
    t =    29.66s     Checking `Expect predicate `exists == 1` for object Any`
    t =    29.66s         Checking existence of `Any`
    t =    29.70s         Capturing element debug description
    t =    30.04s Checking existence of `Any`
2023-07-13 17:58:01.810559-0300 RunnerUITests-Runner[48509:3435891] PatrolServer: ERROR: view with text "" in app "com.apple.DocumentsApp" doesn't exist

Patrol version

patrol: 2.0.7

Patrol Doctor output

Patrol Doctor output
% patrol doctor                                                              
You're using Patrol CLI 2.0, which has breaking changes.
Read the migration guide at https://patrol.leancode.co/v2.
Disable this warning by setting the PATROL_MIGRATED environment variable.

Patrol CLI version: 2.0.4
Program adb found in /Users/cesarcastro/Library/Android/sdk/platform-tools/adb
Env var $ANDROID_HOME is not set
Program xcodebuild found in /usr/bin/xcodebuild
Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller

Flutter Doctor output

Flutter Doctor output
% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.4.1 22F82 darwin-arm64, locale pt-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[!] Android Studio
    ✗ Android Studio not found at ~/Library/Application\ Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android\ Studio.app/Contents
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Community Edition (version 2023.1.3)
[✓] VS Code (version 1.79.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

@bartekpacia bartekpacia added bug Something isn't working platform: ios iOS is affected a: native automation labels Jul 13, 2023
@bartekpacia
Copy link
Contributor

Thank you for reporting it - it's just not implemented on iOS. Sorry about that. Actually only Selector.text has the effect on iOS.

We should get it fixed so things like Selector.textStartsWith and Selector.textContains work on iOS as well. Some (roughly related) work on that has been started in #1054.

@bartekpacia bartekpacia added package: patrol Related to the patrol package (native automation, test bundling) and removed a: native automation labels Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package: patrol Related to the patrol package (native automation, test bundling) platform: ios iOS is affected
Projects
None yet
Development

No branches or pull requests

2 participants