-
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.
Add test for metricbeat monitoring for ES (#77768)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
8347fd0
commit ba8213c
Showing
2 changed files
with
44 additions
and
1 deletion.
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
39 changes: 39 additions & 0 deletions
39
...st/stack_functional_integration/test/functional/apps/monitoring/_monitoring_metricbeat.js
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,39 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export default ({ getService, getPageObjects }) => { | ||
describe('monitoring app - stack functional integration - suite', () => { | ||
const browser = getService('browser'); | ||
const PageObjects = getPageObjects(['security', 'monitoring', 'common']); | ||
const log = getService('log'); | ||
const testSubjects = getService('testSubjects'); | ||
const isSaml = !!process.env.VM.includes('saml') || !!process.env.VM.includes('oidc'); | ||
|
||
before(async () => { | ||
await browser.setWindowSize(1200, 800); | ||
if (process.env.SECURITY === 'YES' && !isSaml) { | ||
await PageObjects.security.logout(); | ||
log.debug('### log in as elastic superuser to enable monitoring'); | ||
// Tests may be running as a non-superuser like `power` but that user | ||
// doesn't have the cluster privs to enable monitoring. | ||
// On the SAML config, this will fail, but the test recovers on the next | ||
// navigate and logs in as the saml user. | ||
} | ||
// navigateToApp without a username and password will default to the superuser | ||
await PageObjects.common.navigateToApp('monitoring', { insertTimestamp: false }); | ||
}); | ||
|
||
it('should have Monitoring already enabled', async () => { | ||
await testSubjects.click('esOverview'); | ||
}); | ||
|
||
after(async () => { | ||
if (process.env.SECURITY === 'YES' && !isSaml) { | ||
await PageObjects.security.forceLogout(isSaml); | ||
} | ||
}); | ||
}); | ||
}; |