debian/*log
debian/*substvars
debian/magicsmoke2-*
+bin/*
#Unit Test Environment
tests/apache/*pid
tests/apache/log
tests/apache/www
-tests/apache/etc/apache2.conf
-tests/apache/etc/ssl.conf
+tests/apache/etc/*.conf
tests/apache/etc/server.*
+tests/apache/etc/config.php
tests/config
tests/db/data
tests/db/etc/environment
tests/db/etc/*.conf
-tests/db/run
\ No newline at end of file
+tests/db/run
+tests/appdata
+tests/appconf
<li><tt>run</tt> - dynamically created directory that hold server logs, sockets and other housekeeping
</ul>
<li><tt>ssl</tt> - contains the SSL certificates used for the tests, normally you should not need to alter them
+ <li><tt>appdata</tt> - dynamically created: contains the profile data for the client under test
+ <li><tt>appconf</tt> - dynamically created: contains the configuration data for the client under test
</ul>
<li><tt>guitest</tt> - GUI test scripts for Squish</li>
</ul>
--- /dev/null
+:Chose Language.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Chose Language_QInputDialog'}
+:Chose Language_QInputDialog {type='QInputDialog' unnamed='1' visible='1' windowTitle='Chose Language'}
+:Default Username:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='Default Username:' type='QLabel' unnamed='1' visible='1'}
+:Default Username:_QLineEdit {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':Default Username:_QLabel' type='QLineEdit' unnamed='1' visible='1'}
+:Error.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Error_QMessageBox'}
+:Error_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Error'}
+:Import Key from File.splitter_QSplitter {name='splitter' type='QSplitter' visible='1' window=':Import Key from File_QFileDialog'}
+:Import Key from File.toParentButton_QToolButton {name='toParentButton' type='QToolButton' visible='1' window=':Import Key from File_QFileDialog'}
+:Import Key from File_QFileDialog {name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Import Key from File'}
+:Initial Profile Warning.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Initial Profile Warning_QMessageBox'}
+:Initial Profile Warning_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Initial Profile Warning'}
+:Magic Smoke Configuration.Profile_QMenu {title='Profile' type='QMenu' unnamed='1' visible='1' window=':Magic Smoke Configuration_MConfigDialog'}
+:Magic Smoke Configuration.qt_tabwidget_stackedwidget_QStackedWidget {name='qt_tabwidget_stackedwidget' type='QStackedWidget' visible='1' window=':Magic Smoke Configuration_MConfigDialog'}
+:Magic Smoke Configuration.qt_tabwidget_tabbar_QTabBar {name='qt_tabwidget_tabbar' type='QTabBar' visible='1' window=':Magic Smoke Configuration_MConfigDialog'}
+:Magic Smoke Configuration_MConfigDialog {type='MConfigDialog' unnamed='1' visible='1' windowTitle='Magic Smoke Configuration'}
+:Magic Smoke Configuration_QListView {type='QListView' unnamed='1' visible='1' window=':Magic Smoke Configuration_MConfigDialog'}
+:Magic Smoke Configuration_QMenuBar {type='QMenuBar' unnamed='1' visible='1' window=':Magic Smoke Configuration_MConfigDialog'}
+:Magic Smoke Login.Login_QPushButton {text='Login' type='QPushButton' unnamed='1' visible='1' window=':Magic Smoke Login_MLogin'}
+:Magic Smoke Login_MLogin {type='MLogin' unnamed='1' visible='1' windowTitle='Magic Smoke Login'}
+:New Profile.Please enter a profile name. It must be non-empty and must not be used yet:_QLabel {text='Please enter a profile name. It must be non-empty and must not be used yet:' type='QLabel' unnamed='1' visible='1' window=':New Profile_QInputDialog'}
+:New Profile_QInputDialog {type='QInputDialog' unnamed='1' visible='1' windowTitle='New Profile'}
+:Please enter a profile name. It must be non-empty and must not be used yet:_QLineEdit {buddy=':New Profile.Please enter a profile name. It must be non-empty and must not be used yet:_QLabel' type='QLineEdit' unnamed='1' visible='1'}
+:Probe Server_QPushButton {container=':qt_tabwidget_stackedwidget_QWidget' text='Probe Server' type='QPushButton' unnamed='1' visible='1'}
+:SSL Warning.Yes_QPushButton {text='Yes' type='QPushButton' unnamed='1' visible='1' window=':SSL Warning_QMessageBox'}
+:SSL Warning_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='SSL Warning'}
+:Server Probe.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Server Probe_QMessageBox'}
+:Server Probe_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Server Probe'}
+:Warning.Yes_QPushButton {text='Yes' type='QPushButton' unnamed='1' visible='1' window=':Warning_QMessageBox'}
+:Warning_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Warning'}
+:frame.stackedWidget_QStackedWidget {container=':splitter.frame_QFrame' name='stackedWidget' type='QStackedWidget' visible='1'}
+:https://_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='https://' type='QLabel' unnamed='1' visible='1'}
+:https://_QLineEdit {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':https://_QLabel' type='QLineEdit' unnamed='1' visible='1'}
+:qt_tabwidget_stackedwidget_QWidget {container=':Magic Smoke Configuration.qt_tabwidget_stackedwidget_QStackedWidget' type='QWidget' unnamed='1' visible='1'}
+:splitter.frame_QFrame {container=':Import Key from File.splitter_QSplitter' name='frame' type='QFrame' visible='1'}
+:stackedWidget.listView_QListView {container=':frame.stackedWidget_QStackedWidget' name='listView' type='QListView' visible='1'}
--- /dev/null
+import subprocess
+
+MagicSmokeBasePath=squishinfo.testCase + "/../.."
+
+def startMagicSmoke():
+ startApplication("magicsmoke -datadir=$APP/../tests/appdata -confdir=$APP/../tests/appconf")
+
+def cleanUpMagicSmoke():
+ subprocess.call(MagicSmokeBasePath+"/tests/setup-stop.sh")
+ subprocess.call(MagicSmokeBasePath+"/tests/setup-clean.sh")
+
+def cleanUpClient():
+ subprocess.call("rm -rf "+MagicSmokeBasePath+"/tests/appdata "+MagicSmokeBasePath+"/tests/appconf",shell=True)
+
+def startServer():
+ subprocess.call(MagicSmokeBasePath+"/tests/setup-start.sh")
+
+def initServer():
+ subprocess.call(MagicSmokeBasePath+"/tests/setup-create.sh")
+
+def stopServer():
+ subprocess.call(MagicSmokeBasePath+"/tests/setup-stop.sh")
\ No newline at end of file
--- /dev/null
+AUT=magicsmoke -datadir=$APP/../tests/appdata -confdir=$APP/../tests/appconf
+ENVVARS=envvars
+HOOK_SUB_PROCESSES=false
+IMPLICITAUTSTART=0
+LANGUAGE=Python
+TEST_CASES=tst_login-prep
+VERSION=2
+WRAPPERS=Qt
--- /dev/null
+source(findFile("scripts","common.py"))
+
+def init():
+ cleanUpClient()
+ startServer()
+ initServer()
+
+def cleanup():
+ stopServer()
+
+def createProfile():
+ #we'll be asked for the language, ack C
+ clickButton(waitForObject(":Chose Language.OK_QPushButton",100))
+ #yes we want an initial profile
+ clickButton(waitForObject(":Initial Profile Warning.OK_QPushButton",100))
+ #create a profile
+ activateItem(waitForObjectItem(":Magic Smoke Configuration_QMenuBar", "Profile",100))
+ activateItem(waitForObjectItem(":Magic Smoke Configuration.Profile_QMenu", "New Profile...",100))
+ type(waitForObject(":Please enter a profile name. It must be non-empty and must not be used yet:_QLineEdit",100), "test")
+ type(waitForObject(":Please enter a profile name. It must be non-empty and must not be used yet:_QLineEdit",1), "<Return>")
+ #enter URL
+ type(waitForObject(":https://_QLineEdit",100), "<Ctrl+A>")
+ type(waitForObject(":https://_QLineEdit",1), "<Del>")
+ type(waitForObject(":https://_QLineEdit",1), "localhost:20989/machine.php")
+ #go to authentication, import host key
+ clickTab(waitForObject(":Magic Smoke Configuration.qt_tabwidget_tabbar_QTabBar",100), "Authentication")
+ activateItem(waitForObjectItem(":Magic Smoke Configuration_QMenuBar", "Profile",100))
+ activateItem(waitForObjectItem(":Magic Smoke Configuration.Profile_QMenu", "Import Host Key...",100))
+ clickButton(waitForObject(":Warning.Yes_QPushButton",100))
+ #we usually start in the application bin directory
+ # from here we go to ../tests/testhost.mshk
+ clickButton(waitForObject(":Import Key from File.toParentButton_QToolButton",2000))
+ waitForObjectItem(":stackedWidget.listView_QListView", "tests",1000)
+ clickItem(":stackedWidget.listView_QListView", "tests", 41, 8, 0, Qt.LeftButton)
+ doubleClick(waitForObject(":stackedWidget.listView_QListView",1000), 136, 8, 0, Qt.LeftButton)
+ waitForObjectItem(":stackedWidget.listView_QListView", "testhost\\.mshk",1000)
+ clickItem(":stackedWidget.listView_QListView", "testhost\\.mshk", 103, 14, 0, Qt.LeftButton)
+ #enter a default user name too: admin
+ mouseClick(waitForObject(":Default Username:_QLineEdit",100), 14, 14, 0, Qt.LeftButton)
+ type(waitForObject(":Default Username:_QLineEdit",1), "admin")
+ #get the SSL exceptions
+ clickTab(waitForObject(":Magic Smoke Configuration.qt_tabwidget_tabbar_QTabBar",100), "SSL Exceptions")
+ clickButton(waitForObject(":Probe Server_QPushButton",100))
+ clickButton(waitForObject(":SSL Warning.Yes_QPushButton",2000))
+ clickButton(waitForObject(":Server Probe.OK_QPushButton",1000))
+ #done, close dialog
+ activateItem(waitForObjectItem(":Magic Smoke Configuration_QMenuBar", "Profile",100))
+ activateItem(waitForObjectItem(":Magic Smoke Configuration.Profile_QMenu", "Close Window",100))
+
+
+def main():
+ startMagicSmoke()
+ createProfile()
+ sendEvent("QCloseEvent", waitForObject(":Magic Smoke Login_MLogin",1000))
rm -f server.* mods.conf
)
+####################################
+#Client
+
+rm -rf appdata appconf
+
exit 0