mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
using test_user with minimum privileges for lens functional ui tests (#76673)
* lens modified privs * lens reporting test * new role added -global_dashboard_all * remove unwanted file * added the reverted file * precommit hook fix * moved the navigateToApp to the before method * moving the navigateToApp to before method * closing the alert window if open in the test_user method * adding the false param * addressed review comments * added common PageObjects * removed common Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
37465f5c8c
commit
04a5a4c0ca
4 changed files with 46 additions and 1 deletions
|
@ -81,6 +81,9 @@ export async function createTestUserService(
|
|||
});
|
||||
|
||||
if (browser && testSubjects && shouldRefreshBrowser) {
|
||||
// accept alert if it pops up
|
||||
const alert = await browser.getAlert();
|
||||
await alert?.accept();
|
||||
if (await testSubjects.exists('kibanaChrome', { allowHidden: true })) {
|
||||
await browser.refresh();
|
||||
await testSubjects.find('kibanaChrome', config.get('timeouts.find') * 10);
|
||||
|
|
|
@ -17,6 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const retry = getService('retry');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const filterBar = getService('filterBar');
|
||||
const security = getService('security');
|
||||
|
||||
async function clickInChart(x: number, y: number) {
|
||||
const el = await elasticChart.getCanvas();
|
||||
|
@ -24,8 +25,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
}
|
||||
|
||||
describe('lens dashboard tests', () => {
|
||||
it('metric should be embeddable', async () => {
|
||||
before(async () => {
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await security.testUser.setRoles(['global_dashboard_all', 'test_logstash_reader'], false);
|
||||
});
|
||||
after(async () => {
|
||||
await security.testUser.restoreDefaults();
|
||||
});
|
||||
|
||||
it('metric should be embeddable', async () => {
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await dashboardAddPanel.clickOpenAddPanel();
|
||||
await dashboardAddPanel.filterEmbeddableNames('Artistpreviouslyknownaslens');
|
||||
|
|
|
@ -12,8 +12,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const browser = getService('browser');
|
||||
const filterBar = getService('filterBar');
|
||||
const appsMenu = getService('appsMenu');
|
||||
const security = getService('security');
|
||||
|
||||
describe('lens query context', () => {
|
||||
before(async () => {
|
||||
await security.testUser.setRoles(
|
||||
['global_discover_read', 'global_visualize_read', 'test_logstash_reader'],
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await security.testUser.restoreDefaults();
|
||||
});
|
||||
|
||||
it('should carry over time range and pinned filters to discover', async () => {
|
||||
await PageObjects.visualize.navigateToNewVisualization();
|
||||
await PageObjects.visualize.clickVisType('lens');
|
||||
|
|
|
@ -236,6 +236,28 @@ export default async function ({ readConfigFile }) {
|
|||
],
|
||||
},
|
||||
|
||||
global_discover_all: {
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
discover: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
global_dashboard_read: {
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
dashboard: ['read'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
global_discover_read: {
|
||||
kibana: [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue