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

Random failures with StaleElementReferenceException in selenium tests in Jenkins #616

Open
toni-sissala opened this issue Oct 2, 2023 · 1 comment
Assignees

Comments

@toni-sissala
Copy link

src/cdc_test_firefox.py::FirefoxTestCase::test_sort_by_collection_date keeps failing with StaleElementReferenceException.

@toni-sissala
Copy link
Author

I'm unable to reproduce this on my development environment. I had a look at jenkins.cessda.eu and it seems that this failure has not been happening for a while, so I'm not sure if there is anything to do here.

I did see - and was able to reproduce - another unrelated failure (https://jenkins.cessda.eu/view/CDC/job/cessda.cdc.test/job/main/405/execution/node/112/log/):

========================================= FAILURES ==========================================
__________________ FirefoxTestCase.test_find_studies_in_french_with_topic ___________________

self = <test_cdc_firefox.FirefoxTestCase testMethod=test_find_studies_in_french_with_topic>

    def test_find_studies_in_french_with_topic(self):
        """As a user I am interested in finding studies for a
        specific language that are within a specified topic
    
        - https://github.com/cessda/cessda.cdc.versions/issues/588
        """
        # I use the language selection functionality next to the search box
        self._change_catalogue_lang("French")
        # After clicking on the Topic bar in the menu at the left,
        # I can start to type the topic I am interested in or
        # select from the list
        self.driver.find_element(
            By.XPATH,
            "//div[contains(concat(' ', @class, ' '), ' filter--classifications.term ')]/div",
        ).click()
        self.driver.find_element(
            By.XPATH, '//div[@id="react-select-3--value"]/div[2]/input'
        ).send_keys("Edu")
        first_opt_el = self.driver.find_element(
            By.XPATH, '//div[@id="react-select-3--option-0"]'
        )
        selected_option_text = first_opt_el.text
        first_opt_el.click()
        # I expect to see results with the specified language and topic
        sk_hits_el = self.driver.find_elements(
            By.XPATH, "//div[@class='sk-hits-stats__info']"
        )[0]
        assert " studies found in French from a total of " in sk_hits_el.text
        # make sure the selected topic is active in GUI
        selected_topic = self.driver.find_element(
            By.XPATH, '//span[@id="react-select-3--value-0"]/span[1]'
        )
>       assert selected_topic.text == selected_option_text
E       AssertionError: assert 'éducation et formation' == 'éducation et formation (117)'
E         - éducation et formation (117)
E         ?                       ------
E         + éducation et formation

src/common.py:599: AssertionError
================================== short test summary info ==================================
FAILED src/test_cdc_firefox.py::FirefoxTestCase::test_find_studies_in_french_with_topic - AssertionError: assert 'éducation et formation' == 'éducation et formation (117)'

My understanding of this is that for some reason the topic-filter is not working properly in "datacatalogue-dev.cessda.eu", and this is an actual error in CDC in this particular environment. It does work as expected in production environment.

Any thoughts @matthew-morris-cessda ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant