Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DHpie committed Apr 14, 2022
1 parent efc9d46 commit 7a338d8
Show file tree
Hide file tree
Showing 12 changed files with 231 additions and 92 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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脚手架,快速搭建项目
Expand Down Expand Up @@ -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)

79 changes: 44 additions & 35 deletions docs/casedsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
78 changes: 43 additions & 35 deletions docs/casedsl_zhCN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| \----- | \----- | \----- |


## 语句模版:
Expand Down
14 changes: 11 additions & 3 deletions docs/demoproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 7a338d8

Please sign in to comment.