-
-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace hacky docs.pytest and Demo.raw with generic docs.part
- Loading branch information
Showing
8 changed files
with
84 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,35 @@ | ||
from nicegui.testing import Screen | ||
from . import doc | ||
from nicegui.testing import Screen | ||
from ..windows import python_window | ||
from nicegui import ui | ||
|
||
|
||
@doc.part('Screen Fixture') | ||
def screen_fixture(): | ||
|
||
doc.text('Screen Fixture', ''' | ||
The `screen` fixture starts a real(headless) browser to interact with your application. | ||
ui.markdown(''' | ||
The `screen` fixture starts a real (headless) browser to interact with your application. | ||
This is only necessary if you have browser specific behavior to test. | ||
NiceGUI itself is thoroughly tested with this fixture to ensure each component works as expected. | ||
So only use it if you have to. | ||
''') | ||
|
||
with python_window(classes='w-[600px]', title='example'): | ||
ui.markdown(''' | ||
```python | ||
from selenium.webdriver.common.keys import Keys | ||
screen.open('/') | ||
screen.type(Keys.TAB) # to focus on the first input | ||
screen.type('user1') | ||
screen.type(Keys.TAB) # to focus the second input | ||
screen.type('pass1') | ||
screen.click('Log in') | ||
screen.should_contain('Hello user1!') | ||
screen.click('logout') | ||
screen.should_contain('Log in') | ||
```''') | ||
|
||
|
||
doc.reference(Screen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters