It makes it easy to do end-to-end testing using Selinium and xPath
For example a code like this:
<DatePicker id='datepicker' />
should give in the compiled code something like this:
...
<div class="ant-calendar-date-input-wrap">
<input class="ant-calendar-input " value="" placeholder="Select date" id="datepicker">
</div>
...
Thank you very much for the great job you are doing!
Adding ids won't work for all components. Let's say Select component, a simplest Select component doesn't render input, you can not assign a value to input to change Select's value.
@yesmeck thank you for giving me more information regarding this issue, so is there any other way around that you are aware? Do you know any other tools which would work well for end-to-end testing? is this going to work on the antd@3? If no... at least we will be able to read pre-populated values.
Adding id to DatePicker
input won't work. I you want to populate a DatePicker
, you need simulate user behavior:
As far as I could see, there is currently no way to pass any kind of id to the input field with the class '.ant-calendar-input'.
I will have a look into the rc-calendar module.
Adding an id
to input fields (even inside components like DatePicker
) is important for accessibility reasons. I want to add an htmlFor
to associated labels, and focus the input fields when I click the labels.
PR anytime if you find any component doesn't support id.
I'm using uilicious.com for my UI testing and it's very challenging when IDs are not present.
Most helpful comment
Adding an
id
to input fields (even inside components likeDatePicker
) is important for accessibility reasons. I want to add anhtmlFor
to associated labels, and focus the input fields when I click the labels.