Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JButtonFixture


   
      @Test public void testMenuTemplatesAll() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
            restoreModelWithBasicmol();
            applet.menuItem("pasteTemplate").click();
            DialogFixture dialog = applet.dialog("templates");
            JButtonFixture morphineButton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Morphine")));
            morphineButton.click();
            Assert.assertEquals(2,panel.getChemModel().getMoleculeSet().getAtomContainerCount());
            Assert.assertEquals(22,panel.getChemModel().getMoleculeSet().getAtomContainer(1).getAtomCount());
      }
View Full Code Here


                if(((String)combobox.getItemAt(i)).equals("German")){
                    combobox.setSelectedIndex(i);
                    break;
                }
            }
            JButtonFixture applybutton = new JButtonFixture(dialog.robot, (JButton)dialog.robot.finder().find(new NameMatcher("apply",true)));
            applybutton.click();
            Assert.assertEquals("Neu", applet.menuItem("new").component().getText());
           
            for(int i=0;i<combobox.getItemCount();i++){
                if(((String)combobox.getItemAt(i)).equals("American English")){
                    combobox.setSelectedIndex(i);
                    System.out.println("set USA");
                    break;
                }
            }

            JButtonFixture okbutton = new JButtonFixture(dialog.robot, (JButton)dialog.robot.finder().find(new NameMatcher("ok",true)));
            okbutton.click();
           
            Assert.assertFalse(dialog.component().isShowing());
            Assert.assertEquals("New", applet.menuItem("new").component().getText()); // fails in test only?
        }
View Full Code Here

  @Test
  public void testInvalidInputDialog()
  {
    final ComponentFinder finder = BasicComponentFinder
        .finderWithCurrentAwtHierarchy();
    JButtonFixture btn = window.button();
    JTextComponentFixture url = window.textBox();
    url.enterText("not a url");
    btn.click();

    window.dialog().requireVisible();

    window.dialog().button().click();

    btn.requireEnabled();
    btn.requireEnabled();

    url.enterText("www.yahoo.com");
    url.pressKey(KeyEvent.VK_ENTER);

    final JFileChooserFixture fc = JFileChooserFinder.findFileChooser()
        .withTimeout(15000).using(window.robot);
    final JButtonFixture fBtn = btn;

    GuiActionRunner.execute(new GuiTask() {
      @Override
      public void executeInEDT()
      {
        fc.target.setSelectedFile(Files.currentFolder());
        fc.target.approveSelection();
        fBtn.requireDisabled();
        fBtn.requireDisabled();
      }
    });

    JPanel panel = (JPanel) finder.findByName("Download Progress");
    Assert.assertTrue(panel.getComponentCount() > 0);
View Full Code Here

TOP

Related Classes of org.fest.swing.fixture.JButtonFixture

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.