widgetastic.patternfly5 24.3.19.0__py3-none-any.whl → 25.1.24.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.3.19.0.dist-info → widgetastic.patternfly5-25.1.24.0.dist-info}/METADATA +4 -2
- {widgetastic.patternfly5-24.3.19.0.dist-info → widgetastic.patternfly5-25.1.24.0.dist-info}/RECORD +8 -6
- {widgetastic.patternfly5-24.3.19.0.dist-info → widgetastic.patternfly5-25.1.24.0.dist-info}/WHEEL +1 -1
- widgetastic_patternfly5/__init__.py +2 -0
- widgetastic_patternfly5/charts/alerts_timeline_chart.py +65 -0
- widgetastic_patternfly5/charts/boxplot_chart.py +12 -0
- widgetastic_patternfly5/components/menus/select.py +9 -0
- {widgetastic.patternfly5-24.3.19.0.dist-info → widgetastic.patternfly5-25.1.24.0.dist-info}/licenses/LICENSE +0 -0
{widgetastic.patternfly5-24.3.19.0.dist-info → widgetastic.patternfly5-25.1.24.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: widgetastic.patternfly5
|
|
3
|
-
Version:
|
|
3
|
+
Version: 25.1.24.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'
|
|
@@ -103,6 +104,7 @@ itteration of [widgetastic.patternfly4](https://github.com/RedHatQE/widgetastic.
|
|
|
103
104
|
|
|
104
105
|
### Charts:
|
|
105
106
|
- [bullet-chart](https://www.patternfly.org/charts/bullet-chart)
|
|
107
|
+
- [boxplot-chart](https://www.patternfly.org/charts/box-plot-chart)
|
|
106
108
|
- [donut-chart](https://www.patternfly.org/charts/donut-chart)
|
|
107
109
|
- [legends](https://www.patternfly.org/charts/legends)
|
|
108
110
|
- [line-chart](https://www.patternfly.org/charts/line-chart)
|
{widgetastic.patternfly5-24.3.19.0.dist-info → widgetastic.patternfly5-25.1.24.0.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
widgetastic_patternfly5/__init__.py,sha256=
|
|
1
|
+
widgetastic_patternfly5/__init__.py,sha256=YeVCoYFKRjU7Jgm8iYlikzG_aUfdPr--ayP4i_KrKuY,4859
|
|
2
2
|
widgetastic_patternfly5/ouia.py,sha256=DCVMYscDvvhDbYlyfEnuaS1yUAqQ8Ty3sV50tZkXQHI,4299
|
|
3
3
|
widgetastic_patternfly5/charts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
widgetastic_patternfly5/charts/alerts_timeline_chart.py,sha256=U7hJvxAG1Wgj9WFt5QxAmLh9cJm2qzs2YHs2wfEW0Pk,2377
|
|
5
|
+
widgetastic_patternfly5/charts/boxplot_chart.py,sha256=6Ek6gwbmwNeazy-5o2fVfvkjpd6bhbTyitiPomvLBts,405
|
|
4
6
|
widgetastic_patternfly5/charts/bullet_chart.py,sha256=G7-U1l9d8VlkiPKc3IfFtcleHAmM5WXsfAKwiyw5DEg,3737
|
|
5
7
|
widgetastic_patternfly5/charts/donut_chart.py,sha256=phPoVkvxdfUqxsHB8uWvdFUhWGT3ECi89J8H7VCySx4,2693
|
|
6
8
|
widgetastic_patternfly5/charts/legend.py,sha256=fhAg-FhsWpvi91BZ29EztKO3QfANRW-hnfzIkq45q3Y,2983
|
|
@@ -37,8 +39,8 @@ widgetastic_patternfly5/components/menus/dropdown.py,sha256=5nCz0HRG4VcrzD1NFC9H
|
|
|
37
39
|
widgetastic_patternfly5/components/menus/menu.py,sha256=0cUb5V1y3RgRpdAB8DlPIL9OOl7IxBC8A1xjcZgfLBA,7949
|
|
38
40
|
widgetastic_patternfly5/components/menus/menu_toggle.py,sha256=PBwNvg6E2RPdCG6ALBUqyTZxCwThJgk5S-9ghTiZ9hM,1029
|
|
39
41
|
widgetastic_patternfly5/components/menus/options_menu.py,sha256=43D0_JHeY-kPORQi54NL9OVmcMyAolVnI4dqHpo5omY,1353
|
|
40
|
-
widgetastic_patternfly5/components/menus/select.py,sha256=
|
|
41
|
-
widgetastic.patternfly5-
|
|
42
|
-
widgetastic.patternfly5-
|
|
43
|
-
widgetastic.patternfly5-
|
|
44
|
-
widgetastic.patternfly5-
|
|
42
|
+
widgetastic_patternfly5/components/menus/select.py,sha256=D4M5XUsiQVye97dClWra1c6rD0M-HM4wVJ2VdVFM0F0,6537
|
|
43
|
+
widgetastic.patternfly5-25.1.24.0.dist-info/METADATA,sha256=UghSZ34wny32rW5NAY_n8MdGqPDXCa_hIku9knDTa3k,6925
|
|
44
|
+
widgetastic.patternfly5-25.1.24.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
45
|
+
widgetastic.patternfly5-25.1.24.0.dist-info/licenses/LICENSE,sha256=nDhhj8jp0XsTdmvWpTWFpOKVn0LPXPb6ecA9zFF3Exk,576
|
|
46
|
+
widgetastic.patternfly5-25.1.24.0.dist-info/RECORD,,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from .charts.boxplot_chart import BoxPlotChart
|
|
1
2
|
from .charts.bullet_chart import BulletChart
|
|
2
3
|
from .charts.donut_chart import DonutChart
|
|
3
4
|
from .charts.legend import DataPoint
|
|
@@ -72,6 +73,7 @@ from .components.title import Title
|
|
|
72
73
|
__all__ = [
|
|
73
74
|
"Alert",
|
|
74
75
|
"BreadCrumb",
|
|
76
|
+
"BoxPlotChart",
|
|
75
77
|
"BulletChart",
|
|
76
78
|
"Button",
|
|
77
79
|
"CalendarMonth",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from widgetastic_patternfly5.charts.line_chart import LineChart
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AlertsTimelineChart(LineChart):
|
|
5
|
+
"""Represents the Patternfly Alerts Timeline.
|
|
6
|
+
|
|
7
|
+
https://v5-archive.patternfly.org/charts/bar-chart/#alerts-timeline
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
id: If you want to look the input up by id, use this parameter, pass the id.
|
|
11
|
+
locator: If you have specific locator else it will take pf-chart.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
Y_AXIS_ROW = "./*[name()='svg']/*[name()='g'][3]/*[name()='g']"
|
|
15
|
+
Y_AXIS_ROW_LINE = "./*[name()='path']"
|
|
16
|
+
|
|
17
|
+
TOOLTIP = "./*[name()='svg']/*[name()='g'][5]"
|
|
18
|
+
TOOLTIP_X_AXIS_LABLE = None
|
|
19
|
+
TOOLTIP_LABLES = None
|
|
20
|
+
TOOLTIP_VALUES = ".//*[name()='text']/*[name()='tspan']"
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def _y_axis_labels_map(self):
|
|
24
|
+
"""Labels and its webelements in the Y axis
|
|
25
|
+
NOTE: Y labels might not match the number of rows in Y axes.
|
|
26
|
+
"""
|
|
27
|
+
return {self.browser.text(el): el for el in self.browser.elements(self.Y_AXIS_LABELS)}
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def labels_y_axis(self):
|
|
31
|
+
"""Return Y-Axis labels."""
|
|
32
|
+
return list(self._y_axis_labels_map.keys())
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def _y_axis_map(self):
|
|
36
|
+
"""Dict with Y axis row number as key and the contained lines in each row as values."""
|
|
37
|
+
y_axis_rows_els = self.browser.elements(self.Y_AXIS_ROW)
|
|
38
|
+
y_axis_map = {}
|
|
39
|
+
for row_n, row_el in enumerate(y_axis_rows_els):
|
|
40
|
+
y_axis_map[row_n] = self.browser.elements(self.Y_AXIS_ROW_LINE, parent=row_el)
|
|
41
|
+
return y_axis_map
|
|
42
|
+
|
|
43
|
+
def read(self):
|
|
44
|
+
"""Read chart data."""
|
|
45
|
+
_data = []
|
|
46
|
+
|
|
47
|
+
for lines_el in self._y_axis_map.values():
|
|
48
|
+
_row_data = []
|
|
49
|
+
for line_el in lines_el:
|
|
50
|
+
self.browser.move_to_element(line_el)
|
|
51
|
+
self.browser.click(line_el)
|
|
52
|
+
tooltip_el = self.browser.wait_for_element(self.TOOLTIP)
|
|
53
|
+
|
|
54
|
+
label_data = {}
|
|
55
|
+
value_els = self.browser.elements(self.TOOLTIP_VALUES, parent=tooltip_el)
|
|
56
|
+
for value_el in value_els:
|
|
57
|
+
key, value = self.browser.text(value_el).lower().split(": ")
|
|
58
|
+
label_data[key] = value
|
|
59
|
+
|
|
60
|
+
_row_data.append(label_data)
|
|
61
|
+
_data.append(_row_data)
|
|
62
|
+
|
|
63
|
+
# Just move cursor to avoid mismatch of legend and tooltip text.
|
|
64
|
+
self.root_browser.move_to_element(".//body")
|
|
65
|
+
return _data
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from widgetastic_patternfly5.charts.line_chart import LineChart
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class BoxPlotChart(LineChart):
|
|
5
|
+
"""Represents the Patternfly Boxplot Chart.
|
|
6
|
+
|
|
7
|
+
https://patternfly-react-main.surge.sh/charts/box-plot-chart#embedded-legend
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
id: If you want to look the input up by id, use this parameter, pass the id.
|
|
11
|
+
locator: If you have specific locator else it will take pf-chart.
|
|
12
|
+
"""
|
|
@@ -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
|