/// <summary> /// Finds a selectable child widget by index and returns it /// </summary> /// <param name="index">The index of the item.</param> /// <returns>The found item.</returns> public virtual IWidget GetSelectableItem(int index) { // scroll is handled by getItemFromSelectables script object result = JsRunner.RunScript("getItemFromSelectables", ContentElement, index); IWebElement element = (IWebElement)result; return(Driver.GetWidgetForElement(element)); }
/// <summary> /// Returns the scroll step. /// </summary> /// <param name="direction">The direction.</param> /// <returns>The scroll step.</returns> public override long?GetScrollStep(string direction) { if (ReferenceEquals(direction, "y")) { return((long?)JsRunner.RunScript("getTableRowHeight", ContentElement)); } // TODO return(0); }
/// <summary> /// Scrolls the widget to the specified position /// </summary> /// <param name="direction"> "x" or "y" for horizontal/vertical scrolling </param> /// <param name="position"> Position (in pixels) to scroll to </param> public virtual void ScrollTo(string direction, int?position) { IWidget scrollBar = GetScrollbar(direction); if (scrollBar == null) { return; } JsRunner.RunScript("scrollTo", scrollBar.ContentElement, position); }
/// <summary> /// Returns the maximum scroll position of the widget /// </summary> /// <param name="direction"> "x" or "y" for horizontal/vertical maximum </param> /// <returns>The maximum scroll position in pixels.</returns> public override long?GetMaximum(string direction) { if (ReferenceEquals(direction, "y")) { return((long?)JsRunner.RunScript("getTableScrollerMaximum", ContentElement)); } // TODO return(0); }
/// <summary> /// Registers a global error handler using qx.event.GlobalError.setErrorHandler /// Caught exceptions can be retrieved using getCaughtErrors /// </summary> public virtual void RegisterGlobalErrorHandler() { JsRunner.RunScript("registerGlobalErrorHandler"); }
/// <summary> /// Registers a new log appender with the AUT's logging system. Entries can be /// accessed using getLogEvents() /// </summary> public virtual void RegisterLogAppender() { JsRunner.RunScript("registerLogAppender"); }
/// <summary> /// Returns the maximum scroll position of the widget /// </summary> /// <param name="direction"> "x" or "y" for horizontal/vertical maximum </param> /// <returns>The maximum scroll position in pixels.</returns> public override long?GetMaximum(string direction) { return((long?)JsRunner.RunScript("getScrollMax", ContentElement, direction)); }
/// <summary> /// Scrolls the widget to the specified position /// </summary> /// <param name="direction"> "x" or "y" for horizontal/vertical scrolling </param> /// <param name="position"> Position (in pixels) to scroll to </param> public override void ScrollTo(string direction, int?position) { JsRunner.RunScript("scrollTo", ContentElement, position, direction); }
/// <summary> /// Returns the current scroll position of the widget /// </summary> /// <param name="direction"> "x" or "y" for horizontal/vertical position </param> /// <returns>scroll position in pixels.</returns> public override long?GetScrollPosition(string direction) { string propertyName = "scroll" + direction.ToUpper(); return((long?)JsRunner.RunScript("getPropertyValue", ContentElement, propertyName)); }
/// <summary> /// Scrolls the widget to the specified position /// </summary> /// <param name="direction"> "x" or "y" for horizontal/vertical scrolling </param> /// <param name="position"> Position (in pixels) to scroll to </param> public override void ScrollTo(string direction, int?position) { string propertyName = "scroll" + direction.ToUpper(); JsRunner.RunScript("setPropertyValue", ContentElement, propertyName, position); }
/// <summary> /// Select the table row at position <code>rowIdx</code>. /// </summary> /// <param name="rowIdx">the index of the row to select</param> /// <param name="opened">The opened.</param> public virtual void SetNodeOpened(long?rowIdx, bool?opened) { long?result = (long?)JsRunner.RunScript("setTreeNodeOpened", ContentElement, rowIdx, opened); }
/// <summary> /// Select the table row at position <code>rowIdx</code>. /// </summary> /// <param name="rowIdx"> the index of the row to select </param> public virtual void SelectRow(long?rowIdx) { JsRunner.RunScript("selectTableRow", ContentElement, rowIdx); }