Skip to content

Commit

Permalink
Watcher -functional xpack test using test_user with specific permissi…
Browse files Browse the repository at this point in the history
…ons. (#89068)

* fixes #74449

* watcher test with specific permissions

* adding the false parameter

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
rashmivkulkarni and kibanamachine authored Jan 26, 2021
1 parent 0c2c451 commit 87992d0
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit 87992d0

Please sign in to comment.