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

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mikigo committed Jul 18, 2024
1 parent 71fa6d1 commit 1ca8683
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
10 changes: 10 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-i https://pypi.tuna.tsinghua.edu.cn/simple

pytest-timeout
pytest-rerunfailures
pytest-mark-manage
allure-pytest
pytest-json-report
funnylog2
click
pexpect
2 changes: 2 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ def test_001():
pylinuxauto.find_element_by_attr_path("/dde-dock/Btn_文件管理器").click()
pylinuxauto.find_element_by_ocr()



if __name__ == '__main__':
pytest.main()
4 changes: 4 additions & 0 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pytest

def test_gui_001(gui):
...
10 changes: 5 additions & 5 deletions youqu3/dbus.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from youqu3.exceptions import YouQuPluginDependencyError

try:
from youqu_dbus import DbusUtils as Dbus
from pydbussend import PyDBusSend as Dbus

HAS_YOUQU_DBUS = True
HAS_PYDBUSSEND = True
except ImportError:
HAS_YOUQU_DBUS = False
HAS_PYDBUSSEND = False

if HAS_YOUQU_DBUS is False:
raise YouQuPluginDependencyError("youqu-dbus")
if HAS_PYDBUSSEND is False:
raise YouQuPluginDependencyError("pydbussend")
20 changes: 19 additions & 1 deletion youqu3/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def pytest_sessionstart(session):


def pytest_runtest_setup(item):
print("-")
print()


@pytest.fixture(scope='module')
Expand Down Expand Up @@ -65,3 +65,21 @@ def slaves(pytestconfig):
if not s:
raise EnvironmentError("No slaves found, check -s/--slaves value")
return s


@pytest.fixture(scope="session")
def gui():
from youqu3.gui import pylinuxauto
return pylinuxauto


@pytest.fixture(scope="session")
def sleep():
from youqu3.sleepx import sleep as slp
return slp


@pytest.fixture(scope="session")
def cmd():
from youqu3.cmd import Cmd
return Cmd

0 comments on commit 1ca8683

Please sign in to comment.