-
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.
Browse files
Browse the repository at this point in the history
* make last stored url space aware (#62264) * fix doc type
- Loading branch information
Showing
11 changed files
with
683 additions
and
3 deletions.
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
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
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,70 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function({ getService, getPageObjects }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const PageObjects = getPageObjects(['common', 'dashboard', 'spaceSelector', 'header']); | ||
const appsMenu = getService('appsMenu'); | ||
const globalNav = getService('globalNav'); | ||
|
||
describe('preserve url', function() { | ||
before(async function() { | ||
await esArchiver.load('spaces/multi_space'); | ||
}); | ||
|
||
after(function() { | ||
return esArchiver.unload('spaces/multi_space'); | ||
}); | ||
|
||
it('goes back to last opened url', async function() { | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await PageObjects.dashboard.loadSavedDashboard('A Dashboard'); | ||
await PageObjects.common.navigateToApp('home'); | ||
await appsMenu.clickLink('Dashboard'); | ||
await PageObjects.dashboard.loadSavedDashboard('A Dashboard'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
const activeTitle = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitle).to.be('A Dashboard'); | ||
}); | ||
|
||
it('remembers url after switching spaces', async function() { | ||
// default space | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await PageObjects.dashboard.loadSavedDashboard('A Dashboard'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('another-space'); | ||
await PageObjects.spaceSelector.expectHomePage('another-space'); | ||
|
||
// other space | ||
await appsMenu.clickLink('Dashboard'); | ||
await PageObjects.dashboard.loadSavedDashboard('A Dashboard in another space'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('default'); | ||
await PageObjects.spaceSelector.expectHomePage('default'); | ||
|
||
// default space | ||
await appsMenu.clickLink('Dashboard'); | ||
await PageObjects.dashboard.waitForRenderComplete(); | ||
const activeTitleDefaultSpace = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitleDefaultSpace).to.be('A Dashboard'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('another-space'); | ||
await PageObjects.spaceSelector.expectHomePage('another-space'); | ||
|
||
// other space | ||
await appsMenu.clickLink('Dashboard'); | ||
await PageObjects.dashboard.waitForRenderComplete(); | ||
const activeTitleOtherSpace = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitleOtherSpace).to.be('A Dashboard in another space'); | ||
}); | ||
}); | ||
} |
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,69 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function({ getService, getPageObjects }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const PageObjects = getPageObjects(['common', 'discover', 'spaceSelector', 'header']); | ||
const appsMenu = getService('appsMenu'); | ||
const globalNav = getService('globalNav'); | ||
|
||
describe('preserve url', function() { | ||
before(async function() { | ||
await esArchiver.load('spaces/multi_space'); | ||
}); | ||
|
||
after(function() { | ||
return esArchiver.unload('spaces/multi_space'); | ||
}); | ||
|
||
it('goes back to last opened url', async function() { | ||
await PageObjects.common.navigateToApp('discover'); | ||
await PageObjects.discover.saveSearch('A Search'); | ||
await PageObjects.common.navigateToApp('home'); | ||
await appsMenu.clickLink('Discover'); | ||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
const activeTitle = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitle).to.be('A Search'); | ||
}); | ||
|
||
it('remembers url after switching spaces', async function() { | ||
// default space | ||
await PageObjects.common.navigateToApp('discover'); | ||
await PageObjects.discover.loadSavedSearch('A Search'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('another-space'); | ||
await PageObjects.spaceSelector.expectHomePage('another-space'); | ||
|
||
// other space | ||
await appsMenu.clickLink('Discover'); | ||
await PageObjects.discover.saveSearch('A Search in another space'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('default'); | ||
await PageObjects.spaceSelector.expectHomePage('default'); | ||
|
||
// default space | ||
await appsMenu.clickLink('Discover'); | ||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
const activeTitleDefaultSpace = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitleDefaultSpace).to.be('A Search'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('another-space'); | ||
await PageObjects.spaceSelector.expectHomePage('another-space'); | ||
|
||
// other space | ||
await appsMenu.clickLink('Discover'); | ||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
const activeTitleOtherSpace = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitleOtherSpace).to.be('A Search in another space'); | ||
}); | ||
}); | ||
} |
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,69 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function({ getService, getPageObjects }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const PageObjects = getPageObjects(['common', 'visualize', 'spaceSelector', 'visChart']); | ||
const appsMenu = getService('appsMenu'); | ||
const globalNav = getService('globalNav'); | ||
|
||
describe('preserve url', function() { | ||
before(async function() { | ||
await esArchiver.load('spaces/multi_space'); | ||
}); | ||
|
||
after(function() { | ||
return esArchiver.unload('spaces/multi_space'); | ||
}); | ||
|
||
it('goes back to last opened url', async function() { | ||
await PageObjects.common.navigateToApp('visualize'); | ||
await PageObjects.visualize.openSavedVisualization('A Pie'); | ||
await PageObjects.common.navigateToApp('home'); | ||
await appsMenu.clickLink('Visualize'); | ||
await PageObjects.visChart.waitForVisualization(); | ||
const activeTitle = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitle).to.be('A Pie'); | ||
}); | ||
|
||
it('remembers url after switching spaces', async function() { | ||
// default space | ||
await PageObjects.common.navigateToApp('visualize'); | ||
await PageObjects.visualize.openSavedVisualization('A Pie'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('another-space'); | ||
await PageObjects.spaceSelector.expectHomePage('another-space'); | ||
|
||
// other space | ||
await appsMenu.clickLink('Visualize'); | ||
await PageObjects.visualize.openSavedVisualization('A Pie in another space'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('default'); | ||
await PageObjects.spaceSelector.expectHomePage('default'); | ||
|
||
// default space | ||
await appsMenu.clickLink('Visualize'); | ||
await PageObjects.visChart.waitForVisualization(); | ||
const activeTitleDefaultSpace = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitleDefaultSpace).to.be('A Pie'); | ||
|
||
await PageObjects.spaceSelector.openSpacesNav(); | ||
await PageObjects.spaceSelector.clickSpaceAvatar('another-space'); | ||
await PageObjects.spaceSelector.expectHomePage('another-space'); | ||
|
||
// other space | ||
await appsMenu.clickLink('Visualize'); | ||
await PageObjects.visChart.waitForVisualization(); | ||
const activeTitleOtherSpace = await globalNav.getLastBreadcrumb(); | ||
expect(activeTitleOtherSpace).to.be('A Pie in another space'); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.