From 8c7ccd27b808c064efa8230ba769aeb39b3e4cf2 Mon Sep 17 00:00:00 2001 From: ut005790 Date: Thu, 22 Aug 2024 16:10:31 +0800 Subject: [PATCH 1/4] new create dde autotest project --- .env | 4 ++ .gitignore | 6 ++ README.md | 46 ++++++--------- case/__init__.py | 0 case/assert_res/README.md | 3 + case/base_case.py | 11 ++++ case/test_mycase_001.py | 17 ++++++ case/test_mycase_002.py | 20 +++++++ config.py | 19 ++++++ conftest.py | 9 +++ env.sh | 7 +++ method/__init__.py | 0 method/assert_method.py | 12 ++++ method/base_method.py | 10 ++++ method/dde_autotest_euler_method.py | 30 ++++++++++ method/image_res/README.md | 3 + method/static_res/README.md | 3 + method/ui.ini | 14 +++++ mycase.csv | 3 + pytest.ini | 18 ++++++ requirements.txt | 3 + ruff.toml | 90 +++++++++++++++++++++++++++++ 22 files changed, 301 insertions(+), 27 deletions(-) create mode 100644 .env create mode 100644 .gitignore create mode 100644 case/__init__.py create mode 100644 case/assert_res/README.md create mode 100644 case/base_case.py create mode 100644 case/test_mycase_001.py create mode 100644 case/test_mycase_002.py create mode 100644 config.py create mode 100644 conftest.py create mode 100644 env.sh create mode 100644 method/__init__.py create mode 100644 method/assert_method.py create mode 100644 method/base_method.py create mode 100644 method/dde_autotest_euler_method.py create mode 100644 method/image_res/README.md create mode 100644 method/static_res/README.md create mode 100644 method/ui.ini create mode 100644 mycase.csv create mode 100644 pytest.ini create mode 100644 requirements.txt create mode 100644 ruff.toml diff --git a/.env b/.env new file mode 100644 index 0000000..59e96ba --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +PIPENV_VENV_IN_PROJECT=true +PIPENV_PYPI_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple +PIPENV_QUIET=true +PIPENV_DEFAULT_PYTHON_VERSION=3 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a9d4f07 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.idea +.vscode +__pycache__ +Pipfile +Pipfile.lock +report diff --git a/README.md b/README.md index d0213ed..e2d3c2a 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,29 @@ -# dde_autotest_euler +# ${app_name} -#### 介绍 -dde autotest case for openEuler +## 环境部署 -#### 软件架构 -软件架构说明 +```bash +pip3 install youqu3 +youqu3 envx +``` -#### 安装教程 +## Ruff -1. xxxx -2. xxxx -3. xxxx +## 安装 Ruff -#### 使用说明 +```bash +pip3 install ruff +``` -1. xxxx -2. xxxx -3. xxxx +### 代码检查 -#### 参与贡献 +```bash +ruff check . +``` -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +### 代码格式化 - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +```bash +ruff format . +``` \ No newline at end of file diff --git a/case/__init__.py b/case/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/case/assert_res/README.md b/case/assert_res/README.md new file mode 100644 index 0000000..5f38070 --- /dev/null +++ b/case/assert_res/README.md @@ -0,0 +1,3 @@ +# assert_res + +用例断言资源 \ No newline at end of file diff --git a/case/base_case.py b/case/base_case.py new file mode 100644 index 0000000..84f5fc1 --- /dev/null +++ b/case/base_case.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" +from method.assert_method import AssertMethod + + +class BaseCase(AssertMethod): + """用例基类""" diff --git a/case/test_mycase_001.py b/case/test_mycase_001.py new file mode 100644 index 0000000..c5cb19e --- /dev/null +++ b/case/test_mycase_001.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" +from case.base_case import BaseCase +from method.dde_autotest_euler_method import DdeAutotestEulerMethod + +class TestMyCase(BaseCase): + + def test_mycase_001(self): + """this is my test case title""" + # 用例步骤,调用方法层封装好的方法进行操作 + DdeAutotestEulerMethod().click_dde_file_manager_on_dock_by_attr() + # 在关键节点进行断言 + self.assert_true(True) diff --git a/case/test_mycase_002.py b/case/test_mycase_002.py new file mode 100644 index 0000000..0169556 --- /dev/null +++ b/case/test_mycase_002.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" +from case.base_case import BaseCase +from youqu3 import sleep +from youqu3.gui import pylinuxauto + +class TestMyCase(BaseCase): + + def test_mycase_002(self, check): + """快捷键 ctrl + alt + t 启动终端""" + # 用例步骤,调用方法层封装好的方法进行操作 + pylinuxauto.ctrl_alt_t() + # 在关键节点进行断言 + # 等待 2 秒,判断终端是否启动 + sleep(2) + check.assert_true(True) diff --git a/config.py b/config.py new file mode 100644 index 0000000..6f8c476 --- /dev/null +++ b/config.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +import pathlib + + +class _Config: + + ROOTDIR = pathlib.Path(__file__).parent + ASSERT_RES = ROOTDIR / "case/assert_res" + IMAGE_RES = ROOTDIR / "method/image_res" + STATIC_RES = ROOTDIR / "method/static_res" + + +config = _Config() diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..cbce23a --- /dev/null +++ b/conftest.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" +import pytest + +# fixtures diff --git a/env.sh b/env.sh new file mode 100644 index 0000000..77deca0 --- /dev/null +++ b/env.sh @@ -0,0 +1,7 @@ +python3-pyatspi + +pyscreenshot + + +python3-pillow +xdotool \ No newline at end of file diff --git a/method/__init__.py b/method/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/method/assert_method.py b/method/assert_method.py new file mode 100644 index 0000000..ce5f5c1 --- /dev/null +++ b/method/assert_method.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +from youqu3.assertx import Assert + + +class AssertMethod(Assert): + """AssertMethod""" diff --git a/method/base_method.py b/method/base_method.py new file mode 100644 index 0000000..12a6009 --- /dev/null +++ b/method/base_method.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" + +class BaseMethod: + """应用的方法基类""" + diff --git a/method/dde_autotest_euler_method.py b/method/dde_autotest_euler_method.py new file mode 100644 index 0000000..32129e7 --- /dev/null +++ b/method/dde_autotest_euler_method.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# _*_ coding:utf-8 _*_ +""" +:Author:uos +:Date :2024/08/22 13:15:47 +""" +import pylinuxauto +from funnylog2.config import config as funnylog2_config + +funnylog2_config.CLASS_NAME_ENDSWITH = ["Method"] + +from youqu3 import log +from youqu3.gui import pylinuxauto + + +from method.base_method import BaseMethod + + +@log +class DdeAutotestEulerMethod(BaseMethod): + """应用方法主类""" + + def click_dde_file_manager_on_dock_by_attr(self): + """在任务栏点击文件管理器""" + pylinuxauto.find_element_by_attr_path("/dde-dock/Btn_文件管理器").click() + + + +if __name__ == '__main__': + DdeAutotestEulerMethod().click_dde_file_manager_on_dock_by_attr() \ No newline at end of file diff --git a/method/image_res/README.md b/method/image_res/README.md new file mode 100644 index 0000000..5239ba2 --- /dev/null +++ b/method/image_res/README.md @@ -0,0 +1,3 @@ +# image_res + +用于图像识别定位的图片资源 \ No newline at end of file diff --git a/method/static_res/README.md b/method/static_res/README.md new file mode 100644 index 0000000..b95a396 --- /dev/null +++ b/method/static_res/README.md @@ -0,0 +1,3 @@ +# static_res + +用例执行需要用到的测试资源 \ No newline at end of file diff --git a/method/ui.ini b/method/ui.ini new file mode 100644 index 0000000..d4ba153 --- /dev/null +++ b/method/ui.ini @@ -0,0 +1,14 @@ +[播放按钮] +direction = left_bottom +location = 0, 0, 0, 0 + +# section 是你根据对应的元素按钮命名,你可以任意命名,但最好有具体含义,且能明确表示这个元素按钮的名称; + +# direction 是配置该元素的参考系,分别为: +# left_top 左上 +# left_bottom 左下 +# right_top 右上 +# right_bottom 右下 + +# location 是该元素按钮的相对与参考系的x, y的距离,及大小(w, h),这四个数据可以通过 UI 设计图上 +# 获取数据,在编辑模式下,点击 UI 图上的按钮,右侧就会出现该元素按钮的x, y, w, h数据。 diff --git a/mycase.csv b/mycase.csv new file mode 100644 index 0000000..14dcc0c --- /dev/null +++ b/mycase.csv @@ -0,0 +1,3 @@ +脚本ID,跳过原因,确认修复,废弃用例 +001, +002, diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..fb20844 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,18 @@ +[pytest] +addopts = + -s + --no-header + --verbosity=2 + --show-capture=no + --reruns-delay=1 + --color=auto + --code-highlight=yes + --tb=auto + -r fEs + --continue-on-collection-errors +filterwarnings = + ignore + ignore::UserWarning + ignore:.*U.*mode is deprecated:DeprecationWarning + +console_output_style = count diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1d57132 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +-i https://pypi.tuna.tsinghua.edu.cn/simple + +youqu3[gui] \ No newline at end of file diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..d1a61de --- /dev/null +++ b/ruff.toml @@ -0,0 +1,90 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + ".idea", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 100 +indent-width = 4 + +# Assume Python 3.7 +target-version = "py37" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = [ + "E402", + "E711", + "E721", + "E722", + "E731", + "E712", + "F401", + "F403", + "F507", + "F541", + "F841", +] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" \ No newline at end of file -- Gitee From cb5f296312d9f9c6501922ed6fc4b4e7077a7387 Mon Sep 17 00:00:00 2001 From: ut005790 Date: Fri, 23 Aug 2024 16:26:06 +0800 Subject: [PATCH 2/4] New commit 5 autotest project --- case/assert_res/firefox_icon_in_window.png | Bin 0 -> 789 bytes case/test_euler_1271309.py | 32 +++++++++++++++++ ...st_mycase_001.py => test_euler_1271311.py} | 19 ++++++---- case/test_euler_1271313.py | 33 +++++++++++++++++ case/test_euler_1271317.py | 33 +++++++++++++++++ case/test_mycase_002.py | 20 ----------- method/dde_autotest_euler_method.py | 34 +++++++++++++++--- .../image_res/all_categories_in_launcher.png | Bin 0 -> 1314 bytes .../image_res/back_in_all_categories_view.png | Bin 0 -> 703 bytes method/image_res/deepin_manager_cn.png | Bin 0 -> 1566 bytes method/image_res/launcher_icon_on_dock.png | Bin 0 -> 908 bytes method/image_res/launcher_window.png | Bin 0 -> 1782 bytes method/image_res/power_icon_on_dock.png | Bin 0 -> 692 bytes method/image_res/search_in_launcher.png | Bin 0 -> 1156 bytes .../system_manager_in_all_categories_view.png | Bin 0 -> 1528 bytes mycase.csv | 2 +- 16 files changed, 141 insertions(+), 32 deletions(-) create mode 100644 case/assert_res/firefox_icon_in_window.png create mode 100644 case/test_euler_1271309.py rename case/{test_mycase_001.py => test_euler_1271311.py} (33%) create mode 100644 case/test_euler_1271313.py create mode 100644 case/test_euler_1271317.py delete mode 100644 case/test_mycase_002.py create mode 100644 method/image_res/all_categories_in_launcher.png create mode 100644 method/image_res/back_in_all_categories_view.png create mode 100644 method/image_res/deepin_manager_cn.png create mode 100644 method/image_res/launcher_icon_on_dock.png create mode 100644 method/image_res/launcher_window.png create mode 100644 method/image_res/power_icon_on_dock.png create mode 100644 method/image_res/search_in_launcher.png create mode 100644 method/image_res/system_manager_in_all_categories_view.png diff --git a/case/assert_res/firefox_icon_in_window.png b/case/assert_res/firefox_icon_in_window.png new file mode 100644 index 0000000000000000000000000000000000000000..8b407dfce5c1c1af72129fb7089859a3135f2e51 GIT binary patch literal 789 zcmV+w1M2*VP)K)lFyf$ zf`Z~j5cH%L6cjxwo)x6vp%)L{#DfPB#TG$4s0gC?nS)X__QTRNCTVu_v74ReK@seS z@uMCD-))9BKOT=aGsMi8*AVl|{TKhb$YA;15ZpuNtsQ!|E|XrFiCCQ0Dp$5I?z$r?9v8xt2vADHt|i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Lihlk2^~8x2pFe+ADwTzW zg<7rl^5x4oGZu@nSgiH+bqvGG%gfi-*SEK~U%!6MKl{;waP#DKgssTab0}CSJgNhXjJ_aFfE+XQnSaIke zs6*}GB8ZDc=oEAk5i{xH=q7>=ilq<)$AF!jL{td)OsrxD!F#VJy?3y1x!nJBzVrRh z_se+(A_xL}v#!1y@SpM5G5F_Q{eJ)U_7;L5002$XtJP|`Tv8M@91eH8o!jl+@Ani% zeNj{*k??ptP6kcWrBcaavE1L^*X#9EDy7ruluD&sF2A|CQK?ikO>Z_Ex7+;%qgJcQ zWHL^MKp;pY66tgrMNt4iI2;azLMNWhW&;3dHk$~7oTMmcG_FwAH)o-0je5O47K`QcdB5K;m&>^deId^KvE6PvosL4G@OV6T zcX!ol)oQh#+ls{^ilQirRw@;)QY?FZP`BGf5JV!8l*?t3Bp)9iUtV4^nT%4YJbLVQ zd#lwthA<4z=kq^etk-J*K(E&e1OoART%*xsv)SwGYaWk>4!G_u)jTCH|47)Yg30D!~c_-%D|21$~3yWQvWy}!S| zzP?tg)!}eBnM}lDu}~-!iA2F*P$rY1D4IwlghJuT@Y!sJVc6BxFWU^A{|EQ`{o%2? llvvKyWdZDri|b!ud;$$M>b+9Eh;aY_002ovPDHLkV1nH*LE8WT literal 0 HcmV?d00001 diff --git a/method/image_res/deepin_manager_cn.png b/method/image_res/deepin_manager_cn.png new file mode 100644 index 0000000000000000000000000000000000000000..d45f79b244c873eca5ec5b40c2e5e2583de0a61e GIT binary patch literal 1566 zcmV+(2I2XMP)eHZY=M#pogkHyI84Lq&gvOIWdyCbpbYkMDPJ z=tb22L4EOk{jSdWo##By^LwA?9FMF(AOQbUu>W)dzY%}8Hkzhsn*JA3`Q`YIHiVEy zqj~V)LEhDPJZ?6dqtWPx4<7))X0ru@!Aye}FJ2rta3GydwnclLn=-b)|f~c>rzj*OtRaF&15Lv6EqoYrrJV6LmR#r|- zOx(YJf6JCF%qmUOH*ek?8yjnAXaE3#Kp>OJd_JF2sl*04o$k$>HwJ?NPn(*W91cfT zi1G39qN1Yi?rw|4f*FUy@&5gLqtS?`27{rcrR7Jp-MV$_@ZrN*VDl01+8XC&V${s&{JTo)%>eVZ^+wF8ZSFKtlm&=QbiF{_OMlZrr$GHk&a?({x)~n@Xjssi`R_C?HAl-o1M* zEiI28J?ii8KYjXimXp`7UoTp;sIjr}?c2AQ`Sj@%La4B?kg>Ua`?gRhjKyM%w%Xd- zEI+tzmoHyt>UQ$v$@%$tCb6HZn?N8C2n1WVZnfELp-@OFl>)%?=g+67r)z6#Ns`2= zV~?Rw$l-8!yljzbWU{-vyR@`4D?}s`*|>2d04yvlL?RK)Boc}0 z>gt}Jo~u`{u3WiNE|)VKo12@}YBd0ij*gx`fBxFFYhtl@WMo9E)s~f&?lh?fvT(P*@yqN2CAci+B!xqHu^J*!YC0HCk0Z((5pe|3zZp`ma% z+}hfTr{C?#!otF2GU@etj~+d0u~@3Bt7)3&XO<$6K;w2_AE~T#-mrR8*8@)7I9OS+~3x z9v%(^0#~kFVVL8`j|0H<>(?hICkF-w0KjB2nM@{%qUPr2D2l>ndcFSGv17Y;@BRsG z;c&R8r^n;*SS%JUm#fq19zJ}iR;#~uw7!8eXU=qWb!9T4Q0VU6yQQV26B84IgM)lN z|K-b-7L&wOUuKSbjSy<56;DgH)3 zg1Nc5cswo^i=)vfi^WQ%QUpN=g~CWA!r^chFJ7E?*KgPM2l03RfBWy^ADZLY#;oPE Qt^fc407*qoM6N<$f=u`b;{X5v literal 0 HcmV?d00001 diff --git a/method/image_res/launcher_icon_on_dock.png b/method/image_res/launcher_icon_on_dock.png new file mode 100644 index 0000000000000000000000000000000000000000..37e7cebfef1898714acab595c9afdd8e6b7a2189 GIT binary patch literal 908 zcmV;719SX|P)}<^}&Md484y;B&OwbDnA&~bDW#MO!%zqT0LGXkNunrBv5Kl%>vBWf`i8}=KBo1TxOknI3AH%bMc`z01W`Rw|ePl{cNSW2LRGv zv%8Buhh-8{CpPbk@(#%$W7Arr0Zg6@ExcE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rTKAsp`)WiEEWR*y1Kd`UjP6M!_;autww)&3=Itx78XJo$8ma}xw*L= z9UUAF2mI5HWoBlE!(jk`TrR(G;R0NmLka+Z&*v{S*CrC-!tkdc8^75cO zONu}s@caF-Wq)C?SS2z+{vSrPhH9ymT^5hA9QoLSoMMXvI zDvslNy}r7-nsyin1n3Cmayd-21VP-pchBv1b2yx=tSq%!J-<-QlEP#%MIzDY=;$K1 zBo>R8`MKSnM`SEXnBGK|cl(}4PettfbCnqPfva%Ek1srbOx|MFF;y@5YRaF&>#j35Xg&A#p ze7wHC{?MUA3WWkekWeV3R4M@gN~KaRmqRPN-LBW`w{PEm>eQ*++*~-R(P&&Q*NYb~ zy1Tm%9y~}VBgXtorbr}$Vc5@FeinLrPEOAJ zOQzMUS0^VYuhb>e!euTlFEE+R3BX`5mf6Ms8}T2%ZT&U; Y1^8S42+^^z$^ZZW07*qoM6N<$f|YPhkpKVy literal 0 HcmV?d00001 diff --git a/method/image_res/power_icon_on_dock.png b/method/image_res/power_icon_on_dock.png new file mode 100644 index 0000000000000000000000000000000000000000..3443594fc93d601032a5c54e71ebc707af10ee07 GIT binary patch literal 692 zcmV;l0!#ggP)P000^Y0ssI2%^zTz00009a7bBm000ie z000ie0hKEb8vpzmAMY$Fc5|vv|x~EIV7r3LSBLZ6$QKi2q$s*ci<|ZpbBRR;t1CkkxVwpE~^#APBs4H`Rp0ZIK*f)0$(!2w?JQJ z{rKGnNs?7`!A&vfuA}y|3o?gwT9G zpUq}U)^s{uEEWhMtJNwiq9_gq105FjlgZ@aa3~ZCuh&b-dc9tSLg9EkCX-1l4u?ZE zOL>J*D8#bt`FsW%JDpC=W-}BDX#?NADmNqm07B?=I+eY$+wGLN@p$ZXIw6GD>s1-3 z)As~H001l&3s$Pts&a$bY{uJ^_Ri5}v&qioa@lM)6h&!|k&U9L^?H4|TvUN?mdE44 zez)6=Mx(kz2O*5bV!d8Z8~A3?G>v_P(DV7MR4OVQgs@yL-|u&X5EgwtpX|KnQIe!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- .../assert_res/all_categories_in_launcher.png | Bin 0 -> 1314 bytes case/assert_res/deepin_manager_cn.png | Bin 0 -> 1566 bytes case/assert_res/keyboard_layout_hanyu.png | Bin 0 -> 829 bytes case/assert_res/launcher_window.png | Bin 0 -> 1782 bytes case/test_euler_1271309.py | 29 +++++---- case/test_euler_1271311.py | 8 +-- case/test_euler_1271313.py | 23 ++++--- case/test_euler_1271317.py | 35 ++++++----- config.py | 6 +- method/assert_method.py | 12 +++- method/dde_autotest_euler_method.py | 57 ++++++++++++------ .../add_keyboard_layout_confirm_icon.png | Bin 0 -> 769 bytes method/image_res/add_keyboard_layout_icon.png | Bin 0 -> 1301 bytes .../image_res/control_center_close_button.png | Bin 0 -> 390 bytes .../image_res/delete_keyboard_layout_icon.png | Bin 0 -> 374 bytes .../image_res/edit_icon_in_control_center.png | Bin 0 -> 717 bytes method/image_res/keyboard_layout_hanyu.png | Bin 0 -> 829 bytes .../keyboard_layout_in_control_center.png | Bin 0 -> 1413 bytes 18 files changed, 109 insertions(+), 61 deletions(-) create mode 100644 case/assert_res/all_categories_in_launcher.png create mode 100644 case/assert_res/deepin_manager_cn.png create mode 100644 case/assert_res/keyboard_layout_hanyu.png create mode 100644 case/assert_res/launcher_window.png create mode 100644 method/image_res/add_keyboard_layout_confirm_icon.png create mode 100644 method/image_res/add_keyboard_layout_icon.png create mode 100644 method/image_res/control_center_close_button.png create mode 100644 method/image_res/delete_keyboard_layout_icon.png create mode 100644 method/image_res/edit_icon_in_control_center.png create mode 100644 method/image_res/keyboard_layout_hanyu.png create mode 100644 method/image_res/keyboard_layout_in_control_center.png diff --git a/case/assert_res/all_categories_in_launcher.png b/case/assert_res/all_categories_in_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..42d2e72cf5db2500418acacc062cf31f0058d874 GIT binary patch literal 1314 zcmV+-1>O3IP)4R$oY3Z5V%yl+tw3Y-(j>(-m26>q0OQ8$%gv1tCE} z47%7_FetkSpQ zzf<|`gT6o8@9KG<=l49%?|n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nclLn=-b)|f~c>rzj*OtRaF&15Lv6EqoYrrJV6LmR#r|- zOx(YJf6JCF%qmUOH*ek?8yjnAXaE3#Kp>OJd_JF2sl*04o$k$>HwJ?NPn(*W91cfT zi1G39qN1Yi?rw|4f*FUy@&5gLqtS?`27{rcrR7Jp-MV$_@ZrN*VDl01+8XC&V${s&{JTo)%>eVZ^+wF8ZSFKtlm&=QbiF{_OMlZrr$GHk&a?({x)~n@Xjssi`R_C?HAl-o1M* zEiI28J?ii8KYjXimXp`7UoTp;sIjr}?c2AQ`Sj@%La4B?kg>Ua`?gRhjKyM%w%Xd- zEI+tzmoHyt>UQ$v$@%$tCb6HZn?N8C2n1WVZnfELp-@OFl>)%?=g+67r)z6#Ns`2= zV~?Rw$l-8!yljzbWU{-vyR@`4D?}s`*|>2d04yvlL?RK)Boc}0 z>gt}Jo~u`{u3WiNE|)VKo12@}YBd0ij*gx`fBxFFYhtl@WMo9E)s~f&?lh?fvT(P*@yqN2CAci+B!xqHu^J*!YC0HCk0Z((5pe|3zZp`ma% z+}hfTr{C?#!otF2GU@etj~+d0u~@3Bt7)3&XO<$6K;w2_AE~T#-mrR8*8@)7I9OS+~3x z9v%(^0#~kFVVL8`j|0H<>(?hICkF-w0KjB2nM@{%qUPr2D2l>ndcFSGv17Y;@BRsG z;c&R8r^n;*SS%JUm#fq19zJ}iR;#~uw7!8eXU=qWb!9T4Q0VU6yQQV26B84IgM)lN z|K-b-7L&wOUuKSbjSy<56;DgH)3 zg1Nc5cswo^i=)vfi^WQ%QUpN=g~CWA!r^chFJ7E?*KgPM2l03RfBWy^ADZLY#;oPE Qt^fc407*qoM6N<$f=u`b;{X5v literal 0 HcmV?d00001 diff --git a/case/assert_res/keyboard_layout_hanyu.png b/case/assert_res/keyboard_layout_hanyu.png new file mode 100644 index 0000000000000000000000000000000000000000..f85167fdd5a60a4bec9ff9f1b14c12a38d83d326 GIT binary patch literal 829 zcmV-D1H$}?P)i+-#&&bHgz`*eC z!zV$0UPea7&!4|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F00x6$F@718jS#eOP4Oi+V=PNGZ>6WBy#@zc>q9hadB)}T(@prX=!PFeSKS7+xqqE zA-Q8?V=XN$-@bk0a5zjR^YG!rMMXs{)|}QPar0&}nQ$C``}XagJ$rh3dfaZe)oPW= zWPN>oE|&`cK$EgeP!z@Ga+8vhAhQHPG&MC978WX%O1)m6ot+H;7#J8hefl&2;L)Q; z0)YS;Vi;CgSqbG&pFSZ7GBh-#QmNwnmz0$3-n|>950A%VwOXG(ecIUAI5;?nqG*18 z{@uHGA3l6oTU)zn)24V*;;5>rsTm#~-mzl`06?u)_x1I`GX{T)i;JNegTaV1Tq=UW zAbqM^TU-5pzeFNQO-%&=q@<*9x!l*UUpF)~T)uqy%$YO$_U%jPWb@|DEiEmu&+hE( zlt?6y9h=Q&Hk(hJH~|1~I-QM;ja5}uH*eldNl6(P7{GBnGc)ttxpS{xy=rS~yK?0U z-I22B?V%`2rTKAsp`)WiEEWR*y1Kd`UjP6M!_;autww)&3=Itx78XJo$8ma}xw*L= z9UUAF2mI5HWoBlE!(jk`TrR(G;R0NmLka+Z&*v{S*CrC-!tkdc8^75cO zONu}s@caF-Wq)C?SS2z+{vSrPhH9ymT^5hA9QoLSoMMXvI zDvslNy}r7-nsyin1n3Cmayd-21VP-pchBv1b2yx=tSq%!J-<-QlEP#%MIzDY=;$K1 zBo>R8`MKSnM`SEXnBGK|cl(}4PettfbCnqPfva%Ek1srbOx|MFF;y@5YRaF&>#j35Xg&A#p ze7wHC{?MUA3WWkekWeV3R4M@gN~KaRmqRPN-LBW`w{PEm>eQ*++*~-R(P&&Q*NYb~ zy1Tm%9y~}VBgXtorbr}$Vc5@FeinLrPEOAJ zOQzMUS0^VYuhb>e!euTlFEE+R3BX`5mf6Ms8}T2%ZT&U; Y1^8S42+^^z$^ZZW07*qoM6N<$f|YPhkpKVy literal 0 HcmV?d00001 diff --git a/case/test_euler_1271309.py b/case/test_euler_1271309.py index 93ef80d..7b4027e 100644 --- a/case/test_euler_1271309.py +++ b/case/test_euler_1271309.py @@ -1,6 +1,6 @@ from case.base_case import BaseCase from youqu3 import sleep -from method.dde_autotest_euler_method import DdeAutotestEulerMethod +from method.dde_autotest_euler_method import DdeMethod from youqu3.gui import pylinuxauto @@ -8,25 +8,28 @@ class TestMyCase(BaseCase): def test_euler_1271313_1(self): """open launcher on dock""" - euler=DdeAutotestEulerMethod() - euler.click_launcher_on_doc_by_img() - - # 等待 1 秒,判断launcher是否启动 + euler=DdeMethod() + euler.dde_method_click_launcher_on_dock_by_img() sleep(1) - self.assert_image_exist("~/dde_autotest_euler/method/image_res/launcher_window.png") + # 等待 1 秒,判断launcher是否启动 + self.assert_image_exist_in_dde("launcher_window.png") + sleep(3) + euler.dde_method_click_launcher_on_dock_by_img() sleep(1) - euler.click_launcher_on_doc_by_img() - self.assert_image_not_exist("~/dde_autotest_euler/method/image_res/launcher_window.png") + self.assert_image_not_exist_in_dde("launcher_window.png") + sleep(3) + + def test_euler_1271313_2(self): """open launcher on dock""" pylinuxauto.win() - - # 等待 1 秒,判断launcher是否启动 sleep(1) - self.assert_image_exist("~/dde_autotest_euler/method/image_res/launcher_window.png") + # 等待 1 秒,判断launcher是否启动 + self.assert_image_exist_in_dde("launcher_window.png") - sleep(1) + sleep(3) pylinuxauto.win() - self.assert_image_not_exist("~/dde_autotest_euler/method/image_res/launcher_window.png") \ No newline at end of file + sleep(1) + self.assert_image_not_exist_in_dde("launcher_window.png") diff --git a/case/test_euler_1271311.py b/case/test_euler_1271311.py index ce027e8..30f8c60 100644 --- a/case/test_euler_1271311.py +++ b/case/test_euler_1271311.py @@ -6,7 +6,7 @@ """ from case.base_case import BaseCase from youqu3 import sleep -from method.dde_autotest_euler_method import DdeAutotestEulerMethod +from method.dde_autotest_euler_method import DdeMethod from youqu3.gui import pylinuxauto @@ -14,11 +14,11 @@ class TestMyCase(BaseCase): def test_euler_1271311(self): """open browser in launcher""" - euler=DdeAutotestEulerMethod() - euler.search_software_in_dock() + euler=DdeMethod() + euler.dde_method_search_software_in_dock() pylinuxauto.input_message("Firefox") pylinuxauto.enter() # 等待 10 秒,判断browser是否启动 sleep(10) - self.assert_image_exist("~/dde_autotest_euler/case/assert_res/firefox_icon_in_window.png") + self.assert_image_exist_in_dde("firefox_icon_in_window.png") diff --git a/case/test_euler_1271313.py b/case/test_euler_1271313.py index 4e918fb..07a716d 100644 --- a/case/test_euler_1271313.py +++ b/case/test_euler_1271313.py @@ -4,10 +4,11 @@ :Author:uos :Date :2024/08/22 13:15:47 """ +import pytest from case.base_case import BaseCase from youqu3 import sleep -from method.dde_autotest_euler_method import DdeAutotestEulerMethod +from method.dde_autotest_euler_method import DdeMethod from youqu3.gui import pylinuxauto @@ -15,19 +16,27 @@ class TestMyCase(BaseCase): def test_euler_1271313_1(self): """click launcher icon on dock""" - euler=DdeAutotestEulerMethod() - euler.click_launcher_on_doc_by_img() + euler=DdeMethod() + euler.dde_method_click_launcher_on_dock_by_img() # 等待 1 秒,判断launcher是否启动 sleep(1) - self.assert_image_exist("~/dde_autotest_euler/method/image_res/launcher_window.png") - euler.click_launcher_on_doc_by_img() + self.assert_image_exist_in_dde("launcher_window.png") + sleep(1) + euler.dde_method_click_launcher_on_dock_by_img() def test_euler_1271313_2(self): """open launcher on dock""" - sleep(1) + sleep(2) pylinuxauto.win() # 等待 1 秒,判断launcher是否启动 sleep(1) - self.assert_image_exist("~/dde_autotest_euler/method/image_res/launcher_window.png") \ No newline at end of file + self.assert_image_exist_in_dde("launcher_window.png") + sleep(1) + + @pytest.fixture(scope="function", autouse=True) + def tear_down(self): + yield + sleep(1) + pylinuxauto.win() \ No newline at end of file diff --git a/case/test_euler_1271317.py b/case/test_euler_1271317.py index d3b6195..287ef59 100644 --- a/case/test_euler_1271317.py +++ b/case/test_euler_1271317.py @@ -2,32 +2,37 @@ import pytest from case.base_case import BaseCase from youqu3 import sleep -from method.dde_autotest_euler_method import DdeAutotestEulerMethod +from method.dde_autotest_euler_method import DdeMethod + class TestMyCase(BaseCase): def test_euler_1271313_1(self): """check launcher all categories""" - euler=DdeAutotestEulerMethod() - euler.click_all_categories_in_launcher() + euler=DdeMethod() + euler.dde_method_click_all_categories_in_launcher() sleep(1) - self.assert_image_exist("~/dde_autotest_euler/method/image_res/all_categories_in_launcher.png") + self.assert_image_exist_in_dde("all_categories_in_launcher.png") sleep(1) - euler.click_back_in_all_categories_view() - self.assert_image_exist("~/dde_autotest_euler/method/image_res/launcher_window.png") - + euler.dde_method_click_back_in_all_categories_view() + sleep(1) + self.assert_image_exist_in_dde("launcher_window.png") + sleep(2) - def test_euler_1271313_2(self): - euler = DdeAutotestEulerMethod() - euler.click_all_categories_in_launcher() - euler.click_system_manager_in_all_categories_view() - self.assert_image_exist("~/dde_autotest_euler/method/image_res/deepin_manager_cn.png") + def test_euler_1271313_2(self, teardown): + euler=DdeMethod() + euler.dde_method_click_all_categories_in_launcher() + sleep(3) + euler.dde_method_click_system_manager_in_all_categories_view() + sleep(3) + self.assert_image_exist_in_dde("deepin_manager_cn.png") - @pytest.fixture(scope="function", autouse=True) - def tear_down(self): + @pytest.fixture(scope="function") + def teardown(self): yield - DdeAutotestEulerMethod().click_launcher_on_doc_by_img() \ No newline at end of file + sleep(1) + DdeMethod().dde_method_click_launcher_on_dock_by_img() \ No newline at end of file diff --git a/config.py b/config.py index 6f8c476..d8cae67 100644 --- a/config.py +++ b/config.py @@ -6,14 +6,16 @@ """ import pathlib - - +import os class _Config: ROOTDIR = pathlib.Path(__file__).parent ASSERT_RES = ROOTDIR / "case/assert_res" IMAGE_RES = ROOTDIR / "method/image_res" STATIC_RES = ROOTDIR / "method/static_res" + BASE_PATH = os.getcwd() config = _Config() + + diff --git a/method/assert_method.py b/method/assert_method.py index ce5f5c1..7c31694 100644 --- a/method/assert_method.py +++ b/method/assert_method.py @@ -4,9 +4,19 @@ :Author:uos :Date :2024/08/22 13:15:47 """ - +from dbus.decorators import method from youqu3.assertx import Assert +from config import config class AssertMethod(Assert): """AssertMethod""" + + @classmethod + def assert_image_exist_in_dde(cls, img_name, rate=0.8): + cls.assert_image_exist(f"{config.ASSERT_RES}/{img_name}", rate=rate) + + @classmethod + def assert_image_not_exist_in_dde(cls, img_name, rate=0.8): + cls.assert_image_not_exist(f"{config.ASSERT_RES}/{img_name}", rate=rate) + diff --git a/method/dde_autotest_euler_method.py b/method/dde_autotest_euler_method.py index 85c4576..7c404d1 100644 --- a/method/dde_autotest_euler_method.py +++ b/method/dde_autotest_euler_method.py @@ -4,51 +4,70 @@ :Author:uos :Date :2024/08/22 13:15:47 """ +from time import sleep from funnylog2.config import config as funnylog2_config -from pylinuxauto import find_element_by_attr_path, find_element_by_ocr - funnylog2_config.CLASS_NAME_ENDSWITH = ["Method"] + from youqu3 import log from youqu3.gui import pylinuxauto +from config import config from method.base_method import BaseMethod @log -class DdeAutotestEulerMethod(BaseMethod): +class DdeMethod(BaseMethod): """应用方法主类""" - def click_dde_file_manager_on_dock_by_attr(self): + def dde_method_click_dde_file_manager_on_dock_by_attr(self): """在任务栏点击文件管理器""" pylinuxauto.find_element_by_attr_path("/dde-dock/Btn_文件管理器").click() - def click_power_on_dock_by_attr(self): - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/power_icon_on_dock.png").click() + def dde_method_click_power_on_dock_by_attr(self): + DdeMethod().dde_method_click_by_img("power_icon_on_dock.png") + + + def dde_method_click_launcher_on_dock_by_img(self): + DdeMethod().dde_method_click_by_img("launcher_icon_on_dock.png") + + + def dde_method_search_software_in_dock(self): + DdeMethod().dde_method_click_by_img("launcher_icon_on_dock.png") + DdeMethod().dde_method_click_by_img("search_in_launcher.png") + + + def dde_method_click_all_categories_in_launcher(self): + DdeMethod().dde_method_click_by_img("launcher_icon_on_dock.png") + DdeMethod().dde_method_click_by_img("launcher_window.png") + + def dde_method_click_back_in_all_categories_view(self): + DdeMethod().dde_method_click_by_img("back_in_all_categories_view.png") + + def dde_method_click_system_manager_in_all_categories_view(self): + DdeMethod().dde_method_click_by_img("system_manager_in_all_categories_view.png") - def click_launcher_on_doc_by_img(self): - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/launcher_icon_on_dock.png").click() + def dde_method_open_control_center_by_dock(self): + pylinuxauto.find_element_by_attr_path("/dde-dock/Btn_控制中心").click() - def search_software_in_dock(self): - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/launcher_icon_on_dock.png").click() - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/search_in_launcher").click() + def dde_method_click_keyboard_and_language_in_control_center(self): + pylinuxauto.find_element_by_attr_path("/dde-control-center/DMainWindow/contentwindow/键盘和语言").click() - def click_all_categories_in_launcher(self): - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/launcher_icon_on_dock.png").click() - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/launcher_window.png").click() + def dde_method_click_keyboard_layout_in_control_center(self): + DdeMethod().dde_method_click_by_img("keyboard_layout_in_control_center.png") - def click_back_in_all_categories_view(self): - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/back_in_all_categories_view.png").click() + def dde_method_close_control_center_by_window(self): + DdeMethod().dde_method_click_by_img("control_center_close_button.png") - def click_system_manager_in_all_categories_view(self): - pylinuxauto.find_element_by_image("~/dde_autotest_euler/method/image_res/back_in_all_categories_view.png").click() + def dde_method_click_by_img(self, img_name): + pylinuxauto.find_element_by_image(f"{config.IMAGE_RES}/{img_name}").click() if __name__ == '__main__': - DdeAutotestEulerMethod().click_all_categories_in_launcher() \ No newline at end of file + sleep(2) diff --git a/method/image_res/add_keyboard_layout_confirm_icon.png b/method/image_res/add_keyboard_layout_confirm_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..712181fd74a9aa78bf3eeb813357ac5a92da4bd1 GIT binary patch literal 769 zcmV+c1OEJpP)Cm0w6xaTLctZgV;{C)%c2Y7R}ak_yAXQK>I#ey}|(%bxSs-q}$F&~=igF3MVc(aYN@&0UaR^`2s*?=|N>9TSq`l69ACAT645GxbL>=)H%< zMxS(Z7w2AM8sO%BK7FTin2UQ6+}IqXJS0y~ZIQ1Z5^RZpFiSx?dr~=GM{Fo}57T6! z#=`YHW@fqcl2HMxfK}k0nlB^RoQNRI01HM(rmG4>{CcI8+(%TjFgQi25&I+>H5(%- zYa}^_(;3)Y-b`%>1LK4S;&RVdDb6z`#OGWg6YUYusAxV$d=zJ&vniJN2wKN^+D=w7 z)%y@3MMI#H9tUA+1h=1BW%T7{EGLpHg;bjeRa3SLAj?2wED2G(>ZY;-5t6ldJbeB| zK@d|e|7^*g&;1U5{a`ACW1Rm$RuXS|K;);Bok=`yB|n}1NkoyXIEEek_7I_ALhzzQ z(f1(Za(ird3g%vJ7*Q&?(+TkP2ksf1(~M71vK1gRk&k@DJ0w@(^M-s1<5%!wo zj2(!^py$F1raf4OSffU%Koq&%Lc5IzZ?W3R*Rd^u1`GK*Hm}2E1<-}lc| zoYb{ZZv)8l&{oRC6sCUfiMbn~Dw{SdY8B5;U~^F0$re49elnks9m%aigju=o9T0qV zS=%Hrh+Y>F3LKtA-(Bt=`{n|$FCP34*vqj$O59MFyZmq900000NkvXXu0mjfLNrsw literal 0 HcmV?d00001 diff --git a/method/image_res/add_keyboard_layout_icon.png b/method/image_res/add_keyboard_layout_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b305edbcd1d7b5a7e906997402b4bf657ae89963 GIT binary patch literal 1301 zcmV+w1?u{VP)brJcreP@ZaV(t zVv2OW^wM#Qx0=}cGObIPSA|wc*=i-UjKPDUG>5Noq%%lmvQ#^?t)gueH8BKK8FJ6m z@`ciQPTb)0EA)>(k5HHw6MVLgk6tBim6n@W%Rg$j2ibm_uD>c33e)lur?<197Ojez zO`zo&@*cn5<=xZVuQ;UtQdh+f+gURoOP)Dxz#=i@oQjODN2-Rz6rZab{y$eoj~Ku=)FG%qfhcIlqgw4cIb%&g6+x-jEt% z=b0ID0v66-Vke(-w}QbpAj4TM-;UY{ zfJ-SJWrFdNpL)x>rkerMc`l}K4H)F-zNmFVT)rKQm)v?7wM&Se0bGM;kkmlbE+Kj! z;(B-n8O%iO5@IM5Y+Y9QcMT;s%pxyP2g`bk;T#6clM9>w8&okD0wRjdi=#FIU{f=q&#D7>Jw-wY!F(oh5aj;H>;v`E1|B6{VT8~l$KW5n%X#R zuScfUwu;&~jvnhsL@6wVt=Zke()tLTme%ur3$}i$h!X{(u!I_iZ@10#p{%RokA!e~_8DDM0p3XCpBOHE*_g*1pVaWvb?gS-e#^rII-|w*JEDs(}z0=%T z9B*ZH1G6k*x>QN&<5!g#mrS0X0rqt8$Ni~vT3W~Ptu!Zz6`V>}x;}npIgd=9;T+#} zaio(671vDjs`&IZcDGP%6SJ^oG6lGgUwUO-vMyz03J{ImtM2 zjiV>{>XoJS#LV@RbIG{$k8q)f3%y+JBV9)A8`G?7WaC0MHB+A;rm=M};KiMaX;JuX z%rBv{E_sivOU~m_hAVyic9+x;eFOZH4N^?l)HpOIX_~|8`K)hbb_`2!1Y6^1EQL}N z57Q*H0y%?6a1ZX8pd-k8xL)wsw};^U{A(sHV}C^<3N7XSJO=y=;XURg)B*Hd00000 LNkvXXu0mjfH8^Pu literal 0 HcmV?d00001 diff --git a/method/image_res/control_center_close_button.png b/method/image_res/control_center_close_button.png new file mode 100644 index 0000000000000000000000000000000000000000..6916acc1ae73cd3e258205b8a46bb4601b1b32c0 GIT binary patch literal 390 zcmV;10eSw3P)X0ssI2puDL!00009a7bBm000ie z000ie0hKEb8vp*ls!%ZF%X5{Gj7sz7(_)EfubM*;Tjv9TOi^5+#^vC zQW7KtH2hqFJ3uHmMI57rx_6jXh!8}6_Xa-U7dD6 z0D$&Qu%Tlsk@tFc5~vkL{CG;Q*K$fCP8&EmGw?X>tn0A$VK? zr-v$Ok=BnbkQS4SysVPHLZkV=`90D=rfGurMBns(2EoxP83xw2R4H=51AsdmtPm#4 zTofVA&%4l?mnCZ&aPB2BHF>V31il))Mri$Yz0%t)5ZlJ__vz$QR=eP38TJDJRf<>D zsF$Yg^>~sH|mOhajj@oBVTg-~WCuTOp6fs_Sxj_MOjYv$sw{ zwx{s5q;R{Pza)R=tK5E%q_9G4pKOx^L6|H9y6t2rHED_Y46+%ntSFkgyDpuEEEt0<|w3NVD5HVNBk#!yI`{me^#H6X8{}05!^nt(D52jjp UNXvR|oB#j-07*qoM6N<$g3M5&zW@LL literal 0 HcmV?d00001 diff --git a/method/image_res/edit_icon_in_control_center.png b/method/image_res/edit_icon_in_control_center.png new file mode 100644 index 0000000000000000000000000000000000000000..11996cdd9fc6ce856dd29e4b09f516af54d53dfa GIT binary patch literal 717 zcmV;;0y6!HP)jlv_xXVI0PP-!`4o&D5z2(^)!mT8pkSLqd>YX&`|Y zLKoe7V_0B!-GovYMBr@~N^}uH#iGL?P$9^(X){7yV#yAcuDLvH`}TcZByIZ=I$%9_ z|L6VlRH8t?6Lffq8Z$56Q)mEC z3CgnS53)y#V-88?njN6FBxymG5rhP&%gf9vm3b@#IaAKl1zMjdp@P7e7yAJo&l47D zcPbZ}EHqdXpuVr@)I6A_$%0xSTg!F3GQ#X9Tr0R%0NR~gI>y~MT&)8b`M`vi1}lK@ z<3)u37AUx)jbI!JLgJ$dnIYa0y`8 zhb#lwEv!fIhnW3LRKnrrY#Ga&Tzno+s)QQTSqyOhEisv31e+0~PMLJTjl+!qYJqc= zq^OgUj(ZU$G^zw>znf7njb-f1r1K><6P`6?tyN}@79h#o9AdA5?jbZPItK_w2t|dR3HtVd|6ATy2C4T`hK%V65i$`&R)dM$u&4WKlap3{UyBpI!m*B&N) zG~1GI|Mw-yghg~INoF*LC~cd61O27`$$$C{ZFl{=v;lHF00000NkvXXu0mjfCsH(& literal 0 HcmV?d00001 diff --git a/method/image_res/keyboard_layout_hanyu.png b/method/image_res/keyboard_layout_hanyu.png new file mode 100644 index 0000000000000000000000000000000000000000..f85167fdd5a60a4bec9ff9f1b14c12a38d83d326 GIT binary patch literal 829 zcmV-D1H$}?P)i+-#&&bHgz`*eC z!zV$0UPea7&!4|CFfyVktIbo5o5PwNdbb3+8`wySdESS_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S8U7 zmnwSt1OlEOApqd>Yy<)xm&-9l9U6Y-KFg)Kt?OuRsmYl7@fPRT9ob9p^s6unyBlg!=DJ*a84KC(Z+aR;#nOT8+rNJs8jY6CW}CM_bKnF)qf#jp3rq_tUqSpg{xAOo7ByL# TWu!D#00000NkvXXu0mjfD&3@? literal 0 HcmV?d00001 -- Gitee From 7981ea8bb3df757353eb33fb51b7556707800707 Mon Sep 17 00:00:00 2001 From: ut005790 Date: Mon, 26 Aug 2024 17:32:38 +0800 Subject: [PATCH 4/4] Basic framework --- case/test_euler_1271309.py | 35 ------------------------------- case/test_euler_1271311.py | 24 ---------------------- case/test_euler_1271313.py | 42 -------------------------------------- case/test_euler_1271317.py | 38 ---------------------------------- 4 files changed, 139 deletions(-) delete mode 100644 case/test_euler_1271309.py delete mode 100644 case/test_euler_1271311.py delete mode 100644 case/test_euler_1271313.py delete mode 100644 case/test_euler_1271317.py diff --git a/case/test_euler_1271309.py b/case/test_euler_1271309.py deleted file mode 100644 index 7b4027e..0000000 --- a/case/test_euler_1271309.py +++ /dev/null @@ -1,35 +0,0 @@ -from case.base_case import BaseCase -from youqu3 import sleep -from method.dde_autotest_euler_method import DdeMethod -from youqu3.gui import pylinuxauto - - -class TestMyCase(BaseCase): - - def test_euler_1271313_1(self): - """open launcher on dock""" - euler=DdeMethod() - euler.dde_method_click_launcher_on_dock_by_img() - sleep(1) - # 等待 1 秒,判断launcher是否启动 - self.assert_image_exist_in_dde("launcher_window.png") - - sleep(3) - euler.dde_method_click_launcher_on_dock_by_img() - sleep(1) - self.assert_image_not_exist_in_dde("launcher_window.png") - sleep(3) - - - - def test_euler_1271313_2(self): - """open launcher on dock""" - pylinuxauto.win() - sleep(1) - # 等待 1 秒,判断launcher是否启动 - self.assert_image_exist_in_dde("launcher_window.png") - - sleep(3) - pylinuxauto.win() - sleep(1) - self.assert_image_not_exist_in_dde("launcher_window.png") diff --git a/case/test_euler_1271311.py b/case/test_euler_1271311.py deleted file mode 100644 index 30f8c60..0000000 --- a/case/test_euler_1271311.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 -# _*_ coding:utf-8 _*_ -""" -:Author:uos -:Date :2024/08/22 13:15:47 -""" -from case.base_case import BaseCase -from youqu3 import sleep -from method.dde_autotest_euler_method import DdeMethod -from youqu3.gui import pylinuxauto - - -class TestMyCase(BaseCase): - - def test_euler_1271311(self): - """open browser in launcher""" - euler=DdeMethod() - euler.dde_method_search_software_in_dock() - pylinuxauto.input_message("Firefox") - pylinuxauto.enter() - # 等待 10 秒,判断browser是否启动 - sleep(10) - self.assert_image_exist_in_dde("firefox_icon_in_window.png") - diff --git a/case/test_euler_1271313.py b/case/test_euler_1271313.py deleted file mode 100644 index 07a716d..0000000 --- a/case/test_euler_1271313.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 -# _*_ coding:utf-8 _*_ -""" -:Author:uos -:Date :2024/08/22 13:15:47 -""" -import pytest - -from case.base_case import BaseCase -from youqu3 import sleep -from method.dde_autotest_euler_method import DdeMethod -from youqu3.gui import pylinuxauto - - -class TestMyCase(BaseCase): - - def test_euler_1271313_1(self): - """click launcher icon on dock""" - euler=DdeMethod() - euler.dde_method_click_launcher_on_dock_by_img() - - # 等待 1 秒,判断launcher是否启动 - sleep(1) - self.assert_image_exist_in_dde("launcher_window.png") - sleep(1) - euler.dde_method_click_launcher_on_dock_by_img() - - def test_euler_1271313_2(self): - """open launcher on dock""" - sleep(2) - pylinuxauto.win() - - # 等待 1 秒,判断launcher是否启动 - sleep(1) - self.assert_image_exist_in_dde("launcher_window.png") - sleep(1) - - @pytest.fixture(scope="function", autouse=True) - def tear_down(self): - yield - sleep(1) - pylinuxauto.win() \ No newline at end of file diff --git a/case/test_euler_1271317.py b/case/test_euler_1271317.py deleted file mode 100644 index 287ef59..0000000 --- a/case/test_euler_1271317.py +++ /dev/null @@ -1,38 +0,0 @@ -import pytest - -from case.base_case import BaseCase -from youqu3 import sleep -from method.dde_autotest_euler_method import DdeMethod - - - -class TestMyCase(BaseCase): - - def test_euler_1271313_1(self): - """check launcher all categories""" - euler=DdeMethod() - euler.dde_method_click_all_categories_in_launcher() - sleep(1) - self.assert_image_exist_in_dde("all_categories_in_launcher.png") - - sleep(1) - euler.dde_method_click_back_in_all_categories_view() - sleep(1) - self.assert_image_exist_in_dde("launcher_window.png") - sleep(2) - - - def test_euler_1271313_2(self, teardown): - euler=DdeMethod() - euler.dde_method_click_all_categories_in_launcher() - sleep(3) - euler.dde_method_click_system_manager_in_all_categories_view() - sleep(3) - self.assert_image_exist_in_dde("deepin_manager_cn.png") - - - @pytest.fixture(scope="function") - def teardown(self): - yield - sleep(1) - DdeMethod().dde_method_click_launcher_on_dock_by_img() \ No newline at end of file -- Gitee