From f8d0f859b82e8c9f6bc826112399205dc1bcb2d7 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Thu, 29 Oct 2015 11:14:49 +0100 Subject: [PATCH] find projects by name - e2e --- e2e/full/user-stories/user-story-detail.e2e.js | 2 +- e2e/utils/nav.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/e2e/full/user-stories/user-story-detail.e2e.js b/e2e/full/user-stories/user-story-detail.e2e.js index 77cdb585..1bdd46b6 100644 --- a/e2e/full/user-stories/user-story-detail.e2e.js +++ b/e2e/full/user-stories/user-story-detail.e2e.js @@ -13,7 +13,7 @@ describe('User story detail', function(){ before(async function(){ await utils.nav .init() - .project(2) + .project('Project Example 0') .backlog() .us(0) .go(); diff --git a/e2e/utils/nav.js b/e2e/utils/nav.js index b37bdaea..20bd694c 100644 --- a/e2e/utils/nav.js +++ b/e2e/utils/nav.js @@ -6,7 +6,13 @@ var actions = { project: function(index) { browser.actions().mouseMove($('div[tg-dropdown-project-list]')).perform(); - let project = $$('div[tg-dropdown-project-list] li a').get(index); + let project = null; + + if (typeof index === 'string' || index instanceof String) { + project = $('div[tg-dropdown-project-list]').element(by.cssContainingText('li a', index)); + } else { + project = $$('div[tg-dropdown-project-list] li a').get(index); + } common.link(project);