Skip to content

Commit 6ce082b

Browse files
committed
Addressing review comments
1 parent c1e0acf commit 6ce082b

File tree

2 files changed

+30
-29
lines changed

2 files changed

+30
-29
lines changed

docs/utility-guides/TableUtil.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ The Table Utilities module provides helper functions to interact with and valida
4242

4343
### Get Column Index
4444

45-
This function returns the index (1-based) of a specified column name.
45+
This 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).
46+
If the column is not found, the function returns -1.
4647

4748
#### Required Arguments
4849

49-
-`column_name`:
50-
-Type: `str`
51-
-The visible header text of the column to locate.
50+
- `column_name`:
51+
- Type: `str`
52+
- The visible header text of the column to locate.
5253

5354
#### How This Function Works
5455

@@ -62,14 +63,14 @@ Clicks on the first hyperlink present in a specified column.
6263

6364
#### Required Arguments
6465

65-
-`column_name`:
66-
-Type: `str`
67-
-The column in which the link needs to be found.
66+
- `column_name`:
67+
- Type: `str`
68+
- The column in which the link needs to be found.
6869

6970
#### How This Function Works
7071

7172
1. Finds the index of the specified column.
72-
2. Searches the first visible row in the column for an <a> tag.
73+
2. Searches the first visible row in the column for an `<a>` tag.
7374
3. Clicks the first available link found.
7475

7576
### Click First Input In Column
@@ -78,14 +79,14 @@ Clicks on the first input element (e.g., checkbox/radio) in a specific column.
7879

7980
#### Required Arguments
8081

81-
-`column_name`:
82-
-Type: `str`
83-
-The name of the column containing the input element.
82+
- `column_name`:
83+
- Type: `str`
84+
- The name of the column containing the input element.
8485

8586
#### How This Function Works
8687

8788
1. Locates the index of the specified column.
88-
2. Checks the first visible row for an <input> tag in that column.
89+
2. Checks the first visible row for an `<input>` tag in that column.
8990
3. Clicks the first input found.
9091

9192
### Format Inner Text
@@ -94,9 +95,9 @@ Formats inner text of a row string into a dictionary.
9495

9596
#### Required Arguments
9697

97-
-data:
98-
-Type: `str`
99-
-Raw inner text of a table row (tab-delimited).
98+
- data:
99+
- Type: `str`
100+
- Raw inner text of a table row (tab-delimited).
100101

101102
#### How This Function Works
102103

@@ -110,7 +111,7 @@ Extracts and returns table headers.
110111

111112
#### Required Arguments
112113

113-
-None
114+
- None
114115

115116
#### How This Function Works
116117

@@ -124,7 +125,7 @@ Returns the count of visible rows in the table.
124125

125126
#### Required Arguments
126127

127-
-None
128+
- None
128129

129130
#### How This Function Works
130131

@@ -138,9 +139,9 @@ Returns a locator for a specific row.
138139

139140
#### Required Arguments
140141

141-
-`row_number`:
142-
-Type: `int`
143-
-The row index to locate (1-based).
142+
- `row_number`:
143+
- Type: `int`
144+
- The row index to locate (1-based).
144145

145146
#### How This Function Works
146147

@@ -153,7 +154,7 @@ Picks and returns a random row locator.
153154

154155
#### Required Arguments
155156

156-
None
157+
- None
157158

158159
#### How This Function Works
159160

@@ -167,7 +168,7 @@ Returns the number of a randomly selected row.
167168

168169
#### Required Arguments
169170

170-
None
171+
- None
171172

172173
#### How This Function Works
173174

@@ -181,9 +182,9 @@ Returns a dictionary of header-value pairs for a given row.
181182

182183
#### Required Arguments
183184

184-
-`row_number`:
185-
-Type:int
186-
-Index of the target row (1-based).
185+
- `row_number`:
186+
- Type:int
187+
- Index of the target row (1-based).
187188

188189
#### How This Function Works
189190

@@ -197,7 +198,7 @@ Constructs a dictionary of the entire table content.
197198

198199
#### Required Arguments
199200

200-
-None
201+
- None
201202

202203
#### How This Function Works
203204

utils/table_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_column_index(self, column_name: str) -> int:
3232
Works even if <thead> is missing and header is inside <tbody>.
3333
3434
Args:
35-
column_name(str): Name of the column (e.g., 'NHS Number')
35+
column_name (str): Name of the column (e.g., 'NHS Number')
3636
3737
Return:
3838
An int (1-based column index or -1 if not found)
@@ -58,7 +58,7 @@ def click_first_link_in_column(self, column_name: str):
5858
Clicks the first link found in the given column.
5959
6060
Args:
61-
column_name: Name of the column containing links
61+
column_name (str): Name of the column containing links
6262
"""
6363
column_index = self.get_column_index(column_name)
6464
if column_index == -1:
@@ -78,7 +78,7 @@ def click_first_input_in_column(self, column_name: str):
7878
Clicks the first input found in the given column. E.g. Radios
7979
8080
Args:
81-
column_name: Name of the column containing inputs
81+
column_name (str): Name of the column containing inputs
8282
"""
8383
column_index = self.get_column_index(column_name)
8484
if column_index == -1:

0 commit comments

Comments
 (0)