37020^Testfall-Protokoll^--Autor: D. Quathamer\ --Datum: 2.8.2019\ --Freemarker Template\ <#include "SQL_lingua_franca"/>\ <#include "SuperX_general"/>\ --Achtung: Diese Script ist auch das select_stmt der Maske 37020\ \ <#assign resultValueNative="result_value::float" />\ <#if SQLdialect='Postgres'>\ <#assign resultValueNative="round(decval(replace(result_value,'.',',')),0) " />\ \ \ <#assign inEtl=true />\ <#if Maskennummer?exists && Maskennummer=37020>\ <#assign inEtl=false />\ \ \ <#assign mask_execution_id="" />\ <#if inEtl>\ \ \ \ <@selectintotmp \ select="1::integer as testcase_type,\ A.tid as qa_mask_execution_assert_result_tid,\ R.tid,\ R.mask_execution_id,\ R.execution_start,\ R.execution_end,\ R.result_code,\ null::integer as result_status,\ ''::char(255) as result_status_str,\ A.result_value,\ E.tid as execution_id,\ E.name as execution_name,\ E.uniquename,\ E.systeminfo_id,\ ''::char(255) as systeminfo_id_str,\ ''::varchar(255) as ticket_link,\ E.maskeninfo_id,\ ''::char(255) as maskeninfo_id_str,\ A.mask_execution_assert_id,\ null::integer as dauer,\ A.assert_result_value_min as result_value_min,\ A.assert_result_value_max as result_value_max,\ null::varchar(255) as assert_caption,\ null::varchar(255) as assert_value_range,\ null::varchar(255)[] as fields,\ null::varchar(255) as nextedit,\ null::varchar(255) as nextmask,\ null::varchar(255) as nexttable\ "\ source="qa_mask_execution E, qa_mask_execution_result R inner join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)"\ target="tmp_testcase">\ -- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen\ where \ E.tid=R.mask_execution_id\ and A.result_code is null\ \ <@informixnolog/>;\ \ <#else>\ \ \ <@selectintotmp \ select="1::integer as testcase_type,\ A.tid as qa_mask_execution_assert_result_tid,\ R.tid,\ R.mask_execution_id,\ R.execution_start,\ R.execution_end,\ R.result_code,\ null::integer as result_status,\ ''::char(255) as result_status_str,\ A.result_value,\ E.tid as execution_id,\ E.name as execution_name,\ E.uniquename,\ E.systeminfo_id,\ ''::char(255) as systeminfo_id_str,\ ''::varchar(255) as ticket_link,\ E.maskeninfo_id,\ ''::char(255) as maskeninfo_id_str,\ A.mask_execution_assert_id,\ null::decimal(20,6) as dauer,\ A.assert_result_value_min as result_value_min,\ A.assert_result_value_max as result_value_max,\ null::varchar(255) as assert_caption,\ null::varchar(255) as assert_value_range,\ null::varchar(255)[] as fields, \ ('' || E.maskeninfo_id || '&')::text as nextmask,\ ('../edit/qa/qa_mask_execution_edit.jsp|tid=' || E.tid)::varchar(255) as nextedit,\ ('37040&Ergebnis=' || R.tid)::varchar(255) as nexttable\ "\ source="qa_mask_execution E, qa_mask_execution_result R left outer join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)"\ target="tmp_testcase">\ -- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen\ where \ E.tid=R.mask_execution_id\ /* and E.is_active=<> */\ /* and E.maskeninfo_id=<> */\ /* and E.userinfo_id=<> */\ /* and E.systeminfo_id=<> */\ /* and position(<> in E.name)>0 */\ /* and E.uniquename = <> */\ /* and date(R.execution_start) >= date_val(<>) */\ /* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<>) */\ /* and 1=<> */\ \ <@informixnolog/>;\ \ \ \ <#if SQLdialect='Postgres'>\ update tmp_testcase set assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) \ from qa_mask_execution_assert A\ where A.tid=tmp_testcase.mask_execution_assert_id;\ <#else>\ --Informix Dialekt:\ update tmp_testcase set assert_caption=(select \ nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)\ from qa_mask_execution_assert A\ where A.tid=tmp_testcase.mask_execution_assert_id\ )\ where tmp_testcase.mask_execution_assert_id in (select A.tid\ from qa_mask_execution_assert A)\ ;\ \ \ \ update tmp_testcase set result_status=2,\ result_status_str='Fehler'\ where result_code!=0;\ \ update tmp_testcase set result_status=0,\ result_status_str='Erfolg'\ where result_code=0\ and (\ (${resultValueNative} >= result_value_min or result_value_min is null) \ and\ (${resultValueNative} <= result_value_max or result_value_max is null) \ )\ ;\ \ update tmp_testcase set result_status=1,\ result_status_str='Warnung'\ where result_status is null;\ \ update tmp_testcase set assert_value_range=result_value_min || '-' || result_value_max;\ \ update tmp_testcase set dauer=\ <#if SQLdialect='Postgres'>\ round(extract(second from (execution_end-execution_start))::decimal,0)::decimal\ <#else>\ execution_end-execution_start\ \ ;\ update tmp_testcase set ticket_link=P.issue_link || TP.issue_id\ from qa_mask_execution2project TP, qa_project P\ where TP.mask_execution_id=tmp_testcase.mask_execution_id\ and P.tid=TP.project_id\ ;\ --nun DB-Tests:\ <@selectintotmp \ select="\ T.tid,\ T.name,\ T.uniquename,\ R.execution_start,\ R.execution_end,\ R.result_code,\ null::integer as result_status,\ ''::char(255) as result_status_str,\ R.result_value,\ T.systeminfo_id,\ ''::char(255) as systeminfo_id_str,\ A.tid as qa_dbtest_assertion_id,\ A.def_col_caption,\ A.def_col_name,\ A.def_col_value,\ ''::varchar(255) as ticket_link,\ ('../edit/qa/qa_dbtest_edit.jsp|tid=' || T.tid)::varchar(255) as nextedit\ "\ source="qa_dbtest T, qa_dbtest_assertion A inner join qa_dbtest_result R \ on (R.dbtest_assertion_id=A.tid /* and date(R.execution_start) >= date_val(<>) */\ /* and R.tid=<> */\ )"\ target="tmp_qa_dbtest">\ where \ T.tid=A.dbtest_id\ /* and T.active=<> */\ /* and T.tid in (select P.dbtest_id from qa_dbtest2project P where P.project_id=<>) */\ /* and E.userinfo_id=<> */\ /* and T.systeminfo_id=<> */\ /* and position(<> in T.name)>0 */\ /* and T.uniquename = <> */\ /* and T.tid=<> */\ /* and 2=<> */\ \ <@informixnolog/>;\ \ update tmp_qa_dbtest set ticket_link=P.issue_link || TP.issue_id\ from qa_dbtest2project TP, qa_project P\ where TP.dbtest_id=tmp_qa_dbtest.tid\ and P.tid=TP.project_id\ ;\ update tmp_qa_dbtest set --result_status=1,\ result_status_str='Warnung'\ where result_code=1;\ update tmp_qa_dbtest set result_status=2,\ result_status_str='Fehler'\ where result_code is null;\ -- \ update tmp_qa_dbtest set \ result_status_str='Erfolg'\ where result_code=0\ ;\ \ /* delete from tmp_qa_dbtest where result_code not in ( <>) ; */\ \ \ \ insert into tmp_testcase(testcase_type,\ systeminfo_id,\ execution_name,\ uniquename,\ --maskeninfo_id_str,\ --nextserverlink,\ ticket_link,\ --nextmask,\ execution_start,\ dauer,\ assert_caption,\ assert_value_range,\ result_value,\ result_status_str,\ nexttable,\ nextedit\ )\ select 2::integer as testcase_type, --DB-Test\ systeminfo_id,\ name,\ uniquename,\ case when ticket_link !='' then 'Ticket|' || ticket_link else '' end as ticket_link,\ execution_start,\ <#if SQLdialect='Postgres'>\ round(extract(second from (execution_end-execution_start))::decimal,0)::integer as dauer,\ <#else>\ execution_end-execution_start as dauer,\ \ nvl(def_col_caption,def_col_name) as assert_caption,\ def_col_value as assert_value_range,\ result_value,\ result_status_str,\ '' as nexttable,\ nextedit\ from tmp_qa_dbtest\ ;\ \ drop table tmp_qa_dbtest;\ \ \ \ <#if inEtl>\ \ update qa_mask_execution_assert_result set result_code=T.result_status\ from tmp_testcase T\ where T.qa_mask_execution_assert_result_tid=qa_mask_execution_assert_result.tid \ and qa_mask_execution_assert_result.result_code is null;\ \ drop table tmp_testcase;\ \ <#else>\ \ /* delete from tmp_testcase where result_status not in (<>) ; */\ \ \ update tmp_testcase set systeminfo_id_str=(select name from systeminfo S\ where S.tid=tmp_testcase.systeminfo_id);\ \ update tmp_testcase set maskeninfo_id_str=(select name from maskeninfo M\ where M.tid=tmp_testcase.maskeninfo_id);\ \ <#if SQLdialect='Postgres'>\ \ update tmp_testcase set fields=(select array_agg(trim(F.name) || '=' || trim(S.field_value))\ from qa_mask_field_sel S, felderinfo F\ where S.felderinfo_id=F.tid\ and S.is_active=1\ and S.mask_execution_id=tmp_testcase.execution_id\ );\ \ update tmp_testcase set nextmask=nextmask || array_to_string(fields,'&','')\ where fields is not null;\ \ \ \ select systeminfo_id_str,\ execution_name,\ uniquename,\ maskeninfo_id_str,\ nextmask,\ ticket_link as nextserverlink,\ execution_start,\ dauer,\ assert_caption,\ assert_value_range,\ result_value,\ result_status_str,\ nexttable\ <#if UserIsAdmin>\ ,nextedit\ \ from tmp_testcase\ order by 1,2,3,4,5,6,7;\ \ ^--freemarker template\ XIL List\ drop_and_delete movable_columns sizable_columns horizontal_scrolling\ white_space_color=COLOR_WHITE fixed_columns=2\ min_heading_height=35\ Column CID=0 heading_text="Komponente" center_heading\ row_selectable col_selectable heading_platform readonly\ width=12 text_size=100\ Column CID=1 heading_text="Testfall" center_heading\ row_selectable col_selectable heading_platform readonly\ width=20 text_size=200\ Column CID=1 heading_text="Testfall\\nSchlüssel" center_heading\ row_selectable col_selectable heading_platform readonly\ width=20 text_size=200\ Column CID=1 heading_text="Maske" center_heading\ row_selectable col_selectable heading_platform readonly\ width=40 text_size=200\ Column CID=1 heading_text="Maske\\naufrufen" center_heading\ row_selectable col_selectable heading_platform readonly\ width=40 text_size=200\ Column CID=1 heading_text="Ticket" center_heading\ row_selectable col_selectable heading_platform readonly\ width=40 text_size=200\ Column CID=1 heading_text="Ausführungszeit\\nStart" center_heading\ row_selectable col_selectable heading_platform readonly\ width=14 text_size=200\ Column CID=1 heading_text="Dauer\\n(Sek.)" center_heading\ row_selectable col_selectable heading_platform readonly\ width=6 text_size=200\ Column CID=1 heading_text="Erwarteter Wert\\n(Zelle)" center_heading\ row_selectable col_selectable heading_platform readonly\ width=15 text_size=200\ Column CID=1 heading_text="Erwarteter Wert" center_heading\ row_selectable col_selectable heading_platform readonly\ width=15 text_size=200\ Column CID=1 heading_text="Gefundener Wert" center_heading\ row_selectable col_selectable heading_platform readonly\ width=5 text_size=200\ Column CID=1 heading_text="Ausführungsstatus" center_heading\ row_selectable col_selectable heading_platform readonly\ width=15 text_size=200\ Column CID=1 heading_text="Details" center_heading\ row_selectable col_selectable heading_platform readonly\ width=5 text_size=200\ <#if UserIsAdmin>\ Column CID=1 heading_text="Bearbeiten" center_heading\ row_selectable col_selectable heading_platform readonly\ width=5 text_size=200\ \ @@@^^^Protokoll der Testfall-Ausführung ausgeben^drop table tmp_testcase;^^1^440^360^0^1^^