1 | # -*- coding: utf-8 -*- |
---|
2 | |
---|
3 | def main(): |
---|
4 | startApplication("sasview") |
---|
5 | mouseClick(waitForObject(":groupBox_6.cbCategory_QComboBox_2"), 68, 16, 0, Qt.LeftButton) |
---|
6 | mouseClick(waitForObjectItem(":groupBox_6.cbCategory_QComboBox_2", "Cylinder"), 66, 7, 0, Qt.LeftButton) |
---|
7 | clickButton(waitForObject(":groupBox_7.chkPolydispersity_QCheckBox")) |
---|
8 | test.compare(waitForObjectExists(":qt_tabwidget_tabbar.Polydispersity_TabItem").enabled, True) |
---|
9 | clickTab(waitForObject(":FittingWidgetUI.tabFitting_QTabWidget_2"), "Polydispersity") |
---|
10 | test.compare(waitForObjectExists(":lstPoly.0_0_QModelIndex").checkState, "unchecked") |
---|
11 | test.compare(waitForObjectExists(":lstPoly.0_0_QModelIndex").text, "Distribution of radius_bell") |
---|
12 | test.compare(waitForObjectExists(":lstPoly.0_0_QModelIndex").enabled, True) |
---|
13 | test.compare(waitForObjectExists(":lstPoly.1_0_QModelIndex").text, "Distribution of radius") |
---|
14 | test.compare(waitForObjectExists(":lstPoly.1_0_QModelIndex").checkState, "unchecked") |
---|
15 | test.compare(waitForObjectExists(":lstPoly.1_0_QModelIndex").enabled, True) |
---|
16 | test.compare(waitForObjectExists(":lstPoly.2_0_QModelIndex").row, 2) |
---|
17 | test.compare(waitForObjectExists(":lstPoly.2_0_QModelIndex").checkState, "unchecked") |
---|
18 | test.compare(waitForObjectExists(":lstPoly.2_0_QModelIndex").enabled, True) |
---|
19 | test.compare(waitForObjectExists(":lstPoly.2_0_QModelIndex").text, "Distribution of length") |
---|
20 | test.compare(waitForObjectExists(":lstPoly_QComboBox").count, 5) |
---|
21 | test.compare(waitForObjectExists(":lstPoly_QComboBox").enabled, True) |
---|
22 | test.compare(waitForObjectExists(":lstPoly_QComboBox").currentIndex, 3) |
---|
23 | test.compare(str(waitForObjectExists(":lstPoly_QComboBox").currentText), "gaussian") |
---|
24 | test.compare(waitForObjectExists(":lstPoly_QComboBox").visible, True) |
---|
25 | test.compare(waitForObjectExists(":lstPoly.0_4_QModelIndex").text, "35") |
---|
26 | test.compare(waitForObjectExists(":lstPoly.0_5_QModelIndex").text, "3") |
---|
27 | mouseClick(waitForObject(":lstPoly_QComboBox"), 70, 19, 0, Qt.LeftButton) |
---|
28 | mouseClick(waitForObjectItem(":lstPoly_QComboBox", "rectangle"), 63, 5, 0, Qt.LeftButton) |
---|
29 | test.compare(waitForObjectExists(":lstPoly.0_4_QModelIndex").text, "35") |
---|
30 | test.compare(waitForObjectExists(":lstPoly.0_5_QModelIndex").text, "1.70325") |
---|
31 | test.compare(str(waitForObjectExists(":lstPoly_QComboBox").currentText), "rectangle") |
---|
32 | mouseClick(waitForObject(":lstPoly_QComboBox"), 70, 11, 0, Qt.LeftButton) |
---|
33 | mouseClick(waitForObjectItem(":lstPoly_QComboBox", "lognormal"), 52, 7, 0, Qt.LeftButton) |
---|
34 | test.compare(waitForObjectExists(":lstPoly.0_4_QModelIndex").text, "80") |
---|
35 | test.compare(waitForObjectExists(":lstPoly.0_5_QModelIndex").text, "8") |
---|
36 | test.compare(str(waitForObjectExists(":lstPoly_QComboBox").currentText), "lognormal") |
---|
37 | mouseClick(waitForObject(":lstPoly_QComboBox_2"), 48, 14, 0, Qt.LeftButton) |
---|
38 | mouseClick(waitForObjectItem(":lstPoly_QComboBox_2", "schulz"), 26, 8, 0, Qt.LeftButton) |
---|
39 | test.compare(waitForObjectExists(":lstPoly.2_4_QModelIndex").text, "35") |
---|
40 | test.compare(waitForObjectExists(":lstPoly.2_5_QModelIndex").text, "3") |
---|
41 | test.compare(str(waitForObjectExists(":lstPoly_QComboBox_3").currentText), "gaussian") |
---|
42 | mouseClick(waitForObject(":lstPoly_QComboBox"), 43, 11, 0, Qt.LeftButton) |
---|
43 | mouseClick(waitForObjectItem(":lstPoly_QComboBox", "array"), 28, 8, 0, Qt.LeftButton) |
---|
44 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").visible, True) |
---|
45 | test.compare(str(waitForObjectExists(":QFileDialog_QFileDialog").windowTitle), "Choose a weight file") |
---|
46 | clickButton(waitForObject(":QFileDialog.Cancel_QPushButton")) |
---|
47 | test.compare(str(waitForObjectExists(":lstPoly_QComboBox").currentText), "schulz") |
---|
48 | mouseClick(waitForObjectItem(":lstPoly_QComboBox_2", "array"), 48, 8, 0, Qt.LeftButton) |
---|
49 | waitForObjectItem(":stackedWidget.listView_QListView_2", "test") |
---|
50 | doubleClickItem(":stackedWidget.listView_QListView_2", "test", 28, 5, 0, Qt.LeftButton) |
---|
51 | waitForObjectItem(":stackedWidget.listView_QListView_2", "1d\\_data") |
---|
52 | doubleClickItem(":stackedWidget.listView_QListView_2", "1d\\_data", 43, 6, 0, Qt.LeftButton) |
---|
53 | waitForObjectItem(":stackedWidget.listView_QListView_2", "circular\\_test\\.txt") |
---|
54 | clickItem(":stackedWidget.listView_QListView_2", "circular\\_test\\.txt", 102, 10, 0, Qt.LeftButton) |
---|
55 | clickButton(waitForObject(":FittingWidgetUI.Open_QPushButton")) |
---|
56 | test.compare(waitForObjectExists(":lstPoly.1_0_QModelIndex").enabled, True) |
---|
57 | test.compare(waitForObjectExists(":lstPoly.1_1_QModelIndex").enabled, False) |
---|
58 | test.compare(waitForObjectExists(":lstPoly.1_4_QModelIndex").enabled, False) |
---|
59 | test.compare(waitForObjectExists(":lstPoly.1_5_QModelIndex").enabled, False) |
---|
60 | test.compare(str(waitForObjectExists(":lstPoly_QComboBox_2").currentText), "array") |
---|
61 | test.compare(waitForObjectExists(":lstPoly.1_7_QModelIndex").text, "circular_test.txt") |
---|