generator-cucumber


Namegenerator-cucumber JSON
Version 0.0.23 PyPI version JSON
download
home_pageNone
SummaryGeneration gitlab/github => .feature file
upload_time2024-08-02 17:29:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseThe MIT License (MIT) Copyright (c) 2024 Shibikin Dmitry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python cucmber generator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### Cucmber generator

Для формирования .feature файлов на основе html tags. 
Необходимую информацию для .feature файлов берем из epic/issue GitLab и GitHub.


### Установка

Вводим в терминал следующую команду
```bash
pip install generator-cucumber
```
или вносим в requirements.txt

```bash
generator-cucumber==<version>
```

### Пример работы generator-cucumber

1. Создаем epic и добавляем специальные tags (дублирующие ключевые слова языка Gherkin)

```<src-1>```  
```<src-1-1>```

```<scenario>```Напишем сценарий```</scenario>```  

```<given>```Здесь добавим given```</given>```  
```<when>```Здесь добавим when```</when>```  
```<then>```Здесь добавим then```</then>```  

```<group>```  

```<then>```Таблица THEN```<groupin>``` ```</groupin>``` ```</then>```

|Наименование                     |Что-то|
|---------------------------------|------|
|```<examples>```Первый```</examples>```      |1     |
|```<examples>```Второй```</examples>```      |2     |
|```<examples>```Третий```</examples>```      |3     |

```</group>```

```</src-1-1>```  
```</src-1>```  

2. В GitLab Epic будет выглядить следующим образом

<src-1>
<src-1-1>

<scenario>Напишем сценарий</scenario>  

<given>Здесь добавим given</given>  
<when>Здесь добавим when</when>  
<then>Здесь добавим then</then>  

<group>
<then>Таблица THEN <groupin></groupin></then>  

|Наименование                     |Что-то|
|---------------------------------|------|
|<examples>Первый</examples>      |1     |
|<examples>Второй</examples>      |2     |
|<examples>Третий</examples>      |3     |

</group>

</src-1-1>
</src-1>

3. После установки generator-cucumber создаем тест (например test_example.py)

```python
from generator_cucumber import Generator

Generator.URL_GIT = 'https://gitlab.com/' # url развернутого gitlab
Generator.PRIVATE_TOKEN_GIT = 'gsdff-sdx5DkswkqSDFSSQnVL' #'здесь необходим ваш access token (для примeра)

Generator.create_cucumber(
    group_id=100, # номер группы в которой написан epic
    epi_iid=1, # номер  epic
    name_file='test_lib', # наименование файла .feature (любое удобное)
    scenario_number='src-1-1', # текст к которому относиться тест
    ssl_verify=True # если все ок с ssl, по умолчанию false
)
```

3. После запуска теста сформируется .feature файл и папка __featurecache__ для контроля изменений в тексте 

```
# https://gitlab.com/python_epic/test_pr/-/epic/1
# Di
# 2024-08-01T01:48:53.366Z

Feature: Тестируем lib

    Scenario: Напишем сценарий

        Given Здесь добавим given

        When Здесь добавим when

        Then Таблица THEN  "<col_1>", "<col_2>", "<col_3>"
 
            Examples: col_1, col_2, col_3
                | col_1 | col_2 | col_3 |
                | Первый | Второй | Третий |
```

### Html tags
| gherkin equivalent |  HTML equivalent                           |
|--------------------|--------------------------------------------|
|"and"               |```<and></and>```                           |
|"background"        |```<background></background>```             |
|"but"               |```<but></but>```                           |
|"examples"          |```<examples></examples>```                 |
|"feature"           |```<feature></feature>```                   |
|"given"             |```<given></given>```                       |
|"scenario"          |```<scenario></scenario>```                 |
|"scenarioOutline"   |```<scenariooutline></scenariooutline>```   |
|"then"              |```<then></then>```                         |
|"when"              |```<when></when>```                         |

### Html tags ➕
| gherkin equivalent |  HTML equivalent (tags)                    | Описание                                                |
|--------------------|--------------------------------------------|---------------------------------------------------------|
|"groupin"           |```<groupin></groupin>```                   | Место куда поставиться examples                         |
|"scr-1-1"           |```<scr-1-1></scr-1-1>```                   | Для ограничения места для генерации (номер условный)    |

