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

Fix console tests on cloud #138682

Merged
merged 7 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
19 changes: 17 additions & 2 deletions test/functional/apps/console/_console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const PageObjects = getPageObjects(['common', 'console', 'header']);
const toasts = getService('toasts');
const security = getService('security');
const testSubjects = getService('testSubjects');

describe('console app', function describeIndexTests() {
this.tags('includeFirefox');
Expand Down Expand Up @@ -151,7 +153,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.console.clickPlay();
};

before(async () => {
await security.testUser.setRoles(['kibana_admin', 'test_index']);
});

after(async () => {
await security.testUser.restoreDefaults();
});

beforeEach(async () => {
// Welcome fly out exists sometimes
const flyOutExists = await testSubjects.exists('euiFlyoutCloseButton');
if (flyOutExists) {
await testSubjects.click('euiFlyoutCloseButton');
}
await PageObjects.console.clearTextArea();
});

Expand All @@ -160,8 +175,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await retry.try(async () => {
const response = await PageObjects.console.getResponse();
log.debug(response);
expect(response).to.contain('# PUT test-index 200 OK');
expect(response).to.contain('# DELETE test-index 200 OK');
expect(response).to.contain('# PUT test-index 200');
expect(response).to.contain('# DELETE test-index 200');
});
});

Expand Down
15 changes: 15 additions & 0 deletions test/functional/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,21 @@ export default async function ({ readConfigFile }) {
kibana: [],
},

test_index: {
elasticsearch: {
cluster: [],
indices: [
{
names: ['test-index'],
privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'],
field_security: { grant: ['*'], except: [] },
},
],
run_as: [],
},
kibana: [],
},

index_a: {
elasticsearch: {
cluster: [],
Expand Down