Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问有案例参考吗 #46

Open
saifeiLee opened this issue Mar 5, 2024 · 1 comment
Open

请问有案例参考吗 #46

saifeiLee opened this issue Mar 5, 2024 · 1 comment
Labels
Feature New feature or request

Comments

@saifeiLee
Copy link
Contributor

首先感谢作者们的出色工作。
我在学习Youqu,但是不知道该如何编写用例,请问能否提供一些case作参考?
(。◕◡◕。)ノ谢谢~

@mikigo
Copy link
Contributor

mikigo commented Mar 6, 2024

Hi,赛飞:

YouQu项目能得到你的关注,我们深感惊喜和荣幸!

项目目前确实缺少测试用例的 examples 模块,公司在用的基于YouQu的测试用例也都没有开源。我们会尽快将此模块补齐。

针对你的问题,我们建议可以先尝试使用如下操作:

youqu manage.py startapp my_app

然后在 apps/my_app/case 目录下新建 test_mycase_001.py 文件,此文件为用例文件(以 test_ 开头),写入类似以下内容:

# test_mycase_001.py

from apps.my_app.case.base_case import BaseCase
from apps.my_app.widget.my_app_widget import MyAppWidget

class TestCase(BaseCase)

	def test_mycase_001(self):
        """this is my test case"""
        MyAppWidget().click_xxx_by_attr()
        self.assert_true()

MyAppWidget 是方法层出口,在里面写元素定位和操作方法,具体设计方案写法可以参考文档【框架设计】- 【AT应用库设计方案】

my_app.csv 重命名为 mycase.csv,并在 脚本ID 列填入 001(建议使用wps进行编辑),csv 文件的具体使用可以参考文档【详细功能】-【标签化管理】。

在线文档地址:https://linuxdeepin.github.io/deepin-autotest-framework/

如此,相信你可以快速的开始一个自动化测试项目,如果遇到问题可以随时与我们联系或者提 issue,我们会以最快的速度为你解决。

YouQu 团队~

@mikigo mikigo added the Feature New feature or request label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants