File tree Expand file tree Collapse file tree 9 files changed +26
-35
lines changed Expand file tree Collapse file tree 9 files changed +26
-35
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Library resources.helpers
66Library resources.profiles.Profiles
77Library resources.github.GitHub
88
9- Suite Setup Set Rest Base URL From Config
9+ Suite Setup Load Config
1010
1111Test Setup Default Setup
1212Test Teardown Default Teardown
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Library resources.profiles.Profiles
1414Library resources.minder_restapi_lib.MinderRestApiLib
1515Library resources.minderlib
1616
17- Suite Setup Set Rest Base URL From Config
17+ Suite Setup Load Config
1818
1919Test Setup Default Setup
2020Test Teardown Default Teardown
Original file line number Diff line number Diff line change 22Resource resources/keywords.robot
33Library resources.projects.Projects
44
5- Suite Setup Set Rest Base URL From Config
5+ Suite Setup Load Config
66
77Test Setup Default Setup
88Test Teardown Default Teardown
Original file line number Diff line number Diff line change 22Resource resources/keywords.robot
33Library resources.oauth_service.OAuthService
44
5- Suite Setup Set Rest Base URL From Config
5+ Suite Setup Load Config
66
77Test Setup Default Setup
88Test Teardown Default Teardown
@@ -33,4 +33,4 @@ Test Authorization URL API for GitHub OAuth
3333 Given Response Format Is Valid
3434 Then URL Is Not Empty
3535 And URL Is Authorization Code
36- And State Is Not Empty
36+ And State Is Not Empty
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Library resources.repositories_service.RepositoriesService
1414Library resources.github.GitHub
1515Library resources.minderlib
1616
17- Suite Setup Set Rest Base URL From Config
17+ Suite Setup Load Config
1818
1919Test Setup Default Setup
2020Test Teardown Default Teardown
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Library resources.minder_restapi_lib.MinderRestApiLib
1111Library resources.eval_results_service.EvalResultsService
1212Library resources.rule_type_service.RuleTypeService
1313
14- Suite Setup Set Rest Base URL From Config
14+ Suite Setup Load Config
1515
1616Test Setup Create Project And Ruletypes
1717Test Teardown Delete Ruletypes And Project
Original file line number Diff line number Diff line change @@ -3,10 +3,13 @@ Documentation Test suite for some simple Minder operations
33
44Test Tags smoke
55
6- Library resources.helpers
7- Library resources/minderlib.py
6+ Resource resources/keywords.robot
7+ Resource resources/variables.robot
88
9- Suite Setup Set Grpc Base URL From Config
9+ Library resources.helpers
10+ Library resources.minderlib
11+
12+ Suite Setup Load Config
1013
1114
1215*** Variables ***
@@ -36,10 +39,3 @@ Project created
3639 Given I Am Logged Into Minder
3740 When I List My Projects
3841 Then I Should Have At Least One Project
39-
40-
41- *** Keywords ***
42- Set Grpc Base URL From Config
43- [Documentation] Reads the GRPC_BASE_URL from the config file and sets it for all tests.
44- ${GRPC_BASE_URL } = Get Grpc URL From Config
45- Set Suite Variable ${GRPC_BASE_URL }
Original file line number Diff line number Diff line change @@ -12,10 +12,14 @@ Library BuiltIn
1212Library RequestsLibrary
1313
1414*** Keywords ***
15- Set Rest Base URL From Config
16- [Documentation] Reads the BASE_URL from the config file and sets it for all tests.
15+ Load Config
16+ [Documentation] Reads tests' config file and sets useful variables for all tests.
1717 ${BASE_URL } = Get Rest URL From Config
1818 Set Suite Variable ${BASE_URL }
19+ ${root_project } = Get Environment Variable MINDER_PROJECT
20+ Set Suite Variable ${root_project }
21+ ${GRPC_BASE_URL } = Get Grpc URL From Config
22+ Set Suite Variable ${GRPC_BASE_URL }
1923
2024Create Ruletypes
2125 [Documentation] Create the ruletypes for the current project.
@@ -39,4 +43,4 @@ Set Project as Environment Variable With Test Name
3943Remove Project Environment Variable For Test
4044 [Documentation] Remove the environment variable after the test.
4145 Remove Minder Project With Test Name
42- Remove Environment Variable MINDER_PROJECT
46+ Set Environment Variable MINDER_PROJECT ${ root_project }
Original file line number Diff line number Diff line change 1- from robot .api import logger
21from robot .api .deco import keyword
32from robot .libraries .BuiltIn import BuiltIn
43import re
@@ -40,20 +39,12 @@ def get_toplevel_project(self):
4039 Raises:
4140 Exception: If the API request fails or the expected project is not found.
4241 """
43- try :
44- data = self .rest_api .get_request ("/user" )
45- logger .debug (f"Received response: { data } " )
46-
47- for project in data .get ("projects" , []):
48- if project .get ("description" ) == "A self-enrolled project." :
49- logger .info (
50- f"Found self-enrolled project with UUID: { project ['projectId' ]} "
51- )
52- return project ["projectId" ]
53-
54- raise Exception ("No self-enrolled project found in the response" )
55- except Exception as e :
56- raise Exception (f"Failed to get top-level project: { str (e )} " )
42+ project_id = BuiltIn ().get_variable_value ("${root_project}" )
43+ if project_id is None :
44+ raise Exception ("Variable ${root_project} is not set" )
45+ if project_id == "" :
46+ raise Exception ("Variable ${root_project} is empty" )
47+ return project_id
5748
5849 @keyword
5950 def client_lists_roles (self ):
You can’t perform that action at this time.
0 commit comments