Example #1
0
def run_tests(self):
    app.tap_menu_js()
    c.log('Validating montage')
    c.click_item('testaut_menu_montage')
    sleep(2)
    c.take_screenshot(None, 'montage-view-initial.png')
    c.click_item('img-0')
    sleep(4)
    c.take_screenshot(None, 'montage-singleview.png')
    c.log('Trying to save to gallery...')
    c.click_item('testaut_monitormodal_camera_button')
    if c.platform == 'ios':
        sleep(3)
        try:
            c.log("iOS:Auto accepting alert...")
            c.driver.execute('mobile:alert', {action: 'accept'})
            #c.driver.switchTo().alert().accept();
        except:
            pass
    c.wait_for_loading_text(
        save_screenshot=True,
        save_screenshot_file='single-view-photo-save-results.png',
        text_options=['done', 'Error - could not save'])
    sleep(1)
    c.dbl_click_item('singlemonitor')
def graphics_test() -> None:
    from utility.constants import DATA_PATH, TEST_DATA_PATH
    import pyautogui

    # pick RRT Connect algorithm
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'algorithm_new.png'),
                                          confidence=0.55)
    pyautogui.click(x + 150, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'rrt_connect.png'),
                                          confidence=0.8)
    pyautogui.click(x, y)

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'update.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)

    wait_for('initialised.png')

    # make obstacles transparent for a better ss comparison
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'obstacles_new.png'),
                                          confidence=0.75)
    pyautogui.click(x - 115, y)

    # run algo
    pyautogui.press('t')
    wait_for('done.png')

    take_screenshot("RRT_Connect_test_3D.png", threshold=350)
def run_tests(self, isFirstRun = False):

    success_color = 'rgba(22, 160, 133, 1)'
    fail_color = 'rgba(231, 76, 60, 1)'

    c.log ('Validating wizard test case')

    if isFirstRun:
        c.log ('First run, assuming first use screen')
        c.click_item('testaut_wizard_button')
    else:
        c.log ('Launching wizard via menu')
        app.tap_menu_js()
        c.click_item('testaut_menu_wizard')

    c.log ('Entering portal text')
    c.input_item('testaut_portal_input', c.testConfig['portal'])

    c.click_item('testaut_wiz1_next_button')

    c.log ('Setting up auth parameters')
    # fill in auth settings based on how you configured the server
    if c.testConfig['use_auth']:
        c.tap_toggle('testaut_useauth_toggle')
        if c.testConfig['use_zm_auth']:
            c.tap_toggle('testaut_usezmauth_toggle')
            c.input_item('testaut_zmauthusername_input', c.testConfig['user'])
            c.input_item('testaut_zmauthpassword_input', c.testConfig['password'])
        if c.testConfig['use_basic_auth']:
            c.tap_toggle('testaut_usebasicauth_toggle')
            c.input_item('testaut_basicauthusername_input', c.testConfig['basic_user'])
            c.input_item('testaut_basicauthpassword_input', c.testConfig['basic_password'])
            #sleep(10)
    c.click_item('testaut_wiz2_next_button')

    # Now check wizard results
    portal_ok = c.get_element_attributes('testaut_wizard_portal_results')
    portal_color = portal_ok.value_of_css_property('color')
    self.assertEqual(portal_color,success_color)
    # don't do this before assert. If portal fails, api won't show
    api_ok = c.get_element_attributes('testaut_wizard_api_results')
    api_color = api_ok.value_of_css_property('color')
    self.assertEqual(api_color,success_color)
    
    # Wait for bit for cgi-bin. Don't really care, but hey if we catch it, cool
    sleep(5)
    c.take_screenshot(None,'wizard-detection-results.png')


    c.click_item('testaut_wizard_goto_login')
    c.click_item('testaut_settings_save')


    # discard the popup and get to sane state
    c.click_popup(save_screenshot=True, save_screenshot_file='wizard-save-report.png')
    # we need this because at the end of wizard, it shows the menu,
    # so close it
    app.tap_menu_js()
