[ftr] read username from config (#169755)

## Summary

Similar to #169639

The tests fail on MKI because username is hardcoded to
`elastic_serverless`. Reading value from FTR config should fix it.
This commit is contained in:
Dzmitry Lemechko 2023-10-25 16:01:46 +02:00 committed by GitHub
parent 0993ce4db9
commit 13d1792544
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -17,6 +17,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'svlCommonPage', 'header']);
const reportingAPI = getService('svlReportingApi');
const config = getService('config');
const navigateToReportingManagement = async () => {
log.debug(`navigating to reporting management app`);
@ -47,8 +48,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
],
};
const TEST_USERNAME = 'elastic_serverless';
const TEST_PASSWORD = 'changeme';
// Kibana CI and MKI use different users
const TEST_USERNAME = config.get('servers.kibana.username');
const TEST_PASSWORD = config.get('servers.kibana.password');
before('initialize saved object archive', async () => {
// add test saved search object

View file

@ -28,7 +28,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const cases = getService('cases');
const svlCases = getService('svlCases');
const find = getService('find');
const config = getService('config');
const retry = getService('retry');
const comboBox = getService('comboBox');
const svlCommonNavigation = getPageObject('svlCommonNavigation');
@ -453,7 +453,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const reporterText = await reporter.getVisibleText();
expect(reporterText).to.be('elastic_serverless');
expect(reporterText).to.be(config.get('servers.kibana.username'));
});
});

View file

@ -28,7 +28,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const cases = getService('cases');
const svlCases = getService('svlCases');
const find = getService('find');
const config = getService('config');
const retry = getService('retry');
const comboBox = getService('comboBox');
const svlCommonNavigation = getPageObject('svlCommonNavigation');
@ -452,7 +452,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const reporterText = await reporter.getVisibleText();
expect(reporterText).to.be('elastic_serverless');
expect(reporterText).to.be(config.get('servers.kibana.username'));
});
});