mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
improve preserve app cross state logic (#15464)
This commit is contained in:
parent
1c84458078
commit
c008f3225e
6 changed files with 12 additions and 33 deletions
|
@ -15,7 +15,8 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
describe('dashboard tab', function describeIndexTests() {
|
||||
before(async function () {
|
||||
return PageObjects.dashboard.initTests();
|
||||
await PageObjects.dashboard.initTests();
|
||||
await PageObjects.dashboard.preserveCrossAppState();
|
||||
});
|
||||
|
||||
after(async function () {
|
||||
|
@ -27,13 +28,6 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
|
||||
it('should be able to add visualizations to dashboard', async function addVisualizations() {
|
||||
// This flip between apps fixes the url so state is preserved when switching apps in test mode.
|
||||
// Without this flip the url in test mode looks something like
|
||||
// "http://localhost:5620/app/kibana?_t=1486069030837#/dashboard?_g=...."
|
||||
// after the initial flip, the url will look like this: "http://localhost:5620/app/kibana#/dashboard?_g=...."
|
||||
await PageObjects.header.clickVisualize();
|
||||
await PageObjects.header.clickDashboard();
|
||||
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await dashboardVisualizations.createAndAddTSVBVisualization('TSVB');
|
||||
await PageObjects.dashboard.addVisualizations(PageObjects.dashboard.getTestVisualizationNames());
|
||||
|
|
|
@ -13,7 +13,8 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
describe('dashboard queries', function describeIndexTests() {
|
||||
before(async function () {
|
||||
return PageObjects.dashboard.initTests();
|
||||
await PageObjects.dashboard.initTests();
|
||||
await PageObjects.dashboard.preserveCrossAppState();
|
||||
});
|
||||
|
||||
after(async function () {
|
||||
|
@ -25,13 +26,6 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
|
||||
it('Nested visualization query filters data as expected', async () => {
|
||||
// This flip between apps fixes the url so state is preserved when switching apps in test mode.
|
||||
// Without this flip the url in test mode looks something like
|
||||
// "http://localhost:5620/app/kibana?_t=1486069030837#/dashboard?_g=...."
|
||||
// after the initial flip, the url will look like this: "http://localhost:5620/app/kibana#/dashboard?_g=...."
|
||||
await PageObjects.header.clickVisualize();
|
||||
await PageObjects.header.clickDashboard();
|
||||
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await PageObjects.dashboard.setTimepickerInDataRange();
|
||||
|
||||
|
|
|
@ -14,12 +14,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
describe('dashboard state', function describeIndexTests() {
|
||||
before(async function () {
|
||||
await PageObjects.dashboard.initTests();
|
||||
// This flip between apps fixes the url so state is preserved when switching apps in test mode.
|
||||
// Without this flip the url in test mode looks something like
|
||||
// "http://localhost:5620/app/kibana?_t=1486069030837#/dashboard?_g=...."
|
||||
// after the initial flip, the url will look like this: "http://localhost:5620/app/kibana#/dashboard?_g=...."
|
||||
await PageObjects.header.clickVisualize();
|
||||
await PageObjects.header.clickDashboard();
|
||||
await PageObjects.dashboard.preserveCrossAppState();
|
||||
});
|
||||
|
||||
after(async function () {
|
||||
|
|
|
@ -11,10 +11,7 @@ export default function ({ getPageObjects }) {
|
|||
describe('dashboard time', function dashboardSaveWithTime() {
|
||||
before(async function () {
|
||||
await PageObjects.dashboard.initTests();
|
||||
|
||||
// This flip between apps fixes the url so state is preserved when switching apps in test mode.
|
||||
await PageObjects.header.clickVisualize();
|
||||
await PageObjects.header.clickDashboard();
|
||||
await PageObjects.dashboard.preserveCrossAppState();
|
||||
});
|
||||
|
||||
after(async function () {
|
||||
|
|
|
@ -11,6 +11,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
describe('dashboard view edit mode', function viewEditModeTests() {
|
||||
before(async function () {
|
||||
await PageObjects.dashboard.initTests();
|
||||
await PageObjects.dashboard.preserveCrossAppState();
|
||||
await kibanaServer.uiSettings.disableToastAutohide();
|
||||
await remote.refresh();
|
||||
});
|
||||
|
@ -20,13 +21,6 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
|
||||
it('create new dashboard opens in edit mode', async function () {
|
||||
// This flip between apps fixes the url so state is preserved when switching apps in test mode.
|
||||
// Without this flip the url in test mode looks something like
|
||||
// "http://localhost:5620/app/kibana?_t=1486069030837#/dashboard?_g=...."
|
||||
// after the initial flip, the url will look like this: "http://localhost:5620/app/kibana#/dashboard?_g=...."
|
||||
await PageObjects.header.clickVisualize();
|
||||
await PageObjects.header.clickDashboard();
|
||||
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await PageObjects.dashboard.clickCancelOutOfEditMode();
|
||||
});
|
||||
|
|
|
@ -34,6 +34,11 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
|
|||
await PageObjects.common.navigateToApp('dashboard');
|
||||
}
|
||||
|
||||
async preserveCrossAppState() {
|
||||
const url = await remote.getCurrentUrl();
|
||||
await remote.get(url, false);
|
||||
}
|
||||
|
||||
async clickEditVisualization() {
|
||||
log.debug('clickEditVisualization');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue