I wrote a protractor test with this locator:
this.questionsInList = element.all(by.repeater('question in
survey.questions'));
Where this 1st function:
/// MAP QUESTION TO KEY FIELD ///
this.mapQuestionToKeyField = function(keyName, position){
console.log("Calling this.getQuestionsInQuestionsList().. ");
this.getQuestionsInQuestionsList();
console.log("Size of questionsInSurveyQuestionListArray after calling
method this.getQuestionsInQuestionsList :" +
this.questionsInSurveyQuestionListArray.length);
//Drag & drop to question column to the right of key field
browser.actions().dragAndDrop(this.questionsInSurveyQuestionListArray[position
- 1], this.determineKeyFieldToMapQuestion(keyName)).perform();
};
Calls this other function which is supposed to process an array of promises:
this.getQuestionsInQuestionsList = function(){
var numberOfItems = this.questionsInList;
numberOfItems.then(function (rows){
====> I NEVER GET HERE
console.log ("Am in getQuestionsInQuestionsList() "); //
//console.log("Size of questionsInSurveyQuestionListArray is:" +
rows.length);
for(var i=0; i < rows.length; i++){
rows[i].then(function (arg){
console.log("Text is currently:", arg);
this.questionsInSurveyQuestionListArray.push(arg); //array of
'survey in questions' element text
});
}
console.log("Length of questionsInSurveyQuestionListArray is: " +
this.questionsInSurveyQuestionListArray.length);
});
console.log ("Out of getQuestionsInQuestionsList() ");
};
Question: I cannot get the array of promises in the second function to be
processed. Anyone know what I am doing wrong?
--
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.