widgetastic.patternfly5 24.2.29.0__py3-none-any.whl → 24.4.15.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {widgetastic.patternfly5-24.2.29.0.dist-info → widgetastic.patternfly5-24.4.15.0.dist-info}/METADATA +4 -2
- {widgetastic.patternfly5-24.2.29.0.dist-info → widgetastic.patternfly5-24.4.15.0.dist-info}/RECORD +7 -6
- {widgetastic.patternfly5-24.2.29.0.dist-info → widgetastic.patternfly5-24.4.15.0.dist-info}/WHEEL +1 -1
- widgetastic_patternfly5/__init__.py +2 -0
- widgetastic_patternfly5/components/expandable_section.py +60 -0
- widgetastic_patternfly5/components/menus/select.py +9 -0
- {widgetastic.patternfly5-24.2.29.0.dist-info → widgetastic.patternfly5-24.4.15.0.dist-info}/licenses/LICENSE +0 -0
{widgetastic.patternfly5-24.2.29.0.dist-info → widgetastic.patternfly5-24.4.15.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: widgetastic.patternfly5
|
|
3
|
-
Version: 24.
|
|
3
|
+
Version: 24.4.15.0
|
|
4
4
|
Summary: Patternfly5 widget library for Widgetastic.
|
|
5
5
|
Project-URL: repository, https://github.com/RedHatQE/widgetastic.patternfly5
|
|
6
6
|
Maintainer-email: Nikhil Dhandre <ndhandre@redhat.com>, Egor Shamardin <eshamard@redhat.com>, Mike Shriver <mshriver@redhat.com>
|
|
@@ -34,6 +34,7 @@ Requires-Dist: codecov; extra == 'dev'
|
|
|
34
34
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
35
35
|
Requires-Dist: pytest; extra == 'dev'
|
|
36
36
|
Requires-Dist: pytest-cov; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest-rerunfailures; extra == 'dev'
|
|
37
38
|
Requires-Dist: pytest-xdist; extra == 'dev'
|
|
38
39
|
Provides-Extra: doc
|
|
39
40
|
Requires-Dist: sphinx; extra == 'doc'
|
|
@@ -78,6 +79,7 @@ itteration of [widgetastic.patternfly4](https://github.com/RedHatQE/widgetastic.
|
|
|
78
79
|
- [description-list](https://www.patternfly.org/components/description-list)
|
|
79
80
|
- [drawer](https://www.patternfly.org/components/drawer)
|
|
80
81
|
- [dual-list-selector](https://www.patternfly.org/components/dual-list-selector)
|
|
82
|
+
- [expandable-section](https://www.patternfly.org/components/expandable-section)
|
|
81
83
|
- forms
|
|
82
84
|
- [form-select](https://www.patternfly.org/components/forms/form-select)
|
|
83
85
|
- [radio](https://www.patternfly.org/components/forms/radio)
|
{widgetastic.patternfly5-24.2.29.0.dist-info → widgetastic.patternfly5-24.4.15.0.dist-info}/RECORD
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
widgetastic_patternfly5/__init__.py,sha256=
|
|
1
|
+
widgetastic_patternfly5/__init__.py,sha256=tYIOwdzFaAxtzk9xRM89MgeYNQrEqGKl8jpbMry1zTg,4792
|
|
2
2
|
widgetastic_patternfly5/ouia.py,sha256=DCVMYscDvvhDbYlyfEnuaS1yUAqQ8Ty3sV50tZkXQHI,4299
|
|
3
3
|
widgetastic_patternfly5/charts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
widgetastic_patternfly5/charts/bullet_chart.py,sha256=G7-U1l9d8VlkiPKc3IfFtcleHAmM5WXsfAKwiyw5DEg,3737
|
|
@@ -16,6 +16,7 @@ widgetastic_patternfly5/components/clipboard_copy.py,sha256=klEgT2RN4Sc7pd7Erwlx
|
|
|
16
16
|
widgetastic_patternfly5/components/description_list.py,sha256=sVhKwKnvJguZh9FqyPC1NU2UA_w7uA3ugkY5eoVRlPk,989
|
|
17
17
|
widgetastic_patternfly5/components/drawer.py,sha256=NuWK3DLpY6YmGs3ANi5XGizJRYhEnrrLcucP2ZFZHoA,949
|
|
18
18
|
widgetastic_patternfly5/components/dual_list_selector.py,sha256=tPT3cMmKVU3vs-iEW0D-iH-E17MOufWyrgQQUm5kHzY,4869
|
|
19
|
+
widgetastic_patternfly5/components/expandable_section.py,sha256=QCqonn1kiYfL-mGcjwrG6x4TiJBr9RKXZvyDerVTUmQ,1876
|
|
19
20
|
widgetastic_patternfly5/components/modal.py,sha256=842x6D9Xe4LRW0YA8W-rGp8Ak8tHwinD_zktLCYsjtg,2003
|
|
20
21
|
widgetastic_patternfly5/components/navigation.py,sha256=9CdnD23hlBtfJAi1RDFRSbTpHc7Rz8wS1W-C9XWOGZw,5361
|
|
21
22
|
widgetastic_patternfly5/components/pagination.py,sha256=YIDYCEATEp4BVy0JZYtNIRGy-dKbgZP2WOzZ6z3c56s,8843
|
|
@@ -36,8 +37,8 @@ widgetastic_patternfly5/components/menus/dropdown.py,sha256=5nCz0HRG4VcrzD1NFC9H
|
|
|
36
37
|
widgetastic_patternfly5/components/menus/menu.py,sha256=0cUb5V1y3RgRpdAB8DlPIL9OOl7IxBC8A1xjcZgfLBA,7949
|
|
37
38
|
widgetastic_patternfly5/components/menus/menu_toggle.py,sha256=PBwNvg6E2RPdCG6ALBUqyTZxCwThJgk5S-9ghTiZ9hM,1029
|
|
38
39
|
widgetastic_patternfly5/components/menus/options_menu.py,sha256=43D0_JHeY-kPORQi54NL9OVmcMyAolVnI4dqHpo5omY,1353
|
|
39
|
-
widgetastic_patternfly5/components/menus/select.py,sha256=
|
|
40
|
-
widgetastic.patternfly5-24.
|
|
41
|
-
widgetastic.patternfly5-24.
|
|
42
|
-
widgetastic.patternfly5-24.
|
|
43
|
-
widgetastic.patternfly5-24.
|
|
40
|
+
widgetastic_patternfly5/components/menus/select.py,sha256=D4M5XUsiQVye97dClWra1c6rD0M-HM4wVJ2VdVFM0F0,6537
|
|
41
|
+
widgetastic.patternfly5-24.4.15.0.dist-info/METADATA,sha256=lxzOzvnP6ACqHBqvWNCJ74O3nEAesZJlyiQw5KvtEK0,6857
|
|
42
|
+
widgetastic.patternfly5-24.4.15.0.dist-info/WHEEL,sha256=xl5aZkiJYVTjhVaiADvIe6UeUVylGNomrxKZ0Zda1CE,87
|
|
43
|
+
widgetastic.patternfly5-24.4.15.0.dist-info/licenses/LICENSE,sha256=nDhhj8jp0XsTdmvWpTWFpOKVn0LPXPb6ecA9zFF3Exk,576
|
|
44
|
+
widgetastic.patternfly5-24.4.15.0.dist-info/RECORD,,
|
|
@@ -25,6 +25,7 @@ from .components.description_list import DescriptionList
|
|
|
25
25
|
from .components.drawer import Drawer
|
|
26
26
|
from .components.dual_list_selector import DualListSelector
|
|
27
27
|
from .components.dual_list_selector import SearchDualListSelector
|
|
28
|
+
from .components.expandable_section import ExpandableSection
|
|
28
29
|
from .components.forms.form_select import FormSelect
|
|
29
30
|
from .components.forms.form_select import FormSelectDisabled
|
|
30
31
|
from .components.forms.form_select import FormSelectOptionDisabled
|
|
@@ -137,4 +138,5 @@ __all__ = [
|
|
|
137
138
|
"SwitchDisabled",
|
|
138
139
|
"Tab",
|
|
139
140
|
"Title",
|
|
141
|
+
"ExpandableSection",
|
|
140
142
|
]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from wait_for import wait_for_decorator
|
|
2
|
+
from widgetastic.widget import View
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ExpandableSection(View):
|
|
6
|
+
"""Represents the Patternfly Expandable section widget.
|
|
7
|
+
|
|
8
|
+
Expands itself automatically when any child widget gets accessed, ensuring
|
|
9
|
+
that the widget is visible.
|
|
10
|
+
|
|
11
|
+
https://www.patternfly.org/components/expandable-section
|
|
12
|
+
|
|
13
|
+
NOTE: When using this in your code you need to set the ROOT yourself!
|
|
14
|
+
|
|
15
|
+
Example code with a button underneath the section:
|
|
16
|
+
|
|
17
|
+
class MySection(ExpandableSection):
|
|
18
|
+
ROOT = ".//div[contains(@data-testid, 'my-expandable-section')]"
|
|
19
|
+
my-button = Button(locator=".//button")
|
|
20
|
+
|
|
21
|
+
After creating the view you can run `MySection.my-button.click()` and it
|
|
22
|
+
will automatically expand and click on your button.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
ROOT = './/div[contains(@class, "-c-expandable-section")]'
|
|
26
|
+
BUTTON_LOCATOR = ".//button"
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def is_expanded(self):
|
|
30
|
+
"""Returns a boolean."""
|
|
31
|
+
if self.browser.get_attribute("aria-expanded", self.BUTTON_LOCATOR) == "true":
|
|
32
|
+
return True
|
|
33
|
+
else:
|
|
34
|
+
return False
|
|
35
|
+
|
|
36
|
+
def click(self):
|
|
37
|
+
"""Clicks the expandable section button."""
|
|
38
|
+
return self.browser.click(self.BUTTON_LOCATOR)
|
|
39
|
+
|
|
40
|
+
def expand(self):
|
|
41
|
+
"""Expands the section (checks if not expanded already first)."""
|
|
42
|
+
if not self.is_expanded:
|
|
43
|
+
|
|
44
|
+
@wait_for_decorator(timeout=3)
|
|
45
|
+
def _click():
|
|
46
|
+
self.click()
|
|
47
|
+
return self.is_expanded
|
|
48
|
+
|
|
49
|
+
def collapse(self):
|
|
50
|
+
"""Collapses the section (checks if expanded already first)."""
|
|
51
|
+
if self.is_expanded:
|
|
52
|
+
|
|
53
|
+
@wait_for_decorator(timeout=3)
|
|
54
|
+
def _click():
|
|
55
|
+
self.click()
|
|
56
|
+
return not self.is_expanded
|
|
57
|
+
|
|
58
|
+
def child_widget_accessed(self, widget):
|
|
59
|
+
# Expand the section
|
|
60
|
+
self.expand()
|
|
@@ -66,7 +66,10 @@ class BaseSelect:
|
|
|
66
66
|
|
|
67
67
|
def fill(self, value):
|
|
68
68
|
"""Fills a Select with a value."""
|
|
69
|
+
if self.read() == value:
|
|
70
|
+
return False
|
|
69
71
|
self.item_select(value)
|
|
72
|
+
return True
|
|
70
73
|
|
|
71
74
|
def read(self):
|
|
72
75
|
"""Returns a string of the text of the selected option."""
|
|
@@ -136,14 +139,20 @@ class BaseCheckboxSelect(BaseSelect):
|
|
|
136
139
|
Args:
|
|
137
140
|
items: A dictionary containing what items to select (True) or deselect (False)
|
|
138
141
|
"""
|
|
142
|
+
current_values = self.read()
|
|
143
|
+
has_changed = False
|
|
139
144
|
try:
|
|
140
145
|
for item, value in items.items():
|
|
146
|
+
if value == current_values.get(item, None):
|
|
147
|
+
continue
|
|
141
148
|
if value:
|
|
142
149
|
self.item_select(item, close=False)
|
|
143
150
|
else:
|
|
144
151
|
self.item_deselect(item, close=False)
|
|
152
|
+
has_changed = True
|
|
145
153
|
finally:
|
|
146
154
|
self.close()
|
|
155
|
+
return has_changed
|
|
147
156
|
|
|
148
157
|
def read(self):
|
|
149
158
|
"""Returns a dictionary containing the selected status as bools."""
|
|
File without changes
|