mirror of
https://github.com/reactos/ahk_tests.git
synced 2024-11-23 11:39:42 +00:00
[AHK_Abyss_Web_Server_X1_2.7]
Add install test. The install test works fine in clean snapshot of win2k3 sp2. svn path=/trunk/ahk_tests/; revision=1658
This commit is contained in:
parent
6aff5567e8
commit
fb0b27eea5
248
Abyss Web Server X1/2.7/install_test.ahk
Normal file
248
Abyss Web Server X1/2.7/install_test.ahk
Normal file
@ -0,0 +1,248 @@
|
||||
/*
|
||||
* Designed for Abyss Web Server X1 2.7
|
||||
* Copyright (C) 2012 Edijs Kolesnikovics
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
ModuleExe = %A_WorkingDir%\Apps\Abyss Web Server X1 2.7 Setup.exe
|
||||
TestName = 1.install
|
||||
MainAppFile = abyssws.exe ; Mostly this is going to be process we need to look for
|
||||
|
||||
; Test if Setup file exists, if so, delete installed files, and run Setup
|
||||
TestsTotal++
|
||||
IfNotExist, %ModuleExe%
|
||||
TestsFailed("'" ModuleExe "' not found.")
|
||||
else
|
||||
{
|
||||
loop, 2 ; There are two 'abyssws.exe' processes running
|
||||
{
|
||||
Process, Close, %MainAppFile% ; Teminate process
|
||||
Sleep, 1000 ; Sleep is required
|
||||
}
|
||||
Process, WaitClose, %MainAppFile%, 4
|
||||
if ErrorLevel ; The PID still exists.
|
||||
TestsFailed("Unable to terminate '" MainAppFile "' process.") ; So, process still exists
|
||||
else
|
||||
{
|
||||
RegRead, UninstallerPath, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AbyssWebServer, UninstallString
|
||||
if ErrorLevel
|
||||
{
|
||||
; There was a problem (such as a nonexistent key or value).
|
||||
; That probably means we have not installed this app before.
|
||||
; Check in default directory to be extra sure
|
||||
bHardcoded := true ; To know if we got path from registry or not
|
||||
IfNotExist, %A_ProgramFiles%\Abyss Web Server
|
||||
bContinue := true ; No previous versions detected in hardcoded path
|
||||
else
|
||||
{
|
||||
FileRemoveDir, %A_ProgramFiles%\Abyss Web Server, 1 ; Silent switch '/S' shows a dialog
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to delete hardcoded path '" A_ProgramFiles "\Abyss Web Server' ('" MainAppFile "' process is reported as terminated).'")
|
||||
else
|
||||
bContinue := true
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StringReplace, UninstallerPath, UninstallerPath, `", , All ; Abyss string path contains quotes
|
||||
SplitPath, UninstallerPath,, InstalledDir
|
||||
IfNotExist, %InstalledDir%
|
||||
bContinue := true
|
||||
else
|
||||
{
|
||||
FileRemoveDir, %InstalledDir%, 1 ; Delete just in case
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to delete existing '" InstalledDir "' ('" MainAppFile "' process is reported as terminated).")
|
||||
else
|
||||
bContinue := true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if bContinue
|
||||
{
|
||||
RegDelete, HKEY_CURRENT_USER, Software\AbyssWebServer ; If this is not deleted, window 'Abyss Web Server X1 Setup (Another version)' will pop-up
|
||||
RegDelete, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AbyssWebServer
|
||||
|
||||
if bContinue
|
||||
{
|
||||
if bHardcoded
|
||||
TestsOK("Either there was no previous versions or we succeeded removing it using hardcoded path.")
|
||||
else
|
||||
TestsOK("Either there was no previous versions or we succeeded removing it using data from registry.")
|
||||
Run %ModuleExe%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Test if 'Abyss Web Server X1 Setup: License Agreement (Please read)' window appeared
|
||||
TestsTotal++
|
||||
if bContinue
|
||||
{
|
||||
WinWaitActive, Abyss Web Server X1 Setup: License Agreement, Please read, 7
|
||||
if ErrorLevel
|
||||
{
|
||||
IfWinActive, Abyss Web Server X1 Setup, Another version
|
||||
TestsFailed("We probably failed to delete 'HKCU\Software\AbyssWebServer'.")
|
||||
else
|
||||
TestsFailed("'Abyss Web Server X1 Setup: License Agreement (Please read)' window failed to appear.")
|
||||
}
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
ControlClick, Button2, Abyss Web Server X1 Setup: License Agreement, Please read ; Hit 'I Agree' button
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to hit 'I Agree' button in 'Abyss Web Server X1 Setup: License Agreement (Please read)' window.")
|
||||
else
|
||||
{
|
||||
WinWaitClose, Abyss Web Server X1 Setup: License Agreement, Please read, 5
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server X1 Setup: License Agreement (Please read)' window failed to close despite 'I Agree' button being clicked.")
|
||||
else
|
||||
TestsOK("'Abyss Web Server X1 Setup: License Agreement (Please read)' window appeared, 'I Agree' button clicked and window closed.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Test if 'Abyss Web Server X1 Setup: Installation Options (This will install)' window appeared
|
||||
TestsTotal++
|
||||
if bContinue
|
||||
{
|
||||
WinWaitActive, Abyss Web Server X1 Setup: Installation Options, This will install, 7
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server X1 Setup: Installation Options (This will install)' window failed to appear.")
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
ControlClick, Button2, Abyss Web Server X1 Setup: Installation Options, This will install ; Hit 'Next' button
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to hit 'Next' button in 'Abyss Web Server X1 Setup: Installation Options (This will install)' window.")
|
||||
else
|
||||
TestsOK("'Abyss Web Server X1 Setup: Installation Options (This will install)' window appeared and 'Next' button was clicked.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Test if 'Abyss Web Server X1 Setup: Installation Folder (Choose a directory)' window appeared
|
||||
TestsTotal++
|
||||
if bContinue
|
||||
{
|
||||
WinWaitActive, Abyss Web Server X1 Setup: Installation Folder, Choose a directory, 7
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server X1 Setup: Installation Folder (Choose a directory)' window failed to appear.")
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
ControlClick, Button2, Abyss Web Server X1 Setup: Installation Folder, Choose a directory ; Hit 'Install' button
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to hit 'Install' button in 'Abyss Web Server X1 Setup: Installation Folder (Choose a directory)' window.")
|
||||
else
|
||||
TestsOK("'Abyss Web Server X1 Setup: Installation Folder (Choose a directory)' window appeared and 'Install' button was clicked.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Test if can get thru 'Abyss Web Server X1 Setup: Installing (Show)' window
|
||||
TestsTotal++
|
||||
if bContinue
|
||||
{
|
||||
WinWaitActive, Abyss Web Server X1 Setup: Installing, Show, 7
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server X1 Setup: Installing (Show)' window failed to appear.")
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
WinWaitActive, Abyss Web Server Startup Configuration, Select the startup, 25
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server Startup Configuration (Select the startup)' window failed to pop-up.")
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
ControlClick, Button3, Abyss Web Server Startup Configuration, Select the startup ; Check 'Manual startup' radiobutton
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to check 'Manual startup' radiobutton in 'Abyss Web Server Startup Configuration (Select the startup)' window.")
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
ControlClick, Button1, Abyss Web Server Startup Configuration, Select the startup ; Hit 'OK' button
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to hit 'OK' button in 'Abyss Web Server Startup Configuration (Select the startup)' window.")
|
||||
else
|
||||
{
|
||||
WinWaitClose, Abyss Web Server Startup Configuration, Select the startup, 5
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server Startup Configuration (Select the startup)' window failed to close despite 'OK' button being clicked.")
|
||||
else
|
||||
{
|
||||
WinWaitActive, Abyss Web Server X1 Setup, Setup has completed, 5
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server X1 Setup (Setup has completed)' window failed to appear.")
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
ControlClick, Button2, Abyss Web Server X1 Setup, Setup has completed ; Hit 'No' button
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to hit 'No' button in 'Abyss Web Server X1 Setup (Setup has completed)' window.")
|
||||
else
|
||||
{
|
||||
WinWaitActive, Abyss Web Server X1 Setup: Completed, Completed, 5
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server X1 Setup: Completed (Completed)' window failed to appear.")
|
||||
else
|
||||
{
|
||||
Sleep, 700
|
||||
ControlClick, Button2, Abyss Web Server X1 Setup: Completed, Completed ; Hit 'Close' button
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to hit 'Close' button in 'Abyss Web Server X1 Setup: Completed (Completed)' window.")
|
||||
else
|
||||
{
|
||||
WinWaitClose, Abyss Web Server X1 Setup: Completed, Completed, 5
|
||||
if ErrorLevel
|
||||
TestsFailed("'Abyss Web Server X1 Setup: Completed (Completed)' window failed to close.")
|
||||
else
|
||||
TestsOK("Got thu a lot of windows successfully.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Check if program exists
|
||||
TestsTotal++
|
||||
if bContinue
|
||||
{
|
||||
Sleep, 2000
|
||||
RegRead, UninstallerPath, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AbyssWebServer, UninstallString
|
||||
if ErrorLevel
|
||||
TestsFailed("Either we can't read from registry or data doesn't exist.")
|
||||
else
|
||||
{
|
||||
StringReplace, UninstallerPath, UninstallerPath, `", , All ; Abyss string path contains quotes
|
||||
SplitPath, UninstallerPath,, InstalledDir
|
||||
IfNotExist, %InstalledDir%\%MainAppFile%
|
||||
TestsFailed("Something went wrong, can't find '" InstalledDir "\" MainAppFile "'.")
|
||||
else
|
||||
TestsOK("The application has been installed, because '" InstalledDir "\" MainAppFile "' was found.")
|
||||
}
|
||||
}
|
39
Abyss Web Server X1/2.7/zz_abyss_web_server_x1_2.7_test.ahk
Normal file
39
Abyss Web Server X1/2.7/zz_abyss_web_server_x1_2.7_test.ahk
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Designed for Abyss Web Server X1 2.7
|
||||
* Copyright (C) 2012 Edijs Kolesnikovics
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#Include ..\..\helper_functions.ahk
|
||||
InitalizeCounters()
|
||||
|
||||
params =
|
||||
(
|
||||
|
||||
1.install
|
||||
|
||||
)
|
||||
|
||||
if CheckParam()
|
||||
{
|
||||
; Those brackets are required!
|
||||
if 1 = 1.install
|
||||
{
|
||||
#include install_test.ahk
|
||||
}
|
||||
}
|
||||
|
||||
ShowTestResults()
|
Loading…
Reference in New Issue
Block a user