Package org.eclipse.swtbot.swt.finder.widgets

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotButton


   * @return a {@link SWTBotButton} with the specified <code>tooltip</code> with the specified <code>inGroup</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotButton buttonWithTooltipInGroup(String tooltip, String inGroup, int index) {
    Matcher matcher = allOf(widgetOfType(Button.class), withTooltip(tooltip), inGroup(inGroup), withStyle(SWT.PUSH, "SWT.PUSH"));
    return new SWTBotButton((Button) widget(matcher, index), matcher);
  }
View Full Code Here


     * NOTE: If a definition is not defined locally the global value should remain unchanged.
     * @throws Exception
     */
    @Test public void colorSchemeApplied() throws Exception {
        // Rule 5 applies
        final SWTBotButton button = bot.button("BuTToN");
        assertEquals(123, button.backgroundColor().getGreen());
        assertEquals(213, button.foregroundColor().getGreen());
        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                assertEquals(null, button.widget.getBackgroundImage());
            }
        });
View Full Code Here

        SWTBotPreferences.PLAYBACK_DELAY = 10;
        SWTBotPreferences.TYPE_INTERVAL = 1000;
    }

    @Test public void testPrompt() throws Exception {
        SWTBotButton button = bot.button("BuTToN");
        button.click();

        SWTBotLabel label = bot.label("Enter a test prompt answer:");
        assertNotNull(label);

        //Thread.sleep(10000);
View Full Code Here


    @Test public void testSingleDistinguishableFromDouble() throws Exception {
        SingleAndDblClickListener.dblClickWaitTime = 1000; // Screen shots take time

        SWTBotButton button = bot.button();
        button.click();
        assertEquals(1, preClicksHandled);

        Thread.sleep(SingleAndDblClickListener.dblClickWaitTime + 1);
        assertEquals(ACTION.SINGLE_CLICK_ACTION, actionPerformed);
        assertEquals(1, clicks);
        assertEquals(1, clicksHandled);

        button.click();
        button.click();
        assertEquals(2, preClicksHandled);
        assertEquals(ACTION.DOUBLE_CLICK_ACTION, actionPerformed);
        assertEquals(3, clicks);
        assertEquals(2, clicksHandled);

        button.click();
        assertEquals(3, preClicksHandled);
        Thread.sleep(SingleAndDblClickListener.dblClickWaitTime + 1);
        assertEquals(ACTION.SINGLE_CLICK_ACTION, actionPerformed);
        assertEquals(4, clicks);
        assertEquals(3, clicksHandled);

        button.click();
        assertEquals(4, preClicksHandled);
        Thread.sleep(SingleAndDblClickListener.dblClickWaitTime + 1);
        assertEquals(ACTION.SINGLE_CLICK_ACTION, actionPerformed);
        assertEquals(5, clicks);
        assertEquals(4, clicksHandled);
View Full Code Here

        assertEquals(4, clicksHandled);
    }

    @Test public void testDoubleClick() {
        SingleAndDblClickListener.dblClickWaitTime = 1000; // Screen shots take time
        SWTBotButton button = bot.button();
        button.click();
        button.click();
        assertEquals(ACTION.DOUBLE_CLICK_ACTION, actionPerformed);
    }
View Full Code Here

    @Test public void testCancelAction() throws InterruptedException {
        bot.button("Start Loading Action").click();
        bot.button("Cancel").click();
        try {
            SWTBotButton b = bot.button("Cancel");
            fail("Cancel button still active after loading action was canceled!");
        }catch(Throwable t) {
            assertTrue(true);
        }
    }
View Full Code Here

    @Test public void testFullLoad() {
        bot.button("Start Loading Action").click();
        bot.sleep(14000);
        try {
            SWTBotButton b = bot.button("Cancel");
            fail("Cancel button still active after loading action should have completed!");
        }catch(Throwable t) {
            assertTrue(true);
        }
    }
View Full Code Here

   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotButton buttonWithLabel(String label, int index) {
    Matcher matcher = allOf(widgetOfType(Button.class), withLabel(label), withStyle(SWT.PUSH, "SWT.PUSH"));
    return new SWTBotButton((Button) widget(matcher, index), matcher);
  }
View Full Code Here

   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotButton button(String mnemonicText, int index) {
    Matcher matcher = allOf(widgetOfType(Button.class), withMnemonic(mnemonicText), withStyle(SWT.PUSH, "SWT.PUSH"));
    return new SWTBotButton((Button) widget(matcher, index), matcher);
  }
View Full Code Here

   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotButton buttonWithTooltip(String tooltip, int index) {
    Matcher matcher = allOf(widgetOfType(Button.class), withTooltip(tooltip), withStyle(SWT.PUSH, "SWT.PUSH"));
    return new SWTBotButton((Button) widget(matcher, index), matcher);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.widgets.SWTBotButton

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.