Skip to content

Commit

Permalink
Merge pull request #1590 from totvs/hotfix/program_screen_environment
Browse files Browse the repository at this point in the history
add server environment in restart method and default value in program…
  • Loading branch information
renanllisboa authored Nov 18, 2024
2 parents 29ff9be + 4d61fea commit 6337a40
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tir/technologies/webapp_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ def program_screen(self, initial_program="", environment="", poui=False):
>>> self.program_screen("SIGAADV", "MYENVIRONMENT")
"""

if not environment:
environment = self.config.environment


self.config.poui_login = poui

Expand Down Expand Up @@ -669,13 +672,15 @@ def reload_user_screen(self):

logger().debug('Reloading user screen')

server_environment = self.config.environment

self.restart_browser()

if self.config.coverage:
self.driver.get(f"{self.config.url}/?StartProg=CASIGAADV&A={self.config.initial_program}&Env={self.config.environment}")

if not self.config.skip_environment and not self.config.coverage:
self.program_screen(self.config.initial_program)
self.program_screen(self.config.initial_program, environment=server_environment)

self.wait_element_timeout(term="[name='cGetUser']",
scrap_type=enum.ScrapType.CSS_SELECTOR, timeout = self.config.time_out , main_container='body')
Expand Down Expand Up @@ -3212,6 +3217,8 @@ def restart(self):
"""
webdriver_exception = None

server_environment = self.config.environment

if self.config.appserver_service:
try:
self.sc_query(self.config.appserver_service)
Expand Down Expand Up @@ -3240,7 +3247,7 @@ def restart(self):
if self.config.initial_program != '' and self.restart_counter < 3:

if not self.config.skip_environment and not self.config.coverage:
self.program_screen(self.config.initial_program)
self.program_screen(self.config.initial_program, environment=server_environment)

self.wait_user_screen()
if 'POUILogin' in self.config.json_data and self.config.json_data['POUILogin'] == True:
Expand Down

0 comments on commit 6337a40

Please sign in to comment.