use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproNoiseTest method openObservationAndCaptureOIFitsFiles.
/*
--- Utility methods ---------------------------------------------------------
*/
private void openObservationAndCaptureOIFitsFiles(final String obsFileName) {
openObservation("noise/" + obsFileName + ".asprox");
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
selectTab(SettingPanel.TAB_OIFITS_VIEWER);
final JPanelFixture oifitsView = window.panel("plotView");
final JComboBoxFixture comboPlotDef = oifitsView.comboBox("plotDefinitionComboBox");
final String[] plotDefNames = comboPlotDef.contents();
// System.out.println("plotDefNames: " + Arrays.toString(plotDefNames));
// select preset Residuals:
// last-3 corresponds to Residuals
comboPlotDef.selectItem(plotDefNames.length - 3);
final JPanelFixture mainForm = window.panel("observationForm");
final JSpinnerFixture dateSpinner = mainForm.spinner("jDateSpinner");
final JPanelFixture plot = window.panel("plotChartPanel");
int i = 1;
do {
// Capture plot screenshot :
saveScreenshot(plot, obsFileName + "-SNR_" + i + ".png");
// Export OIFits :
exportOIFits(obsFileName + "_" + i + ".oifits");
dateSpinner.increment();
dateSpinner.decrement();
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// let plot update:
pauseShort();
} while (i++ <= 10);
}
use of org.fest.swing.fixture.JPanelFixture in project android by JetBrains.
the class MessagesFixture method findByTitle.
@NotNull
public static MessagesFixture findByTitle(@NotNull Robot robot, @NotNull String title) {
if (Messages.canShowMacSheetPanel()) {
JPanelFixture panelFixture = findMacSheetByTitle(robot, title);
JDialog dialog = (JDialog) SwingUtilities.getWindowAncestor(panelFixture.target());
return new MessagesFixture(panelFixture, dialog);
}
MessageDialogFixture dialog = MessageDialogFixture.findByTitle(robot, title);
return new MessagesFixture(dialog, dialog.target());
}
use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproDocJUnitTest method m020_shouldShowCharaPoPs.
/**
* Test Chara PoPs
*/
@Test
@GUITest
public void m020_shouldShowCharaPoPs() {
// show observability plot :
getMainTabbedPane().selectTab(SettingPanel.TAB_OBSERVABILITY);
window.list("jListTargets").selectItem("HIP1234");
final JPanelFixture form = window.panel("observationForm");
// select CHARA interferometer :
form.comboBox("jComboBoxInterferometer").selectItem("CHARA");
final int left = 5 + window.panel("jPanelTargets").component().getWidth();
final int width = 5 + window.panel("jPanelMain").component().getWidth() + window.panel("jPanelConfigurations").component().getWidth();
// Get plot's title to show PoPs in use:
final int height = getMainFormHeight(window) + 50;
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
saveCroppedScreenshotOf("popsAuto.png", left, 0, width, height);
// set PoPs to '34' (manual):
final JFormattedTextField jTextPoPs = (JFormattedTextField) form.textBox("jTextPoPs").component();
GuiActionRunner.execute(new GuiTask() {
@Override
protected void executeInEDT() {
// Integer field :
jTextPoPs.setValue(NumberUtils.valueOf(34));
}
});
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// show observability plot (force plot refresh) :
getMainTabbedPane().selectTab(SettingPanel.TAB_OBSERVABILITY);
saveCroppedScreenshotOf("popsUser.png", left, 0, width, height);
}
use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproDocJUnitTest method m005_shouldShowObservability.
/**
* Test observability plot
*/
@Test
@GUITest
public void m005_shouldShowObservability() {
// Capture observability plot :
getMainTabbedPane().selectTab(SettingPanel.TAB_OBSERVABILITY);
try {
enableTooltips(true);
// move the mouse on the first observability interval (top right corner):
// note: check window margin issue (gnome3):
robot().moveMouse(window.component(), 390, 410);
// let tooltip appear:
pauseMedium();
saveScreenshotWithMousePointer(window, "Aspro2-obs.png");
} finally {
enableTooltips(false);
}
// export PDF :
exportPDF();
final JPanelFixture panel = window.panel("observabilityPanel");
// enable baseline limits :
panel.checkBox("jCheckBoxBaseLineLimits").check();
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// Capture observability plot of baseline limits :
saveScreenshot(getMainTabbedPane(), "Aspro2-obs-bl.png");
// disable baseline limits :
panel.checkBox("jCheckBoxBaseLineLimits").uncheck();
// enable detailed plot :
panel.checkBox("jCheckBoxDetailedOutput").check();
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// Capture observability plot of detailed plot :
saveScreenshot(getMainTabbedPane(), "Aspro2-obs-det.png");
// disable detailed plot :
panel.checkBox("jCheckBoxDetailedOutput").uncheck();
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
}
use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproNightBoundsTest method shouldChangeDateForVLTI.
/**
* Test observability plot when updating the observation date
*/
@Test
@GUITest
public void shouldChangeDateForVLTI() {
initTest();
final JPanelFixture form = window.panel("observationForm");
// select VLTI interferometer :
form.comboBox("jComboBoxInterferometer").selectItem("VLTI");
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
final JSpinnerFixture dateSpinner = form.spinner("jDateSpinner");
traverseDays(dateSpinner);
}
Aggregations