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 19, 2024
1 parent 75de331 commit 8ca2198
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ ipython_config.py
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
Pipfile.lock
Pipfile

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
Expand Down
22 changes: 0 additions & 22 deletions Pipfile

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
## [特性]()

- 以 Python 包的形式提供框架能力,方便安装、更新。
- 支持离线部署,用例整体打包交付之后,可以在无网络环境下直接运行。
- 自带虚拟环境管理器,支持离线部署,用例整体打包交付之后,可以在无网络环境下直接运行。
- 极致轻量化、可定制化依赖,可以根据测试项目类型安装对应的依赖。
- 功能可插拔,以插件的形式提供功能,不安装插件的情况下框架也能正常运行。
- 可视化配置,在浏览器中输入一些配置后即可驱动测试用例执行,搭配远程执行功能,可实现群控测试机执行。
Expand Down Expand Up @@ -69,13 +69,12 @@ pip install youqu3[http]
| 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 | ✔️ |
| 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 | [allure-custom](https://github.com/funny-dream/allure-custom) | 基于 Allure 定制的测试报告 | ✔️ |
| 14 | [wdotool](https://github.com/funny-dream/wdotool) | Wayland 下完美的键鼠工具 | - |
| 15 | [uos-method-toolkit](https://github.com/funny-dream/uos-method-toolkit)(UMTK ) | UOS系统自动化测试操作方法套件 | 🔥 |
| 13 | [wdotool](https://github.com/funny-dream/wdotool) | Wayland 下完美的键鼠工具 | - |
| 14 | [uos-method-toolkit](https://github.com/funny-dream/uos-method-toolkit)(UMTK ) | UOS系统自动化测试操作方法套件 | 🔥 |

## [用例工程]()

Expand Down
2 changes: 1 addition & 1 deletion youqu3/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.10"
__version__ = "0.1.11"
9 changes: 5 additions & 4 deletions youqu3/driver/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ def init():


@cli.command()
def env():
"""安装YouQu环境"""
from youqu3.driver.env import env
env()
@click.option("--python", default="3", type=click.STRING, help="指定虚拟环境的Python版本")
def envx(python):
"""超级环境管理器"""
from youqu3.driver.envx import envx as env
env(python_version=python)


if __name__ == '__main__':
Expand Down
30 changes: 20 additions & 10 deletions youqu3/driver/env.py → youqu3/driver/envx.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
from youqu3.cmd import Cmd


def env():
def cli_cmd_creator(cmd_name, cmd_txt):
cmd_path = os.path.expanduser(f"~/.local/bin/{cmd_name}")
if not os.path.exists(cmd_path):
Cmd.run(f"echo '{cmd_txt}' >> {cmd_path}")
Cmd.run(f"chmod +x {cmd_path}")


def envx(python_version):
rootdir = pathlib.Path(".").absolute()
logger.info(rootdir)
# pip
Expand All @@ -17,23 +24,26 @@ def env():
Cmd.run('curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py')
# youqu3
Cmd.run(f'pip3 install youqu3 -i {setting.PYPI_MIRROR}')
# youqu3-env
youqu3_env_cmd_txt = 'pipenv run youqu3 "$@"'
youqu3_env_cmd_path = os.path.expanduser("~/.local/bin/youqu3-env")
if not os.path.exists(youqu3_env_cmd_path):
Cmd.run(f"echo '{youqu3_env_cmd_txt}' >> {youqu3_env_cmd_path}")
# youqu3-cargo
cli_cmd_creator("youqu3-cargo", 'pipenv run youqu3 "$@"')
# youqu3-shell
cli_cmd_creator("youqu3-shell", 'pipenv shell')
# youqu3-rm
cli_cmd_creator("youqu3-rm", 'pipenv --rm')
# PATH
with open(os.path.expanduser("~/.bashrc"), 'r') as f:
bashrc = f.read()
path_cmd = "export PATH=$PATH:$HOME/.local/bin"
if path_cmd not in bashrc:
Cmd.run(f"echo '{path_cmd}' >> ~/.bashrc")
Cmd.run("source ~/.bashrc")
Cmd.run("source ~/.bashrc")
# pipenv
Cmd.run(f'pip3 install pipenv -i {setting.PYPI_MIRROR}')
Cmd.run(f"cd {rootdir} && pipenv --python 3")
Cmd.run(f"cd {rootdir} && pipenv run pip install -r requirements.txt")
Cmd.run(f"cd {rootdir} && pipenv --python {python_version}")
os.system(
f"cd {rootdir} && pipenv run pip install -r requirements.txt -i {setting.PYPI_MIRROR}",
)


if __name__ == '__main__':
env()
envx()
4 changes: 2 additions & 2 deletions youqu3/driver/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def run(self):
[i.strip("'") for i in self.generate_cmd()[1:]]
)

from allure_custom import AllureCustom
AllureCustom.gen(str(self.allure_data_path), str(self.allure_html_path), clean=True)
from youqu_html import YouQuHtml
YouQuHtml.gen(str(self.allure_data_path), str(self.allure_html_path), clean=True)


if __name__ == "__main__":
Expand Down

0 comments on commit 8ca2198

Please sign in to comment.