You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating markdown doc to address feedback comments (#84)
<!-- markdownlint-disable-next-line first-line-heading -->
## Description
<!-- Describe your changes in detail. -->
Updating the markdown document as according to feedback comments.
## Context
<!-- Why is this change required? What problem does it solve? -->
Makes it easier to understand what the util does and how to use it.
## Type of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply. -->
- [x] Refactoring (non-breaking change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would change existing
functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I am familiar with the [contributing
guidelines](https://github.com/nhs-england-tools/playwright-python-blueprint/blob/main/CONTRIBUTING.md)
- [x] I have followed the code style of the project
- [ ] I have added tests to cover my changes (where appropriate)
- [x] I have updated the documentation accordingly
- [ ] This PR is a result of pair or mob programming
---
## Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others
privacy, we kindly ask you to NOT including [PII (Personal Identifiable
Information) / PID (Personal Identifiable
Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public)
or any other sensitive data in this PR (Pull Request) and the codebase
changes. We will remove any PR that do contain any sensitive
information. We really appreciate your cooperation in this matter.
- [x] I confirm that neither PII/PID nor sensitive data are included in
this PR and the codebase changes.
The Table Utilities module provides helper functions to interact with and validate HTML tables in Playwright-based UI tests.
3
+
The Table Utilities module (`utils/table_util.py`) provides helper functions to interact with and validate HTML tables in Playwright-based UI tests.
4
+
**This utility is designed to be used inside Page Object Model (POM) classes** to simplify table interactions and assertions.
4
5
5
6
## Table of Contents
6
7
@@ -9,227 +10,193 @@ The Table Utilities module provides helper functions to interact with and valida
9
10
-[Using the Table Utility](#using-the-table-utility)
10
11
-[Example usage](#example-usage)
11
12
-[Get Column Index](#get-column-index)
12
-
-[Required Arguments](#required-arguments)
13
-
-[How This Function Works](#how-this-function-works)
13
+
-[Example](#example)
14
14
-[Click First Link In Column](#click-first-link-in-column)
15
-
-[Required Arguments](#required-arguments-1)
16
-
-[How This Function Works](#how-this-function-works-1)
15
+
-[Example](#example-1)
17
16
-[Click First Input In Column](#click-first-input-in-column)
18
-
-[Required Arguments](#required-arguments-2)
19
-
-[How This Function Works](#how-this-function-works-2)
17
+
-[Example](#example-2)
20
18
-[Format Inner Text](#format-inner-text)
21
-
-[Required Arguments](#required-arguments-3)
22
-
-[How This Function Works](#how-this-function-works-3)
19
+
-[Example](#example-3)
23
20
-[Get Table Headers](#get-table-headers)
24
-
-[Required Arguments](#required-arguments-4)
25
-
-[How This Function Works](#how-this-function-works-4)
21
+
-[Example](#example-4)
26
22
-[Get Row Count](#get-row-count)
27
-
-[Required Arguments](#required-arguments-5)
28
-
-[How This Function Works](#how-this-function-works-5)
23
+
-[Example](#example-5)
29
24
-[Pick Row](#pick-row)
30
-
-[Required Arguments](#required-arguments-6)
31
-
-[How This Function Works](#how-this-function-works-6)
25
+
-[Example](#example-6)
32
26
-[Pick Random Row](#pick-random-row)
33
-
-[Required Arguments](#required-arguments-7)
34
-
-[How This Function Works](#how-this-function-works-7)
27
+
-[Example](#example-7)
35
28
-[Pick Random Row Number](#pick-random-row-number)
36
-
-[Required Arguments](#required-arguments-8)
37
-
-[How This Function Works](#how-this-function-works-8)
29
+
-[Example](#example-8)
38
30
-[Get Row Data With Headers](#get-row-data-with-headers)
39
-
-[Required Arguments](#required-arguments-9)
40
-
-[How This Function Works](#how-this-function-works-9)
31
+
-[Example](#example-9)
41
32
-[Get Full Table With Headers](#get-full-table-with-headers)
42
-
-[Required Arguments](#required-arguments-10)
43
-
-[How This Function Works](#how-this-function-works-10)
33
+
-[Example](#example-10)
44
34
45
35
## Using the Table Utility
46
36
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.
37
+
To use the Table Utility, import the `TableUtils` class into your Page Object Model (POM) file and instantiate it for each table you want to interact with.
48
38
49
-
## Example usage
50
-
51
-
Below is an example of how the TableUtils used in reports_page.py
39
+
```python
40
+
from utils.table_util import TableUtils
52
41
53
-
from utils.table_util import TableUtils
54
-
class ReportsPage(BasePage):
42
+
classReportsPage(BasePage):
55
43
"""Reports Page locators, and methods for interacting with the page."""
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).
73
-
If the column is not found, the function returns -1.
56
+
Below are examples of how to use `TableUtils` methods inside your POM methods or tests:
74
57
75
-
#### Required Arguments
58
+
```python
59
+
# Click the first NHS number link in the reports table
0 commit comments