From cbe8624ae980f3270784a0df0b989c512fb99e58 Mon Sep 17 00:00:00 2001 From: deepthivenkat Date: Wed, 1 Jun 2016 21:22:07 +0200 Subject: [PATCH] Issue #1079 - added functional tests for URL and search box update upon label click in /issues --- tests/functional/search-non-auth.js | 30 +++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tests/functional/search-non-auth.js b/tests/functional/search-non-auth.js index 2089a16ec..e30d3374d 100644 --- a/tests/functional/search-non-auth.js +++ b/tests/functional/search-non-auth.js @@ -52,10 +52,9 @@ define([ }, 'Clicking on label search suggestion works': function() { - var params = '?q=dfjdkfjdkfjkdfjdkjf'; return this.remote .setFindTimeout(intern.config.wc.pageLoadTimeout) - .get(require.toUrl(url('/issues') + params)) + .get(require.toUrl(url('/issues'))) .findByCssSelector('[data-remotename=browser-android]').click() .end() // click the first suggestion, which is "android" @@ -66,6 +65,33 @@ define([ .end(); }, + 'Clicking on label search adds query parameter to the URL': function() { + return this.remote + .setFindTimeout(intern.config.wc.pageLoadTimeout) + .get(require.toUrl(url('/issues'))) + .findByCssSelector('[data-remotename=browser-android]').click() + .end() + .getCurrentUrl() + .then(function(currUrl) { + assert.include(currUrl, 'q=label%3Abrowser-android', 'Url updated with label name'); + }) + .end(); + }, + + 'Clicking on label search updates the search input': function() { + return this.remote + .setFindTimeout(intern.config.wc.pageLoadTimeout) + .get(require.toUrl(url('/issues'))) + .findByCssSelector('[data-remotename=browser-android]').click() + .end() + .sleep(2000) + .findById('js-SearchForm-input').getProperty('value') + .then(function(searchText) { + assert.include(searchText, 'label:browser-android', 'Url updated with label name'); + }) + .end(); + }, + 'Search input is visible': function() { return this.remote .get(require.toUrl(url('/issues')))