From de5a9228387defccaeb70cc143073516c9acf00f Mon Sep 17 00:00:00 2001 From: liza-mae Date: Thu, 7 Jun 2018 12:52:41 -0600 Subject: [PATCH] Remove flaky selectors: .ng-scope, .ng-binding and .ng-isolate.scope (#19688) (#19738) --- test/functional/page_objects/discover_page.js | 2 +- test/functional/page_objects/header_page.js | 2 +- test/functional/page_objects/monitoring_page.js | 2 +- test/functional/page_objects/visualize_page.js | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/functional/page_objects/discover_page.js b/test/functional/page_objects/discover_page.js index cd85e17d89bd2..49e431609b098 100644 --- a/test/functional/page_objects/discover_page.js +++ b/test/functional/page_objects/discover_page.js @@ -198,7 +198,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }) { getDocHeader() { return getRemote() - .findByCssSelector('thead.ng-isolate-scope > tr:nth-child(1)') + .findByCssSelector('thead > tr:nth-child(1)') .getVisibleText(); } diff --git a/test/functional/page_objects/header_page.js b/test/functional/page_objects/header_page.js index a03e5cf220980..f06b0ae19e0d1 100644 --- a/test/functional/page_objects/header_page.js +++ b/test/functional/page_objects/header_page.js @@ -225,7 +225,7 @@ export function HeaderPageProvider({ getService, getPageObjects }) { async getToastMessage(findTimeout = defaultFindTimeout) { const toastMessage = - await find.displayedByCssSelector('kbn-truncated.toast-message.ng-isolate-scope', findTimeout); + await find.displayedByCssSelector('kbn-truncated.toast-message', findTimeout); const messageText = await toastMessage.getVisibleText(); log.debug(`getToastMessage: ${messageText}`); return messageText; diff --git a/test/functional/page_objects/monitoring_page.js b/test/functional/page_objects/monitoring_page.js index 5935044a037ae..9407c163e5f87 100644 --- a/test/functional/page_objects/monitoring_page.js +++ b/test/functional/page_objects/monitoring_page.js @@ -39,7 +39,7 @@ export function MonitoringPageProvider({ getService }) { getToasterContents() { return getRemote() - .findByCssSelector('div.toaster-container.ng-isolate-scope') + .findByCssSelector('div.toaster-container') .getVisibleText(); } diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index ebbbb7d759766..8fb5f3672383f 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -128,7 +128,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { } async getChartTypeCount() { - const tags = await find.allByCssSelector('a.wizard-vis-type.ng-scope'); + const tags = await find.allByCssSelector('a.wizard-vis-type'); return tags.length; } @@ -394,7 +394,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { // clickBucket(bucketType) 'X-Axis', 'Split Area', 'Split Chart' async clickBucket(bucketName) { const chartTypes = await retry.try( - async () => await find.allByCssSelector('li.list-group-item.list-group-menu-item.ng-binding.ng-scope')); + async () => await find.allByCssSelector('li.list-group-item.list-group-menu-item')); log.debug('found bucket types ' + chartTypes.length); async function getChartType(chart) { @@ -442,7 +442,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { const aggItem = await find.byCssSelector(`[data-test-subj="${agg}"]`); await aggItem.click(); const fieldSelect = await find - .byCssSelector(`#visAggEditorParams${index} > [agg-param="agg.type.params[0]"] > div > div > div.ui-select-match.ng-scope > span`); + .byCssSelector(`#visAggEditorParams${index} > [agg-param="agg.type.params[0]"] > div > div > div.ui-select-match > span`); // open field selection list await fieldSelect.click(); // select our field @@ -510,7 +510,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { async orderBy(fieldValue) { await find.clickByCssSelector( 'select.form-control.ng-pristine.ng-valid.ng-untouched.ng-valid-required[ng-model="agg.params.orderBy"]' - + `option.ng-binding.ng-scope:contains("${fieldValue}")`); + + `option:contains("${fieldValue}")`); } async selectOrderBy(fieldValue) { @@ -817,12 +817,12 @@ export function VisualizePageProvider({ getService, getPageObjects }) { } async getMarkdownData() { - const markdown = await retry.try(async () => find.byCssSelector('visualize.ng-isolate-scope')); + const markdown = await retry.try(async () => find.byCssSelector('visualize')); return await markdown.getVisibleText(); } async clickColumns() { - await find.clickByCssSelector('div.schemaEditors.ng-scope > div > div > button:nth-child(2)'); + await find.clickByCssSelector('div.schemaEditors > div > div > button:nth-child(2)'); } async waitForVisualization() {