wally-dev 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wally_dev-0.0.1/CHANGELOG.md +41 -0
- wally_dev-0.0.1/LICENSE +33 -0
- wally_dev-0.0.1/MANIFEST.in +24 -0
- wally_dev-0.0.1/PKG-INFO +320 -0
- wally_dev-0.0.1/README.md +266 -0
- wally_dev-0.0.1/pyproject.toml +187 -0
- wally_dev-0.0.1/setup.cfg +4 -0
- wally_dev-0.0.1/tests/__init__.py +1 -0
- wally_dev-0.0.1/tests/conftest.py +344 -0
- wally_dev-0.0.1/tests/test_api_client.py +663 -0
- wally_dev-0.0.1/tests/test_cli.py +205 -0
- wally_dev-0.0.1/tests/test_commands.py +206 -0
- wally_dev-0.0.1/tests/test_config.py +181 -0
- wally_dev-0.0.1/tests/test_exceptions.py +184 -0
- wally_dev-0.0.1/tests/test_generator.py +324 -0
- wally_dev-0.0.1/tests/test_models.py +171 -0
- wally_dev-0.0.1/tests/test_runner.py +256 -0
- wally_dev-0.0.1/tests/test_workspace.py +328 -0
- wally_dev-0.0.1/wally_dev/__init__.py +36 -0
- wally_dev-0.0.1/wally_dev/__main__.py +11 -0
- wally_dev-0.0.1/wally_dev/api_client.py +886 -0
- wally_dev-0.0.1/wally_dev/cli.py +91 -0
- wally_dev-0.0.1/wally_dev/commands/__init__.py +27 -0
- wally_dev-0.0.1/wally_dev/commands/checkout.py +338 -0
- wally_dev-0.0.1/wally_dev/commands/login.py +194 -0
- wally_dev-0.0.1/wally_dev/commands/logout.py +142 -0
- wally_dev-0.0.1/wally_dev/commands/norms.py +164 -0
- wally_dev-0.0.1/wally_dev/commands/organizations.py +296 -0
- wally_dev-0.0.1/wally_dev/commands/push.py +376 -0
- wally_dev-0.0.1/wally_dev/commands/rules.py +192 -0
- wally_dev-0.0.1/wally_dev/commands/run.py +549 -0
- wally_dev-0.0.1/wally_dev/commands/status.py +137 -0
- wally_dev-0.0.1/wally_dev/commands/testcases.py +761 -0
- wally_dev-0.0.1/wally_dev/config.py +268 -0
- wally_dev-0.0.1/wally_dev/constants.py +34 -0
- wally_dev-0.0.1/wally_dev/exceptions.py +233 -0
- wally_dev-0.0.1/wally_dev/generator.py +354 -0
- wally_dev-0.0.1/wally_dev/models.py +253 -0
- wally_dev-0.0.1/wally_dev/py.typed +0 -0
- wally_dev-0.0.1/wally_dev/runner.py +412 -0
- wally_dev-0.0.1/wally_dev/workspace.py +785 -0
- wally_dev-0.0.1/wally_dev.egg-info/SOURCES.txt +39 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Todas as alterações notáveis neste projeto serão documentadas neste arquivo.
|
|
4
|
+
|
|
5
|
+
O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.0.0/),
|
|
6
|
+
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Comando `norms list` para listar normas disponíveis
|
|
12
|
+
- Comando `rules list` para listar regras de uma norma
|
|
13
|
+
- Flag `--debug` no comando `run` mostrando elementos e validações detalhadas
|
|
14
|
+
- Coluna de número da linha no output de debug
|
|
15
|
+
- Suporte a Python 3.13
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Melhorias na documentação e README
|
|
19
|
+
|
|
20
|
+
## [0.1.0] - 2026-01-12
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- Comando `login` para autenticação com username/password
|
|
24
|
+
- Comando `logout` para remover credenciais e desbloquear normas
|
|
25
|
+
- Comando `checkout` para baixar casos de teste de uma norma
|
|
26
|
+
- Comando `push` para enviar alterações ao servidor
|
|
27
|
+
- Comando `run` para execução local de casos de teste
|
|
28
|
+
- Comando `status` para verificar estado do workspace
|
|
29
|
+
- Suporte ao padrão finder/validator para casos de teste
|
|
30
|
+
- Download de exemplos (compliant/non-compliant) como arquivos HTML
|
|
31
|
+
- Auto-refresh de tokens JWT expirados
|
|
32
|
+
- Interface rica com tabelas e painéis (Rich)
|
|
33
|
+
- Configuração via variáveis de ambiente
|
|
34
|
+
- Suporte a múltiplas normas em checkout simultâneo
|
|
35
|
+
|
|
36
|
+
### Security
|
|
37
|
+
- Armazenamento seguro de tokens em arquivo local
|
|
38
|
+
- Senha solicitada de forma interativa (não visível no histórico)
|
|
39
|
+
|
|
40
|
+
[Unreleased]: https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/compare/v0.1.0...main
|
|
41
|
+
[0.1.0]: https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/tags/v0.1.0
|
wally_dev-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Equallyze Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Equallyze Tecnologia LTDA. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
NOTICE: This software and associated documentation files (the "Software") are
|
|
6
|
+
proprietary and confidential to Equallyze Tecnologia LTDA.
|
|
7
|
+
|
|
8
|
+
RESTRICTIONS:
|
|
9
|
+
1. You may not copy, modify, merge, publish, distribute, sublicense, or sell
|
|
10
|
+
copies of the Software without prior written authorization from Equallyze.
|
|
11
|
+
|
|
12
|
+
2. You may not reverse engineer, decompile, or disassemble the Software.
|
|
13
|
+
|
|
14
|
+
3. You may not use the Software for any purpose other than as expressly
|
|
15
|
+
authorized by Equallyze in writing.
|
|
16
|
+
|
|
17
|
+
4. You may not remove or alter any proprietary notices, labels, or marks on
|
|
18
|
+
the Software.
|
|
19
|
+
|
|
20
|
+
AUTHORIZED USE:
|
|
21
|
+
Use of this Software requires a valid subscription or license agreement with
|
|
22
|
+
Equallyze. The Software is provided solely for use with the Wally accessibility
|
|
23
|
+
testing platform (https://wally.equallyze.com).
|
|
24
|
+
|
|
25
|
+
DISCLAIMER:
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
29
|
+
EQUALLYZE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
30
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
31
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
+
|
|
33
|
+
For licensing inquiries, contact: contato@equallyze.com
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
|
|
6
|
+
recursive-include wally_dev *.py
|
|
7
|
+
recursive-include wally_dev *.typed
|
|
8
|
+
include wally_dev/py.typed
|
|
9
|
+
|
|
10
|
+
recursive-include tests *.py
|
|
11
|
+
|
|
12
|
+
global-exclude __pycache__
|
|
13
|
+
global-exclude *.py[cod]
|
|
14
|
+
global-exclude *.so
|
|
15
|
+
global-exclude .DS_Store
|
|
16
|
+
global-exclude .git*
|
|
17
|
+
|
|
18
|
+
prune workspace
|
|
19
|
+
prune .pytest_cache
|
|
20
|
+
prune .mypy_cache
|
|
21
|
+
prune .ruff_cache
|
|
22
|
+
prune *.egg-info
|
|
23
|
+
prune build
|
|
24
|
+
prune dist
|
wally_dev-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wally-dev
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: CLI para desenvolvimento local de casos de teste de acessibilidade da plataforma Wally
|
|
5
|
+
Author-email: Equallyze <contato@equallyze.com>
|
|
6
|
+
Maintainer-email: Equallyze <contato@equallyze.com>
|
|
7
|
+
License-Expression: LicenseRef-Proprietary
|
|
8
|
+
Project-URL: Homepage, https://acessibilidade.global
|
|
9
|
+
Project-URL: Documentation, https://docs.acessibilidade.global
|
|
10
|
+
Project-URL: Repository, https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev
|
|
11
|
+
Project-URL: Issues, https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/issues
|
|
12
|
+
Project-URL: Changelog, https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: accessibility,a11y,testing,cli,wally,equallyze,acessibilidade,nbr17225
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Software Development :: Testing
|
|
25
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
26
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
|
|
27
|
+
Classifier: Typing :: Typed
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: requests<3.0.0,>=2.31.0
|
|
32
|
+
Requires-Dist: pydantic<3.0.0,>=2.5.0
|
|
33
|
+
Requires-Dist: pydantic-settings<3.0.0,>=2.1.0
|
|
34
|
+
Requires-Dist: python-dotenv<2.0.0,>=1.0.0
|
|
35
|
+
Requires-Dist: click<9.0.0,>=8.1.0
|
|
36
|
+
Requires-Dist: rich<14.0.0,>=13.0.0
|
|
37
|
+
Requires-Dist: beautifulsoup4<5.0.0,>=4.12.0
|
|
38
|
+
Provides-Extra: ai
|
|
39
|
+
Requires-Dist: openai<2.0.0,>=1.0.0; extra == "ai"
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
|
|
44
|
+
Requires-Dist: responses>=0.24.0; extra == "dev"
|
|
45
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
46
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=1.7.0; extra == "dev"
|
|
48
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
49
|
+
Requires-Dist: types-requests>=2.31.0; extra == "dev"
|
|
50
|
+
Requires-Dist: types-beautifulsoup4>=4.12.0; extra == "dev"
|
|
51
|
+
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
|
|
52
|
+
Requires-Dist: openai<2.0.0,>=1.0.0; extra == "dev"
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
|
|
55
|
+
# Wally Dev CLI
|
|
56
|
+
|
|
57
|
+
[](https://pypi.org/project/wally-dev/)
|
|
58
|
+
[](https://pypi.org/project/wally-dev/)
|
|
59
|
+
[](https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/pipelines)
|
|
60
|
+
|
|
61
|
+
**Wally Dev** é uma ferramenta de linha de comando (CLI) para desenvolvimento local de casos de teste de acessibilidade da plataforma [Wally](https://wally.equallyze.com).
|
|
62
|
+
|
|
63
|
+
## 🚀 Instalação
|
|
64
|
+
|
|
65
|
+
### Opção 1: pipx (Recomendado)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Instalar pipx (se necessário)
|
|
69
|
+
sudo apt install pipx
|
|
70
|
+
pipx ensurepath
|
|
71
|
+
|
|
72
|
+
# Instalar wally-dev
|
|
73
|
+
pipx install wally-dev
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Opção 2: pip com virtual environment
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Criar e ativar virtual environment
|
|
80
|
+
python3 -m venv ~/.venvs/wally-dev
|
|
81
|
+
source ~/.venvs/wally-dev/bin/activate
|
|
82
|
+
|
|
83
|
+
# Instalar
|
|
84
|
+
pip install wally-dev
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Opção 3: pip direto (sistemas sem proteção PEP 668)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pip install wally-dev
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Requisitos
|
|
94
|
+
|
|
95
|
+
- Python 3.9 ou superior
|
|
96
|
+
- Conta ativa na plataforma Wally
|
|
97
|
+
|
|
98
|
+
## 📋 Comandos Disponíveis
|
|
99
|
+
|
|
100
|
+
| Comando | Descrição |
|
|
101
|
+
|---------|-----------|
|
|
102
|
+
| `wally-dev login` | Autenticar na plataforma Wally |
|
|
103
|
+
| `wally-dev logout` | Remover credenciais e desbloquear normas |
|
|
104
|
+
| `wally-dev status` | Mostrar status do workspace local |
|
|
105
|
+
| `wally-dev norms list` | Listar normas disponíveis |
|
|
106
|
+
| `wally-dev rules list` | Listar regras de uma norma |
|
|
107
|
+
| `wally-dev checkout` | Baixar casos de teste para desenvolvimento |
|
|
108
|
+
| `wally-dev run` | Executar casos de teste localmente |
|
|
109
|
+
| `wally-dev push` | Enviar alterações para o servidor |
|
|
110
|
+
|
|
111
|
+
## 🔐 Autenticação
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Login interativo
|
|
115
|
+
wally-dev login
|
|
116
|
+
|
|
117
|
+
# Com parâmetros
|
|
118
|
+
wally-dev login --username user@example.com --org-id <organization-id>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 📦 Workflow de Desenvolvimento
|
|
122
|
+
|
|
123
|
+
### 1. Listar normas disponíveis
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
wally-dev norms list
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Saída:
|
|
130
|
+
```
|
|
131
|
+
╭────────────────── 📋 Normas (3) ──────────────────╮
|
|
132
|
+
│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ │
|
|
133
|
+
│ ┃ ID ┃ Nome ┃ │
|
|
134
|
+
│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ │
|
|
135
|
+
│ │ 6954434ffdd23615c0e5d85d │ NBR 17225 │ │
|
|
136
|
+
│ │ 695c46a91dd6a5bae0e4863b │ Community │ │
|
|
137
|
+
│ └──────────────────────────┴───────────────────┘ │
|
|
138
|
+
╰───────────────────────────────────────────────────╯
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 2. Fazer checkout de uma norma
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
wally-dev checkout --norm-id <norm-id>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Isso irá:
|
|
148
|
+
- Bloquear a norma no servidor (impede edições simultâneas)
|
|
149
|
+
- Baixar todos os casos de teste e exemplos para `./workspace/`
|
|
150
|
+
|
|
151
|
+
### 3. Estrutura do Workspace
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
./workspace/
|
|
155
|
+
<norm-id>/
|
|
156
|
+
testCases/
|
|
157
|
+
<testcase-id>/
|
|
158
|
+
testcase.json # Metadados do caso de teste
|
|
159
|
+
code/
|
|
160
|
+
finder.py # Função que encontra elementos
|
|
161
|
+
validator.py # Função que valida elementos
|
|
162
|
+
examples/
|
|
163
|
+
compliant/
|
|
164
|
+
example.html # HTML que deve passar
|
|
165
|
+
non-compliant/
|
|
166
|
+
example.html # HTML que deve falhar
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 4. Desenvolver o caso de teste
|
|
170
|
+
|
|
171
|
+
#### `finder.py`
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
from bs4 import BeautifulSoup
|
|
175
|
+
|
|
176
|
+
def find(html_content: str):
|
|
177
|
+
"""
|
|
178
|
+
Encontra elementos HTML para validação.
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
html_content: String com o HTML a ser analisado
|
|
182
|
+
|
|
183
|
+
Yields:
|
|
184
|
+
Elementos encontrados para validação
|
|
185
|
+
"""
|
|
186
|
+
soup = BeautifulSoup(html_content, "html.parser")
|
|
187
|
+
for img in soup.find_all("img"):
|
|
188
|
+
yield img
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
#### `validator.py`
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
def validate(element) -> bool:
|
|
195
|
+
"""
|
|
196
|
+
Valida se um elemento está em conformidade.
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
element: Elemento HTML encontrado pelo finder
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
True se o elemento está em conformidade, False caso contrário
|
|
203
|
+
"""
|
|
204
|
+
alt = element.get("alt", "")
|
|
205
|
+
return bool(alt and alt.strip())
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 5. Executar testes localmente
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Executar todos os exemplos de um caso de teste
|
|
212
|
+
wally-dev run --testcase <testcase-id>
|
|
213
|
+
|
|
214
|
+
# Executar um exemplo específico
|
|
215
|
+
wally-dev run --testcase <testcase-id> --example compliant/example.html
|
|
216
|
+
|
|
217
|
+
# Modo debug (mostra elementos encontrados e validações)
|
|
218
|
+
wally-dev run --testcase <testcase-id> --debug
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Saída com `--debug`:
|
|
222
|
+
```
|
|
223
|
+
╭───────────────────── 🔍 Debug Output ─────────────────────╮
|
|
224
|
+
│ Execução bem sucedida │
|
|
225
|
+
│ │
|
|
226
|
+
│ Elementos encontrados: 2 │
|
|
227
|
+
│ Tempo finder: 0.35ms │
|
|
228
|
+
│ Tempo total: 0.40ms │
|
|
229
|
+
╰───────────────────────────────────────────────────────────╯
|
|
230
|
+
|
|
231
|
+
📋 Elementos e Validações:
|
|
232
|
+
┏━━━┳━━━━━━━┳━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
233
|
+
┃ # ┃ Linha ┃ Tag ┃ validate() ┃ Snippet ┃
|
|
234
|
+
┡━━━╇━━━━━━━╇━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
|
235
|
+
│ 0 │ 10 │ img │ ✓ True │ <img alt="" src="img.jpg"/> │
|
|
236
|
+
│ 1 │ 12 │ img │ ✓ True │ <img aria-hidden="true"/> │
|
|
237
|
+
└───┴───────┴─────┴────────────┴─────────────────────────────┘
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### 6. Enviar alterações
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
wally-dev push --norm-id <norm-id>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## 🧪 Lógica de Validação
|
|
247
|
+
|
|
248
|
+
Os casos de teste seguem a convenção:
|
|
249
|
+
|
|
250
|
+
- **Exemplos `compliant/`**: Todos os elementos encontrados pelo `finder` devem retornar `True` no `validator`
|
|
251
|
+
- **Exemplos `non-compliant/`**: Pelo menos um elemento deve retornar `False` no `validator`
|
|
252
|
+
|
|
253
|
+
## ⚙️ Configuração
|
|
254
|
+
|
|
255
|
+
A CLI armazena configurações em `~/.config/wally-dev/.wally-dev.json`:
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
{
|
|
259
|
+
"access_token": "...",
|
|
260
|
+
"refresh_token": "...",
|
|
261
|
+
"user_email": "user@example.com",
|
|
262
|
+
"organization_id": "...",
|
|
263
|
+
"backend_url": "https://api.wally.equallyze.com/backend/services/v0.0.1"
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Variáveis de Ambiente
|
|
268
|
+
|
|
269
|
+
| Variável | Descrição | Default |
|
|
270
|
+
|----------|-----------|---------|
|
|
271
|
+
| `WALLY_DEV_BACKEND_URL` | URL da API backend | `https://api.wally.equallyze.com/...` |
|
|
272
|
+
| `WALLY_DEV_CONFIG_DIR` | Diretório de configuração | `~/.config/wally-dev` |
|
|
273
|
+
|
|
274
|
+
## 🛠️ Desenvolvimento
|
|
275
|
+
|
|
276
|
+
### Instalação para desenvolvimento
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
git clone https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev.git
|
|
280
|
+
cd wally-dev
|
|
281
|
+
|
|
282
|
+
# Criar virtual environment
|
|
283
|
+
python3 -m venv .venv
|
|
284
|
+
source .venv/bin/activate
|
|
285
|
+
|
|
286
|
+
# Instalar em modo editável com dependências de dev
|
|
287
|
+
pip install -e ".[dev]"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Executar testes
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
pytest
|
|
294
|
+
pytest --cov=wally_dev --cov-report=html
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Formatação e linting
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
black wally_dev tests
|
|
301
|
+
isort wally_dev tests
|
|
302
|
+
ruff check wally_dev tests
|
|
303
|
+
mypy wally_dev
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## 📄 Licença
|
|
307
|
+
|
|
308
|
+
Este software é propriedade da [Equallyze Tecnologia LTDA](https://equallyze.com).
|
|
309
|
+
Todos os direitos reservados. Consulte o arquivo [LICENSE](LICENSE) para mais detalhes.
|
|
310
|
+
|
|
311
|
+
## 🔗 Links
|
|
312
|
+
|
|
313
|
+
- [Plataforma Wally](https://wally.equallyze.com)
|
|
314
|
+
- [Documentação](https://docs.wally.equallyze.com)
|
|
315
|
+
- [Equallyze](https://equallyze.com)
|
|
316
|
+
- [Repositório](https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev)
|
|
317
|
+
|
|
318
|
+
## 🤝 Suporte
|
|
319
|
+
|
|
320
|
+
Para suporte, abra uma issue no [GitLab](https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/issues) ou entre em contato através de [contato@equallyze.com](mailto:contato@equallyze.com).
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Wally Dev CLI
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/wally-dev/)
|
|
4
|
+
[](https://pypi.org/project/wally-dev/)
|
|
5
|
+
[](https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/pipelines)
|
|
6
|
+
|
|
7
|
+
**Wally Dev** é uma ferramenta de linha de comando (CLI) para desenvolvimento local de casos de teste de acessibilidade da plataforma [Wally](https://wally.equallyze.com).
|
|
8
|
+
|
|
9
|
+
## 🚀 Instalação
|
|
10
|
+
|
|
11
|
+
### Opção 1: pipx (Recomendado)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Instalar pipx (se necessário)
|
|
15
|
+
sudo apt install pipx
|
|
16
|
+
pipx ensurepath
|
|
17
|
+
|
|
18
|
+
# Instalar wally-dev
|
|
19
|
+
pipx install wally-dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Opção 2: pip com virtual environment
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Criar e ativar virtual environment
|
|
26
|
+
python3 -m venv ~/.venvs/wally-dev
|
|
27
|
+
source ~/.venvs/wally-dev/bin/activate
|
|
28
|
+
|
|
29
|
+
# Instalar
|
|
30
|
+
pip install wally-dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Opção 3: pip direto (sistemas sem proteção PEP 668)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install wally-dev
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Requisitos
|
|
40
|
+
|
|
41
|
+
- Python 3.9 ou superior
|
|
42
|
+
- Conta ativa na plataforma Wally
|
|
43
|
+
|
|
44
|
+
## 📋 Comandos Disponíveis
|
|
45
|
+
|
|
46
|
+
| Comando | Descrição |
|
|
47
|
+
|---------|-----------|
|
|
48
|
+
| `wally-dev login` | Autenticar na plataforma Wally |
|
|
49
|
+
| `wally-dev logout` | Remover credenciais e desbloquear normas |
|
|
50
|
+
| `wally-dev status` | Mostrar status do workspace local |
|
|
51
|
+
| `wally-dev norms list` | Listar normas disponíveis |
|
|
52
|
+
| `wally-dev rules list` | Listar regras de uma norma |
|
|
53
|
+
| `wally-dev checkout` | Baixar casos de teste para desenvolvimento |
|
|
54
|
+
| `wally-dev run` | Executar casos de teste localmente |
|
|
55
|
+
| `wally-dev push` | Enviar alterações para o servidor |
|
|
56
|
+
|
|
57
|
+
## 🔐 Autenticação
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Login interativo
|
|
61
|
+
wally-dev login
|
|
62
|
+
|
|
63
|
+
# Com parâmetros
|
|
64
|
+
wally-dev login --username user@example.com --org-id <organization-id>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 📦 Workflow de Desenvolvimento
|
|
68
|
+
|
|
69
|
+
### 1. Listar normas disponíveis
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
wally-dev norms list
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Saída:
|
|
76
|
+
```
|
|
77
|
+
╭────────────────── 📋 Normas (3) ──────────────────╮
|
|
78
|
+
│ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ │
|
|
79
|
+
│ ┃ ID ┃ Nome ┃ │
|
|
80
|
+
│ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ │
|
|
81
|
+
│ │ 6954434ffdd23615c0e5d85d │ NBR 17225 │ │
|
|
82
|
+
│ │ 695c46a91dd6a5bae0e4863b │ Community │ │
|
|
83
|
+
│ └──────────────────────────┴───────────────────┘ │
|
|
84
|
+
╰───────────────────────────────────────────────────╯
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2. Fazer checkout de uma norma
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
wally-dev checkout --norm-id <norm-id>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Isso irá:
|
|
94
|
+
- Bloquear a norma no servidor (impede edições simultâneas)
|
|
95
|
+
- Baixar todos os casos de teste e exemplos para `./workspace/`
|
|
96
|
+
|
|
97
|
+
### 3. Estrutura do Workspace
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
./workspace/
|
|
101
|
+
<norm-id>/
|
|
102
|
+
testCases/
|
|
103
|
+
<testcase-id>/
|
|
104
|
+
testcase.json # Metadados do caso de teste
|
|
105
|
+
code/
|
|
106
|
+
finder.py # Função que encontra elementos
|
|
107
|
+
validator.py # Função que valida elementos
|
|
108
|
+
examples/
|
|
109
|
+
compliant/
|
|
110
|
+
example.html # HTML que deve passar
|
|
111
|
+
non-compliant/
|
|
112
|
+
example.html # HTML que deve falhar
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 4. Desenvolver o caso de teste
|
|
116
|
+
|
|
117
|
+
#### `finder.py`
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from bs4 import BeautifulSoup
|
|
121
|
+
|
|
122
|
+
def find(html_content: str):
|
|
123
|
+
"""
|
|
124
|
+
Encontra elementos HTML para validação.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
html_content: String com o HTML a ser analisado
|
|
128
|
+
|
|
129
|
+
Yields:
|
|
130
|
+
Elementos encontrados para validação
|
|
131
|
+
"""
|
|
132
|
+
soup = BeautifulSoup(html_content, "html.parser")
|
|
133
|
+
for img in soup.find_all("img"):
|
|
134
|
+
yield img
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### `validator.py`
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
def validate(element) -> bool:
|
|
141
|
+
"""
|
|
142
|
+
Valida se um elemento está em conformidade.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
element: Elemento HTML encontrado pelo finder
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
True se o elemento está em conformidade, False caso contrário
|
|
149
|
+
"""
|
|
150
|
+
alt = element.get("alt", "")
|
|
151
|
+
return bool(alt and alt.strip())
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 5. Executar testes localmente
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Executar todos os exemplos de um caso de teste
|
|
158
|
+
wally-dev run --testcase <testcase-id>
|
|
159
|
+
|
|
160
|
+
# Executar um exemplo específico
|
|
161
|
+
wally-dev run --testcase <testcase-id> --example compliant/example.html
|
|
162
|
+
|
|
163
|
+
# Modo debug (mostra elementos encontrados e validações)
|
|
164
|
+
wally-dev run --testcase <testcase-id> --debug
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Saída com `--debug`:
|
|
168
|
+
```
|
|
169
|
+
╭───────────────────── 🔍 Debug Output ─────────────────────╮
|
|
170
|
+
│ Execução bem sucedida │
|
|
171
|
+
│ │
|
|
172
|
+
│ Elementos encontrados: 2 │
|
|
173
|
+
│ Tempo finder: 0.35ms │
|
|
174
|
+
│ Tempo total: 0.40ms │
|
|
175
|
+
╰───────────────────────────────────────────────────────────╯
|
|
176
|
+
|
|
177
|
+
📋 Elementos e Validações:
|
|
178
|
+
┏━━━┳━━━━━━━┳━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
179
|
+
┃ # ┃ Linha ┃ Tag ┃ validate() ┃ Snippet ┃
|
|
180
|
+
┡━━━╇━━━━━━━╇━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
|
181
|
+
│ 0 │ 10 │ img │ ✓ True │ <img alt="" src="img.jpg"/> │
|
|
182
|
+
│ 1 │ 12 │ img │ ✓ True │ <img aria-hidden="true"/> │
|
|
183
|
+
└───┴───────┴─────┴────────────┴─────────────────────────────┘
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 6. Enviar alterações
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
wally-dev push --norm-id <norm-id>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## 🧪 Lógica de Validação
|
|
193
|
+
|
|
194
|
+
Os casos de teste seguem a convenção:
|
|
195
|
+
|
|
196
|
+
- **Exemplos `compliant/`**: Todos os elementos encontrados pelo `finder` devem retornar `True` no `validator`
|
|
197
|
+
- **Exemplos `non-compliant/`**: Pelo menos um elemento deve retornar `False` no `validator`
|
|
198
|
+
|
|
199
|
+
## ⚙️ Configuração
|
|
200
|
+
|
|
201
|
+
A CLI armazena configurações em `~/.config/wally-dev/.wally-dev.json`:
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"access_token": "...",
|
|
206
|
+
"refresh_token": "...",
|
|
207
|
+
"user_email": "user@example.com",
|
|
208
|
+
"organization_id": "...",
|
|
209
|
+
"backend_url": "https://api.wally.equallyze.com/backend/services/v0.0.1"
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Variáveis de Ambiente
|
|
214
|
+
|
|
215
|
+
| Variável | Descrição | Default |
|
|
216
|
+
|----------|-----------|---------|
|
|
217
|
+
| `WALLY_DEV_BACKEND_URL` | URL da API backend | `https://api.wally.equallyze.com/...` |
|
|
218
|
+
| `WALLY_DEV_CONFIG_DIR` | Diretório de configuração | `~/.config/wally-dev` |
|
|
219
|
+
|
|
220
|
+
## 🛠️ Desenvolvimento
|
|
221
|
+
|
|
222
|
+
### Instalação para desenvolvimento
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
git clone https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev.git
|
|
226
|
+
cd wally-dev
|
|
227
|
+
|
|
228
|
+
# Criar virtual environment
|
|
229
|
+
python3 -m venv .venv
|
|
230
|
+
source .venv/bin/activate
|
|
231
|
+
|
|
232
|
+
# Instalar em modo editável com dependências de dev
|
|
233
|
+
pip install -e ".[dev]"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Executar testes
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
pytest
|
|
240
|
+
pytest --cov=wally_dev --cov-report=html
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Formatação e linting
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
black wally_dev tests
|
|
247
|
+
isort wally_dev tests
|
|
248
|
+
ruff check wally_dev tests
|
|
249
|
+
mypy wally_dev
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## 📄 Licença
|
|
253
|
+
|
|
254
|
+
Este software é propriedade da [Equallyze Tecnologia LTDA](https://equallyze.com).
|
|
255
|
+
Todos os direitos reservados. Consulte o arquivo [LICENSE](LICENSE) para mais detalhes.
|
|
256
|
+
|
|
257
|
+
## 🔗 Links
|
|
258
|
+
|
|
259
|
+
- [Plataforma Wally](https://wally.equallyze.com)
|
|
260
|
+
- [Documentação](https://docs.wally.equallyze.com)
|
|
261
|
+
- [Equallyze](https://equallyze.com)
|
|
262
|
+
- [Repositório](https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev)
|
|
263
|
+
|
|
264
|
+
## 🤝 Suporte
|
|
265
|
+
|
|
266
|
+
Para suporte, abra uma issue no [GitLab](https://gitlab.com/AcessibilidadeParaTodos/wally/wally-dev/-/issues) ou entre em contato através de [contato@equallyze.com](mailto:contato@equallyze.com).
|