1 | # -*- coding: utf-8 -*- |
---|
2 | |
---|
3 | def main(): |
---|
4 | startApplication("sasview") |
---|
5 | activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "File")) |
---|
6 | activateItem(waitForObjectItem(":MainWindow.menu_File_QMenu", "Load Data File(s)")) |
---|
7 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").visible, True) |
---|
8 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").enabled, True) |
---|
9 | test.compare(str(waitForObjectExists(":Data Explorer.fileTypeCombo_QComboBox").currentText), "All (*.*)") |
---|
10 | sendEvent("QCloseEvent", waitForObject(":QFileDialog_QFileDialog")) |
---|
11 | activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "File")) |
---|
12 | activateItem(waitForObjectItem(":MainWindow.menu_File_QMenu", "Load Data Folder")) |
---|
13 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").visible, True) |
---|
14 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").enabled, True) |
---|
15 | test.compare(str(waitForObjectExists(":QFileDialog_QFileDialog").windowTitle), "Choose a directory") |
---|
16 | test.compare(str(waitForObjectExists(":Data Explorer.fileTypeCombo_QComboBox").currentText), "Directories") |
---|
17 | clickButton(waitForObject(":buttonBox.Cancel_QPushButton")) |
---|
18 | activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "File")) |
---|
19 | activateItem(waitForObjectItem(":MainWindow.menu_File_QMenu", "Open Project")) |
---|
20 | test.compare(str(waitForObjectExists(":QFileDialog_QFileDialog").windowTitle), "Open Project") |
---|
21 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").visible, True) |
---|
22 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").enabled, True) |
---|
23 | test.compare(str(waitForObjectExists(":Data Explorer.fileTypeCombo_QComboBox").currentText), "Project (*.json)") |
---|
24 | clickButton(waitForObject(":buttonBox.Cancel_QPushButton")) |
---|
25 | activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "File")) |
---|
26 | activateItem(waitForObjectItem(":MainWindow.menu_File_QMenu", "Save Project")) |
---|
27 | test.compare(str(waitForObjectExists(":QFileDialog_QFileDialog").windowTitle), "Save Project") |
---|
28 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").visible, True) |
---|
29 | test.compare(waitForObjectExists(":QFileDialog_QFileDialog").enabled, True) |
---|
30 | test.compare(str(waitForObjectExists(":Data Explorer.fileTypeCombo_QComboBox").currentText), "Project (*.json)") |
---|
31 | clickButton(waitForObject(":buttonBox.Cancel_QPushButton")) |
---|
32 | activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "File")) |
---|
33 | activateItem(waitForObjectItem(":MainWindow.menu_File_QMenu", "Quit")) |
---|
34 | test.compare(str(waitForObjectExists(":Information_QMessageBox").text), "Are you sure you want to exit the application?") |
---|
35 | test.compare(waitForObjectExists(":Information_QMessageBox").visible, True) |
---|
36 | test.compare(waitForObjectExists(":Information.Yes_QPushButton").default, True) |
---|
37 | clickButton(waitForObject(":Information.No_QPushButton")) |
---|