-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
- Loading branch information
Showing
7 changed files
with
378 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* 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 ({ getPageObjects, getService }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const queryBar = getService('queryBar'); | ||
const testSubjects = getService('testSubjects'); | ||
const browser = getService('browser'); | ||
const inspector = getService('inspector'); | ||
const PageObjects = getPageObjects(['discover', 'common', 'timePicker', 'header']); | ||
|
||
describe('discover async search', () => { | ||
before(async () => { | ||
await esArchiver.loadIfNeeded('logstash_functional'); | ||
await esArchiver.load('discover/default'); | ||
await PageObjects.common.navigateToApp('discover'); | ||
await PageObjects.timePicker.setDefaultAbsoluteRange(); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
}); | ||
|
||
it('search session id should change between searches', async () => { | ||
const searchSessionId1 = await getSearchSessionId(); | ||
expect(searchSessionId1).not.to.be.empty(); | ||
await queryBar.clickQuerySubmitButton(); | ||
const searchSessionId2 = await getSearchSessionId(); | ||
expect(searchSessionId2).not.to.be(searchSessionId1); | ||
}); | ||
|
||
// NOTE: this test will be revised when | ||
// `searchSessionId` functionality actually works | ||
it('search session id should be picked up from the URL', async () => { | ||
const url = await browser.getCurrentUrl(); | ||
const fakeSearchSessionId = '__test__'; | ||
const savedSessionURL = url + `&searchSessionId=${fakeSearchSessionId}`; | ||
await browser.navigateTo(savedSessionURL); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
const searchSessionId1 = await getSearchSessionId(); | ||
expect(searchSessionId1).to.be(fakeSearchSessionId); | ||
await queryBar.clickQuerySubmitButton(); | ||
const searchSessionId2 = await getSearchSessionId(); | ||
expect(searchSessionId2).not.to.be(searchSessionId1); | ||
}); | ||
}); | ||
|
||
async function getSearchSessionId(): Promise<string> { | ||
await inspector.open(); | ||
const searchSessionId = await ( | ||
await testSubjects.find('inspectorRequestSearchSessionId') | ||
).getAttribute('data-search-session-id'); | ||
await inspector.close(); | ||
return searchSessionId; | ||
} | ||
} |
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
Binary file not shown.
Oops, something went wrong.