def test_grid_square_screenshots():
    for row in range(gwg.num_rows()):
        for col in range(gwg.num_cols()):
            file_url = ('%sss_test/grid/grid_(%s_%s).png' %
                        (_img_direct, row, col))
            va.screenshot(file_url, region=gwg.get_rect_at(row, col))
def take_grid_square_screenshot(row, col):
    file_url = ('%sss_test\\grid\\squares\\grid_(%s_%s).png' %
                (_img_direct, row, col))
    print('Taking screenshot:', file_url)
    va.screenshot(file_url, region=gwg.get_rect_at(row, col))
def take_quadrant_screenshot(quad_index):
    file_url = ('%sss_test\\grid\\quads\\grid_quad_%s.png' %
                (_img_direct, quad_index))
    print('Taking screenshot:', file_url)
    va.screenshot(file_url, region=gwg.get_quadrant_rect(quad_index))
def take_half_screenshot(half_name):
    file_url = ('%sss_test\\grid\\halves\\grid_half_%s.png' %
                (_img_direct, half_name))
    print('Taking screenshot:', file_url)
    va.screenshot(file_url, region=gwg.get_half_rect(half_name))
def take_row_screenshot(row):
    file_url = '%sss_test\\grid\\rows\\grid_row_%s.png' % (_img_direct, row)
    print('Taking screenshot:', file_url)
    va.screenshot(file_url, region=gwg.get_row_rect(row))
def take_col_screenshot(col):
    file_url = '%sss_test\\grid\\cols\\grid_col_%s.png' % (_img_direct, col)
    print('Taking screenshot:', file_url)
    va.screenshot(file_url, region=gwg.get_col_rect(col))
def take_window_screenshot():
    file_url = '%sss_test\\grid\\game_window.png' % _img_direct
    print('Taking screenshot:', file_url)
    va.screenshot(file_url)
Exemple #8
0
 def take_window_ss(self):
     wc.set_window_foreground_and_resize()
     window_ss = va.screenshot(region=wc.get_window_rect())
     kc.alt_tab()
     return window_ss
def test_window_screenshot():
    print('Testing window screenshot...')
    img_name = 'img/ss_test/window_ss_test.png'
    va.screenshot(file_name=img_name)
    print('Screenshot stored in: ' + img_name)
def test_runtime_window_screenshot():
    print('Testing window screenshot runtime...')
    runtime = trt.get_avg_runtime(lambda: va.screenshot())
    print('Avg runtime: ' + str(runtime))
def test_half_screenshot(half_name):
    print('Testing window right half screenshot')
    img_name = 'img/ss_test/window_right_ss_test.png'
    va.screenshot(file_name=img_name, region=gwg.get_half_rect(half_name))