-
Notifications
You must be signed in to change notification settings - Fork 164
[1LP][RFR] Adding dialog text area regex validation test #10200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice use of parametrization 👍
@@ -25,16 +25,15 @@ def dialog_cat_item(appliance, catalog, request): | |||
'ele_label': fauxfactory.gen_alphanumeric(15, start="ele_label_"), | |||
'ele_name': fauxfactory.gen_alphanumeric(15, start="ele_name_"), | |||
'ele_desc': fauxfactory.gen_alphanumeric(15, start="ele_desc_"), | |||
'choose_type': "Text Box" | |||
"choose_type": hasattr(request, "param") and request.param.get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is behaving quite in the way you intended.
the value for the dict field will be set to the boolean result of hasattr() and request.param.get()
- not the string value of request.param.get()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suspect behavior within the modified fixture, not sure how/why the test passed anyway?
I detected some fixture changes in commit a983062 The local fixture
Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃 |
@@ -16,30 +16,30 @@ | |||
|
|||
@pytest.fixture(scope="function") | |||
def dialog_cat_item(appliance, catalog, request): | |||
default_data = {"choose_type": "Text Box", "validation": "^([a-z0-9]+_*)*[a-z0-9]+$"} | |||
data = getattr(request, "param", default_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix, this pattern is much better.
Purpose or Intent
PRT Run
{{pytest: cfme/tests/services/test_dialog_regex_validation_in_catalog.py::test_dialog_element_regex_validation }}