Reputation: 10439
I have a Dockerfile
which is trying to call a Robot Framework test runner. I am passing desired command line arguments (e. g. testcases, testsuit, included tags, excluded tags, etc.) to the Dockerfile
as environment variables. Sometimes my command line arguments contains whitespaces. For example consider my testcase to be Define Something
and my testsuite to be MyWebsite
. If I set my environments as TESTCASE='Define Sponsor' and TESTSUITE=MyWebsite, I will get this error from Robot Framework test runner:
[ ERROR ] Suite 'Scenarios' contains no tests named ''Define or Something'' in suite 'MyWebsite'.
I tried multiple ways to pass my environments:
Using env file:
docker run --env-file test/test.env
Where test/test.env
contains:
TESTSUITE="MyWebsite"
TESTCASE="Define Sponsor"
Set them in the shell:
TESTSUITE="MyWebsite"
TESTCASE="Define Sponsor"
Set them in the Dockerfile
:
ENV TESTSUITE="MyWebsite"
ENV TESTCASE="Define Sponsor"
All of them returned mentioned error.
Upvotes: 1
Views: 3097
Reputation: 2473
The error is kind of explicit here, especially this part: contains no tests named ''Define or Something''
Notice the Define OR Something
. The CLI uses spaces as a separator, and so it thinks you're trying to select the test cases Define
and Something
. Instead, type Define_Something
and Robot Framework will correctly convert the underscore to a space, but after the CLI and it's separators were evaluated, which should correctly select your test case, Define Something
This is documented here
possible underscores are replaced with spaces, and names fully in lower case are title cased. For example, some_tests.html becomes Some Tests and My_test_directory becomes My test directory.
Upvotes: 3