Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
Description:

Log:
  • Loading branch information
mikigo committed Jun 20, 2024
1 parent 5038b02 commit 66c549d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 26 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,26 @@ pip install youqu3[http]

## [YouQu3插件生态]()

| 序号 | 插件名称 | 说明 | 可用 |
| :----------------------------------------------------------: | ------------------------------------ | ------------------------------------ | :----------------------------------: |
| 1 | [youqu-dogtail](https://github.com/funny-dream/youqu-dogtail) | 属性定位插件 | ✔️ |
| 2 | [youqu-imagecenter-rpc](https://github.com/funny-dream/youqu-imagecenter-rpc) | 基于 RPC 服务的图像识别插件 | ✔️ |
| 3 | [youqu-mousekey](https://github.com/funny-dream/youqu-mousekey) | 键鼠操作插件 | ✔️ |
| 4 | [youqu-dbus](https://github.com/funny-dream/youqu-dbus) | D-Bus 操控插件 | ✔️ |
| 5 | youqu-pms-driver | PMS 测试单驱动插件 | - |
| 6 | [youqu-button-center](https://github.com/funny-dream/youqu-button-center) | 相对位移定位插件 | ✔️ |
| 7 | [pytest-mark-manage](https://github.com/funny-dream/pytest-mark-manage) | 用例标签化管理插件 | ✔️ |
| 8 | [pytest-youqu-playwright](https://github.com/funny-dream/pytest-youqu-playwright) | 基于 Playwright 的 Web UI 自动化插件 | ✔️ |
| 9 | [youqu-html](https://github.com/funny-dream/youqu-html) | YouQu Html Report | ✔️ |
| 10 | pytest-record-video | 用例失败录屏插件 | - |
| 11 | [funnylog](https://linuxdeepin.github.io/funnylog/) | 全自动日志插件 | ✔️ |
| 12 | [pdocr-rpc](https://linuxdeepin.github.io/pdocr-rpc/) | 基于 RPC 服务的 OCR 识别插件 | ✔️ |
| 13 | [wdotool](https://github.com/funny-dream/wdotool) | Wayland 下完美的键鼠工具 | - |
| 序号 | 插件名称 | 说明 |
| :----------------------------------------------------------: | ------------------------------------ | ------------------------------------ |
| 1 | [youqu-dogtail](https://github.com/funny-dream/youqu-dogtail) | 属性定位插件 |
| 2 | [youqu-imagecenter-rpc](https://github.com/funny-dream/youqu-imagecenter-rpc) | 基于 RPC 服务的图像识别插件 |
| 3 | [youqu-mousekey](https://github.com/funny-dream/youqu-mousekey) | 键鼠操作插件 |
| 4 | [youqu-dbus](https://github.com/funny-dream/youqu-dbus) | D-Bus 操控插件 |
| 5 | youqu-pms-driver | PMS 测试单驱动插件 |
| 6 | [youqu-button-center](https://github.com/funny-dream/youqu-button-center) | 相对位移定位插件 |
| 7 | [pytest-mark-manage](https://github.com/funny-dream/pytest-mark-manage) | 用例标签化管理插件 |
| 8 | [pytest-youqu-playwright](https://github.com/funny-dream/pytest-youqu-playwright) | 基于 Playwright 的 Web UI 自动化插件 |
| 9 | [youqu-html](https://github.com/funny-dream/youqu-html) | YouQu Html Report |
| 10 | [pytest-record-video](https://github.com/funny-dream/pytest-record-video) | 用例失败录屏插件 |
| 11 | [funnylog](https://linuxdeepin.github.io/funnylog/) | 全自动日志插件 |
| 12 | [pdocr-rpc](https://linuxdeepin.github.io/pdocr-rpc/) | 基于 RPC 服务的 OCR 识别插件 |
| 13 | [wdotool](https://github.com/funny-dream/wdotool) | Wayland 下完美的键鼠工具 |

## [UOS测试套件]()

| 序号 | 套件名称 | 说明 | 状态 |
| :--: | ------------------------------------------------------------ | -------------------------- | :--: |
| 1 | [uos-method-toolkit](https://github.com/funny-dream/uos-method-toolkit)(UMTK ) | UOS 自动化测试操作方法套件 | 🔥 |
| 2 | [uos-case-toolkit](https://github.com/funny-dream/uos-case-toolkit)(UCTK ) | UOS 自动化测试操作用例套件 | 🔥 |
| 序号 | 套件名称 | 说明 |
| :--: | ------------------------------------------------------------ | -------------------------- |
| 1 | [uos-method-toolkit](https://github.com/funny-dream/uos-method-toolkit)(UMTK ) | UOS 自动化测试操作方法套件 |
| 2 | [uos-case-v20](https://github.com/funny-dream/uos-case-v20) | UOS 自动化测试操作用例 |

2 changes: 1 addition & 1 deletion docs/设计/UOS自动化测试用例.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Author : mikigo

## 1. 简介

UOS 自动化测试用例,以下简称测试用例套件,是基于 YouQu3 和 UMTK 编写的 UOS 系统级测试用例,旨在提供 UOS 系统所有预装应用的测试用例。
UOS 自动化测试用例,以下简称测试用例,是基于 YouQu3 和 UMTK 编写的 UOS 系统级测试用例,旨在提供 UOS 系统所有预装应用的测试用例。

## 2. 工程设计

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies = [
"pytest-json-report",
"funnylog",
"click",
"pexpect"
"pexpect",
"youqu-html",
]
dynamic = [
Expand Down
23 changes: 18 additions & 5 deletions youqu3/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _run(command, _input=None, timeout=None, check=False, **kwargs):
with subprocess.Popen(command, **kwargs) as process:
try:
stdout, stderr = process.communicate(_input, timeout=timeout)
except: # Including KeyboardInterrupt, communicate handled that.
except:
process.kill()
raise
retcode = process.poll()
Expand Down Expand Up @@ -43,7 +43,6 @@ def _getstatusoutput(cls, command, timeout):
data = ex.output
exitcode = ex.returncode
except subprocess.TimeoutExpired as ex:
# pylint: disable=unnecessary-dunder-call
data = ex.__str__()
exitcode = -1
if data[-1:] == "\n":
Expand Down Expand Up @@ -81,7 +80,12 @@ def run(
return stdout

@staticmethod
def expect_run(cmd: str, events: dict, return_code=False, timeout: int = 30):
def expect_run(
cmd: str,
events: dict,
return_code=False,
timeout: int = 30
):
"""
expect_run(
"ssh [email protected] 'ls -l'",
Expand All @@ -90,7 +94,12 @@ def expect_run(cmd: str, events: dict, return_code=False, timeout: int = 30):
如果 return_code=True,返回 (stdout, return_code)
"""
import pexpect
return pexpect.run(cmd, events=events, withexitstatus=return_code, timeout=timeout)
return pexpect.run(
cmd,
events=events,
withexitstatus=return_code,
timeout=timeout
)

@classmethod
def sudo_run(
Expand Down Expand Up @@ -147,10 +156,14 @@ def remote_sudo_run(self, cmd: str, return_code: bool = False):
return res.stdout, res.return_code
return res.stdout

def remote_expect_run(self):
# TODO
...


if __name__ == '__main__':
stdout = Cmd.run(
"sshpass -p '1' rsync -av -e ssh --exclude='__pycache__' --exclude='.pytest_cache' --exclude='.vscode' --exclude='.idea' --exclude='.git' --exclude='.github' --exclude='.venv' --exclude='report' --exclude='.gitignore' /home/mikigo/github/youqu3-testcase/* [email protected]:/home/uos/youqu3-testcase/",
"ls",
interrupt=True,
print_log=False,
)
Expand Down

0 comments on commit 66c549d

Please sign in to comment.