Example #4
0
def run_tests(self):
    app.tap_menu_js()
    c.log ('Validating state with restart')
    c.click_item('testaut_menu_state')
    c.click_item('testaut_state_restart_button')
    c.click_popup(save_screenshot=True, save_screenshot_file='state-restart-prompt.png')
    # Wait for state change to show
    sleep(2)
    c.take_screenshot(None,'state-after-restart.png')
def graphics_test() -> None:
    from utility.constants import DATA_PATH, TEST_DATA_PATH
    import pyautogui

    # Pick Uniform Random Fill 3D with Potential Field
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'map.png'),
                                          confidence=0.5)
    pyautogui.click(x + 160, y + 5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'uniform.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)
    time.sleep(0.5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'algorithm_new.png'),
                                          confidence=0.55)
    pyautogui.click(x + 150, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'potential_field.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)

    # start and end goals coordinate input
    pyautogui.click(342, 545)
    pyautogui.write('6')
    pyautogui.doubleClick(422, 545)
    pyautogui.write('1')
    pyautogui.doubleClick(502, 545)
    pyautogui.write('2')
    time.sleep(0.5)
    pyautogui.doubleClick(342, 617)
    pyautogui.write('6')
    time.sleep(0.5)
    pyautogui.doubleClick(422, 617)
    pyautogui.write('5')
    pyautogui.doubleClick(502, 617)
    pyautogui.write('5')

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'update.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)

    wait_for('initialised.png')
    wait_for('traversables_new.png')

    # make traversables transparent for the RRT
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'traversables_new.png'),
                                          confidence=0.5)
    pyautogui.click(x - 120, y)

    # run algo
    pyautogui.press('t')
    wait_for('done.png', confidence=0.8)
    take_screenshot("potential_field_3d.png")
def graphics_test() -> None:
    from utility.constants import DATA_PATH, TEST_DATA_PATH
    import pyautogui

    # Select map Labyrinth, Potential Field algorithm
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'map.png'),
                                          confidence=0.5)
    pyautogui.click(x + 160, y + 5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'labyrinth_new.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'algorithm_new.png'),
                                          confidence=0.5)
    pyautogui.click(x + 150, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'potential_field.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)

    # start and end goals coordinate input
    pyautogui.click(342, 545)
    pyautogui.write('17')
    pyautogui.doubleClick(422, 545)
    pyautogui.write('15')
    pyautogui.doubleClick(342, 617)
    pyautogui.write('17')
    pyautogui.doubleClick(422, 617)
    pyautogui.write('4')

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'update.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)
    wait_for('initialised.png')

    # pick colours and do other modifications on the map
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'traversables_new.png'),
                                          confidence=0.5)
    pyautogui.click(x - 85, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'lime.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)

    pyautogui.press('t')
    wait_for('done.png')
    take_screenshot("potential_field_2d.png")
Example #7
0
def graphics_test() -> None:
    from utility.constants import DATA_PATH, TEST_DATA_PATH
    import pyautogui

    # Select map Labyrinth, A* algorithm, update
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'map.png'), confidence=0.6)
    pyautogui.click(x + 160, y + 5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'labyrinth_new.png'), confidence=0.5)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'algorithm_new.png'), confidence=0.6)
    pyautogui.click(x + 150, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'a_star.png'), confidence=0.6)
    pyautogui.click(x, y)

    # start and end goals coordinate input
    pyautogui.click(342, 545)
    pyautogui.write('17')
    pyautogui.doubleClick(422, 545)
    pyautogui.write('9')
    pyautogui.doubleClick(342, 617)
    pyautogui.write('6')
    pyautogui.doubleClick(422, 617)
    pyautogui.write('4')

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'update.png'), confidence=0.6)
    pyautogui.click(x, y)

    wait_for('initialised.png')
    wait_for('traversables_new.png')

    # pick colours and other modifications of the map
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'traversables_new.png'), confidence=0.5)
    pyautogui.click(x - 85, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'lightblue.png'), confidence=0.8)
    pyautogui.click(x, y)

    pyautogui.press('t')
    wait_for('done.png')

    take_screenshot("labyrinth_A_1.png", threshold=350)

    wait_for('traversables_new.png')

    # make traversables transparent
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'traversables_new.png'), confidence=0.5)
    pyautogui.click(x - 125, y)

    take_screenshot("labyrinth_A_2.png", threshold=350)
