I have code similar to this:
ExamPage.prototype.enterDetailsInputData = function (modifier) {
page.sendKeys(this.modalExamName, 'Test Exam ' + modifier);
page.sendKeys(this.modalExamVersionId, 'Test exam version ' + modifier);
page.sendKeys(this.modalExamProductVersionId, 'Test exam product version ' + modifier);
page.sendKeys(this.modalExamAudienceId, 'Test exam audience ' + modifier);
page.sendKeys(this.modalExamPublishedId, '2014-06-1' + modifier);
page.sendKeys(this.modalExamPriceId, '100' + modifier);
page.sendKeys(this.modalExamDurationId, '6' + modifier);
};
Here's the page.sendKeys function. Note that currently this is not doing any return of promises or anything like that. If the function is not coded well then I welcome comments:
// page.sendkeys function
sendKeys(id: string, text: string) {
element(by.id(id)).sendKeys(text);
}
I watch as it slowly fills out each field on my screen and then repeats it again and again in more tests that follow.
Is there any way that this could be optimized or do I have to wait for one field after the other to fill and have to live with tests that take a long time to run?
I assume sendKeys is promise based. Could I for example use AngularJS $q to issue all the sendKeys at the same time and then use $q to wait for them to complete?