Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix poui reload #1623

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions tir/technologies/webapp_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ def Setup(self, initial_program, date='', group='99', branch='01', module='', sa
logger().info(f"***System Info*** in Setup():")
system_info()

self.config.poui_login = self.config.json_data['POUILogin']
if 'POUILogin' in self.config.json_data and self.config.json_data['POUILogin'] == True:
self.config.poui_login = True
else:
self.config.poui_login = False

try:
self.service_process_bat_file()
Expand Down Expand Up @@ -8179,7 +8182,12 @@ def AddParameter(self, parameter, branch, portuguese_value, english_value="", sp
"""

logger().info(f"AddParameter: {parameter}")
twebview = True if self.config.json_data['POUILogin'] else False

if 'POUILogin' in self.config.json_data and self.config.json_data['POUILogin'] == True:
twebview = True
else:
twebview = False

endtime = time.time() + self.config.time_out
halftime = ((endtime - time.time()) / 2)

Expand Down Expand Up @@ -8261,7 +8269,12 @@ def parameter_url(self, restore_backup=False):
>>> self.parameter_url(restore_backup=False)
"""
try_counter = False
twebview = True if self.config.json_data['POUILogin'] else False

if 'POUILogin' in self.config.json_data and self.config.json_data['POUILogin'] == True:
twebview = True
else:
twebview = False

endtime = time.time() + self.config.time_out
halftime = ((endtime - time.time()) / 2)
function_to_call = "u_SetParam" if restore_backup is False else "u_RestorePar"
Expand Down Expand Up @@ -9463,7 +9476,10 @@ def TearDown(self):
logger().exception(str(e))
webdriver_exception = e

self.config.poui_login = self.config.json_data['POUILogin']
if 'POUILogin' in self.config.json_data and self.config.json_data['POUILogin'] == True:
self.config.poui_login = True
else:
self.config.poui_login = False

if webdriver_exception:
message = f"Wasn't possible execute self.driver.refresh() Exception: {next(iter(webdriver_exception.msg.split(':')), None)}"
Expand Down
Loading