Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JButtonFixture.click()


        applet.menuItem("open").click();
        dialog = applet.dialog();
        text = dialog.textBox();
        text.setText(file.toString());
        okbutton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Open")));
        okbutton.click();
        //save should write to mol2, ie mol1=6 atoms, mol2=7atoms
        applet.menuItem("save").click();
        file=new File(System.getProperty("java.io.tmpdir")+File.separator+"test1.mol");
        reader = new MDLReader(new FileInputStream(file));
        mol = (IAtomContainer)reader.read(DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class));
View Full Code Here


        applet.menuItem("showACProperties").click();
        DialogFixture dialog = applet.dialog();
        JTextComponent textfield = dialog.robot.finder().find(JTextComponentMatcher.withName("Title"));
        textfield.setText("aaa");
        JButtonFixture okbutton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("OK")));
        okbutton.click();
        applet.menuItem("save").click();
        dialog = applet.dialog();
        File file=new File(System.getProperty("java.io.tmpdir")+File.separator+"test.mol");
        if(file.exists())
            file.delete();
View Full Code Here

        JComboBox combobox = dialog.robot.finder().find(new ComboBoxTextComponentMatcher("org.openscience.jchempaint.io.JCPFileFilter"));
        combobox.setSelectedItem(combobox.getItemAt(SAVE_AS_MOL_COMBOBOX_POS));
        JTextComponentFixture text = dialog.textBox();
        text.setText(file.toString());
        JButtonFixture savebutton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Save")));
        savebutton.click();
        MDLReader reader = new MDLReader(new FileInputStream(file));
        IAtomContainer mol = (IAtomContainer)reader.read(DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class));
        Assert.assertEquals("aaa",(String)mol.getProperty(CDKConstants.TITLE));
  }
View Full Code Here

              Assert.assertFalse(index < 0);
              combobox.setSelectedIndex(index);
        JTextComponentFixture text = dialog.textBox();
        text.setText(file.toString());
        JButtonFixture okbutton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Save")));
        okbutton.click();
        MDLReader reader = null;
        try {
          reader = new MDLReader(new FileInputStream(file));
        } catch (Exception e) {
          // TODO Auto-generated catch block
View Full Code Here

          applet.menuItem("open").click();
          DialogFixture dialog = applet.dialog();
          JTextComponentFixture text = dialog.textBox();
          text.setText(file.toString());
          JButtonFixture okbutton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Open")));
          okbutton.click();
              ins = this.getClass().getClassLoader().getResourceAsStream(filename);
              MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
              ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile());
              Assert.assertNotNull(chemFile);
              List<IAtomContainer> containersList = ChemFileManipulator.getAllAtomContainers(chemFile);
View Full Code Here

              //JComboBox combobox = dialog.robot.finder().find(new ComboBoxTextComponentMatcher("org.openscience.jchempaint.io.JCPFileFilter","org.openscience.jchempaint.io.JCPSaveFileFilter"));
                  //combobox.setSelectedItem(combobox.getItemAt(2));
              JTextComponentFixture text = dialog.textBox();
              text.setText(file.toString());
              JButtonFixture okbutton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Open")));
              okbutton.click();
              DialogFixture coordsdialog = new DialogFixture(applet.robot, applet.robot.finder().find(new DialogTitleComponentMatcher("No 2D coordinates")));
              JButtonFixture okbuttoncoordsdialog = new JButtonFixture(coordsdialog.robot, coordsdialog.robot.finder().find(new ButtonTextComponentMatcher("Yes")));
              okbuttoncoordsdialog.click();
                  ins = this.getClass().getClassLoader().getResourceAsStream(filename);
                  SMILESReader reader = new SMILESReader(ins);
View Full Code Here

              text.setText(file.toString());
              JButtonFixture okbutton = new JButtonFixture(dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Open")));
              okbutton.click();
              DialogFixture coordsdialog = new DialogFixture(applet.robot, applet.robot.finder().find(new DialogTitleComponentMatcher("No 2D coordinates")));
              JButtonFixture okbuttoncoordsdialog = new JButtonFixture(coordsdialog.robot, coordsdialog.robot.finder().find(new ButtonTextComponentMatcher("Yes")));
              okbuttoncoordsdialog.click();
                  ins = this.getClass().getClassLoader().getResourceAsStream(filename);
                  SMILESReader reader = new SMILESReader(ins);
                  ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile());
                  Assert.assertNotNull(chemFile);
                  List<IAtomContainer> containersList = ChemFileManipulator.getAllAtomContainers(chemFile);
View Full Code Here

      @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());
      }

        @Test public void testSwitchLanguage(){
View Full Code Here

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

                    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

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.