mozilla-mobile / mozilla-vpn-client

A fast, secure and easy to use VPN. Built by the makers of Firefox.
https://vpn.mozilla.org
Other
427 stars 102 forks source link

Android Acessibility: Duplicate Accessible Elements #9466

Open data-sync-user opened 2 weeks ago

data-sync-user commented 2 weeks ago

In i’m currently Playing with the Android UiAutomator If i i.e on the launcher screen with the “register” button run

// Query all Acessible Qt Elements
        val obj = device.findObjects(By.clazz("android.view.View\$VirtualChild"))
        Log.e("TESTING", "${obj.size}")
        obj.forEach {
            Log.e("TESTING", it.contentDescription)
        }

I get as output

2024-04-30 15:23:24.725 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  12
2024-04-30 15:23:24.731 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  
2024-04-30 15:23:24.737 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  
2024-04-30 15:23:24.740 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Hilfe erhalten 
2024-04-30 15:23:24.742 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Hilfe erhalten 
2024-04-30 15:23:24.746 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Mozilla VPN 
2024-04-30 15:23:24.749 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Ein sicheres, zuverlässiges und schnelles VPN – entwickelt von den Machern von Firefox. 
2024-04-30 15:23:24.751 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  
2024-04-30 15:23:25.261 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Registrieren 
2024-04-30 15:23:25.272 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Registrieren 
2024-04-30 15:23:25.279 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Bereits Kunde? 
2024-04-30 15:23:25.284 14171-14197 Daemon-TESTING          org.mozilla.firefox.vpn.debug        E  Bereits Kunde? 

So it seems we have dupes. This can confuse people but also you know given each object in the accessiblity tree is pricy to update we should look into that.

My wild guess is we have something like

SomeElement{
Acessible.Text = a 
MZ_ACESSBILE_THING{
 text = a
}
}
// and 
MZ_ACCESSIBLE_THING{
Acessible.Text = text
}

cc [~accountid:60482d76ceccdd006a1ce9dd]

┆Issue is synchronized with this Jira Bug ┆Reporter: Basti

data-sync-user commented 2 weeks ago

➤ Lesley Norton commented:

thanks Basti! Reminds me of this: https://github.com/mozilla-mobile/mozilla-vpn-client/pull/8439 ( https://github.com/mozilla-mobile/mozilla-vpn-client/pull/8439|smart-link ). We may just need to apply the same hack to elements in the pre-signup onboarding SwipeView.

If you’re still testing these views, I’m curious what happens if you throw Accessible.ignored: !visible in MZHeaderLink{}? If it’s the same issue as before we’d expect to not see a duplicate Hilfe erhalten elem.