Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Fix shared links flaky test #161172

Merged
merged 3 commits into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions test/functional/apps/discover/group1/_shared_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { DISCOVER_APP_LOCATOR } from '@kbn/discover-plugin/common';
import expect from '@kbn/expect';
import { decompressFromBase64 } from 'lz-string';

import { FtrProviderContext } from '../ftr_provider_context';

Expand All @@ -21,8 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const toasts = getService('toasts');
const deployment = getService('deployment');

// Failing: See https://github.com/elastic/kibana/issues/158465
describe.skip('shared links', function describeIndexTests() {
describe('shared links', function describeIndexTests() {
let baseUrl: string;

async function setup({ storeStateInSessionStorage }: { storeStateInSessionStorage: boolean }) {
Expand Down Expand Up @@ -75,14 +75,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('permalink', function () {
it('should allow for copying the snapshot URL', async function () {
const lz =
'N4IgjgrgpgTgniAXKSsGJCANCANgQwDsBzCfYqJEAa2nhAF8cBnAexgBckBtbkAAQ4BLALZRmHfCIAO2EABNxAYxABdVTiWtcEEYWY8N' +
'IIYUUAPKrlbEJ%2BZgAsAtACo5JjrABu%2BXFXwQOVjkAMyFcDxgDRG4jeXxJADUhKAB3AEl5S2tbBxc5YTEAJSIKJFBgmFYRKgAmAAY' +
'ARgBWRzqATkcGtoAVOoA2RABmBsQAFlGAOjrpgC18oIx65taOmsHuhoAOIZHxqdnGHBgoCvF7NMII719kEGvoJD7p6Zxpf2ZKRA4YaAY' +
'GIA%3D';
const actualUrl = await PageObjects.share.getSharedUrl();
expect(actualUrl).to.contain(`?l=${DISCOVER_APP_LOCATOR}`);
expect(actualUrl).to.contain(`&lz=${lz}`);
const urlSearchParams = new URLSearchParams(actualUrl);
expect(JSON.parse(decompressFromBase64(urlSearchParams.get('lz')!)!)).to.eql({
query: {
language: 'kuery',
query: '',
},
sort: [['@timestamp', 'desc']],
columns: [],
index: 'logstash-*',
interval: 'auto',
filters: [],
dataViewId: 'logstash-*',
timeRange: {
from: '2015-09-19T06:31:44.000Z',
to: '2015-09-23T18:31:44.000Z',
},
refreshInterval: {
value: 60000,
pause: true,
},
});
});

it('should allow for copying the snapshot URL as a short URL', async function () {
Expand Down