Package net.sf.swtbot.widgets

Examples of net.sf.swtbot.widgets.SWTBotText


        bot.button( "Next >" ).click();

        // specify DN
        SWTBotCombo typeCombo = bot.comboBoxWithLabel( "RDN:" );
        typeCombo.setText( "O" );
        SWTBotText valueText = bot.text( "" );
        valueText.setText( "testCreateOrganizationEntry" );
        bot.button( "Next >" ).click();

        // wait for check that entry doesn't exist yet
        bot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.tree( 0 ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find widget";
            }
        } );

        // click finish to create the entry
        bot.button( "Finish" ).click();

        // wait till entry is created and selected in the tree
        bot.waitUntil( new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return browserTree.selection().get( 0 ).get( 0 ).startsWith( "O=testCreateOrganizationEntry" );
            }


            public String getFailureMessage()
            {
                return "Could not find widget";
            }
        } );
       
        // Now create a second entry under the previously created entry
        // to ensure that the selected parent is also upper case.
       
        // open "New Entry" wizard
        contextMenu = browserTree.contextMenu( "New Entry..." );
        contextMenu.click();

        // select entry creation method
        bot.radio( "Create entry from scratch" ).click();
        bot.button( "Next >" ).click();

        // select object classes
        bot.table( 0 ).select( "organization" );
        bot.button( "Add" ).click();
        bot.button( "Next >" ).click();
       
        // specify DN
        typeCombo = bot.comboBoxWithLabel( "RDN:" );
        typeCombo.setText( "O" );
        valueText = bot.text( "" );
        valueText.setText( "testCreateOrganizationEntry2" );
       
        // check preview text
        SWTBotText previewText = bot.text( "O=testCreateOrganizationEntry2,O=testCreateOrganizationEntry,ou=system" );
        assertEquals( "O=testCreateOrganizationEntry2,O=testCreateOrganizationEntry,ou=system", previewText.getText() );
       
        bot.button( "Next >" ).click();

        // wait for check that entry doesn't exist yet
        bot.waitUntil( new DefaultCondition()
View Full Code Here


   * @return a wrapper around a TextBox with the specified label.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.2
   */
  public SWTBotText textWithLabel(String labelText, int index) throws WidgetNotFoundException {
    return new SWTBotText(finder, labelText, index);
  }
View Full Code Here

   */
  public SWTBotText text(String text, int index) throws WidgetNotFoundException {
    List findControls = finder.findControls(new DecoratingAndMatcher(new ClassMatcher(Text.class), new TextMatcher(text)));
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any text widget");
    return new SWTBotText((Text) findControls.get(index));
  }
View Full Code Here

   * @return a wrapper around a TextBox with the specified label.
   * @throws WidgetNotFoundException if the widget is not found.
   * @since 1.2
   */
  public SWTBotText textWithLabel(String labelText, int index) throws WidgetNotFoundException {
    return new SWTBotText(finder, labelText, index);
  }
View Full Code Here

   */
  public SWTBotText text(String text, int index) throws WidgetNotFoundException {
    List findControls = finder.findControls(new DecoratingAndMatcher(new ClassMatcher(Text.class), new TextMatcher(text)));
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any text widget");
    return new SWTBotText((Text) findControls.get(index));
  }
View Full Code Here

        bot.button( "Next >" ).click();

        // specify DN
        SWTBotCombo typeCombo = bot.comboBoxWithLabel( "RDN:" );
        typeCombo.setText( "o" );
        SWTBotText valueText = bot.text( "" );
        valueText.setText( "testCreateOrganizationEntry" );
        SWTBotUtils.asyncClick( bot, bot.button( "Next >" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.tree( 0 ) != null;
View Full Code Here

        bot.button( "Next >" ).click();

        // specify DN
        SWTBotCombo typeCombo = bot.comboBoxWithLabel( "RDN:" );
        typeCombo.setText( "cn" );
        SWTBotText valueText = bot.text( "" );
        valueText.setText( "testCreatePersonEntry" );
        SWTBotUtils.asyncClick( bot, bot.button( "Next >" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.tree( 0 ) != null;
View Full Code Here

        bot.button( "Next >" ).click();

        // specify DN
        SWTBotCombo typeCombo = bot.comboBoxWithLabel( "RDN:" );
        typeCombo.setText( "O" );
        SWTBotText valueText = bot.text( "" );
        valueText.setText( "testCreateOrganizationEntry" );
        SWTBotUtils.asyncClick( bot, bot.button( "Next >" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.tree( 0 ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find widget";
            }
        } );

        // click finish to create the entry
        SWTBotUtils.asyncClick( bot, bot.button( "Finish" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return browserTree.selection().get( 0 ).get( 0 ).startsWith( "O=testCreateOrganizationEntry" );
            }


            public String getFailureMessage()
            {
                return "Could not find 'O=testCreateOrganizationEntry'";
            }
        } );

        // Now create a second entry under the previously created entry
        // to ensure that the selected parent is also upper case.

        // open "New Entry" wizard
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "New Entry..." ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "New Entry" ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find dialog 'New Entry'";
            }
        } );

        // select entry creation method
        bot.radio( "Create entry from scratch" ).click();
        bot.button( "Next >" ).click();

        // select object classes
        bot.table( 0 ).select( "organization" );
        bot.button( "Add" ).click();
        bot.button( "Next >" ).click();

        // specify DN
        typeCombo = bot.comboBoxWithLabel( "RDN:" );
        typeCombo.setText( "O" );
        valueText = bot.text( "" );
        valueText.setText( "testCreateOrganizationEntry2" );

        // check preview text
        SWTBotText previewText = bot.text( "O=testCreateOrganizationEntry2,O=testCreateOrganizationEntry,ou=system" );
        assertEquals( "O=testCreateOrganizationEntry2,O=testCreateOrganizationEntry,ou=system", previewText.getText() );

        SWTBotUtils.asyncClick( bot, bot.button( "Next >" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
View Full Code Here

        bot.button( "Next >" ).click();

        // specify DN
        SWTBotCombo typeCombo = bot.comboBoxWithLabel( "RDN:" );
        typeCombo.setText( "krb5PrincipalName" );
        SWTBotText valueText = bot.text( "" );
        valueText.setText( "kadmin/changepw@DOMAIN" );
        SWTBotUtils.asyncClick( bot, bot.button( "Next >" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.tree( 0 ) != null;
View Full Code Here

        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() );
View Full Code Here

TOP

Related Classes of net.sf.swtbot.widgets.SWTBotText

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.