Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-test-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ concurrency:
cancel-in-progress: true

env:
PYTHON_VERSION: "3.7"
POETRY_VERSION: "1.5.1"
PYTHON_VERSION: "3.9"
POETRY_VERSION: "2.1.4"

jobs:
meta:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ submodules:

# Set the version of Python and requirements required to build your docs
python:
version: 3.7
version: 3.9
install:
- requirements: docs/requirements.txt
- method: pip
Expand Down
2 changes: 1 addition & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The general file structure of pytest_splunk_addon_ui_smartx is as follows:
Support
-------

* **Python**: 3.7
* **Python**: 3.9
* **Platforms**: Linux, Windows, and MacOS

Features
Expand Down
1,640 changes: 803 additions & 837 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ classifiers = [
"Intended Audience :: Developers",
"Topic :: Software Development :: Testing",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.9",
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
]
packages = [
{include = "pytest_splunk_addon_ui_smartx/**/*.py"},
]
version = "2.5.3"
version = "2.5.4-beta.1"

[tool.poetry.dependencies]
python = "^3.7"
python = ">=3.9,<3.14"
pytest-html = "*"
urllib3 = "^1.21.1"
urllib3 = "2.5.0"
selenium = "*"
webdriver-manager = "*"
msedge-selenium-tools = "*"
cssselect = "*"
lxml = "^4.8.0"
pytest-splunk-addon = "^5.0.0"
pytest-splunk-addon = "7.0.0b1"

[tool.poetry.plugins]
pytest11 = { "ucc-smartx" = "pytest_splunk_addon_ui_smartx.plugin" }
Expand All @@ -51,7 +51,7 @@ pytest = ">=5.4, <7.3"
Sphinx = "*"
sphinx_rtd_theme = "*"
sphinx-panels = "*"
splunk-add-on-ucc-framework = "5.28.5"
splunk-add-on-ucc-framework = "5.66.0"
pytest-rerunfailures = "^12.0"

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion pytest_splunk_addon_ui_smartx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
from . import components, pages
from .components import controls

__version__ = "2.5.3"
__version__ = "2.5.4-beta.1"
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,22 @@ def _wait_for_search_list(driver):
_wait_for_search_list, msg="No values found in SingleSelect search"
)

def is_editable(self) -> bool:
def allow_new_values(self) -> bool:
"""
Returns True if the SingleSelect is editable, False otherwise
Returns True if the SingleSelect accepts new values, False otherwise
"""
self.get_element("root")
return True if self.allow_new_values else False

def is_editable(self) -> bool:
"""
Returns True if the SingleSelect is editable, False otherwise
"""
if (
self.root.get_attribute("readonly")
or self.root.get_attribute("readOnly")
or self.root.get_attribute("disabled")
):
return False
else:
return True
3 changes: 3 additions & 0 deletions pytest_splunk_addon_ui_smartx/components/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,6 @@ def get_input_type_list(self):
}
)
return [each.text.strip() for each in self.get_elements("type_filter_list")]

