source: sasview/src/sas/qtgui/UnitTesting/SquishTestSuites/suite_sasview_calculators/tst_SLD_Calculator/test.js @ d6b234b

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since d6b234b was d6b234b, checked in by Piotr Rozyczko <rozyczko@…>, 6 years ago

Cleanup after merge (removed sasview/sasview)

  • Property mode set to 100755
File size: 3.9 KB
Line 
1function main() {
2    startApplication("sasview");
3    activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "Tool"));
4    activateItem(waitForObjectItem(":MainWindow.menuTool_QMenu", "SLD Calculator"));
5    test.compare(waitForObjectExists(":SldPanel_SldPanel").windowTitle, "SLD Calculator");
6    test.compare(waitForObjectExists(":SldPanel_SldPanel").visible, true);
7    test.compare(waitForObjectExists(":groupBoxInput.editMolecularFormula_QLineEdit").displayText, "H2O");
8    test.compare(waitForObjectExists(":groupBoxInput.editMolecularFormula_QLineEdit").readOnly, false);
9    test.compare(waitForObjectExists(":groupBoxInput.editMolecularFormula_QLineEdit").enabled, true);
10    test.compare(waitForObjectExists(":groupBoxInput.editMassDensity_QLineEdit").text, "1");
11    test.compare(waitForObjectExists(":groupBoxInput.editWavelength_QLineEdit").text, "6");
12    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronSldReal_QLineEdit").text, "-5.61e-07");
13    test.compare(waitForObjectExists(":groupBoxOutput.editCuKaSldReal_QLineEdit").text, "9.47e-06");
14    test.compare(waitForObjectExists(":groupBoxOutput.editMoKaSldReal_QLineEdit").text, "9.43e-06");
15    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronIncXs_QLineEdit").text, "5.37");
16    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronAbsXs_QLineEdit").text, "0.0742");
17    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronLength_QLineEdit").text, "0.175");
18    type(waitForObject(":groupBoxInput.editMolecularFormula_QLineEdit"), "2");
19    type(waitForObject(":groupBoxInput.editMolecularFormula_QLineEdit"), "<Tab>");
20    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronSldReal_QLineEdit").text, "7.31e-07");
21    test.compare(waitForObjectExists(":groupBoxOutput.editCuKaSldReal_QLineEdit").text, "9.03e-06");
22    test.compare(waitForObjectExists(":groupBoxOutput.editMoKaSldReal_QLineEdit").text, "8.99e-06");
23    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronIncXs_QLineEdit").text, "2.84");
24    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronAbsXs_QLineEdit").text, "0.0393");
25    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronLength_QLineEdit").text, "0.323");
26    type(waitForObject(":groupBoxInput.editMassDensity_QLineEdit"), "5");
27    type(waitForObject(":groupBoxInput.editMassDensity_QLineEdit"), "<Tab>");
28    type(waitForObject(":groupBoxInput.editWavelength_QLineEdit"), "10");
29    type(waitForObject(":groupBoxInput.editWavelength_QLineEdit"), "<Tab>");
30    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronSldReal_QLineEdit").text, "3.65e-06");
31    test.compare(waitForObjectExists(":groupBoxOutput.editCuKaSldReal_QLineEdit").text, "4.52e-05");
32    test.compare(waitForObjectExists(":groupBoxOutput.editMoKaSldReal_QLineEdit").text, "4.5e-05");
33    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronIncXs_QLineEdit").text, "14.2");
34    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronAbsXs_QLineEdit").text, "0.328");
35    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronLength_QLineEdit").text, "0.0641");
36    clickButton(waitForObject(":SldPanel.Reset_QPushButton"));
37    test.compare(waitForObjectExists(":groupBoxInput.editMolecularFormula_QLineEdit").text, "H2O");
38    test.compare(waitForObjectExists(":groupBoxInput.editMassDensity_QLineEdit").text, "1");
39    test.compare(waitForObjectExists(":groupBoxInput.editWavelength_QLineEdit").text, "6");
40    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronSldReal_QLineEdit").text, "-5.61e-07");
41    test.compare(waitForObjectExists(":groupBoxOutput.editNeutronIncXs_QLineEdit").text, "5.37");
42    sendEvent("QWheelEvent", waitForObject(":SldPanel_SldPanel"), -1835, 357, 120, 0, 2);
43    sendEvent("QWheelEvent", waitForObject(":SldPanel_SldPanel"), -1456, 356, -120, 0, 2);
44    clickButton(waitForObject(":SldPanel.Close_QPushButton"));
45}
Note: See TracBrowser for help on using the repository browser.