ppodgorsek / docker-robot-framework

Robot Framework in Docker
https://cloud.docker.com/repository/docker/ppodgorsek/robot-framework
MIT License
347 stars 240 forks source link

How to run the test using resources or jpg files in an different folders ? #505

Open lgustavolp opened 2 months ago

lgustavolp commented 2 months ago

Describe the bug I'm trying to use some javascript files to create a mock environment to run my tests, it is in a folder /resources in the Robot Project but when I try to run I'm getting this error below:

I got the same error if I use any file in my test, for example, a jgp file

============================================================================== Tests

[ ERROR ] Error in file '/opt/robotframework/tests/player.robot' on line 2: Initializing library 'Browser' with arguments [ jsextension=/opt/robotframework/temp/resources/module.js ] failed: Error: Cannot find module '/opt/robotframework/temp/resources/module.js' Require stack:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/Browser/browser.py", line 889, in init libraries.append(self._create_lib_component_from_jsextension(js_ext)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/Browser/browser.py", line 975, in _create_lib_component_from_jsextension response = self.init_js_extension(Path(jsextension)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/Browser/browser.py", line 987, in init_js_extension with self.playwright.grpc_channel() as stub: File "/usr/lib64/python3.12/contextlib.py", line 158, in exit self.gen.throw(value) File "/usr/local/lib/python3.12/site-packages/Browser/playwright.py", line 169, in grpc_channel raise AssertionError(error.details()) AssertionError: Error: Cannot find module '/opt/robotframework/temp/resources/module.js' Require stack:

I got the same error if I use any file in my test, for example, a jgp file

Tests.Home :: Suite de testes da home page | PASS | 1 test, 1 passed, 0 failed

Tests.Signup :: Suite de testes de cadastro de dog walker

Deve poder cadastrar um novo dog walker | FAIL | ValueError: Nonexistent input file path '/opt/robotframework/temp/toretto.jpg'

To Reproduce Steps to reproduce the behavior:

command line1:

docker run -v ./results:/opt/robotframework/reports:Z -v C:\QAx\prj\stdRobotFram\tests:/opt/robotframework/tests:Z ppodgorsek/robot-framework:latest

command line2:

docker run -v ./results:/opt/robotframework/reports:Z -v C:\QAx\prj\stdRobotFramWD:/opt/robotframework/tests:Z ppodgorsek/robot-framework:latest

Expected behavior A clear and concise description of what you expected to happen.

Robot template No

Screenshots No

Please provide any relevant information, such as:

Additional context No