Description
Hello,
A couple of months back I had submitted a PR to add the feature for "Correctly loading the methods from relatively imported classes" and updated "getgauge/impl_loader.py" file's update_step_resgistry_with_class(instance, file_path) method to check if the file_path had ".." and resolve it to its absolute path. This check was added for efficiency to reduce execution time.
The check was kept as if '..' in file_path because we give the relative paths in the python.properties file (../common_project/step_imp) of the project which when passed to the impl_loader file is prepended with the project folder name and ultimately becomes like: <CURRET_PROJECT_DIR>/../common_project/step_impl (For detailed project structure info and values of python.properties file please refer issue #359
But apparently this check was changed to if str(file_path).startswith("..") in the following PR - Enable test coverage report according to README which returns false for the above mentioned scenario due to which the step implementations from other projects are unable to load
This issue sneaked past the unit tests of impl_loader too as there was no test to cover the scenario where the file name was like <CURRET_PROJECT_DIR>/../common_project/step_impl
I'll create a PR with the fix for this issue and updating the unit tests to handle this scenario as well.
Thanks! 😄
Activity