-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
test/functional/apps/discover/_context_encoded_url_param.ts
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,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const dataGrid = getService('dataGrid'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'settings', 'header']); | ||
const testSubjects = getService('testSubjects'); | ||
const es = getService('es'); | ||
|
||
describe('context encoded id param', () => { | ||
before(async function () { | ||
await PageObjects.common.navigateToApp('settings'); | ||
await es.transport.request({ | ||
path: '/includes-plus-symbol-doc-id/_doc/1+1=2', | ||
method: 'PUT', | ||
body: { | ||
username: 'matt', | ||
'@timestamp': '2015-09-21T09:30:23', | ||
}, | ||
}); | ||
await PageObjects.settings.createIndexPattern('includes-plus-symbol-doc-id'); | ||
|
||
await kibanaServer.uiSettings.update({ 'doc_table:legacy': false }); | ||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); | ||
await PageObjects.common.navigateToApp('discover'); | ||
}); | ||
|
||
it('should navigate to context page correctly', async () => { | ||
await PageObjects.discover.selectIndexPattern('includes-plus-symbol-doc-id'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
// navigate to the context view | ||
await dataGrid.clickRowToggle({ rowIndex: 0 }); | ||
const [, surroundingActionEl] = await dataGrid.getRowActions({ | ||
isAnchorRow: false, | ||
rowIndex: 0, | ||
}); | ||
await surroundingActionEl.click(); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const headerElement = await testSubjects.find('contextDocumentSurroundingHeader'); | ||
|
||
expect(await headerElement.getVisibleText()).to.be('Documents surrounding #1+1=2'); | ||
}); | ||
}); | ||
} |