-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rmicheev
committed
Jan 12, 2024
1 parent
142bc72
commit 3af09bf
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ pyperclip==1.8.2 | |
pytesseract==0.3.10 | ||
pytest==7.2.2 | ||
python_Levenshtein==0.20.9 | ||
qat==0.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import qat | ||
from typing import Optional | ||
from pygats.pygats import step, passed, failed | ||
|
||
|
||
def register_application(name='', path='', args=''): | ||
qat.register_application(name=name, path=path, args=args) | ||
|
||
|
||
def start_application(ctx, name='', args=''): | ||
step(ctx, f'Запуск приложения {name}') | ||
app_ctx = qat.start_application(app_name=name, args=args) | ||
qat.unlock_application() | ||
passed() | ||
return app_ctx | ||
|
||
|
||
def close_application(ctx, app_context): | ||
step(ctx, 'Закрытие приложения ...') | ||
qat.close_application(app_context) | ||
passed() | ||
|
||
|
||
def typewrite(ctx, object: dict, message, count = 1): | ||
step(ctx, f'Набрать на клавиатуре {message} ...') | ||
for i in range(count): | ||
qat.type_in(object, message) | ||
passed() | ||
|
||
|
||
def click_left_button(ctx, object: dict, x = None, y = None, clicks: Optional[int] = 1): | ||
step(ctx, 'Нажать левую кнопку мыши ...') | ||
qat.mouse_click(object, x, y) | ||
passed() | ||
|
||
|
||
def find_object(ctx, definition: dict): | ||
step(ctx, 'Поиск объекта ...') | ||
object = qat.wait_for_object_exists(definition) | ||
passed() | ||
return object | ||
|
||
|
||
def find_all_objects(ctx, definition: dict): | ||
step(ctx, 'Поиск всех объектов, соответствующих данному определению ...') | ||
objects = qat.find_all_objects(definition) | ||
passed() | ||
return objects | ||
|
||
|
||
# def list_top_windows(): | ||
# return qat.list_top_windows() |