Skip to content

Commit

Permalink
Merge pull request #2 from douglasdcm/organize-folder
Browse files Browse the repository at this point in the history
Organize folder
  • Loading branch information
douglasdcm authored Jan 22, 2025
2 parents 86306a3 + 7c0489c commit a8523c2
Show file tree
Hide file tree
Showing 87 changed files with 57 additions and 42 deletions.
22 changes: 0 additions & 22 deletions .cloudbees/workflows/build.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions .cloudbees/workflows/my-workflow.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/pylint.yml → .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pylint
name: Linter

on: [push]

Expand All @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
pip install flake8
- name: Analysing the code with flake8
run: |
pylint $(git ls-files '*.py')
flake8 --exclude venv,venv*,env*,sikuli* --ignore=E501
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions ferramentas/desktop/02_pyautogui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Instalação

```
python3 -m venv venv
pip install -r requirements.txt
python -m pytest -k test_pyauto_gui
```
Abra a calculadora do Linux e rode

```
python -m pytest -k test_pyauto_gui
```

Bugs comuns

- Ao rodar os testes aparece `pyautogui.ImageNotFoundException`. Rode os comandos abaixo
```
pip uninstall pyscreeze
pip install pyscreeze==0.1.29
```
Fonte:
- https://github.com/asweigart/pyautogui/issues/864
- https://github.com/asweigart/pyscreeze/issues/110
Binary file added ferramentas/desktop/02_pyautogui/images/button_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ferramentas/desktop/02_pyautogui/images/button_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ferramentas/desktop/02_pyautogui/images/displays_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ferramentas/desktop/02_pyautogui/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyautogui
opencv-python
28 changes: 28 additions & 0 deletions ferramentas/desktop/02_pyautogui/test_calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pyautogui
from os import getcwd


def test_pyauto_gui():

BASE_PATH = getcwd() + "/images/"
BUTTON_1 = f"{BASE_PATH}button_1.png"
BUTTON_2 = f"{BASE_PATH}button_2.png"
BUTTON_SUM = f"{BASE_PATH}button_sum.png"
BUTTON_EQUALS = f"{BASE_PATH}button_equals.png"
DISPLAYS_3 = f"{BASE_PATH}displays_0dot5.png"

button_1 = pyautogui.locateOnScreen(BUTTON_1, confidence=0.9)
pyautogui.click(button_1)

# The tool confuses "+" and "÷", but this example does not worry about it
button_sum = pyautogui.locateOnScreen(BUTTON_SUM, confidence=0.8)
pyautogui.click(button_sum)

button_2 = pyautogui.locateOnScreen(BUTTON_2, confidence=0.9)
pyautogui.click(button_2)

button_equals = pyautogui.locateOnScreen(BUTTON_EQUALS, confidence=0.9)
pyautogui.click(button_equals)

button_display = pyautogui.locateOnScreen(DISPLAYS_3, confidence=0.9)
assert button_display is not None
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a8523c2

Please sign in to comment.