Search in sources :

Example 16 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project android by JetBrains.

the class CreateFileFromTemplateDialogFixture method selectKind.

@NotNull
public CreateFileFromTemplateDialogFixture selectKind(@NotNull final Kind kind) {
    JComboBoxFixture kindFixture = new JComboBoxFixture(robot(), robot().finder().findByType(target(), JComboBox.class));
    kindFixture.selectItem(kind.getTemplateName());
    return this;
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) NotNull(org.jetbrains.annotations.NotNull)

Example 17 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project flutter-intellij by flutter.

the class FlutterProjectStepFixture method enterSdkPath.

@NotNull
public FlutterProjectStepFixture enterSdkPath(@NotNull String text) {
    JComboBoxFixture comboBox = findComboBox();
    // comboBox.replaceText(text); // TODO(messick) Update combo box.
    FlutterProjectStep.ensureComboModelContainsCurrentItem(comboBox.target());
    return this;
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) NotNull(org.jetbrains.annotations.NotNull)

Example 18 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project beast2 by CompEvol.

the class BeautiStarBeastTest method simpleStarBeastTest.

@Test
public void simpleStarBeastTest() throws Exception {
    ScreenshotTaker screenshotTaker = new ScreenshotTaker();
    beauti.frame.setSize(1024, 640);
    String BASE_DIR = PREFIX.substring(0, PREFIX.lastIndexOf('/'));
    for (File file : new File(BASE_DIR).listFiles()) {
        if (file.getAbsolutePath().contains(PREFIX) && file.getName().endsWith(".png")) {
            file.delete();
        }
    }
    // create screen-shot showing template menu item
    warning("Select StarBeast template");
    beautiFrame.menuItemWithPath("File", "Template").click();
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "selectTemplate.png");
    JMenuItemFixture templateMenu = beautiFrame.menuItemWithPath("File", "Template", "StarBeast");
    templateMenu.click();
    // remove menu from screen
    beautiFrame.menuItemWithPath("File").click();
    JTabbedPaneFixture f = beautiFrame.tabbedPane();
    f = f.selectTab("Priors");
    // 1. Load gopher data 26.nex, 29.nex, 47.nex
    warning("1. Load gopher data 26.nex, 29.nex, 47.nex");
    importAlignment("examples/nexus", new File("26.nex"), new File("29.nex"), new File("47.nex"));
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "DataPartitions.png");
    printBeautiState(f);
    // 2. Define Taxon sets
    warning("2. Define taxon sets");
    f.selectTab("Taxon sets");
    beautiFrame.button("Guess").click();
    JOptionPaneFixture dialog = new JOptionPaneFixture(robot());
    // DialogFixture dialog = WindowFinder.findDialog("GuessTaxonSets").using(robot());
    dialog.radioButton("split on character").click();
    dialog.comboBox("splitCombo").selectItem("2");
    dialog.textBox("SplitChar2").deleteText().enterText("_");
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "Guess_Taxonsets.png");
    // JButton okButton = dialog.robot.finder().find(JButtonMatcher.withText("OK"));
    // new JButtonFixture(dialog.robot, okButton).click();
    dialog.okButton().click();
    printBeautiState(f);
    // 3. Set site model to HKY + empirical frequencies
    warning("3. Set site model to HKY + empirical frequencies");
    f.selectTab("Site Model");
    for (int i = 0; i < 3; i++) {
        beautiFrame.list().selectItem(i);
        beautiFrame.comboBox("substModel").selectItem("HKY");
        JComboBoxFixture freqs = beautiFrame.comboBox("frequencies");
        freqs.selectItem("Empirical");
    // beautiFrame.checkBox("mutationRate.isEstimated").check();
    }
    // JCheckBoxFixture fixMeanMutationRate = beautiFrame.checkBox("FixMeanMutationRate");
    // fixMeanMutationRate.check();
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "Site_Model.png");
    printBeautiState(f);
    // 4. Inspect clock models
    warning("4. Inspect clock models");
    f.selectTab("Clock Model");
    beautiFrame.list().selectItem(0);
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "ClockModel1.png");
    beautiFrame.list().selectItem(1);
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "ClockModel2.png");
    beautiFrame.list().selectItem(2);
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "ClockModel3.png");
    // 5. Inspect multispecies coalescent
    warning("5. Inspect multispecies coalescent");
    f.selectTab("Multi Species Coalescent");
    beautiFrame.button("treePrior.t:26.editButton").click();
    beautiFrame.button("treePrior.t:29.editButton").click();
    beautiFrame.button("treePrior.t:47.editButton").click();
    beautiFrame.comboBox().selectItem("linear_with_constant_root");
    beautiFrame.button("treePrior.t:26.editButton").click();
    beautiFrame.button("treePrior.t:29.editButton").click();
    beautiFrame.button("treePrior.t:47.editButton").click();
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "MSP.png");
    // 6. Set up MCMC parameters
    warning("6. Set up MCMC parameters");
    f = f.selectTab("MCMC");
    beautiFrame.textBox("chainLength").selectAll().setText("5000000");
    beautiFrame.button("speciesTreeLogger.editButton").click();
    beautiFrame.textBox("logEvery").selectAll().setText("1000");
    beautiFrame.button("speciesTreeLogger.editButton").click();
    beautiFrame.button("screenlog.editButton").click();
    beautiFrame.textBox("logEvery").selectAll().setText("10000");
    beautiFrame.button("speciesTreeLogger.editButton").click();
    screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "MCMC.png");
    makeSureXMLParses();
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) ScreenshotTaker(org.fest.swing.image.ScreenshotTaker) JMenuItemFixture(org.fest.swing.fixture.JMenuItemFixture) File(java.io.File) JTabbedPaneFixture(org.fest.swing.fixture.JTabbedPaneFixture) JOptionPaneFixture(org.fest.swing.fixture.JOptionPaneFixture) Test(org.junit.Test)

