update testcase template and add write function to html