#45150 appeared in 7.3 and disappeared in 7.4
This commit is contained in:
parent
6a6fc51bf8
commit
b5a0d4b03d
|
@ -25,11 +25,12 @@ export default function ({ getService, getPageObjects }) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const kibanaServer = getService('kibanaServer');
|
const kibanaServer = getService('kibanaServer');
|
||||||
const PageObjects = getPageObjects(['common', 'discover', 'share', 'timePicker']);
|
const PageObjects = getPageObjects(['common', 'discover', 'share', 'timePicker']);
|
||||||
|
const browser = getService('browser');
|
||||||
|
|
||||||
describe('shared links', function describeIndexTests() {
|
describe('shared links', function describeIndexTests() {
|
||||||
let baseUrl;
|
let baseUrl;
|
||||||
|
|
||||||
before(async function () {
|
async function setup({ storeStateInSessionStorage }) {
|
||||||
baseUrl = PageObjects.common.getHostPort();
|
baseUrl = PageObjects.common.getHostPort();
|
||||||
log.debug('baseUrl = ' + baseUrl);
|
log.debug('baseUrl = ' + baseUrl);
|
||||||
// browsers don't show the ':port' if it's 80 or 443 so we have to
|
// browsers don't show the ':port' if it's 80 or 443 so we have to
|
||||||
|
@ -47,9 +48,12 @@ export default function ({ getService, getPageObjects }) {
|
||||||
|
|
||||||
log.debug('load kibana index with default index pattern');
|
log.debug('load kibana index with default index pattern');
|
||||||
await esArchiver.load('discover');
|
await esArchiver.load('discover');
|
||||||
|
|
||||||
await esArchiver.loadIfNeeded('logstash_functional');
|
await esArchiver.loadIfNeeded('logstash_functional');
|
||||||
|
|
||||||
|
await kibanaServer.uiSettings.replace({
|
||||||
|
'state:storeInSessionStorage': storeStateInSessionStorage
|
||||||
|
});
|
||||||
|
|
||||||
log.debug('discover');
|
log.debug('discover');
|
||||||
await PageObjects.common.navigateToApp('discover');
|
await PageObjects.common.navigateToApp('discover');
|
||||||
|
|
||||||
|
@ -60,47 +64,103 @@ export default function ({ getService, getPageObjects }) {
|
||||||
await PageObjects.common.sleep(1000);
|
await PageObjects.common.sleep(1000);
|
||||||
|
|
||||||
await PageObjects.share.clickShareTopNavButton();
|
await PageObjects.share.clickShareTopNavButton();
|
||||||
});
|
|
||||||
|
|
||||||
describe('permalink', function () {
|
return async () => {
|
||||||
it('should allow for copying the snapshot URL', async function () {
|
await kibanaServer.uiSettings.replace({
|
||||||
const expectedUrl =
|
'state:storeInSessionStorage': undefined
|
||||||
baseUrl +
|
});
|
||||||
'/app/kibana?_t=1453775307251#' +
|
};
|
||||||
'/discover?_g=(refreshInterval:(pause:!t,value:0),time' +
|
}
|
||||||
':(from:\'2015-09-19T06:31:44.000Z\',to:\'2015-09' +
|
|
||||||
'-23T18:31:44.000Z\'))&_a=(columns:!(_source),index:\'logstash-' +
|
describe('shared links with state in query', async () => {
|
||||||
'*\',interval:auto,query:(language:kuery,query:\'\')' +
|
let teardown;
|
||||||
',sort:!(!(\'@timestamp\',desc)))';
|
before(async function () {
|
||||||
const actualUrl = await PageObjects.share.getSharedUrl();
|
teardown = await setup({ storeStateInSessionStorage: false });
|
||||||
// strip the timestamp out of each URL
|
|
||||||
expect(actualUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP')).to.be(
|
|
||||||
expectedUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP')
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allow for copying the snapshot URL as a short URL', async function () {
|
after(async function () {
|
||||||
const re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$');
|
await teardown();
|
||||||
await PageObjects.share.checkShortenUrl();
|
});
|
||||||
await retry.try(async () => {
|
|
||||||
|
describe('permalink', function () {
|
||||||
|
it('should allow for copying the snapshot URL', async function () {
|
||||||
|
const expectedUrl =
|
||||||
|
baseUrl +
|
||||||
|
'/app/kibana?_t=1453775307251#' +
|
||||||
|
'/discover?_g=(refreshInterval:(pause:!t,value:0),time' +
|
||||||
|
':(from:\'2015-09-19T06:31:44.000Z\',to:\'2015-09' +
|
||||||
|
'-23T18:31:44.000Z\'))&_a=(columns:!(_source),index:\'logstash-' +
|
||||||
|
'*\',interval:auto,query:(language:kuery,query:\'\')' +
|
||||||
|
',sort:!(!(\'@timestamp\',desc)))';
|
||||||
const actualUrl = await PageObjects.share.getSharedUrl();
|
const actualUrl = await PageObjects.share.getSharedUrl();
|
||||||
expect(actualUrl).to.match(re);
|
// strip the timestamp out of each URL
|
||||||
|
expect(actualUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP')).to.be(
|
||||||
|
expectedUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow for copying the snapshot URL as a short URL', async function () {
|
||||||
|
const re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$');
|
||||||
|
await PageObjects.share.checkShortenUrl();
|
||||||
|
await retry.try(async () => {
|
||||||
|
const actualUrl = await PageObjects.share.getSharedUrl();
|
||||||
|
expect(actualUrl).to.match(re);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow for copying the saved object URL', async function () {
|
||||||
|
const expectedUrl =
|
||||||
|
baseUrl +
|
||||||
|
'/app/kibana#' +
|
||||||
|
'/discover/ab12e3c0-f231-11e6-9486-733b1ac9221a' +
|
||||||
|
'?_g=(refreshInterval%3A(pause%3A!t%2Cvalue%3A0)' +
|
||||||
|
'%2Ctime%3A(from%3A\'2015-09-19T06%3A31%3A44.000Z\'%2C' +
|
||||||
|
'to%3A\'2015-09-23T18%3A31%3A44.000Z\'))';
|
||||||
|
await PageObjects.discover.loadSavedSearch('A Saved Search');
|
||||||
|
await PageObjects.share.clickShareTopNavButton();
|
||||||
|
await PageObjects.share.exportAsSavedObject();
|
||||||
|
const actualUrl = await PageObjects.share.getSharedUrl();
|
||||||
|
expect(actualUrl).to.be(expectedUrl);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should allow for copying the saved object URL', async function () {
|
describe('shared links with state in sessionStorage', async () => {
|
||||||
const expectedUrl =
|
let teardown;
|
||||||
baseUrl +
|
before(async function () {
|
||||||
'/app/kibana#' +
|
teardown = await setup({ storeStateInSessionStorage: true });
|
||||||
'/discover/ab12e3c0-f231-11e6-9486-733b1ac9221a' +
|
});
|
||||||
'?_g=(refreshInterval%3A(pause%3A!t%2Cvalue%3A0)' +
|
|
||||||
'%2Ctime%3A(from%3A\'2015-09-19T06%3A31%3A44.000Z\'%2C' +
|
after(async function () {
|
||||||
'to%3A\'2015-09-23T18%3A31%3A44.000Z\'))';
|
await teardown();
|
||||||
await PageObjects.discover.loadSavedSearch('A Saved Search');
|
});
|
||||||
await PageObjects.share.clickShareTopNavButton();
|
|
||||||
await PageObjects.share.exportAsSavedObject();
|
describe('permalink', function () {
|
||||||
const actualUrl = await PageObjects.share.getSharedUrl();
|
it('should allow for copying the snapshot URL as a short URL and should open it', async function () {
|
||||||
expect(actualUrl).to.be(expectedUrl);
|
const re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$');
|
||||||
|
await PageObjects.share.checkShortenUrl();
|
||||||
|
let actualUrl;
|
||||||
|
await retry.try(async () => {
|
||||||
|
actualUrl = await PageObjects.share.getSharedUrl();
|
||||||
|
expect(actualUrl).to.match(re);
|
||||||
|
});
|
||||||
|
|
||||||
|
const actualTime = await PageObjects.timePicker.getTimeConfig();
|
||||||
|
|
||||||
|
await browser.clearSessionStorage();
|
||||||
|
await browser.get(actualUrl, false);
|
||||||
|
await retry.waitFor(
|
||||||
|
'shortUrl resolves and opens',
|
||||||
|
async () => {
|
||||||
|
const resolvedUrl = await browser.getCurrentUrl();
|
||||||
|
expect(resolvedUrl).to.match(/discover/);
|
||||||
|
const resolvedTime = await PageObjects.timePicker.getTimeConfig();
|
||||||
|
expect(resolvedTime.start).to.equal(actualTime.start);
|
||||||
|
expect(resolvedTime.end).to.equal(actualTime.end);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -429,6 +429,15 @@ export async function BrowserProvider({ getService }: FtrProviderContext) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears session storage for the focused window/frame.
|
||||||
|
*
|
||||||
|
* @return {Promise<void>}
|
||||||
|
*/
|
||||||
|
public async clearSessionStorage(): Promise<void> {
|
||||||
|
await driver.executeScript('return window.sessionStorage.clear();');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the currently focused window. In most environments, after the window has been
|
* Closes the currently focused window. In most environments, after the window has been
|
||||||
* closed, it is necessary to explicitly switch to whatever window is now focused.
|
* closed, it is necessary to explicitly switch to whatever window is now focused.
|
||||||
|
|
Loading…
Reference in a new issue