-
Notifications
You must be signed in to change notification settings - Fork 454
0001 expose element list
Ankon Chakraborty edited this page Sep 11, 2019
·
4 revisions
This ADR has been recorded retrospectively.
Proposed
We decided to add new apis like isDisabled, contentEditable, isCovered etc. There we faced the problem that should taiko check the first matching element or at least one of the matching element. This behaviour is currently inconsistent across apis. And also the elementWrapper.get returns a list of elements. But when elementWrapper.exists() is called we work on the first element of the matching elements only.
- We are going to return an element list from the selector instead of elementWrapper.
- The elementList will be a list of elementWrappers which will wrap only one element in each
- The elementList will expose same apis as elementWrapper which will route to the first elementWrapper of the list.
- Users can loop through the list and write some manual logic.
Examples:
button('foo') will return a list of elementWrappers i.e. [elementWrapper1, elementWrapper2 …]
button('foo')[0] will be a elementWrapper. I.e. {get, value, exists, isDisabled…}
button('foo') will also be a elementWrapper. I.e. {get, value, exists, isDisabled…}. ( This will be similar to button('foo')[0] ).