Script for generating tests from Markdown files
Project description
Скрипт для генерации файлов с тестами на фрейморвке vedro по тестовым сценариям
Getting Started
WD - текущая директория
Step 1. Создать новый md-файл со сценариями
Генерация нового md-файла со сценариями в WD:
gena --md-example --md-format=md_table_format
Step 2. Создать py-файлы по сценариям
Генерация py-файлов в WD без использования интерфейса по md-файлу со сценариями в WD:
gena --template-path=$(pwd)/templates/test_template.txt --no-interface
Step 3. Создать md-файл со сценариями по py-файлам
Cгенерировать md-файл в WD по уже имеющимся тестам в TARGET_DIR и сабдиректориях:
gena --reversed --target-dir TARGET_DIR
Использование AI
Для генерации имен тестов можно использовать AI ChatGPT
Для того чтобы имена тестов были сгенерированы AI:
- запустить скрипт генерации py файлов с ключом
--ai
; - в файле сценариев поле subject должно быть не заполнено;
- должны быть определены env переменные
OPENAI_API_KEY
&OPENAI_URL
.
gena --template-path=$(pwd)/templates/test_template.txt --no-interface --ai
Форматы md-файлов
- В виде списка:
--md-format=md_list_format
- В виде таблицы:
--md-format=md_table_format
Help
usage: generate_scenarios.py [-h] [--scenarios-path SCENARIOS_PATH] [--template-path TEMPLATE_PATH] [--target-dir TARGET_DIR] [--md-example] [--ai]
[--md-format MD_FORMAT] [--force] [--reversed] [--no-interface] [--interface-only] [--yaml-path YAML_PATH]
[--interface-path INTERFACE_PATH]
Parse scenario file and generate scenario files from template.
options:
-h, --help show this help message and exit
--scenarios-path SCENARIOS_PATH
Path to the scenario file. Defaults to scenarios.md in the current directory.
--template-path TEMPLATE_PATH
Path to the test template file (used for tests generation).
--target-dir TARGET_DIR
Directory to put or read generated test files. Defaults to the directory of scenarios-path.
--md-example Generate new md-file with scenarios.
--ai Use AI to generate test file names and subjects for tests (if not exsists).
--md-format MD_FORMAT
Name of the format to use. Available scenarios.md formats are: md_list_format, md_table_format
--force Force overwrite existing files.
--reversed Create scenarios file from test files.Tests should have same story and feature.
--no-interface Generated without interface
--interface-only Generate interface only.
--yaml-path YAML_PATH
Path to the swagger yaml file. Used for interface generating.
--interface-path INTERFACE_PATH
Path to the interface file. Used for interface generating.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gena_test_generator-0.0.1.tar.gz
(18.0 kB
view hashes)
Built Distribution
Close
Hashes for gena_test_generator-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3798379bad74222fbf924b7c4cda36ccae5fd3a8b3c407806cb59450a34ef1b3 |
|
MD5 | 4411002b618fd9405d5a5f4e96bde1b1 |
|
BLAKE2b-256 | 5833e99246600f37041ee5c02132b54912890358a5f92716814012ac9f167b3a |
Close
Hashes for gena_test_generator-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89b5933be32885dcfdf307fd20eba2d4820b5ca3692a7a2c2e2271d86fe07129 |
|
MD5 | b52eb42a18ca6887e5b0e0939be6e547 |
|
BLAKE2b-256 | 8aa3e2e9fda10a089fe97a9b6bcd51711b580b2dffa82ca9055b633090473ba6 |