Page MenuHomePhabricator

Add testing automation for QA smoke tests
Open, LowPublicSpike

Description

UI Tests

We should add some automated coverage for our QA smoketest (priority tests TBD). We can add this into our existing WikipediaUITests target. If possible, set it up to run via GitHub actions on a regular cadence. We are choosing GitHub Actions here for consistency, because PR unit tests are through GA.

Mock networking endpoints on an as-needed basis. There are several features that should work well enough against live endpoints (for example, unauthenticated features like the Explore feed, Article, etc.). Others may need some network mocking to be able to get around (like bypassing a Captcha request in the login flow).

Nice to Haves / Questions

  1. Would it be possible to performance-test the launch time? Have a test fail if time between app launch to seeing the Explore feed takes X% longer than the baseline.

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptDec 4 2020, 9:44 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
LGoto triaged this task as Low priority.Dec 7 2020, 7:43 PM
LGoto moved this task from Needs Triage to Engineering Backlog on the Wikipedia-iOS-App-Backlog board.
LGoto added a subscriber: ABorbaWMF.

Progress is in the prototype/testing/ui-test-screenshots branch. So far it:

  • Swipes through each onboarding screen (4 screens in total) and takes a screenshot.
  • Does this for an iPhone X 13.5 simulator and iPad Pro 9.7 inch 14.3 simulator
  • Also does this for both English and German language settings
  • Saves screenshots to user's desktop
  • Triggers locally from the fastlane command bundle exec fastlane ios screenshots. This runs tests on the new WikipediaScreenshots scheme, which only runs the new WikipediaScreenshots test plan.

Remaining work/improvements:

  • Allow list of simulators to be input into the bash script rather than hardcoded
  • Add ability to trigger the fastlane lane from CI (Circle CI, GitHub actions, or the build server). Seems like we should allow both one-off triggering from any branch, and maybe run it on a periodic cadence on main if next step can be accomplished
  • Keep track of the last successful screenshots, compare new run to old screenshots, and send failure alert if pixels differ
  • Send zip file of screenshots somewhere (Slack? Email?)
  • Screenshot the login flow per task description

Update - I was able to get these running from an open PR in CircleCI. It takes screenshots and saves them as CircleCI artifacts. The results are here (you can download screenshots from the Artifacts tab):

https://app.circleci.com/pipelines/github/wikimedia/wikipedia-ios/1002/workflows/edb25d58-82b7-4b7d-9544-1fd90b5c03cc/jobs/975

A couple of notes:

  • Because we have the "Only build pull requests" project-wide setting set, I'm not sure if this will kick off on a regular cadence for us from main. We might want to monitor this feature request (and consider the mentioned GitHub actions solution).
  • Artifacts are accessible for up to 30 days
  • I didn't see a way to export the artifacts elsewhere (Slack, email), but there's a way to pull the latest artifacts via a script (see "Downloading all artifacts for a build on CircleCI" here).

Sync notes:

  1. It looks the tests did run automatically last night (see https://app.circleci.com/pipelines/github/wikimedia/wikipedia-ios?branch=ui-test-screenshots), on a branch that did not contain a pull request, so I think the first note in the comment above is a non-issue.
  2. No need to worry about Slack integration, it's easy enough to pull artifacts from the CircleCI portal.
  3. At this point it would be nice to break it off into two separate test flows: One faster-running smoketest that does not take screenshots, that we possibly trigger upon new PR or a merge into main. Then a another set of tests that take screenshots on various devices and languages, compares against gold standard screenshots (committed to the repo) and errors out if any of them are off.

The Ruby gem for comparing images is chunky_png. This article has example code on how to use it:

I've recently stumbled upon https://percy.io/ "Your all-in-one visual review platform".

Tsevener claimed this task.
Tsevener renamed this task from Add some UI testing automation for QA smoke tests to Add testing automation for QA smoke tests.May 16 2024, 5:40 PM
Tsevener removed a project: Spike.
Tsevener updated the task description. (Show Details)
Tsevener updated the task description. (Show Details)

@Tsevener: Removing task assignee as this open task has been assigned for more than two years - See the email sent on 2025-05-22.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome!
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!