Hey everyone!
I've been learning protractor recently and have some questions about how to
parameterize options for my E2E tests for a dropdown menu.
In the page that I'm testing, we have a drop down for countries. The
dropdown contains 4 selectable options "?" which is blank, and then US, UK,
and Canada.
I'm obviously not calling the element correctly within my PO file, as the
parameterization is not working. The tests "pass", however when you watch
what is being driven, the country that is selected, is the "?" one(which is
default). So the test is navigating to the page, selecting the element and
not actually clicking on the option that I'd like.
What am I missing/doing wrong?
Heres my test:
Spec file:
campaignPO.clickCountryLocation('US');
PageObject File:
this.countryType = by.css('select[ng-model="country"]');
this.clickCountryLocation = function(button) { element(this.countryType).
click(button); };
Here is the element were working with:
<select class="form-control input-sm ng-pristine ng-invalid
ng-invalid-required" ng-size="11" ng-model="country" name="country"
ng-options="opt.value as opt.label for opt in countries" ng-change=
"updateCountry()" required="">
<option value="?" selected="selected" label=""></option>
<option value="0" label="US">US</option>
<option value="1" label="UK">UK</option>
<option value="2" label="Canada">Canada</option>
</select>
Thanks everyone! And thank you Julie for creating such a great wrapper:)
Selenium itself is a pain to work with, Protractor....not so much:)
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.