def run_tests(self):
    app.tap_menu_js()
    c.log('Validating events')
    c.click_item('testaut_menu_events')

    # Can't use click_item (el.click) due to footer button
    # focus conflict
    # taking 2nd event - first one goes off in emulator
    # no idea why

    c.click_item_js('testaut_events_footage_button-1')

    sleep(4)
    c.take_screenshot(None, 'events-playback.png')
    sleep(1)
    c.dbl_click_item('testaut_events_playwindow')
Example #9
0
def run_tests(self):
    app.tap_menu_js()
    c.log ('Validating events')
    c.click_item('testaut_menu_events')

    # Can't use click_item (el.click) due to footer button
    # focus conflict
    # taking 2nd event - first one goes off in emulator
    # no idea why
    
    c.click_item_js('testaut_events_footage_button-1')
  
    sleep(4)
    c.take_screenshot(None,'events-playback.png')
    sleep(1)
    c.dbl_click_item('testaut_events_playwindow')
Example #10
0
def graphics_test() -> None:
    from utility.constants import DATA_PATH, TEST_DATA_PATH
    import pyautogui


    # pick RRT algorithm
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'algorithm_new.png'), confidence=0.55)
    pyautogui.click(x + 150, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'rrt2.png'), confidence=0.9)
    pyautogui.click(x, y)

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH, 'update.png'), confidence=0.5)
    pyautogui.click(x, y)

    wait_for('initialised.png')

    # run algo
    pyautogui.press('t')
    wait_for('done.png')

    take_screenshot("RRT_test_2D.png", threshold=350)
Example #11
0
def run_tests(self):
    app.tap_menu_js()
    c.log ('Validating montage')
    c.click_item('testaut_menu_montage')
    sleep(2)
    c.take_screenshot(None, 'montage-view-initial.png')
    c.click_item('img-0')
    sleep(4)
    c.take_screenshot(None,'montage-singleview.png')
    c.log ('Trying to save to gallery...')
    c.click_item('testaut_monitormodal_camera_button')
    if c.platform == 'ios':
        sleep(3)
        try:
            c.log ("iOS:Auto accepting alert...")
            c.driver.execute('mobile:alert', { action: 'accept' });
            #c.driver.switchTo().alert().accept();
        except:
            pass
    c.wait_for_loading_text(save_screenshot=True, save_screenshot_file='single-view-photo-save-results.png', text_options = ['done', 'Error - could not save'])
    sleep(1)
    c.dbl_click_item('singlemonitor')
Example #12
0
def graphics_test() -> None:
    from utility.constants import DATA_PATH, TEST_DATA_PATH
    import pyautogui

    # Pick 3d cube with A*
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'map.png'),
                                          confidence=0.5)
    pyautogui.click(x + 160, y + 5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       '3d_cube.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'algorithm_new.png'),
                                          confidence=0.5)
    pyautogui.click(x + 150, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'a_star.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)

    # start and end goals coordinate input
    pyautogui.click(342, 545)
    pyautogui.write('1')
    pyautogui.doubleClick(422, 545)
    pyautogui.write('1')
    pyautogui.doubleClick(502, 545)
    pyautogui.write('1')
    time.sleep(0.5)
    pyautogui.doubleClick(342, 617)
    pyautogui.write('13')
    time.sleep(0.5)
    pyautogui.doubleClick(422, 617)
    pyautogui.write('1')
    pyautogui.doubleClick(502, 617)
    pyautogui.write('13')

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'update.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)

    wait_for('initialised.png')

    # run algo
    pyautogui.press('t')

    wait_for('traversables_new.png')

    # pick colours and other modifications of the map
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'traversables_new.png'),
                                          confidence=0.5)
    pyautogui.click(x - 85, y)
    time.sleep(0.5)

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'colour_1.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)
    time.sleep(0.5)

    wait_for('traversables_new.png')
    wait_for('done.png')

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'traversables_new.png'),
                                          confidence=0.5)
    pyautogui.click(x - 125, y)
    time.sleep(0.6)
    take_screenshot("3d_A_1.png")

    wait_for('traversables_new.png')

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'traversables_new.png'),
                                          confidence=0.5)
    pyautogui.click(x - 125, y)

    take_screenshot("3d_A_2.png")
