mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Dashboard tab test: attempt to fix (#206485)
Closes #203740 ## Summary After some other attempts to fix it, I saw that a different tab was selected before the test started so I added an extra step to start from the overview (this should make it more stable- locally it passed several times so I guess the issue was that other test results affected the test)
This commit is contained in:
parent
21493f7990
commit
adfd7d7ed4
2 changed files with 20 additions and 15 deletions
|
@ -224,7 +224,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
|
||||
// Helpers
|
||||
|
||||
const loginWithReadOnlyUserAndNavigateToHostsFlyout = async () => {
|
||||
const loginWithReadOnlyUser = async () => {
|
||||
await security.role.create('global_hosts_read_privileges_role', {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
|
@ -260,17 +260,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
expectSpaceSelector: false,
|
||||
}
|
||||
);
|
||||
|
||||
await pageObjects.common.navigateToApp(HOSTS_VIEW_PATH);
|
||||
await pageObjects.header.waitUntilLoadingHasFinished();
|
||||
await pageObjects.timePicker.setAbsoluteRange(
|
||||
START_SYNTHTRACE_DATE.format(DATE_PICKER_FORMAT),
|
||||
END_SYNTHTRACE_DATE.format(DATE_PICKER_FORMAT)
|
||||
);
|
||||
|
||||
await waitForPageToLoad();
|
||||
|
||||
await pageObjects.infraHostsView.clickTableOpenFlyoutButton();
|
||||
};
|
||||
|
||||
const logoutAndDeleteReadOnlyUser = async () => {
|
||||
|
@ -997,13 +986,23 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#Permissions: Read Only User - Single Host Flyout', () => {
|
||||
describe('Dashboards Tab', () => {
|
||||
before(async () => {
|
||||
await setCustomDashboardsEnabled(true);
|
||||
await loginWithReadOnlyUserAndNavigateToHostsFlyout();
|
||||
await pageObjects.assetDetails.clickDashboardsTab();
|
||||
await loginWithReadOnlyUser();
|
||||
await pageObjects.common.navigateToApp(HOSTS_VIEW_PATH);
|
||||
await pageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
await pageObjects.timePicker.setAbsoluteRange(
|
||||
START_SYNTHTRACE_DATE.format(DATE_PICKER_FORMAT),
|
||||
END_SYNTHTRACE_DATE.format(DATE_PICKER_FORMAT)
|
||||
);
|
||||
|
||||
await waitForPageToLoad();
|
||||
|
||||
await pageObjects.infraHostsView.clickTableOpenFlyoutButton();
|
||||
await browser.scrollTop();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
@ -1014,6 +1013,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
});
|
||||
|
||||
it('should render dashboards tab splash screen with disabled option to add dashboard', async () => {
|
||||
await pageObjects.assetDetails.dashboardsTabExistsOrFail();
|
||||
await pageObjects.assetDetails.clickDashboardsTab();
|
||||
await pageObjects.assetDetails.addDashboardExists();
|
||||
const elementToHover = await pageObjects.assetDetails.getAddDashboardButton();
|
||||
await retry.tryForTime(5000, async () => {
|
||||
|
|
|
@ -342,6 +342,10 @@ export function AssetDetailsProvider({ getService }: FtrProviderContext) {
|
|||
return testSubjects.exists('infraAssetDetailsDashboardsTab');
|
||||
},
|
||||
|
||||
async dashboardsTabExistsOrFail() {
|
||||
return testSubjects.existOrFail('infraAssetDetailsDashboardsTab');
|
||||
},
|
||||
|
||||
async addDashboardExists() {
|
||||
await testSubjects.existOrFail('infraAddDashboard');
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue