nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
215 stars 80 forks source link

MDTextField automationText attribute not supported #301

Open chuckmitchell opened 3 years ago

chuckmitchell commented 3 years ago

Make sure to check the demo app(s) for sample usage

Checked them out... tried adding the automationText attribute to an Angular project.

Make sure to check the existing issues in this repository

I have, and I cannot find any references.

If the demo apps cannot help and there is no issue for your problem, tell us about it

MDTextfield promises to support all the attributes from theTextField in Nativescript but it does not. We are trying to use Appium to do automated tests but need to identify elements through AutomationText element attributes.

From the MDTextfield Readme: "Inherits from NativeScript TextField so it already has all the same attributes."

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Try to set the attribute "automationText" which is supported by almost all Nativescript tags like so <MDTextField #username
automationText="username_field" hint="username" >

The element generated does not accept the attribute, it just ignores it. Changing to the Nativescript provided TextField does support the automationText attribute.

Is there any code involved?

Simply try and add the automationText attribute, it does not work on MDTextField tags.

farfromrefug commented 3 years ago

@chuckmitchell automationText is not a N TextField property but a View propery. So any View (so any plugin) should work with it. Without you giving more details i cant help. Probably N does not support automationText for composite views and does not set it on the right N view. We added nativeTextViewProtected in N a while back. I think the recent changes for a11y broke automationText for plugins like mine

BTW it promises and it delivers! you should be kinder to people who actually brings you open source software without you having to pay or spend time on it...