Skip to content

Commit

Permalink
Merge pull request #442 from totvs/release/v1.17.27
Browse files Browse the repository at this point in the history
Release/v1.17.27
  • Loading branch information
renanllisboa authored Nov 16, 2020
2 parents d8606fd + 868133a commit 6c5275d
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 49 deletions.
2 changes: 1 addition & 1 deletion doc_files/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '1.17.24'
release = '1.0.0'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ taskkill /f /im chromedriver.exe
echo -------------------------
echo Installing project...
echo -------------------------
pip install -U dist/tir_framework-1.17.24.tar.gz
pip install -U dist/tir_framework-1.17.27.tar.gz
pause >nul | set/p = Press any key to exit ...
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
project_urls={
'Script Samples': 'https://github.com/totvs/tir-script-samples'
},
version='1.17.24',
version='1.17.27',
license='MIT',
keywords='test automation selenium tir totvs protheus framework',
classifiers=[
Expand Down
22 changes: 16 additions & 6 deletions tir/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def ChangeEnvironment(self, date="", group="", branch="", module=""):
"""
self.__webapp.ChangeEnvironment(date, group, branch, module)

def CheckResult(self, field, user_value, grid=False, line=1, grid_number=1, name_attr=False):
def CheckResult(self, field, user_value, grid=False, line=1, grid_number=1, name_attr=False, input_field=True, direction=None):
"""
Checks if a field has the value the user expects.
Expand All @@ -108,6 +108,10 @@ def CheckResult(self, field, user_value, grid=False, line=1, grid_number=1, name
:type grid_number: int
:param name_attr: Boolean if search by Name attribute must be forced. - **Default:** False
:type name_attr: bool
:param input_field: False if the desired field is not an input type .
:type bool
:param direction: Desired direction to search for the element, currently accepts right and down.
:type str
Usage:
Expand All @@ -121,8 +125,13 @@ def CheckResult(self, field, user_value, grid=False, line=1, grid_number=1, name
>>> # Calling method to check a field that is on the second grid of the screen:
>>> oHelper.CheckResult("Order", "000001", grid=True, line=1, grid_number=2)
>>> oHelper.LoadGrid()
>>> #-----------------------------------------
>>> # Call method to check a field value that is not an input field and is on the right:
>>> oHelper.CheckResult("Saldo Titulo", "100.000,00", input_field=False, direction='right')
>>> oHelper.LoadGrid()
"""
self.__webapp.CheckResult(field, user_value, grid, line, grid_number, name_attr)
self.__webapp.CheckResult(field, user_value, grid, line, grid_number, name_attr, input_field, direction)

def CheckView(self, text, element_type="help"):
"""
Expand Down Expand Up @@ -1009,18 +1018,19 @@ def ClickListBox(self, text):

return self.__webapp.ClickListBox(text)

def ClickImage(self, img_name):
def ClickImage(self, img_name, double_click=False):
"""
Clicks in an Image button. They must be used only in case that 'ClickIcon' doesn't support.
:param img_name: Image to be clicked.
:type img_name: src
Usage:
>>> # Call the method:
>>> oHelper.ClickImage("img_name")
>>> # Call the method:
>>> oHelper.ClickImage("img_name")
>>> oHelper.ClickImage("img_name",double_click=True)
"""
self.__webapp.ClickImage(img_name)
self.__webapp.ClickImage(img_name,double_click)

def ProgramScreen(self, initial_program=""):
"""
Expand Down
24 changes: 17 additions & 7 deletions tir/technologies/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,22 @@ def double_click(self, element, click_type = enum.ClickType.SELENIUM):
self.driver.execute_script("arguments[0].click()", element)
self.driver.execute_script("arguments[0].click()", element)

except Exception:
self.scroll_to_element(element)
actions = ActionChains(self.driver)
actions.move_to_element(element)
actions.double_click()
actions.perform()
return True

except Exception as e:
try:
print(f"Warning double_click method Exception: {str(e)}")
self.scroll_to_element(element)
actions = ActionChains(self.driver)
actions.move_to_element(element)
actions.double_click()
actions.perform()

return True
except Exception as x:
print(f"Error double_click method Exception: {str(x)}")
return False


def element_exists(self, term, scrap_type=enum.ScrapType.TEXT, position=0, optional_term="", main_container=".tmodaldialog,.ui-dialog"):
"""
Expand Down Expand Up @@ -1002,7 +1012,7 @@ def Start(self):

self.driver.get(self.config.url)

self.wait = WebDriverWait(self.driver, 90)
self.wait = WebDriverWait(self.driver, self.config.time_out)

def TearDown(self):
"""
Expand Down
Loading

0 comments on commit 6c5275d

Please sign in to comment.