matrix-org / matrix-rich-text-editor

Matrix Rich Text Editor
https://matrix-org.github.io/matrix-rich-text-editor/
Apache License 2.0
92 stars 23 forks source link

[Android] Take a screenshot when instrumentation tests fail #871

Closed jonnyandrew closed 10 months ago

jonnyandrew commented 10 months ago

Changes

Take a screenshot when the core library UI tests fail.

An example of the output can be found in the CI artifacts for https://github.com/matrix-org/matrix-rich-text-editor/pull/871/commits/04b84f5c990f41969fd7ee07b15c11d92e345c00.

Context

To aid debugging of test failures.

codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (59d2a99) 89.40% compared to head (04b84f5) 89.39%. Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #871 +/- ## ========================================== - Coverage 89.40% 89.39% -0.02% ========================================== Files 118 86 -32 Lines 16845 15324 -1521 Branches 635 0 -635 ========================================== - Hits 15061 13699 -1362 + Misses 1760 1625 -135 + Partials 24 0 -24 ``` | [Flag](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/871/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/871/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `?` | | | [uitests-ios](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/871/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `?` | | | [unittests](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/871/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `89.39% <ø> (+1.38%)` | :arrow_up: | | [unittests-ios](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/871/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `?` | | | [unittests-rust](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/871/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `89.39% <ø> (+0.03%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jmartinesp commented 10 months ago

Nice, it seems like we can get the cause of the issue now! Maybe we can automate closing that dialog? I'm pretty sure I saw something similar in some issue a long time ago.

jmartinesp commented 10 months ago

Maybe this? They also recommend using non-google-api versions if possible.

jonnyandrew commented 10 months ago

Maybe this? They also recommend using non-google-api versions if possible.

Yeah this would be handy but the API is deprecated from API 31 so I don't think we can use that.

I was going to try to see if we can use UiAutomator to dismiss the dialog because I see a few other projects doing this.

jonnyandrew commented 10 months ago

@jmartinesp am I OK to merge this change so that it's not blocked by the eventual fix?

jmartinesp commented 10 months ago

Oh, sure. I thought you wanted to apply the fix in this PR, that's why I hadn't approved yet.

sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information