### Стуктура проекта
```
# Проект по генерации .feature
├── 📁 generator_cucumber/
|   ├── 🐍 api_github.py        # для работы с github (не реализован)
|   ├── 🐍 api_gitlab.py        # Для работы с gitlab
|   ├── 🐍 bdd_generator.py     # Для работы с .py и подготовка шаблона bdd
|   ├── 🐍 cache_file.py        # создание файлов cache
|   ├── 🐍 create_file.py       # Обработка файлов cache и .feature
|   ├── 🐍 cucumber_text.py     # Формирование .feature текст
|   └── 🐍 generator.py         # входная точка
└── ... 
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "generator-cucumber",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, cucmber, generator",
    "author": null,
    "author_email": "Dmitry Shibikin <dmitry.shibikin@yandex.ru>",
    "download_url": "https://files.pythonhosted.org/packages/8a/cd/520b974df823a6425b1811758830c331f1d37ce166c2921b900d16e63ac3/generator_cucumber-0.0.23.tar.gz",
    "platform": null,
    "description": "### Cucmber generator\n\n\u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .feature \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 html tags. \n\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f .feature \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0435\u0440\u0435\u043c \u0438\u0437 epic/issue GitLab \u0438 GitHub.\n\n\n### \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\n\n\u0412\u0432\u043e\u0434\u0438\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443\n```bash\npip install generator-cucumber\n```\n\u0438\u043b\u0438 \u0432\u043d\u043e\u0441\u0438\u043c \u0432 requirements.txt\n\n```bash\ngenerator-cucumber==<version>\n```\n\n### \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b generator-cucumber\n\n1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c epic \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 tags (\u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u044f\u0437\u044b\u043a\u0430 Gherkin)\n\n```<src-1>```  \n```<src-1-1>```\n\n```<scenario>```\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439```</scenario>```  \n\n```<given>```\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c given```</given>```  \n```<when>```\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c when```</when>```  \n```<then>```\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c then```</then>```  \n\n```<group>```  \n\n```<then>```\u0422\u0430\u0431\u043b\u0438\u0446\u0430 THEN```<groupin>``` ```</groupin>``` ```</then>```\n\n|\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435                     |\u0427\u0442\u043e-\u0442\u043e|\n|---------------------------------|------|\n|```<examples>```\u041f\u0435\u0440\u0432\u044b\u0439```</examples>```      |1     |\n|```<examples>```\u0412\u0442\u043e\u0440\u043e\u0439```</examples>```      |2     |\n|```<examples>```\u0422\u0440\u0435\u0442\u0438\u0439```</examples>```      |3     |\n\n```</group>```\n\n```</src-1-1>```  \n```</src-1>```  \n\n2. \u0412 GitLab Epic \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c\n\n<src-1>\n<src-1-1>\n\n<scenario>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439</scenario>  \n\n<given>\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c given</given>  \n<when>\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c when</when>  \n<then>\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c then</then>  \n\n<group>\n<then>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 THEN <groupin></groupin></then>  \n\n|\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435                     |\u0427\u0442\u043e-\u0442\u043e|\n|---------------------------------|------|\n|<examples>\u041f\u0435\u0440\u0432\u044b\u0439</examples>      |1     |\n|<examples>\u0412\u0442\u043e\u0440\u043e\u0439</examples>      |2     |\n|<examples>\u0422\u0440\u0435\u0442\u0438\u0439</examples>      |3     |\n\n</group>\n\n</src-1-1>\n</src-1>\n\n3. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 generator-cucumber \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u0441\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 test_example.py)\n\n```python\nfrom generator_cucumber import Generator\n\nGenerator.URL_GIT = 'https://gitlab.com/' # url \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u0433\u043e gitlab\nGenerator.PRIVATE_TOKEN_GIT = 'gsdff-sdx5DkswkqSDFSSQnVL' #'\u0437\u0434\u0435\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0432\u0430\u0448 access token (\u0434\u043b\u044f \u043f\u0440\u0438\u043ce\u0440\u0430)\n\nGenerator.create_cucumber(\n    group_id=100, # \u043d\u043e\u043c\u0435\u0440 \u0433\u0440\u0443\u043f\u043f\u044b \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d epic\n    epi_iid=1, # \u043d\u043e\u043c\u0435\u0440  epic\n    name_file='test_lib', # \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 .feature (\u043b\u044e\u0431\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435)\n    scenario_number='src-1-1', # \u0442\u0435\u043a\u0441\u0442 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\n    ssl_verify=True # \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u043a \u0441 ssl, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e false\n)\n```\n\n3. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f .feature \u0444\u0430\u0439\u043b \u0438 \u043f\u0430\u043f\u043a\u0430 __featurecache__ \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \n\n```\n# https://gitlab.com/python_epic/test_pr/-/epic/1\n# Di\n# 2024-08-01T01:48:53.366Z\n\nFeature: \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c lib\n\n    Scenario: \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439\n\n        Given \u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c given\n\n        When \u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c when\n\n        Then \u0422\u0430\u0431\u043b\u0438\u0446\u0430 THEN  \"<col_1>\", \"<col_2>\", \"<col_3>\"\n \n            Examples: col_1, col_2, col_3\n                | col_1 | col_2 | col_3 |\n                | \u041f\u0435\u0440\u0432\u044b\u0439 | \u0412\u0442\u043e\u0440\u043e\u0439 | \u0422\u0440\u0435\u0442\u0438\u0439 |\n```\n\n### Html tags\n| gherkin equivalent |  HTML equivalent                           |\n|--------------------|--------------------------------------------|\n|\"and\"               |```<and></and>```                           |\n|\"background\"        |```<background></background>```             |\n|\"but\"               |```<but></but>```                           |\n|\"examples\"          |```<examples></examples>```                 |\n|\"feature\"           |```<feature></feature>```                   |\n|\"given\"             |```<given></given>```                       |\n|\"scenario\"          |```<scenario></scenario>```                 |\n|\"scenarioOutline\"   |```<scenariooutline></scenariooutline>```   |\n|\"then\"              |```<then></then>```                         |\n|\"when\"              |```<when></when>```                         |\n\n### Html tags \u2795\n| gherkin equivalent |  HTML equivalent (tags)                    | \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                                                |\n|--------------------|--------------------------------------------|---------------------------------------------------------|\n|\"groupin\"           |```<groupin></groupin>```                   | \u041c\u0435\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0441\u044f examples                         |\n|\"scr-1-1\"           |```<scr-1-1></scr-1-1>```                   | \u0414\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0441\u0442\u0430 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 (\u043d\u043e\u043c\u0435\u0440 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439)    |\n\n### \u0421\u0442\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\n```\n# \u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 .feature\n\u251c\u2500\u2500 \ud83d\udcc1 generator_cucumber/\n|   \u251c\u2500\u2500 \ud83d\udc0d api_github.py        # \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 github (\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d)\n|   \u251c\u2500\u2500 \ud83d\udc0d api_gitlab.py        # \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 gitlab\n|   \u251c\u2500\u2500 \ud83d\udc0d bdd_generator.py     # \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 .py \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 bdd\n|   \u251c\u2500\u2500 \ud83d\udc0d cache_file.py        # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 cache\n|   \u251c\u2500\u2500 \ud83d\udc0d create_file.py       # \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 cache \u0438 .feature\n|   \u251c\u2500\u2500 \ud83d\udc0d cucumber_text.py     # \u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 .feature \u0442\u0435\u043a\u0441\u0442\n|   \u2514\u2500\u2500 \ud83d\udc0d generator.py         # \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430\n\u2514\u2500\u2500 ... \n```\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2024 Shibikin Dmitry  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Generation gitlab/github => .feature file",
    "version": "0.0.23",
    "project_urls": {
        "Documentation": "https://bdd-generator.readthedocs.io/ru/latest/",
        "Homepage": "https://gitlab.com/python_lib/generator_cucumber",
        "Repository": "https://gitlab.com/python_lib/generator_cucumber"
    },
    "split_keywords": [
        "python",
        " cucmber",
        " generator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "72747f1ea2090b5372bed3797ed6b4c7a2fc36f27e3d70e924b5254068108809",
                "md5": "9e333fdcd6affd821d59c5e74ab95d39",
                "sha256": "5358d04ff11de68b86656ad4822baa6e962afa00ab0eb4c88928168cb769905c"
            },
            "downloads": -1,
            "filename": "generator_cucumber-0.0.23-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9e333fdcd6affd821d59c5e74ab95d39",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14245,
            "upload_time": "2024-08-02T17:29:57",
            "upload_time_iso_8601": "2024-08-02T17:29:57.620197Z",
            "url": "https://files.pythonhosted.org/packages/72/74/7f1ea2090b5372bed3797ed6b4c7a2fc36f27e3d70e924b5254068108809/generator_cucumber-0.0.23-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8acd520b974df823a6425b1811758830c331f1d37ce166c2921b900d16e63ac3",
                "md5": "d490fd6bba8281e7e724affb36756402",
                "sha256": "bcf6aceed560324b6dd69454f79ab28b2e8b9c1c85868088df54d881f7c673e8"
            },
            "downloads": -1,
            "filename": "generator_cucumber-0.0.23.tar.gz",
            "has_sig": false,
            "md5_digest": "d490fd6bba8281e7e724affb36756402",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 69589,
            "upload_time": "2024-08-02T17:29:59",
            "upload_time_iso_8601": "2024-08-02T17:29:59.100058Z",
            "url": "https://files.pythonhosted.org/packages/8a/cd/520b974df823a6425b1811758830c331f1d37ce166c2921b900d16e63ac3/generator_cucumber-0.0.23.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-02 17:29:59",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "python_lib",
    "gitlab_project": "generator_cucumber",
    "lcname": "generator-cucumber"
}
        
Elapsed time: 0.33357s