[watcher] add missing await (#41351)

* [watcher] add missing await

* run x-pack-firefoxSmoke ciGroup 40 times, run watcher tests 20 times per job

* Fix failing watcher test

* Revert "run x-pack-firefoxSmoke ciGroup 40 times, run watcher tests 20 times per job"

This reverts commit c5d891d44d.

* Clean up watches via api

* fix linting errors

* don't swallow errors, wait for completion

* strip trailing numbers in suite tags

* run x-pack-firefoxSmoke group 40 times

* Revert "run x-pack-firefoxSmoke group 40 times"

This reverts commit cc4eb6ce54.

* run x-pack-firefoxSmoke group 40 times

# Conflicts:
#	.ci/jobs.yml

* run tests 80 times

* Revert "run tests 80 times"

This reverts commit 4320c9488a.

* Revert "run x-pack-firefoxSmoke group 40 times"

This reverts commit cf0d4056d7.
This commit is contained in:
Spencer 2019-08-15 10:49:36 -07:00 committed by GitHub
parent df7b073789
commit b2515c780d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View file

@ -57,8 +57,8 @@ export async function setupMocha(lifecycle, log, config, providers) {
filterSuitesByTags({
log,
mocha,
include: config.get('suiteTags.include'),
exclude: config.get('suiteTags.exclude'),
include: config.get('suiteTags.include').map(tag => tag.replace(/-\d+$/, '')),
exclude: config.get('suiteTags.exclude').map(tag => tag.replace(/-\d+$/, '')),
});
return mocha;

View file

@ -12,17 +12,28 @@ const watchName = 'watch Name';
const updatedName = 'updatedName';
export default function ({ getService, getPageObjects }) {
const browser = getService('browser');
const find = getService('find');
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const log = getService('log');
const esSupertest = getService('esSupertest');
const PageObjects = getPageObjects(['security', 'common', 'header', 'settings', 'watcher']);
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
const watches = await esSupertest.get('/.watches/_search');
if (watches.status === 200) {
for (const hit of watches.body.hits.hits) {
if (hit._id) {
await esSupertest.delete(`/_watcher/watch/${hit._id}`);
}
}
}
await browser.setWindowSize(1600, 1000);
await PageObjects.common.navigateToApp('watcher');
await PageObjects.watcher.clearAllWatches();
});
it('create and save a new watch', async () => {
@ -49,10 +60,10 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.watcher.deleteWatch(watchID);
await testSubjects.click('confirmModalConfirmButton');
await PageObjects.header.waitUntilLoadingHasFinished();
retry.try(async () => {
const row = await find.byCssSelector('.euiTableRow');
const cell = await row.findByCssSelector('td:nth-child(1)');
expect(cell.getVisibleText()).to.equal('No watches to show');
await retry.try(async () => {
const emptyPrompt = await testSubjects.find('emptyPrompt');
const emptyPromptText = await emptyPrompt.getVisibleText();
expect(emptyPromptText).to.contain('You dont have any watches yet\n');
});
});
});