Name | excelbdd JSON |
Version |
1.4.9
JSON |
| download |
home_page | |
Summary | conduct BDD by excel feature files |
upload_time | 2024-01-19 13:29:25 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.9 |
license | |
keywords |
bdd
excel
sbe
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Use Excel file as BDD feature file, get example data from excel files, support automation tests
V1.4.9 changes:
columns are not selected after a blank header is present in bdd format.
behavior is removed, use excelbdd instead, as below.
old: from excelbdd.behavior import get_example_list
new: from excelbdd import excelbdd
```
#pip install excelbdd
import pytest
from excelbdd import excelbdd
import FizzBuzz
excelBDDFile = "path of excel file"
@pytest.mark.parametrize("HeaderName, Number1, Output1, Number2, Output2, Number3, Output3, Number4, Output4",
excelbdd.get_example_list(excelBDDFile,"FizzBuzz"))
def test_FizzBuzz(HeaderName, Number1, Output1, Number2, Output2, Number3, Output3, Number4, Output4):
assert FizzBuzz.handle(Number1) == Output1
assert FizzBuzz.handle(Number2) == Output2
assert FizzBuzz.handle(Number3) == Output3
assert FizzBuzz.handle(Number4) == Output4
```
Get data from table in Excel, similar to get from csv file
```
from excelbdd import excelbdd
@pytest.mark.parametrize("Header01, Header02, Header03, Header04, Header05, Header06, Header07, Header08",
excelbdd.get_example_table(excelBDDFile, "DataTable4"))
def test_get_example_tableB(Header01, Header02, Header03, Header04, Header05, Header06, Header07, Header08):
print(Header01, Header02, Header03, Header04, Header05, Header06, Header07, Header08)
# add test code here
```
"Specification by testcase" is supported. the bdd excel files can be regarded as the test reports.
The test format in excel is detected automatically, only extra parameters(expected, test result) are needed to take into test method.
Python unittest is also supported by ExcelBDD.
```
import unittest
from excelbdd import excelbdd
from parameterized import parameterized
class ExcelBDDTest(unittest.TestCase):
@parameterized.expand(excelbdd.get_example_list(excelBDDFile))
def test_get_example_tableB(self, HeaderName, ParamName1, ParamName2, ParamName3, ParamName4):
print(HeaderName, ParamName1, ParamName2, ParamName3, ParamName4)
# add test code here
self.assertEqual(ParamName1, "P1")
self.assertEqual(ParamName3, None)
```
more information at [ExcelBDD Python Guideline](https://dev.azure.com/simplopen/ExcelBDD/_wiki/wikis/ExcelBDD.wiki/80/ExcelBDD-Python-Guideline)
Raw data
{
"_id": null,
"home_page": "",
"name": "excelbdd",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "BDD,Excel,SBE",
"author": "",
"author_email": "Zhang Keqiang Mike <zhangkq2000@hotmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c3/20/ab4eafe776b35cd9dd1bd46ca884b19abcacfa40ffe0987ed90bb2d8d583/excelbdd-1.4.9.tar.gz",
"platform": null,
"description": "Use Excel file as BDD feature file, get example data from excel files, support automation tests\r\n\r\nV1.4.9 changes:\r\n columns are not selected after a blank header is present in bdd format.\r\n behavior is removed, use excelbdd instead, as below.\r\n old: from excelbdd.behavior import get_example_list\r\n new: from excelbdd import excelbdd\r\n```\r\n#pip install excelbdd\r\nimport pytest\r\nfrom excelbdd import excelbdd\r\nimport FizzBuzz\r\n\r\nexcelBDDFile = \"path of excel file\" \r\n@pytest.mark.parametrize(\"HeaderName, Number1, Output1, Number2, Output2, Number3, Output3, Number4, Output4\",\r\n excelbdd.get_example_list(excelBDDFile,\"FizzBuzz\"))\r\ndef test_FizzBuzz(HeaderName, Number1, Output1, Number2, Output2, Number3, Output3, Number4, Output4):\r\n assert FizzBuzz.handle(Number1) == Output1\r\n assert FizzBuzz.handle(Number2) == Output2\r\n assert FizzBuzz.handle(Number3) == Output3\r\n assert FizzBuzz.handle(Number4) == Output4\r\n``` \r\n\r\nGet data from table in Excel, similar to get from csv file\r\n\r\n```\r\nfrom excelbdd import excelbdd\r\n@pytest.mark.parametrize(\"Header01, Header02, Header03, Header04, Header05, Header06, Header07, Header08\",\r\n excelbdd.get_example_table(excelBDDFile, \"DataTable4\"))\r\ndef test_get_example_tableB(Header01, Header02, Header03, Header04, Header05, Header06, Header07, Header08):\r\n print(Header01, Header02, Header03, Header04, Header05, Header06, Header07, Header08)\r\n # add test code here\r\n```\r\n\r\n\"Specification by testcase\" is supported. the bdd excel files can be regarded as the test reports. \r\nThe test format in excel is detected automatically, only extra parameters(expected, test result) are needed to take into test method.\r\n\r\nPython unittest is also supported by ExcelBDD.\r\n```\r\nimport unittest\r\nfrom excelbdd import excelbdd\r\nfrom parameterized import parameterized\r\n\r\nclass ExcelBDDTest(unittest.TestCase):\r\n @parameterized.expand(excelbdd.get_example_list(excelBDDFile))\r\n def test_get_example_tableB(self, HeaderName, ParamName1, ParamName2, ParamName3, ParamName4):\r\n print(HeaderName, ParamName1, ParamName2, ParamName3, ParamName4)\r\n # add test code here\r\n self.assertEqual(ParamName1, \"P1\")\r\n self.assertEqual(ParamName3, None)\r\n\r\n```\r\n\r\n \r\nmore information at [ExcelBDD Python Guideline](https://dev.azure.com/simplopen/ExcelBDD/_wiki/wikis/ExcelBDD.wiki/80/ExcelBDD-Python-Guideline)\r\n",
"bugtrack_url": null,
"license": "",
"summary": "conduct BDD by excel feature files",
"version": "1.4.9",
"project_urls": null,
"split_keywords": [
"bdd",
"excel",
"sbe"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c4234344d0e001167d75c2413f05fc843fb4116a2f8e077a248281da0e9c7c12",
"md5": "e3ebbad32b6753c93a3e2780d58fe591",
"sha256": "7143ebb4e2a3bf2bd0156c24c7512ee1ff722729e6bfbe894eb2f1c39b273d17"
},
"downloads": -1,
"filename": "excelbdd-1.4.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e3ebbad32b6753c93a3e2780d58fe591",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 3789,
"upload_time": "2024-01-19T13:29:24",
"upload_time_iso_8601": "2024-01-19T13:29:24.163004Z",
"url": "https://files.pythonhosted.org/packages/c4/23/4344d0e001167d75c2413f05fc843fb4116a2f8e077a248281da0e9c7c12/excelbdd-1.4.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c320ab4eafe776b35cd9dd1bd46ca884b19abcacfa40ffe0987ed90bb2d8d583",
"md5": "55a17e1b5b01dd9c58b7defa46601658",
"sha256": "135a7cd9a16b98a6b9bb4369a56d60cc7c512e2b0990efe485cd322d41cd16aa"
},
"downloads": -1,
"filename": "excelbdd-1.4.9.tar.gz",
"has_sig": false,
"md5_digest": "55a17e1b5b01dd9c58b7defa46601658",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 4984,
"upload_time": "2024-01-19T13:29:25",
"upload_time_iso_8601": "2024-01-19T13:29:25.363473Z",
"url": "https://files.pythonhosted.org/packages/c3/20/ab4eafe776b35cd9dd1bd46ca884b19abcacfa40ffe0987ed90bb2d8d583/excelbdd-1.4.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 13:29:25",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "excelbdd"
}