ViprUITestApi.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. "use strict";
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. *+------------------------------------------------------------------------+
  5. *| Licensed Materials - Property of IBM
  6. *| IBM Cognos Products: Dashboard
  7. *| (C) Copyright IBM Corp. 2018, 2020
  8. *|
  9. *| US Government Users Restricted Rights - Use, duplication or disclosure
  10. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  11. *+------------------------------------------------------------------------+
  12. */
  13. define([], function () {
  14. /**
  15. * The ViprUITestApi is a support class for the functional Test UI.
  16. * Its purpose is to allow the test framework to check and interact with a visualization from an external point of view.
  17. * In the case of VIPR, we assume that VIPR "does the right thing" and checking its structures via getItemsAtPoint/getItemsInPolygon is sufficient.
  18. * The hope is to have VIPR implement an interface and this class will simply adapt to the UITestAPI interface and not use private information.
  19. */
  20. var ViprUITestApi = function () {
  21. function ViprUITestApi() {
  22. _classCallCheck(this, ViprUITestApi);
  23. }
  24. /**
  25. * given a searchTuple of captions, return points in the visualization that match.
  26. * @param {string[]} searchTuple - an array of captions to match eg: ['2004', 'Friday'] for dataPoint which is the intersection of Year and Release Day.
  27. * @param {Object} [options] - the locations to find points
  28. * @param {boolean} [options.axis] - if true, return axis matches (eg: for bar charts)
  29. * @param {boolean} [options.legend] - if true, return legend matches
  30. * @param {boolean} [options.data] - if true, return data point matches
  31. * @returns {Object} an object with the match (or null).
  32. */
  33. ViprUITestApi.prototype.findPoint = function findPoint() /* searchTuple, options */{};
  34. /**
  35. * Take a 'snapshot' of the visualization which includes the tuples which are part of the visualization
  36. * and their selection state.
  37. * @param {Object} [filter] - VIDA spec to return only the itemInfo that matches the filter. eg: { isSelected: true }
  38. */
  39. ViprUITestApi.prototype.takeSnapshot = function takeSnapshot() /* filter */{};
  40. return ViprUITestApi;
  41. }();
  42. return ViprUITestApi;
  43. });
  44. //# sourceMappingURL=ViprUITestApi.js.map