Skip to content

Commit 1df3618

Browse files
committed
Added docstrings and made a minor correction
1 parent 279e760 commit 1df3618

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Note: This project is actively maintained and evolving.
2121
- [Prerequisites](#prerequisites)
2222
- [1. Install Python 3.11 or higher](#1-install-python-311-or-higher)
2323
- [2. Set up a virtual environment (recommended)](#2-set-up-a-virtual-environment-recommended)
24-
- [First Create the virtual environment](#first-create-the-virtual-environment)
25-
- [Next Activate the virtual environment](#next-activate-the-virtual-environment)
24+
- [First - Create the virtual environment](#first---create-the-virtual-environment)
25+
- [Next - Activate the virtual environment](#next---activate-the-virtual-environment)
2626
- [Installation \& Configuration](#installation--configuration)
2727
- [1. Install Dependencies](#1-install-dependencies)
2828
- [2. Environment Variables](#2-environment-variables)
@@ -72,7 +72,7 @@ A virtual environment is like a sandbox—it keeps your project’s Python packa
7272

7373
Note: If you are using an IDE such as Visual Studio Code or PyCharm, you will normally be prompted to do this automatically.
7474

75-
##### First Create the virtual environment
75+
##### First - Create the virtual environment
7676

7777
To create and activate a virtual environment, open your terminal or command prompt in the root folder of the project (where requirements.txt lives), then run:
7878

@@ -84,7 +84,7 @@ If you get an error like 'Python not found', try using Python3 instead:
8484

8585
`python3 -m venv .venv`
8686

87-
##### Next Activate the virtual environment
87+
##### Next - Activate the virtual environment
8888

8989
This step tells your terminal to use the Python version and packages inside .venv.
9090

@@ -202,6 +202,13 @@ Each test typically follows this structure:
202202

203203
```Python
204204
def test_user_can_login(page):
205+
"""
206+
Verifies that a predefined user can successfully log in and reach the BCSS home page.
207+
208+
Steps:
209+
- Logs in using the 'Hub Manager State Registered at BCS01' user defined in users.json.
210+
- Asserts that the application title is visible and contains the expected text.
211+
"""
205212
UserTools.user_login(page, "Hub Manager State Registered at BCS01") # Users are defined in users.json
206213
expect(page.locator("#ntshAppTitle")).to_contain_text(
207214
"Bowel Cancer Screening System"
@@ -214,7 +221,7 @@ def test_user_can_login(page):
214221

215222
#### 4. Markers and Tags
216223

217-
Use @pytest.mark.<tag> to run a subset or tests as required:
224+
Use @pytest.mark.<tag> to run a subset of tests as required:
218225

219226
```Python
220227
@pytest.mark.smoke
@@ -314,6 +321,17 @@ Utility modules help you abstract common functionality that doesn’t belong in
314321
from playwright.sync_api import expect
315322

316323
def wait_for_element(page, selector, timeout=5000):
324+
"""
325+
Waits for a specific element to become visible on the page within a given timeout.
326+
327+
Args:
328+
page (Page): The Playwright page instance to operate on.
329+
selector (str): The CSS selector of the element to wait for.
330+
timeout (int, optional): Maximum time to wait for visibility in milliseconds. Defaults to 5000.
331+
332+
Returns:
333+
None
334+
"""
317335
expect(page.locator(selector)).to_be_visible(timeout=timeout)
318336
```
319337

0 commit comments

Comments
 (0)