Skip to content

Dev #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 20, 2022
Merged

Dev #20

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

---

### JE Auto Control as a tool for GUI Testing
#### Features
* Image Detect
* Keyboard Event
* Mouse Event
* Screen
* Action File
* Record Event
* CLI with action file
* timeout

---

[![CircleCI](https://circleci.com/gh/JE-Chen/AutoControl/tree/main.svg?style=svg)](https://circleci.com/gh/JE-Chen/AutoControl/tree/main)

### Documentation
Expand Down
2 changes: 1 addition & 1 deletion dev_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="je_auto_control_dev",
version="0.0.07",
version="0.0.08",
author="JE-Chen",
author_email="zenmailman@gmail.com",
description="auto testing",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
AutoControlGUI Critical Exit Doc
==========================

.. code-block:: python

class CriticalExit(Thread):
"""
use to make program interrupt
"""

def __init__(self, default_daemon: bool = True):
"""
default interrupt is keyboard F7 key
:param default_daemon bool thread setDaemon
"""

def set_critical_key(self, keycode: [int, str] = None):
"""
set interrupt key
:param keycode interrupt key
"""

def run(self):
"""
listener keycode _exit_check_key to interrupt
"""

def init_critical_exit(self):
"""
should only use this to start critical exit
may this function will add more
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
AutoControlGUI Executor Doc
==========================

.. code-block:: python

def execute_action(action_list: list):
"""
use to execute all action on action list(action file or python list)
:param action_list the list include action
for loop the list and execute action
"""

"""
Executor example
on program or action file
use format like bottom
[function_name, {param: value,...}]
if no param use [function_name]
"""
from je_auto_control import execute_action
from je_auto_control import test_record
example_list = [
["type_key", {"keycode": 65}],
["mouse_left", {"mouse_keycode": "mouse_left", "x": 500, "y": 500}],
["position"],
["press_mouse", {"mouse_keycode": "mouse_left", "x": 500, "y": 500}],
["release_mouse", {"mouse_keycode": "mouse_left", "x": 500, "y": 500}],
]
execute_action(example_list)

def read_action_json(json_file_path: str):
"""
use to read action file
:param json_file_path json file's path to read
"""

def write_action_json(json_save_path: str, action_json: list):
"""
use to save action file
:param json_save_path json save path
:param action_json the json str include action to write
"""
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AutoControlGUI Critical Exit
AutoControlGUI Image Doc
==========================

.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AutoControlGUI Critical Exit
AutoControlGUI Keyboard Doc
==========================


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AutoControlGUI Critical Exit
AutoControlGUI Mouse Doc
==========================


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
AutoControlGUI Record Doc
==========================


.. code-block:: python

def record():
"""
start record keyboard and mouse event until stop_record
"""

def stop_record():
"""
stop current record
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
AutoControlGUI Screen Doc
==========================


.. code-block:: python

def size():
"""
get screen size
"""

def screenshot(file_path: str = None, region: list = None):
"""
use to capture current screen image
:param file_path screenshot file save path
:param region screenshot region
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
AutoControlGUI Test Record Doc
==========================


.. code-block:: python

"""
just a data class use to record success and failure
"""
class TestRecord(object):

def __init__(self):
self.record_list = list()
self.error_record_list = list()

def clean_record(self):
self.record_list = list()
self.error_record_list = list()


test_record = TestRecord()

13 changes: 9 additions & 4 deletions docs/source/doc/doc_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ Doc
==================

.. toctree::
:maxdepth: 2
:maxdepth: 4

auto_control_image/auto_control_image.rst
auto_control_keyboard/auto_control_keyboard.rst
auto_control_mouse/auto_control_mouse.rst
auto_control_image_doc/auto_control_image_doc.rst
auto_control_keyboard_doc/auto_control_keyboard_doc.rst
auto_control_mouse_doc/auto_control_mouse_doc.rst
auto_control_critical_exit_doc/auto_control_critical_exit_doc.rst
auto_control_executor_doc/auto_control_executor_doc.rst
auto_control_record_doc/auto_control_record_doc.rst
auto_control_screen_doc/auto_control_screen_doc.rst
auto_control_test_record_doc/auto_control_test_record_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AutoControlGUI Critical Exit
| if you want to click keyboard key to exit program you can use this module
| when you click what you set on set_critical_key will make program exit
| this example is how to auto use CriticalExit

.. code-block:: python

from je_auto_control import CriticalExit
Expand Down
21 changes: 10 additions & 11 deletions docs/source/example/example_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ Example
==================

.. toctree::
:maxdepth: 2
:maxdepth: 4

installation/installation.rst
critical_exit/critical_exit.rst
mouse/mouse.rst
keyboard/keyboard.rst
screen/screen.rst
image_detect/image_detect.rst
record/record.rst
execute_action/execute_action.rst
editor/editor.rst
test/test.rst
installation_example/installation.rst
critical_exit_example/critical_exit.rst
mouse_example/mouse.rst
keyboard_example/keyboard.rst
screen_example/screen.rst
image_detect_example/image_detect.rst
record_example/record.rst
executor_example/execute_action.rst
editor_example/editor.rst
14 changes: 0 additions & 14 deletions docs/source/example/test/test.rst

This file was deleted.

14 changes: 11 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ AutoControlGUI_JE
==================

.. toctree::
:maxdepth: 2
:maxdepth: 4

example/example_index.rst
doc/doc_index.rst

Github :
https://github.com/JE-Chen/Python_JEAutoControl
* Test on
* windows 10 ~ 11
* osx 10.5 ~ 11 big sur
* ubuntu 20.0.4
* raspberry pi 3B+

| All test in test dir

* Notice
* if you are using XWindows os ,like ubuntu you may need to update pillow
Loading