Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Fixing functional test user roles (#75547) #75570

Merged
merged 1 commit into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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