Skip to content

Commit 8acee67

Browse files
As per JIRA Ticket - https://nhsd-jira.digital.nhs.uk/browse/BCSS-20628 - BCSS – Playwright - Load Properties Markdown Improvements, Implemented the Code Refactoring.
1 parent 794cc2c commit 8acee67

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

docs/utility-guides/LoadProperties.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The Load Properties Utility can be used to retrieve values from a properties fil
77
- [Utility Guide: Load Properties](#utility-guide-load-properties)
88
- [Table of Contents](#table-of-contents)
99
- [How This Works](#how-this-works)
10+
- [Example Usage - Properties files use key value pairs and the reason for using it is to avoid hard coded values in our tests](#example-usage---properties-files-use-key-value-pairs-and-the-reason-for-using-it-is-to-avoid-hard-coded-values-in-our-tests)
1011
- [Using the Load Properties Utility](#using-the-load-properties-utility)
1112
- [Example usage](#example-usage)
1213

@@ -26,11 +27,21 @@ To ensure that there are no mistakes when providing this input there are two add
2627

2728
To add values to the properties file follow the format:
2829

29-
# ----------------------------------
30-
# EXAMPLE VALUES
31-
# ----------------------------------
32-
example_value_1=value1
33-
example_value_2=value2
30+
## Example Usage - Properties files use key value pairs and the reason for using it is to avoid hard coded values in our tests
31+
32+
```python
33+
from utils.load_properties import PropertiesFile
34+
# Create an instance of the PropertiesFile class
35+
properties = PropertiesFile()
36+
37+
# Load smokescreen properties
38+
smokescreen_props = properties.get_smokescreen_properties()
39+
print(smokescreen_props["example_value_1"])
40+
41+
# Load general properties
42+
general_props = properties.get_general_properties()
43+
print(general_props["example_value_2"])
44+
```
3445

3546
## Using the Load Properties Utility
3647

@@ -43,7 +54,9 @@ Here there are two fixtures:
4354

4455
## Example usage
4556

57+
```python
4658
def test_example_1(page: Page, general_properties: dict) -> None:
4759
print(
4860
general_properties["example_value_1"]
4961
)
62+
```

0 commit comments

Comments
 (0)