{"size": 926, "ext": "js", "max_stars_repo_path": "components/cloud-foundry/frontend/test/e2e/po/widgets/cluster-settings.po.js", "max_stars_repo_name": "richard-cox/stratos-1", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "components/cloud-foundry/frontend/test/e2e/po/widgets/cluster-settings.po.js", "max_issues_repo_name": "richard-cox/stratos-1", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "components/cloud-foundry/frontend/test/e2e/po/widgets/cluster-settings.po.js", "max_forks_repo_name": "richard-cox/stratos-1", "max_forks_repo_forks_event_min_datetime": "2018-09-07T09:08:52.000Z", "max_forks_repo_forks_event_max_datetime": "2018-09-07T09:08:52.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.027027027, "max_line_length": 109, "alphanum_fraction": 0.6965442765}
(function () {
  'use strict';

  module.exports = {
    getClusterSettings: getClusterSettings,
    getItems: getItems,
    getItem: getItem,
    isExpired: isExpired,
    canReconnect: canReconnect,
    reconnect: reconnect
  };

  function getClusterSettings() {
    return element.all(by.css('.cluster-settings'));
  }

  function getItems(clusterSettings) {
    return clusterSettings.all(by.repeater('(name, cnsi) in clusterSettingsCtrl.serviceInstances'));
  }

  function getItem(clusterSettings, row) {
    return clusterSettings.all(by.repeater('(name, cnsi) in clusterSettingsCtrl.serviceInstances')).get(row);
  }

  function isExpired(item) {
    return item.element(by.css('.cluster-expired')).isPresent();
  }

  function canReconnect(item) {
    return item.element(by.linkText('Reconnect')).isDisplayed();
  }

  function reconnect(item) {
    return item.element(by.linkText('Reconnect')).click();
  }
})();
