├── README.md ├── __init__.py ├── apk └── JinDi_0405_ali.apk ├── base ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ └── action.cpython-35.pyc └── action.py ├── data ├── __init__.py ├── config.ini └── environment_info.yaml ├── exception ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ └── exceptions.cpython-35.pyc └── exceptions.py ├── page ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── pages.cpython-35.pyc │ └── tools.cpython-35.pyc ├── pages.py ├── template │ └── pages ├── tools.py └── yaml │ ├── home_page.yaml │ ├── login_page.yaml │ └── view_pages.yaml ├── report ├── html │ ├── 1e07e63bbecccb93b06ffd6b43b46e4d.svg │ ├── 3fb9611bab3151e965e023162e86089a.svg │ ├── 61aae920ab2f8fe604ba57b135aa9919.png │ ├── 64b1e3c3d94863c86e92e89aea3a5c99.svg │ ├── 674f50d287a8c48dc19ba404d20fe713.eot │ ├── 912ec66d7572ff821749319396470bde.svg │ ├── af7ae505a9eed503f8b8e6982036873e.woff2 │ ├── app.js │ ├── b06871f281fee6b241d60582ae9369b9.ttf │ ├── data │ │ ├── 10ffcc1a426ef058-testcase.json │ │ ├── 17f12264d672126-testcase.json │ │ ├── 1a35b08bac21979c-testcase.json │ │ ├── 1dd27810a4bb8ae-testcase.json │ │ ├── 1f96faf2332d1ca6-testcase.json │ │ ├── 2b96226502b6a3ed-testcase.json │ │ ├── 32a4f4e2edc9cebb-testcase.json │ │ ├── 362ad7f1659efb26-testcase.json │ │ ├── 40e97668f9e6bf86-testcase.json │ │ ├── 42812a568525f205-testcase.json │ │ ├── 43d3019db534a513-testcase.json │ │ ├── 44a23e34f54ce0b2-testcase.json │ │ ├── 49188dea32fa0410-testcase.json │ │ ├── 4a69dddc288ac54e-testcase.json │ │ ├── 4d346be85ee26100-testcase.json │ │ ├── 5097fbde62b9d005-testcase.json │ │ ├── 52ead96d99f4ce42-testcase.json │ │ ├── 55f7af815569dbca-testcase.json │ │ ├── 5b9a793c1960be30-testcase.json │ │ ├── 5e7a77fa2bc26126-testcase.json │ │ ├── 6d0c28e7e7b2d066-testcase.json │ │ ├── 705cf9efbc60400a-testcase.json │ │ ├── 76f0bd0085d224d2-testcase.json │ │ ├── 78113748ea66b62-testcase.json │ │ ├── 8e256c44177f8b7b-testcase.json │ │ ├── 9169c65b1cebb592-testcase.json │ │ ├── 96f65d2e274609da-testcase.json │ │ ├── a9b7f4b2bcb2438d-testcase.json │ │ ├── a9c71b2f89e4a140-testcase.json │ │ ├── b0eb0948572e822e-testcase.json │ │ ├── b9b00f22ef1e2bbe-testcase.json │ │ ├── behaviors.json │ │ ├── cfbdf122bf09d1ed-testcase.json │ │ ├── da59c5b23baadf5b-testcase.json │ │ ├── defects.json │ │ ├── e63ad3a26d77dfe2-testcase.json │ │ ├── edb6afe50956d2d2-testcase.json │ │ ├── environment.json │ │ ├── fccad72fcb9e887d-testcase.json │ │ ├── fd888a915d3acf29-testcase.json │ │ ├── graph.json │ │ ├── plugins.json │ │ ├── report.json │ │ ├── timeline.json │ │ ├── total.json │ │ ├── widgets.json │ │ └── xunit.json │ ├── f8ddfbfcb1a4e191ee1fa7f98417280e.svg │ ├── fa4b5e31eae6378a0dfa9e10cfb9262f.svg │ ├── favicon.ico │ ├── fee66e712a8a08eef5805a46892932ad.woff │ ├── index.html │ └── styles.css └── xml │ └── 13948fa7-e111-4e81-892a-fc6cfab3bfb5-testsuite.xml ├── run.py ├── s.py ├── sDoc.txt ├── test ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── conftest.cpython-35-PYTEST.pyc │ ├── steps.cpython-35.pyc │ └── test_home.cpython-35-PYTEST.pyc ├── conftest.py ├── steps.py └── test_home.py ├── utils ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── config.cpython-35.pyc │ ├── environment.cpython-35.pyc │ ├── log.cpython-35.pyc │ ├── shell.cpython-35.pyc │ └── tools.cpython-35.pyc ├── config.py ├── environment.py ├── log.py ├── shell.py └── tools.py └── watch_dog.py /README.md: -------------------------------------------------------------------------------- 1 | # appium_test 2 | appium+python+allure+Jenkins的自动化测试框架 3 | 4 | ## [1.Appium环境搭建](https://github.com/hanhan1/appium_test/issues/1) 5 | ## [2.Python测试框架pytest](https://github.com/hanhan1/appium_test/issues/2) 6 | ## [3.Allure测试报告与Jenkins集成](https://github.com/hanhan1/appium_test/issues/3) 7 | ## [4.Appium-test项目详解](https://github.com/hanhan1/appium_test/issues/4) 8 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/__init__.py -------------------------------------------------------------------------------- /apk/JinDi_0405_ali.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/apk/JinDi_0405_ali.apk -------------------------------------------------------------------------------- /base/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from appium import webdriver 4 | -------------------------------------------------------------------------------- /base/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/base/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /base/__pycache__/action.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/base/__pycache__/action.cpython-35.pyc -------------------------------------------------------------------------------- /data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/data/__init__.py -------------------------------------------------------------------------------- /data/config.ini: -------------------------------------------------------------------------------- 1 | [name] 2 | apk=JinDi_0405_ali.apk 3 | app_activity = com.grandale.uo.LaunchActivity 4 | app_package = com.grandale.uo 5 | 6 | [account] 7 | account_success = 15815568727 8 | password_success = 12345678 9 | -------------------------------------------------------------------------------- /data/environment_info.yaml: -------------------------------------------------------------------------------- 1 | !EnvironmentInfo 2 | apk: D:\pycharm\appium-test/apk/JinDi_0405_ali.apk 3 | app_activity: com.grandale.uo.LaunchActivity 4 | app_package: com.grandale.uo 5 | appium: 1.4.16 6 | devices: 7 | - !DeviceInfo 8 | device_name: 192.168.169.102:5555 9 | platform_name: Android 10 | platform_version: '6.0' 11 | html_report: D:\pycharm\appium-test/report/html 12 | pages_yaml: D:\pycharm\appium-test/page/yaml 13 | xml_report: D:\pycharm\appium-test/report/xml 14 | -------------------------------------------------------------------------------- /exception/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Mio4kon' -------------------------------------------------------------------------------- /exception/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/exception/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /exception/__pycache__/exceptions.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/exception/__pycache__/exceptions.cpython-35.pyc -------------------------------------------------------------------------------- /exception/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | 4 | 5 | class NotFoundElementError(Exception): 6 | pass 7 | 8 | 9 | class NotFoundTextError(Exception): 10 | pass 11 | -------------------------------------------------------------------------------- /page/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Mio4kon' -------------------------------------------------------------------------------- /page/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/page/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /page/__pycache__/pages.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/page/__pycache__/pages.cpython-35.pyc -------------------------------------------------------------------------------- /page/__pycache__/tools.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/page/__pycache__/tools.cpython-35.pyc -------------------------------------------------------------------------------- /page/pages.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from page import tools 4 | 5 | pages = tools.parse() 6 | 7 | 8 | def get_locater(clazz_name, method_name): 9 | locators = pages[clazz_name]['locators'] 10 | for locator in locators: 11 | if locator['name'] == method_name: 12 | return locator 13 | 14 | 15 | class HomePage: 16 | 登录入口 = get_locater('HomePage', '登录入口') 17 | 取消升级 = get_locater('HomePage','取消升级') 18 | 确认升级 = get_locater('HomePage','确认升级') 19 | 我的 = get_locater('HomePage','我的') 20 | 21 | class LoginPage: 22 | 账户 = get_locater('LoginPage', '账户') 23 | 密码 = get_locater('LoginPage', '密码') 24 | 登录 = get_locater('LoginPage', '登录') 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /page/template/pages: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from page import tools 4 | 5 | pages = tools.parse() 6 | 7 | 8 | def get_locater(clazz_name, method_name): 9 | locators = pages[clazz_name]['locators'] 10 | for locator in locators: 11 | if locator['name'] == method_name: 12 | return locator 13 | 14 | {% for page, locators in page_list.items() %} 15 | class {{page}}:{% for locator in locators %} 16 | {{locator}} = get_locater('{{page}}', '{{locator}}'){% endfor %} 17 | 18 | {% endfor %} 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /page/tools.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from utils import L 4 | import yaml 5 | import jinja2 6 | from utils.environment import Environment 7 | import os 8 | import os.path 9 | from utils.config import Config 10 | 11 | pages_path = Environment().get_environment_info().pages_yaml 12 | 13 | 14 | def parse(): 15 | L.i('解析yaml, Path:' + pages_path) 16 | pages = {} 17 | for root, dirs, files in os.walk(pages_path): 18 | for name in files: 19 | watch_file_path = os.path.join(root, name) 20 | with open(watch_file_path, 'r', encoding='utf-8') as f: 21 | page = yaml.safe_load(f) 22 | pages.update(page) 23 | return pages 24 | 25 | 26 | class GenPages: 27 | @staticmethod 28 | def gen_page_list(): 29 | """ 30 | 将page.yaml转换成下面dict: 31 | return: {'HomePage': ['登录入口'], 'LoginPage': ['账户', '密码', '登录']} 32 | """ 33 | _page_list = {} 34 | pages = parse() 35 | for page, value in pages.items(): 36 | locators = value['locators'] 37 | locator_names = [] 38 | for locator in locators: 39 | locator_names.append(locator['name']) 40 | _page_list[page] = locator_names 41 | return _page_list 42 | 43 | @staticmethod 44 | def gen_page_py(): 45 | """ 46 | 利用jinja2生成pages.py文件 47 | """ 48 | base_dir = Config.BASE_PATH_DIR 49 | template_loader = jinja2.FileSystemLoader(searchpath=base_dir + "/page/template") 50 | template_env = jinja2.Environment(loader=template_loader) 51 | page_list = GenPages.gen_page_list() 52 | print(page_list) 53 | _templateVars = { 54 | 'page_list': page_list 55 | } 56 | template = template_env.get_template("pages") 57 | with open(base_dir + '/page/pages.py', 'w', encoding='utf-8') as f: 58 | f.write(template.render(_templateVars)) 59 | 60 | 61 | if __name__ == '__main__': 62 | GenPages.gen_page_py() 63 | -------------------------------------------------------------------------------- /page/yaml/home_page.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | HomePage: 3 | dec: 主界面 4 | locators: 5 | - 6 | name: 登录入口 7 | type: id 8 | value: com.grandale.uo:id/btn_my 9 | - 10 | name: 取消升级 11 | type: id 12 | value: com.grandale.uo:id/btn_ok 13 | - 14 | name: 确认升级 15 | type: id 16 | value: com.grandale.uo:id/btn_cancel 17 | - 18 | name: 我的 19 | type: class 20 | value: android.widget.Button 21 | -------------------------------------------------------------------------------- /page/yaml/login_page.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | LoginPage: 3 | dec: 登录页面 4 | locators: 5 | - 6 | name: 账户 7 | type: id 8 | value: com.grandale.uo:id/edt_login_mobile_no 9 | - 10 | name: 密码 11 | type: id 12 | value: com.grandale.uo:id/edt_login_password 13 | - 14 | name: 登录 15 | type: id 16 | value: com.grandale.uo:id/btn_register 17 | -------------------------------------------------------------------------------- /page/yaml/view_pages.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | View_pages: 3 | dec: 广告页 4 | locators: 5 | - 6 | name: 滑动广告页 7 | type: id 8 | value: com.grandale.uo:id/btn_my -------------------------------------------------------------------------------- /report/html/1e07e63bbecccb93b06ffd6b43b46e4d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /report/html/3fb9611bab3151e965e023162e86089a.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /report/html/61aae920ab2f8fe604ba57b135aa9919.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/report/html/61aae920ab2f8fe604ba57b135aa9919.png -------------------------------------------------------------------------------- /report/html/64b1e3c3d94863c86e92e89aea3a5c99.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /report/html/674f50d287a8c48dc19ba404d20fe713.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/report/html/674f50d287a8c48dc19ba404d20fe713.eot -------------------------------------------------------------------------------- /report/html/af7ae505a9eed503f8b8e6982036873e.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/report/html/af7ae505a9eed503f8b8e6982036873e.woff2 -------------------------------------------------------------------------------- /report/html/b06871f281fee6b241d60582ae9369b9.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/report/html/b06871f281fee6b241d60582ae9369b9.ttf -------------------------------------------------------------------------------- /report/html/data/10ffcc1a426ef058-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "10ffcc1a426ef058", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492746842831, 7 | "stop" : 1492746873457, 8 | "duration" : 30626 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "AssertionError: assert False\n + where False = >('登陆成功')\n + where > = ._find_text_in_page", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n action.click(HomePage.登录入口)\n action.text(LoginPage.账户, account[0])\n action.text(LoginPage.密码, account[1])\n action.sleep(1)\n action.click(LoginPage.登录)\n action.sleep(3)\n> assert action._find_text_in_page(\"登陆成功\")\nE AssertionError: assert False\nE + where False = >('登陆成功')\nE + where > = ._find_text_in_page\n\ntest\\test_home.py:21: AssertionError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "69c3e4b19db299b2", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492746847378, 31 | "stop" : 1492746847380, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "16820-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/17f12264d672126-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "17f12264d672126", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492737760547, 7 | "stop" : 1492737791389, 8 | "duration" : 30842 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"627f8dff-bb22-4715-a302-cab240d7296e\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "21a9a302cd917522", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492737782424, 31 | "stop" : 1492737782434, 32 | "duration" : 10 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "10368-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/1a35b08bac21979c-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "1a35b08bac21979c", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492738496058, 7 | "stop" : 1492738514189, 8 | "duration" : 18131 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"4dfb58be-5b40-468f-945b-691387729ef7\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "abe6ebcde491bca3", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492738506993, 31 | "stop" : 1492738506995, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "8708-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/1dd27810a4bb8ae-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "1dd27810a4bb8ae", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492747027899, 7 | "stop" : 1492747158178, 8 | "duration" : 130279 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "AssertionError: assert False\n + where False = >('登陆成功', 100)\n + where > = .is_toast_show", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n action.click(HomePage.登录入口)\n action.text(LoginPage.账户, account[0])\n action.text(LoginPage.密码, account[1])\n action.sleep(1)\n action.click(LoginPage.登录)\n action.sleep(3)\n> assert action._find_text_in_page(\"\")\nE AssertionError: assert False\nE + where False = >('登陆成功', 100)\nE + where > = .is_toast_show\n\ntest\\test_home.py:21: AssertionError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "54ce5e71421409c8", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492747032523, 31 | "stop" : 1492747032525, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "8136-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/1f96faf2332d1ca6-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "1f96faf2332d1ca6", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492743115410, 7 | "stop" : 1492743123525, 8 | "duration" : 8115 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "TypeError: argument of type 'bool' is not iterable", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n # action.click(HomePage.登录入口)\n # action.click(HomePage.我的)\n # action._find_text_in_page(\"我的\")\n> action.click(action._find_text_in_page(\"我的\"))\n\ntest\\test_home.py:18: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:87: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = , locator = True\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n> if 'timeOutInSeconds' in locator:\nE TypeError: argument of type 'bool' is not iterable\n\nbase\\action.py:255: TypeError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "21531e60065ab34b", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492743120237, 31 | "stop" : 1492743120238, 32 | "duration" : 1 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "4080-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/2b96226502b6a3ed-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "2b96226502b6a3ed", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492741672830, 7 | "stop" : 1492741731009, 8 | "duration" : 58179 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:262: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x000001FF015FFD08>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n action.test_SwipeGuideImages()\n> action.click(HomePage.登录入口)\n\ntest\\test_home.py:15: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:86: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:269: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "76cf8df705583aa", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492741680502, 31 | "stop" : 1492741680504, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "9832-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/32a4f4e2edc9cebb-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "32a4f4e2edc9cebb", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492676907040, 7 | "stop" : 1492676926936, 8 | "duration" : 19896 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '对话框取消键', 'timeOutInSeconds': 5, 'type': 'id', 'value': 'android:id/button2'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:260: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x00000206C320BA60>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.swip_left(3)\n> action.dialog_cancel(5)\n\ntest\\test_home.py:14: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:54: in dialog_cancel\n self.click(locator)\nbase\\action.py:84: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '对话框取消键', 'timeOutInSeconds': 5, 'type': 'id', 'value': 'android:id/button2'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:267: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "288d253efa317068", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492676913327, 31 | "stop" : 1492676913329, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "30324-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/40e97668f9e6bf86-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "40e97668f9e6bf86", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492678819461, 7 | "stop" : 1492678829089, 8 | "duration" : 9628 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"d192b65a-f96a-4219-8af3-af7f808c4bdd\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "4666c3b9f2f2698a", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492678825825, 31 | "stop" : 1492678825827, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "30876-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/42812a568525f205-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "42812a568525f205", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492678189334, 7 | "stop" : 1492678197060, 8 | "duration" : 7726 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"a6d5ff30-75ef-4271-8d99-9fa4b407c1e9\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "802f60b5e1b40aa2", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492678195805, 31 | "stop" : 1492678195807, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "thread", 47 | "value" : "30756-MainThread" 48 | }, { 49 | "name" : "host", 50 | "value" : "DESKTOP-33SMPDQ" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/43d3019db534a513-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "43d3019db534a513", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492677760001, 7 | "stop" : 1492677863651, 8 | "duration" : 103650 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "AssertionError: assert False\n + where False = >('登陆成功')\n + where > = .is_toast_show", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.swip_left(3)\n action.click(HomePage.取消升级)\n action.click(HomePage.登录入口)\n action.text(LoginPage.账户, account[0])\n action.text(LoginPage.密码, account[1])\n action.sleep(1)\n action.click(LoginPage.登录)\n> assert action.is_toast_show('登陆成功')\nE AssertionError: assert False\nE + where False = >('登陆成功')\nE + where > = .is_toast_show\n\ntest\\test_home.py:20: AssertionError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "BROKEN", 21 | "suite" : { 22 | "uid" : "659aa98b4a66c563", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492677766665, 31 | "stop" : 1492677766668, 32 | "duration" : 3 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "27204-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/44a23e34f54ce0b2-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "44a23e34f54ce0b2", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492678277674, 7 | "stop" : 1492678317000, 8 | "duration" : 39326 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"538f647d-8074-4ef4-a263-285c65dae0db\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "9396cc6e409af890", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492678307979, 31 | "stop" : 1492678307984, 32 | "duration" : 5 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "31672-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/49188dea32fa0410-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "49188dea32fa0410", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492738820764, 7 | "stop" : 1492738835033, 8 | "duration" : 14269 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"8085701d-d04d-46c0-adfd-279751ef951c\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "8d7b125b17f06812", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492738828619, 31 | "stop" : 1492738828621, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "9272-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/4a69dddc288ac54e-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "4a69dddc288ac54e", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492744801065, 7 | "stop" : 1492744809035, 8 | "duration" : 7970 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "AttributeError: 'str' object has no attribute 'click'", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n # action.click(HomePage.登录入口)\n # action.click(HomePage.我的)\n # action._find_text_in_page(\"我的\")\n> action.clickByTextName(\"我的\")\n\ntest\\test_home.py:18: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = , test = '我的'\nclick_first = True\n\n def clickByTextName(self,test, click_first=True):\n \"\"\"基础的点击事件\n \n Args:\n locator:定位器\n count: 点击次数\n \"\"\"\n if click_first:\n> self._text_in_page(test).click()\nE AttributeError: 'str' object has no attribute 'click'\n\nbase\\action.py:107: AttributeError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "754f5ccc105b27ca", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492744805808, 31 | "stop" : 1492744805810, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "thread", 47 | "value" : "16616-MainThread" 48 | }, { 49 | "name" : "host", 50 | "value" : "DESKTOP-33SMPDQ" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/4d346be85ee26100-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "4d346be85ee26100", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492678150441, 7 | "stop" : 1492678158039, 8 | "duration" : 7598 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"1b84980f-411f-44d6-8592-9ea0e7a39666\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "d30c961feb2686cf", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492678156877, 31 | "stop" : 1492678156882, 32 | "duration" : 5 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "thread", 47 | "value" : "29340-MainThread" 48 | }, { 49 | "name" : "host", 50 | "value" : "DESKTOP-33SMPDQ" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/5097fbde62b9d005-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "5097fbde62b9d005", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492747488900, 7 | "stop" : 1492747519583, 8 | "duration" : 30683 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : null, 15 | "description" : null, 16 | "severity" : "NORMAL", 17 | "status" : "PASSED", 18 | "suite" : { 19 | "uid" : "fe03d07c46e45bf0", 20 | "name" : "test.test_home", 21 | "title" : "Test home" 22 | }, 23 | "steps" : [ { 24 | "name" : "获取账号和密码", 25 | "title" : "获取账号和密码", 26 | "time" : { 27 | "start" : 1492747493530, 28 | "stop" : 1492747493532, 29 | "duration" : 2 30 | }, 31 | "summary" : { 32 | "attachments" : 0, 33 | "steps" : 0 34 | }, 35 | "status" : "PASSED", 36 | "attachments" : [ ], 37 | "steps" : [ ] 38 | } ], 39 | "attachments" : [ ], 40 | "issues" : [ ], 41 | "testIds" : [ ], 42 | "labels" : [ { 43 | "name" : "host", 44 | "value" : "DESKTOP-33SMPDQ" 45 | }, { 46 | "name" : "suite-title", 47 | "value" : null 48 | }, { 49 | "name" : "suite-name", 50 | "value" : "test.test_home" 51 | }, { 52 | "name" : "severity", 53 | "value" : "normal" 54 | }, { 55 | "name" : "thread", 56 | "value" : "10184-MainThread" 57 | } ], 58 | "parameters" : [ ] 59 | } -------------------------------------------------------------------------------- /report/html/data/52ead96d99f4ce42-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "52ead96d99f4ce42", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492677242760, 7 | "stop" : 1492677250127, 8 | "duration" : 7367 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:75: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"a0b89c15-00fe-4ff0-a151-005a2005db5b\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "7f9535e1b17e3acc", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492677248816, 31 | "stop" : 1492677248819, 32 | "duration" : 3 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "30432-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/55f7af815569dbca-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "55f7af815569dbca", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492674417159, 7 | "stop" : 1492674454483, 8 | "duration" : 37324 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(1)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"eef14bd2-9c15-4399-82c1-455e85c32d41\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "e5a765979d4b69fa", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492674451630, 31 | "stop" : 1492674451631, 32 | "duration" : 1 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "26712-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/5b9a793c1960be30-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "5b9a793c1960be30", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492681311661, 7 | "stop" : 1492681328098, 8 | "duration" : 16437 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"036c2f57-5576-41ca-862b-494c3953434f\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "cb6c372dfc45abb9", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492681325327, 31 | "stop" : 1492681325328, 32 | "duration" : 1 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "thread", 47 | "value" : "34676-MainThread" 48 | }, { 49 | "name" : "host", 50 | "value" : "DESKTOP-33SMPDQ" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/5e7a77fa2bc26126-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "5e7a77fa2bc26126", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492675828614, 7 | "stop" : 1492675859250, 8 | "duration" : 30636 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:257: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x0000016F72F52E18>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.click(HomePage.登录入口)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:81: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:264: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "e890dae290ba230b", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492675838769, 31 | "stop" : 1492675838774, 32 | "duration" : 5 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "27652-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/705cf9efbc60400a-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "705cf9efbc60400a", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492676690329, 7 | "stop" : 1492676706048, 8 | "duration" : 15719 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"43dca0ef-c7a3-4eca-8923-a3900547e3a7\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "7babf01303e1c041", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492676697287, 31 | "stop" : 1492676697290, 32 | "duration" : 3 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "thread", 47 | "value" : "26700-MainThread" 48 | }, { 49 | "name" : "host", 50 | "value" : "DESKTOP-33SMPDQ" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/76f0bd0085d224d2-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "76f0bd0085d224d2", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492673750063, 7 | "stop" : 1492673812167, 8 | "duration" : 62104 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:257: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x0000028423E2B2F0>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.click(HomePage.登录入口)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:81: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:264: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "7d01245808bf0c61", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492673791670, 31 | "stop" : 1492673791672, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "23780-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/78113748ea66b62-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "78113748ea66b62", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492745607170, 7 | "stop" : 1492745615270, 8 | "duration" : 8100 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = , locator = '我的'\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:287: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x000002458260DC80>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n> value = method(self._driver)\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:71: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\ndriver = \n\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:287: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\ndriver = \nlocator = '我的', element = True\n\n @staticmethod\n def _get_element_by_type(driver, locator, element=True):\n \"\"\"通过locator定位元素(默认定位单个元素)\n \n Args:\n driver:driver\n locator:定位器\n element:\n true:查找单个元素\n false:查找多个元素\n \n Returns:单个元素 或 元素list\n \n \"\"\"\n> value = locator['value']\nE TypeError: string indices must be integers\n\nbase\\action.py:332: TypeError\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n # action.click(HomePage.登录入口)\n # action.click(HomePage.我的)\n # action._find_text_in_page(\"我的\")\n> action.clickByTextName(\"我的\")\n\ntest\\test_home.py:18: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:108: in clickByTextName\n self.click(test)\nbase\\action.py:87: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = , locator = '我的'\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:294: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "c19796292c51893d", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492745612023, 31 | "stop" : 1492745612025, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "13940-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/8e256c44177f8b7b-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "8e256c44177f8b7b", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492675714569, 7 | "stop" : 1492675770520, 8 | "duration" : 55951 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:257: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x0000021A8367F2F0>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.click(HomePage.登录入口)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:81: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:264: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "3a7a7690237e0ecf", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492675750017, 31 | "stop" : 1492675750019, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "thread", 47 | "value" : "27872-MainThread" 48 | }, { 49 | "name" : "host", 50 | "value" : "DESKTOP-33SMPDQ" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/96f65d2e274609da-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "96f65d2e274609da", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492746762133, 7 | "stop" : 1492746792866, 8 | "duration" : 30733 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '账户', 'type': 'id', 'value': 'com.grandale.uo:id/edt_login_mobile_no'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:287: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x000001E80C150D08>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n action.click(HomePage.登录入口)\n> action.text(LoginPage.账户, account[0])\n\ntest\\test_home.py:16: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:142: in text\n self._find_element(locator).click()\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '账户', 'type': 'id', 'value': 'com.grandale.uo:id/edt_login_mobile_no'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:294: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "86ba043a123fb7ae", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492746766706, 31 | "stop" : 1492746766708, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "1072-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/a9b7f4b2bcb2438d-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "a9b7f4b2bcb2438d", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492746445501, 7 | "stop" : 1492746493394, 8 | "duration" : 47893 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "AssertionError: assert False\n + where False = >('登陆成功')\n + where > = .is_toast_show", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n action.click(HomePage.登录入口)\n action.text(LoginPage.账户, account[0])\n action.text(LoginPage.密码, account[1])\n action.sleep(1)\n action.click(LoginPage.登录)\n> assert action.is_toast_show('登陆成功')\nE AssertionError: assert False\nE + where False = >('登陆成功')\nE + where > = .is_toast_show\n\ntest\\test_home.py:20: AssertionError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "6daffd3911f6425d", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492746450335, 31 | "stop" : 1492746450337, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "thread", 53 | "value" : "436-MainThread" 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/a9c71b2f89e4a140-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "a9c71b2f89e4a140", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492679565898, 7 | "stop" : 1492679597398, 8 | "duration" : 31500 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "WebDriverException: Message: An unknown server-side error occurred while processing the command.\n", 16 | "stackTrace" : "self = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.swip_left(3)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:72: in swip_left\n self.driver.swipe(self.width * 9 / 10, self.height / 2, self.width / 10, self.height / 2, 1500)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\webdriver.py:264: in swipe\n action.perform()\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\common\\touch_action.py:94: in perform\n self._driver.execute(Command.TOUCH_ACTION, params)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py:249: in execute\n self.error_handler.check_response(response)\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:29: in check_response\n raise wde\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\appium\\webdriver\\errorhandler.py:24: in check_response\n super(MobileErrorHandler, self).check_response(response)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nresponse = {'status': 500, 'value': '{\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"The swipe did not complete successfully\"},\"sessionId\":\"301d1f87-4c02-4682-b0dc-d644d5757d9e\"}'}\n\n def check_response(self, response):\n \"\"\"\n Checks that a JSON response from the WebDriver does not have an error.\n \n :Args:\n - response - The JSON response from the WebDriver server as a dictionary\n object.\n \n :Raises: If the response contains an error message.\n \"\"\"\n status = response.get('status', None)\n if status is None or status == ErrorCode.SUCCESS:\n return\n value = None\n message = response.get(\"message\", \"\")\n screen = response.get(\"screen\", \"\")\n stacktrace = None\n if isinstance(status, int):\n value_json = response.get('value', None)\n if value_json and isinstance(value_json, basestring):\n import json\n try:\n value = json.loads(value_json)\n if len(value.keys()) == 1:\n value = value['value']\n status = value.get('error', None)\n if status is None:\n status = value[\"status\"]\n message = value[\"value\"]\n if not isinstance(message, basestring):\n value = message\n try:\n message = message['message']\n except TypeError:\n message = None\n else:\n message = value.get('message', None)\n except ValueError:\n pass\n \n exception_class = ErrorInResponseException\n if status in ErrorCode.NO_SUCH_ELEMENT:\n exception_class = NoSuchElementException\n elif status in ErrorCode.NO_SUCH_FRAME:\n exception_class = NoSuchFrameException\n elif status in ErrorCode.NO_SUCH_WINDOW:\n exception_class = NoSuchWindowException\n elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\n exception_class = StaleElementReferenceException\n elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\n exception_class = ElementNotVisibleException\n elif status in ErrorCode.INVALID_ELEMENT_STATE:\n exception_class = InvalidElementStateException\n elif status in ErrorCode.INVALID_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR \\\n or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\n exception_class = InvalidSelectorException\n elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\n exception_class = ElementNotSelectableException\n elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\n exception_class = WebDriverException\n elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\n exception_class = WebDriverException\n elif status in ErrorCode.TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.SCRIPT_TIMEOUT:\n exception_class = TimeoutException\n elif status in ErrorCode.UNKNOWN_ERROR:\n exception_class = WebDriverException\n elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\n exception_class = UnexpectedAlertPresentException\n elif status in ErrorCode.NO_ALERT_OPEN:\n exception_class = NoAlertPresentException\n elif status in ErrorCode.IME_NOT_AVAILABLE:\n exception_class = ImeNotAvailableException\n elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\n exception_class = ImeActivationFailedException\n elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\n exception_class = MoveTargetOutOfBoundsException\n else:\n exception_class = WebDriverException\n if value == '' or value is None:\n value = response['value']\n if isinstance(value, basestring):\n if exception_class == ErrorInResponseException:\n raise exception_class(response, value)\n raise exception_class(value)\n if message == \"\" and 'message' in value:\n message = value['message']\n \n screen = None\n if 'screen' in value:\n screen = value['screen']\n \n stacktrace = None\n if 'stackTrace' in value and value['stackTrace']:\n stacktrace = []\n try:\n for frame in value['stackTrace']:\n line = self._value_or_default(frame, 'lineNumber', '')\n file = self._value_or_default(frame, 'fileName', '')\n if line:\n file = \"%s:%s\" % (file, line)\n meth = self._value_or_default(frame, 'methodName', '')\n if 'className' in frame:\n meth = \"%s.%s\" % (frame['className'], meth)\n msg = \" at %s (%s)\"\n msg = msg % (meth, file)\n stacktrace.append(msg)\n except TypeError:\n pass\n if exception_class == ErrorInResponseException:\n raise exception_class(response, message)\n elif exception_class == UnexpectedAlertPresentException and 'alert' in value:\n raise exception_class(message, screen, stacktrace, value['alert'].get('text'))\n> raise exception_class(message, screen, stacktrace)\nE selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command.\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py:193: WebDriverException" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "bb78e8253fa60845", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492679596163, 31 | "stop" : 1492679596166, 32 | "duration" : 3 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "29860-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/b9b00f22ef1e2bbe-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "b9b00f22ef1e2bbe", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492742185883, 7 | "stop" : 1492742214014, 8 | "duration" : 28131 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:263: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x00000201D8765378>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n action.sleep(3)\n # action.test_SwipeGuideImages()\n> action.click(HomePage.登录入口)\n\ntest\\test_home.py:15: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:87: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:270: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "7bfaec6df150a8e5", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492742190584, 31 | "stop" : 1492742190586, 32 | "duration" : 2 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "thread", 50 | "value" : "9480-MainThread" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/behaviors.json: -------------------------------------------------------------------------------- 1 | { 2 | "features" : [ { 3 | "title" : "Without feature", 4 | "statistic" : { 5 | "total" : 1, 6 | "passed" : 1, 7 | "pending" : 0, 8 | "canceled" : 0, 9 | "failed" : 0, 10 | "broken" : 0 11 | }, 12 | "stories" : [ { 13 | "uid" : "51b8a64ec61327a0", 14 | "title" : "Without story", 15 | "statistic" : { 16 | "total" : 1, 17 | "passed" : 1, 18 | "pending" : 0, 19 | "canceled" : 0, 20 | "failed" : 0, 21 | "broken" : 0 22 | }, 23 | "testCases" : [ { 24 | "uid" : "5097fbde62b9d005", 25 | "name" : "TestLogin.test_login", 26 | "title" : "Test login", 27 | "time" : { 28 | "start" : 1492747488900, 29 | "stop" : 1492747519583, 30 | "duration" : 30683 31 | }, 32 | "severity" : "NORMAL", 33 | "status" : "PASSED" 34 | } ] 35 | } ] 36 | } ] 37 | } -------------------------------------------------------------------------------- /report/html/data/cfbdf122bf09d1ed-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "cfbdf122bf09d1ed", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492676331620, 7 | "stop" : 1492676358488, 8 | "duration" : 26868 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:257: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x000001B6EA252E18>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.click(HomePage.登录入口)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:81: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:264: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "459ddeae13ae2fc0", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492676338378, 31 | "stop" : 1492676338381, 32 | "duration" : 3 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "host", 47 | "value" : "DESKTOP-33SMPDQ" 48 | }, { 49 | "name" : "suite-title", 50 | "value" : null 51 | }, { 52 | "name" : "suite-name", 53 | "value" : "test.test_home" 54 | }, { 55 | "name" : "severity", 56 | "value" : "normal" 57 | }, { 58 | "name" : "thread", 59 | "value" : "29288-MainThread" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/defects.json: -------------------------------------------------------------------------------- 1 | { 2 | "defectsList" : [ { 3 | "title" : "Product defects", 4 | "status" : "FAILED", 5 | "defects" : [ ] 6 | }, { 7 | "title" : "Test defects", 8 | "status" : "BROKEN", 9 | "defects" : [ ] 10 | } ] 11 | } -------------------------------------------------------------------------------- /report/html/data/environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "5f9e8f4f-12bc-4ad2-8813-5c87fccc0b2a", 3 | "name" : "Allure Test Pack", 4 | "url" : null, 5 | "parameter" : [ ] 6 | } -------------------------------------------------------------------------------- /report/html/data/fd888a915d3acf29-testcase.json: -------------------------------------------------------------------------------- 1 | { 2 | "uid" : "fd888a915d3acf29", 3 | "name" : "TestLogin.test_login", 4 | "title" : "Test login", 5 | "time" : { 6 | "start" : 1492676372403, 7 | "stop" : 1492676399956, 8 | "duration" : 27553 9 | }, 10 | "summary" : { 11 | "attachments" : 0, 12 | "steps" : 1 13 | }, 14 | "failure" : { 15 | "message" : "NotFoundElementError: ", 16 | "stackTrace" : "self = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n> lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n\nbase\\action.py:257: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nmethod = . at 0x0000020124242E18>\nmessage = ''\n\n def until(self, method, message=''):\n \"\"\"Calls the method provided with the driver as an argument until the \\\n return value is not False.\"\"\"\n screen = None\n stacktrace = None\n \n end_time = time.time() + self._timeout\n while True:\n try:\n value = method(self._driver)\n if value:\n return value\n except self._ignored_exceptions as exc:\n screen = getattr(exc, 'screen', None)\n stacktrace = getattr(exc, 'stacktrace', None)\n time.sleep(self._poll)\n if time.time() > end_time:\n break\n> raise TimeoutException(message, screen, stacktrace)\nE selenium.common.exceptions.TimeoutException: Message:\n\nC:\\Users\\hyh\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\selenium\\webdriver\\support\\wait.py:80: TimeoutException\n\nDuring handling of the above exception, another exception occurred:\n\nself = \naction = \n\n def test_login(self, action: ElementActions):\n L.d('test_login')\n account = Steps.get_account()\n> action.click(HomePage.登录入口)\n\ntest\\test_home.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nbase\\action.py:81: in click\n el = self._find_element(locator)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = \nlocator = {'name': '登录入口', 'type': 'id', 'value': 'com.grandale.uo:id/btn_my'}\nis_need_displayed = True\n\n def _find_element(self, locator, is_need_displayed=True):\n \"\"\"查找单个元素,如果有多个返回第一个\n \n Args:\n locator: 定位器\n is_need_displayed: 是否需要定位的元素必须展示\n \n Returns: 元素\n \n Raises: NotFoundElementError\n 未找到元素会抛 NotFoundElementError 异常\n \n \"\"\"\n if 'timeOutInSeconds' in locator:\n wait = locator['timeOutInSeconds']\n else:\n wait = 20\n \n try:\n if is_need_displayed:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator).is_displayed())\n else:\n WebDriverWait(self.driver, wait).until(\n lambda driver: self._get_element_by_type(driver, locator) is not None)\n return self._get_element_by_type(self.driver, locator)\n except Exception as e:\n L.e(\"[element] 页面中未能找到 %s 元素\" % locator)\n> raise NotFoundElementError\nE exception.exceptions.NotFoundElementError\n\nbase\\action.py:264: NotFoundElementError" 17 | }, 18 | "description" : null, 19 | "severity" : "NORMAL", 20 | "status" : "FAILED", 21 | "suite" : { 22 | "uid" : "44b3ce4e6c104afc", 23 | "name" : "test.test_home", 24 | "title" : "Test home" 25 | }, 26 | "steps" : [ { 27 | "name" : "获取账号和密码", 28 | "title" : "获取账号和密码", 29 | "time" : { 30 | "start" : 1492676379324, 31 | "stop" : 1492676379327, 32 | "duration" : 3 33 | }, 34 | "summary" : { 35 | "attachments" : 0, 36 | "steps" : 0 37 | }, 38 | "status" : "PASSED", 39 | "attachments" : [ ], 40 | "steps" : [ ] 41 | } ], 42 | "attachments" : [ ], 43 | "issues" : [ ], 44 | "testIds" : [ ], 45 | "labels" : [ { 46 | "name" : "thread", 47 | "value" : "29156-MainThread" 48 | }, { 49 | "name" : "host", 50 | "value" : "DESKTOP-33SMPDQ" 51 | }, { 52 | "name" : "suite-title", 53 | "value" : null 54 | }, { 55 | "name" : "suite-name", 56 | "value" : "test.test_home" 57 | }, { 58 | "name" : "severity", 59 | "value" : "normal" 60 | } ], 61 | "parameters" : [ ] 62 | } -------------------------------------------------------------------------------- /report/html/data/graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "testCases" : [ { 3 | "uid" : "5097fbde62b9d005", 4 | "name" : "TestLogin.test_login", 5 | "title" : "Test login", 6 | "time" : { 7 | "start" : 1492747488900, 8 | "stop" : 1492747519583, 9 | "duration" : 30683 10 | }, 11 | "severity" : "NORMAL", 12 | "status" : "PASSED" 13 | } ] 14 | } -------------------------------------------------------------------------------- /report/html/data/plugins.json: -------------------------------------------------------------------------------- 1 | [ "total", "defects", "xunit", "behaviors", "graph", "timeline", "environment" ] -------------------------------------------------------------------------------- /report/html/data/report.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "Allure Test Pack", 3 | "id" : "5f9e8f4f-12bc-4ad2-8813-5c87fccc0b2a", 4 | "url" : null, 5 | "size" : 5490, 6 | "time" : 1070 7 | } -------------------------------------------------------------------------------- /report/html/data/timeline.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosts" : [ { 3 | "title" : "DESKTOP-33SMPDQ", 4 | "threads" : [ { 5 | "title" : "10184-MainThread", 6 | "testCases" : [ { 7 | "uid" : "5097fbde62b9d005", 8 | "name" : "TestLogin.test_login", 9 | "title" : "Test login", 10 | "time" : { 11 | "start" : 1492747488900, 12 | "stop" : 1492747519583, 13 | "duration" : 30683 14 | }, 15 | "severity" : "NORMAL", 16 | "status" : "PASSED" 17 | } ] 18 | } ] 19 | } ] 20 | } -------------------------------------------------------------------------------- /report/html/data/total.json: -------------------------------------------------------------------------------- 1 | { 2 | "statistic" : { 3 | "total" : 1, 4 | "passed" : 1, 5 | "pending" : 0, 6 | "canceled" : 0, 7 | "failed" : 0, 8 | "broken" : 0 9 | }, 10 | "time" : { 11 | "start" : 1492747488900, 12 | "stop" : 1492747519583, 13 | "duration" : 30683 14 | } 15 | } -------------------------------------------------------------------------------- /report/html/data/widgets.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash" : "e7105c43ada45c9f6e0006854ef1a1d95249231d", 3 | "plugins" : { 4 | "total" : { 5 | "statistic" : { 6 | "total" : 1, 7 | "passed" : 1, 8 | "pending" : 0, 9 | "canceled" : 0, 10 | "failed" : 0, 11 | "broken" : 0 12 | }, 13 | "time" : { 14 | "start" : 1492747488900, 15 | "stop" : 1492747519583, 16 | "duration" : 30683 17 | } 18 | }, 19 | "defects" : { 20 | "totalCount" : 0, 21 | "items" : [ ] 22 | }, 23 | "xunit" : { 24 | "totalCount" : 1, 25 | "items" : [ { 26 | "uid" : "fe03d07c46e45bf0", 27 | "title" : "Test home", 28 | "statistic" : { 29 | "total" : 1, 30 | "passed" : 1, 31 | "pending" : 0, 32 | "canceled" : 0, 33 | "failed" : 0, 34 | "broken" : 0 35 | } 36 | } ] 37 | }, 38 | "behaviors" : { 39 | "totalCount" : 1, 40 | "items" : [ { 41 | "title" : "Without feature", 42 | "statistic" : { 43 | "total" : 1, 44 | "passed" : 1, 45 | "pending" : 0, 46 | "canceled" : 0, 47 | "failed" : 0, 48 | "broken" : 0 49 | } 50 | } ] 51 | }, 52 | "environment" : [ ] 53 | } 54 | } -------------------------------------------------------------------------------- /report/html/data/xunit.json: -------------------------------------------------------------------------------- 1 | { 2 | "time" : { 3 | "start" : 1492747488900, 4 | "stop" : 1492747519583, 5 | "duration" : 30683 6 | }, 7 | "testSuites" : [ { 8 | "uid" : "fe03d07c46e45bf0", 9 | "name" : "test.test_home", 10 | "title" : "Test home", 11 | "time" : { 12 | "start" : 1492747488900, 13 | "stop" : 1492747519583, 14 | "duration" : 30683 15 | }, 16 | "statistic" : { 17 | "total" : 1, 18 | "passed" : 1, 19 | "pending" : 0, 20 | "canceled" : 0, 21 | "failed" : 0, 22 | "broken" : 0 23 | }, 24 | "description" : null, 25 | "testCases" : [ { 26 | "uid" : "5097fbde62b9d005", 27 | "name" : "TestLogin.test_login", 28 | "title" : "Test login", 29 | "time" : { 30 | "start" : 1492747488900, 31 | "stop" : 1492747519583, 32 | "duration" : 30683 33 | }, 34 | "severity" : "NORMAL", 35 | "status" : "PASSED" 36 | } ] 37 | } ] 38 | } -------------------------------------------------------------------------------- /report/html/f8ddfbfcb1a4e191ee1fa7f98417280e.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /report/html/fa4b5e31eae6378a0dfa9e10cfb9262f.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /report/html/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/report/html/favicon.ico -------------------------------------------------------------------------------- /report/html/fee66e712a8a08eef5805a46892932ad.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/report/html/fee66e712a8a08eef5805a46892932ad.woff -------------------------------------------------------------------------------- /report/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Allure 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /report/xml/13948fa7-e111-4e81-892a-fc6cfab3bfb5-testsuite.xml: -------------------------------------------------------------------------------- 1 | 2 | test.test_home 3 | 4 | 5 | 6 | TestLogin.test_login 7 | 8 | 9 | 13 | 14 | 15 | 获取账号和密码 16 | 获取账号和密码 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | import pytest 6 | from utils.environment import Environment 7 | from utils.shell import Shell 8 | from utils import L 9 | 10 | if __name__ == '__main__': 11 | env = Environment() 12 | xml_report_path = env.get_environment_info().xml_report 13 | html_report_path = env.get_environment_info().html_report 14 | # 开始测试 15 | args = ['-s', '-q', '--alluredir', xml_report_path] 16 | pytest.main(args) 17 | # 生成html测试报告 18 | cmd = 'allure generate %s -o %s' % (xml_report_path, html_report_path) 19 | try: 20 | Shell.invoke(cmd) 21 | except: 22 | L.e("Html测试报告生成失败,确保已经安装了Allure-Commandline") 23 | -------------------------------------------------------------------------------- /s.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | 4 | 5 | from appium import webdriver 6 | from base.action import ElementActions 7 | from utils.environment import Environment 8 | 9 | env = Environment().get_environment_info() 10 | capabilities = {'platformName': env.devices[0].platform_name, 11 | 'platformVersion': env.devices[0].platform_version, 12 | 'deviceName': env.devices[0].device_name, 13 | 'app': env.apk, 14 | 'clearSystemFiles': True, 15 | 'appActivity': env.app_activity, 16 | 'appPackage': env.app_package, 17 | 'automationName': 'UIAutomator2', 18 | 'noSign': True, 19 | 'newCommandTimeout': 60 * 100} 20 | host = "http://localhost:4723/wd/hub" 21 | driver = webdriver.Remote(host, capabilities) 22 | action = ElementActions(driver) 23 | -------------------------------------------------------------------------------- /sDoc.txt: -------------------------------------------------------------------------------- 1 | 直接shell中粘贴下面,方便自己实时调试,比如想测试xpath 2 | 3 | import s 4 | action = s.action 5 | driver = s.driver 6 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Mio4kon' -------------------------------------------------------------------------------- /test/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/test/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /test/__pycache__/conftest.cpython-35-PYTEST.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/test/__pycache__/conftest.cpython-35-PYTEST.pyc -------------------------------------------------------------------------------- /test/__pycache__/steps.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/test/__pycache__/steps.cpython-35.pyc -------------------------------------------------------------------------------- /test/__pycache__/test_home.cpython-35-PYTEST.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/test/__pycache__/test_home.cpython-35-PYTEST.pyc -------------------------------------------------------------------------------- /test/conftest.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pytest 4 | from appium import webdriver 5 | from base.action import ElementActions 6 | from utils.environment import Environment 7 | 8 | 9 | @pytest.fixture() 10 | def action(): 11 | env = Environment().get_environment_info() 12 | capabilities = {'platformName': env.devices[0].platform_name, 13 | 'platformVersion': env.devices[0].platform_version, 14 | 'deviceName': env.devices[0].device_name, 15 | 'app': env.apk, 16 | 'clearSystemFiles': True, 17 | 'appActivity': env.app_activity, 18 | 'appPackage': env.app_package, 19 | 'automationName': 'UIAutomator2', 20 | 'noSign': True 21 | } 22 | host = "http://localhost:4723/wd/hub" 23 | driver = webdriver.Remote(host, capabilities) 24 | yield ElementActions(driver).reset(driver) 25 | driver.quit() 26 | 27 | 28 | @pytest.fixture(scope="module") 29 | def action2(): 30 | env = Environment().get_environment_info() 31 | capabilities = {'platformName': env.devices[0].platform_name, 32 | 'platformVersion': env.devices[0].platform_version, 33 | 'deviceName': env.devices[0].device_name, 34 | 'app': env.apk, 35 | 'clearSystemFiles': True, 36 | 'appActivity': env.app_activity, 37 | 'appPackage': env.app_package, 38 | 'automationName': 'UIAutomator2', 39 | 'noSign': True 40 | } 41 | host = "http://localhost:4723/wd/hub" 42 | driver = webdriver.Remote(host, capabilities) 43 | yield ElementActions(driver).reset(driver) 44 | driver.quit() 45 | -------------------------------------------------------------------------------- /test/steps.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import allure 4 | 5 | from utils import L 6 | from utils.environment import Environment 7 | 8 | 9 | class Steps: 10 | @staticmethod 11 | @allure.step(title="获取账号和密码") 12 | def get_account(): 13 | 14 | account = Environment().get_inited_config().account_success 15 | pwd = Environment().get_inited_config().password_success 16 | L.d('账号:%s 密码 %s' % (account, pwd)) 17 | return [account, pwd] 18 | -------------------------------------------------------------------------------- /test/test_home.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from base.action import ElementActions 4 | from page.pages import * 5 | from test.steps import Steps 6 | from utils import L 7 | import allure 8 | import pytest 9 | class TestLogin: 10 | @allure.step(title="登陆") 11 | @pytest.allure.severity(pytest.allure.severity_level.MINOR) 12 | @allure.feature('Feature1') 13 | @allure.story('Story1') 14 | def test_login(self, action: ElementActions): 15 | L.d('test_login') 16 | allure.attach('描述','这是一个登陆的case') 17 | account = Steps.get_account() 18 | action.sleep(3) 19 | # action.test_SwipeGuideImages() 20 | action.click(HomePage.登录入口) 21 | action.text(LoginPage.账户, account[0]) 22 | action.text(LoginPage.密码, account[1]) 23 | action.sleep(1) 24 | action.click(LoginPage.登录) 25 | action.sleep(3) 26 | assert action._find_text_in_page("我的") 27 | -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | __author__ = 'Mio4kon' 4 | from .log import Log as L -------------------------------------------------------------------------------- /utils/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/utils/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /utils/__pycache__/config.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/utils/__pycache__/config.cpython-35.pyc -------------------------------------------------------------------------------- /utils/__pycache__/environment.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/utils/__pycache__/environment.cpython-35.pyc -------------------------------------------------------------------------------- /utils/__pycache__/log.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/utils/__pycache__/log.cpython-35.pyc -------------------------------------------------------------------------------- /utils/__pycache__/shell.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/utils/__pycache__/shell.cpython-35.pyc -------------------------------------------------------------------------------- /utils/__pycache__/tools.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanhan1/appium_test/8da675473be9d6ae37cb416ef977049ebc2b7c71/utils/__pycache__/tools.cpython-35.pyc -------------------------------------------------------------------------------- /utils/config.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Mio4kon' 3 | from configparser import ConfigParser 4 | import os 5 | from utils import L 6 | 7 | 8 | def singleton(class_): 9 | instances = {} 10 | 11 | def getinstance(*args, **kwargs): 12 | if class_ not in instances: 13 | instances[class_] = class_(*args, **kwargs) 14 | return instances[class_] 15 | 16 | return getinstance 17 | 18 | 19 | class Config: 20 | DEFAULT_CONFIG_DIR = str(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, "data/config.ini"))) 21 | BASE_PATH_DIR = str(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))) 22 | 23 | # titles: 24 | TITLE_NAME = "name" 25 | TITLE_ACCOUNT = "account" 26 | # values: 27 | # [name] 28 | VALUE_APP = "apk" 29 | VALUE_APP_ACTIVITY = "app_activity" 30 | VALUE_APP_PACKAGE = "app_package" 31 | # [account] 32 | VALUE_ACCOUNT_SUCCESS = "account_success" 33 | VALUE_PASSWORD_SUCCESS = "password_success" 34 | 35 | def __init__(self): 36 | self.path = Config.DEFAULT_CONFIG_DIR 37 | self.cp = ConfigParser() 38 | self.cp.read(self.path) 39 | L.i('初始化config...config path: ' + self.path) 40 | apk_name = self.get_config(Config.TITLE_NAME, Config.VALUE_APP) 41 | self.apk_path = Config.BASE_PATH_DIR + '/apk/' + apk_name 42 | self.xml_report_path = Config.BASE_PATH_DIR + '/report/xml' 43 | self.html_report_path = Config.BASE_PATH_DIR + '/report/html' 44 | self.pages_yaml_path = Config.BASE_PATH_DIR + '/page/yaml' 45 | self.env_yaml_path = Config.BASE_PATH_DIR + '/data/environment_info.yaml' 46 | self.app_activity = self.get_config(Config.TITLE_NAME, Config.VALUE_APP_ACTIVITY) 47 | self.app_package = self.get_config(Config.TITLE_NAME, Config.VALUE_APP_PACKAGE) 48 | self.account_success = self.get_config(Config.TITLE_ACCOUNT, Config.VALUE_ACCOUNT_SUCCESS) 49 | self.password_success = self.get_config(Config.TITLE_ACCOUNT, Config.VALUE_PASSWORD_SUCCESS) 50 | 51 | def set_config(self, title, value, text): 52 | self.cp.set(title, value, text) 53 | with open(self.path, "w+") as f: 54 | return self.cp.write(f) 55 | 56 | def add_config(self, title): 57 | self.cp.add_section(title) 58 | with open(self.path, "w+") as f: 59 | return self.cp.write(f) 60 | 61 | def get_config(self, title, value): 62 | return self.cp.get(title, value) 63 | 64 | -------------------------------------------------------------------------------- /utils/environment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Mio4kon' 3 | from utils.config import Config 4 | from utils import L 5 | from utils.tools import Device 6 | from utils.shell import Shell 7 | from utils.shell import ADB 8 | import yaml 9 | 10 | 11 | class EnvironmentInfo(yaml.YAMLObject): 12 | yaml_loader = yaml.SafeLoader 13 | yaml_tag = u'!EnvironmentInfo' 14 | 15 | def __init__(self, appium, devices, apk, pages_yaml, xml_report, html_report, app_activity, app_package): 16 | self.appium = appium 17 | self.pages_yaml = pages_yaml 18 | self.xml_report = xml_report 19 | self.html_report = html_report 20 | self.apk = apk 21 | self.devices = devices 22 | self.app_activity = app_activity 23 | self.app_package = app_package 24 | 25 | 26 | class DeviceInfo(yaml.YAMLObject): 27 | yaml_loader = yaml.SafeLoader 28 | yaml_tag = u'!DeviceInfo' 29 | 30 | def __init__(self, device_name, platform_name, platform_version): 31 | self.device_name = device_name 32 | self.platform_name = platform_name 33 | self.platform_version = platform_version 34 | 35 | 36 | def singleton(class_): 37 | instances = {} 38 | 39 | def getinstance(*args, **kwargs): 40 | if class_ not in instances: 41 | instances[class_] = class_(*args, **kwargs) 42 | return instances[class_] 43 | 44 | return getinstance 45 | 46 | 47 | @singleton 48 | class Environment: 49 | def __init__(self): 50 | self.devices = Device.get_android_devices() 51 | self.appium_v = Shell.invoke('appium -v').splitlines()[0].strip() 52 | self.config = Config() 53 | self.check_environment() 54 | self.save_environment() 55 | 56 | def check_environment(self): 57 | L.i('检查环境...') 58 | # 检查appium版本 59 | if '1.4' not in self.appium_v: 60 | L.e('appium 版本有问题') 61 | exit() 62 | else: 63 | L.i('appium version {}'.format(self.appium_v)) 64 | # 检查设备 65 | if not self.devices: 66 | L.e('没有设备连接') 67 | exit() 68 | else: 69 | L.i('已连接设备:', self.devices) 70 | 71 | def save_environment(self): 72 | infos = [] 73 | env_path = self.config.env_yaml_path 74 | apk_path = self.config.apk_path 75 | pages_yaml_path = self.config.pages_yaml_path 76 | xml_report_path = self.config.xml_report_path 77 | html_report_path = self.config.html_report_path 78 | app_activity = self.config.app_activity 79 | app_package = self.config.app_package 80 | for deviceName in self.devices: 81 | info = DeviceInfo(deviceName, "Android", ADB(deviceName).get_android_version()) 82 | infos.append(info) 83 | env_info = EnvironmentInfo(self.appium_v, infos, apk_path, pages_yaml_path, xml_report_path, html_report_path, 84 | app_activity, app_package) 85 | with open(env_path, 'w') as f: 86 | yaml.dump(env_info, f, default_flow_style=False) 87 | L.i('保存环境配置 Path:' + env_path) 88 | 89 | def get_environment_info(self) -> EnvironmentInfo: 90 | env_path = self.config.env_yaml_path 91 | with open(env_path, 'r') as f: 92 | env_info = yaml.safe_load(f) 93 | return env_info 94 | 95 | def get_inited_config(self): 96 | return self.config 97 | 98 | 99 | if __name__ == '__main__': 100 | env = Environment() 101 | # 检查运行环境 102 | env.check_environment() 103 | # 将环境存在本地 104 | env.save_environment() 105 | info = env.get_environment_info() 106 | print(info.app_package) 107 | -------------------------------------------------------------------------------- /utils/log.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __author__ = 'Mio4kon' 3 | import time 4 | 5 | 6 | class Log: 7 | @staticmethod 8 | def e(msg, list_msg=[]): 9 | if list_msg: 10 | Log.show_list(msg, list_msg, Log.e) 11 | else: 12 | ColorLog.show_error(get_now_time() + " [Error]:" + "".join(msg)) 13 | 14 | @staticmethod 15 | def w(msg, list_msg=[]): 16 | if list_msg: 17 | Log.show_list(msg, list_msg, Log.w) 18 | else: 19 | ColorLog.show_warn(get_now_time() + " [Warn]:" + "".join(msg)) 20 | 21 | @staticmethod 22 | def i(msg, list_msg=[]): 23 | if list_msg: 24 | Log.show_list(msg, list_msg, Log.i) 25 | else: 26 | ColorLog.show_info(get_now_time() + " [Info]:" + "".join(msg)) 27 | 28 | @staticmethod 29 | def d(msg, list_msg=[]): 30 | if list_msg: 31 | Log.show_list(msg, list_msg, Log.d) 32 | else: 33 | ColorLog.show_debug(get_now_time() + " [Debug]:" + "".join(msg)) 34 | 35 | @staticmethod 36 | def show_list(msg, list_msg, f): 37 | temp = msg + "[ " + "\t".join(list_msg) + " ]" 38 | f(temp) 39 | 40 | 41 | 42 | class ColorLog: 43 | @staticmethod 44 | def c(msg, colour): 45 | try: 46 | from termcolor import colored, cprint 47 | p = lambda x: cprint(x, '%s' % colour) 48 | return p(msg) 49 | except: 50 | print(msg) 51 | 52 | @staticmethod 53 | def show_verbose(msg): 54 | ColorLog.c(msg, 'white') 55 | 56 | @staticmethod 57 | def show_debug(msg): 58 | ColorLog.c(msg, 'blue') 59 | 60 | @staticmethod 61 | def show_info(msg): 62 | ColorLog.c(msg, 'green') 63 | 64 | @staticmethod 65 | def show_warn(msg): 66 | ColorLog.c(msg, 'yellow') 67 | 68 | @staticmethod 69 | def show_error(msg): 70 | ColorLog.c(msg, 'red') 71 | 72 | 73 | def get_now_time(): 74 | return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) 75 | -------------------------------------------------------------------------------- /utils/shell.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import platform 4 | 5 | __author__ = 'Mio4kon' 6 | import subprocess 7 | 8 | 9 | class Shell: 10 | @staticmethod 11 | def invoke(cmd): 12 | # shell设为true,程序将通过shell来执行 13 | # stdin, stdout, stderr分别表示程序的标准输入、输出、错误句柄。 14 | # 他们可以是PIPE,文件描述符或文件对象,也可以设置为None,表示从父进程继承。 15 | # subprocess.PIPE实际上为文本流提供一个缓存区 16 | output, errors = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() 17 | o = output.decode("utf-8") 18 | return o 19 | 20 | 21 | # 判断是否设置环境变量ANDROID_HOME 22 | if "ANDROID_HOME" in os.environ: 23 | command = os.path.join( 24 | os.environ["ANDROID_HOME"], 25 | "platform-tools", 26 | "adb") 27 | else: 28 | raise EnvironmentError( 29 | "Adb not found in $ANDROID_HOME path: %s." % 30 | os.environ["ANDROID_HOME"]) 31 | 32 | 33 | class ADB(object): 34 | """ 35 | 参数: device_id 36 | """ 37 | 38 | def __init__(self, device_id=""): 39 | 40 | if device_id == "": 41 | self.device_id = "" 42 | else: 43 | self.device_id = "-s %s" % device_id 44 | 45 | def adb(self, args): 46 | cmd = "%s %s %s" % (command, self.device_id, str(args)) 47 | return Shell.invoke(cmd) 48 | 49 | def shell(self, args): 50 | cmd = "%s %s shell %s" % (command, self.device_id, str(args),) 51 | return Shell.invoke(cmd) 52 | 53 | def get_device_state(self): 54 | """ 55 | 获取设备状态: offline | bootloader | device 56 | """ 57 | return self.adb("get-state").stdout.read().strip() 58 | 59 | def get_device_id(self): 60 | """ 61 | 获取设备id号,return serialNo 62 | """ 63 | return self.adb("get-serialno").stdout.read().strip() 64 | 65 | def get_android_version(self): 66 | """ 67 | 获取设备中的Android版本号,如4.2.2 68 | """ 69 | return self.shell( 70 | "getprop ro.build.version.release").strip() 71 | 72 | def get_sdk_version(self): 73 | """ 74 | 获取设备SDK版本号 75 | """ 76 | return self.shell("getprop ro.build.version.sdk").strip() 77 | -------------------------------------------------------------------------------- /utils/tools.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from utils.shell import Shell 4 | from utils import L 5 | 6 | 7 | class Device: 8 | @staticmethod 9 | def get_android_devices(): 10 | android_devices_list = [] 11 | for device in Shell.invoke('adb devices').splitlines(): 12 | if 'device' in device and 'devices' not in device: 13 | device = device.split('\t')[0] 14 | android_devices_list.append(device) 15 | return android_devices_list 16 | 17 | 18 | if __name__ == '__main__': 19 | devices = Device.get_android_devices() 20 | L.i("devices: ", devices) 21 | -------------------------------------------------------------------------------- /watch_dog.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from watchdog.events import PatternMatchingEventHandler 4 | from watchdog.observers import Observer 5 | 6 | from page.tools import GenPages 7 | from utils import L 8 | from utils.environment import Environment 9 | 10 | 11 | def gen_page_py(): 12 | GenPages.gen_page_py() 13 | 14 | 15 | class WatchHandler(PatternMatchingEventHandler): 16 | patterns = ["*.yaml"] 17 | 18 | def on_created(self, event): 19 | L.i('监听到文件: yaml 发生了变化') 20 | try: 21 | gen_page_py() 22 | except Exception as e: 23 | L.e('\n!!!!!!!---pages.yaml---!!!!!!\n解析文件 pages.yaml 错误\n' 24 | '请到{}路径下检查修改后重新保存.'.format(self.watch_path)) 25 | 26 | 27 | if __name__ == "__main__": 28 | event_handler = WatchHandler() 29 | full_path = Environment().get_environment_info().pages_yaml 30 | print(full_path) 31 | observer = Observer() 32 | observer.schedule(event_handler, full_path) 33 | observer.start() 34 | try: 35 | while True: 36 | time.sleep(1) 37 | except KeyboardInterrupt: 38 | observer.stop() 39 | observer.join() --------------------------------------------------------------------------------