Skip to content

Commit

Permalink
[ftr] read username from config (#169755)
Browse files Browse the repository at this point in the history
## Summary

Similar to #169639

The tests fail on MKI because username is hardcoded to
`elastic_serverless`. Reading value from FTR config should fix it.
  • Loading branch information
dmlemeshko authored Oct 25, 2023
1 parent 0993ce4 commit 13d1792
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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'));
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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'));
});
});

Expand Down

0 comments on commit 13d1792

Please sign in to comment.