@amanat-qa/ui-core 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/baseForm.js +74 -0
  2. package/dist/elements/baseElement.js +443 -0
  3. package/dist/elements/baseElementChildren/button.js +25 -0
  4. package/dist/elements/baseElementChildren/checkbox.js +34 -0
  5. package/dist/elements/baseElementChildren/label.js +25 -0
  6. package/dist/elements/baseElementChildren/radioButton.js +25 -0
  7. package/dist/elements/baseElementChildren/switch.js +34 -0
  8. package/dist/elements/baseElementChildren/textbox.js +25 -0
  9. package/{src → dist}/index.js +3 -1
  10. package/dist/locators/baseLocator.js +29 -0
  11. package/dist/locators/baseLocatorChildren/ATTR.js +25 -0
  12. package/dist/locators/baseLocatorChildren/CSS.js +25 -0
  13. package/dist/locators/baseLocatorChildren/ID.js +25 -0
  14. package/dist/locators/baseLocatorChildren/TAG.js +25 -0
  15. package/dist/locators/baseLocatorChildren/TEXT.js +25 -0
  16. package/dist/locators/baseLocatorChildren/XPATH.js +25 -0
  17. package/package.json +29 -20
  18. package/src/baseForm.js +0 -57
  19. package/src/elements/baseElement.js +0 -361
  20. package/src/elements/baseElementChildren/button.js +0 -5
  21. package/src/elements/baseElementChildren/checkbox.js +0 -9
  22. package/src/elements/baseElementChildren/label.js +0 -5
  23. package/src/elements/baseElementChildren/radioButton.js +0 -5
  24. package/src/elements/baseElementChildren/switch.js +0 -9
  25. package/src/elements/baseElementChildren/textbox.js +0 -5
  26. package/src/locators/baseLocator.js +0 -13
  27. package/src/locators/baseLocatorChildren/ATTR.js +0 -5
  28. package/src/locators/baseLocatorChildren/CSS.js +0 -5
  29. package/src/locators/baseLocatorChildren/ID.js +0 -5
  30. package/src/locators/baseLocatorChildren/TAG.js +0 -5
  31. package/src/locators/baseLocatorChildren/TEXT.js +0 -5
  32. package/src/locators/baseLocatorChildren/XPATH.js +0 -5
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
6
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseElement = require('../baseElement');
17
+ var Switch = /*#__PURE__*/function (_BaseElement) {
18
+ function Switch() {
19
+ _classCallCheck(this, Switch);
20
+ return _callSuper(this, Switch, arguments);
21
+ }
22
+ _inherits(Switch, _BaseElement);
23
+ return _createClass(Switch, [{
24
+ key: "isChecked",
25
+ value: function isChecked() {
26
+ return this.getAttributeValue({
27
+ attrName: 'aria-checked'
28
+ }).then(function (value) {
29
+ return JSON.parse(value);
30
+ });
31
+ }
32
+ }]);
33
+ }(BaseElement);
34
+ module.exports = Switch;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseElement = require('../baseElement');
17
+ var Textbox = /*#__PURE__*/function (_BaseElement) {
18
+ function Textbox() {
19
+ _classCallCheck(this, Textbox);
20
+ return _callSuper(this, Textbox, arguments);
21
+ }
22
+ _inherits(Textbox, _BaseElement);
23
+ return _createClass(Textbox);
24
+ }(BaseElement);
25
+ module.exports = Textbox;
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  // Auto-generated file
2
4
 
3
5
  exports.BaseForm = require('./baseForm');
@@ -14,4 +16,4 @@ exports.CSS = require('./locators/baseLocatorChildren/CSS');
14
16
  exports.ID = require('./locators/baseLocatorChildren/ID');
15
17
  exports.TAG = require('./locators/baseLocatorChildren/TAG');
16
18
  exports.TEXT = require('./locators/baseLocatorChildren/TEXT');
