Implement parametrization through excel sheets based on the input arguments
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng việc xem xét các hook conftest.py được đề xuất, đặc biệt là pytest_addoption và pytest_generate_tests, cùng với đường dẫn Excel iban/data/Licenses.xlsx. Làm rõ liệu --env nên chọn một sheet hay mỗi scenario nên được chạy trên qa, uat và prod; hoàn tất khi việc chọn environment dự kiến hoạt động với scenario được tham số hóa đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
My Scenario is parameterized and I want to select the parameter value from EXCEL. I want to select sheets in the excel based on environment provided qa,uat,prod .Is there any way to dynamically select sheet value to run the parameterised tests.
Scenario: Verify Licenses
Given the <user> is logged in with <password>
Then the response should show <status>
Referring to the issue @ https://github.com/pytest-dev/pytest/issues/6374, I have added the following
In conftest.py
def pytest_addoption(parser):
parser.addoption('--env',
dest='testenv',
choices=["qa","uat","prod"],
default='qa',
help='Specify environment:"qa", "uat", "prod"')
@lru_cache(maxsize = 128)
def get_env(env):
wbinput = openpyxl.load_workbook('iban/data/Licenses.xlsx')
sheetip= wbinput[env] # sheet to select based on env
maxRow=sheetip.max_row
inputData = [tuple(sheetip.cell(row=i,column=j).value for j in range(1,3)) for i in range(2,maxRow+1)]
return inputData
# this code doesnot suite me, as I have no markers for my scenario. My scenario should run for all env values but take the correponding env value for each env.
def pytest_generate_tests(metafunc):
if "env" in metafunc.fixturenames:
metafunc.parametrize("env", get_env(metafunc.config.getoption("env")))
Any help is much appreciated.
- Ngôn ngữ chính
- Python
- Star
- 1.5k
- Fork
- 253
- Merge trung bình
- 4 giờ 30 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytest-dev/pytest-bdd
-
New release to update `gherkin`?Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pytest-dev/pytest-bdd#838 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
pytest-dev/pytest-bdd#805 ·
-
YAML support removed in v8Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
pytest-dev/pytest-bdd#785 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
pytest-dev/pytest-bdd#784 ·
-
Tests with failing setup fixture should get the "Error" statusCó thể đã có người làm @zvarych-oleksii đã nhận 2 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
pytest-dev/pytest-bdd#782 · 1 bình luận ·
Tất cả issue của pytest-dev/pytest-bdd
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
google-agentic-commerce/AP2#388 ·
-
area:codegen backend:cuda backend:hip bug direction:input
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CrossGL/crosstl#3061 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
rlaope/oh-my-hermes#2304 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
mochan-tk/agentic-dev-kit-for-codex#64 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows ARM memory-leakĐang mởbug docs performance
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 3 ngày