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

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikigo committed Jul 31, 2024
1 parent 0cb0717 commit 426e8cf
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 5 deletions.
16 changes: 13 additions & 3 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineConfig({
nav: [
{text: '🏠 首页', link: '/index'},
{text: '🧭 指南', link: '/指南/简介/YouQu3是什么'},
{text: '🏃‍ 实践', link: '/实践/方法开发'},
{text: '🏃‍ 实践', link: '/实践/简介'},
{text: '🎵 规划', link: '/规划/YouQu3架构设计规划'},
{text: '🔌 插件', link: '/插件/插件列表'},
],
Expand Down Expand Up @@ -78,8 +78,18 @@ export default defineConfig({

],
"/实践/": [
{text: "方法开发", link: "/实践/方法开发"},
{text: "用例开发", link: "/实践/用例开发"},
{
text: "从零开始构建自动化工程",
collapsed: false,
items: [
{text: "简介", link: "/实践/简介"},
{text: "工程创建", link: "/实践/工程创建"},
{text: "配置模块", link: "/实践/配置模块"},
{text: "方法开发", link: "/实践/方法开发"},
{text: "用例开发", link: "/实践/用例开发"},
{text: "依赖管理", link: "/实践/依赖管理"},
]
}
],
"/规划/": [
{
Expand Down
1 change: 1 addition & 0 deletions docs/实践/依赖管理.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 依赖管理
1 change: 1 addition & 0 deletions docs/实践/工程创建.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 工程创建
1 change: 1 addition & 0 deletions docs/实践/方法开发.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 方法开发
1 change: 1 addition & 0 deletions docs/实践/用例开发.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 用例开发
15 changes: 15 additions & 0 deletions docs/实践/简介.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 从零开始构建自动化工程

我们将指导如何基于 YouQu3 从零开始构建一个完成的自动化用例工程。

按照以下章节:

- [工程创建](./工程创建.md):使用 YouQu3 官方提供的脚手架工具,快速创建一个自动化用例工程模板。

- [配置模块](./配置模块.md):介绍自动化用例工程配置模块如何管理配置。

- [方法开发](./方法开发.md):使用 PO 设计理念进行方法封装,方法类如何组织,提高可维护性。

- [用例开发](./用例开发.md):按照业务流程调用方法进行用例代码开发,Fixture 如何编写。

- [依赖管理](./依赖管理.md):如何管理自动化用例工程的依赖项。
1 change: 1 addition & 0 deletions docs/实践/配置模块.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 配置模块
10 changes: 8 additions & 2 deletions youqu3/cmd.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import subprocess
import sys

Expand Down Expand Up @@ -106,6 +107,7 @@ def sudo_run(
cls,
command,
password: str = None,
workdir: str = None,
interrupt: bool = False,
timeout: int = 25,
print_log: bool = True,
Expand All @@ -114,8 +116,13 @@ def sudo_run(
):
if password is None:
password = setting.PASSWORD
wd = ""
if workdir:
if not os.path.exists(workdir):
raise FileNotFoundError
wd = f"cd {workdir} && "
return cls.run(
f"echo '{password}' | sudo -S {command}",
f"{wd}echo '{password}' | sudo -S {command}",
interrupt=interrupt,
timeout=timeout,
print_log=print_log,
Expand All @@ -127,7 +134,6 @@ def sudo_run(
"grep",
"pytest",
"python",
"tee",
"ffmpeg",
"youqu",
)
Expand Down

0 comments on commit 426e8cf

Please sign in to comment.