17
- exports.XPATH = require('./locators/baseLocatorChildren/XPATH');
19
+ exports.XPATH = require('./locators/baseLocatorChildren/XPATH');
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
6
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _classPrivateFieldLooseBase(e, t) { if (!{}.hasOwnProperty.call(e, t)) throw new TypeError("attempted to use private field on non-instance"); return e; }
10
+ var id = 0;
11
+ function _classPrivateFieldLooseKey(e) { return "__private_" + id++ + "_" + e; }
12
+ var _value = /*#__PURE__*/_classPrivateFieldLooseKey("value");
13
+ var BaseLocator = /*#__PURE__*/function () {
14
+ function BaseLocator(value) {
15
+ _classCallCheck(this, BaseLocator);
16
+ Object.defineProperty(this, _value, {
17
+ writable: true,
18
+ value: void 0
19
+ });
20
+ _classPrivateFieldLooseBase(this, _value)[_value] = value;
21
+ }
22
+ return _createClass(BaseLocator, [{
23
+ key: "value",
24
+ get: function get() {
25
+ return _classPrivateFieldLooseBase(this, _value)[_value];
26
+ }
27
+ }]);
28
+ }();
29
+ module.exports = BaseLocator;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseLocator = require('../baseLocator');
17
+ var ATTR = /*#__PURE__*/function (_BaseLocator) {
18
+ function ATTR() {
19
+ _classCallCheck(this, ATTR);
20
+ return _callSuper(this, ATTR, arguments);
21
+ }
22
+ _inherits(ATTR, _BaseLocator);
23
+ return _createClass(ATTR);
24
+ }(BaseLocator);
25
+ module.exports = ATTR;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseLocator = require('../baseLocator');
17
+ var CSS = /*#__PURE__*/function (_BaseLocator) {
18
+ function CSS() {
19
+ _classCallCheck(this, CSS);
20
+ return _callSuper(this, CSS, arguments);
21
+ }
22
+ _inherits(CSS, _BaseLocator);
23
+ return _createClass(CSS);
24
+ }(BaseLocator);
25
+ module.exports = CSS;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseLocator = require('../baseLocator');
17
+ var ID = /*#__PURE__*/function (_BaseLocator) {
18
+ function ID() {
19
+ _classCallCheck(this, ID);
20
+ return _callSuper(this, ID, arguments);
21
+ }
22
+ _inherits(ID, _BaseLocator);
23
+ return _createClass(ID);
24
+ }(BaseLocator);
25
+ module.exports = ID;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseLocator = require('../baseLocator');
17
+ var TAG = /*#__PURE__*/function (_BaseLocator) {
18
+ function TAG() {
19
+ _classCallCheck(this, TAG);
20
+ return _callSuper(this, TAG, arguments);
21
+ }
22
+ _inherits(TAG, _BaseLocator);
23
+ return _createClass(TAG);
24
+ }(BaseLocator);
25
+ module.exports = TAG;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseLocator = require('../baseLocator');
17
+ var TEXT = /*#__PURE__*/function (_BaseLocator) {
18
+ function TEXT() {
19
+ _classCallCheck(this, TEXT);
20
+ return _callSuper(this, TEXT, arguments);
21
+ }
22
+ _inherits(TEXT, _BaseLocator);
23
+ return _createClass(TEXT);
24
+ }(BaseLocator);
25
+ module.exports = TEXT;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
+ var BaseLocator = require('../baseLocator');
17
+ var XPATH = /*#__PURE__*/function (_BaseLocator) {
18
+ function XPATH() {
19
+ _classCallCheck(this, XPATH);
20
+ return _callSuper(this, XPATH, arguments);
21
+ }
22
+ _inherits(XPATH, _BaseLocator);
23
+ return _createClass(XPATH);
24
+ }(BaseLocator);
25
+ module.exports = XPATH;
package/package.json CHANGED
@@ -1,36 +1,45 @@
1
1
  {
2
2
  "name": "@amanat-qa/ui-core",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "type": "commonjs",
8
8
  "files": [
9
- "src"
9
+ "dist"
10
10
  ],
11
11
  "keywords": [],
12
12
  "license": "MIT",
13
- "main": "./src/index.js",
13
+ "main": "./dist/index.js",
14
14
  "exports": {
15
- ".": "./src/index.js",
16
- "./baseForm": "./src/baseForm.js",
17
- "./baseElement": "./src/elements/baseElement.js",
18
- "./button": "./src/elements/baseElementChildren/button.js",
19
- "./checkbox": "./src/elements/baseElementChildren/checkbox.js",
20
- "./label": "./src/elements/baseElementChildren/label.js",
21
- "./radioButton": "./src/elements/baseElementChildren/radioButton.js",
22
- "./switch": "./src/elements/baseElementChildren/switch.js",
23
- "./textbox": "./src/elements/baseElementChildren/textbox.js",
24
- "./baseLocator": "./src/locators/baseLocator.js",
25
- "./ATTR": "./src/locators/baseLocatorChildren/ATTR.js",
26
- "./CSS": "./src/locators/baseLocatorChildren/CSS.js",
27
- "./ID": "./src/locators/baseLocatorChildren/ID.js",
28
- "./TAG": "./src/locators/baseLocatorChildren/TAG.js",
29
- "./TEXT": "./src/locators/baseLocatorChildren/TEXT.js",
30
- "./XPATH": "./src/locators/baseLocatorChildren/XPATH.js"
15
+ ".": "./dist/index.js",
16
+ "./baseForm": "./dist/baseForm.js",
17
+ "./baseElement": "./dist/elements/baseElement.js",
18
+ "./button": "./dist/elements/baseElementChildren/button.js",
19
+ "./checkbox": "./dist/elements/baseElementChildren/checkbox.js",
20
+ "./label": "./dist/elements/baseElementChildren/label.js",
21
+ "./radioButton": "./dist/elements/baseElementChildren/radioButton.js",
22
+ "./switch": "./dist/elements/baseElementChildren/switch.js",
23
+ "./textbox": "./dist/elements/baseElementChildren/textbox.js",
24
+ "./baseLocator": "./dist/locators/baseLocator.js",
25
+ "./ATTR": "./dist/locators/baseLocatorChildren/ATTR.js",
26
+ "./CSS": "./dist/locators/baseLocatorChildren/CSS.js",
27
+ "./ID": "./dist/locators/baseLocatorChildren/ID.js",
28
+ "./TAG": "./dist/locators/baseLocatorChildren/TAG.js",
29
+ "./TEXT": "./dist/locators/baseLocatorChildren/TEXT.js",
30
+ "./XPATH": "./dist/locators/baseLocatorChildren/XPATH.js"
31
+ },
32
+ "scripts": {
33
+ "build": "babel src --out-dir dist --extensions .js",
34
+ "prepare": "npm run build"
31
35
  },
32
36
  "dependencies": {
33
- "@amanat-qa/utils-frontend": "1.0.2",
37
+ "@amanat-qa/utils-frontend": "1.0.8",
34
38
  "cypress-xpath": "*"
39
+ },
40
+ "devDependencies": {
41
+ "@babel/plugin-transform-class-properties": "^7.27.1",
42
+ "@babel/plugin-transform-private-methods": "^7.27.1",
43
+ "@babel/plugin-transform-private-property-in-object": "^7.27.1"
35
44
  }
36
45
  }
