Skip to content

Commit def4948

Browse files
feat: remove placeholder functionality from framework (#430)
ADDON-71391 Removes the placeholder related functionalities and the test cases present. Users would no longer be able to use the `get_placeholder_value` property for their test cases. **NOTE:** This PR can be merged once UCC 5.48.0 is released and updating the same version for this repo. BREAKING CHANGE: remove placeholder functionality --------- Co-authored-by: Artem Rys <rysartem@gmail.com>
1 parent 4bd8d4f commit def4948

File tree

15 files changed

+4518
-4797
lines changed

15 files changed

+4518
-4797
lines changed

docs/change_log.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# v5.0.0
2+
3+
The `get_placeholder_value` method has been removed in this version. The value present in placeholder will no longer be accessible starting SmartX v5.0.0.
4+
To ensure smooth upgrade of the SmartX from v4.x to v5.0 in your environment, ensure that your add-on doesn't use `placeholder` property defined in your add-on's globalConfig file.
5+
The `placeholder` property for an entity of an input has been deprecated as of September 2023 and has been removed as of UCC framework v5.48.0. You can use `help` property instead. Refer [this documentation](https://splunk.github.io/addonfactory-ucc-generator/entity/) of UCC framework for more details.
6+
7+
Refer the [deprecation notice](https://github.com/splunk/addonfactory-ucc-generator/issues/831) for more details.
8+

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ nav:
9898
- single_select: "api_reference/components/controls/single_select.md"
9999
- textbox: "api_reference/components/controls/textbox.md"
100100
- toggle: "api_reference/components/controls/toggle.md"
101+
- Changelog: "change_log.md"

poetry.lock

Lines changed: 345 additions & 508 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pytest11 = { "ucc-smartx" = "pytest_splunk_addon_ui_smartx.plugin" }
4848

4949
[tool.poetry.group.dev.dependencies]
5050
pytest = ">=5.4, <7.3"
51-
splunk-add-on-ucc-framework = "5.28.5"
51+
splunk-add-on-ucc-framework = "5.48.0"
5252
pytest-rerunfailures = "^12.0"
5353

5454
[build-system]

pytest_splunk_addon_ui_smartx/alert_actions/components/account_select.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,6 @@ def get_value(self):
154154
except:
155155
return False
156156

157-
def get_placeholder_value(self):
158-
"""
159-
get placeholder value from the single select
160-
"""
161-
return self.input.get_attribute("placeholder").strip()
162-
163157
def cancel_selected_value(self):
164158
"""
165159
Cancels the currently selected value in the SingleSelect

pytest_splunk_addon_ui_smartx/alert_actions/components/textbox.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ def get_value(self):
4848
"""
4949
return self.input.get_attribute("value").strip()
5050

51-
def get_placeholder_value(self):
52-
"""
53-
get placeholder value from the textbox
54-
"""
55-
return self.input.get_attribute("placeholder").strip()
56-
5751
def is_editable(self):
5852
"""
5953
Returns True if the Textbox is editable, False otherwise

pytest_splunk_addon_ui_smartx/components/controls/single_select.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -202,29 +202,6 @@ def get_value(self):
202202
else:
203203
return False
204204

205-
def get_placeholder_value(self):
206-
"""
207-
get placeholder value from the single select
208-
"""
209-
if self.searchable:
210-
if self.allow_new_values:
211-
self.elements.update(
212-
{
213-
"input": Selector(
214-
select=self.container.select + ' [data-test="textbox"]'
215-
)
216-
}
217-
)
218-
else:
219-
self.wait_to_be_clickable("root")
220-
self.root.click()
221-
popover_id = "#" + self.root.get_attribute("data-test-popover-id")
222-
self.elements.update(
223-
{"input": Selector(select=popover_id + ' [data-test="textbox"]')}
224-
)
225-
226-
return self.input.get_attribute("placeholder").strip()
227-
228205
def cancel_selected_value(self):
229206
"""
230207
Cancels the currently selected value in the SingleSelect

pytest_splunk_addon_ui_smartx/components/controls/textarea.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ def get_value(self):
4949
"""
5050
return self.input.get_attribute("value")
5151

52-
def get_placeholder_value(self):
53-
"""
54-
get placeholder value from the textbox
55-
:return: Str Value of the placeholder
56-
"""
57-
return self.input.get_attribute("placeholder")
58-
5952
def get_textarea_height(self) -> int:
6053
"""
6154
Get the height of the displayed textarea.

pytest_splunk_addon_ui_smartx/components/controls/textbox.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ def get_value(self):
6262
"""
6363
return self.input.get_attribute("value").strip()
6464

65-
def get_placeholder_value(self):
66-
"""
67-
get placeholder value from the textbox
68-
"""
69-
return self.input.get_attribute("placeholder").strip()
70-
7165
def is_editable(self):
7266
"""
7367
Returns True if the Textbox is editable, False otherwise

tests/testdata/Splunk_TA_UCCExample/globalConfig.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
"pattern": "^[a-zA-Z]\\w*$"
3939
}
4040
],
41-
"options": {
42-
"placeholder": "Required"
43-
},
4441
"field": "name",
4542
"help": "Enter a unique name for this account.",
4643
"required": true
@@ -349,10 +346,7 @@
349346
"minLength": 5
350347
}
351348
],
352-
"required": true,
353-
"options": {
354-
"placeholder": "Required"
355-
}
349+
"required": true
356350
},
357351
{
358352
"field": "test_number",
@@ -367,10 +361,7 @@
367361
]
368362
}
369363
],
370-
"required": true,
371-
"options": {
372-
"placeholder": "Required"
373-
}
364+
"required": true
374365
},
375366
{
376367
"field": "test_regex",

0 commit comments

Comments
 (0)