Merge pull request #178 from LotteHofstede/fixed-e2e-search-page-test

Fixed e2e search page test
This commit is contained in:
Art Lowel
2017-10-06 11:59:12 +02:00
committed by GitHub

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');
});
}