Step definition parses wrong parameter from feature file
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ trong feature-file với hai bước Then và And có tiền tố tương tự, sau đó kiểm tra tệp .py định nghĩa step tương ứng và cách pytest-bdd ánh xạ các step khớp. Hoàn tất khi status_code_returned nhận giá trị số của ví dụ một cách độc lập với error_message và assertion không còn phát sinh ValueError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Pytest BDD version : 7.0.1
I have below lines in feature file:
Given..
When..
Then I see a <status_code_returned>
And I see a "<error_message>"
Examples:
|status_code_returned| error_message. |
| 409 | credential exists |
Within the step definition .py file of Then, the value of status code is populating as , ' credential exists ' instead of 200, and it is throwing ValueError exception during assertion as it is expecting int (200)
I tried commenting And line in feature file and the value for status_code_returned is passing as expected.
Update:
The issue is step definition for feature line And I see a "<error_message>" is before than the line Then I see a <status_code_returned>. So during execution , pytest-bdd maps this line with the other as the beginning of both the feature lines are same.
This code was perfectly working in previous versions of pytest-bdd, so it will be great if a fix can be in place.
- Ngôn ngữ chính
- Python
- Star
- 1.5k
- Fork
- 251
- Merge trung bình
- 1 giờ 44 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
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 ·
-
Độ 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 ·
Tất cả issue của pytest-dev/pytest-bdd
Issue tương tự
-
Claiming namespace `apoint`Đang mởnamespace operations
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
EclipseFdn/open-vsx.org#13573 ·
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 72/100
collective/icalendar#1854 ·
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 72/100
rancher/rancher-ai-agent#412 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TUDelftGeodesy/DePSI#134 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
HenriquesLab/rxiv-maker#335 ·