use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproDocJUnitTest method m003_captureWindCompass.
/**
* Capture the main panel with wind compass enabled
*/
@Test
@GUITest
public void m003_captureWindCompass() {
// enable wind restriction:
window.checkBox("jCheckBoxWind").check();
final WindWidget windWidget = robot().finder().findByName("WindWidget", WindWidget.class);
GuiActionRunner.execute(new GuiTask() {
@Override
protected void executeInEDT() {
windWidget.setValue(60d);
}
});
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// Capture observability plot :
getMainTabbedPane().selectTab(SettingPanel.TAB_OBSERVABILITY);
saveScreenshot(window, "Aspro2-wind-obs.png");
final JPanelFixture panel = window.panel("observabilityPanel");
// enable detailed plot :
panel.checkBox("jCheckBoxDetailedOutput").check();
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// see HD 1234
panel.scrollBar("scroller").scrollToMaximum();
// Capture observability plot of detailed plot :
saveScreenshot(getMainTabbedPane(), "Aspro2-wind-obs-det.png");
// see ETA TAU (moon) [0 to 14]
panel.scrollBar("scroller").scrollTo(8);
// Capture observability plot of detailed plot :
saveScreenshot(getMainTabbedPane(), "Aspro2-moon-obs-det.png");
// disable detailed plot :
panel.checkBox("jCheckBoxDetailedOutput").uncheck();
// disable wind restriction:
GuiActionRunner.execute(new GuiTask() {
@Override
protected void executeInEDT() {
windWidget.setValue(0d);
}
});
window.checkBox("jCheckBoxWind").uncheck();
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
}
use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproDocJUnitTest method m099_captureMoon.
/**
* Capture the moon details
*/
@Test
@GUITest
public void m099_captureMoon() {
openObservation("Aspro2_sample_moon.asprox");
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// Capture observability plot :
getMainTabbedPane().selectTab(SettingPanel.TAB_OBSERVABILITY);
final JPanelFixture panel = window.panel("observabilityPanel");
// enable detailed plot :
panel.checkBox("jCheckBoxDetailedOutput").check();
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// see ETA TAU (moon) [0 to 14]
panel.scrollBar("scroller").scrollTo(8);
// Capture observability plot of detailed plot :
saveScreenshot(getMainTabbedPane(), "Aspro2-moon-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 AsproDocJUnitTest method m023_shouldOpenSampleWithUserModel.
/**
* Test Open file "Aspro2_sample_spiral.asprox" (User model)
*/
@Test
@GUITest
public void m023_shouldOpenSampleWithUserModel() {
try {
Preferences.getInstance().setPreference(Preferences.MODEL_IMAGE_LUT, ColorModels.COLOR_MODEL_HEAT);
openObservation("Aspro2_sample_spiral.asprox");
// target editor with calibrators :
window.button("jButtonTargetEditor").click();
final DialogFixture dialog = window.dialog(withTitle("Target Editor").andShowing());
dialog.requireVisible();
dialog.moveToFront();
dialog.tabbedPane().selectTab(TargetEditorDialog.TAB_MODELS);
dialog.tree().selectPath("Models/HD 1234");
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
saveScreenshot(dialog, "Aspro2-UserModel.png");
// close dialog :
dialog.button(JButtonMatcher.withText("Cancel")).click();
window.list("jListTargets").selectItem("HD 1234");
// select UV tab:
getMainTabbedPane().selectTab(SettingPanel.TAB_UV_COVERAGE);
final JPanelFixture panel = window.panel("uvCoveragePanel");
// disable Compute OIFits data :
panel.checkBox("jCheckBoxDoOIFits").uncheck();
// zoom uv max (trigger uv model to compute again):
panel.textBox("jFieldUVMax").setText("40.00");
// select UV tab to let fields lost focus (trigger change listeners):
getMainTabbedPane().selectTab(SettingPanel.TAB_UV_COVERAGE);
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// Capture UV Coverage plot :
showPlotTab(SettingPanel.TAB_UV_COVERAGE, "Aspro2-UserModel-uv.png");
} catch (PreferencesException pe) {
logger.error("setPreference failed", pe);
} finally {
try {
Preferences.getInstance().setPreference(Preferences.MODEL_IMAGE_LUT, Preferences.DEFAULT_IMAGE_LUT);
} catch (PreferencesException pe) {
logger.error("setPreference failed", pe);
}
}
}
use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproMatisseTest method openObservationAndCaptureOIFitsSNRPlot.
/*
--- Utility methods ---------------------------------------------------------
*/
private void openObservationAndCaptureOIFitsSNRPlot(final String obsFileName) {
openObservation(obsFileName);
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
selectTab(SettingPanel.TAB_OIFITS_VIEWER);
final JPanelFixture form = window.panel("plotView");
final JComboBoxFixture comboPlotDef = form.comboBox("plotDefinitionComboBox");
final String[] plotDefNames = comboPlotDef.contents();
// select preset 'V2_T3_SNR/EFF_WAVE':
// last corresponds to 'V2_T3_SNR/EFF_WAVE'
comboPlotDef.selectItem(plotDefNames.length - 1);
// let plot update:
pauseMedium();
// Capture plot screenshot :
final JPanelFixture plot = window.panel("plotChartPanel");
saveScreenshot(plot, obsFileName + "-SNR.png");
// select preset 'V_V2_T3_ERR/EFF_WAVE':
// last corresponds to 'V2_T3_SNR/EFF_WAVE'
comboPlotDef.selectItem(plotDefNames.length - 2);
// let plot update:
pauseMedium();
// Capture plot screenshot :
saveScreenshot(plot, obsFileName + "-ERR.png");
}
use of org.fest.swing.fixture.JPanelFixture in project aspro by JMMC-OpenDev.
the class AsproNightBoundsTest method shouldChangeDateForCHARA.
/**
* Test observability plot when updating the observation date
*/
@Test
@GUITest
public void shouldChangeDateForCHARA() {
initTest();
final JPanelFixture form = window.panel("observationForm");
// select CHARA interferometer :
form.comboBox("jComboBoxInterferometer").selectItem("CHARA");
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
// set PoPs to '54' :
final JFormattedTextField jTextPoPs = (JFormattedTextField) form.textBox("jTextPoPs").component();
GuiActionRunner.execute(new GuiTask() {
@Override
protected void executeInEDT() {
// Integer field :
jTextPoPs.setValue(Integer.valueOf(54));
}
});
// waits for computation to finish :
AsproTestUtils.checkRunningTasks();
final JSpinnerFixture dateSpinner = form.spinner("jDateSpinner");
traverseDays(dateSpinner);
}
Aggregations