Skip to content

Commit

Permalink
Merge pull request #150 from qentinelqi/tko_doc_improvements
Browse files Browse the repository at this point in the history
Tko doc improvements
  • Loading branch information
tkoukkari authored May 15, 2024
2 parents 6312d4a + bbd1fa0 commit c0622b5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
18 changes: 18 additions & 0 deletions QWeb/keywords/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def drop_down(
) -> None:
r"""Select an option from dropdown menu/list.
**NOTE:** This keyword is designed to function exclusively with actual dropdowns
that contain **<select>** and **<option>** tags.
Examples
--------
.. code-block:: robotframework
Expand Down Expand Up @@ -136,6 +139,9 @@ def verify_selected_option(
r"""Verify that an option is selected from dropdown menu/list.
Note: with multiselection dropdown verify each option individually.
**NOTE:** This keyword is designed to function exclusively with actual dropdowns
that contain **<select>** and **<option>** tags.
Examples
--------
.. code-block:: robotframework
Expand Down Expand Up @@ -188,6 +194,9 @@ def get_selected(
) -> None:
r"""Get selected option to variable from dropdown menu/list.
**NOTE:** This keyword is designed to function exclusively with actual dropdowns
that contain **<select>** and **<option>** tags.
Examples
--------
.. code-block:: robotframework
Expand Down Expand Up @@ -248,6 +257,9 @@ def verify_option(
) -> None:
r"""Verify that option exist in dropdown menu/list.
**NOTE:** This keyword is designed to function exclusively with actual dropdowns
that contain **<select>** and **<option>** tags.
Examples
--------
.. code-block:: robotframework
Expand Down Expand Up @@ -299,6 +311,9 @@ def get_drop_down_values(
) -> None:
r"""Return all options from a dropdown menu/list.
**NOTE:** This keyword is designed to function exclusively with actual dropdowns
that contain **<select>** and **<option>** tags.
Examples
--------
.. code-block:: robotframework
Expand Down Expand Up @@ -349,6 +364,9 @@ def verify_no_option(
) -> None:
r"""Verify that a given option is not in a dropdown menu/list.
**NOTE:** This keyword is designed to function exclusively with actual dropdowns
that contain **<select>** and **<option>** tags.
Examples
--------
.. code-block:: robotframework
Expand Down
20 changes: 12 additions & 8 deletions QWeb/keywords/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
ACTIVE_FILE: File = None # type: ignore[assignment]


@keyword(tags=["File"])
@keyword(tags=["PDF", "File"])
def use_pdf(filename: str) -> None:
r"""Define pdf file for all other pdf keywords.
Expand Down Expand Up @@ -91,7 +91,7 @@ def use_file(filename: str) -> None:
ACTIVE_FILE = File.create_text_file_instance(filename)


@keyword(tags=("File", "Getters"))
@keyword(tags=("PDF", "File", "Getters"))
def get_pdf_text(**kwargs) -> str:
r"""Get text content from pdf file.
Expand All @@ -116,6 +116,8 @@ def get_pdf_text(**kwargs) -> str:
${text} GetPdfText between=Simple???File
# matches to text between Simple and end of file.
${text} GetPdfText between=Simple???
# Returns 6 characters from the beginning of match.
${text} GetPdfText between=Simple??? from_start=6
Expand Down Expand Up @@ -168,6 +170,8 @@ def get_file_text(**kwargs) -> str:
${text} GetFileText between=Simple???File
# matches to text between Simple and end of file.
${text} GetFileText between=Simple???File
# Returns 6 characters from the beginning of match.
${text} GetFileText between=Simple??? from_start=6
Expand Down Expand Up @@ -195,7 +199,7 @@ def get_file_text(**kwargs) -> str:
return str(ACTIVE_FILE.get(**kwargs))


@keyword(tags=("File", "Verification"))
@keyword(tags=("PDF", "File", "Verification"))
def verify_pdf_text(text: str, normalize: bool = False) -> None:
r"""Verify text from pdf file.
Expand Down Expand Up @@ -223,7 +227,7 @@ def verify_pdf_text(text: str, normalize: bool = False) -> None:

@keyword(tags=("File", "Verification"))
def verify_file_text(text: str, normalize: bool = False) -> None:
r"""Verify text from pdf file.
r"""Verify text from plain text file.
Examples
--------
Expand All @@ -246,9 +250,9 @@ def verify_file_text(text: str, normalize: bool = False) -> None:
ACTIVE_FILE.verify(text, normalize)


@keyword(tags=("File", "Verification"))
@keyword(tags=("PDF", "File", "Verification"))
def verify_no_pdf_text(text: str, normalize: bool = False) -> None:
r"""Verify text not exists in pdf-file.
r"""Check that the text does not exist in the PDF file.
Examples
--------
Expand Down Expand Up @@ -277,7 +281,7 @@ def verify_no_pdf_text(text: str, normalize: bool = False) -> None:

@keyword(tags=("File", "Verification"))
def verify_no_file_text(text: str, normalize: bool = False) -> None:
r"""Verify text not exists in pdf-file.
r"""Check that the text does not exist in the plain text file.
Examples
--------
Expand Down Expand Up @@ -329,7 +333,7 @@ def remove_file(file: Optional[str] = None) -> None:
os.remove(file)


@keyword(tags=("File", "Interaction"))
@keyword(tags=("PDF", "File", "Interaction"))
def remove_pdf() -> None:
r"""Remove a file.
Expand Down
2 changes: 1 addition & 1 deletion docs/QWeb.html

Large diffs are not rendered by default.

0 comments on commit c0622b5

Please sign in to comment.