@@ -65,6 +65,38 @@ def adjust_python_path():
65
65
from Framework .node_server_state import STATE # noqa: E402
66
66
from server import main as node_server # noqa: E402
67
67
68
+ settings_conf_path = str (Path (__file__ ).parent / "Framework" / "settings.conf" )
69
+ print (f"Settings config path: { settings_conf_path } " )
70
+ def create_config_file ():
71
+ if not os .path .exists (settings_conf_path ):
72
+ config = ConfigObj ()
73
+ config ["Authentication" ] = {
74
+ "username" : "" ,
75
+ "api-key" : "" ,
76
+ "server_address" : ""
77
+ }
78
+ config ["Advanced Options" ] = {
79
+ "module_update_interval" : 30 ,
80
+ "log_delete_interval" : 7 ,
81
+ "last_module_update_date" : "2025-02-21" ,
82
+ "last_log_delete_date" : "2023-09-19" ,
83
+ "element_wait" : 10 ,
84
+ "available_to_all_project" : False ,
85
+ "_file" : "temp_config.ini" ,
86
+ "_file_upload_path" : "TestExecutionLog" ,
87
+ "stop_live_log" : False
88
+ }
89
+ config ["Inspector" ] = {
90
+ "Window" : "" ,
91
+ "No_of_level_to_skip" : 0 ,
92
+ "ai_plugin" : True
93
+ }
94
+ config ["server" ] = {
95
+ "port" : 0
96
+ }
97
+ config .filename = settings_conf_path
98
+ config .write ()
99
+ print (f"Created settings.conf at { settings_conf_path } " )
68
100
69
101
def start_server ():
70
102
def is_port_in_use (port ):
@@ -78,14 +110,18 @@ def run():
78
110
while is_port_in_use (node_server_port ) and tries < 99 :
79
111
node_server_port += 1
80
112
tries += 1
113
+ config = ConfigObj (settings_conf_path )
114
+ config ["server" ]["port" ] = node_server_port
115
+ config .write ()
81
116
uvicorn .run (
82
117
node_server .main (),
83
118
host = "127.0.0.1" ,
84
119
port = node_server_port ,
85
120
log_level = "warning" ,
86
121
)
87
- except Exception :
88
- print ("[WARN] Failed to launch node-server. Seamless connect feature is disabled." )
122
+
123
+ except Exception as e :
124
+ print (f"[WARN] Failed to launch node-server: { str (e )} " )
89
125
90
126
t = threading .Thread (target = run , daemon = True )
91
127
t .start ()
@@ -146,6 +182,7 @@ def main():
146
182
147
183
kill_old_process (Path .cwd ().parent / "pid.txt" )
148
184
check_min_python_version (min_python_version = "3.11" , show_warning = True )
185
+ create_config_file ()
149
186
update_outdated_modules ()
150
187
monkeypatch_fromisoformat ()
151
188
start_server ()
@@ -531,23 +568,6 @@ def PreProcess(log_dir=None):
531
568
current_path_file = TMP_INI_FILE
532
569
ConfigModule .clean_config_file (current_path_file )
533
570
ConfigModule .add_section ("sectionOne" , current_path_file )
534
-
535
- if not ConfigModule .has_section ("Selenium_driver_paths" ):
536
- ConfigModule .add_section ("Selenium_driver_paths" )
537
- ConfigModule .add_config_value ("Selenium_driver_paths" , "chrome_path" , "" )
538
- ConfigModule .add_config_value ("Selenium_driver_paths" , "firefox_path" , "" )
539
- ConfigModule .add_config_value ("Selenium_driver_paths" , "edge_path" , "" )
540
- ConfigModule .add_config_value ("Selenium_driver_paths" , "opera_path" , "" )
541
- ConfigModule .add_config_value ("Selenium_driver_paths" , "ie_path" , "" )
542
- if not ConfigModule .get_config_value (
543
- "Selenium_driver_paths" , "electron_chrome_path"
544
- ):
545
- ConfigModule .add_config_value (
546
- "Selenium_driver_paths" , "electron_chrome_path" , ""
547
- )
548
-
549
- # If `log_dir` is not specified, then store all logs inside Zeuz Node's
550
- # "AutomationLog" folder
551
571
if log_dir is None :
552
572
log_dir = TMP_INI_FILE .parent
553
573
0 commit comments