这个要怎么改🤔
原生的 app 吗
pydantic 回退到 1.8.2 就可以了
在官方文档中,参数化是这么写的, 实际中写 testcases 不会生效,能否留个联系方式,这里沟通不方便
config:
name: test suite demo
base_url: "https://postman-echo.com"
testcases:
-
name: test case 1
parameters:
username-password:
- [ "user1", "111111" ]
- [ "user2", "222222" ]
- [ "user3", "333333" ]
testcase: /path/to/testcase1
我现在考虑用哪个版本,你能给我一个建议吗
是有一个包问题,回退就解决了
谢谢大佬的提示,我不会调 logcat 日志
我加上了时间打印的日志,我找不出什么问题
2022-01-08 01:34:36:316 - [HTTP]
2022-01-08 01:34:36:324 - [HTTP] --> POST /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element
2022-01-08 01:34:36:324 - [HTTP] {"using":"-android uiautomator","value":"className(\"android.widget.TextView\").text(\"确定\")"}
2022-01-08 01:34:36:325 - [debug] [W3C (cfecf3f7)] Calling AppiumDriver.findElement() with args: ["-android uiautomator","className(\"android.widget.TextView\").text(\"确定\")","cfecf3f7-0532-42dc-9eb6-6369e4e4e02a"]
2022-01-08 01:34:36:325 - [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator
2022-01-08 01:34:36:325 - [debug] [BaseDriver] Waiting up to 0 ms for condition
2022-01-08 01:34:36:326 - [debug] [WD Proxy] Matched '/element' to command name 'findElement'
2022-01-08 01:34:36:326 - [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8201/wd/hub/session/74b2d304-3843-4dba-98c2-fc0f9438be52/element] with body: {"strategy":"-android uiautomator","selector":"className(\"android.widget.TextView\").text(\"确定\")","context":"","multiple":false}
2022-01-08 01:34:56:510 - [debug] [WD Proxy] Got response with status 200: {"sessionId":"74b2d304-3843-4dba-98c2-fc0f9438be52","value":{"ELEMENT":"00000000-0000-1371-ffff-ffff0000014f","element-6066-11e4-a52e-4f735466cecf":"00000000-0000-1371-ffff-ffff0000014f"}}
2022-01-08 01:34:56:511 - [debug] [W3C (cfecf3f7)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"00000000-0000-1371-ffff-ffff0000014f","ELEMENT":"00000000-0000-1371-ffff-ffff0000014f"}
2022-01-08 01:34:56:512 - [HTTP] <-- POST /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element 200 20188 ms - 137
2022-01-08 01:34:56:512 - [HTTP]
2022-01-08 01:34:56:518 - [HTTP] --> GET /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element/00000000-0000-1371-ffff-ffff0000014f/displayed
2022-01-08 01:34:56:518 - [HTTP] {}
2022-01-08 01:34:56:519 - [debug] [W3C (cfecf3f7)] Calling AppiumDriver.elementDisplayed() with args: ["00000000-0000-1371-ffff-ffff0000014f","cfecf3f7-0532-42dc-9eb6-6369e4e4e02a"]
2022-01-08 01:34:56:519 - [debug] [WD Proxy] Matched '/element/00000000-0000-1371-ffff-ffff0000014f/attribute/displayed' to command name 'getAttribute'
2022-01-08 01:34:56:519 - [debug] [WD Proxy] Proxying [GET /element/00000000-0000-1371-ffff-ffff0000014f/attribute/displayed] to [GET http://127.0.0.1:8201/wd/hub/session/74b2d304-3843-4dba-98c2-fc0f9438be52/element/00000000-0000-1371-ffff-ffff0000014f/attribute/displayed] with no body
2022-01-08 01:35:26:871 - [debug] [WD Proxy] Got response with status 200: {"sessionId":"74b2d304-3843-4dba-98c2-fc0f9438be52","value":"true"}
2022-01-08 01:35:26:872 - [debug] [W3C (cfecf3f7)] Responding to client with driver.elementDisplayed() result: true
2022-01-08 01:35:26:874 - [HTTP] <-- GET /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element/00000000-0000-1371-ffff-ffff0000014f/displayed 200 30356 ms - 14
2022-01-08 01:35:26:874 - [HTTP]
2022-01-08 01:35:26:878 - [HTTP] --> GET /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element/00000000-0000-1371-ffff-ffff0000014f/enabled
2022-01-08 01:35:26:878 - [HTTP] {}
2022-01-08 01:35:26:878 - [debug] [W3C (cfecf3f7)] Calling AppiumDriver.elementEnabled() with args: ["00000000-0000-1371-ffff-ffff0000014f","cfecf3f7-0532-42dc-9eb6-6369e4e4e02a"]
2022-01-08 01:35:26:879 - [debug] [WD Proxy] Matched '/element/00000000-0000-1371-ffff-ffff0000014f/attribute/enabled' to command name 'getAttribute'
2022-01-08 01:35:26:879 - [debug] [WD Proxy] Proxying [GET /element/00000000-0000-1371-ffff-ffff0000014f/attribute/enabled] to [GET http://127.0.0.1:8201/wd/hub/session/74b2d304-3843-4dba-98c2-fc0f9438be52/element/00000000-0000-1371-ffff-ffff0000014f/attribute/enabled] with no body
2022-01-08 01:35:46:924 - [debug] [WD Proxy] Got response with status 200: {"sessionId":"74b2d304-3843-4dba-98c2-fc0f9438be52","value":"true"}
2022-01-08 01:35:46:924 - [debug] [W3C (cfecf3f7)] Responding to client with driver.elementEnabled() result: true
2022-01-08 01:35:46:926 - [HTTP] <-- GET /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element/00000000-0000-1371-ffff-ffff0000014f/enabled 200 20048 ms - 14
2022-01-08 01:35:46:926 - [HTTP]
2022-01-08 01:35:46:930 - [HTTP] --> POST /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element/00000000-0000-1371-ffff-ffff0000014f/click
2022-01-08 01:35:46:930 - [HTTP] {"id":"00000000-0000-1371-ffff-ffff0000014f"}
2022-01-08 01:35:46:934 - [debug] [W3C (cfecf3f7)] Calling AppiumDriver.click() with args: ["00000000-0000-1371-ffff-ffff0000014f","cfecf3f7-0532-42dc-9eb6-6369e4e4e02a"]
2022-01-08 01:35:46:934 - [debug] [WD Proxy] Matched '/element/00000000-0000-1371-ffff-ffff0000014f/click' to command name 'click'
2022-01-08 01:35:46:934 - [debug] [WD Proxy] Proxying [POST /element/00000000-0000-1371-ffff-ffff0000014f/click] to [POST http://127.0.0.1:8201/wd/hub/session/74b2d304-3843-4dba-98c2-fc0f9438be52/element/00000000-0000-1371-ffff-ffff0000014f/click] with body: {"element":"00000000-0000-1371-ffff-ffff0000014f"}
2022-01-08 01:36:08:550 - [debug] [WD Proxy] Got response with status 200: {"sessionId":"74b2d304-3843-4dba-98c2-fc0f9438be52","value":null}
2022-01-08 01:36:08:551 - [debug] [W3C (cfecf3f7)] Responding to client with driver.click() result: null
2022-01-08 01:36:08:552 - [HTTP] <-- POST /wd/hub/session/cfecf3f7-0532-42dc-9eb6-6369e4e4e02a/element/00000000-0000-1371-ffff-ffff0000014f/click 200 21622 ms - 14
看截图,第二条用例断言应该是失败,密码是错误的, 但它执行成功了
我是按照官方的例子写的