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="zenmailman@gmail.com",
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+
"""
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
AutoControlGUI Test Record Doc
2+
==========================
3+
4+
5+
.. code-block:: python
6+
7+
"""
8+
just a data class use to record success and failure
9+
"""
10+
class TestRecord(object):
11+
12+
def __init__(self):
13+
self.record_list = list()
14+
self.error_record_list = list()
15+
16+
def clean_record(self):
17+
self.record_list = list()
18+
self.error_record_list = list()
19+
20+
21+
test_record = TestRecord()
22+

docs/source/doc/doc_index.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ Doc
33
==================
44

55
.. toctree::
6-
:maxdepth: 2
6+
:maxdepth: 4
77

8-
auto_control_image/auto_control_image.rst
9-
auto_control_keyboard/auto_control_keyboard.rst
10-
auto_control_mouse/auto_control_mouse.rst
8+
auto_control_image_doc/auto_control_image_doc.rst
9+
auto_control_keyboard_doc/auto_control_keyboard_doc.rst
10+
auto_control_mouse_doc/auto_control_mouse_doc.rst
11+
auto_control_critical_exit_doc/auto_control_critical_exit_doc.rst
12+
auto_control_executor_doc/auto_control_executor_doc.rst
13+
auto_control_record_doc/auto_control_record_doc.rst
14+
auto_control_screen_doc/auto_control_screen_doc.rst
15+
auto_control_test_record_doc/auto_control_test_record_doc.rst

docs/source/example/critical_exit/critical_exit.rst renamed to docs/source/example/critical_exit_example/critical_exit.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ AutoControlGUI Critical Exit
55
| if you want to click keyboard key to exit program you can use this module
66
| when you click what you set on set_critical_key will make program exit
77
| this example is how to auto use CriticalExit
8+
89
.. code-block:: python
910
1011
from je_auto_control import CriticalExit

docs/source/example/example_index.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ Example
33
==================
44

55
.. toctree::
6-
:maxdepth: 2
6+
:maxdepth: 4
77

8-
installation/installation.rst
9-
critical_exit/critical_exit.rst
10-
mouse/mouse.rst
11-
keyboard/keyboard.rst
12-
screen/screen.rst
13-
image_detect/image_detect.rst
14-
record/record.rst
15-
execute_action/execute_action.rst
16-
editor/editor.rst
17-
test/test.rst
8+
installation_example/installation.rst
9+
critical_exit_example/critical_exit.rst
10+
mouse_example/mouse.rst
11+
keyboard_example/keyboard.rst
12+
screen_example/screen.rst
13+
image_detect_example/image_detect.rst
14+
record_example/record.rst
15+
executor_example/execute_action.rst
16+
editor_example/editor.rst

docs/source/example/test/test.rst

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/source/index.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ AutoControlGUI_JE
33
==================
44

55
.. toctree::
6-
:maxdepth: 2
6+
:maxdepth: 4
77

88
example/example_index.rst
99
doc/doc_index.rst
1010

11-
Github :
12-
https://github.com/JE-Chen/Python_JEAutoControl
11+
* Test on
12+
* windows 10 ~ 11
13+
* osx 10.5 ~ 11 big sur
14+
* ubuntu 20.0.4
15+
* raspberry pi 3B+
16+
17+
| All test in test dir
18+
19+
* Notice
20+
* if you are using XWindows os ,like ubuntu you may need to update pillow

0 commit comments

Comments
 (0)