def wait_to_be_stale(self, msg=None):
return super().wait_to_be_stale(key=self.get_element("root"), msg=msg)
8 changes: 6 additions & 2 deletions tests/testdata/Splunk_TA_UCCExample/globalConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@
"type": "singleSelect",
"label": "Example Account",
"options": {
"referenceName": "account"
"referenceName": "account",
"disableonEdit": true
},
"help": "",
"field": "account",
Expand Down Expand Up @@ -965,7 +966,10 @@
{
"groupName": "group_one",
"groupTitle": "Group One",
"groupServices": ["example_input_three", "example_input_four"]
"groupServices": [
"example_input_three",
"example_input_four"
]
}
],
"description": "Manage your data inputs",
Expand Down
24 changes: 12 additions & 12 deletions tests/testdata/Splunk_TA_UCCExample/package/lib/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
certifi==2022.12.7 ; python_version >= "3.7" and python_version < "4"
charset-normalizer==3.0.1 ; python_version >= "3.7" and python_version < "4"
defusedxml==0.7.1 ; python_version >= "3.7" and python_version < "4.0"
idna==3.4 ; python_version >= "3.7" and python_version < "4"
pysocks==1.7.1 ; python_version >= "3.7" and python_version < "4.0"
requests==2.28.2 ; python_version >= "3.7" and python_version < "4"
solnlib==4.9.1 ; python_version >= "3.7" and python_version < "4.0"
sortedcontainers==2.4.0 ; python_version >= "3.7" and python_version < "4.0"
splunk-sdk==1.7.3 ; python_version >= "3.7" and python_version < "4.0"
splunktalib==3.0.3 ; python_version >= "3.7" and python_version < "4.0"
splunktaucclib==6.0.7 ; python_version >= "3.7" and python_version < "4.0"
urllib3==1.26.14 ; python_version >= "3.7" and python_version < "4"
certifi==2022.12.7 ; python_version >= "3.9" and python_version < "4"
charset-normalizer==3.0.1 ; python_version >= "3.9" and python_version < "4"
defusedxml==0.7.1 ; python_version >= "3.9" and python_version < "4.0"
idna==3.4 ; python_version >= "3.9" and python_version < "4"
pysocks==1.7.1 ; python_version >= "3.9" and python_version < "4.0"
requests==2.28.2 ; python_version >= "3.9" and python_version < "4"
solnlib==4.9.1 ; python_version >= "3.9" and python_version < "4.0"
sortedcontainers==2.4.0 ; python_version >= "3.9" and python_version < "4.0"
splunk-sdk==1.7.3 ; python_version >= "3.9" and python_version < "4.0"
splunktalib==3.0.3 ; python_version >= "3.9" and python_version < "4.0"
splunktaucclib @ ssh://[email protected]/splunk/addonfactory-ucc-test.git ; python_version >= "3.9" and python_version < "4.0"
urllib3==2.5.0 ; python_version >= "3.9" and python_version < "4"
26 changes: 19 additions & 7 deletions tests/ui/test_splunk_ta_example_addon_input_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,14 +880,12 @@ def test_example_input_one_edit_frontend_validation(
"""Verifies the frontend edit functionality of the example input one entity"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.table.edit_row("dummy_input_one")
input_page.entity1.example_account.wait_for_values()
input_page.entity1.example_checkbox.uncheck()
input_page.entity1.example_radio.select("No")
input_page.entity1.single_select_group_test.select("four")
input_page.entity1.multiple_select_test.deselect("b")
input_page.entity1.interval.set_value("3600")
input_page.entity1.index.select("main")
input_page.entity1.example_account.select("test_input")
input_page.entity1.object.set_value("edit_object")
input_page.entity1.object_fields.set_value("edit_field")
input_page.entity1.order_by.set_value("LastDate")
Expand Down Expand Up @@ -918,14 +916,12 @@ def test_example_input_one_edit_backend_validation(
"""Verifies the backend edit functionality of the example input one entity"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.table.edit_row("dummy_input_one")
input_page.entity1.example_account.wait_for_values()
input_page.entity1.example_checkbox.uncheck()
input_page.entity1.example_radio.select("No")
input_page.entity1.single_select_group_test.select("Four")
input_page.entity1.multiple_select_test.deselect("b")
input_page.entity1.interval.set_value("3600")
input_page.entity1.index.select("main")
input_page.entity1.example_account.select("test_input")
input_page.entity1.object.set_value("edit_object")
input_page.entity1.object_fields.set_value("edit_field")
input_page.entity1.order_by.set_value("LastDate")
Expand Down Expand Up @@ -1355,14 +1351,30 @@ def test_inputs_textarea_scroll(
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_single_select_is_editable(
def test_single_select_allows_new_values(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""
Verifies that SingleSelect value is editable or not
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.create_new_input.select("Example Input One")
self.assert_util(input_page.entity1.single_select_group_test.is_editable, True)
self.assert_util(input_page.entity1.index.is_editable, True)
self.assert_util(
input_page.entity1.single_select_group_test.allow_new_values, True
)
self.assert_util(input_page.entity1.index.allow_new_values, True)
self.assert_util(input_page.entity1.example_account.allow_new_values, False)

@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_single_select_is_editable(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one
):
"""
Verifies that SingleSelect value is editable or not
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.table.edit_row("dummy_input_one")
self.assert_util(input_page.entity1.example_account.is_editable, False)
self.assert_util(input_page.entity1.index.is_editable, True)
1 change: 1 addition & 0 deletions tests/ui/test_splunk_ta_example_addon_input_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ def test_inputs_create_new_input_list_nested_values(
"Example Input Four",
]
input_page.create_new_input.select("Group One")
input_page.create_new_input.wait_to_be_stale()
self.assert_util(input_page.create_new_input.get_inputs_list, value_to_test)

@pytest.mark.execute_enterprise_cloud_true
Expand Down