Package net.sf.swtbot.widgets

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( ldapServer.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


        hostnameCombo.setText( "localhost" );
        SWTBotCombo portCombo = bot.comboBoxWithLabel( "Port:" );
        portCombo.setText( Integer.toString( ldapServer.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

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

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

        // select "LDAP" perspective
        SWTBotTable table = eBot.table();
        table.select( "LDAP" );

        // press "OK"
        SWTBotButton okButton = eBot.button( "OK" );
        okButton.click();

        // wait till Connections view become visible
        eBot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
View Full Code Here

        // select "Sleak"
        SWTBotTree tree = eBot.tree();
        SWTBotUtils.selectNode( eBot, tree, "SWT Tools", "Sleak" );

        // press "OK"
        SWTBotButton okButton = eBot.button( "OK" );
        okButton.click();

        // wait till Connections view become visible
        eBot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
View Full Code Here

   * @return a wrapper around a button with the specified text.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.0
   */
  public SWTBotButton button(String buttonText, int index) throws WidgetNotFoundException {
    return new SWTBotButton(finder, buttonText, index);
  }
View Full Code Here

   * @return a wrapper around a button with the specified label.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.0
   */
  public SWTBotButton buttonWithLabel(String labelText, final int index) throws WidgetNotFoundException {
    return new SWTBotButton(finder, labelText, index) {

      protected Widget findWidget(int index) throws WidgetNotFoundException {
        return getNextWidget(super.findWidget(index));
      }

View Full Code Here

   * @return a wrapper around a button with the specified text.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.0
   */
  public SWTBotButton button(String buttonText, int index) throws WidgetNotFoundException {
    return new SWTBotButton(finder, buttonText, index);
  }
View Full Code Here

   * @return a wrapper around a button with the specified label.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.0
   */
  public SWTBotButton buttonWithLabel(String labelText, final int index) throws WidgetNotFoundException {
    return new SWTBotButton(finder, labelText, index) {

      protected Widget findWidget(int index) throws WidgetNotFoundException {
        return getNextWidget(super.findWidget(index));
      }

View Full Code Here

        // select "LDAP" perspective
        SWTBotTable table = eBot.table();
        table.select( "LDAP" );

        // press "OK"
        SWTBotButton okButton = eBot.button( "OK" );
        okButton.click();

        // wait till Connections view become visible
        eBot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
View Full Code Here

TOP

Related Classes of net.sf.swtbot.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.