1 | # -*- coding: utf-8 -*- |
---|
2 | @Given("SasView running") |
---|
3 | def step(context): |
---|
4 | startApplication("sasview") |
---|
5 | test.compare(waitForObjectExists(":_QSplashScreen").visible, False) |
---|
6 | |
---|
7 | @Given("empty File Explorer") |
---|
8 | def step(context): |
---|
9 | test.compare(str(waitForObjectExists(":groupBox.treeView_QTreeView").objectName), "treeView") |
---|
10 | test.compare(waitForObjectExists(":groupBox.treeView_QTreeView").visible, True) |
---|
11 | |
---|
12 | @When("I click on Load Data") |
---|
13 | def step(context): |
---|
14 | sendEvent("QMouseEvent", waitForObject(":groupBox.cmdLoad_QPushButton"), QEvent.MouseButtonPress, 68, 20, Qt.LeftButton, 1, 0) |
---|
15 | sendEvent("QMouseEvent", waitForObject(":groupBox.cmdLoad_QPushButton"), QEvent.MouseButtonRelease, 68, 20, Qt.LeftButton, 0, 0) |
---|
16 | |
---|
17 | @When("choose a 1D file") |
---|
18 | def step(context): |
---|
19 | waitForObjectItem(":stackedWidget.listView_QListView", "test") |
---|
20 | doubleClickItem(":stackedWidget.listView_QListView", "test", 12, 8, 0, Qt.LeftButton) |
---|
21 | waitForObjectItem(":stackedWidget.listView_QListView", "1d\\_data") |
---|
22 | doubleClickItem(":stackedWidget.listView_QListView", "1d\\_data", 35, 14, 0, Qt.LeftButton) |
---|
23 | waitForObjectItem(":stackedWidget.listView_QListView", "cyl\\_400\\_40\\.txt") |
---|
24 | clickItem(":stackedWidget.listView_QListView", "cyl\\_400\\_40\\.txt", 64, 7, 0, Qt.LeftButton) |
---|
25 | clickButton(waitForObject(":buttonBox.Open_QPushButton")) |
---|
26 | |
---|
27 | @Then("a new index will show up in File Explorer") |
---|
28 | def step(context): |
---|
29 | test.compare(waitForObjectExists(":treeView.cyl_400_40.txt_QModelIndex").row, 0) |
---|
30 | test.compare(waitForObjectExists(":treeView.cyl_400_40.txt_QModelIndex").viewType, "QTreeView") |
---|
31 | |
---|
32 | @Then("It will be checked") |
---|
33 | def step(context): |
---|
34 | test.compare(waitForObjectExists(":treeView.cyl_400_40.txt_QModelIndex").checkState, "checked") |
---|
35 | |
---|
36 | |
---|
37 | @Given("a 1D file loaded") |
---|
38 | def step(context): |
---|
39 | clickButton(waitForObject(":groupBox.cmdLoad_QPushButton")) |
---|
40 | waitForObjectItem(":stackedWidget.listView_QListView", "test") |
---|
41 | doubleClickItem(":stackedWidget.listView_QListView", "test", 49, 9, 0, Qt.LeftButton) |
---|
42 | waitForObjectItem(":stackedWidget.listView_QListView", "1d\\_data") |
---|
43 | doubleClickItem(":stackedWidget.listView_QListView", "1d\\_data", 52, 11, 0, Qt.LeftButton) |
---|
44 | waitForObjectItem(":stackedWidget.listView_QListView", "cyl\\_400\\_20\\.txt") |
---|
45 | doubleClickItem(":stackedWidget.listView_QListView", "cyl\\_400\\_20\\.txt", 64, 5, 0, Qt.LeftButton) |
---|
46 | test.compare(waitForObjectExists(":treeView.cyl_400_20.txt_QModelIndex").row, 0) |
---|
47 | test.compare(waitForObjectExists(":treeView.cyl_400_20.txt_QModelIndex").checkState, "checked") |
---|
48 | |
---|
49 | @When("I select Uncheck All") |
---|
50 | def step(context): |
---|
51 | mouseClick(waitForObject(":groupBox.cbSelect_QComboBox"), 76, 7, 0, Qt.LeftButton) |
---|
52 | mouseClick(waitForObjectItem(":groupBox.cbSelect_QComboBox", "Unselect all"), 62, 4, 0, Qt.LeftButton) |
---|
53 | |
---|
54 | @Then("the 1D file index will be unchecked") |
---|
55 | def step(context): |
---|
56 | test.compare(waitForObjectExists(":treeView.cyl_400_20.txt_QModelIndex").checkState, "unchecked") |
---|