forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.0] [Exploratory view] Update index pattern permission error (elast…
…ic#122680) (elastic#123589) * [Exploratory view] Update index pattern permission error (elastic#122680) (cherry picked from commit 5ad36d2) * fix typo * fix type
- Loading branch information
Showing
13 changed files
with
96 additions
and
13 deletions.
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
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
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
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
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
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
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
52 changes: 52 additions & 0 deletions
52
x-pack/plugins/uptime/e2e/journeys/data_view_permissions.ts
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,52 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { journey, step, expect, before } from '@elastic/synthetics'; | ||
import { loginToKibana, waitForLoadingToFinish } from './utils'; | ||
import { byTestId } from './uptime.journey'; | ||
import { callKibana } from '../../../apm/scripts/create_apm_users_and_roles/helpers/call_kibana'; | ||
|
||
journey('DataViewPermissions', async ({ page, params }) => { | ||
before(async () => { | ||
await waitForLoadingToFinish({ page }); | ||
try { | ||
await callKibana({ | ||
elasticsearch: { username: 'elastic', password: 'changeme' }, | ||
kibana: { hostname: params.kibanaUrl, roleSuffix: '' }, | ||
options: { | ||
method: 'DELETE', | ||
url: '/api/saved_objects/index-pattern/synthetics_static_index_pattern_id_heartbeat_?force=false', | ||
}, | ||
}); | ||
// eslint-disable-next-line no-empty | ||
} catch (e) {} | ||
}); | ||
|
||
const queryParams = new URLSearchParams({ | ||
dateRangeStart: '2021-11-21T22:06:06.502Z', | ||
dateRangeEnd: '2021-11-21T22:10:08.203Z', | ||
}).toString(); | ||
|
||
const baseUrl = `${params.kibanaUrl}/app/uptime`; | ||
|
||
step('Go to uptime', async () => { | ||
await page.goto(`${baseUrl}?${queryParams}`, { | ||
waitUntil: 'networkidle', | ||
}); | ||
await loginToKibana({ page, user: { username: 'obs_read_user', password: 'changeme' } }); | ||
}); | ||
|
||
step('Click explore data button', async () => { | ||
await page.click(byTestId('uptimeExploreDataButton')); | ||
await waitForLoadingToFinish({ page }); | ||
await page.waitForSelector(`text=${permissionError}`); | ||
expect(await page.$(`text=${permissionError}`)).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
const permissionError = | ||
"Unable to create Data View. You don't have the required permission, please contact your admin."; |
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
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
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
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
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