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

Watcher -functional xpack test using test_user with specific permissions. #89068

Merged
merged 7 commits into from
Jan 26, 2021
11 changes: 7 additions & 4 deletions x-pack/test/functional/apps/watcher/watcher_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ export default function ({ getService, getPageObjects }) {
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const log = getService('log');
const security = getService('security');
const esSupertest = getService('esSupertest');
const PageObjects = getPageObjects(['security', 'common', 'header', 'settings', 'watcher']);

// Still flaky test :c
// https://github.com/elastic/kibana/pull/56361
// https://github.com/elastic/kibana/pull/56304
describe.skip('watcher_test', function () {
describe('watcher_test', function () {
before('initialize tests', async () => {
// There may be system watches if monitoring was previously enabled
// These cannot be deleted via the UI, so we need to delete via the API
await security.testUser.setRoles(['kibana_admin', 'watcher_admin'], false);
const watches = await esSupertest.get('/.watches/_search');

if (watches.status === 200) {
Expand Down Expand Up @@ -56,6 +55,10 @@ export default function ({ getService, getPageObjects }) {
});
});

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

it('create and save a new watch', async () => {
await PageObjects.watcher.createWatch(watchID, watchName);
const watch = await PageObjects.watcher.getWatch(watchID);
Expand Down