1
0
mirror of https://github.com/element-hq/element-x-android.git synced 2026-10-23 18:49:00 +03:00

27 Commits

Author SHA1 Message Date
Benoit Marty
73b3282939 Stop rewriting screenshots that did not meaningfully change
Recording rewrote every screenshot unconditionally, so renderer noise far below
the verification tolerance produced large "Update screenshots" commits.

Use `app.cash.paparazzi.overwriteOnMaxPercentDifference` to keep screenshots that
are within tolerance. Existing screenshots are no longer deleted before recording;
obsolete ones are pruned afterwards, only when their preview produced no
screenshot at all.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 15:46:28 +02:00
Jorge Martin Espinosa
c4529b87b4 Remove Roborazzi, use Paparazzi for Compound (#7735)
* Remove Roborazzi, use Paparazzi for Compound

The new screenshots will be recorded with the rest of the Paparazzi ones. Note the names changed, since Paparazzi enforces a `$packagename.$testname.$name.$extension` format

* Set a max width value for color previews

* Merge the `verifyPaparazziDebug` CI steps

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-09-21 12:27:56 +02:00
hayaksi1
aa64f07ff0 Do not fail the screenshot recording job when there is nothing to commit
recordScreenshots.sh runs under `set -e`, and the `git commit -m "Update
screenshots"` at the end of it is unconditional. When a recording run
produces no diff — the common case once the snapshots are already up to
date — `git commit` exits 1 with "nothing to commit, working tree clean"
and takes the whole workflow down with it, reporting a red job for a
successful run.

Stage as before, then return early when the staged diff is empty. `set -e`
is left in place: it was added deliberately so that a failed Gradle run
cannot push a commit that deletes every snapshot. Using `git diff --cached
--quiet` as an `if` condition is `set -e`-safe, because its non-zero "there
are changes" status is consumed by the condition. The early return also
skips the push, which had nothing to send.
2026-08-09 13:11:16 +03:00
Jorge Martin Espinosa
556c793b8d CI: yet another Maestro fix (#6505)
* Fix the `assertSessionVerificationDisplayed.yaml` check

* Previous 'Location' is now 'Share location'

* We don't have a GPS location, so the text is 'Share selected location'

* 'Create a new conversation' is now 'Create room'

* Try adding a background logcat process

* 'Sign out' is now 'Remove this device'

* Adjust the logcat filtering so it silences everything that's not our app, otherwise the logs can get quite large
2026-04-01 13:30:01 +02:00
Jorge Martin Espinosa
fb17509726 CI: Add failed tests to summary (#6271)
* Fix maestro CI flow not writing the successful summary

* Add the test failures to the summary of the `test` CI flow
2026-03-02 11:23:41 +01:00
Jorge Martin Espinosa
6bdb9c7c52 Fix Maestro tests again (#6167)
* Increase the timeout for asserting 'Be in your element' is visible

* Disable the chrome onboarding flow. This simplifies the code a lot and helps avoid corner cases.

* More delays with timeout!

* Add more info to the summary, specially when the tests fail, so we can quickly check what failed.

* Make sure Maestro tests can't run in parallel, but APK builds can
2026-02-12 16:24:19 +01:00
Benoit Marty
eb31505dc7 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty
f86431e663 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty
11d6e7e289 Fix CI on screeshot recording 2025-10-06 11:00:30 +02:00
Benoit Marty
d4e295807f Import Compound tests from project https://github.com/element-hq/compound-android 2025-10-06 10:47:31 +02:00
Benoit Marty
fd83aff81d Fix shellcheck issue on local-recording.sh 2025-06-30 17:00:58 +02:00
Jorge Martin Espinosa
f3466aaf7d Make Maestro run for each PR push (#4121)
- Remove the `workflow_run` configuration for the Maestro job.
- Make the 'build apk' job always run again too.
- Make sure the test results are uploaded when the Maestro job fails too (this broke somehow).
2025-01-13 21:06:59 +01:00
Jorge Martin Espinosa
271f032d95 Test using Maestro CLI + emulator instead of Cloud (#4092)
Add Maestro local CI workflow:
- Remove previous Maestro Cloud.
- Use an emulator with Pixel 7 Pro - API 35.
- Allow to record several videos in the background to verify the run.
- Upload test results.
- Allow either dispatching a new flow, running the 'build apk' job or run with a PR after the 'Build APK' flow has succeeded.
2025-01-07 14:05:14 +01:00
Benoit Marty
97f3be3dc5 Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-07 10:05:04 +01:00
Jorge Martín
eb78f32e8c Fix screenshot recording in CI 2024-10-04 15:53:14 +02:00
Benoit Marty
197fe9b2e2 Change ElementBot mail to android@element.io 2024-09-19 11:22:58 +02:00
Benoit Marty
b7fc6261f0 Migrate license to AGPL - sh files. 2024-09-06 17:52:37 +02:00
Jorge Martin Espinosa
b0cebf5ca0 Improve screenshot testing with ComposablePreviewScanner (#3125)
* Use ComposablePreviewScanner to rework how screenshot testing works
* Add test sharding
* Update screenshots
* Fixes for Element Gallery

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-07-03 13:05:06 +02:00
Jorge Martin Espinosa
c9e0db26d8 Try to workaround OOM errors and the runners dying (#3013)
* Try to workaround OOM errors and the runner dying

* Some more tweaks:

- Add `-XX:MaxMetaspaceSize` (https://github.com/gradle/gradle/issues/19750)
- Remove `-PpreDexEnable` as it's deprecated and no longer used.
- Remove `--max-workers` as gradle will automatically use the optimal amount.

* Remove `--max-workers` in recording screenshots too
2024-06-12 15:35:51 +02:00
Jorge Martín
8daf5150af Fix record screenshots workflow and script 2024-01-02 10:43:57 +01:00
Jorge Martin Espinosa
e13b204f4b Run 'record screenshots' flow if label is present (#1860)
* Run 'record screenshots' flow if label is present

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-11-23 08:25:33 +01:00
Benoit Marty
e831b621c9 Ensure previous screenshots are deleted. Sometimes, the registered task is not trigger, I do not know why... 2023-07-18 14:56:48 +02:00
Chris Smith
d0b7f7689e Improve screenshot action error handling
If the gradle build fails for some reason, the script should
bail out instead of carrying on and pushing a commit that
deletes all the screenshots[1]!

`set -e` simply makes the script return the appropriate
exit code immediately if any of the subcommands fails.

[1] e.g.
a58834240e
2023-06-30 10:14:32 +01:00
Jorge Martin Espinosa
97fbe4f4b5 Try using ElementBot for recording screenshots too (#641) 2023-06-20 14:31:52 +02:00
Benoit Marty
7c6fbb36ba Iterate on the script #2 2023-06-02 17:20:36 +02:00
Benoit Marty
38ffb88b7f Iterate on the script 2023-06-02 16:40:41 +02:00
Benoit Marty
1c58a39128 Add GitHub workflow to record screenshots when manually triggered. 2023-06-02 16:16:29 +02:00