package/src/baseForm.js DELETED
@@ -1,57 +0,0 @@
1
- require('cypress-xpath');
2
- const XPATH = require('./locators/baseLocatorChildren/XPATH');
3
-
4
- class BaseForm {
5
- #pageName;
6
-
7
- #pageLocator;
8
-
9
- constructor(pageLocator, pageName) {
10
- this.#pageLocator = pageLocator;
11
- this.#pageName = pageName;
12
- }
13
-
14
- getUniqueElement() {
15
- return this.#pageLocator instanceof XPATH
16
- ? cy.xpath(this.#pageLocator.value).first()
17
- : cy.get(this.#pageLocator.value).first();
18
- }
19
-
20
- pageIsVisible() {
21
- return this.getUniqueElement().isVisible();
22
- }
23
-
24
- waitPageIsExisting() {
25
- return cy.waitIsExisting(this.#pageLocator.value);
26
- }
27
-
28
- pageIsDisplayed() {
29
- cy.logger(`[inf] ▶ check ${this.#pageName} is displayed:`);
30
- return this.waitPageIsExisting().then((isExisting) => {
31
- const notDisplayedLog = `[inf] ${this.#pageName} is not displayed`;
32
- if (isExisting) {
33
- return this.pageIsVisible().then((isVisible) => {
34
- cy.logger(isVisible ? `[inf] ${this.#pageName} is displayed` : notDisplayedLog);
35
- return cy.wrap(isVisible);
36
- });
37
- }
38
-
39
- cy.logger(notDisplayedLog);
40
- return cy.wrap(isExisting);
41
- });
42
- }
43
-
44
- pageIsEnabled() {
45
- cy.logger(`[inf] ▶ check ${this.#pageName} is enabled:`);
46
- return this.getUniqueElement().waitIsEnabled().then((isEnabled) => {
47
- cy.logger(
48
- isEnabled
49
- ? `[inf] ${this.#pageName} is enabled`
50
- : `[inf] ${this.#pageName} is not enabled`,
51
- );
52
- return cy.wrap(isEnabled);
53
- });
54
- }
55
- }
56
-
57
- module.exports = BaseForm;