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

[WIPTEST] Fix AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload' #10315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jarovo
Copy link
Contributor

@jarovo jarovo commented Sep 4, 2020

Purpose or Intent

It seems like the code for adding providers is not finding an attribute which it is looking for as there is misnomer.

I've hit this exception when adding the AWX provider. I didn't spend time to figure out how to 100% reproduce this. The traceback was:

2020-09-04 00:48:40,891 [E] [cfme] def validate(self, timeout=1000, delay=5):
        refresh_timer = RefreshTimer(time_for_refresh=300)
        try:
            wait_for(self.is_refreshed,
                     [refresh_timer],
                     message="is_refreshed",
                     timeout=timeout,
                     delay=delay,
>                    handle_exception=True)
E                    wait_for.TimedOutError: Could not do 'is_refreshed' at /home/jhenner/work/miq/bad_awx_template_bz/.cfme_venv3/lib64/python3.7/site-packages/varmeth/__init__.py:79 in time

cfme/common/provider.py:743: TimedOutError

During handling of the above exception, another exception occurred:

    @pytest.mark.provider([AnsibleTowerProvider], selector=ONE_PER_VERSION, scope="function")
    @pytest.mark.meta(automates=[1819310])
    def test_awx_with_special_chars_refreshes(appliance: IPAppliance, provider: AnsibleTowerProvider,
                                              add_special_characters):
        """
        Tests whether provider with special characters in template definition refreshes in CFME

        :param appliance:
        :param provider:
        :param add_special_characters:
        :return:

        Polarion:
          assignee
          initialEstimate
        """
        # TODO Fill this
        add_special_characters(provider)
>       provider.setup()

cfme/tests/infrastructure/test_providers.py:578:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cfme/common/provider.py:715: in setup
    return self.create_rest(check_existing=True, validate_inventory=True)
cfme/infrastructure/config_management/__init__.py:468: in create_rest
    self.validate(timeout=300)
cfme/common/provider.py:746: in validate
    self.load_details(refresh=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def load_details(self, refresh=False):
        """To be compatible with the Taggable and PolicyProfileAssignable mixins.

        Returns: ProviderDetails view
        """
        view = navigate_to(self, 'Details')
        if refresh:
>           view.toolbar.reload.click()
E           AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload'

@jarovo jarovo changed the title Awx reload refresh Fix AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload' Sep 8, 2020
to make it work with code for adding the provider

I am not sure how to 100% reproduce this, but the traceback was:
```
2020-09-04 00:48:40,891 [E] [cfme] def validate(self, timeout=1000, delay=5):
        refresh_timer = RefreshTimer(time_for_refresh=300)
        try:
            wait_for(self.is_refreshed,
                     [refresh_timer],
                     message="is_refreshed",
                     timeout=timeout,
                     delay=delay,
>                    handle_exception=True)
E                    wait_for.TimedOutError: Could not do 'is_refreshed' at /home/jhenner/work/miq/bad_awx_template_bz/.cfme_venv3/lib64/python3.7/site-packages/varmeth/__init__.py:79 in time

cfme/common/provider.py:743: TimedOutError

During handling of the above exception, another exception occurred:

    @pytest.mark.provider([AnsibleTowerProvider], selector=ONE_PER_VERSION, scope="function")
    @pytest.mark.meta(automates=[1819310])
    def test_awx_with_special_chars_refreshes(appliance: IPAppliance, provider: AnsibleTowerProvider,
                                              add_special_characters):
        """
        Tests whether provider with special characters in template definition refreshes in CFME

        :param appliance:
        :param provider:
        :param add_special_characters:
        :return:

        Polarion:
          assignee
          initialEstimate
        """
        # TODO Fill this
        add_special_characters(provider)
>       provider.setup()

cfme/tests/infrastructure/test_providers.py:578:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cfme/common/provider.py:715: in setup
    return self.create_rest(check_existing=True, validate_inventory=True)
cfme/infrastructure/config_management/__init__.py:468: in create_rest
    self.validate(timeout=300)
cfme/common/provider.py:746: in validate
    self.load_details(refresh=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def load_details(self, refresh=False):
        """To be compatible with the Taggable and PolicyProfileAssignable mixins.

        Returns: ProviderDetails view
        """
        view = navigate_to(self, 'Details')
        if refresh:
>           view.toolbar.reload.click()
E           AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload'
```
@jarovo jarovo changed the title Fix AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload' [RFR] Fix AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload' Sep 8, 2020
@jarovo jarovo changed the title [RFR] Fix AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload' [WIPTEST] Fix AttributeError: 'ConfigManagementToolbar' object has no attribute 'reload' Sep 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant