Skip to content

Commit d5bf8d3

Browse files
Merge pull request #76 from QA-Automation-Starter/10-template-module-implementation
10 template module implementation
2 parents 56d2fa2 + 569fca9 commit d5bf8d3

File tree

13 files changed

+267
-2
lines changed

13 files changed

+267
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Open in Codespace or Dev Container and everything will get installed and configu
6161
pdm run install-all
6262
```
6363
> NOTE: This must be run whenever new dependencies, or versions are changed.
64+
> NOTE: in VSCode may need to reload the window in order to refresh
6465
6566
3. Run all tests from the root:
6667
```bash

cookiecutter.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"project_name": "My Project",
3+
"project_slug": "my-project",
4+
"package_name": "my_project",
5+
"version": "0.0.1",
6+
"description": "BDD automation project",
7+
"author": "Your Name"
8+
}

docs/getting-started.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ Open in Codespace or Dev Container and everything will get installed and configu
99
pipx install pdm[all]
1010
```
1111

12-
2. Fork/Clone [demo project](https://github.com/QA-Automation-Starter/qa-automation-python-demo), e.g.:
12+
2. Generate from template:
13+
```bash
14+
cookiecutter gh:QA-Automation-Starter/qa-automation-python
15+
```
16+
17+
or
18+
19+
Fork/Clone [demo project](https://github.com/QA-Automation-Starter/qa-automation-python-demo), e.g.:
1320
```bash
1421
git clone https://github.com/QA-Automation-Starter/qa-automation-python-demo.git
1522
```

qa-pytest-template/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
4+
# Python environments
5+
.venv/
6+
7+
# Distribution / packaging
8+
dist/
9+
.pdm-build
10+
.pdm-python
11+
.python-version
12+
13+
# Installer logs
14+
15+
# Unit test / coverage reports
16+
.pytest_cache/
17+
18+
# Mypy
19+
20+
# Pyre / Pytype
21+
22+
# Ruff
23+
24+
# Debugging & development
25+
*.log
26+
27+
# Notebook / IPython
28+
29+
# JupyterLite / Sphinx / docs
30+
31+
# Cython
32+
33+
# Other tools & IDEs
34+
35+
# JetBrains / PyCharm (optional - uncomment to ignore everything)
36+
#.idea/
37+
38+
# Miscellaneous
39+
allure-results
40+
report.html
41+
docs/reports/
42+
*.zip
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"recommendations": [
3+
"alphabotsec.vscode-eclipse-keybindings",
4+
"bierner.markdown-mermaid",
5+
"ms-python.autopep8",
6+
"ms-python.debugpy",
7+
"ms-python.python",
8+
"ms-python.vscode-pylance",
9+
"spmeesseman.vscode-taskexplorer",
10+
"tamasfe.even-better-toml",
11+
]
12+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"files.autoSave": "afterDelay",
3+
"files.autoSaveDelay": 1000,
4+
"python.defaultInterpreterPath": ".venv/bin/python",
5+
"python.terminal.activateEnvironment": true,
6+
"python.testing.pytestArgs": [
7+
"-s",
8+
"tests"
9+
],
10+
"python.testing.unittestEnabled": false,
11+
"python.testing.pytestEnabled": true,
12+
"python.analysis.autoImportCompletions": true,
13+
"python.analysis.typeCheckingMode": "strict",
14+
"python.analysis.diagnosticSeverityOverrides": {
15+
"reportMissingTypeStubs": "none"
16+
},
17+
"python.analysis.indexing": true,
18+
"python.analysis.completeFunctionParens": true,
19+
"python.analysis.inlayHints.variableTypes": true,
20+
"python.analysis.inlayHints.functionReturnTypes": true,
21+
"editor.rulers": [80],
22+
"editor.codeActionsOnSave": {
23+
"source.organizeImports": "always",
24+
"source.unusedImports": "always",
25+
},
26+
"[python]": {
27+
"editor.defaultFormatter": "ms-python.autopep8",
28+
"editor.formatOnSave": true
29+
},
30+
"autopep8.args": [
31+
"--max-line-length=80",
32+
"--experimental"
33+
]
34+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "clean-all",
6+
"type": "shell",
7+
"command": "pdm run clean-all",
8+
"group": "build",
9+
"problemMatcher": []
10+
},
11+
{
12+
"label": "test-all",
13+
"type": "shell",
14+
"command": "pdm run test-all",
15+
"group": "test",
16+
"problemMatcher": ["$pytest"]
17+
},
18+
{
19+
"label": "install-deps",
20+
"type": "shell",
21+
"command": "pdm run install-deps",
22+
"group": "build",
23+
"problemMatcher": []
24+
},
25+
{
26+
"label": "allure-generate",
27+
"type": "shell",
28+
"command": "pdm run allure-generate",
29+
"group": "build",
30+
"problemMatcher": []
31+
}
32+
]
33+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# {{ cookiecutter.project_name }}
2+
3+
{{ cookiecutter.description }}
4+
5+
## Setup
6+
```bash
7+
pdm install
8+
```
9+
10+
> NOTE: in VSCode you will need to reload the window in order to get tests recognized
11+
12+
## Run tests
13+
```bash
14+
pdm run pytest
15+
```
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
; SPDX-FileCopyrightText: 2025 Adrian Herscu
2+
;
3+
; SPDX-License-Identifier: Apache-2.0
4+
5+
[handlers]
6+
; NOTE: each key here must have a handler_xxx section below
7+
keys=console,overwrite_file
8+
9+
[handler_console]
10+
class=StreamHandler
11+
level=DEBUG
12+
formatter=time_level_thread_name_message
13+
args=(sys.stdout,)
14+
15+
[handler_overwrite_file]
16+
class=FileHandler
17+
level=DEBUG
18+
formatter=time_level_thread_name_message
19+
args=('pytest.log', 'w')
20+
21+
[formatters]
22+
; NOTE: each key here must have a formatter_xxx section below
23+
keys=time_level_thread_name_message
24+
25+
[formatter_time_level_thread_name_message]
26+
format=%(asctime)s [%(levelname)-1.1s] [%(threadName)-10.10s]: %(name)-14.14s - %(message)s
27+
; NOTE don't need milliseconds meanwhile, otherwise append .%03d below
28+
datefmt=%H:%M:%S
29+
30+
[loggers]
31+
keys=root,selenium,urllib3,WDM
32+
33+
[logger_root]
34+
level=DEBUG
35+
handlers=console,overwrite_file
36+
37+
[logger_selenium]
38+
level=WARNING
39+
handlers=console,overwrite_file
40+
qualname=selenium
41+
propagate=0
42+
43+
[logger_urllib3]
44+
level=DEBUG
45+
handlers=console,overwrite_file
46+
qualname=urllib3
47+
propagate=0
48+
49+
[logger_WDM]
50+
level=WARNING
51+
handlers=console,overwrite_file
52+
qualname=WDM
53+
propagate=0

0 commit comments

Comments
 (0)