Examples of SWTBotButton


Examples of net.sf.swtbot.widgets.SWTBotButton

        // open "New Connection" wizard
        SWTBotMenu newConnectionMenu = connectionsTree.contextMenu( "New Connection..." );
        newConnectionMenu.click();

        // get buttons
        SWTBotButton backButton = bot.button( "< Back" );
        SWTBotButton nextButton = bot.button( "Next >" );
        SWTBotButton finishButton = bot.button( "Finish" );

        // ensure "Next >" and "Finish" buttons are disabled
        assertFalse( backButton.isEnabled() );
        assertFalse( nextButton.isEnabled() );
        assertFalse( finishButton.isEnabled() );

        // enter connection parameter
        SWTBotText connText = bot.textWithLabel( "Connection name:" );
        connText.setText( "NewConnectionWizardTest" );
        SWTBotCombo hostnameCombo = bot.comboBoxWithLabel( "Hostname:" );
        hostnameCombo.setText( "localhost" );
        SWTBotCombo portCombo = bot.comboBoxWithLabel( "Port:" );
        portCombo.setText( Integer.toString( ldapService.getIpPort() ) );

        // ensure "Next >" button is enabled, "Finish" button is disabled
        assertFalse( backButton.isEnabled() );
        assertTrue( nextButton.isEnabled() );
        assertFalse( finishButton.isEnabled() );

        // jump to auth page
        nextButton.click();

        // ensure "< Back" is enabled, "Next >" button is disabled, "Finish" button is disabled
        assertTrue( backButton.isEnabled() );
        assertFalse( nextButton.isEnabled() );
        assertFalse( finishButton.isEnabled() );

        // ensure "Simple Authentication" is the default
        SWTBotCombo authMethodCombo = bot.comboBoxWithLabel( "Authentication Method" );
        assertEquals( "Simple Authentication", authMethodCombo.selection() );

        // enter authentication parameters
        SWTBotCombo dnCombo = bot.comboBoxWithLabel( "Bind DN or user:" );
        dnCombo.setText( "uid=admin,ou=system" );
        SWTBotText passwordText = bot.textWithLabel( "Bind password:" );
        passwordText.setText( "secret" );

        // ensure "< Back" is enabled, "Next >" button is enabled, "Finish" button is enabled
        assertTrue( backButton.isEnabled() );
        assertTrue( nextButton.isEnabled() );
        assertTrue( finishButton.isEnabled() );

        // finish dialog
        finishButton.click();
        bot.sleep( 2000 );

        // ensure connection was created
        ConnectionManager connectionManager = ConnectionCorePlugin.getDefault().getConnectionManager();
        assertNotNull( connectionManager.getConnections() );
View Full Code Here

Examples of net.sf.swtbot.widgets.SWTBotButton

        hostnameCombo.setText( "localhost" );
        SWTBotCombo portCombo = bot.comboBoxWithLabel( "Port:" );
        portCombo.setText( Integer.toString( ldapService.getIpPort() ) );

        // click "Check Network Parameter" button
        SWTBotButton checkButton = bot.button( "Check Network Parameter" );
        checkButton.click();
        bot.sleep( 1000 );
        bot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
            {
View Full Code Here

Examples of net.sf.swtbot.widgets.SWTBotButton

        hostnameCombo.setText( "localhost" );
        SWTBotCombo portCombo = bot.comboBoxWithLabel( "Port:" );
        portCombo.setText( Integer.toString( ldapService.getIpPort() + 1 ) );

        // click "Check Network Parameter" button
        SWTBotButton checkButton = bot.button( "Check Network Parameter" );
        checkButton.click();
        bot.sleep( 1000 );
        bot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
            {
View Full Code Here

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

    }


    protected void clickButton( final String buttonTitle )
    {
        final SWTBotButton button = bot.button( buttonTitle );
        if ( !button.isEnabled() )
        {
            bot.waitUntil( new ICondition()
            {

                public boolean test() throws Exception
                {
                    return button.isEnabled();
                }


                public void init( SWTBot bot )
                {
                }


                public String getFailureMessage()
                {
                    return "Button " + buttonTitle + " is not enabled!";
                }
            } );
        }
        button.click();
    }
View Full Code Here

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

   * @return a {@link SWTBotButton} with the specified <code>label</code>.
   */
  @SuppressWarnings("unchecked")
  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

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

   * @return a {@link SWTBotButton} with the specified <code>mnemonicText</code>.
   */
  @SuppressWarnings("unchecked")
  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

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

   * @return a {@link SWTBotButton} with the specified <code>tooltip</code>.
   */
  @SuppressWarnings("unchecked")
  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

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

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

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

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

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

   * @return a {@link SWTBotButton} with the specified <code>inGroup</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotButton buttonInGroup(String inGroup, int index) {
    Matcher matcher = allOf(widgetOfType(Button.class), inGroup(inGroup), withStyle(SWT.PUSH, "SWT.PUSH"));
    return new SWTBotButton((Button) widget(matcher, index), matcher);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.