Skip to content
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

Add try in 2 visualize page methods that have failed. #7187

Merged
merged 1 commit into from
May 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions test/support/pages/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,14 @@ export default (function () {
},

selectField: function selectField(fieldValue) {
return this.remote
.setFindTimeout(defaultFindTimeout)
// the css below should be more selective
.findByCssSelector('option[label="' + fieldValue + '"]')
.click();
var self = this;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use an arrow function below you can get rid of this self ref.

selectField: function selectField(fieldValue) {
  return common.try(() => {
    return this.remote
    .setFindTimeout(defaultFindTimeout)
      // the css below should be more selective
    .findByCssSelector('option[label="' + fieldValue + '"]')
    .click();
  });
},

return common.try(function () {
return self.remote
.setFindTimeout(defaultFindTimeout)
// the css below should be more selective
.findByCssSelector('option[label="' + fieldValue + '"]')
.click();
});
},

orderBy: function orderBy(fieldValue) {
Expand Down Expand Up @@ -341,10 +344,12 @@ export default (function () {
var self = this;
common.debug('clickVisualizationByLinkText(' + vizName + ')');

return this.remote
return common.try(function () {
return self.remote
.setFindTimeout(defaultFindTimeout)
.findByLinkText(vizName)
.click();
});
},

// this starts by clicking the Load Saved Viz button, not from the
Expand Down