[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 commitc5d891d44d
. * 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 commitcc4eb6ce54
. * run x-pack-firefoxSmoke group 40 times # Conflicts: # .ci/jobs.yml * run tests 80 times * Revert "run tests 80 times" This reverts commit4320c9488a
. * Revert "run x-pack-firefoxSmoke group 40 times" This reverts commitcf0d4056d7
.
This commit is contained in:
parent
df7b073789
commit
b2515c780d
|
@ -57,8 +57,8 @@ export async function setupMocha(lifecycle, log, config, providers) {
|
||||||
filterSuitesByTags({
|
filterSuitesByTags({
|
||||||
log,
|
log,
|
||||||
mocha,
|
mocha,
|
||||||
include: config.get('suiteTags.include'),
|
include: config.get('suiteTags.include').map(tag => tag.replace(/-\d+$/, '')),
|
||||||
exclude: config.get('suiteTags.exclude'),
|
exclude: config.get('suiteTags.exclude').map(tag => tag.replace(/-\d+$/, '')),
|
||||||
});
|
});
|
||||||
|
|
||||||
return mocha;
|
return mocha;
|
||||||
|
|
|
@ -12,17 +12,28 @@ const watchName = 'watch Name';
|
||||||
const updatedName = 'updatedName';
|
const updatedName = 'updatedName';
|
||||||
export default function ({ getService, getPageObjects }) {
|
export default function ({ getService, getPageObjects }) {
|
||||||
const browser = getService('browser');
|
const browser = getService('browser');
|
||||||
const find = getService('find');
|
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const testSubjects = getService('testSubjects');
|
const testSubjects = getService('testSubjects');
|
||||||
const log = getService('log');
|
const log = getService('log');
|
||||||
|
const esSupertest = getService('esSupertest');
|
||||||
const PageObjects = getPageObjects(['security', 'common', 'header', 'settings', 'watcher']);
|
const PageObjects = getPageObjects(['security', 'common', 'header', 'settings', 'watcher']);
|
||||||
|
|
||||||
describe('watcher_test', function () {
|
describe('watcher_test', function () {
|
||||||
before('initialize tests', async () => {
|
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 browser.setWindowSize(1600, 1000);
|
||||||
await PageObjects.common.navigateToApp('watcher');
|
await PageObjects.common.navigateToApp('watcher');
|
||||||
await PageObjects.watcher.clearAllWatches();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create and save a new watch', async () => {
|
it('create and save a new watch', async () => {
|
||||||
|
@ -49,10 +60,10 @@ export default function ({ getService, getPageObjects }) {
|
||||||
await PageObjects.watcher.deleteWatch(watchID);
|
await PageObjects.watcher.deleteWatch(watchID);
|
||||||
await testSubjects.click('confirmModalConfirmButton');
|
await testSubjects.click('confirmModalConfirmButton');
|
||||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||||
retry.try(async () => {
|
await retry.try(async () => {
|
||||||
const row = await find.byCssSelector('.euiTableRow');
|
const emptyPrompt = await testSubjects.find('emptyPrompt');
|
||||||
const cell = await row.findByCssSelector('td:nth-child(1)');
|
const emptyPromptText = await emptyPrompt.getVisibleText();
|
||||||
expect(cell.getVisibleText()).to.equal('No watches to show');
|
expect(emptyPromptText).to.contain('You don’t have any watches yet\n');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue