def _native_prepare(): # 本地环境准备,清楚数据,拉起游戏 device = manager.get_device() device._clear_qq_account() device._clear_user_info(local_package) device.launch_app(local_package) time.sleep(10) return True
def _native_prepare(): # clear qq/wechat/app data and launch the app device = manager.get_device() device._clear_qq_account() device._clear_user_info(local_package) device.launch_app(local_package) time.sleep(10) return True
def _cloud_prepare(): # 云端测试,只需要拉起游戏 reporter = manager.get_reporter() device = manager.get_device() logger = manager.get_logger() try: reporter.screenshot() res = device.launch_app() logger.debug(res) reporter.screenshot() time.sleep(10) return True except: stack = traceback.format_exc() logger.error(stack) logger.error("Launch app failure") return False
def _cloud_prepare(): # test in cloud, just launch the app reporter = manager.get_reporter() device = manager.get_device() logger = manager.get_logger() try: reporter.screenshot() res = device.launch_app() logger.debug(res) reporter.screenshot() time.sleep(10) return True except: stack = traceback.format_exc() logger.error(stack) logger.error("Launch app failure") return False
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://opensource.org/licenses/MIT Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ __author__ = 'minhuaxu [email protected]' import sys, os, time sys.path.append(os.path.abspath(os.path.join(os.getcwd(), ".."))) import wpyscripts.manager as manager engine = manager.get_engine() logger = manager.get_logger() device = manager.get_device() def test_get_display_size(): display_size = device.get_display_size() logger.debug(display_size) rotation = device.get_rotation() logger.debug("Rotation : {0}".format(rotation)) def test_get_top_package_activity(): top_activity = device.get_top_package_activity() logger.debug(top_activity)
http://opensource.org/licenses/MIT Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ __author__ = 'yifengcai' import time import wpyscripts.manager as manager import wpyscripts.uiautomator.uiautomator_manager as m uiauto = m.get_uiautomator() logger = manager.get_logger() device = manager.get_device() QQ_PACKAGE_NAME = "com.tencent.mobileqq" WX_PACKAGE_NAME = "com.tencent.mm" def check_qq_wx_package(): top_package = uiauto.info["currentPackageName"] logger.debug("top package is %s", top_package) if top_package == QQ_PACKAGE_NAME or top_package == WX_PACKAGE_NAME: return True else: return False