コード例 #1
0
ファイル: storage_steps.py プロジェクト: zenghui0-0/tempfile
 def do(self):
     ui_steps.press_all_apps(serial=self.serial)()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the app",
                           blocking=True,
                           view_to_find={"text": "File Manager"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Home"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Download"})()
     self.uidevice(textContains=self.value).swipe.right(steps=100)
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Copy"})()
     ui_steps.press_home(serial=self.serial)()
     file_manager_usb(serial=self.serial)()
     if not self.uidevice(textContains=self.value).exists:
         ui_steps.click_button(
             serial=self.serial,
             print_error="Error - Could not find the button",
             blocking=True,
             view_to_find={"text": "Paste"})()
     else:
         print "The file already exists!"
コード例 #2
0
ファイル: storage_steps.py プロジェクト: zenghui0-0/tempfile
 def do(self):
     ui_steps.press_home(serial=self.serial)()
     ui_steps.press_all_apps(serial=self.serial)()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the app",
                           blocking=True,
                           view_to_find={"text": "Settings"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Storage"})()
     ui_utils.is_text_visible(serial=self.serial,
                              text_to_find="Mount USB storage")
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Mount USB storage"})()
     ui_steps.press_home(serial=self.serial)()
     file_manager_usb(serial=self.serial)()
コード例 #3
0
ファイル: storage_steps.py プロジェクト: zenghui0-0/tempfile
 def do(self):
     ui_steps.press_home()()
     ui_steps.press_all_apps()()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the app",
                           blocking=True,
                           view_to_find={"text": "File Manager"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Home"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Up"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Up"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "usbdisk2"})()
コード例 #4
0
ファイル: storage_steps.py プロジェクト: zenghui0-0/tempfile
 def do(self):
     ui_steps.press_home(serial=self.serial)()
     ui_steps.press_all_apps(serial=self.serial)()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the app",
                           blocking=True,
                           view_to_find={"text": "File Manager"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Home"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Download"})()
     self.uidevice(textContains=self.value).swipe.right(steps=100)
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "Delete"})()
     ui_steps.click_button(serial=self.serial,
                           print_error="Error - Could not find the button",
                           blocking=True,
                           view_to_find={"text": "OK"})()
コード例 #5
0
ファイル: 03_app_list.py プロジェクト: zenghui0-0/tempfile
#                   is displayed as expected
#               Will check if apps displayed on screen are sorted
#                   alphabetically.
# @author:      [email protected]
#
##############################################################################

from testlib.scripts.android.ui.interface import steps
from testlib.scripts.android.ui import ui_steps
from testlib.scripts.android.adb import adb_steps
from testlib.scripts.android.adb import adb_utils

from testlib.base.base_utils import get_args
import sys

globals().update(vars(get_args(sys.argv)))

adb_steps.connect_device(serial=serial, port=adb_server_port)()
globals().update({"version": adb_utils.get_android_version()})

ui_steps.press_home()()

ui_steps.press_all_apps(print_error="Error - The connection to the device "
                        "was not established",
                        blocking=True)()
steps.check_apps_are_sorted(print_error="Error - Apps are not sorted in "
                            "android all apps screen.",
                            version=version)()

ui_steps.press_home()()
コード例 #6
0
from testlib.base.base_utils import get_args

globals().update(vars(get_args(sys.argv)))

adb_steps.connect_device(serial=serial, port=adb_server_port)()
globals().update({"version": adb_utils.get_android_version()})

uidevice = ui_device()
app = uidevice(className='android.widget.FrameLayout')
x_coord = app.info['bounds']['right']
y_coord = app.info['bounds']['bottom']
ui_steps.press_home()()

for i in range(1, 4):
    ui_steps.press_all_apps()()
    ui_steps.press_back()()
    ui_steps.swipe(sx=x_coord - 500,
                   sy=y_coord / 2,
                   ex=x_coord,
                   ey=y_coord / 2)()
    time.sleep(1)

ui_steps.press_home()()

for i in range(1, 4):
    ui_steps.press_all_apps()()
    ui_steps.press_back()()
    ui_steps.swipe(sx=x_coord - 10,
                   sy=y_coord / 2,
                   ex=x_coord - 500,
コード例 #7
0
                   "com.facebook.katana-1.apk",]
