{"id":12073,"date":"2024-08-06T09:46:08","date_gmt":"2024-08-06T01:46:08","guid":{"rendered":"https:\/\/www.tosunai.com\/?p=12073"},"modified":"2024-08-06T12:18:35","modified_gmt":"2024-08-06T04:18:35","slug":"tsmaster-test-report-generator-operation-guide","status":"publish","type":"post","link":"https:\/\/www.tosunai.com\/en\/tsmaster-test-report-generator-operation-guide\/","title":{"rendered":"Sharing | TSMaster Test Report Generator Operation Guide"},"content":{"rendered":"
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\tThe TSMaster Test Report Generator is required when users develop test cases based on the TSMaster software, or when they need to generate HTML reports using TSMaster.\n\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t\t
\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
Table of Contents for this article<\/h6>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t
\n\t\t\t
\n\t\t\t\t<\/path><\/svg>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t\t
\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t

01. Test_Report Description\n\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\tTest_Report is a set of test report templates provided by TSMaster for customers, which integrates test report printout, image display, test status display, test pass\/fail rate display, and execution time display as a whole, the test report example is shown below:\n\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Test_Report\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t\t
\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t

02, Test_Report function description\n\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

1.<\/strong><\/em>test_init<\/strong><\/h3><\/section><\/section>
<\/section><\/section><\/section><\/section><\/section>
function name<\/strong><\/section><\/section><\/td>
s32 test_init(const pnative_int Handle, const char* ReportName)<\/section><\/section><\/td><\/tr>
Function<\/strong><\/section><\/section><\/td>
Initialize the test report generator and specify the name of the generated HTML report<\/section><\/section><\/td><\/tr>
call location<\/strong><\/section><\/section><\/td>
You need to call this function to initialize before executing other functions.<\/section><\/section><\/td><\/tr>
input parameter<\/strong><\/section><\/section><\/td>
Handle :Handle to the test report

ReportName: HTML name of the report<\/p><\/section><\/section><\/td><\/tr>

return value<\/strong><\/section><\/section><\/td>
==0: function executed successfully

Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

typical example<\/strong><\/section><\/section><\/td>
native_int Handle = 0;

Test_init(&Handle , \"testReport\").<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

2.<\/strong><\/em>test_title<\/strong><\/h3><\/section><\/section>
<\/section><\/section><\/section><\/section><\/section>
function name<\/strong><\/section><\/section><\/td>
s32 test_title(const native_int Handle, const char* testgroup, const char* testcase, const char* image, const char* testpurpose)<\/section><\/section><\/td><\/tr>
Function<\/strong><\/section><\/section><\/td>
Enter the test case group to which the current test case belongs, the name of the test case, and related information.<\/section><\/section><\/td><\/tr>
call location<\/strong><\/section><\/section><\/td>
Called before the start of each test case, this function is used to identify the test case group, test case name, and can be imported into the test environment picture and the purpose of the test and reference standards<\/section><\/section><\/td><\/tr>
input parameter<\/strong><\/section><\/section><\/td>
Handle : Handle to the test report

testgroup:: name of test case group<\/p>

testcase: name of the test case<\/p>

image: test environment picture, can be any picture, can be empty<\/p>

Testpurpose: the purpose of the test and the test reference standard, string, separated by commas, can be empty<\/p><\/section><\/section><\/td><\/tr>

return value<\/strong><\/section><\/section><\/td>
==0: function executed successfully

Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

typical example<\/strong><\/section><\/section><\/td>
native_int Handle = 0;

s32 ret = Test_init(&Handle , \"testReport\");<\/p>

if(ret == 0)<\/p>

{<\/p>

test_title(Handle , \"testgroup1\", \"testcase1\", \"\", \"\");<\/p>

}<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

3.<\/strong><\/em>test_step<\/strong><\/h3><\/section><\/section>
<\/section><\/section><\/section><\/section><\/section>
function name<\/strong><\/section><\/section><\/td>
s32 test_step(const native_int Handle, const char* teststep, const char* Description)<\/section><\/section><\/td><\/tr>
Function<\/strong><\/section><\/section><\/td>
Specific steps and descriptions for documenting test cases<\/section><\/section><\/td><\/tr>
call location<\/strong><\/section><\/section><\/td>
Called after the test_title function for each test case.<\/section><\/section><\/td><\/tr>
input parameter<\/strong><\/section><\/section><\/td>
Handle :Handle to the test report

teststep: test step<\/p>

Description:Step description, can be separated by English commas, to enter the desired results and actual results<\/p><\/section><\/section><\/td><\/tr>

return value<\/strong><\/section><\/section><\/td>
==0: function executed successfully

Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

typical example<\/strong><\/section><\/section><\/td>
native_int Handle = 0;

s32 ret = Test_init(&Handle , \"testReport\");<\/p>

if(ret == 0)<\/p>

{<\/p>

test_title(Handle , \"testgroup1\", \"testcase1\", \"\", \"\");<\/p>

test_step(Handle, \"1\", \"Starting to power up, powering up successfully, powering up successfully\");;<\/p>

}<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

4.<\/strong><\/em>test_pass<\/strong><\/h3><\/section><\/section>
<\/section><\/section><\/section><\/section><\/section>
function name<\/strong><\/section><\/section><\/td>
s32 test_pass(const native_int Handle, const char* teststep, const char* Description)<\/section><\/section><\/td><\/tr>
Function<\/strong><\/section><\/section><\/td>
Marking a step in a test case as passing the<\/section><\/section><\/td><\/tr>
call location<\/strong><\/section><\/section><\/td>
The test_title function for each test case is followed by the<\/section><\/section><\/td><\/tr>
input parameter<\/strong><\/section><\/section><\/td>
Handle :Handle to the test report

teststep: test step<\/p>

Description:Step Description<\/p><\/section><\/section><\/td><\/tr>

return value<\/strong><\/section><\/section><\/td>
==0: function executed successfully

Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

typical example<\/strong><\/section><\/section><\/td>
native_int Handle = 0;

s32 ret = Test_init(&Handle , \"testReport\");<\/p>

if(ret == 0)<\/p>

{<\/p>

test_title(Handle , \"testgroup1\", \"testcase1\", \"\", \"\");<\/p>

test_step(Handle, \"1\", \"Starting to power up, powering up successfully, powering up successfully\");;<\/p>

test_pass((Handle, \"1\", \"Starting to power up\").<\/p>

}<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

5.<\/strong><\/em>test_fail<\/strong><\/h3><\/section><\/section>
<\/section><\/section><\/section><\/section><\/section>
function name<\/strong><\/section><\/section><\/td>
s32 test_fail(const native_int Handle, const char* teststep, const char* Description)<\/section><\/section><\/td><\/tr>
Function<\/strong><\/section><\/section><\/td>
Marking a step in a test case as a failure<\/section><\/section><\/td><\/tr>
call location<\/strong><\/section><\/section><\/td>
The test_title function for each test case is followed by the<\/section><\/section><\/td><\/tr>
input parameter<\/strong><\/section><\/section><\/td>
Handle :Handle to the test report

teststep: test step<\/p>

Description:Step Description<\/p><\/section><\/section><\/td><\/tr>

return value<\/strong><\/section><\/section><\/td>
==0: function executed successfully

Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

typical example<\/strong><\/section><\/section><\/td>
native_int Handle = 0;

s32 ret = Test_init(&Handle , \"testReport\");<\/p>

if(ret == 0)<\/p>

{<\/p>

test_title(Handle , \"testgroup1\", \"testcase1\", \"\", \"\");<\/p>

test_step(Handle, \"1\", \"Starting to power up, powering up successfully, powering up successfully\");;<\/p>

test_fail(Handle, \"1\", \"Power-up failure\");<\/p>

}<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>

6.<\/strong><\/em>test_final<\/strong><\/h3><\/section><\/section>
<\/section><\/section><\/section><\/section><\/section>
function name<\/strong><\/section><\/section><\/td>
s32 test_final(const native_int Handle)<\/section><\/section><\/td><\/tr>
Function<\/strong><\/section><\/section><\/td>
End test report generation, release the handle and generate the final HTML test report.<\/section><\/section><\/td><\/tr>
call location<\/strong><\/section><\/section><\/td>
Called after all test cases have been executed.<\/section><\/section><\/td><\/tr>
input parameter<\/strong><\/section><\/section><\/td>
Handle :Handle of the test report<\/section><\/section><\/td><\/tr>
return value<\/strong><\/section><\/section><\/td>
==0: function executed successfully

Other values: function execution failed<\/p><\/section><\/section><\/td><\/tr>

typical example<\/strong><\/section><\/section><\/td>
native_int Handle = 0;

s32 ret = Test_init(&Handle , \"testReport\");<\/p>

if(ret == 0)<\/p>

{<\/p>

test_title(Handle , \"testgroup1\", \"testcase1\", \"\", \"\");<\/p>

test_step(Handle, \"1\", \"Starting to power up, powering up successfully, powering up successfully\");;<\/p>

test_fail(Handle, \"1\", \"Power-up failure\");<\/p>

test_final(Handle).<\/p>

}<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section><\/section>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"

When developing test cases based on the TSMaster software, or when you need to generate HTML reports using TSMaster, you need to enable the [...]<\/p>","protected":false},"author":11,"featured_media":12076,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[90],"tags":[65,131],"class_list":{"0":"post-12073","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-software-tutorial","8":"tag-tsmaster","10":"entry","11":"has-media","12":"owp-thumbs-layout-horizontal","13":"owp-btn-normal","14":"owp-tabs-layout-horizontal","15":"has-no-thumbnails","16":"has-product-nav"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts\/12073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/comments?post=12073"}],"version-history":[{"count":0,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts\/12073\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/media\/12076"}],"wp:attachment":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/media?parent=12073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/categories?post=12073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/tags?post=12073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}