percy / percy-selenium-python

Percy visual testing for Python Selenium
MIT License
11 stars 4 forks source link

AttributeError: module 'percy' has no attribute 'Runner' #66

Closed amotl closed 10 months ago

amotl commented 10 months ago

About

Hi. Similar to GH-41, we observed a few problems, maybe also related to the package transition from percy to percy-selenium, and reported about them at https://github.com/earthobservations/wetterdienst/pull/1017#issuecomment-1741240635 ff.

Details

We are observing this error ^1, through dash.testing.composite:

         if self._percy_run:
>           self.percy_runner = percy.Runner(
                loader=percy.ResourceLoader(
                    webdriver=self.driver,
                    base_url="/assets",
                    root_dir=percy_assets_root,
                )
            )
E           AttributeError: module 'percy' has no attribute 'Runner'

We have been able to mitigate it by installing percy manually, after the regular package installation process, as a sort of a workaround, like outlined in https://github.com/earthobservations/wetterdienst/pull/1017/commits/37a24240510234bf3dc66f270bec995ea5123005.

Did you ever see that kind of error on your end?

amotl commented 10 months ago

After applying the fix/workaround to manually run pip install percy>=2,<3 --force after the regular package installation, like outlined at ^1, the software tests at the project we observed this problem on, start to succeed again.

It looks like it might be a package namespace issue, because both packages share the same toplevel package name, right?

itsjwala commented 10 months ago

Hey @amotl

The error you're seeing is from an older version of the package which we don't support.

Please check this comment https://github.com/percy/percy-selenium-python/issues/41#issuecomment-1552820676 it summarises what needs to be done for migration.

Note: The new Percy package is very different from the old one, so you'll be required to make code changes as well.

amotl commented 10 months ago

Dear Jigar,

thanks a stack for your response. In the meanwhile, we submitted this change to our code base, trusting dash[testing] to pull in the correct dependencies.

It looks like it still uses the older percy package, but I am sure they will transition to the new one during one of the next iterations. Because everything is fine on our end now, let me close this issue again.

Keep up the spirit, and with kind regards, Andreas.