UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

40 lines 2.12 kB
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import _inherits from "@babel/runtime/helpers/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } import { InProductTestPageObject } from '@atlaskit/in-product-testing'; import { RendererPageObject } from './Renderer'; export var EditorPageObject = /*#__PURE__*/function (_InProductTestPageObj) { _inherits(EditorPageObject, _InProductTestPageObj); var _super = _createSuper(EditorPageObject); function EditorPageObject() { _classCallCheck(this, EditorPageObject); return _super.apply(this, arguments); } _createClass(EditorPageObject, [{ key: "getEditorArea", value: function getEditorArea() { return this.cy.get('div.ProseMirror', { timeout: 30000 }); } }, { key: "getTitleArea", value: function getTitleArea() { return this.cy.get('[data-test-id="editor-title"]'); } }, { key: "publish", value: function publish(opts) { if (opts !== null && opts !== void 0 && opts.publishButton) { this.cy.get(opts.publishButton).click(); return new RendererPageObject(this.cy); } throw Error('No publish button selector supplied!'); } }]); return EditorPageObject; }(InProductTestPageObject);