Skip to content

Commit 19f1dc2

Browse files
authored
Merge pull request #20 from JE-Chen/dev
Dev
2 parents 1f29bfc + 5b84f1d commit 19f1dc2

File tree

31 files changed

+218
-80
lines changed

31 files changed

+218
-80
lines changed

.idea/workspace.xml

Lines changed: 17 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
---
44

5+
### JE Auto Control as a tool for GUI Testing
6+
#### Features
7+
* Image Detect
8+
* Keyboard Event
9+
* Mouse Event
10+
* Screen
11+
* Action File
12+
* Record Event
13+
* CLI with action file
14+
* timeout
15+
16+
---
17+
518
[![CircleCI](https://circleci.com/gh/JE-Chen/AutoControl/tree/main.svg?style=svg)](https://circleci.com/gh/JE-Chen/AutoControl/tree/main)
619

720
### Documentation

dev_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="je_auto_control_dev",
8-
version="0.0.07",
8+
version="0.0.08",
99
author="JE-Chen",
1010
author_email="[email protected]",
1111
description="auto testing",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
AutoControlGUI Critical Exit Doc
2+
==========================
3+
4+
.. code-block:: python
5+
6+
class CriticalExit(Thread):
7+
"""
8+
use to make program interrupt
9+
"""
10+
11+
def __init__(self, default_daemon: bool = True):
12+
"""
13+
default interrupt is keyboard F7 key
14+
:param default_daemon bool thread setDaemon
15+
"""
16+
17+
def set_critical_key(self, keycode: [int, str] = None):
18+
"""
19+
set interrupt key
20+
:param keycode interrupt key
21+
"""
22+
23+
def run(self):
24+
"""
25+
listener keycode _exit_check_key to interrupt
26+
"""
27+
28+
def init_critical_exit(self):
29+
"""
30+
should only use this to start critical exit
31+
may this function will add more
32+
"""
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
AutoControlGUI Executor Doc
2+
==========================
3+
4+
.. code-block:: python
5+
6+
def execute_action(action_list: list):
7+
"""
8+
use to execute all action on action list(action file or python list)
9+
:param action_list the list include action
10+
for loop the list and execute action
11+
"""
12+
13+
"""
14+
Executor example
15+
on program or action file
16+
use format like bottom
17+
[function_name, {param: value,...}]
18+
if no param use [function_name]
19+
"""
20+
from je_auto_control import execute_action
21+
from je_auto_control import test_record
22+
example_list = [
23+
["type_key", {"keycode": 65}],
24+
["mouse_left", {"mouse_keycode": "mouse_left", "x": 500, "y": 500}],
25+
["position"],
26+
["press_mouse", {"mouse_keycode": "mouse_left", "x": 500, "y": 500}],
27+
["release_mouse", {"mouse_keycode": "mouse_left", "x": 500, "y": 500}],
28+
]
29+
execute_action(example_list)
30+
31+
def read_action_json(json_file_path: str):
32+
"""
33+
use to read action file
34+
:param json_file_path json file's path to read
35+
"""
36+
37+
def write_action_json(json_save_path: str, action_json: list):
38+
"""
39+
use to save action file
40+
:param json_save_path json save path
41+
:param action_json the json str include action to write
42+
"""

docs/source/doc/auto_control_image/auto_control_image.rst renamed to docs/source/doc/auto_control_image_doc/auto_control_image_doc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AutoControlGUI Critical Exit
1+
AutoControlGUI Image Doc
22
==========================
33

44
.. code-block:: python

docs/source/doc/auto_control_keyboard/auto_control_keyboard.rst renamed to docs/source/doc/auto_control_keyboard_doc/auto_control_keyboard_doc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AutoControlGUI Critical Exit
1+
AutoControlGUI Keyboard Doc
22
==========================
33

44

docs/source/doc/auto_control_mouse/auto_control_mouse.rst renamed to docs/source/doc/auto_control_mouse_doc/auto_control_mouse_doc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AutoControlGUI Critical Exit
1+
AutoControlGUI Mouse Doc
22
==========================
33

44

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
AutoControlGUI Record Doc
2+
==========================
3+
4+
5+
.. code-block:: python
6+
7+
def record():
8+
"""
9+
start record keyboard and mouse event until stop_record
10+
"""
11+
12+
def stop_record():
13+
"""
14+
stop current record
15+
"""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
AutoControlGUI Screen Doc
2+
==========================
3+
4+
5+
.. code-block:: python
6+
7+
def size():
8+
"""
9+
get screen size
10+
"""
11+
12+
def screenshot(file_path: str = None, region: list = None):
13+
"""
14+
use to capture current screen image
15+
:param file_path screenshot file save path
16+
:param region screenshot region
17+
"""

0 commit comments

Comments
 (0)