From 4cfb0c3b4f3362c7f7decfa04effab167fba3a31 Mon Sep 17 00:00:00 2001 From: moyuer <443677948@qq.com> Date: Thu, 14 Apr 2022 15:41:21 +0800 Subject: [PATCH 1/9] docs: update docs --- README.md | 6 ++- docs/casedsl.md | 79 ++++++++++++++++++++++----------------- docs/casedsl_zhCN.md | 78 +++++++++++++++++++++----------------- docs/demoproject.md | 14 +++++-- docs/demoproject_zhCN.md | 14 +++++-- docs/flybirds_cli.md | 26 +++++++++++-- docs/flybirds_cli_zhCN.md | 25 +++++++++++-- docs/pageelement.md | 6 ++- docs/pageelement_zhCN.md | 6 ++- docs/readme_en.md | 6 ++- docs/relate.md | 28 +++++++++++++- docs/relate_zhCN.md | 35 ++++++++++++++++- 12 files changed, 231 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 02402135..1d80453a 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,14 @@ Flybirds是基于BDD模式的前端UI自动化测试框架,提供了一系列开箱即用的工具和完善的文档。 - 基于Behave,实现BDD中“自然语言测试用例文档”和“自动化测试代码”关联需要用到支持BDD工具。 -- 基于Airtest,实现BDD中“测试用例能在自动化测试平台上执行”需要用到UI自动化测试框架。 +- 基于Airtest,实现BDD中“测试用例能在自动化测试平台上执行”需要用到移动端UI自动化测试框架。 +- 基于Playwright, 实现BDD中“测试用例能在自动化测试平台上执行”需要用到Web端UI自动化测试框架。 ## 特性 使用Flybirds你能够完成大部分的手机端自动化操作,以下是一些帮助入门的特性描述: - 基于BDD模式,类自然语言语法 -- 支持自动化APP操作、表单提交、UI元素校验、键盘输入、Deeplink跳转等 +- 支持自动化Web、APP操作, 表单提交、UI元素校验、键盘输入、Deeplink跳转等 - 默认支持英文、中文两种语言,支持更多语言扩展 - 插件式设计,支持用户自定义自动化扩展 - 提供cli脚手架,快速搭建项目 @@ -103,5 +104,6 @@ flybirds create 感谢以下仓库让Flybirds变得更好: - [airtest](https://github.com/AirtestProject) - [behave](https://github.com/behave) +- [playwright](https://github.com/microsoft/playwright-python) - [multiple-cucumber-html-reporter](https://github.com/wswebcreation/multiple-cucumber-html-reporter) diff --git a/docs/casedsl.md b/docs/casedsl.md index ca4fb843..5c352113 100644 --- a/docs/casedsl.md +++ b/docs/casedsl.md @@ -7,41 +7,50 @@ The "[]" in the statement template needs to add a value, otherwise the statement ## Common statement template -| statement template | description | -| :---- | :---- | -| go to url[] | jump to the specified url address | -| wait [] seconds | Wait for a while | -| element [] appear after page rendering | check whether the specified element has been rendered when entering a new page | -| click[] | click on the element with the specified attribute | -| click text[] | Click on the element of the specified text | -| click position[][] | click to specify the location on the screen | -| input [] into [] | input a string in the specified selector | -| from [] find [] element | find the element with the specified attribute in the specified direction | -| slide to [] distance [] | swipe the specified distance in the specified direction on the full screen | -| [] slide to [] distance [] | slide the specified distance in the specified direction in the specified area | -| exist text [] | check that the specified string exists in the page| -| not exist text [] | check that the specified string does not exist in the page | -| exist element [] | check the presence of elements with specified attributes on the page | -| not exist element [] | check that there is no element with the specified attribute in the page | -| element [] disappear | check that the element with the specified attribute in the page disappears within the specified time | -| text [] property [] is [] | check that the specified attribute of the specified text in the page is the specified value | -| element [] property [] is [] | check that the specified attribute of the specified element in the page is the specified value | -| element [] position not change in []seconds | check that the position of the specified element on the page has not changed within the specified time | -| the text of element [] is [] | check that the text of the specified element in the page is equal to the specified value | -| the text of element [] include [] | check that the text of the specified element in the page contains the specified value | -| go to home page | go to home page | -| screenshot | save the current screen image | -| start record | start recording video | -| start recording timeout [] | start recording screen and set timeout | -| stop record | stop recording video | -| connect device [] | connect test device | -| install app[] | install app | -| delete app[] | delete app | -| start app[] | start app | -| retart app | retart app | -| logon account[] password [] | login with account and password | -| logout | logout | -| ----- | ----- | +| statement template | description | suitable for | +| ------------------------------------------- | ------------------------------------------------------------ | -------------- | +| go to url[] | jump to the specified url address | android 、web | +| wait [] seconds | Wait for a while | ALL | +| element [] appear after page rendering | check whether the specified element has been rendered when entering a new page | ALL | +| click[] | click on the element with the specified attribute | ALL | +| click text[] | Click on the element of the specified text | ALL | +| click position[][] | click to specify the location on the screen | ALL | +| input [] into [] | input a string in the specified selector | ALL | +| clear [] and input[] | clear and input a string in the specified selector | Web | +| from [] find [] element | find the element with the specified attribute in the specified direction | ALL | +| slide to [] distance [] | swipe the specified distance in the specified direction on the full screen | ALL | +| [] slide to [] distance [] | slide the specified distance in the specified direction in the specified area | ALL | +| exist text [] | check that the specified string exists in the page | ALL | +| not exist text [] | check that the specified string does not exist in the page | ALL | +| exist element [] | check the presence of elements with specified attributes on the page | ALL | +| not exist element [] | check that there is no element with the specified attribute in the page | ALL | +| element [] disappear | check that the element with the specified attribute in the page disappears within the specified time | App | +| text[]disappear | check that the specified string in the page disappears from the page within a specified time | App | +| text [] property [] is [] | check that the specified attribute of the specified text in the page is the specified value | ALL | +| element [] property [] is [] | check that the specified attribute of the specified element in the page is the specified value | ALL | +| element [] position not change in []seconds | check that the position of the specified element on the page has not changed within the specified time | App | +| the text of element [] is [] | check that the text of the specified element in the page is equal to the specified value | ALL | +| the text of element [] include [] | check that the text of the specified element in the page contains the specified value | ALL | +| go to home page | go to home page | ALL | +| screenshot | save the current screen image | ALL | +| start record | start recording video | App | +| start recording timeout [] | start recording screen and set timeout | App | +| stop record | stop recording video | ALL | +| connect device [] | connect test device | App | +| install app[] | install app | android | +| delete app[] | delete app | android | +| start app[] | start app | App | +| retart app | retart app | App | +| close app | close app | App | +| logon account[] password [] | login with account and password | ALL | +| logout | logout | ALL | +| return to previous page | return to previous page | Android 、 web | +| in[]from [] find [] element | Find the element of the specified selector by sliding in the specified direction within the element that refers to the selector | ALL | +| from [] select [] | Select the specified value in the web select element | web | +| exist [] subNode [] element | check that a parent element exists, and a child element exists under that parent element | web | +| the text of element [] subNode [] is [] | check that a parent element exists, and the text of a child element under that parent element is the specified string | web | +| ----- | ----- | ----- | + ## Statement template: diff --git a/docs/casedsl_zhCN.md b/docs/casedsl_zhCN.md index 4163829d..1e20c514 100644 --- a/docs/casedsl_zhCN.md +++ b/docs/casedsl_zhCN.md @@ -7,41 +7,49 @@ ## 以下是常用语句模板: -| 语句模板 | 语义 | -| :---- | :---- | -| 跳转到[] | 跳转到指定的url地址 | -| 等待[]秒 | 等待一段时间 | -| 页面渲染完成出现元素[] | 进入新的页面时检查指定元素是否渲染完成 | -| 点击[] | 点击指定属性的元素 | -| 点击文案[] | 点击指定文案的元素 | -| 点击屏幕位置[][] | 点击屏幕指定位置 | -| 在 [] 中输入[] | 在指定选择器中输入字符串 | -| 向[] 查找[]的元素 | 向指定方向查找指定属性的元素 | -| 全屏向[] 滑动[] | 全屏向指定方向滑动指定距离 | -| [] 向[] 滑动[] | 在指定区域内向指定方向滑动指定距离 | -| 存在[]的文案 | 检查页面中存在指定的字符串| -| 不存在[]的文案 | 检查页面中不存在指定的字符串 | -| 存在[]的元素 | 检查页面中存在指定属性的元素 | -| 不存在[]的元素 | 检查页面中不存在指定属性的元素 | -| 元素[]消失 | 检查页面中指定属性的元素在指定时间内消失 | -| 文案[] 的属性[] 为 [] | 检查页面中指定文案的指定属性为指定值 | -| 元素[] 的属性[] 为 [] | 检查页面中指定元素的指定属性为指定值 | -| 元素[] 位置[] 秒内未变动 | 检查页面中指定元素的位置在指定时间内未发生变化 | -| 元素[] 的文案为[] | 检查页面中指定元素的文案等于指定值 | -| 元素[] 的文案包含[] | 检查页面中指定元素的文案包含指定值 | -| 回到首页 | 回到首页 | -| 全屏截图 | 保存当前屏幕图像 | -| 开始录屏 | 开始录制视频 | -| 开始录屏超时[] | 开始录屏并设置超时时间 | -| 结束录屏 | 结束录制视频 | -| 连接设备[] | 连接测试设备 | -| 安装APP[] | 安装APP | -| 删除APP[] | 删除APP | -| 启动APP[] | 启动APP | -| 重启APP | 重启APP | -| 登录账号[] 密码[] | 使用账号密码进行登录 | -| 退出登录 | 退出系统登录 | -| ----- | ----- | +| 语句模板 | 语义 | 适用于 | +| -------------------------------- | ---------------------------------------------------------- | -------------- | +| 跳转到[] | 跳转到指定的url地址 | android 、web | +| 等待[]秒 | 等待一段时间 | ALL | +| 页面渲染完成出现元素[] | 进入新的页面时检查指定元素是否渲染完成 | ALL | +| 点击[] | 点击指定属性的元素 | ALL | +| 点击文案[] | 点击指定文案的元素 | ALL | +| 点击屏幕位置[][] | 点击屏幕指定位置 | ALL | +| 在 [] 中输入[] | 在指定选择器中输入字符串 | ALL | +| 在[]中清空并输入[] | 在指定选择器中清空并输入字符串 | Web | +| 向[] 查找[]的元素 | 向指定方向查找指定属性的元素 | ALL | +| 全屏向[] 滑动[] | 全屏向指定方向滑动指定距离 | ALL | +| [] 向[] 滑动[] | 在指定区域内向指定方向滑动指定距离 | ALL | +| 存在[]的文案 | 检查页面中存在指定的字符串 | ALL | +| 不存在[]的文案 | 检查页面中不存在指定的字符串 | ALL | +| 存在[]的元素 | 检查页面中存在指定属性的元素 | ALL | +| 不存在[]的元素 | 检查页面中不存在指定属性的元素 | ALL | +| 元素[]消失 | 检查页面中指定属性的元素在指定时间内消失 | App | +| 文案[]消失 | 检查页面中指定的字符串在规定时间内从页面消失 | App | +| 文案[] 的属性[] 为 [] | 检查页面中指定文案的指定属性为指定值 | ALL | +| 元素[] 的属性[] 为 [] | 检查页面中指定元素的指定属性为指定值 | ALL | +| 元素[] 位置[] 秒内未变动 | 检查页面中指定元素的位置在指定时间内未发生变化 | App | +| [] 的文案为[] | 检查页面中指定元素的文案等于指定值 | ALL | +| [] 的文案包含[] | 检查页面中指定元素的文案包含指定值 | ALL | +| 回到首页 | 回到首页 | ALL | +| 全屏截图 | 保存当前屏幕图像 | ALL | +| 开始录屏 | 开始录制视频 | App | +| 开始录屏超时[] | 开始录屏并设置超时时间 | App | +| 结束录屏 | 结束录制视频 | ALL | +| 连接设备[] | 连接测试设备 | App | +| 安装APP[] | 安装APP | android | +| 删除APP[] | 删除APP | android | +| 启动APP[] | 启动APP | App | +| 重启APP | 重启APP | App | +| 关闭App | 关闭App | App | +| 登录账号[] 密码[] | 使用账号密码进行登录 | ALL | +| 退出登录 | 退出系统登录 | ALL | +| 返回上一页 | 返回上一页面 | Android 、 web | +| 在[]中向[]查找[]的元素 | 在指定 选择器 的元素内 向指定方向滑动查找 指定选择器的元素 | ALL | +| 在[]中选择[] | 在web页面下拉框元素中选择指定值 | web | +| 存在[父选择器]的[子选择器]的元素 | 存在某个父元素,并且该父元素下存在某个子元素 | web | +| [父选择器]的[子选择器]的文案为[] | 存在某个父元素,并且该父元素下某个子元素的文案为指定字符串 | web | +| \----- | \----- | \----- | ## 语句模版: diff --git a/docs/demoproject.md b/docs/demoproject.md index af1773e4..e1650f81 100644 --- a/docs/demoproject.md +++ b/docs/demoproject.md @@ -7,7 +7,7 @@ - report:test report ## Config -Must config items:`deviceId`, `packageName`.When connecting to IOS devices, you must configure the `webDriverAgent` 、`platform`. +When testing on **mobile**, you must configure the items: `deviceId`、`packageName`. When testing on IOS devices, you must additionally configure `webDriverAgent`. **flybirds_config.json** @@ -41,12 +41,20 @@ Must config items:`deviceId`, `packageName`.When connecting to IOS devices, yo - `platform` - The system to be connected to the test device, currently supports `Android` and `IOS`, if not filled in, the default is: `Android` + Project case execution platform. currently supports `android`, `ios` and `web`, default is: `android` when not filled - `webDriverAgent` The BundleID of the WebDriverAgent in the device. Can be viewed through the `tidevice applist` command. Required when connecting to IOS device. - + +- `headless` + + The running mode of the browser, `true` means the browser will run in **headless** mode. Effective when `platform=web`. + +- `browserType` + + Supported browser types: `chromium`, `firefox` and `webkit`. Effective when `platform=web`. + - `beforeRunPage` Configure the behavior of the app before starting the test. By default, "restart the app" to ensure that the page is on the main homepage during the test, and startApp (start the app), stopApp (close the app), and None (no operation), default: "restartApp" diff --git a/docs/demoproject_zhCN.md b/docs/demoproject_zhCN.md index ba333c66..441f1de4 100644 --- a/docs/demoproject_zhCN.md +++ b/docs/demoproject_zhCN.md @@ -9,7 +9,7 @@ ## config目录 -必须配置项:`deviceId` `packageName`。连接IOS设备时,必须额外配置`webDriverAgent`、`platform`。 +进行**移动端**测试时,必须配置项:`deviceId` 、`packageName`。在IOS设备上测试时,必须额外配置`webDriverAgent`。 **flybirds_config.json** @@ -43,12 +43,20 @@ - `platform` - 待连接测试设备的系统,目前支持`Android` 和 `IOS`, 不填时默认为:`Android` + 项目case执行的平台,目前支持`android` 、`ios` 和 `web`, 不填时默认为:`android` - `webDriverAgent` 设备里WebDriverAgent的BundleID,可通过`tidevice applist`命令查看。连接IOS设备时必填。 - + +- `headless` + + 浏览器的运行模式,为 true 时表示浏览器将以**无头**方式运行。`platform=web`时生效。 + +- `browserType` + + 支持的浏览器类型: `chromium`, `firefox` and `webkit`。`platform=web`时生效。 + - `beforeRunPage` 在开始测试前对app的行为配置,默认时“重启app”保证测试时页面处于大首页,还有startApp(启动app),stopApp(关闭app)、None(无任何操作), 默认:"restartApp" diff --git a/docs/flybirds_cli.md b/docs/flybirds_cli.md index 69f0b41b..4658217d 100644 --- a/docs/flybirds_cli.md +++ b/docs/flybirds_cli.md @@ -49,7 +49,7 @@ You can specify one of the following **CLI commands**: - `run`: Run the project. - + #### **Options** @@ -65,7 +65,7 @@ flybirds run --help ​ For example: ```bash -flybirds run -P ./features/test/demo.feature +flybirds run --path ./features/test/demo.feature ``` - **--tag, -T TEXT(Optional)** @@ -106,7 +106,7 @@ flybirds run --report report\curent\report.json ​ Pass in user-defined parameters, this parameter has two functions: -Function 1: Overwrite the configuration in the **`config`** file, such as: +Function 1: Override the value of the corresponding configuration item in the **`config`** file, such as: ```bash # The device and uniqueTag used at runtime are the values specified in the command, and the values configured in the configuration file will not be read @@ -127,7 +127,27 @@ For example: flybirds run --no-rerun ``` +- **--html/--no-html (Optional)** + +​ Specify whether to generate html test result report after case execution。The default is 'True', the result test report will be generated automatically after execution. + +For example: + +```bash +# Don't generat test reports +flybirds run --no-html +``` + +- **--processes, -p INTEGER(Optional)** + Specifies the maximum number of processes to be opened for parallel execution. The default is 4 . + **Note:** This command is only valid when executed on the **web** platform. + +For example: + +```bash +flybirds run --path features -p 5 +``` diff --git a/docs/flybirds_cli_zhCN.md b/docs/flybirds_cli_zhCN.md index ac754881..0f9e4e11 100644 --- a/docs/flybirds_cli_zhCN.md +++ b/docs/flybirds_cli_zhCN.md @@ -49,7 +49,7 @@ Usage: flybirds [OPTIONS] COMMAND [ARGS]... - `run`: 运行项目. - + #### 操作 @@ -66,7 +66,7 @@ flybirds run --help 示例: ```bash -flybirds run -P ./features/test/demo.feature +flybirds run --path ./features/test/demo.feature ``` - **--tag, -T TEXT(可选)** @@ -103,7 +103,7 @@ flybirds run --report report\curent\report.json ​ 传入用户自定义的参数,此参数有两个作用: -作用1:覆盖`config`配置文件中的配置,比如: +作用1:覆盖`config`配置文件中的相应配置的值,比如: ```bash # 运行时使用的设备和uniqueTag为命令中指定的值,不会取配置文件中配置的值 @@ -123,7 +123,26 @@ flybirds run --define deviceId=*** --define uniqueTag=*** flybirds run --no-rerun ``` +- **--html/--no-html (可选)** + +​ 指定case 执行完成后是否生成html测试报告,默认是 ‘True’ ,执行完成后自动生成结果测试报告。 + +示例: + +```bash +#不生成测试报告 +flybirds run --no-html +``` + +- **--processes, -p INTEGER(可选)** + + 指定并发执行时开启进程的最大数量。默认是4 。 + **注意:** 此命令只在 **web** 平台执行时有效。 +示例: +```bash +flybirds run --path features -p 5 +``` diff --git a/docs/pageelement.md b/docs/pageelement.md index ad77106d..8dbe4239 100644 --- a/docs/pageelement.md +++ b/docs/pageelement.md @@ -16,5 +16,9 @@ To judge whether the element meets the expected performance, it depends on the s Frankly speaking, there must be cases that only manual testing can not be verified by automated testing, but if most of the cases can use automated testing, we can also alleviate the problems we are facing and benefit from it. # How to inspect Page element +**Mobile** 1. Install IDE editor officially provided by airtest:[Download](https://airtest.netease.com/) -2. [IDE manual](https://airtest.doc.io.netease.com/IDEdocs/3.1getting_started/AirtestIDE_install/) \ No newline at end of file +2. [IDE manual](https://airtest.doc.io.netease.com/IDEdocs/3.1getting_started/AirtestIDE_install/) + +**Web** +1. Element selector:[Selectors](https://playwright.dev/python/docs/selectors) diff --git a/docs/pageelement_zhCN.md b/docs/pageelement_zhCN.md index 390f1044..e5696b25 100644 --- a/docs/pageelement_zhCN.md +++ b/docs/pageelement_zhCN.md @@ -16,5 +16,9 @@ 坦诚讲,肯定存在只有手工测试而自动化测试无法验证的用例,但是如果大部分用例能使用自动化测试,我们也能缓解目前所面临的问题并从中受益。 # 怎样查找元素属性 +**移动端** 1. 安装airtest官方提供的IDE编辑器:[下载地址](https://airtest.netease.com/) -2. [IDE使用帮助](https://airtest.doc.io.netease.com/IDEdocs/3.1getting_started/AirtestIDE_install/) \ No newline at end of file +2. [IDE使用帮助](https://airtest.doc.io.netease.com/IDEdocs/3.1getting_started/AirtestIDE_install/) + +**web端** +1. 元素选择器:[Selectors](https://playwright.dev/python/docs/selectors) \ No newline at end of file diff --git a/docs/readme_en.md b/docs/readme_en.md index 8cbc642d..4cabc0a3 100644 --- a/docs/readme_en.md +++ b/docs/readme_en.md @@ -14,14 +14,15 @@ Flybirds is a front-end UI automation test framework based on BDD mode, providing a series of out-of-the-box tools and complete documentation. - Based on Behave, supporting BDD tools are required to associate Natural Language Test Case Documentation with Automated Test Code in BDD. -- Based on Airtest, UI automated test framework is needed to implement "test cases can be executed on automated test platform" in BDD. +- Based on Airtest, mobile UI automated test framework is needed to implement "test cases can be executed on automated test platform" in BDD. +- Based on Playwright, web UI automated test framework is needed to implement "test cases can be executed on automated test platform" in BDD. ### What can I do? With Flybirds you can do most of the mobile automation, here are some features to help you get started: - Based on BDD pattern, similar natural language syntax -- Support automatic app operation, form submission, UI element verification, keyboard input, deeplink jump, etc. on the Android side. The IOS side is in progress +- Support automatic web、app operation, form submission, UI element verification, keyboard input, deeplink jump, etc. on the Android side. The IOS side is in progress - English and Chinese are supported by default. Support more languages ​​extensions - Plug in design, support user-defined automation framework extension - Provide cli scaffolding construction to help build projects quickly @@ -157,4 +158,5 @@ Thanks for all these great works that make this project better. - [airtest](https://github.com/AirtestProject) - [behave](https://github.com/behave) +- [playwright](https://github.com/microsoft/playwright-python) - [multiple-cucumber-html-reporter](https://github.com/wswebcreation/multiple-cucumber-html-reporter) \ No newline at end of file diff --git a/docs/relate.md b/docs/relate.md index cd9fd6ee..4513be0f 100644 --- a/docs/relate.md +++ b/docs/relate.md @@ -1,4 +1,4 @@ -#requirements list +## requirements list - pocoui>=1.0.85 - airtest>=1.2.3 @@ -8,4 +8,28 @@ - typer==0.4.0 - tidevice==0.5.9 - pyasn1==0.4.8 -- pyOpenSSL==19.1.0 \ No newline at end of file +- pyOpenSSL==19.1.0 +- playwright>=1.19.0 + + + +## Install browsers + +Each version of Playwright needs specific versions of browser binaries to operate. When you perform UI automation testing on the web platform, you need to use the **[Playwright CLI](https://playwright.dev/python/docs/cli)** to install these browsers. + +Playwright can install supported browsers. + +```bash +# Running without arguments will install default browsers +playwright install +``` + +You can also install specific browsers by providing an argument: + +```bash +# Install WebKit +playwright install webkit +``` + + + diff --git a/docs/relate_zhCN.md b/docs/relate_zhCN.md index b90749a0..89329482 100644 --- a/docs/relate_zhCN.md +++ b/docs/relate_zhCN.md @@ -1,11 +1,42 @@ -#依赖包列表 +## 依赖包列表 - pocoui>=1.0.85 + - airtest>=1.2.3 + - setuptools~=47.1.0 + - behave==1.2.6 + - jsonpath==0.82 + - typer==0.4.0 + - tidevice==0.5.9 + - pyasn1==0.4.8 -- pyOpenSSL==19.1.0 \ No newline at end of file + +- pyOpenSSL==19.1.0 + +- playwright>=1.19.0 + + + +## 安装浏览器 + +每个版本的Playwright都需要特定版本的浏览器二进制文件来运行。当你在web端进行UI 自动测试时, 需要使用 **[Playwright CLI](https://playwright.dev/python/docs/cli)** 来安装这些浏览器。 + +Playwright支持可以安装的浏览器。 + +```bash +# 不带参数的运行将安装默认浏览器 +playwright install +``` + +你也可以通过提供一个参数来安装特定的浏览器: + +```bash +# 安装 WebKit +playwright install webkit +``` + From ef89ee7ef05210bc60c5548c50dcb87b6088e8b4 Mon Sep 17 00:00:00 2001 From: David Chen <30871402+clgwlg@users.noreply.github.com> Date: Thu, 14 Apr 2022 17:10:35 +0800 Subject: [PATCH 2/9] Update relate_zhCN.md --- docs/relate_zhCN.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/relate_zhCN.md b/docs/relate_zhCN.md index 89329482..9d807ad5 100644 --- a/docs/relate_zhCN.md +++ b/docs/relate_zhCN.md @@ -26,17 +26,19 @@ 每个版本的Playwright都需要特定版本的浏览器二进制文件来运行。当你在web端进行UI 自动测试时, 需要使用 **[Playwright CLI](https://playwright.dev/python/docs/cli)** 来安装这些浏览器。 -Playwright支持可以安装的浏览器。 - ```bash -# 不带参数的运行将安装默认浏览器 +# 不带参数的运行将安装默认所有浏览器 playwright install ``` -你也可以通过提供一个参数来安装特定的浏览器: - ```bash -# 安装 WebKit +# 通过提供一个参数来安装特定的浏览器 playwright install webkit ``` +```bash +# 查看支持安装的浏览器 +playwright install --help +``` + + From add3852c78754c2b079ee12aaa68841399a8ef5d Mon Sep 17 00:00:00 2001 From: David Chen <30871402+clgwlg@users.noreply.github.com> Date: Thu, 14 Apr 2022 17:12:20 +0800 Subject: [PATCH 3/9] Update relate.md --- docs/relate.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/relate.md b/docs/relate.md index 4513be0f..428a76bc 100644 --- a/docs/relate.md +++ b/docs/relate.md @@ -17,19 +17,20 @@ Each version of Playwright needs specific versions of browser binaries to operate. When you perform UI automation testing on the web platform, you need to use the **[Playwright CLI](https://playwright.dev/python/docs/cli)** to install these browsers. -Playwright can install supported browsers. - ```bash -# Running without arguments will install default browsers +# running without arguments will install default browsers playwright install ``` -You can also install specific browsers by providing an argument: - ```bash -# Install WebKit +# install specific browsers by providing an argument playwright install webkit ``` +```bash +# see all supported browsers +playwright install --help +``` + From fa29e9238de2c03694ac5318c0d791919aac4bfe Mon Sep 17 00:00:00 2001 From: David Chen <30871402+clgwlg@users.noreply.github.com> Date: Thu, 14 Apr 2022 17:20:13 +0800 Subject: [PATCH 4/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d80453a..e6a6339e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Flybirds是基于BDD模式的前端UI自动化测试框架,提供了一系列开 使用Flybirds你能够完成大部分的手机端自动化操作,以下是一些帮助入门的特性描述: - 基于BDD模式,类自然语言语法 -- 支持自动化Web、APP操作, 表单提交、UI元素校验、键盘输入、Deeplink跳转等 +- 支持Android、iOS、Web 自动化操作, 表单提交、UI元素校验、键盘输入、Deeplink跳转等 - 默认支持英文、中文两种语言,支持更多语言扩展 - 插件式设计,支持用户自定义自动化扩展 - 提供cli脚手架,快速搭建项目 From e96ccdab328902ef4fd282be2486bcc9baf01198 Mon Sep 17 00:00:00 2001 From: David Chen <30871402+clgwlg@users.noreply.github.com> Date: Thu, 14 Apr 2022 17:21:12 +0800 Subject: [PATCH 5/9] Update readme_en.md --- docs/readme_en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/readme_en.md b/docs/readme_en.md index 4cabc0a3..0623c512 100644 --- a/docs/readme_en.md +++ b/docs/readme_en.md @@ -22,7 +22,7 @@ Flybirds is a front-end UI automation test framework based on BDD mode, providin With Flybirds you can do most of the mobile automation, here are some features to help you get started: - Based on BDD pattern, similar natural language syntax -- Support automatic web、app operation, form submission, UI element verification, keyboard input, deeplink jump, etc. on the Android side. The IOS side is in progress +- Support Android、iOS、Web automatic operation, form submission, UI element verification, keyboard input, deeplink jump, etc. on the Android side. The IOS side is in progress - English and Chinese are supported by default. Support more languages ​​extensions - Plug in design, support user-defined automation framework extension - Provide cli scaffolding construction to help build projects quickly @@ -159,4 +159,4 @@ Thanks for all these great works that make this project better. - [airtest](https://github.com/AirtestProject) - [behave](https://github.com/behave) - [playwright](https://github.com/microsoft/playwright-python) -- [multiple-cucumber-html-reporter](https://github.com/wswebcreation/multiple-cucumber-html-reporter) \ No newline at end of file +- [multiple-cucumber-html-reporter](https://github.com/wswebcreation/multiple-cucumber-html-reporter) From e8b22fb7ab1ef9a9e0e2dffc112eabe2104231ee Mon Sep 17 00:00:00 2001 From: David Chen <30871402+clgwlg@users.noreply.github.com> Date: Thu, 14 Apr 2022 23:21:07 +0800 Subject: [PATCH 6/9] Update README.md --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e6a6339e..9dd9d13c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Flybirds是基于BDD模式的前端UI自动化测试框架,提供了一系列开 使用Flybirds你能够完成大部分的手机端自动化操作,以下是一些帮助入门的特性描述: - 基于BDD模式,类自然语言语法 -- 支持Android、iOS、Web 自动化操作, 表单提交、UI元素校验、键盘输入、Deeplink跳转等 +- 支持Android、iOS、Web 自动化操作、表单提交、UI元素校验、键盘输入、Deeplink跳转等 - 默认支持英文、中文两种语言,支持更多语言扩展 - 插件式设计,支持用户自定义自动化扩展 - 提供cli脚手架,快速搭建项目 @@ -48,7 +48,7 @@ Flybirds是基于BDD模式的前端UI自动化测试框架,提供了一系列开 ```bash pip3 install flybirds ``` -在Mac/Linux系统下,需要手动赋予adb可执行权限 +在Mac/Linux系统下,需要手动赋予adb可执行权限,Android项目才能正常工作 - for mac ```bash @@ -65,6 +65,21 @@ chmod +x adb ```bash flybirds create ``` +Web项目,需安装浏览器 +```bash +# 不带参数的运行将安装默认所有浏览器 +playwright install +``` + +```bash +# 通过提供一个参数来安装特定的浏览器 +playwright install webkit +``` + +```bash +# 查看支持安装的浏览器 +playwright install --help +``` ## 教程 - [环境准备](https://flybirds.readthedocs.io/zh_CN/latest/BDD-UI-Testing-Flybirds.html#id5) From 2a4a2fea076a77ce8b21a70c66f546c1a056e063 Mon Sep 17 00:00:00 2001 From: David Chen <30871402+clgwlg@users.noreply.github.com> Date: Fri, 15 Apr 2022 10:47:07 +0800 Subject: [PATCH 7/9] Update casedsl_zhCN.md --- docs/casedsl_zhCN.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/casedsl_zhCN.md b/docs/casedsl_zhCN.md index 1e20c514..15cf2b81 100644 --- a/docs/casedsl_zhCN.md +++ b/docs/casedsl_zhCN.md @@ -290,18 +290,28 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j - 语义: 指定选择器的元素在指定时间位置未发生变化,目的是判断页面未处于滑动状态 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 - verifyCount: 最大判断次数,优先级:默认值 < flybirds_config.json中的“verifyPosNotChangeCount” < 语句中指定 + + **开始录屏超时[time]** - 支持平台:Android - 语义:开始录制屏幕,到超时时间未停止则停止录屏 + + **开始录屏** - 支持平台:Android - 语义: 开始录制屏幕,使用默认的超时时间(在配置文件中配置) + + **结束录屏** - 支持平台:Android - 语义:结束录制屏幕,并将视频文件关联到报告中 + + **等待[time]秒** - 支持平台:Android、iOS - 语义:执行暂停指定时间 + + **全屏截图*** - 支持平台:Android、iOS - 语义:截取当前屏幕快照并关联到报告中 From f193036c9b458fb6ee558e53699d20bda90b4dd6 Mon Sep 17 00:00:00 2001 From: David Chen <30871402+clgwlg@users.noreply.github.com> Date: Fri, 15 Apr 2022 11:16:32 +0800 Subject: [PATCH 8/9] Update flybirds_cli_zhCN.md --- docs/flybirds_cli_zhCN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/flybirds_cli_zhCN.md b/docs/flybirds_cli_zhCN.md index 0f9e4e11..434e295a 100644 --- a/docs/flybirds_cli_zhCN.md +++ b/docs/flybirds_cli_zhCN.md @@ -106,8 +106,8 @@ flybirds run --report report\curent\report.json 作用1:覆盖`config`配置文件中的相应配置的值,比如: ```bash - # 运行时使用的设备和uniqueTag为命令中指定的值,不会取配置文件中配置的值 -flybirds run --define deviceId=*** --define uniqueTag=*** +# 通过参数切换执行平台Android、iOS、Web +flybirds run --define platform=web ``` 作用2: 传入自定义参数以便在`pscript`目录下的自定义脚本中使用,使用全局参数 `global_resource` 获取. From c4e460e9594f3a519c084dc56713a9789933929a Mon Sep 17 00:00:00 2001 From: moyuer <443677948@qq.com> Date: Fri, 15 Apr 2022 11:42:18 +0800 Subject: [PATCH 9/9] docs: update casedsl.md --- docs/casedsl.md | 53 ++++++++++++++++++++++++-------------------- docs/casedsl_zhCN.md | 49 ++++++++++++++++++++-------------------- 2 files changed, 53 insertions(+), 49 deletions(-) diff --git a/docs/casedsl.md b/docs/casedsl.md index 5c352113..078f2756 100644 --- a/docs/casedsl.md +++ b/docs/casedsl.md @@ -56,7 +56,7 @@ The "[]" in the statement template needs to add a value, otherwise the statement ## Statement template: **connect device[{param}]** -- platform: Android +- platform: Android , IOS - description:connect test device - example:connect device [10.21.37.123:5555] @@ -76,6 +76,7 @@ The "[]" in the statement template needs to add a value, otherwise the statement - example:start app [package name] **restart app** +- platform: Android, IOS - description:restart app **go to home page** @@ -91,7 +92,7 @@ The "[]" in the statement template needs to add a value, otherwise the statement - PS:User-defined implementation, implement the logout() method in the pscript/app/operation.py file **exist text[string{, fuzzyMatch=false, timeout=10}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:find specified string exists in the page - timeout Search timeout time, priority: default value < “waitEleTimeout” in flybirds_config.json< Specified in the statement ```js @@ -100,7 +101,7 @@ exist text [flight, timeout=10] exist text [.?ght, fuzzyMatch=true] ``` **not exist text[string{, fuzzyMatch=false}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:find specified string not exists in the page ```js not exist text [flight] @@ -108,7 +109,7 @@ not exist text [flight, timeout=10] not exist text [.?ght, fuzzyMatch=true] ``` **text[string{, fuzzyMatch=false, timeout=10}]disappear** -- platform: Android, IOS +- platform: Android, IOS,Web - description:specified character string disappears from the page within the specified time timeout timeout for waiting to disappear, priority: default value < “waitEleDisappear” in flybirds_config.json< Specified in the statement ```js @@ -116,7 +117,7 @@ text [flight] disappear text [.?ght, fuzzyMatch=true, timeout=20] disappear ``` **exist element [selector{, path=false, multiSelector=false, timeout=10}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:check element of the specified selector on the page - timeout timeout for waiting to disappear, priority: default value < “waitEleTimeout” in flybirds_config.json < Specified in the statement ```js @@ -126,7 +127,7 @@ exist element [textMatches=.?eco] exist element [textMatches=.?eco and type=android.view.ViewGroup, multiSelector=true, timeout=30] ``` **not exist element[selector{, path=false, multiSelector=false}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:check element of the specified selector not on the page ```js not exist element [center_content_layout] @@ -135,7 +136,7 @@ not exist element [textMatches=.?eco] not exist element [textMatches=.?eco and type=android.view.ViewGroup, multiSelector=true, timeout=30] ``` **element[selector{, path=false, multiSelector=false, timeout=10}]disappear** -- platform: Android, iOS +- platform: Android, iOS,Web - description:specified selector disappears from the page within the specified time - timeout: timeout for waiting to disappear, priority: default value < “waitEleDisappear” in flybirds_config.json < Specified in the statement ```js @@ -143,7 +144,7 @@ element [center_content_layout] disappear element [text=flight] disappear ``` **the text of element [selector{, path=false, multiSelector=false, timeout=10}] is [string{, dealMethod=name}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:specify the text of the element of the selector as the specified string - timeout timeout for waiting to disappear, priority: default value < “waitEleTimeout” in flybirds_config.json < Specified in the statement ```js @@ -152,7 +153,7 @@ the text of element [textMatches=.?economic, timeout=15] is [economic, dealMetho the text of element [textMatches=.?economic and visible=True, multiSelector=true, timeout=15] is [economic, dealMethod=trim_prefix] ``` **the text of element [selector{, path=false, multiSelector=false, timeout=10}] include [string{, dealMethod=name}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:pecify the text of the element of the selector include the specified string - timeout timeout for waiting to disappear, priority: default value < “waitEleTimeout” in flybirds_config.json < Specified in the statement ```js @@ -161,7 +162,7 @@ the text of element [textMatches=.?economic, timeout=15] include [economic, deal the text of element [textMatches=.?economic and visible=True, multiSelector=true, timeout=15] include [economic, dealMethod=trim_prefix] ``` **element[selector{, path=false, multiSelector=false, timeout=10}] appear after page rendering** -- platform: Android, iOS +- platform: Android, iOS,Web - description:when entering a new page, you can determine that the page rendering is complete by specifying the element of the selector to appear on the page - timeout timeout for waiting to disappear, priority: default value < “pageRenderTimeout” in flybirds_config.json < Specified in the statement ```js @@ -170,7 +171,7 @@ element [center_content_layout, timeout=15] appear after page rendering element [center_content_layout, timeout=40] appear after page rendering ``` **click text[string{, fuzzyMatch=false, timeout=10, verifyEle=null, verifyIsPath=false, verifyIsMultiSelector=false, verifyTimeout=10, verifyAction=null}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:click on the string specified on the page - timeout: find the timeout of "string", priority: default value < “waitEleTimeout” in flybirds_config.json < specified in the statement - verifyEle: if there is partial rendering after clicking, use the relevant information of the element represented by the selector specified by this attribute to determine @@ -186,7 +187,7 @@ click text [flight, verifyEle=center_content_layout, verifyAction=position] click text [flight, verifyEle=text=filterand =textView, verifyIsMultiSelector=true, verifyAction=position] ``` **click[selector{, path=false, multiSelector=false, timeout=10, verifyEle=null, verifyIsPath=false, verifyIsMultiSelector=false, verifyTimeout=10, verifyAction=null}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description: click on the element of the specified selector on the page - timeout: find the timeout of "string", priority: default value < “waitEleTimeout” in flybirds_config.json < specified in the statement - verifyEle: if there is partial rendering after clicking, use the relevant information of the element represented by the selector specified by this attribute to determine @@ -206,7 +207,7 @@ click [flight, verifyEle=text=filterand =textView, verifyIsMultiSelector=true, v click position [200,100] ``` **text [string{, fuzzyMatch=false, timeout=10}]property [{, dealMethod=name}]is {}** -- platform: Android, iOS +- platform: Android, iOS,Web - description:the value of the specified attribute of the element corresponding to the specified string in the page is the specified value - timeout: find the timeout of "string", priority: default value < “waitEleTimeout” in flybirds_config.json < Specified in the statement ```js @@ -214,7 +215,7 @@ text [economic] property [text] is flight text [economic, timeout=15] property [text, dealMethod=trim_last] is fli ``` **element[selector{, path=false, multiSelector=false, timeout=10}]property[property name{, dealMethod=name}]is{property value}** -- platform: Android, iOS +- platform: Android, iOS,Web - description:the value of the specified attribute of the element of the specified selector on the page is the specified value - timeout: find the timeout of "string", priority: default value < “waitEleTimeout” in flybirds_config.json < Specified in the statement ```js @@ -222,7 +223,7 @@ element [text=flight] property [text] is flight element [text=flight, timeout=15] property[text, dealMethod=trim_last] is fli ``` **input[selector{, path=false, multiSelector=false, timeout=10}]into[string{, pocoInput=false, afterInputWait=1}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:input the specified copy in the element of the specified selector - timeout: find the timeout of "string", priority: default value < “waitEleTimeout” in flybirds_config.json < Specified in the statement - pocoInput: Whether to use the input method of poco, the input method of airtest is used by default, Priority: default < “usePocoInput” in flybirds_config.json < Specified in the statement @@ -233,7 +234,7 @@ input [shanghai] into [inputEleId] input [david, pocoInput=true, afterInputWait=5] into [type=InputView] ``` **[selector{, path=false, multiSelector=false, timeout=10}] slide to {up/down/left/right} distance [value{, startX=0.5, startY=0.5, duration=null, readyTime=null}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:slide the specified distance in the specified direction in the sliding container of the specified selector - timeout: find the timeout of "string", priority: default value < “waitEleTimeout” in flybirds_config.json < Specified in the statement - startX: the coordinate value of the X axis of the starting coordinate of the sliding in the container,<=1 represents the percentage,>1 representative pixel @@ -246,7 +247,7 @@ input [david, pocoInput=true, afterInputWait=5] into [type=InputView] [containerEleId] slide to right [100, startX=0.2, startY=0.4, duration=5, readyTime=3] ``` **slide to {up/down/left/right} distance [value{, startX=0.5, startY=0.5, duration=null, readyTime=null}]** -- platform: Android, iOS +- platform: Android, iOS,Web - description:use the full screen as the container to slide the specified distance in the specified direction - startX: the coordinate value of the X axis of the sliding start coordinate in the full screen,<=1 represents the percentage,>1 representative pixel - startY: the coordinate value of the Y axis of the sliding start coordinate in the full screen,<=1 represents the percentage,>1 representative pixel @@ -257,7 +258,7 @@ slide to up distance [0.05] slide to down [0.4, readyTime=3, duration=2] ``` **from {up/down/left/right} find [selector{, path=false, multiSelector=false, swipeCount=5, startX=0.5, startY=0.5, distance=0.3, duration=null}]element** -- platform: Android, iOS +- platform: Android, iOS,Web - description:swipe to the specified direction on the full screen to find the element of the specified selector - swipeCount: swipe to find the maximum number of swipes. If the specified element is not found on the page after the sliding operation exceeds this value, it will fail. priority: default < “swipeSearchCount” in flybirds_config.json < Specified in the statement - startX: Slide the X-axis coordinate value of the starting coordinate in the full screen, <=1 means percentage, >1 means pixel @@ -276,23 +277,27 @@ from left find [testId, distance=0.5, duration=2, swipeCount=8] element - verifyCount: maximum number of judgments,priority: default <“verifyPosNotChangeCount” in flybirds_config.json < Specified in the statement **start recording timeout[time]** -- platform: Android +- platform: Android,iOS - description:start to record the screen, stop recording when the timeout period is not stopped + **start record** -- platform: Android +- platform: Android,iOS - description: start recording the screen, using the default timeout period (configured in the configuration file) + **stop record** -- platform: Android +- platform: Android,iOS,Web - description:stop the screen recording and associate the video file to the report + **wait[time]seconds** -- platform: Android, iOS +- platform: Android, iOS,Web - description:wait for a while + **screenshot*** -- platform: Android, iOS +- platform: Android, iOS,Web - description:take a screenshot of the current screen and associate it with the report **go to url[url address]** -- platform: Android +- platform: Android,Web - description:Jump to the specified page through the schema, and the page name is maintained in the form of "page name: page schemaUrl" in config/schema_url.js ```js go to url [list page] diff --git a/docs/casedsl_zhCN.md b/docs/casedsl_zhCN.md index 15cf2b81..33a78d55 100644 --- a/docs/casedsl_zhCN.md +++ b/docs/casedsl_zhCN.md @@ -55,7 +55,7 @@ ## 语句模版: **连接设备[{param}]** -- 支持平台:Android +- 支持平台:Android 、 IOS - 语义:连接测试设备 - 例子:连接设备[10.21.37.123:5555] @@ -91,7 +91,7 @@ - 注:用户自定义实现, 在 pscript/app/operation.py 文件中实现 logout() 方法 **存在[字符串{, fuzzyMatch=false, timeout=10}]的文案** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:页面中存在指定的字符串 - timeout 查找的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 ```js @@ -100,14 +100,14 @@ 存在[.?票, fuzzyMatch=true]的文案 ``` **不存在[字符串{, fuzzyMatch=false}]的文案** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:页面中不存在指定的文案 ```js 不存在[机票]的文案 不存在[.?票, fuzzyMatch=true]的文案 ``` **文案[字符串{, fuzzyMatch=false, timeout=10}]消失** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:指定的字符串在规定时间内从页面消失 timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.json中的“waitEleDisappear” < 语句中指定 ```js @@ -115,7 +115,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 文案[.?票, fuzzyMatch=true, timeout=20]消失 ``` **存在[选择器{, path=false, multiSelector=false, timeout=10}]的元素** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:页面中存在指定 选择器 的元素 - timeout 查找的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 ```js @@ -126,7 +126,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 存在[机票→第1个兄弟节点, path=true]的元素 ``` **不存在[选择器{, path=false, multiSelector=false}]的元素** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:页面中不存在指定 选择器 的元素 ```js 不存在[center_content_layout]的元素 @@ -144,7 +144,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 元素[机票→第1个兄弟节点, path=true, timeout=15]消失 ``` **[选择器{, path=false, multiSelector=false, timeout=10}]的文案为[字符串{, dealMethod=name}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:指定 选择器 的元素的文案为指定的字符串 - timeout 查找的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 ```js @@ -153,7 +153,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j [textMatches=.?经济舱并且visible=True, multiSelector=true, timeout=15]的文案为[经济舱, dealMethod=trim_prefix] ``` **[选择器{, path=false, multiSelector=false, timeout=10}]的文案包含[字符串{, dealMethod=name}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:指定 选择器 的元素的文案包含指定的字符串 - timeout 查找的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 ```js @@ -164,7 +164,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j [textMatches=.?经济舱并且visible=True, multiSelector=true, timeout=15]的文案包含[经济, dealMethod=trim_prefix] ``` **页面渲染完成出现元素[选择器{, path=false, multiSelector=false, timeout=10}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:进入新的页面时通过指定 选择器 的元素出现在页面上来判断页面渲染完成 - timeout 查找的超时时间,优先级:默认值 < flybirds_config.json中的“pageRenderTimeout” < 语句中指定 ```js @@ -175,7 +175,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 页面渲染完成出现元素[center_content_layout, timeout=40] ``` **点击文案[字符串{, fuzzyMatch=false, timeout=10, verifyEle=null, verifyIsPath=false, verifyIsMultiSelector=false, verifyTimeout=10, verifyAction=null}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:点击页面上指定的 字符串 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 - verifyEle 点击后如果有局部渲染,使用该属性指定的选择器代表的元素的相关信息判断 @@ -191,7 +191,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 点击文案[机票, verifyEle=text=筛选并且type=textView, verifyIsMultiSelector=true, verifyAction=position] ``` **点击[选择器{, path=false, multiSelector=false, timeout=10, verifyEle=null, verifyIsPath=false, verifyIsMultiSelector=false, verifyTimeout=10, verifyAction=null}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义: 点击页面上指定 选择器 的元素 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 - verifyEle 点击后如果有局部渲染,使用该属性指定的选择器代表的元素的相关信息判断 @@ -211,7 +211,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 点击屏幕位置[200,100] ``` **文案[字符串{, fuzzyMatch=false, timeout=10}]的属性[属性名{, dealMethod=name}]为{属性值}** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:页面中指定 字符串对应的元素的指定的属性的值为指定的值 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 ```js @@ -219,7 +219,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 文案[机票, timeout=15]的属性[text, dealMethod=trim_last]为机 ``` **元素[选择器{, path=false, multiSelector=false, timeout=10}]的属性[属性名{, dealMethod=name}]为{属性值}** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:页面中指定 选择器 的元素的指定的 属性的值为指定的 值 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 ```js @@ -227,7 +227,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 元素[text=机票, timeout=15]的属性[text, dealMethod=trim_last]为机 ``` **在[选择器{, path=false, multiSelector=false, timeout=10}]中输入[文案{, pocoInput=false, afterInputWait=1}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:在指定选择器的元素中输入指定的文案 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 - pocoInput: 是否使用 poco 的输入方法,默认使用的是airtest的输入方法, 优先级:默认值 < flybirds_config.json中的“usePocoInput” < 语句中指定 @@ -237,7 +237,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 在[type=InputView]中输入[用户名, pocoInput=true, afterInputWait=5] ``` **[选择器{, path=false, multiSelector=false, timeout=10}]向{上/下/左/右}滑动[滑动距离{, startX=0.5, startY=0.5, duration=null, readyTime=null}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:在指定 选择器 的滑动容器内向指定 方向 滑动指定 距离 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 - startX: 在容器中滑动起始坐标的X轴的坐标值,<=1 代表百分比,>1代表像素点 @@ -250,7 +250,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j [containerEleId]向上滑动[100, startX=0.2, startY=0.4, duration=5, readyTime=3] ``` **全屏向{上/下/左/右}滑动[滑动距离{, startX=0.5, startY=0.5, duration=null, readyTime=null}]** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:以全屏为容器向指定 方向 滑动指定 距离 - startX: 在全屏中滑动起始坐标的X轴的坐标值,<=1 代表百分比,>1代表像素点 - startY: 在全屏中滑动起始坐标的Y轴的坐标值,<=1 代表百分比,>1代表像素点 @@ -261,7 +261,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 向下滑动[0.4, readyTime=3, duration=2] ``` **在[选择器{, path=false, multiSelector=false, timeout=10}]中向{上/下/左/右}查找[选择器{, path=false, multiSelector=false, swipeCount=5, startX=0.5, startY=0.5, distance=0.3, duration=null}]的元素** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:在指定 选择器 的元素内 向指定方向滑动查找 指定选择器的元素 - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 - swipeCount: 滑动查找最大滑动次数,超过这个值的滑动操作后还未在页面中找到指定元素则失败, 优先级:默认值 < flybirds_config.json中的“swipeSearchCount” < 语句中指定 @@ -274,7 +274,7 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j 在[containerId]中向下查找[testId, distance=0.5, duration=2, swipeCount=8] ``` **向{上/下/左/右}查找[选择器{, path=false, multiSelector=false, swipeCount=5, startX=0.5, startY=0.5, distance=0.3, duration=null}]的元素** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:在全屏向指定方向滑动查找 指定选择器的元素 - swipeCount: 滑动查找最大滑动次数,超过这个值的滑动操作后还未在页面中找到指定元素则失败, 优先级:默认值 < flybirds_config.json中的“swipeSearchCount” < 语句中指定 - startX: 在全屏中滑动起始坐标的X轴的坐标值,<=1 代表百分比,>1代表像素点 @@ -291,33 +291,32 @@ timeout 等待消失的超时时间 ,优先级:默认值 < flybirds_config.j - timeout 查找“字符串”的超时时间,优先级:默认值 < flybirds_config.json中的“waitEleTimeout” < 语句中指定 - verifyCount: 最大判断次数,优先级:默认值 < flybirds_config.json中的“verifyPosNotChangeCount” < 语句中指定 - **开始录屏超时[time]** -- 支持平台:Android +- 支持平台:Android、iOS - 语义:开始录制屏幕,到超时时间未停止则停止录屏 **开始录屏** -- 支持平台:Android +- 支持平台:Android、iOS - 语义: 开始录制屏幕,使用默认的超时时间(在配置文件中配置) **结束录屏** -- 支持平台:Android +- 支持平台:Android、iOS、Web - 语义:结束录制屏幕,并将视频文件关联到报告中 **等待[time]秒** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:执行暂停指定时间 **全屏截图*** -- 支持平台:Android、iOS +- 支持平台:Android、iOS、Web - 语义:截取当前屏幕快照并关联到报告中 **跳转到[页面名称]** -- 支持平台:Android +- 支持平台:Android、Web - 语义:通过schema跳转到指定页面,页面名称在config/schema_url.json 中以 "页面名称: 页面schemaUrl" 的形式维护 ```js 跳转到[首页]