From 5c77aee1a2afbdd7a232869151cbdcfae1fb9dbc Mon Sep 17 00:00:00 2001 From: Lotte Hofstede Date: Fri, 6 Oct 2017 11:37:38 +0200 Subject: [PATCH] Fixed e2e search page test --- e2e/search-page/search-page.po.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/search-page/search-page.po.ts b/e2e/search-page/search-page.po.ts index b5e43dcf82..b1a17ee150 100644 --- a/e2e/search-page/search-page.po.ts +++ b/e2e/search-page/search-page.po.ts @@ -39,8 +39,8 @@ export class ProtractorPage { getRandomScopeOption(): promise.Promise { 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'); }); }