# -*- coding: utf-8 -*-

def main():
    startApplication("sasview")
    activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "Tool"))
    activateItem(waitForObjectItem(":MainWindow.menuTool_QMenu", "SLD Calculator"))
    test.compare(waitForObjectExists(":SldPanel_SldPanel").enabled, True)
    test.compare(str(waitForObjectExists(":SldPanel_SldPanel").windowTitle), "SLD Calculator")
    test.compare(waitForObjectExists(":SldPanel_SldPanel").visible, True)
    clickButton(waitForObject(":SldPanel.Close_QPushButton"))
    activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "Tool"))
    activateItem(waitForObjectItem(":MainWindow.menuTool_QMenu", "Density/Volume Calculator"))
    test.compare(waitForObjectExists(":DensityPanel_DensityPanel").visible, True)
    test.compare(str(waitForObjectExists(":DensityPanel_DensityPanel").windowTitle), "Density/Volume Calculator")
    test.compare(waitForObjectExists(":DensityPanel_DensityPanel").enabled, True)
    clickButton(waitForObject(":DensityPanel.Close_QPushButton"))
    activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "Tool"))
    activateItem(waitForObjectItem(":MainWindow.menuTool_QMenu", "Slit Size Calculator"))
    test.compare(str(waitForObjectExists(":SlitSizeCalculator_SlitSizeCalculator").windowTitle), "Slit Size Calculator")
    test.compare(waitForObjectExists(":SlitSizeCalculator_SlitSizeCalculator").visible, True)
    test.compare(waitForObjectExists(":SlitSizeCalculator_SlitSizeCalculator").enabled, True)
    clickButton(waitForObject(":SlitSizeCalculator.closeButton_QPushButton"))
    activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "Tool"))
    activateItem(waitForObjectItem(":MainWindow.menuTool_QMenu", "Kiessig Thickness Calculator"))
    test.compare(str(waitForObjectExists(":KiessigPanel_KiessigPanel").windowTitle), "Kiessig Thickness Calculator")
    test.compare(waitForObjectExists(":KiessigPanel_KiessigPanel").enabled, True)
    test.compare(waitForObjectExists(":KiessigPanel_KiessigPanel").visible, True)
    clickButton(waitForObject(":KiessigPanel.closeButton_QPushButton"))
    activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "Tool"))
    activateItem(waitForObjectItem(":MainWindow.menuTool_QMenu", "Generic Scattering Calculator"))
    test.compare(waitForObjectExists(":GenericScatteringCalculator_GenericScatteringCalculator").enabled, True)
    test.compare(str(waitForObjectExists(":GenericScatteringCalculator_GenericScatteringCalculator").windowTitle), "Generic SAS Calculator")
    test.compare(waitForObjectExists(":GenericScatteringCalculator_GenericScatteringCalculator").visible, True)
    clickButton(waitForObject(":GenericScatteringCalculator.cmdClose_QPushButton"))
    activateItem(waitForObjectItem(":MainWindow.menubar_QMenuBar", "Tool"))
    activateItem(waitForObjectItem(":MainWindow.menuTool_QMenu", "Python Shell/Editor"))
    test.compare(waitForObjectExists(":MainWindow.IPythonDockWidget_QDockWidget").visible, True)
    test.compare(str(waitForObjectExists(":MainWindow.IPythonDockWidget_QDockWidget").windowTitle), "IPython")
    test.compare(waitForObjectExists(":MainWindow.IPythonDockWidget_QDockWidget").enabled, True)
