Selecting dropdowns

You can also use I.select to select options from dropdown lists, like this:

I.goTo("https://en-gb.facebook.com/")
I.see("Create an account")
// Let's select our birthday
I.select("16")I.select("Dec")I.select("2016")

By the way, you can add comments to your test by starting your comment with two slashes like this //. These lines are ignored by the test engine and it's just for you to read.

While it's not necessary, it's usually good to be more descriptive about what you are trying to do. We should specify the dropdown list we want to make the selection from.

I.goTo("https://en-gb.facebook.com/")
I.see("Create an account")
// Let's select our birthday
I.select("Day", "16")I.select("Month", "Dec")I.select("Year", "2016")

Note that if your dropdown list is heavily customised, I.select may not work on it. You will have to fallback on using a combination of I.click commands to open the list and select the option instead. Note to developers: We recommend implement native <select> dropdowns under your custom dropdown components or use ARIA role="option" so that UI-licious can pick it up.

When you are ready, click Next below.