-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Back button navigation fix 31238 (#32372)
* initial fix for navigation issue + Spencer * added navigation test for issue #31238 * added more validations to the navigate back test
- Loading branch information
Showing
3 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import expect from 'expect.js'; | ||
|
||
|
||
export default function ({ getService, getPageObjects }) { | ||
const browser = getService('browser'); | ||
const PageObjects = getPageObjects(['dashboard', 'common', 'home', 'timePicker']); | ||
const appsMenu = getService('appsMenu'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const fromTime = '2015-09-19 06:31:44.000'; | ||
const toTime = '2015-09-23 18:31:44.000'; | ||
|
||
describe('Kibana browser back navigation should work', function describeIndexTests() { | ||
|
||
before(async () => { | ||
await PageObjects.dashboard.initTests(); | ||
await kibanaServer.uiSettings.disableToastAutohide(); | ||
await browser.refresh(); | ||
}); | ||
|
||
it('detect navigate back issues', async ()=> { | ||
let currUrl; | ||
// Detects bug described in issue #31238 - where back navigation would get stuck to URL encoding handling in Angular. | ||
// Navigate to home app | ||
await PageObjects.common.navigateToApp('home'); | ||
const homeUrl = await browser.getCurrentUrl(); | ||
|
||
// Navigate to discover app | ||
await appsMenu.clickLink('Discover'); | ||
const discoverUrl = await browser.getCurrentUrl(); | ||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); | ||
const modifiedTimeDiscoverUrl = await browser.getCurrentUrl(); | ||
|
||
// Navigate to dashboard app | ||
await appsMenu.clickLink('Dashboard'); | ||
|
||
// Navigating back to discover | ||
await browser.goBack(); | ||
currUrl = await browser.getCurrentUrl(); | ||
expect(currUrl).to.be(modifiedTimeDiscoverUrl); | ||
|
||
// Navigating back from time settings | ||
await browser.goBack(); // undo time settings | ||
await browser.goBack(); // undo automatically set config, should it be in the history stack? (separate issue!) | ||
currUrl = await browser.getCurrentUrl(); | ||
// Discover view also keeps adds some default arguments into the _a URL parameter, so we can only check that the url starts the same. | ||
expect(currUrl.startsWith(discoverUrl)).to.be(true); | ||
|
||
// Navigate back home | ||
await browser.goBack(); | ||
currUrl = await browser.getCurrentUrl(); | ||
expect(currUrl).to.be(homeUrl); | ||
}); | ||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters