Hi:
I am trying to get all hot and heavy with this e2e testing business.
I have a bit of html that is used to have an input with a button on its right that opens a dropdown. Something like this:
<input id="input0"><button id="dropDownButton0">SelectedValue</button>
<ul id="dropdownOptions0">
<li>Option 1</li>
<li>Option 2</li>
</ul>
I am using some syntax like this to get an element and attempt to click on it:
it('Should have some options and clicking on one should set the button's text to be the selected value', function() {
browser().navigateTo('/');
expect(browser().window().hash()).toMatch('/');
var dropdownBtn = element('#dropdownButton0');
dropdownBtn.click();
var item2 = element('#dropdownOptions0 li:nth-child(2)');
item2.click();
//note that at this point if I pause item 2 was not clicked
pause();
});
I guess I see when I pause the runner that item 2 was not clicked because when I do it via just clicking in a normal browser something happens on the UI. Whats the right way to click on this? Do I need to make sure I have buttons in each <li> tag that are clickable?
Thanks for the help!
Adam