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.
[Observability] [RAC] Add basic functional tests for observability al…
…erts (elastic#109876) * Add basic functional tests for observability alerts
- Loading branch information
Showing
5 changed files
with
788 additions
and
0 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
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 querystring from 'querystring'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
// Based on the x-pack/test/functional/es_archives/observability/alerts archive. | ||
const DATE_WITH_DATA = { | ||
rangeFrom: '2021-08-31T13:36:22.109Z', | ||
rangeTo: '2021-09-01T13:36:22.109Z', | ||
}; | ||
|
||
export default ({ getPageObjects, getService }: FtrProviderContext) => { | ||
const esArchiver = getService('esArchiver'); | ||
|
||
describe('Observability alerts', function () { | ||
this.tags('includeFirefox'); | ||
|
||
const pageObjects = getPageObjects(['common']); | ||
const testSubjects = getService('testSubjects'); | ||
|
||
before(async () => { | ||
await esArchiver.load('x-pack/test/functional/es_archives/observability/alerts'); | ||
await pageObjects.common.navigateToUrlWithBrowserHistory( | ||
'observability', | ||
'/alerts', | ||
`?${querystring.stringify(DATE_WITH_DATA)}` | ||
); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload('x-pack/test/functional/es_archives/observability/alerts'); | ||
}); | ||
|
||
describe('Alerts table', () => { | ||
it('Renders the table', async () => { | ||
await testSubjects.existOrFail('events-viewer-panel'); | ||
}); | ||
|
||
it('Renders the correct number of cells', async () => { | ||
// NOTE: This isn't ideal, but EuiDataGrid doesn't really have the concept of "rows" | ||
const cells = await testSubjects.findAll('dataGridRowCell'); | ||
expect(cells.length).to.be(54); | ||
}); | ||
}); | ||
}); | ||
}; |
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
Binary file not shown.
Oops, something went wrong.