From 82d993adff278a632e4cb9f52307af7a8ba474bb Mon Sep 17 00:00:00 2001 From: LeeDr Date: Mon, 25 Jan 2016 20:39:27 -0600 Subject: [PATCH 1/6] Add 5 tests for Discover shared links --- test/functional/apps/discover/_discover.js | 2 +- .../functional/apps/discover/_shared_links.js | 143 ++++++++++++++++++ test/functional/apps/discover/index.js | 3 + test/support/pages/Common.js | 4 + test/support/pages/DiscoverPage.js | 36 +++++ test/utils/getUrl.js | 10 +- 6 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 test/functional/apps/discover/_shared_links.js diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index eced6ad881378..b0cf63a0748d2 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -272,7 +272,7 @@ define(function (require) { var hasFailure = false; for (var y = 0; y < expectedBarChartData.length; y++) { stringResults += y + ': expected = ' + expectedBarChartData[y] + ', actual = ' + paths[y] + - ', Pass = ' + (Math.abs(expectedBarChartData[y] - paths[y]) < barHeightTolerance); + ', Pass = ' + (Math.abs(expectedBarChartData[y] - paths[y]) < barHeightTolerance) + '\n'; if ((Math.abs(expectedBarChartData[y] - paths[y]) > barHeightTolerance)) { hasFailure = true; }; diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js new file mode 100644 index 0000000000000..7b032e1d4dade --- /dev/null +++ b/test/functional/apps/discover/_shared_links.js @@ -0,0 +1,143 @@ +define(function (require) { + var Common = require('../../../support/pages/Common'); + var HeaderPage = require('../../../support/pages/HeaderPage'); + var SettingsPage = require('../../../support/pages/settings_page'); + var DiscoverPage = require('../../../support/pages/DiscoverPage'); + var expect = require('intern/dojo/node!expect.js'); + + return function (bdd, scenarioManager) { + bdd.describe('shared links', function describeIndexTests() { + var common; + var headerPage; + var settingsPage; + var discoverPage; + var baseUrl; + + bdd.before(function () { + common = new Common(this.remote); + headerPage = new HeaderPage(this.remote); + settingsPage = new SettingsPage(this.remote); + discoverPage = new DiscoverPage(this.remote); + + baseUrl = common.getHostPort(); + // baseUrl = 'http://localhost:5620'; + + var fromTime = '2015-09-19 06:31:44.000'; + var toTime = '2015-09-23 18:31:44.000'; + + // start each test with an empty kibana index + return scenarioManager.reload('emptyKibana') + // and load a set of makelogs data + .then(function loadIfEmptyMakelogs() { + return scenarioManager.loadIfEmpty('logstashFunctional'); + }) + .then(function (navigateTo) { + common.debug('navigateTo'); + return settingsPage.navigateTo(); + }) + .then(function () { + common.debug('createIndexPattern'); + return settingsPage.createIndexPattern(); + }) + .then(function () { + common.debug('discover'); + return common.navigateToApp('discover'); + }) + .then(function () { + common.debug('setAbsoluteRange'); + return headerPage.setAbsoluteRange(fromTime, toTime); + }) + .catch(common.handleError(this)); + }); + + + bdd.describe('shared link', function () { + var queryName1 = 'Query # 1'; + var fromTimeString = 'September 19th 2015, 06:31:44.000'; + var toTimeString = 'September 23rd 2015, 18:31:44.000'; + + bdd.it('should show "Share a link" caption', function () { + var expectedCaption = 'Share a link'; + return discoverPage.clickShare() + .then(function () { + return discoverPage.getShareCaption(); + }) + .then(function (actualCaption) { + expect(actualCaption).to.be(expectedCaption); + }) + .catch(common.handleError(this)); + }); + + + bdd.it('should show the correct formatted URL', function () { + // this is a BAD URL which includes the nav bar + var expectedUrl = baseUrl + + '/app/kibana?_t=1453775307251#' + + '/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time' + + ':(from:%272015-09-19T06:31:44.000Z%27,mode:absolute,to:%272015-09' + + '-23T18:31:44.000Z%27))&_a=(columns:!(_source),index:%27logstash-' + + '*%27,interval:auto,query:(query_string:(analyze_wildcard:!t,query' + + ':%27*%27)),sort:!(%27@timestamp%27,desc))'; + return discoverPage.getSharedUrl() + .then(function (actualUrl) { + // strip the timestamp out of each URL + expect(actualUrl.replace(/_t=\d{13}/,'_t=TIMESTAMP')) + + .to.be(expectedUrl.replace(/_t=\d{13}/,'_t=TIMESTAMP')); + }) + .catch(common.handleError(this)); + }); + + bdd.it('should show toast message for copy to clipboard', function () { + var expectedMsg = 'Share search: URL copied to clipboard.'; + return discoverPage.clickCopyToClipboard() + .then(function () { + return headerPage.getToastMessage(); + }) + .then(function (toastMessage) { + expect(toastMessage).to.be(expectedMsg); + }) + .then(function () { + return headerPage.waitForToastMessageGone(); + }) + .catch(common.handleError(this)); + }); + + // TODO: verify clipboard contents + + bdd.it('shorten URL button should produce a short URL', function () { + var re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$'); + return discoverPage.clickShortenUrl() + .then(function () { + return common.tryForTime(20 * 1000, function tryingForTime() { + return discoverPage.getShortenedUrl() + .then(function (actualUrl) { + expect(actualUrl).to.match(re); + }); + }); + }) + .catch(common.handleError(this)); + }); + + // NOTE: This test has to run immediately after the test above + // 'shorten URL button should produce a short URL' + bdd.it('should show toast message for copy to clipboard', function () { + var expectedMsg = 'Share search: URL copied to clipboard.'; + return discoverPage.clickCopyToClipboard() + .then(function () { + return headerPage.getToastMessage(); + }) + .then(function (toastMessage) { + expect(toastMessage).to.be(expectedMsg); + }) + .then(function () { + return headerPage.waitForToastMessageGone(); + }) + .catch(common.handleError(this)); + }); + + + }); + }); + }; +}); diff --git a/test/functional/apps/discover/index.js b/test/functional/apps/discover/index.js index eef3af445e9a3..c7885133e7e89 100644 --- a/test/functional/apps/discover/index.js +++ b/test/functional/apps/discover/index.js @@ -5,6 +5,7 @@ define(function (require) { var ScenarioManager = require('intern/dojo/node!../../../fixtures/scenarioManager'); var discoverTest = require('./_discover'); var fieldData = require('./_field_data'); + var sharedLinks = require('./_shared_links'); bdd.describe('discover app', function () { var scenarioManager; @@ -25,5 +26,7 @@ define(function (require) { fieldData(bdd, scenarioManager); + sharedLinks(bdd, scenarioManager); + }); }); diff --git a/test/support/pages/Common.js b/test/support/pages/Common.js index 070f4e041c896..a48f06f3ecc51 100644 --- a/test/support/pages/Common.js +++ b/test/support/pages/Common.js @@ -51,6 +51,10 @@ define(function (require) { Common.prototype = { constructor: Common, + getHostPort: function getHostPort() { + return getUrl.baseUrl(config.servers.kibana); + }, + navigateToApp: function (appName, testStatusPage) { var self = this; // navUrl includes user:password@ for use with Shield diff --git a/test/support/pages/DiscoverPage.js b/test/support/pages/DiscoverPage.js index cbaa0073f43a1..3dcf3f55fbf1c 100644 --- a/test/support/pages/DiscoverPage.js +++ b/test/support/pages/DiscoverPage.js @@ -175,6 +175,42 @@ define(function (require) { return thisTime .findAllByCssSelector('mark') .getVisibleText(); + }, + + clickShare: function clickShare() { + return thisTime + .findByCssSelector('button[aria-label="Share Search"]') + .click(); + }, + + clickShortenUrl: function clickShortenUrl() { + return thisTime + .findByCssSelector('button.shorten-button') + .click(); + }, + + clickCopyToClipboard: function clickCopyToClipboard() { + return thisTime + .findByCssSelector('button.clipboard-button') + .click(); + }, + + getShareCaption: function getShareCaption() { + return thisTime + .findByCssSelector('div.form-group > label') + .getVisibleText(); + }, + + getSharedUrl: function getSharedUrl() { + return thisTime + .findByCssSelector('.url') + .getProperty('baseURI'); + }, + + getShortenedUrl: function getShortenedUrl() { + return thisTime + .findByCssSelector('.url') + .getProperty('value'); } }; diff --git a/test/utils/getUrl.js b/test/utils/getUrl.js index 5e69bb8707162..3a1b172d7fbc9 100644 --- a/test/utils/getUrl.js +++ b/test/utils/getUrl.js @@ -8,7 +8,8 @@ var url = require('url'); * { * protocol: 'http', * hostname: 'localhost', -* port: 9220 +* port: 9220, +* auth: shield.kibanaUser.username + ':' + shield.kibanaUser.password * } * @param {object} app The params to append * example: @@ -31,3 +32,10 @@ getUrl.noAuth = function getUrlNoAuth(config, app) { }); return getUrl(config, app); }; + +getUrl.baseUrl = function getBaseUrl(config) { + config = _.pick(config, function (val, param) { + return param !== 'auth' & param !== 'pathname' & param !== 'hash'; + }); + return url.format(config); +}; From 3ea248c3eebcecf2417fbcdf8aaf1e57d1ec3211 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Mon, 25 Jan 2016 20:39:27 -0600 Subject: [PATCH 2/6] Add 5 tests for Discover shared links --- test/functional/apps/discover/_discover.js | 2 +- .../functional/apps/discover/_shared_links.js | 143 ++++++++++++++++++ test/functional/apps/discover/index.js | 3 + test/support/pages/Common.js | 4 + test/support/pages/DiscoverPage.js | 36 +++++ test/utils/getUrl.js | 10 +- 6 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 test/functional/apps/discover/_shared_links.js diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index eced6ad881378..b0cf63a0748d2 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -272,7 +272,7 @@ define(function (require) { var hasFailure = false; for (var y = 0; y < expectedBarChartData.length; y++) { stringResults += y + ': expected = ' + expectedBarChartData[y] + ', actual = ' + paths[y] + - ', Pass = ' + (Math.abs(expectedBarChartData[y] - paths[y]) < barHeightTolerance); + ', Pass = ' + (Math.abs(expectedBarChartData[y] - paths[y]) < barHeightTolerance) + '\n'; if ((Math.abs(expectedBarChartData[y] - paths[y]) > barHeightTolerance)) { hasFailure = true; }; diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js new file mode 100644 index 0000000000000..7b032e1d4dade --- /dev/null +++ b/test/functional/apps/discover/_shared_links.js @@ -0,0 +1,143 @@ +define(function (require) { + var Common = require('../../../support/pages/Common'); + var HeaderPage = require('../../../support/pages/HeaderPage'); + var SettingsPage = require('../../../support/pages/settings_page'); + var DiscoverPage = require('../../../support/pages/DiscoverPage'); + var expect = require('intern/dojo/node!expect.js'); + + return function (bdd, scenarioManager) { + bdd.describe('shared links', function describeIndexTests() { + var common; + var headerPage; + var settingsPage; + var discoverPage; + var baseUrl; + + bdd.before(function () { + common = new Common(this.remote); + headerPage = new HeaderPage(this.remote); + settingsPage = new SettingsPage(this.remote); + discoverPage = new DiscoverPage(this.remote); + + baseUrl = common.getHostPort(); + // baseUrl = 'http://localhost:5620'; + + var fromTime = '2015-09-19 06:31:44.000'; + var toTime = '2015-09-23 18:31:44.000'; + + // start each test with an empty kibana index + return scenarioManager.reload('emptyKibana') + // and load a set of makelogs data + .then(function loadIfEmptyMakelogs() { + return scenarioManager.loadIfEmpty('logstashFunctional'); + }) + .then(function (navigateTo) { + common.debug('navigateTo'); + return settingsPage.navigateTo(); + }) + .then(function () { + common.debug('createIndexPattern'); + return settingsPage.createIndexPattern(); + }) + .then(function () { + common.debug('discover'); + return common.navigateToApp('discover'); + }) + .then(function () { + common.debug('setAbsoluteRange'); + return headerPage.setAbsoluteRange(fromTime, toTime); + }) + .catch(common.handleError(this)); + }); + + + bdd.describe('shared link', function () { + var queryName1 = 'Query # 1'; + var fromTimeString = 'September 19th 2015, 06:31:44.000'; + var toTimeString = 'September 23rd 2015, 18:31:44.000'; + + bdd.it('should show "Share a link" caption', function () { + var expectedCaption = 'Share a link'; + return discoverPage.clickShare() + .then(function () { + return discoverPage.getShareCaption(); + }) + .then(function (actualCaption) { + expect(actualCaption).to.be(expectedCaption); + }) + .catch(common.handleError(this)); + }); + + + bdd.it('should show the correct formatted URL', function () { + // this is a BAD URL which includes the nav bar + var expectedUrl = baseUrl + + '/app/kibana?_t=1453775307251#' + + '/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time' + + ':(from:%272015-09-19T06:31:44.000Z%27,mode:absolute,to:%272015-09' + + '-23T18:31:44.000Z%27))&_a=(columns:!(_source),index:%27logstash-' + + '*%27,interval:auto,query:(query_string:(analyze_wildcard:!t,query' + + ':%27*%27)),sort:!(%27@timestamp%27,desc))'; + return discoverPage.getSharedUrl() + .then(function (actualUrl) { + // strip the timestamp out of each URL + expect(actualUrl.replace(/_t=\d{13}/,'_t=TIMESTAMP')) + + .to.be(expectedUrl.replace(/_t=\d{13}/,'_t=TIMESTAMP')); + }) + .catch(common.handleError(this)); + }); + + bdd.it('should show toast message for copy to clipboard', function () { + var expectedMsg = 'Share search: URL copied to clipboard.'; + return discoverPage.clickCopyToClipboard() + .then(function () { + return headerPage.getToastMessage(); + }) + .then(function (toastMessage) { + expect(toastMessage).to.be(expectedMsg); + }) + .then(function () { + return headerPage.waitForToastMessageGone(); + }) + .catch(common.handleError(this)); + }); + + // TODO: verify clipboard contents + + bdd.it('shorten URL button should produce a short URL', function () { + var re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$'); + return discoverPage.clickShortenUrl() + .then(function () { + return common.tryForTime(20 * 1000, function tryingForTime() { + return discoverPage.getShortenedUrl() + .then(function (actualUrl) { + expect(actualUrl).to.match(re); + }); + }); + }) + .catch(common.handleError(this)); + }); + + // NOTE: This test has to run immediately after the test above + // 'shorten URL button should produce a short URL' + bdd.it('should show toast message for copy to clipboard', function () { + var expectedMsg = 'Share search: URL copied to clipboard.'; + return discoverPage.clickCopyToClipboard() + .then(function () { + return headerPage.getToastMessage(); + }) + .then(function (toastMessage) { + expect(toastMessage).to.be(expectedMsg); + }) + .then(function () { + return headerPage.waitForToastMessageGone(); + }) + .catch(common.handleError(this)); + }); + + + }); + }); + }; +}); diff --git a/test/functional/apps/discover/index.js b/test/functional/apps/discover/index.js index eef3af445e9a3..c7885133e7e89 100644 --- a/test/functional/apps/discover/index.js +++ b/test/functional/apps/discover/index.js @@ -5,6 +5,7 @@ define(function (require) { var ScenarioManager = require('intern/dojo/node!../../../fixtures/scenarioManager'); var discoverTest = require('./_discover'); var fieldData = require('./_field_data'); + var sharedLinks = require('./_shared_links'); bdd.describe('discover app', function () { var scenarioManager; @@ -25,5 +26,7 @@ define(function (require) { fieldData(bdd, scenarioManager); + sharedLinks(bdd, scenarioManager); + }); }); diff --git a/test/support/pages/Common.js b/test/support/pages/Common.js index 070f4e041c896..a48f06f3ecc51 100644 --- a/test/support/pages/Common.js +++ b/test/support/pages/Common.js @@ -51,6 +51,10 @@ define(function (require) { Common.prototype = { constructor: Common, + getHostPort: function getHostPort() { + return getUrl.baseUrl(config.servers.kibana); + }, + navigateToApp: function (appName, testStatusPage) { var self = this; // navUrl includes user:password@ for use with Shield diff --git a/test/support/pages/DiscoverPage.js b/test/support/pages/DiscoverPage.js index cbaa0073f43a1..3dcf3f55fbf1c 100644 --- a/test/support/pages/DiscoverPage.js +++ b/test/support/pages/DiscoverPage.js @@ -175,6 +175,42 @@ define(function (require) { return thisTime .findAllByCssSelector('mark') .getVisibleText(); + }, + + clickShare: function clickShare() { + return thisTime + .findByCssSelector('button[aria-label="Share Search"]') + .click(); + }, + + clickShortenUrl: function clickShortenUrl() { + return thisTime + .findByCssSelector('button.shorten-button') + .click(); + }, + + clickCopyToClipboard: function clickCopyToClipboard() { + return thisTime + .findByCssSelector('button.clipboard-button') + .click(); + }, + + getShareCaption: function getShareCaption() { + return thisTime + .findByCssSelector('div.form-group > label') + .getVisibleText(); + }, + + getSharedUrl: function getSharedUrl() { + return thisTime + .findByCssSelector('.url') + .getProperty('baseURI'); + }, + + getShortenedUrl: function getShortenedUrl() { + return thisTime + .findByCssSelector('.url') + .getProperty('value'); } }; diff --git a/test/utils/getUrl.js b/test/utils/getUrl.js index 5e69bb8707162..3a1b172d7fbc9 100644 --- a/test/utils/getUrl.js +++ b/test/utils/getUrl.js @@ -8,7 +8,8 @@ var url = require('url'); * { * protocol: 'http', * hostname: 'localhost', -* port: 9220 +* port: 9220, +* auth: shield.kibanaUser.username + ':' + shield.kibanaUser.password * } * @param {object} app The params to append * example: @@ -31,3 +32,10 @@ getUrl.noAuth = function getUrlNoAuth(config, app) { }); return getUrl(config, app); }; + +getUrl.baseUrl = function getBaseUrl(config) { + config = _.pick(config, function (val, param) { + return param !== 'auth' & param !== 'pathname' & param !== 'hash'; + }); + return url.format(config); +}; From 5073aa520c11e8d498697fbcfc20a4a7571c52fc Mon Sep 17 00:00:00 2001 From: LeeDr Date: Tue, 26 Jan 2016 12:30:09 -0600 Subject: [PATCH 3/6] Share expectedToastMessage variable between tests, and comment about Firefox version changes message. --- test/functional/apps/discover/_shared_links.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 7b032e1d4dade..4d04b2b67fb8d 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -12,6 +12,8 @@ define(function (require) { var settingsPage; var discoverPage; var baseUrl; + // var expectedToastMessage = 'Share search: URL selected. Press Ctrl+C to copy.'; pre-Firefox 41 + var expectedToastMessage = 'Share search: URL copied to clipboard.'; bdd.before(function () { common = new Common(this.remote); @@ -89,13 +91,12 @@ define(function (require) { }); bdd.it('should show toast message for copy to clipboard', function () { - var expectedMsg = 'Share search: URL copied to clipboard.'; return discoverPage.clickCopyToClipboard() .then(function () { return headerPage.getToastMessage(); }) .then(function (toastMessage) { - expect(toastMessage).to.be(expectedMsg); + expect(toastMessage).to.be(expectedToastMessage); }) .then(function () { return headerPage.waitForToastMessageGone(); @@ -122,13 +123,12 @@ define(function (require) { // NOTE: This test has to run immediately after the test above // 'shorten URL button should produce a short URL' bdd.it('should show toast message for copy to clipboard', function () { - var expectedMsg = 'Share search: URL copied to clipboard.'; return discoverPage.clickCopyToClipboard() .then(function () { return headerPage.getToastMessage(); }) .then(function (toastMessage) { - expect(toastMessage).to.be(expectedMsg); + expect(toastMessage).to.be(expectedToastMessage); }) .then(function () { return headerPage.waitForToastMessageGone(); From 91fe72c89aa4bffece50e3fef10b098fd9351da0 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Tue, 26 Jan 2016 17:33:26 -0600 Subject: [PATCH 4/6] Allow either old Firefox Ctrl + C or new Firefox clipboard message. --- test/functional/apps/discover/_shared_links.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 4d04b2b67fb8d..02cba8ff69787 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -12,8 +12,11 @@ define(function (require) { var settingsPage; var discoverPage; var baseUrl; - // var expectedToastMessage = 'Share search: URL selected. Press Ctrl+C to copy.'; pre-Firefox 41 - var expectedToastMessage = 'Share search: URL copied to clipboard.'; + // The message changes for Firefox < 41 and Firefox >= 41 + // var expectedToastMessage = 'Share search: URL selected. Press Ctrl+C to copy.'; + // var expectedToastMessage = 'Share search: URL copied to clipboard.'; + // Pass either one. + var expectedToastMessage = /Share search: URL (selected. Press Ctrl+C to copy|copied to clipboard.)/; bdd.before(function () { common = new Common(this.remote); @@ -22,7 +25,6 @@ define(function (require) { discoverPage = new DiscoverPage(this.remote); baseUrl = common.getHostPort(); - // baseUrl = 'http://localhost:5620'; var fromTime = '2015-09-19 06:31:44.000'; var toTime = '2015-09-23 18:31:44.000'; @@ -54,9 +56,6 @@ define(function (require) { bdd.describe('shared link', function () { - var queryName1 = 'Query # 1'; - var fromTimeString = 'September 19th 2015, 06:31:44.000'; - var toTimeString = 'September 23rd 2015, 18:31:44.000'; bdd.it('should show "Share a link" caption', function () { var expectedCaption = 'Share a link'; @@ -72,7 +71,6 @@ define(function (require) { bdd.it('should show the correct formatted URL', function () { - // this is a BAD URL which includes the nav bar var expectedUrl = baseUrl + '/app/kibana?_t=1453775307251#' + '/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time' @@ -96,7 +94,7 @@ define(function (require) { return headerPage.getToastMessage(); }) .then(function (toastMessage) { - expect(toastMessage).to.be(expectedToastMessage); + expect(toastMessage).to.match(expectedToastMessage); }) .then(function () { return headerPage.waitForToastMessageGone(); @@ -121,14 +119,13 @@ define(function (require) { }); // NOTE: This test has to run immediately after the test above - // 'shorten URL button should produce a short URL' bdd.it('should show toast message for copy to clipboard', function () { return discoverPage.clickCopyToClipboard() .then(function () { return headerPage.getToastMessage(); }) .then(function (toastMessage) { - expect(toastMessage).to.be(expectedToastMessage); + expect(toastMessage).to.match(expectedToastMessage); }) .then(function () { return headerPage.waitForToastMessageGone(); From ef9833f4a36d4967c19593bd8d57d849b909a560 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Tue, 26 Jan 2016 17:55:58 -0600 Subject: [PATCH 5/6] Missing a period. --- test/functional/apps/discover/_shared_links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 02cba8ff69787..e446109c5c566 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -16,7 +16,7 @@ define(function (require) { // var expectedToastMessage = 'Share search: URL selected. Press Ctrl+C to copy.'; // var expectedToastMessage = 'Share search: URL copied to clipboard.'; // Pass either one. - var expectedToastMessage = /Share search: URL (selected. Press Ctrl+C to copy|copied to clipboard.)/; + var expectedToastMessage = /Share search: URL (selected. Press Ctrl+C to copy.|copied to clipboard.)/; bdd.before(function () { common = new Common(this.remote); From a30a70964ca4e7b82342d61bccb104dd3ebbc691 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Wed, 27 Jan 2016 09:16:08 -0600 Subject: [PATCH 6/6] Improve baseUrl function. --- test/utils/getUrl.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/utils/getUrl.js b/test/utils/getUrl.js index 3a1b172d7fbc9..8dd676d98b627 100644 --- a/test/utils/getUrl.js +++ b/test/utils/getUrl.js @@ -34,8 +34,5 @@ getUrl.noAuth = function getUrlNoAuth(config, app) { }; getUrl.baseUrl = function getBaseUrl(config) { - config = _.pick(config, function (val, param) { - return param !== 'auth' & param !== 'pathname' & param !== 'hash'; - }); - return url.format(config); + return url.format(_.pick(config, 'protocol', 'hostname', 'port')); };