File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ Each RF suite may define the following variables:
5252 changes! If subsequent test scenarios, aka .robot files don't override
5353 ``plan_id `` the current one will be used!
5454- **${product} **: Existing product name when creating a new TestPlan
55- - **${build_user_email} **: Email for an existing user
55+ - **${build_user_email} **: Email for an existing user,
56+ override with ``TCMS_DEFAULT_TESTER_ID ``!
5657
5758.. warning ::
5859
Original file line number Diff line number Diff line change 11import os
22
3+ from xmlrpc .client import ProtocolError
34from robot .libraries .BuiltIn import BuiltIn
45from tcms_api .plugin_helpers import Backend
56
@@ -12,21 +13,33 @@ class RFBackend(Backend):
1213 built_in = BuiltIn ()
1314 cwd = os .getcwd () + os .sep
1415
16+ @property
1517 def default_tester_id (self ):
1618 """
17- If ${build_user_email} is specified witin the suite then use it,
18- otherwise default to the user connecting via API!
19+ If ${build_user_email} is specified within the suite then use it!
20+
21+ .. warning::
22+
23+ Searching users via email requires ``auth.view_user``! See
24+ https://kiwitcms.readthedocs.io/en/latest/admin.html?highlight=auth.view_user#managing-permissions
25+ If this permission is not assigned to the user performing the
26+ API request you may try defining the ``TCMS_DEFAULT_TESTER_ID``
27+ environment variable instead!
1928 """
20- user_email = self .built_in .get_variable_value ('${build_user_email}' )
2129 result = None
30+ user_email = self .built_in .get_variable_value ('${build_user_email}' )
2231
2332 if user_email :
24- result = self .rpc .User .filter ({'email' : user_email })
33+ try :
34+ result = self .rpc .User .filter ({'email' : user_email })
35+ except ProtocolError as err :
36+ if err .errcode != 403 :
37+ raise
2538
2639 if result :
2740 return result [0 ]['id' ]
2841
29- return super ().default_tester_id ()
42+ return super ().default_tester_id
3043
3144 def external_plan_id (self ):
3245 """
You can’t perform that action at this time.
0 commit comments