1import os
2import sys
3import time
4import test_utils
5import test_constants
6import logging
7
8def get_test_header():
9
10    notes =  "*                     App Run Tests                   *\n"
11    notes += "*                                                     *\n"
12    notes += "* Test run application in studio                      *\n"
13    return notes
14
15def run_app_tests(generate, screenshot):
16
17    test_utils.output_test_header(get_test_header())
18    test_utils.setup(generate, screenshot, 'test_app_run_golden_file')
19
20    # open test project
21    test_utils.open_project('test_app_run.gxp')
22
23    test_utils.select_project_tree_node('main_window')
24
25    test_utils.run_application()
26    test_utils.terminate_app_execution()
27    test_utils.compare_result()
28
29    test_utils.select_project_tree_node('second_main_window')
30    test_utils.compare_result()
31
32    test_utils.run_application()
33    test_utils.terminate_app_execution()
34    test_utils.compare_result()
35
36    test_utils.write_end("Test App Run")
37
38