So I can't figure this one out.
My test calls for choosing a list item as part of a form to create a new user. However, when I run the test it does not choose an item from the list. And Protractor doesn't return any errors, it thinks the test was a success.
The function I was using previously worked, but in an effort to reduce code repetition, and increase fluidity and flexibility I have started converting the test to incorporate Page Objects.
Below is my test document which shows the functions being called in from two different page objects:
it('Should create first new User.', function() {
var users_page = require('../page/users_page.js');
var addUser_page = require('../page/addUser_page.js');
users_page.addUserButton.click();
addUser_page.addUser('Test', 'Smith', 'Test100@testing.co.nz', 'Password', 'Password', '0');
addUser_page.userRole[1];
addUser_page.confirmNewUser.click();
addUser_page.backToUsersPage.click();
});
Everything works here apart from line 6 - choosing a list item.
Below is the snippet from the page object I refer to when calling the .userRole function:
this.userRole = function (index) {
this.element(by.model('tes.userRole')).$('[value="'+index+'"]');
};
NOTE: There is NOT a problem with the Page Objects talking to the test as there are multiple other functions that DO work.
Let me know if you need any more information, cheers.