Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Adding dialog text area regex validation test #10200

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

niyazRedhat
Copy link
Contributor

@niyazRedhat niyazRedhat commented Jun 19, 2020

Purpose or Intent

PRT Run

{{pytest: cfme/tests/services/test_dialog_regex_validation_in_catalog.py::test_dialog_element_regex_validation }}

@niyazRedhat niyazRedhat changed the title [WIPTEST] Adding dialog text area regex validation test [RFR] Adding dialog text area regex validation test Jun 19, 2020
@john-dupuy john-dupuy added the test-automation To be applied on PR's which are automating existing manual cases label Jun 19, 2020
@john-dupuy john-dupuy changed the title [RFR] Adding dialog text area regex validation test [WIPTEST] Adding dialog text area regex validation test Jun 19, 2020
@niyazRedhat niyazRedhat changed the title [WIPTEST] Adding dialog text area regex validation test [RFR] Adding dialog text area regex validation test Jun 22, 2020
Copy link
Contributor

@john-dupuy john-dupuy left a 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 👍

@john-dupuy john-dupuy changed the title [RFR] Adding dialog text area regex validation test [1LP][RFR] Adding dialog text area regex validation test Jun 26, 2020
@@ -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
Copy link
Member

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()

Copy link
Member

@mshriver mshriver left a 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?

@mshriver mshriver changed the title [1LP][RFR] Adding dialog text area regex validation test [1LP][WIPTEST] Adding dialog text area regex validation test Jun 29, 2020
@dajoRH
Copy link
Contributor

dajoRH commented Jun 30, 2020

I detected some fixture changes in commit a983062

The local fixture dialog_cat_item is used in the following files:

  • cfme/tests/services/test_dialog_regex_validation_in_catalog.py
    • test_dialog_element_regex_validation
    • test_dialog_regex_validation_button

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@niyazRedhat niyazRedhat changed the title [1LP][WIPTEST] Adding dialog text area regex validation test [1LP][RFR] Adding dialog text area regex validation test Jun 30, 2020
@@ -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)
Copy link
Member

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.

@mshriver mshriver merged commit 98337b0 into ManageIQ:master Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
test-automation To be applied on PR's which are automating existing manual cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants