Skip to content

Commit

Permalink
Fixing functional test user roles (#75547)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Aug 20, 2020
1 parent 0223c3a commit 39b163d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/functional/apps/dashboard/embeddable_rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function ({ getService, getPageObjects }) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const pieChart = getService('pieChart');
const security = getService('security');
const dashboardExpect = getService('dashboardExpect');
const dashboardAddPanel = getService('dashboardAddPanel');
const PageObjects = getPageObjects([
Expand Down Expand Up @@ -100,6 +101,7 @@ export default function ({ getService, getPageObjects }) {

describe('dashboard embeddable rendering', function describeIndexTests() {
before(async () => {
await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']);
await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
Expand All @@ -118,6 +120,7 @@ export default function ({ getService, getPageObjects }) {
const currentUrl = await browser.getCurrentUrl();
const newUrl = currentUrl.replace(/\?.*$/, '');
await browser.get(newUrl, false);
await security.testUser.restoreDefaults();
});

it('adding visualizations', async () => {
Expand Down
3 changes: 3 additions & 0 deletions test/functional/apps/dashboard/legacy_urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const dashboardAddPanel = getService('dashboardAddPanel');
const listingTable = getService('listingTable');
const esArchiver = getService('esArchiver');
const security = getService('security');

let kibanaLegacyBaseUrl: string;
let kibanaVisualizeBaseUrl: string;
let testDashboardId: string;

describe('legacy urls', function describeIndexTests() {
before(async function () {
await security.testUser.setRoles(['kibana_admin', 'animals']);
await esArchiver.load('dashboard/current/kibana');
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.clickNewDashboard();
Expand All @@ -61,6 +63,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async function () {
await PageObjects.dashboard.gotoDashboardLandingPage();
await listingTable.deleteItem('legacyTest', testDashboardId);
await security.testUser.restoreDefaults();
});

describe('kibana link redirect', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export default async function ({ readConfigFile }) {
cluster: [],
indices: [
{
names: ['animals-*'],
names: ['animals-*', 'dogbreeds'],
privileges: ['read', 'view_index_metadata'],
field_security: { grant: ['*'], except: [] },
},
Expand Down

0 comments on commit 39b163d

Please sign in to comment.