@@ -6,6 +6,8 @@ The Table Utilities module provides helper functions to interact with and valida
66
77- [ Utility Guide: Table Utility] ( #utility-guide-table-utility )
88 - [ Table of Contents] ( #table-of-contents )
9+ - [ Using the Table Utility] ( #using-the-table-utility )
10+ - [ Example usage] ( #example-usage )
911 - [ Get Column Index] ( #get-column-index )
1012 - [ Required Arguments] ( #required-arguments )
1113 - [ How This Function Works] ( #how-this-function-works )
@@ -40,6 +42,31 @@ The Table Utilities module provides helper functions to interact with and valida
4042 - [ Required Arguments] ( #required-arguments-10 )
4143 - [ How This Function Works] ( #how-this-function-works-10 )
4244
45+ ## Using the Table Utility
46+
47+ To use the Table Utility, import the ` TableUtils ` class into your POM file and then define the actions using the its methods as needed.
48+
49+ ## Example usage
50+
51+ Below is an example of how the TableUtils used in reports_page.py
52+
53+ from utils.table_util import TableUtils
54+ class ReportsPage(BasePage):
55+ """Reports Page locators, and methods for interacting with the page."""
56+
57+ def __init__(self, page):
58+ super().__init__(page)
59+ self.page = page
60+
61+ # Initialize TableUtils for different tables
62+ self.failsafe_reports_sub_links_table = TableUtils(page, "#listReportDataTable")
63+ self.fail_safe_reports_screening_subjects_with_inactive_open_episodes_table = (
64+ TableUtils(page, "#subjInactiveOpenEpisodes")
65+ )
66+ def click_failsafe_reports_sub_links(self):
67+ """Clicks the first NHS number link from the primary report table."""
68+ self.failsafe_reports_sub_links_table.click_first_link_in_column("NHS Number")
69+
4370### Get Column Index
4471
4572This function returns the index (1-based) of a specified column name. 1-based indexing means the first column is considered index 1 (not 0 as in Python lists).
0 commit comments