source: sasview/sasview/squish_test_suites/suite_sasview_bdd/shared/steps/steps.py @ c691d36

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

Added an initial BDD suite: SASVIEW-635

  • Property mode set to 100755
File size: 2.9 KB
Line 
1# -*- coding: utf-8 -*-
2@Given("SasView running")
3def step(context):
4    startApplication("sasview")
5    test.compare(waitForObjectExists(":_QSplashScreen").visible, False)
6
7@Given("empty File Explorer")
8def 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")
13def 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")
18def 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")
28def 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")
33def step(context):
34    test.compare(waitForObjectExists(":treeView.cyl_400_40.txt_QModelIndex").checkState, "checked")
35
36
37@Given("a 1D file loaded")
38def 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")
50def 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")
55def step(context):
56    test.compare(waitForObjectExists(":treeView.cyl_400_20.txt_QModelIndex").checkState, "unchecked")
Note: See TracBrowser for help on using the repository browser.