forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Grok Debugger] Add functional serverless tests (elastic#172545)
- Loading branch information
1 parent
55aca66
commit 727fb13
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
x-pack/test_serverless/functional/test_suites/common/grok_debugger/grok_debugger.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,52 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default ({ getPageObjects, getService }: FtrProviderContext) => { | ||
const PageObjects = getPageObjects(['common', 'grokDebugger']); | ||
const browser = getService('browser'); | ||
const security = getService('security'); | ||
const testSubjects = getService('testSubjects'); | ||
const retry = getService('retry'); | ||
|
||
describe('Grok Debugger', function () { | ||
before(async () => { | ||
// Increase window height to ensure "Simulate" button is shown above the | ||
// fold. Otherwise it can't be clicked by the browser driver. | ||
await browser.setWindowSize(1600, 1000); | ||
await security.testUser.setRoles(['global_devtools_read', 'ingest_pipelines_user']); | ||
await PageObjects.common.navigateToApp('dev_tools', { hash: '/grokdebugger' }); | ||
await retry.waitFor('Grok Debugger Header to be visible', async () => { | ||
return testSubjects.isDisplayed('grokDebuggerContainer'); | ||
}); | ||
}); | ||
|
||
after(async () => { | ||
await security.testUser.restoreDefaults(); | ||
}); | ||
|
||
it('Loads the app', async () => { | ||
await retry.waitForWithTimeout('Grok Debugger to be visible', 15000, async () => { | ||
return await (await PageObjects.grokDebugger.simulateButton()).isDisplayed(); | ||
}); | ||
}); | ||
|
||
it('Accept and parse input with built-in grok pattern', async () => { | ||
const eventInput = 'SegerCommaBob'; | ||
const patternInput = '%{USERNAME:u}'; | ||
const response = await PageObjects.grokDebugger.executeGrokSimulation( | ||
eventInput, | ||
patternInput, | ||
null | ||
); | ||
expect(response).to.eql({ u: 'SegerCommaBob' }); | ||
}); | ||
}); | ||
}; |
14 changes: 14 additions & 0 deletions
14
x-pack/test_serverless/functional/test_suites/common/grok_debugger/index.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,14 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('Serverless Common UI - Grok debugger', function () { | ||
loadTestFile(require.resolve('./grok_debugger')); | ||
}); | ||
} |
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