Package org.eclipse.swtbot.swt.finder.waits

Examples of org.eclipse.swtbot.swt.finder.waits.DefaultCondition


  }

  @Test
  public void doesNotWait5SecondsAndPassesForPassingCondition() throws Exception {
    final long begin = System.currentTimeMillis();
    bot.waitUntil(new DefaultCondition() {
      public boolean test() throws Exception {
        return true;
      }

      public String getFailureMessage() {
View Full Code Here


  }

  @Test
  public void waitsLessThan5sWhenConditionSwitchToFailing() {
    final long begin = System.currentTimeMillis();
    bot.waitWhile(new DefaultCondition() {

      public String getFailureMessage() {
        return "time out";
      }
View Full Code Here

  @Test
  public void waitsMoreThan5sWhenConditionDoesNotSwitchToFailing() {
    final long begin = System.currentTimeMillis();
    try {
      bot.waitWhile(new DefaultCondition() {

        public String getFailureMessage() {
          return "time out";
        }
View Full Code Here

   * @return the tree item with the specified text.
   * @throws WidgetNotFoundException if the node was not found.
   */
  public SWTBotTreeItem getTreeItem(final String nodeText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + nodeText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   * @throws WidgetNotFoundException if the node was not found.
   * @since 1.3
   */
  public SWTBotTableItem getTableItem(final String itemText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + itemText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   * @throws WidgetNotFoundException if the node was not found.
   * @since 2.0
   */
  public SWTBotTableItem getTableItem(final int row) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find table item for row " + row; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   *
   * @param timeout the timeout in ms.
   * @throws TimeoutException if the condition does not evaluate to true after {@code timeout}ms milliseconds.
   */
  public static void waitForDisplayToAppear(long timeout) {
    waitUntil(new DefaultCondition() {

      public String getFailureMessage() {
        return "Could not find a display"; //$NON-NLS-1$
      }

View Full Code Here

      }
    });

    notify(SWT.Selection, createEvent(), parent);

    new SWTBot().waitUntil(new DefaultCondition() {
      public boolean test() throws Exception {
        return isActive();
      }

      public String getFailureMessage() {
View Full Code Here

  protected SWTBotMenu contextMenu(final Control control, final String text) {
    Matcher<MenuItem> withMnemonic = withMnemonic(text);
    final Matcher<MenuItem> matcher = allOf(widgetOfType(MenuItem.class), withMnemonic);
    final ContextMenuFinder menuFinder = new ContextMenuFinder(control);

    new SWTBot().waitUntil(new DefaultCondition() {
      public String getFailureMessage() {
        return "Could not find context menu with text: " + text; //$NON-NLS-1$
      }

      public boolean test() throws Exception {
View Full Code Here

   * @return itself.
   *
   * @throws TimeoutException if the shell could not be activated
   */
  public SWTBotShell activate() throws TimeoutException {
    new SWTBot().waitUntil(new DefaultCondition() {
      public String getFailureMessage() {
        return "Timed out waiting for " + SWTUtils.toString(widget) + " to get activated"; //$NON-NLS-1$ //$NON-NLS-2$
      }

      public boolean test() throws Exception {
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.waits.DefaultCondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.