Skip to content

Commit

Permalink
Remove flaky selectors: .ng-scope, .ng-binding and .ng-isolate.scope (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
liza-mae authored and Liza Dayoub committed Jun 7, 2018
1 parent 051c87a commit aa7effc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/functional/page_objects/discover_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/header_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/monitoring_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function MonitoringPageProvider({ getService }) {

getToasterContents() {
return getRemote()
.findByCssSelector('div.toaster-container.ng-isolate-scope')
.findByCssSelector('div.toaster-container')
.getVisibleText();
}

Expand Down
12 changes: 6 additions & 6 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit aa7effc

Please sign in to comment.