Skip to content

Commit 8c48174

Browse files
feat(tests): Add shiny.pytest, shiny.run and shiny.playwright (#1448)
Co-authored-by: Barret Schloerke <[email protected]>
1 parent 6679cb9 commit 8c48174

File tree

101 files changed

+744
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+744
-436
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ shiny = py.typed
126126

127127
[options.entry_points]
128128
pytest11 =
129-
shiny-test = shiny.test._pytest
129+
shiny-test = shiny.pytest._pytest
130130
console_scripts =
131131
shiny = shiny._main:main
132132

shiny/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""A package for building reactive web applications."""
22

3-
__version__ = "0.10.2.9000"
3+
__version__ = "0.10.2.9001"
44

55
from ._shinyenv import is_pyodide as _is_pyodide
66

shiny/playwright/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
try:
2+
import playwright # noqa: F401 # pyright: ignore[reportUnusedImport, reportMissingTypeStubs]
3+
except ImportError:
4+
raise ImportError(
5+
"The shiny.playwright module requires the playwright package to be installed."
6+
" Please install it with this command:"
7+
"\n\n pip install playwright"
8+
"\n\n",
9+
"If you are using pytest to test your code,"
10+
" you can install the pytest-playwright shim package with this command:",
11+
"\n\n pip install pytest-playwright",
12+
)
13+
14+
from . import controls, expect
15+
16+
__all__ = ["expect", "controls"]

shiny/playwright/_types.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""Facade classes for working with Shiny inputs/outputs in Playwright"""
2+
3+
from __future__ import annotations
4+
5+
import typing
6+
from typing import Optional
7+
8+
OptionalStr = Optional[str]
9+
OptionalInt = Optional[int]
10+
OptionalFloat = Optional[float]
11+
OptionalBool = Optional[bool]
12+
13+
PatternStr = typing.Pattern[str]
14+
PatternOrStr = typing.Union[str, PatternStr]
15+
ListPatternOrStr = typing.Union[
16+
typing.List[PatternOrStr], typing.List[str], typing.List[PatternStr]
17+
]
18+
AttrValue = typing.Union[PatternOrStr, None]
19+
StyleValue = typing.Union[PatternOrStr, None]
20+
21+
Timeout = typing.Union[float, None]
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
from ._controls import (
2+
Accordion,
3+
Card,
4+
DownloadButton,
5+
DownloadLink,
6+
InputActionButton,
7+
InputActionLink,
8+
InputCheckbox,
9+
InputCheckboxGroup,
10+
InputDarkMode,
11+
InputDate,
12+
InputDateRange,
13+
InputFile,
14+
InputNumeric,
15+
InputPassword,
16+
InputRadioButtons,
17+
InputSelect,
18+
InputSelectize,
19+
InputSlider,
20+
InputSliderRange,
21+
InputSwitch,
22+
InputTaskButton,
23+
InputText,
24+
InputTextArea,
25+
NavItem,
26+
NavsetBar,
27+
NavsetCardPill,
28+
NavsetCardTab,
29+
NavsetCardUnderline,
30+
NavsetHidden,
31+
NavsetPill,
32+
NavsetPillList,
33+
NavsetTab,
34+
NavsetUnderline,
35+
OutputCode,
36+
OutputDataFrame,
37+
OutputImage,
38+
OutputPlot,
39+
OutputTable,
40+
OutputText,
41+
OutputTextVerbatim,
42+
OutputUi,
43+
Popover,
44+
Sidebar,
45+
Tooltip,
46+
ValueBox,
47+
)
48+
49+
__all__ = [
50+
"InputActionButton",
51+
"InputActionLink",
52+
"InputCheckbox",
53+
"InputCheckboxGroup",
54+
"InputDarkMode",
55+
"InputDate",
56+
"InputDateRange",
57+
"InputFile",
58+
"InputNumeric",
59+
"InputPassword",
60+
"InputRadioButtons",
61+
"InputSelect",
62+
"InputSelectize",
63+
"InputSlider",
64+
"InputSliderRange",
65+
"InputSwitch",
66+
"InputTaskButton",
67+
"InputText",
68+
"InputTextArea",
69+
"OutputCode",
70+
"OutputDataFrame",
71+
"OutputImage",
72+
"OutputPlot",
73+
"OutputTable",
74+
"OutputText",
75+
"OutputTextVerbatim",
76+
"OutputUi",
77+
"ValueBox",
78+
"Card",
79+
"Accordion",
80+
"Sidebar",
81+
"Popover",
82+
"Tooltip",
83+
"NavItem",
84+
"NavsetBar",
85+
"NavsetCardPill",
86+
"NavsetCardTab",
87+
"NavsetCardUnderline",
88+
"NavsetHidden",
89+
"NavsetPill",
90+
"NavsetPillList",
91+
"NavsetTab",
92+
"NavsetUnderline",
93+
"DownloadButton",
94+
"DownloadLink",
95+
]

0 commit comments

Comments
 (0)