autotester 0.0.6__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.
- autotester-0.0.6/.gitignore +181 -0
- autotester-0.0.6/LICENSE +22 -0
- autotester-0.0.6/PKG-INFO +195 -0
- autotester-0.0.6/README.md +162 -0
- autotester-0.0.6/pyproject.toml +68 -0
- autotester-0.0.6/src/autotester/AnalyzeError.py +128 -0
- autotester-0.0.6/src/autotester/AutotesterConfig.py +63 -0
- autotester-0.0.6/src/autotester/ContentCleaner.py +1216 -0
- autotester-0.0.6/src/autotester/E2E.py +154 -0
- autotester-0.0.6/src/autotester/GitUtils.py +84 -0
- autotester-0.0.6/src/autotester/Report.py +69 -0
- autotester-0.0.6/src/autotester/ResponseParser.py +9 -0
- autotester-0.0.6/src/autotester/TestFilePattern.py +357 -0
- autotester-0.0.6/src/autotester/__init__.py +5 -0
- autotester-0.0.6/src/autotester/cli.py +184 -0
- autotester-0.0.6/src/autotester/models/anthropic.py +125 -0
- autotester-0.0.6/src/autotester/models/deepseek.py +113 -0
- autotester-0.0.6/src/autotester/models/mistral.py +170 -0
- autotester-0.0.6/src/autotester/models/ollama.py +289 -0
- autotester-0.0.6/src/autotester/models/openai.py +134 -0
- autotester-0.0.6/src/autotester/models/provider_factory.py +32 -0
- autotester-0.0.6/src/autotester/reporting/Report.py +29 -0
- autotester-0.0.6/src/autotester/reporting/ReportRequirements.md +816 -0
- autotester-0.0.6/src/autotester/reporting/__init__.py +3 -0
- autotester-0.0.6/src/autotester/types.py +31 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
.codebeaver
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Ruff stuff:
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# PyPI configuration file
|
|
174
|
+
.pypirc
|
|
175
|
+
.report.json
|
|
176
|
+
.env
|
|
177
|
+
.DS_Store
|
|
178
|
+
|
|
179
|
+
# Autotester reports and artifacts
|
|
180
|
+
.autotester/
|
|
181
|
+
e2e.json
|
autotester-0.0.6/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tailor Media, Inc.
|
|
4
|
+
Copyright (c) 2026 Cyberwave S.p.a.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: autotester
|
|
3
|
+
Version: 0.0.6
|
|
4
|
+
Summary: Autotester - E2E testing for your codebase
|
|
5
|
+
Project-URL: Repository, https://github.com/cyberwaveos/autotester
|
|
6
|
+
Project-URL: Issues, https://github.com/cyberwaveos/autotester/issues
|
|
7
|
+
Author-email: Cyberwave Team <info@cyberwave.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Requires-Dist: aiohttp>=3.9.0
|
|
16
|
+
Requires-Dist: black>=23.0.0
|
|
17
|
+
Requires-Dist: browser-use>=0.12.1
|
|
18
|
+
Requires-Dist: dotenv>=0.9.9
|
|
19
|
+
Requires-Dist: openai>=1.0.0
|
|
20
|
+
Requires-Dist: pydantic>=2.5.0
|
|
21
|
+
Requires-Dist: pygments>=2.19.1
|
|
22
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
23
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
24
|
+
Requires-Dist: tree-sitter-typescript>=0.23.2
|
|
25
|
+
Requires-Dist: tree-sitter>=0.24.0
|
|
26
|
+
Provides-Extra: test
|
|
27
|
+
Requires-Dist: coverage>=7.0.0; extra == 'test'
|
|
28
|
+
Requires-Dist: flake8>=6.0.0; extra == 'test'
|
|
29
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
|
|
30
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
|
|
31
|
+
Requires-Dist: pytest>=7.0.0; extra == 'test'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Autotester
|
|
35
|
+
|
|
36
|
+
[](https://github.com/cyberwaveos/autotester/blob/main/LICENSE)
|
|
37
|
+
[](https://discord.gg/4QMwWdsMGt)
|
|
38
|
+
[](https://docs.autotester.com)
|
|
39
|
+
<a href="https://github.com/cyberwaveos/autotester/commits/main">
|
|
40
|
+
<img alt="GitHub" src="https://img.shields.io/github/last-commit/cyberwaveos/autotester/main?style=for-the-badge" height="20">
|
|
41
|
+
</a><br>
|
|
42
|
+
|
|
43
|
+
Autotester is an open-source testing automation tool to make E2E automated.
|
|
44
|
+
|
|
45
|
+
- 🤖 **Run end-to-end tests** using natural language descriptions
|
|
46
|
+
- 🐛 **Detect potential bugs** and provide detailed fix explanations
|
|
47
|
+
- ⚡ **Reduce testing overhead** while improving code quality
|
|
48
|
+
|
|
49
|
+
Currently supporting Python and TypeScript, with more languages coming soon.
|
|
50
|
+
|
|
51
|
+
## Quickstart
|
|
52
|
+
|
|
53
|
+
Install the package
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install autotester
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Add a config file to your project called `autotester.yml`. This tells Autotester what to test and how.
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
e2e:
|
|
63
|
+
login-test: # Name of the test. You can add more
|
|
64
|
+
url: "localhost:3000" # Starting URL of your app. It can be a local server or a remote server
|
|
65
|
+
steps:
|
|
66
|
+
- Login with Github
|
|
67
|
+
- Go to the team page
|
|
68
|
+
- Change the team name to "e2e"
|
|
69
|
+
- Click on the "Save" button
|
|
70
|
+
- Check that the team name is "e2e" # use words like "Check that" to assert the results of the test
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If your environment is protected by **HTTP Basic Auth**, add an `auth` block:
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
e2e:
|
|
77
|
+
auth:
|
|
78
|
+
type: basic
|
|
79
|
+
username: "dev"
|
|
80
|
+
password: "dev123"
|
|
81
|
+
login-test:
|
|
82
|
+
url: "https://staging.example.com"
|
|
83
|
+
steps:
|
|
84
|
+
- Check the homepage loads
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
You can also provide auth credentials via environment variables (these take precedence over YAML):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
export AUTOTESTER_AUTH_USERNAME="dev"
|
|
91
|
+
export AUTOTESTER_AUTH_PASSWORD="dev123"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
That's it. To run it, you need to have an OpenAI API key and Chrome installed.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
export OPENAI_API_KEY="your-openai-api-key"
|
|
98
|
+
autotester
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
You will get a summary report like the following:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
|
|
106
|
+
🖥️ 1/1 E2E tests
|
|
107
|
+
|
|
108
|
+
login-test: Success!
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## GitHub Action
|
|
112
|
+
|
|
113
|
+
Autotester can be used in a [GitHub Action](https://github.com/cyberwave-os/autotester-action) to run E2E tests after you release a new version.
|
|
114
|
+
|
|
115
|
+
Check out the action's [README](https://github.com/cyberwave-os/autotester-action/blob/main/README.md) for more information, but here's a quick example:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
name: Run Autotester
|
|
119
|
+
|
|
120
|
+
on:
|
|
121
|
+
pull_request:
|
|
122
|
+
types: [opened, synchronize, reopened]
|
|
123
|
+
|
|
124
|
+
jobs:
|
|
125
|
+
after-deployment:
|
|
126
|
+
runs-on: ubuntu-latest
|
|
127
|
+
steps:
|
|
128
|
+
- uses: cyberwave-os/autotester-action@v0.1.0
|
|
129
|
+
with:
|
|
130
|
+
action-type: "e2e"
|
|
131
|
+
env:
|
|
132
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
133
|
+
STARTING_URL: "http://yourstaging.yourwebsite.com"
|
|
134
|
+
# Optional: for Basic Auth protected environments
|
|
135
|
+
# AUTOTESTER_AUTH_USERNAME: ${{ secrets.AUTOTESTER_AUTH_USERNAME }}
|
|
136
|
+
# AUTOTESTER_AUTH_PASSWORD: ${{ secrets.AUTOTESTER_AUTH_PASSWORD }}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## CLI Reference
|
|
140
|
+
|
|
141
|
+
### Commands
|
|
142
|
+
|
|
143
|
+
- `autotester`: Without any command, runs E2E tests if defined in autotester.yml
|
|
144
|
+
- `autotester e2e`: Runs end-to-end tests defined in autotester.yml
|
|
145
|
+
|
|
146
|
+
### Command Options
|
|
147
|
+
|
|
148
|
+
#### Global Options
|
|
149
|
+
|
|
150
|
+
- `-v, --verbose`: Enable verbose logging output
|
|
151
|
+
- `--version`: Display Autotester version number
|
|
152
|
+
|
|
153
|
+
#### E2E Test Command
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
autotester e2e [--config <config_file>] [--verbose]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
- `--config`: (Optional) Path to the YAML configuration file (defaults to autotester.yml)
|
|
160
|
+
- `-v, --verbose`: (Optional) Enable verbose logging output
|
|
161
|
+
|
|
162
|
+
### Environment Variables
|
|
163
|
+
|
|
164
|
+
- `OPENAI_API_KEY`: (Required) Your OpenAI API key
|
|
165
|
+
- `CHROME_INSTANCE_PATH`: Path to your Chrome instance. Defaults to `/Applications/Google Chrome.app/Contents/MacOS/Google Chrome`
|
|
166
|
+
- `AUTOTESTER_AUTH_USERNAME`: Username for HTTP Basic Auth (overrides `auth.username` in YAML)
|
|
167
|
+
- `AUTOTESTER_AUTH_PASSWORD`: Password for HTTP Basic Auth (overrides `auth.password` in YAML)
|
|
168
|
+
|
|
169
|
+
## Run Tests with Docker
|
|
170
|
+
|
|
171
|
+
For contributors who want a reproducible test environment, you can run the test suite in Docker.
|
|
172
|
+
|
|
173
|
+
From the repository root:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
make test-docker
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
This command mounts your local project into the container and runs `pytest`.
|
|
180
|
+
If you want to build manually first:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
make test-docker-build
|
|
184
|
+
docker compose -f tests/docker-compose.yml run --rm test
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Roadmap
|
|
188
|
+
|
|
189
|
+
- [x] Add support for simple auth, since test environment often have auth.
|
|
190
|
+
- [ ] Add support for screen recording with Posthog, so that QA engineers can easily review failed tests.
|
|
191
|
+
|
|
192
|
+
## Credits
|
|
193
|
+
|
|
194
|
+
- [Powered by BrowserUse](https://github.com/browser-use/browser-use)
|
|
195
|
+
- This project evolved from an earlier open-source project developed by Tailor Media Inc, relased under Apache 2.0 [Codebeaver](https://github.com/codebeaver-ai/codebeaver-ai)
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Autotester
|
|
2
|
+
|
|
3
|
+
[](https://github.com/cyberwaveos/autotester/blob/main/LICENSE)
|
|
4
|
+
[](https://discord.gg/4QMwWdsMGt)
|
|
5
|
+
[](https://docs.autotester.com)
|
|
6
|
+
<a href="https://github.com/cyberwaveos/autotester/commits/main">
|
|
7
|
+
<img alt="GitHub" src="https://img.shields.io/github/last-commit/cyberwaveos/autotester/main?style=for-the-badge" height="20">
|
|
8
|
+
</a><br>
|
|
9
|
+
|
|
10
|
+
Autotester is an open-source testing automation tool to make E2E automated.
|
|
11
|
+
|
|
12
|
+
- 🤖 **Run end-to-end tests** using natural language descriptions
|
|
13
|
+
- 🐛 **Detect potential bugs** and provide detailed fix explanations
|
|
14
|
+
- ⚡ **Reduce testing overhead** while improving code quality
|
|
15
|
+
|
|
16
|
+
Currently supporting Python and TypeScript, with more languages coming soon.
|
|
17
|
+
|
|
18
|
+
## Quickstart
|
|
19
|
+
|
|
20
|
+
Install the package
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install autotester
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Add a config file to your project called `autotester.yml`. This tells Autotester what to test and how.
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
e2e:
|
|
30
|
+
login-test: # Name of the test. You can add more
|
|
31
|
+
url: "localhost:3000" # Starting URL of your app. It can be a local server or a remote server
|
|
32
|
+
steps:
|
|
33
|
+
- Login with Github
|
|
34
|
+
- Go to the team page
|
|
35
|
+
- Change the team name to "e2e"
|
|
36
|
+
- Click on the "Save" button
|
|
37
|
+
- Check that the team name is "e2e" # use words like "Check that" to assert the results of the test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If your environment is protected by **HTTP Basic Auth**, add an `auth` block:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
e2e:
|
|
44
|
+
auth:
|
|
45
|
+
type: basic
|
|
46
|
+
username: "dev"
|
|
47
|
+
password: "dev123"
|
|
48
|
+
login-test:
|
|
49
|
+
url: "https://staging.example.com"
|
|
50
|
+
steps:
|
|
51
|
+
- Check the homepage loads
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
You can also provide auth credentials via environment variables (these take precedence over YAML):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
export AUTOTESTER_AUTH_USERNAME="dev"
|
|
58
|
+
export AUTOTESTER_AUTH_PASSWORD="dev123"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
That's it. To run it, you need to have an OpenAI API key and Chrome installed.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
export OPENAI_API_KEY="your-openai-api-key"
|
|
65
|
+
autotester
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
You will get a summary report like the following:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
|
|
73
|
+
🖥️ 1/1 E2E tests
|
|
74
|
+
|
|
75
|
+
login-test: Success!
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## GitHub Action
|
|
79
|
+
|
|
80
|
+
Autotester can be used in a [GitHub Action](https://github.com/cyberwave-os/autotester-action) to run E2E tests after you release a new version.
|
|
81
|
+
|
|
82
|
+
Check out the action's [README](https://github.com/cyberwave-os/autotester-action/blob/main/README.md) for more information, but here's a quick example:
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
name: Run Autotester
|
|
86
|
+
|
|
87
|
+
on:
|
|
88
|
+
pull_request:
|
|
89
|
+
types: [opened, synchronize, reopened]
|
|
90
|
+
|
|
91
|
+
jobs:
|
|
92
|
+
after-deployment:
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
steps:
|
|
95
|
+
- uses: cyberwave-os/autotester-action@v0.1.0
|
|
96
|
+
with:
|
|
97
|
+
action-type: "e2e"
|
|
98
|
+
env:
|
|
99
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
100
|
+
STARTING_URL: "http://yourstaging.yourwebsite.com"
|
|
101
|
+
# Optional: for Basic Auth protected environments
|
|
102
|
+
# AUTOTESTER_AUTH_USERNAME: ${{ secrets.AUTOTESTER_AUTH_USERNAME }}
|
|
103
|
+
# AUTOTESTER_AUTH_PASSWORD: ${{ secrets.AUTOTESTER_AUTH_PASSWORD }}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## CLI Reference
|
|
107
|
+
|
|
108
|
+
### Commands
|
|
109
|
+
|
|
110
|
+
- `autotester`: Without any command, runs E2E tests if defined in autotester.yml
|
|
111
|
+
- `autotester e2e`: Runs end-to-end tests defined in autotester.yml
|
|
112
|
+
|
|
113
|
+
### Command Options
|
|
114
|
+
|
|
115
|
+
#### Global Options
|
|
116
|
+
|
|
117
|
+
- `-v, --verbose`: Enable verbose logging output
|
|
118
|
+
- `--version`: Display Autotester version number
|
|
119
|
+
|
|
120
|
+
#### E2E Test Command
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
autotester e2e [--config <config_file>] [--verbose]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- `--config`: (Optional) Path to the YAML configuration file (defaults to autotester.yml)
|
|
127
|
+
- `-v, --verbose`: (Optional) Enable verbose logging output
|
|
128
|
+
|
|
129
|
+
### Environment Variables
|
|
130
|
+
|
|
131
|
+
- `OPENAI_API_KEY`: (Required) Your OpenAI API key
|
|
132
|
+
- `CHROME_INSTANCE_PATH`: Path to your Chrome instance. Defaults to `/Applications/Google Chrome.app/Contents/MacOS/Google Chrome`
|
|
133
|
+
- `AUTOTESTER_AUTH_USERNAME`: Username for HTTP Basic Auth (overrides `auth.username` in YAML)
|
|
134
|
+
- `AUTOTESTER_AUTH_PASSWORD`: Password for HTTP Basic Auth (overrides `auth.password` in YAML)
|
|
135
|
+
|
|
136
|
+
## Run Tests with Docker
|
|
137
|
+
|
|
138
|
+
For contributors who want a reproducible test environment, you can run the test suite in Docker.
|
|
139
|
+
|
|
140
|
+
From the repository root:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
make test-docker
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
This command mounts your local project into the container and runs `pytest`.
|
|
147
|
+
If you want to build manually first:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
make test-docker-build
|
|
151
|
+
docker compose -f tests/docker-compose.yml run --rm test
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Roadmap
|
|
155
|
+
|
|
156
|
+
- [x] Add support for simple auth, since test environment often have auth.
|
|
157
|
+
- [ ] Add support for screen recording with Posthog, so that QA engineers can easily review failed tests.
|
|
158
|
+
|
|
159
|
+
## Credits
|
|
160
|
+
|
|
161
|
+
- [Powered by BrowserUse](https://github.com/browser-use/browser-use)
|
|
162
|
+
- This project evolved from an earlier open-source project developed by Tailor Media Inc, relased under Apache 2.0 [Codebeaver](https://github.com/codebeaver-ai/codebeaver-ai)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "autotester"
|
|
7
|
+
version = "0.0.6"
|
|
8
|
+
description = "Autotester - E2E testing for your codebase"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Cyberwave Team", email = "info@cyberwave.com" }
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"pyyaml>=6.0.0",
|
|
24
|
+
"openai>=1.0.0",
|
|
25
|
+
"tree-sitter>=0.24.0",
|
|
26
|
+
"tree-sitter-typescript>=0.23.2",
|
|
27
|
+
"Pygments>=2.19.1",
|
|
28
|
+
"pydantic>=2.5.0",
|
|
29
|
+
"python-dotenv>=1.0.0",
|
|
30
|
+
"aiohttp>=3.9.0",
|
|
31
|
+
"browser-use>=0.12.1",
|
|
32
|
+
"dotenv>=0.9.9",
|
|
33
|
+
"black>=23.0.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
test = [
|
|
38
|
+
"pytest>=7.0.0",
|
|
39
|
+
"coverage>=7.0.0",
|
|
40
|
+
"pytest-cov>=4.0.0",
|
|
41
|
+
"flake8>=6.0.0",
|
|
42
|
+
"pytest-asyncio>=0.21.0",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Repository = "https://github.com/cyberwaveos/autotester"
|
|
47
|
+
Issues = "https://github.com/cyberwaveos/autotester/issues"
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
autotester = "autotester.cli:main"
|
|
51
|
+
|
|
52
|
+
[tool.pytest.ini_options]
|
|
53
|
+
testpaths = ["tests"]
|
|
54
|
+
python_files = ["test_*.py"]
|
|
55
|
+
norecursedirs = ["tests/codebases"]
|
|
56
|
+
filterwarnings = [
|
|
57
|
+
"ignore:cannot collect test class 'TestCase':pytest.PytestCollectionWarning",
|
|
58
|
+
"ignore:cannot collect test class 'TestErrorType':pytest.PytestCollectionWarning",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.hatch.build.targets.wheel]
|
|
62
|
+
packages = ["src/autotester"]
|
|
63
|
+
|
|
64
|
+
[tool.hatch.build.targets.sdist]
|
|
65
|
+
include = ["src/autotester"]
|
|
66
|
+
|
|
67
|
+
[tool.hatch.build.targets.wheel.sources]
|
|
68
|
+
"src/autotester" = "autotester"
|