Skip to content

Commit a013a51

Browse files
Addressing PR comments
1 parent df7db5f commit a013a51

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

docs/InvestigationDatasetBuilderApplication.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This application is a Streamlit-based tool for interactively building investigat
99
- [Investigation Dataset Builder Application](#investigation-dataset-builder-application)
1010
- [Table of Contents](#table-of-contents)
1111
- [How to Use the Application](#how-to-use-the-application)
12+
- [What this can be used for](#what-this-can-be-used-for)
1213
- [Pre-requisites](#pre-requisites)
1314
- [Launching the App](#launching-the-app)
1415
- [Selecting and Filling Sections](#selecting-and-filling-sections)
@@ -32,6 +33,14 @@ This application is a Streamlit-based tool for interactively building investigat
3233

3334
## How to Use the Application
3435

36+
### What this can be used for
37+
38+
This application can be used to create the necessary dictionaries in order to populate an investigation dataset<br>
39+
During the conversion on the automation tests from selenium to playwright it can be used for the following feature file steps (There are more but these are just examples):
40+
41+
- And I add the following bowel preparation drugs and values within the Investigation Dataset for this subject:
42+
- And I set the following fields and values within the Investigation Dataset for this subject:
43+
3544
### Pre-requisites
3645

3746
Before running the application, ensure you have the following:

pages/datasets/investigation_dataset_page.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def is_edit_dataset_button_visible(self) -> bool:
571571
"""
572572
return self.edit_dataset_button.is_visible()
573573

574-
def is_dataset_section_present(self, dataset_section_name: str) -> bool | None:
574+
def is_dataset_section_present(self, dataset_section_name: str) -> Optional[bool]:
575575
"""
576576
Checks if a section of the investigation dataset is present
577577
Args:
@@ -600,7 +600,7 @@ def is_dataset_section_present(self, dataset_section_name: str) -> bool | None:
600600
logging.info(f"Dataset section '{dataset_section_name}' not found.")
601601
return False
602602

603-
def get_dataset_section(self, dataset_section_name: str) -> Locator | None:
603+
def get_dataset_section(self, dataset_section_name: str) -> Optional[Locator]:
604604
"""
605605
Retrieves a dataset section by matching its header text.
606606
Only returns the locator if the section is visible.
@@ -609,7 +609,7 @@ def get_dataset_section(self, dataset_section_name: str) -> Locator | None:
609609
Args:
610610
dataset_section_name (str): The name of the dataset section to locate.
611611
Returns:
612-
Locator | None: A Playwright Locator for the matching section if visible, or None if not found or not visible.
612+
Optioanl[Locator]: A Playwright Locator for the matching section if visible, or None if not found or not visible.
613613
"""
614614
logging.info(f"START: Looking for section '{dataset_section_name}'")
615615

@@ -678,7 +678,7 @@ def is_dataset_section_on_page(
678678

679679
def get_dataset_subsection(
680680
self, dataset_section_name: str, dataset_subsection_name: str
681-
) -> Locator | None:
681+
) -> Optional[Locator]:
682682
"""
683683
Retrieves a specific subsection within a dataset section by matching the subsection's header text.
684684
The method first searches through elements with the `.DatasetSubSection` class.
@@ -687,7 +687,7 @@ def get_dataset_subsection(
687687
dataset_section_name (str): The name of the dataset section that contains the subsection.
688688
dataset_subsection_name (str): The name of the subsection to locate.
689689
Returns:
690-
Locator | None: A Playwright Locator for the found subsection, or None if not found.
690+
Optional[Locator]: A Playwright Locator for the found subsection, or None if not found.
691691
Raises:
692692
ValueError: If the specified dataset section cannot be found.
693693
"""
@@ -735,17 +735,17 @@ def get_dataset_subsection(
735735
def are_fields_on_page(
736736
self,
737737
section_name: str,
738-
subsection_name: str | None,
738+
subsection_name: Optional[str],
739739
field_names: list[str],
740-
visible: bool | None = None,
740+
visible: Optional[bool] = None,
741741
) -> bool:
742742
"""
743743
Checks if the given fields are present in a section or subsection, with optional visibility checks.
744744
Args:
745745
section_name (str): The name of the dataset section.
746-
subsection_name (str | None): The name of the subsection, if any.
746+
subsection_name (Optional[str]): The name of the subsection, if any.
747747
field_names (list[str]): List of field labels to check.
748-
visible (bool | None):
748+
visible (Optional[bool]):
749749
- True → fields must be visible
750750
- False → fields must be not visible
751751
- None → visibility doesn't matter (just check presence)

0 commit comments

Comments
 (0)