Example 19 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project beast2 by CompEvol.

the class LinkUnlinkTest method linkSiteModelsAndDeleteTest.

@Test
public void linkSiteModelsAndDeleteTest() throws Exception {
    warning("Load gopher data 26.nex, 47.nex, 59.nex");
    importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
    JTabbedPaneFixture f = beautiFrame.tabbedPane();
    printBeautiState(f);
    assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "birthRate.t:47", "Tree.t:59", "birthRate.t:59");
    assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWilsonBalding.t:47", "YuleBirthRateScaler.t:59", "YuleModelTreeScaler.t:59", "YuleModelTreeRootScaler.t:59", "YuleModelUniformOperator.t:59", "YuleModelSubtreeSlide.t:59", "YuleModelNarrow.t:59", "YuleModelWide.t:59", "YuleModelWilsonBalding.t:59");
    assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "YuleBirthRatePrior.t:59");
    assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "YuleModel.t:59", "birthRate.t:59");
    assertParameterCountInPriorIs(3);
    selectRows(0, 1, 2);
    warning("Link trees");
    f.selectTab("Partitions");
    beautiFrame.button("Link Trees").click();
    printBeautiState(f);
    assertParameterCountInPriorIs(3);
    f.selectTab("Site Model");
    JComboBoxFixture substModel = beautiFrame.comboBox("substModel");
    substModel.selectItem("HKY");
    assertParameterCountInPriorIs(7);
    f.selectTab("Partitions");
    warning("Link site models");
    selectRows(0, 1, 2);
    beautiFrame.button("Link Site Models").click();
    printBeautiState(f);
    assertParameterCountInPriorIs(7);
    beautiFrame.button("Unlink Site Models").click();
    printBeautiState(f);
    assertParameterCountInPriorIs(15);
    warning("Delete second partition");
    f.selectTab("Partitions");
    selectRows(1);
    beautiFrame.button("-").click();
    printBeautiState(f);
    assertParameterCountInPriorIs(10);
    warning("Delete first partition");
    f.selectTab("Partitions");
    selectRows(0, 1);
    beautiFrame.button("Link Clock Models").click();
    beautiFrame.table().selectCell(TableCell.row(0).column(1));
    beautiFrame.button("-").click();
    printBeautiState(f);
    assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "KappaPrior.s:59", "FrequenciesPrior.s:59");
    assertParameterCountInPriorIs(5);
    makeSureXMLParses();
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) File(java.io.File) JTabbedPaneFixture(org.fest.swing.fixture.JTabbedPaneFixture) Test(org.junit.Test)

Aggregations

JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)19 Test (org.junit.Test)8 NotNull (org.jetbrains.annotations.NotNull)7 JTabbedPaneFixture (org.fest.swing.fixture.JTabbedPaneFixture)5 ThemeEditorFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture)4 Component (java.awt.Component)4 File (java.io.File)4 JTextComponentFixture (org.fest.swing.fixture.JTextComponentFixture)4 JListFixture (org.fest.swing.fixture.JListFixture)3 ResourceComponent (com.android.tools.idea.editors.theme.ui.ResourceComponent)2 NewStyleDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.NewStyleDialogFixture)2 JButtonFixture (org.fest.swing.fixture.JButtonFixture)2 JCheckBoxFixture (org.fest.swing.fixture.JCheckBoxFixture)2 JMenuItemFixture (org.fest.swing.fixture.JMenuItemFixture)2 JPanelFixture (org.fest.swing.fixture.JPanelFixture)2 JSpinnerFixture (org.fest.swing.fixture.JSpinnerFixture)2 JTableFixture (org.fest.swing.fixture.JTableFixture)2 ThemeSelectionDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.ThemeSelectionDialogFixture)1 AndroidThemePreviewPanelFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.AndroidThemePreviewPanelFixture)1 PublicAtsApi (com.axway.ats.common.PublicAtsApi)1