I have filtered drop down list which list all tasks. When I type letters into the search box I am presented with a list of tasks that start with those letters.
My Serenity-JS / Cucumber test inputs the first two characters in the 'Given' see below cucumber. But I am trying to use Serenity to select an Item from the list of options.
Given James has entered 'Ta' into the tasks box
When he selects 'Take out the Trash' from the task list options
Then he sees 'Take Out the Trash' in the heading
The Code I am using to find the tasks is something like this:
static List_Of_All_Tasks = Target.the('List of all tasks').located(by.className('task'));
This returns a list of 'tasks'
My question is using the normal Serenity-js Pattern. How do I select an Item in the list?
The Click.on()
takes a Target but how do I specify something like List_Of_All_Tasks.located(by.id='Take_Out_The_Trash')