Skip to content

Enhance android test reliability#3

Open
sauceadam0000345 wants to merge 5 commits intosaucelabs-training:mainfrom
sauceadam0000345:enhance-android-test-reliability
Open

Enhance android test reliability#3
sauceadam0000345 wants to merge 5 commits intosaucelabs-training:mainfrom
sauceadam0000345:enhance-android-test-reliability

Conversation

@sauceadam0000345
Copy link
Copy Markdown

Enhanced Android Test Reliability

This PR improves the Android test suite with robust click strategies and Sauce Labs compatibility fixes.

�� Key Improvements:

  • Robust Click Strategies: Added multiple fallback methods (regular click, touchAction, UiScrollable) for better element interaction reliability
  • Sauce Labs Compatibility: Fixed app reset strategy (noReset: false, fullReset: true) and replaced unsupported mobile: clickGesture with UiScrollable fallback
  • Enhanced Test Flow: Improved navigation through complete checkout process with better error handling
    -Updated README: Pointing to new docs for app management

🐛 Issues Fixed:

  • Test failures on Sauce Labs due to incompatible click methods
  • Inconsistent app state between test runs
  • Element interaction reliability issues

Testing Results:

  • ✅ Works locally with Appium v2.19.0
  • ✅ Works on Sauce Labs with Appium v1.22.1
  • ✅ Complete checkout flow from products to order completion
  • ✅ Robust handling of Review Order button clicks

📁 Files Changed:

  • test/android.spec.ts - Enhanced test with robust click strategies
  • configs/wdio.android.sauce.emu.conf.ts - Fixed app reset configuration

@wswebcreation
Copy link
Copy Markdown
Contributor

@sauceadam0000345

If you want to make this work properly then please:

  • update to the latest version of WDIO
  • don't and please, DON'T use Appium 1. This has been 🚨 EOL since 01-01-2022 🚨, Appium one WILL NEVER BE STABLE WITH ANDROID HIGHER THAN 12

- Update WebdriverIO from 7.40.0 to 9.18.1 (latest version)
- Update Android configuration to use Android 16.0 consistently
- Request Appium 2.0.0 on Sauce Labs for better stability
- Add Appium 2.x specific capabilities for improved reliability
- Maintain robust click strategies for cross-environment compatibility
- Address maintainer feedback about using modern, supported versions
@sauceadam0000345
Copy link
Copy Markdown
Author

@wswebcreation

Thank you for the valuable feedback! I've updated the PR to address what you said:

✅ Updated WebdriverIO from 7.40.0 to 9.18.1 (latest version)
✅ Requested Appium 2.0.0 on Sauce Labs instead of the EOL Appium 1.22.1
✅ Updated Android configuration to use Android 16.0 consistently
✅ Added Appium 2.x specific capabilities for improved reliability
✅ Updated README with correct Sauce Labs app upload URLs and instructions

The original robust click strategies remain in place to ensure cross-environment compatibility, but now the project uses modern, supported versions throughout.

This should provide both immediate stability and long-term maintainability.

Tests are now passing reliably on both local (Appium 2.19.0) and Sauce Labs (Appium 2.0.0) environments with the updated stack.

@wswebcreation
Copy link
Copy Markdown
Contributor

And why use the my.rn.demo.app.android.apk app? This project has been deprecated for ages 😅

Having said that, why use the robust clicks?

@sauceadam0000345
Copy link
Copy Markdown
Author

@wswebcreation

Regarding the robust clicks: I initially implemented multiple fallback strategies when tests were failing intermittently on Sauce Labs with Appium 1.22.1. With the update to Appium 2.0.0, these should be less necessary, but I kept them as a safety net for cross-environment compatibility. If you prefer, I can simplify the click strategies now that we're using modern Appium versions.

Regarding the demo app: You're absolutely right - this was part of my learning process to get things working. Eventually I can update to a more current app, but the focus was on demonstrating the testing framework and addressing the version compatibility issues.

@wswebcreation
Copy link
Copy Markdown
Contributor

I understand regarding the learning process. What is the goal of the project now, to show it to customers? IF so, then please kill the project because there are "bad practices" in it. It's too old. If it's to learn, then also please kill the project or make it private due to the bad practices 😅

@sauceadam0000345
Copy link
Copy Markdown
Author

@wswebcreation

Not the intention to show to customers, no

Will work on making it private/kill project

@wswebcreation
Copy link
Copy Markdown
Contributor

I think it might be wise to do it for all project that I touched in the past, so also the demo-js projects

@sauceadam0000345
Copy link
Copy Markdown
Author

@wswebcreation ok thanks for the heads up and also for the super fast responses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants