Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Jul 29, 2024
1 parent c37170d commit c516b4e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 18 deletions.
5 changes: 3 additions & 2 deletions nicegui/testing/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ async def should_see(self,
content: Union[str, list[str], None] = None,
retries: int = 3,
) -> None:
"""Assert that the page contains an input with the given value.
"""Assert that the page contains an element fulfilling certain filter rules.
Note that there is no scrolling in the user simulation -- the entire page is always *visible*.
Due to asynchronous execution, sometimes the expected elements only appear after a short delay.
By default `should_see` makes three attempts to find the element before failing. This can be adjusted with the `retries` parameter.
By default `should_see` makes three attempts to find the element before failing.
This can be adjusted with the `retries` parameter.
"""
assert self.client
for _ in range(retries):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def main_demo() -> None:
with ui.card():
ui.button('button A')
ui.label('label A')

with ui.card().mark('important'):
ui.button('button B')
ui.label('label B')
Expand Down Expand Up @@ -38,7 +39,7 @@ def text_element() -> None:


@doc.demo('Markers', '''
Markers are a simple way to tag elements with a string which can be queried by an ElementFilter.
Markers are a simple way to tag elements with a string which can be queried by an `ElementFilter`.
''')
def marker_demo() -> None:
from nicegui import ElementFilter
Expand Down
2 changes: 1 addition & 1 deletion website/documentation/content/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
section_action_events,
section_audiovisual_elements,
section_binding_properties,
section_configuration_deployment,
section_controls,
section_data_elements,
section_page_layout,
section_pages_routing,
section_styling_appearance,
section_configuration_deployment,
section_text_elements,
section_testing,
)
Expand Down
2 changes: 1 addition & 1 deletion website/documentation/content/section_testing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from . import (
doc,
screen_documentation,
test_setup_documentation,
user_documentation,
screen_documentation,
)

doc.title('*Testing*')
Expand Down
13 changes: 0 additions & 13 deletions website/documentation/content/test_setup_documentation.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
from nicegui.elements.markdown import remove_indentation
from nicegui import ui

from ..windows import bash_window, python_window
from . import doc


def show_docstring(func) -> None:
"""Show the docstring of a function or class."""
docstring = func.__doc__
if isinstance(func, type) and not doc:
docstring = func.__init__.__doc__ # type: ignore
title, description = docstring.split('\n', 1)
title = title.rstrip('.')
description = remove_indentation(description)
doc.text(title, description)


doc.title('Project Structure')


Expand Down

0 comments on commit c516b4e

Please sign in to comment.