Fixed e2e search page test

This commit is contained in:
Lotte Hofstede
2017-10-06 11:37:38 +02:00
parent 39488a5639
commit 5c77aee1a2

View File

@@ -39,8 +39,8 @@ export class ProtractorPage {
getRandomScopeOption(): promise.Promise<string> {
const options = element(by.css('select[name="scope"]')).all(by.tagName('option'));
return options.count().then((c: number) => {
const index: number = Math.floor(Math.random() * c);
return options.get(index).getAttribute('value');
const index: number = Math.floor(Math.random() * (c - 1));
return options.get(index + 1).getAttribute('value');
});
}