diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..ea5d7f3d --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,29 @@ +name: docs +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + docs: + runs-on: ubuntu-latest + permissions: + contents: write + pages: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.8 + - run: | + curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1 + pip install mkdocs mkdocs-material mkdocstrings-python + - name: Deploy to GitHub Pages + if: github.ref_name == 'main' + run: mkdocs gh-deploy --force --strict + - name: Build Docs + if: github.ref_name != 'main' + run: mkdocs build --strict diff --git a/.gitignore b/.gitignore index 42108a20..75034e60 100644 --- a/.gitignore +++ b/.gitignore @@ -101,9 +101,9 @@ celerybeat.pid # Environments .env -.venv +# ignore all venv with different Py versions +.venv* env/ -venv/ ENV/ env.bak/ venv.bak/ diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index 356844d5..00000000 --- a/.readthedocs.yml +++ /dev/null @@ -1,17 +0,0 @@ -# .readthedocs.yml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -submodules: - exclude: all - -# Set the version of Python and requirements required to build your docs -python: - version: 3.7 - install: - - requirements: docs/requirements.txt - - method: pip - path: . \ No newline at end of file diff --git a/README.md b/README.md index d7bdb2f0..cd545445 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,12 @@ -# SmartX +# addon-factory-smartx-ui-test-library -UCC based Add-on UI automation framework +![PyPI](https://img.shields.io/pypi/v/pytest-splunk-addon-ui-smartx) +![Python](https://img.shields.io/pypi/pyversions/pytest-splunk-addon-ui-smartx.svg) -Confluence Page link: https://confluence.splunk.com/display/PROD/SmartX+UI+Automation+Framework+for+Ucc+based+Add-ons +## What is SmartX UI Test Framework -ReadTheDocs Page link: https://addon-factory-smartx-ui-test-library.readthedocs.io +This framework is wrapper on selenium to write UI test cases for Splunk Add-ons. -## Table of contents +## Usage -- [Goal](#goal) -- [Design](#design) -- [Features](#features) -- [Build test cases using the framework](#build-test-cases-using-the-framework) -- [Steps to test in Local environment](#steps-to-test-in-local-environment) -- [Steps to test with Saucelabs](#steps-to-test-with-saucelabs) - -### Goal - -To test all the UI configuration page of the Splunk add-ons. All the add-ons are built with the same template. The configuration pages consist of an Input page and a configuration page that has different tabs to configure logging, proxy settings and add product account in the add-ons. To support the testing of all the add-ons, a generic framework should be made, which can be used in the test cases for all the add-ons. The framework should have methods that can interact with UI components and test the working of UI. - -### Design - -For UI development, we follow a practice in which we create a set of components first. The component has its own state-cycle. The component will be reusable so that it can be placed on any page. A web-page will be a composition of these components placed in the proper container. - -The testing framework will follow the same practice. It will have classes for all the components used in all the pages. These “Component” class will consist of methods to interact with the component, to get & set values in the component. These components will be put on different pages. The structure is created so that it can easily be maintained and understandable. As per design, the class “Page” should only be used to contain a set of components. No interaction methods should be in the Page class. - - The structure of the framework can be divided into 3 parts. - - Components : A UI component with which a user interacts with. - Pages : Holds multiple components of a specific page - Test cases : Tests the interaction & values in the components - -### Features - -- pytest fixture to control when the browser should be initialized & tear-downed. -- Flag to easily convert the environment from SauceLabs to local for debugging purposes. -- Screenshot when any test case fails. -- An Html report containing the trace-back and the screenshots of the failed test cases. -- Being able to read environment variables to dynamically change the URL and the credentials of a test page. -- Backend configuration that can be fetched from the management API of the Splunk instance. -- Reruns, the test cases will be rerunning to avoid some rare timeout/network issues - - -### Build test cases using the framework - -1. Create the appropriate folders and pytest files within the TA's test/ui directory -2. Create Add-on specific Page classes (we only need to specify which components it contains, demo: server_page) -3. Implement the test-cases by using the page classes & its components -4. Jenkins integrations - -Demo link : https://git.splunk.com/projects/SOLN/repos/ta-microsoft-scom/browse/test/ui - -### Steps to test in Local environment - -1. Install SmartX by using 'pip install pytest-splunk-addon-ui-smartx' or cloning this repository and running 'poetry install' -2. Download Browser's specific driver - For Chrome: download chromedriver - For Firefox: download geckodriver - For IE: download IEdriverserver -3. Put the downloaded driver into test/ui/ directory, make sure that it is within the environment's PATH variable, and that it is executable -4. For Internet explorer, The steps mentioned at below link must be performed: -https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration -5. Execute the test cases: - ```script - pytest -vv --browser={browser} --local --splunk-host={web_url} --splunk-port={mgmt_url} --splunk-user {username} --splunk-password {password} - ``` -### Steps to test with Saucelabs - -1. Install SmartX by using 'pip install pytest-splunk-addon-ui-smartx' or cloning this repository and running 'poetry install' -2. Configure saucelabs credentials as environment variables - SAUCE_USERNAME : - SAUCE_PASSWORD : -3. Execute the test case -```script -pytest -vv --browser={browser} --splunk-host={web_url} --splunk-port={mgmt_url} --setup-retry-count={retry-count} --splunk-user {username} --splunk-password {password} -``` +For full usage instructions, please visit the [documentation](https://splunk.github.io/addon-factory-smartx-ui-test-library). diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/api_reference.rst b/docs/api_reference.rst deleted file mode 100644 index 0c527342..00000000 --- a/docs/api_reference.rst +++ /dev/null @@ -1,15 +0,0 @@ -API Reference -===================== - -The following is the API Reference for SmartX - -.. toctree:: - :maxdepth: 2 - - backend_confs - base_test - plugin - utils - pages/index - components/index - components/controls/index \ No newline at end of file diff --git a/docs/api_reference/backend_confs.md b/docs/api_reference/backend_confs.md new file mode 100644 index 00000000..90ae12e3 --- /dev/null +++ b/docs/api_reference/backend_confs.md @@ -0,0 +1,3 @@ +# backend_confs + +::: pytest_splunk_addon_ui_smartx.backend_confs diff --git a/docs/api_reference/base_test.md b/docs/api_reference/base_test.md new file mode 100644 index 00000000..f60df26e --- /dev/null +++ b/docs/api_reference/base_test.md @@ -0,0 +1,3 @@ +# base_test + +::: pytest_splunk_addon_ui_smartx.base_test diff --git a/docs/api_reference/components/base_component.md b/docs/api_reference/components/base_component.md new file mode 100644 index 00000000..d56a2eb2 --- /dev/null +++ b/docs/api_reference/components/base_component.md @@ -0,0 +1,3 @@ +# base_component + +::: pytest_splunk_addon_ui_smartx.components.base_component diff --git a/docs/api_reference/components/conf_table.md b/docs/api_reference/components/conf_table.md new file mode 100644 index 00000000..a87af643 --- /dev/null +++ b/docs/api_reference/components/conf_table.md @@ -0,0 +1,3 @@ +# conf_table + +::: pytest_splunk_addon_ui_smartx.components.conf_table diff --git a/docs/api_reference/components/controls/base_control.md b/docs/api_reference/components/controls/base_control.md new file mode 100644 index 00000000..bbb8d9ae --- /dev/null +++ b/docs/api_reference/components/controls/base_control.md @@ -0,0 +1,3 @@ +# base_control + +::: pytest_splunk_addon_ui_smartx.components.controls.base_control diff --git a/docs/api_reference/components/controls/button.md b/docs/api_reference/components/controls/button.md new file mode 100644 index 00000000..b378fd9d --- /dev/null +++ b/docs/api_reference/components/controls/button.md @@ -0,0 +1,3 @@ +# button + +::: pytest_splunk_addon_ui_smartx.components.controls.button diff --git a/docs/api_reference/components/controls/checkbox.md b/docs/api_reference/components/controls/checkbox.md new file mode 100644 index 00000000..d299025a --- /dev/null +++ b/docs/api_reference/components/controls/checkbox.md @@ -0,0 +1,3 @@ +# checkbox + +::: pytest_splunk_addon_ui_smartx.components.controls.checkbox diff --git a/docs/api_reference/components/controls/index.md b/docs/api_reference/components/controls/index.md new file mode 100644 index 00000000..88d88627 --- /dev/null +++ b/docs/api_reference/components/controls/index.md @@ -0,0 +1,14 @@ +# controls + +The following is the API Reference for SmartX Controls: + ++ [base_control](base_control.md) ++ [button](button.md) ++ [checkbox](checkbox.md) ++ [learn_more](learn_more.md) ++ [message](message.md) ++ [multi_select](multi_select.md) ++ [oauth_select](oauth_select.md) ++ [single_select](single_select.md) ++ [textbox](textbox.md) ++ [toggle](toggle.md) diff --git a/docs/api_reference/components/controls/learn_more.md b/docs/api_reference/components/controls/learn_more.md new file mode 100644 index 00000000..7ec4816e --- /dev/null +++ b/docs/api_reference/components/controls/learn_more.md @@ -0,0 +1,3 @@ +# learn_more + +::: pytest_splunk_addon_ui_smartx.components.controls.learn_more diff --git a/docs/api_reference/components/controls/message.md b/docs/api_reference/components/controls/message.md new file mode 100644 index 00000000..2fbdfb8b --- /dev/null +++ b/docs/api_reference/components/controls/message.md @@ -0,0 +1,3 @@ +# message + +::: pytest_splunk_addon_ui_smartx.components.controls.message diff --git a/docs/api_reference/components/controls/multi_select.md b/docs/api_reference/components/controls/multi_select.md new file mode 100644 index 00000000..e9ca2066 --- /dev/null +++ b/docs/api_reference/components/controls/multi_select.md @@ -0,0 +1,3 @@ +# multi_select + +::: pytest_splunk_addon_ui_smartx.components.controls.multi_select diff --git a/docs/api_reference/components/controls/oauth_select.md b/docs/api_reference/components/controls/oauth_select.md new file mode 100644 index 00000000..f42e0f85 --- /dev/null +++ b/docs/api_reference/components/controls/oauth_select.md @@ -0,0 +1,3 @@ +# oauth_select + +::: pytest_splunk_addon_ui_smartx.components.controls.oauth_select diff --git a/docs/api_reference/components/controls/single_select.md b/docs/api_reference/components/controls/single_select.md new file mode 100644 index 00000000..35acdd46 --- /dev/null +++ b/docs/api_reference/components/controls/single_select.md @@ -0,0 +1,3 @@ +# single_select + +::: pytest_splunk_addon_ui_smartx.components.controls.single_select diff --git a/docs/api_reference/components/controls/textbox.md b/docs/api_reference/components/controls/textbox.md new file mode 100644 index 00000000..62a28a3d --- /dev/null +++ b/docs/api_reference/components/controls/textbox.md @@ -0,0 +1,3 @@ +# textbox + +::: pytest_splunk_addon_ui_smartx.components.controls.textbox diff --git a/docs/api_reference/components/controls/toggle.md b/docs/api_reference/components/controls/toggle.md new file mode 100644 index 00000000..25af8902 --- /dev/null +++ b/docs/api_reference/components/controls/toggle.md @@ -0,0 +1,3 @@ +# toggle + +::: pytest_splunk_addon_ui_smartx.components.controls.toggle diff --git a/docs/api_reference/components/dropdown.md b/docs/api_reference/components/dropdown.md new file mode 100644 index 00000000..99a118a5 --- /dev/null +++ b/docs/api_reference/components/dropdown.md @@ -0,0 +1,3 @@ +# dropdown + +::: pytest_splunk_addon_ui_smartx.components.dropdown diff --git a/docs/api_reference/components/entity.md b/docs/api_reference/components/entity.md new file mode 100644 index 00000000..02e75220 --- /dev/null +++ b/docs/api_reference/components/entity.md @@ -0,0 +1,3 @@ +# entity + +::: pytest_splunk_addon_ui_smartx.components.entity diff --git a/docs/api_reference/components/index.md b/docs/api_reference/components/index.md new file mode 100644 index 00000000..aa82fe32 --- /dev/null +++ b/docs/api_reference/components/index.md @@ -0,0 +1,12 @@ +# components + +The following is the API Reference for SmartX Components: + ++ [base_component](base_component.md) ++ [conf_table](conf_table.md) ++ [dropdown](dropdown.md) ++ [entity](entity.md) ++ [input_table](input_table.md) ++ [login](login.md) ++ [table](table.md) ++ [tabs](tabs.md) diff --git a/docs/api_reference/components/input_table.md b/docs/api_reference/components/input_table.md new file mode 100644 index 00000000..73ebbc98 --- /dev/null +++ b/docs/api_reference/components/input_table.md @@ -0,0 +1,3 @@ +# input_table + +::: pytest_splunk_addon_ui_smartx.components.input_table diff --git a/docs/api_reference/components/login.md b/docs/api_reference/components/login.md new file mode 100644 index 00000000..e766de96 --- /dev/null +++ b/docs/api_reference/components/login.md @@ -0,0 +1,3 @@ +# login + +::: pytest_splunk_addon_ui_smartx.components.login diff --git a/docs/api_reference/components/table.md b/docs/api_reference/components/table.md new file mode 100644 index 00000000..85911dab --- /dev/null +++ b/docs/api_reference/components/table.md @@ -0,0 +1,3 @@ +# table + +::: pytest_splunk_addon_ui_smartx.components.table diff --git a/docs/api_reference/components/tabs.md b/docs/api_reference/components/tabs.md new file mode 100644 index 00000000..07efac49 --- /dev/null +++ b/docs/api_reference/components/tabs.md @@ -0,0 +1,3 @@ +# tabs + +::: pytest_splunk_addon_ui_smartx.components.tabs diff --git a/docs/api_reference/index.md b/docs/api_reference/index.md new file mode 100644 index 00000000..57a04ac8 --- /dev/null +++ b/docs/api_reference/index.md @@ -0,0 +1,31 @@ +The following is the API Reference for SmartX: + +- [backend_conf](backend_confs.md) +- [base_test](base_test.md) +- [plugin](plugin.md) +- [utils](utils.md) +- [pages](pages/index.md) + + [logging](pages/logging.md) + + [login](pages/login.md) + + [page](pages/page.md) + + [proxy](pages/proxy.md) +- [components](components/index.md) + + [base_component](components/base_component.md) + + [conf_table](components/conf_table.md) + + [dropdown](components/dropdown.md) + + [entity](components/entity.md) + + [input_table](components/input_table.md) + + [login](components/login.md) + + [table](components/table.md) + + [tabs](components/tabs.md) +- [controls](components/controls/index.md) + + [base_control](components/controls/base_control.md) + + [button](components/controls/button.md) + + [checkbox](components/controls/checkbox.md) + + [learn_more](components/controls/learn_more.md) + + [message](components/controls/message.md) + + [multi_select](components/controls/multi_select.md) + + [oauth_select](components/controls/oauth_select.md) + + [single_select](components/controls/single_select.md) + + [textbox](components/controls/textbox.md) + + [toggle](components/controls/toggle.md) diff --git a/docs/api_reference/pages/index.md b/docs/api_reference/pages/index.md new file mode 100644 index 00000000..c4dce19a --- /dev/null +++ b/docs/api_reference/pages/index.md @@ -0,0 +1,8 @@ +# pages + +The following is the API Reference for SmartX Pages: + ++ [logging](logging.md) ++ [login](login.md) ++ [page](page.md) ++ [proxy](proxy.md) diff --git a/docs/api_reference/pages/logging.md b/docs/api_reference/pages/logging.md new file mode 100644 index 00000000..55706a59 --- /dev/null +++ b/docs/api_reference/pages/logging.md @@ -0,0 +1,3 @@ +# logging + +::: pytest_splunk_addon_ui_smartx.pages.logging diff --git a/docs/api_reference/pages/login.md b/docs/api_reference/pages/login.md new file mode 100644 index 00000000..dfaf9146 --- /dev/null +++ b/docs/api_reference/pages/login.md @@ -0,0 +1,3 @@ +# login + +::: pytest_splunk_addon_ui_smartx.pages.login diff --git a/docs/api_reference/pages/page.md b/docs/api_reference/pages/page.md new file mode 100644 index 00000000..ffdb05c0 --- /dev/null +++ b/docs/api_reference/pages/page.md @@ -0,0 +1,3 @@ +# page + +::: pytest_splunk_addon_ui_smartx.pages.page diff --git a/docs/api_reference/pages/proxy.md b/docs/api_reference/pages/proxy.md new file mode 100644 index 00000000..fad45dad --- /dev/null +++ b/docs/api_reference/pages/proxy.md @@ -0,0 +1,3 @@ +# proxy + +::: pytest_splunk_addon_ui_smartx.pages.proxy diff --git a/docs/api_reference/plugin.md b/docs/api_reference/plugin.md new file mode 100644 index 00000000..03832b41 --- /dev/null +++ b/docs/api_reference/plugin.md @@ -0,0 +1,3 @@ +# plugin + +::: pytest_splunk_addon_ui_smartx.plugin diff --git a/docs/api_reference/utils.md b/docs/api_reference/utils.md new file mode 100644 index 00000000..74d4fd56 --- /dev/null +++ b/docs/api_reference/utils.md @@ -0,0 +1,3 @@ +# utils + +::: pytest_splunk_addon_ui_smartx.utils diff --git a/docs/backend_confs.rst b/docs/backend_confs.rst deleted file mode 100644 index 59a8cfcf..00000000 --- a/docs/backend_confs.rst +++ /dev/null @@ -1,6 +0,0 @@ -backend_confs -=============== - -.. automodule:: pytest_splunk_addon_ui_smartx.backend_confs - :members: - :show-inheritance: diff --git a/docs/base_test.rst b/docs/base_test.rst deleted file mode 100644 index b045178c..00000000 --- a/docs/base_test.rst +++ /dev/null @@ -1,6 +0,0 @@ -base_test -========== - -.. automodule:: pytest_splunk_addon_ui_smartx.base_test - :members: - :show-inheritance: diff --git a/docs/components/base_component.rst b/docs/components/base_component.rst deleted file mode 100644 index c0a2b4c7..00000000 --- a/docs/components/base_component.rst +++ /dev/null @@ -1,6 +0,0 @@ -Base Component -============== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.base_component - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/components/conf_table.rst b/docs/components/conf_table.rst deleted file mode 100644 index 137d4c10..00000000 --- a/docs/components/conf_table.rst +++ /dev/null @@ -1,6 +0,0 @@ -Conf Table -========== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.conf_table - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/components/controls/base_control.rst b/docs/components/controls/base_control.rst deleted file mode 100644 index 38b610d1..00000000 --- a/docs/components/controls/base_control.rst +++ /dev/null @@ -1,6 +0,0 @@ -Base Control -============ - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.base_control - :members: - :show-inheritance: diff --git a/docs/components/controls/button.rst b/docs/components/controls/button.rst deleted file mode 100644 index 2cce3752..00000000 --- a/docs/components/controls/button.rst +++ /dev/null @@ -1,6 +0,0 @@ -Button -======= - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.button - :members: - :show-inheritance: diff --git a/docs/components/controls/checkbox.rst b/docs/components/controls/checkbox.rst deleted file mode 100644 index de449cdf..00000000 --- a/docs/components/controls/checkbox.rst +++ /dev/null @@ -1,6 +0,0 @@ -Checkbox -========= - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.checkbox - :members: - :show-inheritance: diff --git a/docs/components/controls/index.rst b/docs/components/controls/index.rst deleted file mode 100644 index bbedc829..00000000 --- a/docs/components/controls/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -Controls -======================== - -The following is the API Reference for SmartX Controls - -.. toctree:: - :maxdepth: 1 - - base_control - button - checkbox - learn_more - message - multi_select - oauth_select - single_select - textbox - toggle - \ No newline at end of file diff --git a/docs/components/controls/learn_more.rst b/docs/components/controls/learn_more.rst deleted file mode 100644 index de1bd53f..00000000 --- a/docs/components/controls/learn_more.rst +++ /dev/null @@ -1,6 +0,0 @@ -Learn More -========== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.learn_more - :members: - :show-inheritance: diff --git a/docs/components/controls/message.rst b/docs/components/controls/message.rst deleted file mode 100644 index 69ffc623..00000000 --- a/docs/components/controls/message.rst +++ /dev/null @@ -1,6 +0,0 @@ -Message -======== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.message - :members: - :show-inheritance: diff --git a/docs/components/controls/multi_select.rst b/docs/components/controls/multi_select.rst deleted file mode 100644 index 559eceda..00000000 --- a/docs/components/controls/multi_select.rst +++ /dev/null @@ -1,6 +0,0 @@ -Multi Select -============= - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.multi_select - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/components/controls/oauth_select.rst b/docs/components/controls/oauth_select.rst deleted file mode 100644 index e892c03e..00000000 --- a/docs/components/controls/oauth_select.rst +++ /dev/null @@ -1,6 +0,0 @@ -Oauth Select -============ - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.oauth_select - :members: - :show-inheritance: diff --git a/docs/components/controls/single_select.rst b/docs/components/controls/single_select.rst deleted file mode 100644 index 616614fe..00000000 --- a/docs/components/controls/single_select.rst +++ /dev/null @@ -1,6 +0,0 @@ -Single Select -============== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.single_select - :members: - :show-inheritance: diff --git a/docs/components/controls/textbox.rst b/docs/components/controls/textbox.rst deleted file mode 100644 index f24e7c3c..00000000 --- a/docs/components/controls/textbox.rst +++ /dev/null @@ -1,6 +0,0 @@ -Textbox -======== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.textbox - :members: - :show-inheritance: diff --git a/docs/components/controls/toggle.rst b/docs/components/controls/toggle.rst deleted file mode 100644 index 1a825400..00000000 --- a/docs/components/controls/toggle.rst +++ /dev/null @@ -1,6 +0,0 @@ -Toggle -======= - -.. automodule:: pytest_splunk_addon_ui_smartx.components.controls.toggle - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/components/dropdown.rst b/docs/components/dropdown.rst deleted file mode 100644 index ea376503..00000000 --- a/docs/components/dropdown.rst +++ /dev/null @@ -1,6 +0,0 @@ -Dropdown -======== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.dropdown - :members: - :show-inheritance: diff --git a/docs/components/entity.rst b/docs/components/entity.rst deleted file mode 100644 index 48026e9b..00000000 --- a/docs/components/entity.rst +++ /dev/null @@ -1,6 +0,0 @@ -Entity -====== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.entity - :members: - :show-inheritance: diff --git a/docs/components/index.rst b/docs/components/index.rst deleted file mode 100644 index 861b92ce..00000000 --- a/docs/components/index.rst +++ /dev/null @@ -1,17 +0,0 @@ -Components -========================= - -The following is the API Reference for SmartX Components - -.. toctree:: - :maxdepth: 1 - - base_component - conf_table - dropdown - entity - input_table - login - table - tabs - \ No newline at end of file diff --git a/docs/components/input_table.rst b/docs/components/input_table.rst deleted file mode 100644 index eeb1b155..00000000 --- a/docs/components/input_table.rst +++ /dev/null @@ -1,6 +0,0 @@ -Input table -=========== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.input_table - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/components/login.rst b/docs/components/login.rst deleted file mode 100644 index a02d1587..00000000 --- a/docs/components/login.rst +++ /dev/null @@ -1,6 +0,0 @@ -Login -====== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.login - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/components/table.rst b/docs/components/table.rst deleted file mode 100644 index 19f037e5..00000000 --- a/docs/components/table.rst +++ /dev/null @@ -1,6 +0,0 @@ -Table -====== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.table - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/components/tabs.rst b/docs/components/tabs.rst deleted file mode 100644 index 4268a495..00000000 --- a/docs/components/tabs.rst +++ /dev/null @@ -1,6 +0,0 @@ -Tabs -====== - -.. automodule:: pytest_splunk_addon_ui_smartx.components.tabs - :members: - :show-inheritance: \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index e8f6f516..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,154 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -import sys - -import sphinx_rtd_theme - -sys.path.insert(0, os.path.abspath("..")) - - -# -- Project information ----------------------------------------------------- - -project = "pytest_splunk_addon_ui_smartx" -copyright = "2020, Splunk, Inc." -author = "Splunk, Inc." - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.todo", - "sphinx.ext.coverage", - "sphinx.ext.viewcode", - "sphinx.ext.napoleon", - "sphinx_panels", -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = [] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = ".rst" - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] - -# The master toctree document. -master_doc = "index" - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "sphinx_rtd_theme" - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] - -# -- Options for todo extension ---------------------------------------------- - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = "pytest_splunk_addon_ui_smartx_doc" - - -# -- Options for LaTeX output ------------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "pytest_splunk_addon_ui_smartx_doc.tex", - "pytest_splunk_addon_ui_smartx_doc Documentation", - "Splunk, Inc.", - "manual", - ), -] - - -# -- Options for manual page output ------------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "pytest_splunk_addon_ui_smartx_doc", - "pytest_splunk_addon_ui_smartx_doc Documentation", - [author], - 1, - ) -] - - -# -- Options for Texinfo output ---------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "pytest_splunk_addon_ui_smartx_doc", - "pytest_splunk_addon_ui_smartx_doc Documentation", - author, - "pytest_splunk_addon_ui_smartx_doc", - "One line description of project.", - "Miscellaneous", - ), -] diff --git a/docs/example_pytest.ini b/docs/example_pytest.ini deleted file mode 100644 index c9834c2d..00000000 --- a/docs/example_pytest.ini +++ /dev/null @@ -1,22 +0,0 @@ -[pytest] -norecursedirs = .git .venv venv build deps tests/deps node_modules package -addopts = -v -s --tb=long - --splunk-type=external - --junitxml=/home/circleci/work/test-results/test.xml - --html=report.html - --splunk-web-scheme=https - --splunk-host=splunk - --splunkweb-port=8000 - --splunk-port=8089 - --splunk-password=Chang3d! -filterwarnings = - ignore::DeprecationWarning -markers = - logging: Logging Page UI test cases - account: Account page UI test cases - proxy: proxy page UI test cases - input: Input page UI test cases - forwarder: Tests to be run on Forwarder/Standalone - liveenvironment: Tests need live server to successfully execute - oauth_account: Oauth Account UI test cases - sanity_test: For sanity check of addons \ No newline at end of file diff --git a/docs/getting_started.rst b/docs/getting_started.rst deleted file mode 100644 index 60c1dc62..00000000 --- a/docs/getting_started.rst +++ /dev/null @@ -1,148 +0,0 @@ -Getting Started -================ -If you want to create new set of UI tests for a Splunk App using SmartX, you can follow the following steps here: - -Setup -====== -To set up the environment, you should do the following: - -**1. Create a Virtual environment and Install the SmartX framework** - -Generally, you would want to install the SmartX framework as part of a Virtual Environment so that you can keep your environment clean and organized: - -.. code-block:: console - - 1. python3 -m venv .venv - 2. source .venv/bin/activate - -There are two ways to install SmartX: - -1) The Framework could be cloned from GitHub: `SmartX Repo `__ - -.. code-block:: console - - 1. git clone https://github.com/splunk/addon-factory-smartx-ui-test-library.git - 4. cd addon-factory-smartx-ui-test-library - 5. poetry install - -2) Download SmartX from PyPi: `SmartX PyPI `__ - -.. code-block:: console - - pip install pytest-splunk-addon-ui-smartx - -**2. Setup the tests directory for SmartX within the App** - -The tests should be structured in the following format, if the folders do not exist you should create them so that the common template for CICD tests works correctly: - * test/ui: The parent ui-test directory in which we should put all of our SmartX test cases. - * test/ui/_UccLib: This is where we should put the specific TA's unique page files that we want to test with here. By default page, proxy, login, and logging are already implemented, if you want to create another page class file, you would add it here. - * test/ui/test_splunk__.py: The test cases for a specific TA page or Input. - * test/ui/pytest-ci.ini: This file is used with CICD (Jenkins/CircleCI) to set up the test environment and add pytest options for the tests. - -.. dropdown:: Example pytest-ci.ini - - .. literalinclude:: ./example_pytest.ini - :language: console - :lines: 1- - - -Test Page Creation -=================== -When creating new UI tests for a Splunk App using SmartX, it would be helpful to start with creating the TA's page class files within test/ui/_UccLib. - -These files should contain Page classes that represent the webpage we want to test within the app, and hold the multiple components that are within that webpage. The class hould also contain the webdriver instance and the backend methods to make API calls to Splunk. - -When creating a Page file, there are usually 2 portions of it to create: - -**1. The page class** -This would be the main class for the page file, which should hold all of the components and class instances for calling the backend. -This file would also need to import all of the components as well from SmartX to be able to use them. -The usual parameters for this class are the following: - - * ucc_smartx_selenium_helper (SmartX fixture): The SmartX instance for the selenium webdriver which helps control page interactions for the tests. This parameter is used to create the UI components, and we should not create the UI component classes without this parameter. - * ucc_smartx_rest_helper (SmartX fixture): The SmartX instance for the selenium helper which helps control page interactions. This parameter holds the selenium driver, urls(web, mgmt) and session key for the tests. This parameter is used for creating SmartX rest classes such as the classes found within backend_confs.py. - * open_page(Flag): This parameter is to indicate whether or not we should open this webpage when we create this class instance. If we want to open the file later, we can use .open() later on. - -This class should also hold functions to open the webpage and to store the backend endpoint. - -**2. The entities found within the page** -If the webpage consists of any entities (A web element on a page that consists of multiple components, such as popups or forms to create a new input). then you would need to create an entity that represents the entity's controls and components. -The usual parameters for this class are the following: - - * browser: The selenium webdriver - * container: The container in which the entity is located in - -The parent class for this type of class is found within the pytest_splunk_addon_ui_smartx/components/entity.py file. This base class has useful functions to click on a save button in the entity, closing the entity, and getting messages that may appear. -This base class has the following parameters: - - * browser: The selenium webdriver - * container: Container in which the entity is located. - * add_btn: The locator of add_button with which the entity will be opened - -**Example** -A Example Page file would look like this: - -.. dropdown:: Example Page File - - .. literalinclude:: ./example_code.py - :language: python3 - :lines: 1-169 - -Test Cases Creation -=================== - -**Creating tests** - -These files contain the test suites for the webpages that we want to test. A test generally consists of creating an instance of the webpage class we created above and calling on component functions to manipulate and assert the status of an element on the webpage. The test cases also calls the two SmartX fixtures that creates the Selenium Driver classes that we need for our tests. It is also recommended to add docstrings to each test so that it can be easily identifiable of what each test is trying to accomplish. -The test cases utilize a class function assert_util to conveniently test a plethora of different assertions in a unified way. It is recommended to use this function to keep the code simple and readable. This function has the following parameters: - - * left: The parameter you want to compare/assert with, generally this would be the status of the webelement. This parameter is required. - * right: The parameter you want to compare/assert with to the left parameter. Generally this would be the state that you want the webelement to be in. This parameter is required. - * operator: This will be the operator in which you want the left to be compared with the right. The options are as follows: ["==", "!=", "<", "<=", ">", ">=", "in", "not in", "is", "is not"]. This parameter's default: "==" - * left_args: If the left parameter is a function, then you can provide that function with the arguments found here. This parameter's default: {} - * right_args: If the right parameter is a function, then you can provide that function with the arguments found here. This parameter's default: {} - * msg: If you want a custom error message to appear if this assertion fails, then you can add that here, otherwise the default message is as follows: "Condition Failed. \nLeft-value: {}\nOperator: {}\nRight-value: {}".format(args['left_value'], args["operator"], args['right_value']) - -For the test cases, you may also want to include informative markers as well so that selectively testing the Addon's UI tests could be easy. Some of the common UI markers we used were: - - * : Test Page UI test cases (IE input) - * forwarder: Tests to be run on Forwarder/Standalone - * liveenvironment: Tests need live server to successfully execute - * oauth_account: Oauth Account UI test cases - * sanity_test: For sanity check of addons - -.. dropdown:: An example of a test case - - .. literalinclude:: ./example_code.py - :language: python3 - :lines: 171-180, 200-225 - -**Setup Fixtures** -The test suite could also contain setup fixtures that would be called before tests to setup the Splunk environment. This could range from creating new inputs, to using a different page class to create a related input/Account for the page being tested. It may also be useful to have global variables for the default configurations so that it could be easily edited and reused later. -An example of a setup fixture: - -.. dropdown:: Example setup Fixture - - .. literalinclude:: ./example_code.py - :language: python3 - :lines: 228-253 - -**Teardown Fixtures** -The test suites should also contain teardown fixtures to revert the Splunk instance back to its original state after each test, this way each test is independent of each other and so if one test fails, then another test shouldn't fail in correspondence as to the first test. -An example of the teardown fixture: - -.. dropdown:: Example teardown Fixture - - .. literalinclude:: ./example_code.py - :language: python3 - :lines: 182-197 - -**Environment Variables** -You may also want to get environment variables so that you can dynamically setup different test variables easily through the environment instead of having to hardcode them into the test. This may useful in hiding sensitive data such as login credentials. -An example for getting environment variables is as follows: - -.. dropdown:: Example Environment Variables Fixture - - .. literalinclude:: ./example_code.py - :language: python3 - :lines: 256- \ No newline at end of file diff --git a/docs/getting_started/index.md b/docs/getting_started/index.md new file mode 100644 index 00000000..17e77318 --- /dev/null +++ b/docs/getting_started/index.md @@ -0,0 +1,7 @@ +If you want to create new set of UI tests for a Splunk App using SmartX, you can follow the following steps here: + +[Setting up the environment for the test cases](setup.md) + +[Test Page Creation](test_page.md) + +[Writing the test cases using SmartX](test_case.md) \ No newline at end of file diff --git a/docs/getting_started/setup.md b/docs/getting_started/setup.md new file mode 100644 index 00000000..cc008543 --- /dev/null +++ b/docs/getting_started/setup.md @@ -0,0 +1,48 @@ +To set up the environment, you should do the following: + +**1. Create a Virtual environment and Install the SmartX framework** + +Generally, you would want to install the SmartX framework as part of a Virtual Environment so that you can keep your environment clean and organized: + +```console +1. python3 -m venv .venv +2. source .venv/bin/activate +``` + +```bash +pip install pytest-splunk-addon-ui-smartx +``` + +**2. Setup the tests directory for SmartX within the App** + +The tests should be structured in the following format, if the folders do not exist you should create them so that the common template for CICD tests works correctly: + + - `test/ui`: The parent ui-test directory in which we should put all of our SmartX test cases. + - `test/ui/_UccLib`: This is where we should put the specific TA's unique page files that we want to test with here. By default page, proxy, login, and logging are already implemented, if you want to create another page class file, you would add it here. + - `test/ui/test_splunk__.py`: The test cases for a specific TA page or Input. + - `test/ui/pytest-ci.ini`: This file is used with CI/CD pipelines to set up the test environment and add pytest options for the tests. + +```conf +[pytest] +norecursedirs = .git .venv venv build deps tests/deps node_modules package +addopts = -v -s --tb=long + --splunk-type=external + --junitxml=/home/circleci/work/test-results/test.xml + --html=report.html + --splunk-web-scheme=https + --splunk-host=splunk + --splunkweb-port=8000 + --splunk-port=8089 + --splunk-password=Chang3d! +filterwarnings = + ignore::DeprecationWarning +markers = + logging: Logging Page UI test cases + account: Account page UI test cases + proxy: proxy page UI test cases + input: Input page UI test cases + forwarder: Tests to be run on Forwarder/Standalone + liveenvironment: Tests need live server to successfully execute + oauth_account: Oauth Account UI test cases + sanity_test: For sanity check of addons +``` diff --git a/docs/getting_started/test_case.md b/docs/getting_started/test_case.md new file mode 100644 index 00000000..ffc72b59 --- /dev/null +++ b/docs/getting_started/test_case.md @@ -0,0 +1,144 @@ +**Creating tests** + +These files contain the test suites for the webpages that we want to test. A test generally consists of creating an instance of the webpage class we created above and calling on component functions to manipulate and assert the status of an element on the webpage. The test cases also calls the two SmartX fixtures that creates the Selenium Driver classes that we need for our tests. It is also recommended to add docstrings to each test so that it can be easily identifiable of what each test is trying to accomplish. +The test cases utilize a class function assert_util to conveniently test a plethora of different assertions in a unified way. It is recommended to use this function to keep the code simple and readable. This function has the following parameters: + + - left: The parameter you want to compare/assert with, generally this would be the status of the webelement. This parameter is required. + - right: The parameter you want to compare/assert with to the left parameter. Generally this would be the state that you want the webelement to be in. This parameter is required. + - operator: This will be the operator in which you want the left to be compared with the right. The options are as follows: \["==", "!=", "\<", "\<=", ">", ">=", "in", "not in", "is", "is not"\]. This parameter's default: "==" + - left_args: If the left parameter is a function, then you can provide that function with the arguments found here. This parameter's default: {} + - right_args: If the right parameter is a function, then you can provide that function with the arguments found here. This parameter's default: {} + - msg: If you want a custom error message to appear if this assertion fails, then you can add that here, otherwise the default message is as follows: + ``` + Condition Failed. + Left-value: {} Operator: {} + Right-value: {}".format(args['left_value'], args['operator'], args['right_value']). + ``` + +For the test cases, you may also want to include informative markers as well so that selectively testing the Addon's UI tests could be easy. Some of the common UI markers we used were: + + - <test_suite>: Test Page UI test cases (i.e. input) + - forwarder: Tests to be run on Forwarder/Standalone + - liveenvironment: Tests need live server to successfully execute + - oauth_account: Oauth Account UI test cases + - sanity_test: For sanity check of addons + +```python +import pytest + +from pytest_splunk_addon_ui_smartx.base_test import UccTester +from pytest_splunk_addon_ui_smartx.pages.proxy import Proxy + +TA_NAME = "Splunk_TA_" +TA_PROXY_URL = ( + "/servicesNS/nobody/Splunk_TA_/Splunk_TA__settings/proxy" +) + +class TestProxy(UccTester): + """ + Test suite testing UCC from based configuration page + """ + + @pytest.mark.proxy + @pytest.mark.forwarder + def test_proxy_default_configs( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """ + Verifies the default proxy configurations + """ + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + ucc_smartx_selenium_helper=ucc_smartx_selenium_helper, + ucc_smartx_rest_helper=ucc_smartx_rest_helper, + ) + self.assert_util(proxy.proxy_enable.is_checked(), False) + self.assert_util(proxy.dns_enable.is_checked(), False) + self.assert_util(proxy.type.get_value(), "http") + self.assert_util(proxy.host.get_value(), "") + self.assert_util(proxy.port.get_value(), "") + self.assert_util(proxy.username.get_value(), "") + self.assert_util(proxy.password.get_value(), "") + +``` + + +**Setup Fixtures** + +The test suite could also contain setup fixtures that would be called before tests to setup the Splunk environment. This could range from creating new inputs, to using a different page class to create a related input/Account for the page being tested. It may also be useful to have global variables for the default configurations so that it could be easily edited and reused later. +An example of a setup fixture: + +```python +ACCOUNT_PARAMS = { + "name": "test_account", + "endpoint": "login.test.com", + "username": None, + "password": None, +} + + +@pytest.fixture(scope="class", autouse=True) +def create_account(ucc_smartx_rest_helper): + """ + Fixture to create account using rest endpoint + """ + account = AccountPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) + url = account._get_account_endpoint() + account_config = { + "name": ACCOUNT_PARAMS.get("name"), + "endpoint": ACCOUNT_PARAMS.get("endpoint"), + "username": ACCOUNT_PARAMS.get("username"), + "password": ACCOUNT_PARAMS.get("password"), + } + account.backend_conf.post_stanza(url, account_config) + yield + account.backend_conf.delete_all_stanzas() + +``` + + +**Teardown Fixtures** + +The test suites should also contain teardown fixtures to revert the Splunk instance back to its original state after each test, this way each test is independent of each other and so if one test fails, then another test shouldn't fail in correspondence as to the first test. +An example of the teardown fixture: + +```python +DEFAULT_CONFIGURATION = { + "proxy_enabled": "", + "proxy_password": "", + "proxy_port": "", + "proxy_rdns": "", + "proxy_type": "http", + "proxy_url": "", + "proxy_username": "", +} + + +@pytest.fixture(autouse=True) +def reset_configuration(ucc_smartx_rest_helper): + yield + proxy = Proxy(TA_NAME, TA_PROXY_URL, ucc_smartx_rest_helper=ucc_smartx_rest_helper) + proxy.backend_conf_post.update_parameters(DEFAULT_CONFIGURATION) + +``` + + +**Environment Variables** + +You may also want to get environment variables so that you can dynamically setup different test variables easily through the environment instead of having to hardcode them into the test. This may useful in hiding sensitive data such as login credentials. +An example for getting environment variables is as follows: + +```python +@pytest.fixture(scope="session", autouse=True) +def get_account_credentials(): + """ + Fixtures to fetch credentials from environment variables + """ + ACCOUNT_PARAMS["username"] = b64decode(os.getenv("USERNAME")).decode("ascii") + ACCOUNT_PARAMS["password"] = b64decode(os.getenv("PASSWORD")).decode("ascii") + ACCOUNT_PARAMS["token"] = b64decode(os.getenv("TOKEN")).decode("ascii") + +``` diff --git a/docs/example_code.py b/docs/getting_started/test_page.md similarity index 70% rename from docs/example_code.py rename to docs/getting_started/test_page.md index 32577e45..2462b815 100644 --- a/docs/example_code.py +++ b/docs/getting_started/test_page.md @@ -1,3 +1,38 @@ +When creating new UI tests for a Splunk App using SmartX, it would be helpful to start with creating the TA's page class files within test/ui/<TA>_UccLib. + +These files should contain Page classes that represent the webpage we want to test within the app, and hold the multiple components that are within that webpage. The class should also contain the webdriver instance and the backend methods to make API calls to Splunk. + +When creating a Page file, there are usually 2 portions of it to create: + +**1. The page class** +This would be the main class for the page file, which should hold all of the components and class instances for calling the backend. +This file would also need to import all of the components as well from SmartX to be able to use them. +The usual parameters for this class are the following: + + - ucc_smartx_selenium_helper (SmartX fixture): The SmartX instance for the selenium webdriver which helps control page interactions for the tests. This parameter is used to create the UI components, and we should not create the UI component classes without this parameter. + - ucc_smartx_rest_helper (SmartX fixture): The SmartX instance for the selenium helper which helps control page interactions. This parameter holds the selenium driver, urls(web, mgmt) and session key for the tests. This parameter is used for creating SmartX rest classes such as the classes found within backend_confs.py. + - open_page(Flag): This parameter is to indicate whether or not we should open this webpage when we create this class instance. If we want to open the file later, we can use <class>.open() later on. + +This class should also hold functions to open the webpage and to store the backend endpoint. + +**2. The entities found within the page** +If the webpage consists of any entities (A web element on a page that consists of multiple components, such as popups or forms to create a new input). then you would need to create an entity that represents the entity's controls and components. +The usual parameters for this class are the following: + + - browser: The selenium webdriver + - container: The container in which the entity is located in + +The parent class for this type of class is found within the `pytest_splunk_addon_ui_smartx/components/entity.py` file. This base class has useful functions to click on a save button in the entity, closing the entity, and getting messages that may appear. +This base class has the following parameters: + + - browser: The selenium webdriver + - container: Container in which the entity is located. + - add_btn: The locator of add_button with which the entity will be opened + +**Example** +A Example Page file would look like this: + +```python from selenium.webdriver.common.by import By from pytest_splunk_addon_ui_smartx.backend_confs import ListBackendConf @@ -167,97 +202,4 @@ def _get_input_endpoint(self): self.splunk_mgmt_url ) - -import pytest - -from pytest_splunk_addon_ui_smartx.base_test import UccTester -from pytest_splunk_addon_ui_smartx.pages.proxy import Proxy - -TA_NAME = "Splunk_TA_" -TA_PROXY_URL = ( - "/servicesNS/nobody/Splunk_TA_/Splunk_TA__settings/proxy" -) - -PROXY_TYPE_VALUES = ["http", "socks4", "socks5"] -DEFAULT_CONFIGURATION = { - "proxy_enabled": "", - "proxy_password": "", - "proxy_port": "", - "proxy_rdns": "", - "proxy_type": "http", - "proxy_url": "", - "proxy_username": "", -} - - -@pytest.fixture(autouse=True) -def reset_configuration(ucc_smartx_rest_helper): - yield - proxy = Proxy(TA_NAME, TA_PROXY_URL, ucc_smartx_rest_helper=ucc_smartx_rest_helper) - proxy.backend_conf_post.update_parameters(DEFAULT_CONFIGURATION) - - -class TestProxy(UccTester): - """ - Test suite testing UCC from based configuration page - """ - - @pytest.mark.proxy - @pytest.mark.forwarder - def test_proxy_default_configs( - self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper - ): - """ - Verifies the default proxy configurations - """ - proxy = Proxy( - TA_NAME, - TA_PROXY_URL, - ucc_smartx_selenium_helper=ucc_smartx_selenium_helper, - ucc_smartx_rest_helper=ucc_smartx_rest_helper, - ) - self.assert_util(proxy.proxy_enable.is_checked(), False) - self.assert_util(proxy.dns_enable.is_checked(), False) - self.assert_util(proxy.type.get_value(), "http") - self.assert_util(proxy.host.get_value(), "") - self.assert_util(proxy.port.get_value(), "") - self.assert_util(proxy.username.get_value(), "") - self.assert_util(proxy.password.get_value(), "") - - -ACCOUNT_PARAMS = { - "name": "test_account", - "endpoint": "login.test.com", - "username": None, - "password": None, -} - - -@pytest.fixture(scope="class", autouse=True) -def create_account(ucc_smartx_rest_helper): - """ - Fixture to create account using rest endpoint - """ - account = AccountPage( - ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False - ) - url = account._get_account_endpoint() - account_config = { - "name": ACCOUNT_PARAMS.get("name"), - "endpoint": ACCOUNT_PARAMS.get("endpoint"), - "username": ACCOUNT_PARAMS.get("username"), - "password": ACCOUNT_PARAMS.get("password"), - } - account.backend_conf.post_stanza(url, account_config) - yield - account.backend_conf.delete_all_stanzas() - - -@pytest.fixture(scope="session", autouse=True) -def get_account_credentials(): - """ - Fixtures to fetch credentials from environment variables - """ - ACCOUNT_PARAMS["username"] = b64decode(os.getenv("USERNAME")).decode("ascii") - ACCOUNT_PARAMS["password"] = b64decode(os.getenv("PASSWORD")).decode("ascii") - ACCOUNT_PARAMS["token"] = b64decode(os.getenv("TOKEN")).decode("ascii") +``` diff --git a/docs/how_to_use.md b/docs/how_to_use.md new file mode 100644 index 00000000..881a56ed --- /dev/null +++ b/docs/how_to_use.md @@ -0,0 +1,57 @@ +# How to use + +## Steps to test in Local Environment + +**1. Install the framework** + +```bash +pip install pytest-splunk-addon-ui-smartx +``` + +**2. Download Browser Drivers** + +Download the drivers for the browser you want to test + + - For Chrome: download chromedriver [ChromeDriver download](https://chromedriver.chromium.org/downloads) + - For Firefox: download geckodriver [Geckodriver Download](https://github.com/mozilla/geckodriver/releases) + - For IE: download IEdriverserver [IEdriverserver Download](https://www.selenium.dev/downloads/) + +**2A. For Internet Explorer:** + +For Internet Explorer, the following steps need to be performed for it to work correctly: +[IEDriver required configuration steps](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration) + +**3. Put the downloaded driver into test/ui/ directory** + +Make sure that the drivers are in at least an area that could be found + +**4. include the driver location in your PATH environment variable** + +This needs to be done so that pytest can find the drivers. + +**5. Execute the test cases** + +You can execute the test cases with the following console command: + +```console +pytest -vv --browser={browser} --local --persist-browser --splunk-host={web_url} --splunk-port={mgmt_url} --splunk-user {username} --splunk-password {password} --html {reportname.html} --setup-retry-count={retry-count} --headless --splunk-type=external +``` + +The parameters are as follows: + + - \--browser: The browser in which the test will run on. The supported values are: chrome, firefox, safari (Default: firefox) + - \--local: The test will be run on the local browsers, used during development and testing phase (Default: False) + - \--persist-browser: For local execution, keep a single browser to execute all tests. (Only supported with --local) + - \--splunk-host: The Splunk web url + - \--splunk-port: Splunk management port (Default: 8089) + - \--splunk-user: Splunk instance username (Default: admin) + - \--splunk-password: Splunk instance account password (Default: Chang3d!) + - \--html: The output html file for debugging purposes + - \--setup-retry-count: The number of times the browser should try to connect to the SeleniumBrowser (Default: 1) + - \--headless: Run the test case on headless mode + - \--splunk-type=external + +## General workflow for writing test cases using the Framework +1. Clone and install the framework inside test/ui +2. Create Add-on specific Page classes (we only need to specify which components it contains) +3. Implement the test-cases by using the pages & its components diff --git a/docs/how_to_use.rst b/docs/how_to_use.rst deleted file mode 100644 index f40df734..00000000 --- a/docs/how_to_use.rst +++ /dev/null @@ -1,82 +0,0 @@ -How to use -========== -Steps to test in Local Environment ----------------------------------- - -**1. Install the framework** - -The Framework could be cloned from here: `SmartX Repo `_ - -.. code-block:: console - - 1. git clone https://github.com/splunk/addon-factory-smartx-ui-test-library.git - 2. python3 -m venv .venv - 3. source .venv/bin/activate - 4. cd addon-factory-smartx-ui-test-library - 5. pip install . - -**2. Download Browser Drivers** - -Download the drivers for the browser you want to test - * For Chrome: download chromedriver `ChromeDriver download `_ - * For Firefox: download geckodriver `Geckodriver Download `_ - * For IE: download IEdriverserver `IEdriverserver Download `_ - -**2A. For Internet Explorer:** - -For Internet Explorer, the following steps need to be performed for it to work correctly: -`IEDriver required configuration steps `_ - -**3. Put the downloaded driver into test/ui/ directory** - -Make sure that the drivers are in at least an area that could be found - -**4. include the driver location in your PATH environment variable** - -This needs to be done so that pytest can find the drivers. - -**5. Execute the test cases** - -You can execute the test cases with the following console command: - -.. code-block:: console - - pytest -vv --browser={browser} --local --persist-browser --splunk-host={web_url} --splunk-port={mgmt_url} --splunk-user {username} --splunk-password {password} --html {reportname.html} --setup-retry-count={retry-count} --headless --splunk-type=external - -The parameters are as follows: - * --browser: The browser in which the test will run on. The supported values are: chrome, firefox, safari (Default: firefox) - * --local: The test will be run on the local browsers, used during development and testing phase (Default: False) - * --persist-browser: For local execution, keep a single browser to execute all tests. (Only supported with --local) - * --splunk-host: The Splunk web url - * --splunk-port: Splunk management port (Default: 8089) - * --splunk-user: Splunk instance username (Default: admin) - * --splunk-password: Splunk instance account password (Default: Chang3d!) - * --html: The output html file for debugging purposes - * --setup-retry-count: The number of times the browser should try to connect to the SeleniumBrowser (Default: 1) - * --headless: Run the test case on headless mode - * --splunk-type=external - -Steps to test in Saucelabs --------------------------- - -Saucelabs is a cloud service that allows engineers/systems to provision any platform + browser combination to run some tests. The Saucelab app can be found here: https://app.saucelabs.com/dashboard/builds - -**1. Install the framework** - -The Framework could be cloned from here: `SmartX Repo `_ - -**2. Configure Saucelabs credentials as environment variables** - * SAUCE_USERNAME : - * SAUCE_PASSWORD : - -**3. Execute the test cases** - -.. code-block:: console - - pytest -vv --browser={browser} --splunk-host={web_url} --splunk-port={mgmt_url} --splunk-user {username} --splunk-password {password} --local - -General workflow for writing test cases using the Framework ------------------------------------------------------------ - 1. Clone and install the framework inside test/ui - 2. Create Add-on specific Page classes (we only need to specify which components it contains) - 3. Implement the test-cases by using the pages & its components diff --git a/docs/UI-Framework.jpeg b/docs/images/UI-Framework.jpeg similarity index 100% rename from docs/UI-Framework.jpeg rename to docs/images/UI-Framework.jpeg diff --git a/docs/UI_automation_Flow.jpeg b/docs/images/UI_automation_Flow.jpeg similarity index 100% rename from docs/UI_automation_Flow.jpeg rename to docs/images/UI_automation_Flow.jpeg diff --git a/docs/file_architecture.jpeg b/docs/images/file_architecture.jpeg similarity index 100% rename from docs/file_architecture.jpeg rename to docs/images/file_architecture.jpeg diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..c1610387 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,51 @@ +# Overview + +UCC based Add-on UI automation framework: The goal of SmartX is to be a UI testing framework to test the UCC UI pages for Splunk Add-ons. +All the add-ons are built with the same template, and such contain consistent input and configuration pages specified for each. To test all of the add-ons easily, a generic framework was created, which can be used to test all the add-ons. + +## Design + +We follow a practice in which we create a set of components first, which would be replaceable and can be utilized on any page. A web-page will be a composition of these components, placed in the proper containers. +The design of the framework will consist of the following 3 parts: + + - Components: A UI component that the user would interact with. This component should consist of methods to interact with the UI component, such as the get and set values in the container. Components will have a set of locators that will be interacted with. (Locators are any type which are supported by selenium) + - Pages: The page holds multiple Components and represents a specific web page for the Add-on. The page should only be used to contain the set of components, and no interaction methods should be made within the Page class. + - Test Cases: Tests the interaction and values in the components. The tests should only test one functionality at a time and should interact with one page at a time. Through interaction with more than one page should be sequential. + +The design of the framework is as follows: +![image](./images/UI-Framework.jpeg) + +## File structure + +The tests should be structured in the following format: + + - `test/ui`: The parent ui-test directory in which we should put all of our SmartX test cases within. May contain files like `conftest.py`, `pytest.ini` and other relevant files for `pytest`. + - `test/ui/_UccLib`: The specific TA's unique page files that we want to test. + - `test/ui/test_.py`: The test cases for a specific TA page or Input. + +We would install SmartX as a package in a virtual environment. +The general file structure of SmartX UI Test Framework is as follows: + +![image](./images/file_architecture.jpeg) + +## Support + +- **Python**: 3.7 +- **Platforms**: Linux, Windows, and MacOS + +## Features + - pytest fixture to control when the browser should be initialized & tear-downed. + - Screenshots when any test case fails. + - An Html and logger report containing the trace-back and the screenshots of the failed test cases. + - Pytest parameters to change the URL and the credentials of the test Splunk instance. + - Pytest fixtures that are used to run some code before every test method or class. Used to initialize the browser we need in every test case and to login to the Splunk Instance + - Backend configuration can be fetched from the management API of the Splunk instance. + - Reruns, the test cases will be rerunning to avoid some rare timeout/network issues + +The general workflow of SmartX UI Test Framework is as follows: +![image](./images/UI_automation_Flow.jpeg) + + +## Installation + +You can download SmartX from PyPI: [SmartX PyPI](https://pypi.org/project/pytest-splunk-addon-ui-smartx/) diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 450b8b81..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. pytest_splunk_addon_ui_smartx documentation master file, created by - sphinx-quickstart on Fri Oct 9 15:31:49 2020. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to pytest_splunk_addon_ui_smartx's documentation! -========================================================= - -.. toctree:: - :maxdepth: 3 - :caption: Contents: - - overview - how_to_use - getting_started - api_reference - diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index be0cfd1d..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,252 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - echo. coverage to run coverage check of the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -REM Check if sphinx-build is available and fallback to Python version if any -%SPHINXBUILD% 2> nul -if errorlevel 9009 goto sphinx_python -goto sphinx_ok - -:sphinx_python - -set SPHINXBUILD=python -m sphinx.__init__ -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -:sphinx_ok - - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "coverage" ( - %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage - if errorlevel 1 exit /b 1 - echo. - echo.Testing of coverage in the sources finished, look at the ^ -results in %BUILDDIR%/coverage/python.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end diff --git a/docs/overview.rst b/docs/overview.rst deleted file mode 100644 index 6d75c2ab..00000000 --- a/docs/overview.rst +++ /dev/null @@ -1,80 +0,0 @@ -Overview -======== -UCC based Add-on UI automation framework -Confluence Page link: -`SmartX Repo `_ - -The goal of SmartX is to be a UI testing framework to test the UCC UI pages for Splunk Add-ons. -All the add-ons are built with the same template, and such contain consistent input and configuration pages specified for each. To test all of the add-ons easily, a generic framework was created, which can be used to test all the add-ons. - -Design ------- -We follow a practice in which we create a set of components first, which would be replaceable and can be utilized on any page. A web-page will be a composition of these components, placed in the proper containers. -The design of the framework will consist of the following 3 parts: - - * Components: A UI component that the user would interact with. This component should consist of methods to interact with the UI component, such as the get and set values in the container. Components will have a set of locators that will be interacted with. (Locators are any type which are supported by selenium) - * Pages: The page holds multiple Components and represents a specific web page for the Add-on. The page should only be used to contain the set of components, and no interaction methods should be made within the Page class. - * Test Cases: Tests the interaction and values in the components. The tests should only test one functionality at a time and should interact with one page at a time. Through interaction with more than one page should be sequential. - -The design of the framework is as follows: - -.. image:: UI-Framework.jpeg - :align: center - :alt: Flow diagram - -File structure --------------- -The tests should be structured in the following format: - * test/ui: The parent ui-test directory in which we should put all of our SmartX test cases within. - * test/ui/_UccLib: The specific TA's unique page files that we want to test. - * test/ui/test_.py: The test cases for a specific TA page or Input. - -We would install SmartX as a package in a virtual environment. -The general file structure of pytest_splunk_addon_ui_smartx is as follows: - -.. image:: file_architecture.jpeg - :align: center - :alt: Flow diagram - -Support -------- - -* **Python**: 3.7 -* **Platforms**: Linux, Windows, and MacOS - -Features --------- - * pytest fixture to control when the browser should be initialized & tear-downed. - * Flag to easily convert the environment from SauceLabs to local for debugging purposes. - * Screenshots when any test case fails. - * An Html and logger report containing the trace-back and the screenshots of the failed test cases. - * Pytest parameters to change the URL and the credentials of the test Splunk instance. - * Pytest fixtures that are used to run some code before every test method or class. Used to initialize the browser we need in every test case and to login to the Splunk Instance - * Backend configuration can be fetched from the management API of the Splunk instance. - * Reruns, the test cases will be rerunning to avoid some rare timeout/network issues - -The general workflow of pytest_splunk_addon_ui_smartx is as follows: - -.. image:: UI_automation_Flow.jpeg - :align: center - :alt: Flow diagram - -Installation ------------- -The Framework could be cloned from here: `SmartX Repo `__ - -.. code-block:: console - - 1. git clone https://github.com/splunk/addon-factory-smartx-ui-test-library.git - 2. python3 -m venv .venv - 3. source .venv/bin/activate - 4. cd addon-factory-smartx-ui-test-library - 5. poetry install - -You could also download SmartX from PyPi as well: `SmartX PyPI `__ - -.. code-block:: console - - 1. python3 -m venv .venv - 2. source .venv/bin/activate - 3. pip install pytest-splunk-addon-ui-smartx diff --git a/docs/pages/index.rst b/docs/pages/index.rst deleted file mode 100644 index 5c3d3ac2..00000000 --- a/docs/pages/index.rst +++ /dev/null @@ -1,14 +0,0 @@ -Pages -===================== - -The following is the API Reference for SmartX Pages - -.. toctree:: - :maxdepth: 1 - - logging - login - page - proxy - - \ No newline at end of file diff --git a/docs/pages/logging.rst b/docs/pages/logging.rst deleted file mode 100644 index 5415b058..00000000 --- a/docs/pages/logging.rst +++ /dev/null @@ -1,6 +0,0 @@ -Logging -------- - -.. automodule:: pytest_splunk_addon_ui_smartx.pages.logging - :members: - :show-inheritance: diff --git a/docs/pages/login.rst b/docs/pages/login.rst deleted file mode 100644 index 74d447f0..00000000 --- a/docs/pages/login.rst +++ /dev/null @@ -1,6 +0,0 @@ -Login -===== - -.. automodule:: pytest_splunk_addon_ui_smartx.pages.login - :members: - :show-inheritance: diff --git a/docs/pages/page.rst b/docs/pages/page.rst deleted file mode 100644 index dccb4243..00000000 --- a/docs/pages/page.rst +++ /dev/null @@ -1,6 +0,0 @@ -Page -==== - -.. automodule:: pytest_splunk_addon_ui_smartx.pages.page - :members: - :show-inheritance: diff --git a/docs/pages/proxy.rst b/docs/pages/proxy.rst deleted file mode 100644 index 06f44f8b..00000000 --- a/docs/pages/proxy.rst +++ /dev/null @@ -1,6 +0,0 @@ -Proxy -====== - -.. automodule:: pytest_splunk_addon_ui_smartx.pages.proxy - :members: - :show-inheritance: diff --git a/docs/plugin.rst b/docs/plugin.rst deleted file mode 100644 index ef039979..00000000 --- a/docs/plugin.rst +++ /dev/null @@ -1,6 +0,0 @@ -plugin -========== - -.. automodule:: pytest_splunk_addon_ui_smartx.plugin - :members: - :show-inheritance: diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 06cf0f67..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -filelock -pytest -future -pytest-splunk-addon -selenium -Sphinx -sphinx_rtd_theme -sphinx-panels diff --git a/docs/utils.rst b/docs/utils.rst deleted file mode 100644 index bf192a8a..00000000 --- a/docs/utils.rst +++ /dev/null @@ -1,6 +0,0 @@ -utils -====== - -.. automodule:: pytest_splunk_addon_ui_smartx.utils - :members: - :show-inheritance: diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..08d31583 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,100 @@ +# +# Copyright 2024 Splunk Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +site_name: SmartX +site_author: Splunk +site_url: "https://splunk.github.io/addon-factory-smartx-ui-test-library/" +edit_uri: "tree/main/docs/" +remote_branch: gh-pages + +repo_name: Splunk SmartX UI Test Framework +repo_url: "https://github.com/splunk/addon-factory-smartx-ui-test-library" + +markdown_extensions: + - toc: + permalink: True + - smarty + - fenced_code + - sane_lists + - codehilite + - pymdownx.superfences + +theme: + name: "material" + palette: + primary: "black" + accent: "orange" + features: + - content.code.copy + - navigation.indexes + +plugins: +- mkdocstrings: + handlers: + python: + options: + show_docstring_classes: true + show_docstring_functions: true + show_docstring_attributes: true + show_docstring_parameters: true + show_docstring_other_parameters: true + show_inheritance_diagram: true + docstring_style: sphinx + docstring_options: + ignore_init_summary: true + merge_init_into_class: true + +nav: + - Home: "index.md" + - How To Use: "how_to_use.md" + - Getting Started: + - "getting_started/index.md" + - Setup: "getting_started/setup.md" + - Test Page Creation: "getting_started/test_page.md" + - Test Cases Creation: "getting_started/test_case.md" + - API Reference: + - "api_reference/index.md" + - backend_conf: "api_reference/backend_confs.md" + - base_test: "api_reference/base_test.md" + - plugin: "api_reference/plugin.md" + - utils: "api_reference/utils.md" + - pages: + - "api_reference/pages/index.md" + - Logging: "api_reference/pages/logging.md" + - Login: "api_reference/pages/login.md" + - Page: "api_reference/pages/page.md" + - Proxy: "api_reference/pages/proxy.md" + - components: + - "api_reference/components/index.md" + - base_component: "api_reference/components/base_component.md" + - conf_table: "api_reference/components/conf_table.md" + - dropdown: "api_reference/components/dropdown.md" + - entity: "api_reference/components/entity.md" + - input_table: "api_reference/components/input_table.md" + - login: "api_reference/components/login.md" + - table: "api_reference/components/table.md" + - tabs: "api_reference/components/tabs.md" + - controls: + - "api_reference/components/controls/index.md" + - base_control: "api_reference/components/controls/base_control.md" + - button: "api_reference/components/controls/button.md" + - checkbox: "api_reference/components/controls/checkbox.md" + - learn_more: "api_reference/components/controls/learn_more.md" + - message: "api_reference/components/controls/message.md" + - multi_select: "api_reference/components/controls/multi_select.md" + - oauth_elect: "api_reference/components/controls/oauth_select.md" + - single_select: "api_reference/components/controls/single_select.md" + - textbox: "api_reference/components/controls/textbox.md" + - toggle: "api_reference/components/controls/toggle.md" diff --git a/poetry.lock b/poetry.lock index 5cdd28bb..1ad1b9ea 100644 --- a/poetry.lock +++ b/poetry.lock @@ -11,17 +11,6 @@ files = [ {file = "addonfactory_splunk_conf_parser_lib-0.3.4.tar.gz", hash = "sha256:e550105c8c85a6f553688e5b1f4f55ae7ca758a1a428cbce1e0b9b73b9f4e35d"}, ] -[[package]] -name = "alabaster" -version = "0.7.13" -description = "A configurable sidebar-enabled Sphinx theme" -optional = false -python-versions = ">=3.6" -files = [ - {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, - {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, -] - [[package]] name = "arrow" version = "1.2.3" @@ -58,20 +47,6 @@ docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib- tests = ["attrs[tests-no-zope]", "zope-interface"] tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -[[package]] -name = "babel" -version = "2.12.1" -description = "Internationalization utilities" -optional = false -python-versions = ">=3.7" -files = [ - {file = "Babel-2.12.1-py3-none-any.whl", hash = "sha256:b4246fb7677d3b98f501a39d43396d3cafdc8eadb045f4a31be01863f655c610"}, - {file = "Babel-2.12.1.tar.gz", hash = "sha256:cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455"}, -] - -[package.dependencies] -pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} - [[package]] name = "binaryornot" version = "0.4.4" @@ -220,13 +195,13 @@ files = [ [[package]] name = "cookiecutter" -version = "2.4.0" +version = "2.6.0" description = "A command-line utility that creates projects from project templates, e.g. creating a Python package project from a Python package project template." optional = false python-versions = ">=3.7" files = [ - {file = "cookiecutter-2.4.0-py3-none-any.whl", hash = "sha256:8344663028abc08ec09b912e663636a97e1775bffe973425ec0107431acd390e"}, - {file = "cookiecutter-2.4.0.tar.gz", hash = "sha256:6d1494e66a784f23324df9d593f3e43af3db4f4b926b9e49e6ff060169fc042a"}, + {file = "cookiecutter-2.6.0-py3-none-any.whl", hash = "sha256:a54a8e37995e4ed963b3e82831072d1ad4b005af736bb17b99c2cbd9d41b6e2d"}, + {file = "cookiecutter-2.6.0.tar.gz", hash = "sha256:db21f8169ea4f4fdc2408d48ca44859349de2647fbe494a9d6c3edfc0542c21c"}, ] [package.dependencies] @@ -261,17 +236,6 @@ files = [ {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"}, ] -[[package]] -name = "docutils" -version = "0.18.1" -description = "Docutils -- Python Documentation Utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, - {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, -] - [[package]] name = "dunamai" version = "1.18.0" @@ -394,17 +358,6 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] -[[package]] -name = "imagesize" -version = "1.4.1" -description = "Getting image size from png/jpeg/jpeg2000/gif file" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, - {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, -] - [[package]] name = "importlib-metadata" version = "6.7.0" @@ -667,6 +620,16 @@ files = [ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, @@ -795,17 +758,18 @@ files = [ [[package]] name = "pygments" -version = "2.16.1" +version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.7" files = [ - {file = "Pygments-2.16.1-py3-none-any.whl", hash = "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692"}, - {file = "Pygments-2.16.1.tar.gz", hash = "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29"}, + {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, + {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, ] [package.extras] plugins = ["importlib-metadata"] +windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pyparsing" @@ -1026,13 +990,13 @@ cli = ["click (>=5.0)"] [[package]] name = "python-slugify" -version = "8.0.1" +version = "8.0.4" description = "A Python slugify application that also handles Unicode" optional = false python-versions = ">=3.7" files = [ - {file = "python-slugify-8.0.1.tar.gz", hash = "sha256:ce0d46ddb668b3be82f4ed5e503dbc33dd815d83e2eb6824211310d3fb172a27"}, - {file = "python_slugify-8.0.1-py2.py3-none-any.whl", hash = "sha256:70ca6ea68fe63ecc8fa4fcf00ae651fc8a5d02d93dcd12ae6d4fc7ca46c4d395"}, + {file = "python-slugify-8.0.4.tar.gz", hash = "sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856"}, + {file = "python_slugify-8.0.4-py2.py3-none-any.whl", hash = "sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8"}, ] [package.dependencies] @@ -1041,17 +1005,6 @@ text-unidecode = ">=1.3" [package.extras] unidecode = ["Unidecode (>=1.1.1)"] -[[package]] -name = "pytz" -version = "2023.3.post1" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -files = [ - {file = "pytz-2023.3.post1-py2.py3-none-any.whl", hash = "sha256:ce42d816b81b68506614c11e8937d3aa9e41007ceb50bfdcb0749b921bf646c7"}, - {file = "pytz-2023.3.post1.tar.gz", hash = "sha256:7b4fddbeb94a1eba4b557da24f19fdf9db575192544270a9101d8509f9f43d7b"}, -] - [[package]] name = "pyyaml" version = "6.0.1" @@ -1064,6 +1017,7 @@ files = [ {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, @@ -1071,8 +1025,16 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, + {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, + {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, + {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, @@ -1089,6 +1051,7 @@ files = [ {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, @@ -1096,6 +1059,7 @@ files = [ {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, @@ -1124,13 +1088,13 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "rich" -version = "13.6.0" +version = "13.7.1" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false python-versions = ">=3.7.0" files = [ - {file = "rich-13.6.0-py3-none-any.whl", hash = "sha256:2b38e2fe9ca72c9a00170a1a2d20c63c790d0e10ef1fe35eba76e1e7b1d7d245"}, - {file = "rich-13.6.0.tar.gz", hash = "sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef"}, + {file = "rich-13.7.1-py3-none-any.whl", hash = "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222"}, + {file = "rich-13.7.1.tar.gz", hash = "sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432"}, ] [package.dependencies] @@ -1155,22 +1119,6 @@ files = [ [package.dependencies] urllib3 = "*" -[[package]] -name = "setuptools" -version = "68.0.0" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "setuptools-68.0.0-py3-none-any.whl", hash = "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f"}, - {file = "setuptools-68.0.0.tar.gz", hash = "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "six" version = "1.16.0" @@ -1182,195 +1130,6 @@ files = [ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] -[[package]] -name = "snowballstemmer" -version = "2.2.0" -description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -optional = false -python-versions = "*" -files = [ - {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, - {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, -] - -[[package]] -name = "sphinx" -version = "3.5.3" -description = "Python documentation generator" -optional = false -python-versions = ">=3.5" -files = [ - {file = "Sphinx-3.5.3-py3-none-any.whl", hash = "sha256:3f01732296465648da43dec8fb40dc451ba79eb3e2cc5c6d79005fd98197107d"}, - {file = "Sphinx-3.5.3.tar.gz", hash = "sha256:ce9c228456131bab09a3d7d10ae58474de562a6f79abb3dc811ae401cf8c1abc"}, -] - -[package.dependencies] -alabaster = ">=0.7,<0.8" -babel = ">=1.3" -colorama = {version = ">=0.3.5", markers = "sys_platform == \"win32\""} -docutils = ">=0.12" -imagesize = "*" -Jinja2 = ">=2.3" -packaging = "*" -Pygments = ">=2.0" -requests = ">=2.5.0" -setuptools = "*" -snowballstemmer = ">=1.1" -sphinxcontrib-applehelp = "*" -sphinxcontrib-devhelp = "*" -sphinxcontrib-htmlhelp = "*" -sphinxcontrib-jsmath = "*" -sphinxcontrib-qthelp = "*" -sphinxcontrib-serializinghtml = "*" - -[package.extras] -docs = ["sphinxcontrib-websupport"] -lint = ["docutils-stubs", "flake8 (>=3.5.0)", "isort", "mypy (>=0.800)"] -test = ["cython", "html5lib", "pytest", "pytest-cov", "typed-ast"] - -[[package]] -name = "sphinx-panels" -version = "0.6.0" -description = "A sphinx extension for creating panels in a grid layout." -optional = false -python-versions = "*" -files = [ - {file = "sphinx-panels-0.6.0.tar.gz", hash = "sha256:d36dcd26358117e11888f7143db4ac2301ebe90873ac00627bf1fe526bf0f058"}, - {file = "sphinx_panels-0.6.0-py3-none-any.whl", hash = "sha256:bd64afaf85c07f8096d21c8247fc6fd757e339d1be97832c8832d6ae5ed2e61d"}, -] - -[package.dependencies] -docutils = "*" -sphinx = ">=2,<5" - -[package.extras] -code-style = ["pre-commit (>=2.7.0,<2.8.0)"] -live-dev = ["sphinx-autobuild", "web-compile (>=0.2.0,<0.3.0)"] -testing = ["pytest (>=6.0.1,<6.1.0)", "pytest-regressions (>=2.0.1,<2.1.0)"] -themes = ["myst-parser (>=0.12.9,<0.13.0)", "pydata-sphinx-theme (>=0.4.0,<0.5.0)", "sphinx-book-theme (>=0.0.36,<0.1.0)", "sphinx-rtd-theme"] - -[[package]] -name = "sphinx-rtd-theme" -version = "1.3.0" -description = "Read the Docs theme for Sphinx" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" -files = [ - {file = "sphinx_rtd_theme-1.3.0-py2.py3-none-any.whl", hash = "sha256:46ddef89cc2416a81ecfbeaceab1881948c014b1b6e4450b815311a89fb977b0"}, - {file = "sphinx_rtd_theme-1.3.0.tar.gz", hash = "sha256:590b030c7abb9cf038ec053b95e5380b5c70d61591eb0b552063fbe7c41f0931"}, -] - -[package.dependencies] -docutils = "<0.19" -sphinx = ">=1.6,<8" -sphinxcontrib-jquery = ">=4,<5" - -[package.extras] -dev = ["bump2version", "sphinxcontrib-httpdomain", "transifex-client", "wheel"] - -[[package]] -name = "sphinxcontrib-applehelp" -version = "1.0.2" -description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, - {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-devhelp" -version = "1.0.2" -description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, - {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-htmlhelp" -version = "2.0.0" -description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -optional = false -python-versions = ">=3.6" -files = [ - {file = "sphinxcontrib-htmlhelp-2.0.0.tar.gz", hash = "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2"}, - {file = "sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl", hash = "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["html5lib", "pytest"] - -[[package]] -name = "sphinxcontrib-jquery" -version = "4.1" -description = "Extension to include jQuery on newer Sphinx releases" -optional = false -python-versions = ">=2.7" -files = [ - {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, - {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, -] - -[package.dependencies] -Sphinx = ">=1.8" - -[[package]] -name = "sphinxcontrib-jsmath" -version = "1.0.1" -description = "A sphinx extension which renders display math in HTML via JavaScript" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, - {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, -] - -[package.extras] -test = ["flake8", "mypy", "pytest"] - -[[package]] -name = "sphinxcontrib-qthelp" -version = "1.0.3" -description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, - {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-serializinghtml" -version = "1.1.5" -description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, - {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - [[package]] name = "splunk-add-on-ucc-framework" version = "5.28.5" @@ -1533,4 +1292,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "71f1aa5a6f6be97606af9308d0e0c4bb492af32bdea4586540ee4e5412965414" +content-hash = "459d7a741bb06753a198278a44c1bfbb0fd29ffec94de5f25fb612ef3fea4c15" diff --git a/pyproject.toml b/pyproject.toml index 74adb975..6b2b9e4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,9 +48,6 @@ pytest11 = { "ucc-smartx" = "pytest_splunk_addon_ui_smartx.plugin" } [tool.poetry.group.dev.dependencies] pytest = ">=5.4, <7.3" -Sphinx = "*" -sphinx_rtd_theme = "*" -sphinx-panels = "*" splunk-add-on-ucc-framework = "5.28.5" pytest-rerunfailures = "^12.0" diff --git a/pytest_splunk_addon_ui_smartx/components/dropdown.py b/pytest_splunk_addon_ui_smartx/components/dropdown.py index 6ab92c7a..84b9124b 100644 --- a/pytest_splunk_addon_ui_smartx/components/dropdown.py +++ b/pytest_splunk_addon_ui_smartx/components/dropdown.py @@ -29,7 +29,6 @@ def __init__(self, browser, container): """ :param browser: The selenium webdriver :param container: Container in which the table is located. Of type dictionary: {"by":..., "select":...} - :param mapping= If the table headers are different from it's html-label, provide the mapping as dictionary. For ex, {"Status": "disabled"} """ super().__init__(browser, container) self.elements.update( diff --git a/pytest_splunk_addon_ui_smartx/components/input_table.py b/pytest_splunk_addon_ui_smartx/components/input_table.py index 29cb5af7..740b4751 100644 --- a/pytest_splunk_addon_ui_smartx/components/input_table.py +++ b/pytest_splunk_addon_ui_smartx/components/input_table.py @@ -33,7 +33,7 @@ def __init__(self, browser, container, mapping={}): """ :param browser: The selenium webdriver :param container: Container in which the table is located. Of type dictionary: {"by":..., "select":...} - :param mapping= If the table headers are different from it's html-label, provide the mapping as dictionary. For ex, {"Status": "disabled"} + :param mapping: If the table headers are different from it's html-label, provide the mapping as dictionary. For ex, {"Status": "disabled"} """ super().__init__(browser, container, mapping) diff --git a/pytest_splunk_addon_ui_smartx/components/table.py b/pytest_splunk_addon_ui_smartx/components/table.py index 42fc9172..0df8f91a 100644 --- a/pytest_splunk_addon_ui_smartx/components/table.py +++ b/pytest_splunk_addon_ui_smartx/components/table.py @@ -39,7 +39,7 @@ def __init__(self, browser, container, mapping=dict(), wait_for_seconds=10): """ :param browser: The selenium webdriver :param container: Container in which the table is located. Of type dictionary: {"by":..., "select":...} - :param mapping= If the table headers are different from it's html-label, provide the mapping as dictionary. For ex, {"Status": "disabled"} + :param mapping: If the table headers are different from it's html-label, provide the mapping as dictionary. For ex, {"Status": "disabled"} """ super().__init__(browser, container) diff --git a/pytest_splunk_addon_ui_smartx/pages/logging.py b/pytest_splunk_addon_ui_smartx/pages/logging.py index f9bd8689..de40af16 100644 --- a/pytest_splunk_addon_ui_smartx/pages/logging.py +++ b/pytest_splunk_addon_ui_smartx/pages/logging.py @@ -34,9 +34,10 @@ def __init__( ucc_smartx_rest_helper=None, ): """ - :param ucc_smartx_configs: Fixture with selenium driver, urls(web, mgmt) and session key :param ta_name: Name of TA :param ta_conf: Name of conf file + :param ucc_smartx_selenium_helper: Fixture with selenium driver, urls(web, mgmt) and session key + :param ucc_smartx_rest_helper: Fixture with selenium driver, urls(mgmt) """ entity_container = Selector(select='div[id="loggingTab"]') self.ta_name = ta_name diff --git a/pytest_splunk_addon_ui_smartx/pages/proxy.py b/pytest_splunk_addon_ui_smartx/pages/proxy.py index f323ac96..ee7b189f 100644 --- a/pytest_splunk_addon_ui_smartx/pages/proxy.py +++ b/pytest_splunk_addon_ui_smartx/pages/proxy.py @@ -36,9 +36,10 @@ def __init__( ucc_smartx_rest_helper=None, ): """ - :param ucc_smartx_configs: Fixture with selenium driver, urls(web, mgmt) and session key :param ta_name: Name of TA :param ta_conf: Name of conf file + :param ucc_smartx_selenium_helper: Fixture with selenium driver, urls(web, mgmt) and session key + :param ucc_smartx_rest_helper: Fixture with selenium driver, urls(mgmt) """ self.ta_name = ta_name self.ta_proxy_url = ta_proxy_url