惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
Visual Studio Blog
I
InfoQ
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
D
Docker
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
量子位
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hugging Face - Blog
Hugging Face - Blog
J
Java Code Geeks
T
Tailwind CSS Blog
S
Securelist
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
雷峰网
雷峰网
D
Darknet – Hacking Tools, Hacker News & Cyber Security
小众软件
小众软件
Cloudbric
Cloudbric
N
News and Events Feed by Topic
L
LangChain Blog
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
L
LINUX DO - 热门话题
T
The Blog of Author Tim Ferriss
AWS News Blog
AWS News Blog
爱范儿
爱范儿
博客园 - 聂微东
Project Zero
Project Zero
V
Vulnerabilities – Threatpost
PCI Perspectives
PCI Perspectives
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - Franky
Y
Y Combinator Blog
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
AI
AI
The Last Watchdog
The Last Watchdog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
CXSECURITY Database RSS Feed - CXSecurity.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
美团技术团队
Google Online Security Blog
Google Online Security Blog
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
T
Tor Project blog

ashishb.net

A day in Luxembourg - the richest country in the world I was asked to install malware during a fake interview Book summary: Breakneck - China's quest to engineer the future by Dan Wang Book summary: How to Teach Your Baby to Read Book Summary: The Discontented Little Baby Book by Pamela Douglas Introducing Amazing Sandbox - run third-party tools and AI agents securely on your machine Why software outsourcing gets a bad reputation? Book summary: The Natural Baby Sleep Solution by Polly Moore A day in Antwerp, Belgium Journey of online influencers Two days in Brussels, Belgium Shortcuts - when we love them and when we don't A visit to Rakhigarhi Three days in overhyped Paris Empty Japan, crowded Tokyo The real lock-in in GitHub is not the code, but the stars 11-day Norwegian Breakaway East Caribbean cruise Sanskrit and Sri Lankan Air Force Use REST with Open API The Achilles heel of American capitalism Costa Rica in 4 days At a juice stall in Sri Lanka A short stay at Warsaw, Poland Best practices for using Python & uv inside Docker Two days in Vilnius, Lithuania How IntelliJ IDEs waste disk space Pregnancy Why there aren't many digital nomads from India Two days in Riga, Latvia To keep your machine secure, run third-party tools inside Docker Family Ties in Your DNA: Some relatives are closer than others Doctors per capita Two days in Tallinn, Estonia Ship tools as standalone static binaries Made in America Two days in Helsinki, Finland Maintaining an Android app is a lot of work The land of good deals Two days in Oslo, Norway FastAPI vs Flask performance comparison Google Search is losing to Perplexity Two days in Dublin, Ireland Continuous integration ≠ Continuous delivery World's simplest project success heuristic London in 5 days It is hard to recommend Python in production Inflation, IRS, Credit cards, and Vendors Temu and the Chinese approach Things to do in Miami Florida Revenue vs Cost Axis Language learning as an adult The unanchored babies of the green card limbo Price variance in the United States A day in Louisville, Kentucky A surprisingly positive experience with Air India Unhospitable Airports Android: Don't use stale views USA = Union of Sales and Advertisement A day in Nashville, Tennessee Minimize Javascript in your codebase A day in Birmingham, Alabama In defense of ad-supported products Real vs artificial world The science behind Punjabi singers Hiking Mt. Fuji The Indian startup bubble is insane Repairing database on the fly for millions of users Book Summary: One up on Wall Street by Peter Lynch It is hard to recommend Google Cloud At the Prague airport Kyoto in three days Migrating from WordPress to Hugo Book summary: Sick Societies by Robert B. Edgerton Statistical outcomes require statistical games Illegal immigrants to Europe via Cairo Tokyo in three days Mobs are Status Games Writing Script matters as much as the spoken language Sri Lanka in 5 days LLMs: great for business but bad business Book Summary: Safe Haven by Mark Spitznagel Mac shortcut for typing Avagraha symbol On a bus with an asylum seeker Nicaragua in 5 days When to commit Generated code to version control Why I always buy a local SIM in a foreign country Use Makefile for Android Four days in Guadalajara, Mexico Android Navigation: Up vs Back Hotels vs Airbnb vs Hostels Currency issues in Argentina Abstractions should be deep not wide Some data on podcasting Always support compressed response in an API service A day in El Calafate - Patagonia, Argentina Hermetic docker images with Hugging Face machine learning models American Elections The sound of "ch" API services should always have usage Limits Hiking in El Chaltén - trekking capital of Argentina
End-to-end testing of mobile apps
Ashish Bhatia · 2023-08-02 · via ashishb.net

Google released a new version of the Google Auth library.

It had a bug that broke Google Login on Android for API 26 and earlier.

This impacted my small but popular Music Player app in Google Play.

It reveals the kind of problem, I have alluded to in end-to-end testing.

The only way to avoid such problems is by end-to-end testing.

However, I find all Android testing frameworks to be terrible.

Most of the frameworks are focused on testing the underlying code.

However, I’m interested in UI interactions to prove the user can accomplish the job.

And that’s how I came across mobile.dev.

Mobile.dev has an excellent open-source framework called Maestro which one can use to write intuitive tests.

You describe how the UI interactions and expectations.

And the framework just verifies that.

Here’s a sample for the test I wrote to prevent my app from breaking in the future.

This snippet describes a basic test that I wrote to assert that Google Drive Folder sharing is always working.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Same this file inside ".maestro" folder in the repo root
---
# Ref: https://maestro.mobile.dev/api-reference
appId: "net.ashishb.androidmusicplayer"
---
- launchApp
- waitForAnimationToEnd

- tapOn:
    id: "shareable_link"
- inputText: "https://drive.google.com/drive/folders/<folder-id>"
- tapOn: "Link Google Drive Folder"
- waitForAnimationToEnd

- assertVisible: "Cached Files"
- assertVisible: "Recently Added"
- assertVisible: "Local Files"
- assertVisible: "song.mp3"
- assertVisible: "Files: 1,0*.*"
- assertVisible: "Files: 1,55.*"

# Now download a file and play it
- tapOn: "song.mp3"
- waitForAnimationToEnd

- assertNotVisible:
    id: "rewind_button"
# Verify bottom sheet expands
- tapOn:
    id: "music_status"
- assertVisible:
    id: "artist_name"
...

And here’s a simple GitHub Actions code to run all the tests on mobile.dev

1
2
3
4
5
6
7
# Run all test flows in ".maestro" directory
- name: Run end to end tests with mobile.dev
  uses: mobile-dev-inc/action-maestro-cloud@v1
  with:
  # The API key can be found at https://console.mobile.dev/quickstart
          api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
          app-file: <path-to-apk>

Update: As of Jan 1, 2025, mobile.dev is no longer free. One can, however, run Maestro on GitHub Actions instead using Android Emulator Runner directly.

Note

  1. You can run maestro CLI locally against a connected device/emulator.
  2. For the Google Auth bug, I still cannot test using Maestro as it only supports recent Android versions. However, the Maestro testing prevented me from shipping another Gradle-related bug.