source: sasview/sasview/squish_test_suites/suite_sasview_qt/tst_Plot1D_ChangeScale/test.py @ 9c39b317

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 9c39b317 was 9c39b317, checked in by Piotr Rozyczko <rozyczko@…>, 7 years ago

SASVIEW-633: initial test suite for Squish functionality testing

  • Property mode set to 100755
File size: 5.1 KB
Line 
1# -*- coding: utf-8 -*-
2
3def main():
4    startApplication("sasview")
5    mouseClick(waitForObject(":groupBox_6.cbCategory_QComboBox_2"), 114, 12, 0, Qt.LeftButton)
6    mouseClick(waitForObjectItem(":groupBox_6.cbCategory_QComboBox_2", "Lamellae"), 103, 10, 0, Qt.LeftButton)
7    clickButton(waitForObject(":FittingWidgetUI.cmdPlot_QPushButton_2"))
8    snooze(1)
9    clickButton(waitForObject(":FittingWidgetUI.cmdPlot_QPushButton_2"))
10    snooze(2)
11   
12    openContextMenu(waitForObject(":qt_workspacechild_FigureCanvasQTAgg"), 221, 184, 0)
13    activateItem(waitForObjectItem(":MainWindow_QMenu", "Change Scale"))
14    sendEvent("QMoveEvent", waitForObject(":scalePropertiesUI_ScaleProperties"), 685, 470, 973, 489)
15    test.compare(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").count, 6)
16    test.compare(str(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").currentText), "log10(x)")
17    test.compare(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").currentIndex, 4)
18    test.compare(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").visible, True)
19    test.compare(str(waitForObjectExists(":qt_workspacechild.cbY_QComboBox").currentText), "log10(y)")
20    test.compare(waitForObjectExists(":qt_workspacechild.cbY_QComboBox").currentIndex, 7)
21    test.compare(waitForObjectExists(":qt_workspacechild.cbView_QComboBox").currentIndex, 0)
22    test.compare(str(waitForObjectExists(":qt_workspacechild.cbView_QComboBox").currentText), "--")
23    mouseClick(waitForObject(":qt_workspacechild.cbView_QComboBox"), 93, 7, 0, Qt.LeftButton)
24    mouseClick(waitForObjectItem(":qt_workspacechild.cbView_QComboBox", "Linear y vs x"), 93, 6, 0, Qt.LeftButton)
25    clickButton(waitForObject(":qt_workspacechild.OK_QPushButton"))
26    test.vp("VP1")
27    snooze(2)
28    #sendEvent("QMouseEvent", waitForObject(":qt_workspacechild_FigureCanvasQTAgg_2"), QEvent.MouseButtonPress, 351, 209, Qt.RightButton, 2, 0)
29    #sendEvent("QMouseEvent", waitForObject(":qt_workspacechild_FigureCanvasQTAgg"), QEvent.MouseButtonRelease, 351, 209, Qt.RightButton, 0, 0)
30   
31    openContextMenu(waitForObject(":qt_workspacechild_FigureCanvasQTAgg"), 351, 209, 0)
32    activateItem(waitForObjectItem(":MainWindow_QMenu", "Change Scale"))
33    test.compare(str(waitForObjectExists(":qt_workspacechild.cbView_QComboBox").currentText), "Linear y vs x")
34    mouseClick(waitForObject(":qt_workspacechild.cbView_QComboBox"), 21, 10, 0, Qt.LeftButton)
35    mouseClick(waitForObjectItem(":qt_workspacechild.cbView_QComboBox", "Guinier lny vs x^(2)"), 27, 5, 0, Qt.LeftButton)
36    test.compare(str(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").currentText), "x^(2)")
37    test.compare(str(waitForObjectExists(":qt_workspacechild.cbY_QComboBox").currentText), "ln(y)")
38    mouseClick(waitForObject(":qt_workspacechild.cbView_QComboBox"), 95, 9, 0, Qt.LeftButton)
39    mouseClick(waitForObjectItem(":qt_workspacechild.cbView_QComboBox", "XS Guinier ln(y*x) vs x^(2)"), 70, 4, 0, Qt.LeftButton)
40    test.compare(str(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").currentText), "x^(2)")
41    test.compare(str(waitForObjectExists(":qt_workspacechild.cbY_QComboBox").currentText), "ln(y*x)")
42    mouseClick(waitForObject(":qt_workspacechild.cbView_QComboBox"), 83, 5, 0, Qt.LeftButton)
43    mouseClick(waitForObjectItem(":qt_workspacechild.cbView_QComboBox", "Porod y*x^(4) vs x^(4)"), 57, 1, 0, Qt.LeftButton)
44    test.compare(str(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").currentText), "x^(4)")
45    test.compare(str(waitForObjectExists(":qt_workspacechild.cbY_QComboBox").currentText), "y*x^(4)")
46    mouseClick(waitForObject(":qt_workspacechild.cbView_QComboBox"), 94, 5, 0, Qt.LeftButton)
47    mouseClick(waitForObjectItem(":qt_workspacechild.cbView_QComboBox", "Kratky y*x^(2) vs x"), 58, 6, 0, Qt.LeftButton)
48    test.compare(str(waitForObjectExists(":qt_workspacechild.cbX_QComboBox").currentText), "x")
49    test.compare(str(waitForObjectExists(":qt_workspacechild.cbY_QComboBox").currentText), "y*x^(2)")
50    mouseClick(waitForObject(":qt_workspacechild.cbView_QComboBox"), 74, 3, 0, Qt.LeftButton)
51    mouseClick(waitForObject(":qt_workspacechild.cbView_QComboBox"), 74, 3, 0, Qt.LeftButton)
52    mouseClick(waitForObject(":qt_workspacechild.cbX_QComboBox"), 31, 8, 0, Qt.LeftButton)
53    mouseClick(waitForObjectItem(":qt_workspacechild.cbX_QComboBox", "log10(x^(4))"), 42, 5, 0, Qt.LeftButton)
54    mouseClick(waitForObject(":qt_workspacechild.cbY_QComboBox"), 45, 10, 0, Qt.LeftButton)
55    mouseClick(waitForObjectItem(":qt_workspacechild.cbY_QComboBox", "y"), 30, 8, 0, Qt.LeftButton)
56    test.compare(str(waitForObjectExists(":qt_workspacechild.cbView_QComboBox").currentText), "--")
57    mouseClick(waitForObject(":qt_workspacechild.cbX_QComboBox"), 67, 9, 0, Qt.LeftButton)
58    mouseClick(waitForObjectItem(":qt_workspacechild.cbX_QComboBox", "log10(x)"), 56, 5, 0, Qt.LeftButton)
59    mouseClick(waitForObject(":qt_workspacechild.cbY_QComboBox"), 42, 12, 0, Qt.LeftButton)
60    mouseClick(waitForObjectItem(":qt_workspacechild.cbY_QComboBox", "log10(y)"), 55, 8, 0, Qt.LeftButton)
61    clickButton(waitForObject(":qt_workspacechild.OK_QPushButton"))
62    test.vp("VP2")
Note: See TracBrowser for help on using the repository browser.