Poui

class tir.main.Poui(config_path='', autostart=True)
AssertFalse(expected=False, script_message='')

Defines that the test case expects a False response to pass

Usage:

>>> #Instantiating the class
>>> inst.oHelper = Webapp()
>>> #Calling the method
>>> inst.oHelper.AssertFalse()
AssertTrue(expected=True, script_message='')

Defines that the test case expects a True response to pass

Usage:

>>> #Calling the method
>>> inst.oHelper.AssertTrue()
CheckResult(field=None, user_value=None, po_component='po-input', position=1)

Checks if a field has the value the user expects.

Parameters:
  • field (str) – The field or label of a field that must be checked.

  • user_value (str) – The value that the field is expected to contain.

  • po_component (str) – POUI component name that you want to check content on screen

  • position (int) – Position which element is located. - Default: 1

Usage:

>>> # Calling method to check a value of a field:
>>> oHelper.CheckResult("Código", "000001", 'po-input')
ClickAvatar(position=1)

Click on the POUI Profile Avatar icon. https://po-ui.io/documentation/po-avatar

Parameters:

position (int) –

  • Default: 1

Usage:

>>> # Call the method:
>>> oHelper.ClickAvatar(position=1)
>>> oHelper.ClickAvatar()
ClickButton(button='', position=1)

Clicks on the Button of POUI component. https://po-ui.io/documentation/po-button

Parameters:
  • field – Button to be clicked.

  • position – Position which element is located. - Default: 1

Usage:

>>> # Call the method:
>>> oHelper.ClickButton('Cancelar')
:return:
ClickByLocator(selector='', locator=None, right_click=False)

Note

Necessary import “By” class in the script: from tir.technologies.core.base import By

Note

For more information check this out: https://selenium-python.readthedocs.io/locating-elements.html

Warning

Use only in cases where it is not possible to use a label or name attribute. Any interface change can directly impact the script. Evaluate the possibility of changing the interface before using these methods in the script.

Parameters:
  • selector (str) – The type of selector to use (e.g., ‘css’, ‘xpath’, ‘id’).

  • locator (str) – The locator expression to identify the element. (e.g., By.CSS_SELECTOR, By.ID)

  • right_click (bool) – Perform a right-click action if True (default is False).

Usage:

>>>  # Call the method:
>>> oHelper_Poui.ClickByLocator(selector='.po-page-header-actions > po-button:nth-child(1) > button:nth-child(1)', locator=By.CSS_SELECTOR)
:return: None
ClickCombo(field='', value='', position=1)

Clicks on the Combo of POUI component. https://po-ui.io/documentation/po-combo

Parameters:
  • field – Combo text title that you want to click.

  • value – Value that you want to select in Combo.

  • position – Position which element is located. - Default: 1

Usage:

>>> # Call the method:
>>> oHelper.ClickCombo('Visão', 'Compras')
:return:
ClickIcon(label='', class_name='', position=1)

Click on the POUI Icon by label, class_name or both. https://po-ui.io/guides/icons

Parameters:
  • label (str) – The tooltip name for icon

  • class_name (str) – The POUI class name for icon

  • position (int)

Returns:

None

Usage:

>>> # Call the method:
>>> oHelper.ClickIcon(label='Delete')
>>> oHelper.ClickIcon(class_name='po-icon po-icon-delete')
>>> oHelper.ClickIcon(label='Delete', class_name='po-icon po-icon-delete')
ClickMenu(menu_item)

Clicks on the menu-item of the POUI component. https://po-ui.io/documentation/po-menu

:param menu_item:Menu item name :type menu_item: str

Usage:

>>> # Call the method:
>>> oHelper.ClickMenu("Contracts")
ClickPopup(label)

Click on the POUI Profile Avatar icon. https://po-ui.io/documentation/po-popup

Parameters:

label (str)

Usage:

>>> # Call the method:
>>> oHelper.ClickPopup(label="Popup Item")
>>> oHelper.ClickPopup()
ClickSelect(field='', value='', position=1)

Clicks on the Select of POUI component. https://po-ui.io/documentation/po-select

Parameters:
  • field – Select text title that you want to click.

  • value – Value that you want to select in Select.

  • position – Position which element is located. - Default: 1

Usage:

>>> # Call the method:
>>> oHelper.ClickSelect('Espécie', 'Compra')
:return:
ClickTable(first_column=None, second_column=None, first_content=None, second_content=None, table_number=1, itens=False, click_cell=None, checkbox=False)

Clicks on the Table of POUI component. https://po-ui.io/documentation/po-table

Parameters:
  • first_column (str) – Column name to be used as reference.

  • second_column (str) – Column name to be used as reference.

  • first_content (str) – Content of the column to be searched.

  • second_content (str) – Content of the column to be searched.

  • table_number (int) – Which grid should be used when there are multiple grids on the same screen. - Default: 1

  • itens (bool) – Bool parameter that click in all itens based in the field and content reference.

  • click_cell (str) – Content to click based on a column position to close the axis

  • checkbox (bool) – If you want to click on the checkbox component in the table

>>> # Call the method:
>>> oHelper.ClickTable(first_column='Código', first_content='000003', click_cell='Editar')
:return: None
ClickWidget(title='', action='', position=1)

Clicks on the Widget or Widget action of POUI component. https://po-ui.io/documentation/po-widget

Parameters:
  • tittle – Widget text title that you want to click.

  • action – The name of action to be clicked

  • position – Position which element is located. - Default: 1

Usage:

>>> # Call the method:
>>> oHelper.ClickWidget(title='LEad Time SC x PC', action='Detalhes', position=1)
:return:
GetUrl(url)

Loads a web page in the current browser session. :param url: :type url: str

InputByLocator(selector='', locator=None, value='')

Note

Necessary import “By” class in the script: from tir.technologies.core.base import By

Note

For more information check this out: https://selenium-python.readthedocs.io/locating-elements.html

Warning

Use only in cases where it is not possible to use a label or name attribute. Any interface change can directly impact the script. Evaluate the possibility of changing the interface before using these methods in the script.

Parameters:
  • selector (str) – The type of selector to use (e.g., ‘css’, ‘xpath’, ‘id’).

  • locator (str) – The locator expression to identify the element. (e.g., By.CSS_SELECTOR, By.ID)

  • value (str) – The value to be used (e.g., for input or interaction).

Usage:

>>> # Call the method:
>>> oHelper_Poui.InputByLocator(selector='[p-label="PO Select"] [class="po-field-container-content"] > select', locator=By.CSS_SELECTOR, value='Option 2')
:return: None
InputValue(field='', value='', position=1)

Fill the POUI input component. https://po-ui.io/documentation/po-input

Parameters:
  • field (str) – Input text title that you want to fill

  • value (str) – Value that fill in input

  • position (int) – Position which element is located. - Default: 1

Usage:

>>> # Call the method:
>>> oHelper.InputValue('Name', 'Test')
:return: None
POSearch(content='', placeholder='')

Fill the POUI Search component. https://po-ui.io/documentation/po-page-dynamic-search

Parameters:

content (str) – Content to be Search.

Usage:

>>> # Call the method:
>>> oHelper.POSearch(content='Content to be Search')
:return: None
POtabs(label='')

Clicks on a Label in po-tab. https://po-ui.io/documentation/po-tabs

Parameters:

label (str) – The tab label name

>>> # Call the method:
>>> oHelper.POTabs(label='Test')
:return: None
TearDown()

Closes the webdriver and ends the test case.

Usage:

>>> #Calling the method
>>> inst.oHelper.TearDown()