-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Unskip shared links test #168923
Merged
kertal
merged 3 commits into
elastic:main
from
kertal:discover-functional-shared-links-unskip
Oct 18, 2023
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,29 +33,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { | |
baseUrl = baseUrl.replace(':80', '').replace(':443', ''); | ||
log.debug('New baseUrl = ' + baseUrl); | ||
|
||
// delete .kibana index and update configDoc | ||
await kibanaServer.uiSettings.replace({ | ||
defaultIndex: 'logstash-*', | ||
}); | ||
|
||
log.debug('load kibana index with default index pattern'); | ||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); | ||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); | ||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); | ||
|
||
await kibanaServer.uiSettings.replace({ | ||
'state:storeInSessionStorage': storeStateInSessionStorage, | ||
defaultIndex: 'logstash-*', | ||
}); | ||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); | ||
|
||
log.debug('discover'); | ||
await PageObjects.common.navigateToApp('discover'); | ||
|
||
await PageObjects.timePicker.setDefaultAbsoluteRange(); | ||
|
||
// After hiding the time picker, we need to wait for | ||
// the refresh button to hide before clicking the share button | ||
await PageObjects.common.sleep(1000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no more reason to sleep! |
||
|
||
await PageObjects.share.clickShareTopNavButton(); | ||
|
||
return async () => { | ||
|
@@ -144,8 +133,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { | |
}); | ||
}); | ||
|
||
// FLAKY: https://github.com/elastic/kibana/issues/167405 | ||
describe.skip('shared links with state in sessionStorage', async () => { | ||
describe('shared links with state in sessionStorage', async () => { | ||
let teardown: () => Promise<void>; | ||
before(async function () { | ||
teardown = await setup({ storeStateInSessionStorage: true }); | ||
|
@@ -168,31 +156,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { | |
|
||
await browser.clearSessionStorage(); | ||
await browser.get(actualUrl, false); | ||
await retry.waitFor('shortUrl resolves and opens', async () => { | ||
await retry.try(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); | ||
await toasts.dismissAllToasts(); | ||
return true; | ||
}); | ||
await toasts.dismissAllToasts(); | ||
}); | ||
|
||
it("sharing hashed url shouldn't crash the app", async () => { | ||
const currentUrl = await browser.getCurrentUrl(); | ||
await browser.clearSessionStorage(); | ||
await browser.get(currentUrl, false); | ||
await retry.waitFor('discover to open', async () => { | ||
await retry.try(async () => { | ||
await browser.clearSessionStorage(); | ||
await browser.get(currentUrl, false); | ||
const resolvedUrl = await browser.getCurrentUrl(); | ||
expect(resolvedUrl).to.match(/discover/); | ||
const { message } = await toasts.getErrorToast(); | ||
expect(message).to.contain( | ||
const { title } = await toasts.getErrorToast(1, true); | ||
expect(title).to.contain( | ||
'Unable to completely restore the URL, be sure to use the share functionality.' | ||
); | ||
await toasts.dismissAllToasts(); | ||
return true; | ||
}); | ||
await toasts.dismissAllToasts(); | ||
}); | ||
}); | ||
}); | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting this time range by UISettings is always a bit faster than doing it via UI