healenium / healenium-example-python

Apache License 2.0
8 stars 7 forks source link

[BUG]: cannot run tests due to ModuleNotFoundError #4

Closed lucielavickova-tesena closed 2 years ago

lucielavickova-tesena commented 2 years ago

Describe the bug

When trying to execute the tests in this repository, I encounter following issues: 1) in readme, there is a mistake in the Run test section: to go to ```cd healenium_selenium\tests``` project folder - there is no folder called "healenium_selenium" 2) when I navigate to tests directory and try to run any of the tests using pytest, I get following error: ImportError while importing test module 'C:\Users\LucieLavickova\Git\healenium-example-python\tests\test_callback.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ..\..\..\anaconda3\lib\importlib\__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) test_callback.py:2: in <module> from src.main.pages.callback_page import CallbackPage E ModuleNotFoundError: No module named 'src'

When trying to fix the issue, I moved the test files to the project root and from there, I was able to run the tests without any issues. So I guess there is some problem in the project path settings.

I am using Python 3.9.7 and pytest 6.2.4, OS Win 10

How to reproduce the issue

1) in commandline terminal, navigate to the project directory
2) cd .\tests
3) pytest .\test_callback.py

Logs appeared during using Healenium

see above

Expected behavior

tests should pass

Actual behavior

error as described above

Healenium Proxy version

0.2.5

Healenium Backend version

3.2.2

Selenium version

4.1.3

Additional context

No response

ElenaStepuro commented 2 years ago

Fixed

lucielavickova-tesena commented 2 years ago

thank you, it's working now :)