"""
import sys
from testlib.base.base_utils import get_args

globals().update(vars(get_args(sys.argv)))

adb_steps.connect_device(
    serial = serial,
    port = adb_server_port,
)()
globals().update({"version": adb_utils.get_android_version()})

ui_steps.press_home()()

ui_steps.press_all_apps(print_error = "Error - failed to open all apps screen",
                        blocking = True)()

apk_folder = media_path
apps_to_install = apks
if apps_to_install:
    for app in apps_to_install:
        apk_path = os.path.join(apk_folder, app)
        adb_steps.install_apk(print_error = "Error - App was not installed",
                              blocking = False,
                              apk_path = apk_path,
                              debug = True)()

ui_steps.swipe(print_error = "Swipe error",
               sx = 300, sy = 400, ex = 100, ey = 400, steps = 10,
               blocking = True,
               view_to_check =  {"textContains": "YouTube"})()
コード例 #8
0
    args[key] = val

ap_name = args.get("ap_name")
ap_lists = [ap_name, "WIFI_ADB"]
uidevice = Device(serial=serial)
product_name = adb_utils.get_product_name(serial=serial)

# turn display on, if turned off
ui_steps.wake_up_device(serial=serial)()

# ensure the device is unlocked
ui_steps.unlock_device(serial=serial, pin=wifi_defaults.wifi['pin'])()

# go to settings app
if product_name != "bxtp_abl_car":
    ui_steps.press_all_apps(serial=serial)()
    ui_steps.click_button_with_scroll(serial=serial, view_to_find={"text": "Settings"}
                                ,view_to_check={"textContains": "Wi‑Fi"})()
else:
    ui_steps.press_home(serial=serial)()
    ui_steps.click_button_with_scroll(serial=serial, view_to_find={"resourceId": "com.android.car.overview:id/gear_button"}
                                , view_to_check={"textContains": "Wi‑Fi"})()
ui_steps.click_button_with_scroll(serial=serial, view_to_find={"text": "Wi‑Fi"}
                                ,view_to_check={"textContains": "Wi‑Fi"})()

# click switch On button,Switch wifi Off
if uidevice(text="On").exists:
    ui_steps.click_button_with_scroll(serial=serial, view_to_find={"text": "On"}
                        , view_to_check={"resourceId": "android:id/empty"})()

# click switch Off button,Switch wifi ON
コード例 #9
0
 def do(self):
     ui_steps.press_all_apps(print_error="Error - failed to open all apps "
                             "screen")()
コード例 #10
0
#!/usr/bin/env python

##############################################################################
#
# @filename:
# @description: ET/Star Peak/Script Library/L2/Interface/02-Installed
#               apps displayed
# @author:      [email protected]
#
##############################################################################

import sys
from testlib.scripts.android.ui import ui_steps
from testlib.scripts.android.adb import adb_steps
from testlib.scripts.android.adb import adb_utils

from testlib.base.base_utils import get_args

globals().update(vars(get_args(sys.argv)))

adb_steps.connect_device(serial=serial, port=adb_server_port)()
globals().update({"version": adb_utils.get_android_version()})

ui_steps.press_home()()

ui_steps.press_all_apps(print_error="Error - The connection to the "
                        "device was not established")()

ui_steps.press_home()()
コード例 #11
0
 def check_condition(self):
     ui_steps.press_all_apps(serial = self.serial)()
     return not ui_utils.is_text_visible_scroll_left(serial = self.serial,
                                                     text_to_find = self.app_name)
コード例 #12
0
try:
    # Install APK from the defined path
    #adb_steps.install_apk(serial = device, apk_path = ftp_server_apk, install_time=60)()

    # turn display on, if turned off
    ui_steps.wake_up_device(serial=device)()

    # ensure the device is unlocked
    ui_steps.unlock_device(serial=device, pin=wifi_defaults.wifi['pin'])()

    # go to home screen
    ui_steps.press_home(serial=device)()

    #Launch  menu
    ui_steps.press_all_apps(serial=device)()

    #Open FTP server app
    ui_steps.open_app_from_allapps(serial=device,
                                   view_to_find={"text": "Ftp server"})()
    time.sleep(3)

    ui_steps.click_button_common(serial=device,
                                 view_to_find={"text": "ALLOW"},
                                 optional=True)()

    #Start FTP server of the APP
    ui_steps.click_button(
        serial=device,
        view_to_find={
            "resourceId": "com.theolivetree.ftpserver:id/imageView1"