Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal in unit test does not pass is_displayed #126

Open
mshriver opened this issue Nov 3, 2020 · 0 comments · May be fixed by #128
Open

Modal in unit test does not pass is_displayed #126

mshriver opened this issue Nov 3, 2020 · 0 comments · May be fixed by #128
Labels

Comments

@mshriver
Copy link
Collaborator

mshriver commented Nov 3, 2020

______________________________ test_generic_modal ______________________________
browser = <testing.conftest.CustomBrowser object at 0x7f5c3316c7f0>
    def test_generic_modal(browser):
        class TestView(View):
            """ Dummy page matching testing_page.html elements"""
            button = Button('Launch demo modal')
            modal = SpecificModal(id=modal_id)

        view = TestView(browser)
        assert not view.modal.is_displayed
        # Open the modal
        assert not view.button.disabled
        view.button.click()
        wait_for(lambda: view.modal.is_displayed,

>                delay=0.5, num_sec=MODAL_INTERACTION_TIMEOUT)
E       wait_for.TimedOutError: Could not do 'lambda defined as `wait_for(lambda: view.modal.is_displayed,
E                    delay=0.5, num_sec=MODAL_INTERACTION_TIMEOUT)`' at /home/travis/build/RedHatQE/widgetastic.patternfly/testing/test_modal.py:50 in time

The id is passed for the modal, and the if id block is evaluated in the modal constructor, but the ROOT locator does not appear to be correctly updated.

(Pdb) view.modal.__locator__()
Locator(by='xpath', locator='.//div[contains(@class, "modal") and contains(@class, "fade") and @role="dialog"]')

The modal, though displayed, is not reading the 'in' class that is included in the modal div when the modal is opened.

(Pdb) view.modal.browser.classes(view.modal)
{'modal', 'fade'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant