Skip to content

Commit

Permalink
fix login in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlemeshko committed Oct 6, 2023
1 parent b0c2220 commit cd3d0b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext
const log = getService('log');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['timePicker']);
const PageObjects = getPageObjects(['timePicker', 'svlCommonPage']);
const config = getService('config');
let remoteEsArchiver;

Expand Down Expand Up @@ -54,6 +54,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext

await esNode.load(esArchive);
// changing the timepicker default here saves us from having to set it in Discover (~8s)
await PageObjects.svlCommonPage.login();
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.uiSettings.update({
defaultIndex: indexPatternString,
Expand All @@ -66,6 +67,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext
after(async () => {
await esArchiver.unload(esArchive);
await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings();
await PageObjects.svlCommonPage.forceLogout();
await kibanaServer.importExport.unload(fixtureDirs.lensBasic);
await kibanaServer.importExport.unload(fixtureDirs.lensDefault);
await kibanaServer.savedObjects.cleanStandardList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default ({ loadTestFile, getPageObject }: FtrProviderContext) => {
await svlCommonPage.login();
});

before(async () => {
await svlCommonPage.forceLogout();
});

loadTestFile(require.resolve('./open_in_lens/agg_based'));
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default ({ loadTestFile, getPageObject }: FtrProviderContext) => {
await svlCommonPage.login();
});

before(async () => {
await svlCommonPage.forceLogout();
});

loadTestFile(require.resolve('./open_in_lens/tsvb'));
});
};

0 comments on commit cd3d0b9

Please sign in to comment.