Initial: flux text FoxBin2Prg (git urmareste .??2 in-arbore, binarele VFP git-ignored)
Include si sistemul de depanare/testare headless din Teste\ (harness UI cu capturi, verificare de sintaxa prin compilare, wrappere text<->binar) si docs\depanare_testare_flora2roa.md.
This commit is contained in:
82
Teste/test_frm_import_ui.prg
Normal file
82
Teste/test_frm_import_ui.prg
Normal file
@@ -0,0 +1,82 @@
|
||||
* test_frm_import_ui.prg - test UI smoke pentru formularul real frm_import.
|
||||
* Verifica pornirea aplicatiei fara Oracle: mediul se initializeaza, formularul se instantiaza,
|
||||
* Init completeaza intervalul de date din settings.ini, iar metoda Trace scrie in edtInfo.
|
||||
*
|
||||
* Rulare (orchestrator + capturi):
|
||||
* powershell -ExecutionPolicy Bypass -File Teste\vfp_ui_harness.ps1 `
|
||||
* -TestPrg 'D:\PROIECTE\FLORA\FLORA2ROA\Teste\test_frm_import_ui.prg' `
|
||||
* -Steps @('afisat','trace','date')
|
||||
* Rulare fara capturi: vfp9.exe -A -T "Teste\test_frm_import_ui.prg" (auto-continue la 30s/pas)
|
||||
|
||||
SET SAFETY OFF
|
||||
SET TALK OFF
|
||||
|
||||
PUBLIC gcUILog, gcSyncDir, gnTestFail, gnMockRaspuns, gcMockUltimMesaj, gnMockUltimTip
|
||||
gnTestFail = 0
|
||||
gnMockRaspuns = 6
|
||||
gcMockUltimMesaj = ''
|
||||
gnMockUltimTip = 0
|
||||
|
||||
LOCAL lcTestDir
|
||||
lcTestDir = ADDBS(JUSTPATH(SYS(16, 0)))
|
||||
gcUILog = lcTestDir + 'test_frm_import_ui_log.txt'
|
||||
gcSyncDir = lcTestDir + 'uisync\'
|
||||
IF !DIRECTORY(gcSyncDir)
|
||||
MD (gcSyncDir)
|
||||
ENDIF
|
||||
STRTOFILE('START ' + TTOC(DATETIME()) + CHR(13) + CHR(10), gcUILog)
|
||||
|
||||
DO (lcTestDir + 'test_init_env_auto.prg') WITH .F.
|
||||
|
||||
SET PROCEDURE TO (lcTestDir + 'ui_harness.prg') ADDITIVE
|
||||
* mock-ul de dialoguri se incarca ULTIMUL, ca sa umbreasca amessagebox din myutils.prg
|
||||
SET PROCEDURE TO (lcTestDir + 'mock_amessagebox.prg') ADDITIVE
|
||||
|
||||
DO HarnessInit
|
||||
HarnessLog('Mediu initializat. goApp=' + TYPE('goApp') + ' goExecutor=' + TYPE('goExecutor') + ;
|
||||
' goConn=' + TYPE('goConn'))
|
||||
|
||||
TestAssert(TYPE('goApp') = 'O', 'goApp instantiat')
|
||||
TestAssert(TYPE('goExecutor') = 'O', 'goExecutor instantiat')
|
||||
TestAssert(TYPE('goConn') = 'O', 'goConn instantiat')
|
||||
TestAssert(TYPE('goApp.oSettings') = 'O', 'settings.ini citit in goApp.oSettings')
|
||||
|
||||
PUBLIC goImportFrm
|
||||
DO FORM (gcAppPath + 'frm_import') NAME goImportFrm NOSHOW
|
||||
* modeless: Show(1) pe un formular modal nu returneaza si blocheaza testul headless
|
||||
goImportFrm.WindowType = 0
|
||||
goImportFrm.Show()
|
||||
goImportFrm.WindowState = 2
|
||||
DOEVENTS FORCE
|
||||
|
||||
TestAssert(TYPE('goImportFrm') = 'O', 'frm_import instantiat')
|
||||
TestAssert(TYPE('goImportFrm.txtData1.Value') = 'D', 'txtData1 are valoare data')
|
||||
TestAssert(TYPE('goImportFrm.txtData2.Value') = 'D', 'txtData2 are valoare data')
|
||||
TestAssert(goImportFrm.txtData1.Value <= goImportFrm.txtData2.Value, ;
|
||||
'interval valid: ' + DTOC(goImportFrm.txtData1.Value) + ' - ' + DTOC(goImportFrm.txtData2.Value))
|
||||
TestAssertEqual(1, goImportFrm.chkTest.Value, 'bifa Test activa implicit (nu scrie note in ROA)')
|
||||
|
||||
DO HarnessStep WITH 0, 'formular afisat'
|
||||
|
||||
* Trace este canalul prin care formularul raporteaza progresul importului
|
||||
goImportFrm.Trace('Verificare harness: mesaj de test')
|
||||
DOEVENTS FORCE
|
||||
TestAssert('Verificare harness' $ goImportFrm.edtInfo.Value, 'Trace scrie in edtInfo')
|
||||
|
||||
DO HarnessStep WITH 1, 'trace scris in edtInfo'
|
||||
|
||||
* schimbarea intervalului se reflecta in controale (fluxul real al utilizatorului)
|
||||
goImportFrm.txtData1.Value = DATE(2025, 6, 1)
|
||||
goImportFrm.txtData2.Value = DATE(2025, 6, 30)
|
||||
goImportFrm.Refresh()
|
||||
DOEVENTS FORCE
|
||||
TestAssertEqual(DATE(2025, 6, 1), goImportFrm.txtData1.Value, 'data inceput modificata')
|
||||
TestAssertEqual(DATE(2025, 6, 30), goImportFrm.txtData2.Value, 'data sfarsit modificata')
|
||||
|
||||
DO HarnessStep WITH 2, 'interval 06/2025 setat'
|
||||
|
||||
HarnessLog('REZULTAT: ' + TestRezultat())
|
||||
DO HarnessDone WITH TestRezultat()
|
||||
|
||||
goImportFrm.Release()
|
||||
QUIT
|
||||
Reference in New Issue
Block a user