Skip to content

Commit

Permalink
[Monitoring] Fix 7.5 cloud test issues (elastic#51781) (elastic#52822)
Browse files Browse the repository at this point in the history
* Fix cloud test issues

* We don't have to skip for cloud
  • Loading branch information
chrisronline authored Dec 12, 2019
1 parent e740133 commit b4a7df2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
5 changes: 4 additions & 1 deletion x-pack/test/api_integration/apis/monitoring/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*/

export default function ({ loadTestFile }) {
describe('Setup', () => {
describe('Setup', function () {
// Setup mode is not supported in cloud
this.tags(['skipCloud']);

loadTestFile(require.resolve('./collection'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {
const clusterOverview = getService('monitoringClusterOverview');
const retry = getService('retry');

describe('Monitoring is turned off', () => {
describe('Monitoring is turned off', function () {
before(async () => {
const browser = getService('browser');
await browser.setWindowSize(1600, 1000);
Expand Down
23 changes: 17 additions & 6 deletions x-pack/test/functional/services/monitoring/logstash_pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function MonitoringLogstashPipelinesProvider({ getService, getPageObjects
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const PageObjects = getPageObjects(['monitoring']);
const find = getService('find');

const SUBJ_LISTING_PAGE = 'logstashPipelinesListing';

Expand All @@ -34,6 +35,12 @@ export function MonitoringLogstashPipelinesProvider({ getService, getPageObjects
return PageObjects.monitoring.tableGetRowsFromContainer(SUBJ_TABLE_CONTAINER);
}

async waitForTableToFinishLoading() {
await retry.try(async () => {
await find.waitForDeletedByCssSelector('.euiBasicTable-loading', 5000);
});
}

async getPipelinesAll() {
const ids = await testSubjects.getVisibleTextAll(SUBJ_PIPELINES_IDS);
const eventsEmittedRates = await testSubjects.getVisibleTextAll(SUBJ_PIPELINES_EVENTS_EMITTED_RATES);
Expand All @@ -57,21 +64,25 @@ export function MonitoringLogstashPipelinesProvider({ getService, getPageObjects
async clickIdCol() {
const headerCell = await testSubjects.find(SUBJ_TABLE_SORT_ID_COL);
const button = await headerCell.findByTagName('button');
return button.click();
await button.click();
await this.waitForTableToFinishLoading();
}

async clickEventsEmittedRateCol() {
const headerCell = await testSubjects.find(SUBJ_TABLE_SORT_EVENTS_EMITTED_RATE_COL);
const button = await headerCell.findByTagName('button');
return button.click();
await button.click();
await this.waitForTableToFinishLoading();
}

setFilter(text) {
return PageObjects.monitoring.tableSetFilter(SUBJ_SEARCH_BAR, text);
async setFilter(text) {
await PageObjects.monitoring.tableSetFilter(SUBJ_SEARCH_BAR, text);
await this.waitForTableToFinishLoading();
}

clearFilter() {
return PageObjects.monitoring.tableClearFilter(SUBJ_SEARCH_BAR);
async clearFilter() {
await PageObjects.monitoring.tableClearFilter(SUBJ_SEARCH_BAR);
await this.waitForTableToFinishLoading();
}

assertNoData() {
Expand Down

0 comments on commit b4a7df2

Please sign in to comment.