How nightly Meastro test prevented accessibility bug

We have few Maestro tests for our flutter app. Since they are E2E and might not be reliable we are only running them nightly as opposed to other unit and integration tests that run on every MR.

I got a notify from our nightly run that these tests fail instead of brushing it off as flaky test, I looked through the logs and screen recordings. And there isn't any noticeable change but it was a consistent repro.

So, I fired up Maestro studio and behold I see this wonky string "Banking\nBanking" in the label. In the test we just search for "Banking"

This is how it is supposed to look like.

Correct accessibility label

Turns out, there was change in the bottom nav icons and it was wrapped in a semantics widget. By default this widget merges the child widgets labels.

Code that caused the error

return Semantics(
 label: item.label, 
child: ConstrainedBox(        

So, we excluded the semantics behaviour for the purposes of label


return Semantics(
      excludeSemantics: true,
      button: true,
       child: ConstrainedBox....
...        

And now the tests pass again!

ps: Another way this could be fixed is adding the property explicitChildNodes=true to semantics widget and the previous label would have retained.


Let this post serve up as a reminder for next time to debug the root cause before marking a test as flaky

要查看或添加评论,请登录

Satyajit Malugu的更多文章

  • What San-Ti Learned from John Galt: The Power of Nerds

    What San-Ti Learned from John Galt: The Power of Nerds

    The Importance of STEM Minds The recent Netflix series "The Three-Body Problem" highlights an intriguing parallel…

  • FRS theorem of test automation

    FRS theorem of test automation

    A biggest lesson from creating test automation suites for over 10 years across different stacks is, that you cannot…

  • Handle feature outages gracefully in mobile apps

    Handle feature outages gracefully in mobile apps

    Outages are part of engineers life, we can measure them, minimize them but cannot completely avoid them. As frontend…

    2 条评论
  • Elevate your mobile development cycle with a hidden debug screen

    Elevate your mobile development cycle with a hidden debug screen

    Software development is an iterative process, most of the features that you are using on your phones has gone through…

  • Single job vs multiple jobs in CI

    Single job vs multiple jobs in CI

    When starting out with CI/CD pipelines a common decision point is if you need a single job (or action for github terms)…

  • Retry vs timeouts for CI pipelines

    Retry vs timeouts for CI pipelines

    Following up on my last article about retries in CI, a follow up concern is timeouts for the jobs. Mobile CI pipelines…

  • To retry or not, is the question

    To retry or not, is the question

    Flaky tests are a big problem for an affective continuous integration setup. We want our CI to be running all tests and…

  • When to combine your mobile repos to a monorepo

    When to combine your mobile repos to a monorepo

    A monorepo combines various technological stacks that produce different deployables into a single code repository. For…

  • Takeaways from ‘Testing without Testers

    Takeaways from ‘Testing without Testers

    Alan page gave a talk at quardev on May 11th titled Testing without Testers. Its a very provocative title for a few…

    1 条评论
  • Triaging a device specific bug

    Triaging a device specific bug

    Today morning as we are about to finalize our release, we got a bug from an external china team stating that Add to…

    1 条评论

社区洞察

其他会员也浏览了