Example #13
0
def graphics_test() -> None:
    from utility.constants import DATA_PATH, TEST_DATA_PATH
    import pyautogui

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'map.png'),
                                          confidence=0.5)
    pyautogui.click(x + 160, y + 5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'labyrinth_new.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'algorithm_new.png'),
                                          confidence=0.5)
    pyautogui.click(x + 150, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'a_star.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)

    # start and end goals coordinate input
    pyautogui.click(342, 545)
    pyautogui.write('17')
    pyautogui.doubleClick(422, 545)
    pyautogui.write('9')
    pyautogui.doubleClick(342, 617)
    pyautogui.write('4')
    pyautogui.doubleClick(422, 617)
    pyautogui.write('5')

    # update
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'update.png'),
                                          confidence=0.5)
    pyautogui.click(x, y)
    wait_for('initialised.png')

    # go into state 1
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'one.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)

    # pick colors and other modifications of the map
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'traversables_new.png'),
                                          confidence=0.5)
    pyautogui.click(x - 83, y)
    time.sleep(0.5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'orange.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)
    time.sleep(0.5)

    # run
    pyautogui.press('t')
    wait_for('done.png')
    time.sleep(0.2)

    # change trace color
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'trace.png'),
                                          confidence=0.8)
    pyautogui.click(x - 70, y)
    time.sleep(0.5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'colour_1.png'),
                                          confidence=0.8)
    pyautogui.click(x, y)
    time.sleep(1.5)

    transparent_1 = take_screenshot()
    time.sleep(1)

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'save.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)
    time.sleep(2)

    # go to state 2
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'two.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)

    transparent_2 = take_screenshot()

    # change colors
    time.sleep(0.5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'traversables_new.png'),
                                          confidence=0.5)
    pyautogui.click(x - 85, y)
    time.sleep(0.5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'lime.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)
    time.sleep(0.5)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'trace.png'),
                                          confidence=0.8)
    pyautogui.click(x - 70, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'lightblue.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'visited.png'),
                                          confidence=0.7)
    pyautogui.click(x - 70, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'colour_2.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)

    # test restore changes
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'restore.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)
    time.sleep(1.5)

    transparent_restored_2 = take_screenshot()

    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'one.png'),
                                          confidence=0.7)
    pyautogui.click(x, y)
    time.sleep(2.5)

    transparent_restored_1 = take_screenshot()

    # check if all states are working
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'three.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'four.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'five.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)
    x, y = pyautogui.locateCenterOnScreen(os.path.join(TEST_DATA_PATH,
                                                       'six.png'),
                                          confidence=0.9)
    pyautogui.click(x, y)

    compare_images(transparent_restored_1, transparent_1, threshold=1)
    compare_images(transparent_restored_2, transparent_2, threshold=1)
Example #14
0
def run_tests(self):
    app.tap_menu_js()
    c.log('Validating timeline')
    c.click_item('testaut_menu_timeline')
    c._wait_for_id('timeline-ctrl')
    c.take_screenshot(None, 'view-after-timeline-draw.png')
Example #15
0
def run_tests(self):
    app.tap_menu_js()
    c.log ('Validating logs')
    c.click_item('testaut_menu_logs')
    sleep(2)
    c.take_screenshot(None, 'logs-app-ver.png')
Example #16
0
def run_tests(self):
    app.tap_menu_js()
    c.log ('Validating timeline')
    c.click_item('testaut_menu_timeline')
    c._wait_for_id('timeline-ctrl')
    c.take_screenshot(None, 'view-after-timeline-draw.png')