-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove flaky selectors: .ng-scope, .ng-binding and .ng-isolate.scope #19688
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Likewise, the toaster notifications are a singleton, so there's no chance we could be accidentally selecting a different element here. |
||
const messageText = await toastMessage.getVisibleText(); | ||
log.debug(`getToastMessage: ${messageText}`); | ||
return messageText; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ export function MonitoringPageProvider({ getService }) { | |
|
||
getToasterContents() { | ||
return getRemote() | ||
.findByCssSelector('div.toaster-container.ng-isolate-scope') | ||
.findByCssSelector('div.toaster-container') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Same as above. |
||
.getVisibleText(); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,7 +128,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { | |
} | ||
|
||
async getChartTypeCount() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this function is ever called, and the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though it is not used, I will leave it up to the visualization team to remove it, if they don't intend to use it. |
||
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')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, a later PR to address adding data-test-subj sounds best. This PR is just a quick fix to get things running on cloud. |
||
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`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 This selector's high specificity and dependence upon |
||
// 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}")`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
} | ||
|
||
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')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There's only one instance of |
||
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)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
} | ||
|
||
async waitForVisualization() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I only see one
thead
on the page, so there's no chance that this could be accidentally selecting a differentthead
that happens to not have.ng-isolate-scope
applied.