def preview_hello_world_js_ts(app_name,
                              platform,
                              device,
                              bundle=True,
                              hmr=True,
                              instrumented=False,
                              click_open_alert=False):
    result = Preview.run_app(app_name=app_name,
                             bundle=bundle,
                             hmr=hmr,
                             platform=platform,
                             device=device,
                             instrumented=instrumented,
                             click_open_alert=click_open_alert)

    # Verify app looks properly
    device.wait_for_text(text=Changes.JSHelloWord.JS.old_text,
                         timeout=60,
                         retry_delay=5)
    device.wait_for_text(text=Changes.JSHelloWord.XML.old_text, timeout=30)
    device.wait_for_main_color(color=Colors.WHITE)
    initial_state = os.path.join(Settings.TEST_OUT_IMAGES, device.name,
                                 'initial_state.png')
    device.get_screen(path=initial_state)
    return result
예제 #2
0
def __preview_vue(app_name, platform, device, bundle, hmr):
    # Execute `tns run` and wait until logs are OK
    return Preview.run_app(app_name=app_name,
                           bundle=bundle,
                           hmr=hmr,
                           platform=platform,
                           device=device,
                           click_open_alert=True)
예제 #3
0
def preview_hello_world_ng(app_name,
                           device,
                           bundle=False,
                           hmr=False,
                           instrumented=False,
                           click_open_alert=False):
    result = Preview.run_app(app_name=app_name,
                             bundle=bundle,
                             hmr=hmr,
                             device=device,
                             instrumented=instrumented,
                             click_open_alert=click_open_alert)

    # Verify app looks properly
    device.wait_for_text(text=Changes.NGHelloWorld.TS.old_text)
    device.wait_for_main_color(color=Colors.WHITE)
    initial_state = os.path.join(Settings.TEST_OUT_IMAGES, device.name,
                                 'initial_state.png')
    device.get_screen(path=initial_state)
    return result