From 69266be14b15b9e48cab09de8be565bfa5922889 Mon Sep 17 00:00:00 2001 From: srv-rr-github-token <94607705+srv-rr-github-token@users.noreply.github.com> Date: Tue, 16 Aug 2022 12:20:39 +0200 Subject: [PATCH] ci: bump repository configuration from template-refs/heads/test/pre-commit-linter (#414) * ci: common template rollout changes * style: pre-commit run --all-files --- .addonmatrix | 2 +- .eslintrc.yml | 19 + .github/workflows/build-test-release.yml | 4 +- .github/workflows/publish-manual.yaml | 4 +- .pre-commit-config.yaml | 28 + .pytest.expect | 2 +- .pytest.expect.baseline | 2 +- .releaserc | 2 +- .semgrepignore | 2 +- .splunkbase | 2 +- .vscode/extensions.json | 14 - .vscode/settings.json | 10 - Dockerfile-http_proxy | 2 +- Dockerfile-saucelabs | 2 +- Dockerfile-splunk | 2 +- Dockerfile-splunk-local | 2 +- Dockerfile-uf | 2 +- LICENSES/LicenseRef-Splunk-8-2021.txt | 38 +- README-test.md | 2 +- README.md | 2 +- docker-compose-ci.yml | 2 +- docker-compose.yml | 4 +- globalConfig.json | 2 +- package/README/restmap.conf.spec | 2 +- package/default/alert_actions.conf | 5 +- test_credentials.env | 2 +- tests/entrypoint.sh | 20 +- tests/knowledge/conftest.py | 6 +- tests/ui/Example_UccLib/__init__.py | 2 +- tests/ui/Example_UccLib/account.py | 147 +- tests/ui/Example_UccLib/alert_action.py | 66 +- tests/ui/Example_UccLib/custom.py | 88 +- tests/ui/Example_UccLib/input_page.py | 264 ++- tests/ui/__init__.py | 2 +- tests/ui/pytest-ci.ini | 8 +- .../test_splunk_ta_example_addon_account.py | 1043 ++++----- ...t_splunk_ta_example_addon_alert_actions.py | 93 +- .../ui/test_splunk_ta_example_addon_custom.py | 331 ++- .../ui/test_splunk_ta_example_addon_input.py | 1935 +++++++++-------- .../test_splunk_ta_example_addon_logging.py | 94 +- .../ui/test_splunk_ta_example_addon_proxy.py | 401 ++-- 41 files changed, 2594 insertions(+), 2066 deletions(-) create mode 100644 .eslintrc.yml create mode 100644 .pre-commit-config.yaml delete mode 100644 .vscode/extensions.json delete mode 100644 .vscode/settings.json diff --git a/.addonmatrix b/.addonmatrix index dfb15b12..9985080e 100644 --- a/.addonmatrix +++ b/.addonmatrix @@ -1 +1 @@ ---splunkfeatures METRICS_MULTI,PYTHON3 \ No newline at end of file +--splunkfeatures METRICS_MULTI,PYTHON3 diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..d45232fd --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,19 @@ +--- +env: + browser: true + es6: true + jest: true + +globals: + Atomics: readonly + SharedArrayBuffer: readonly + +parser: '@typescript-eslint/parser' +parserOptions: + ecmaVersion: 2018 + sourceType: module + +plugins: + - '@typescript-eslint' + +rules: { } diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index fde83a49..de577950 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -7,12 +7,12 @@ on: tags: - "v[0-9]+.[0-9]+.[0-9]+" pull_request: - branches: + branches: - "**" jobs: call-workflow: - uses: splunk/addonfactory-workflow-addon-release/.github/workflows/reusable-build-test-release.yml@v1.7 + uses: splunk/addonfactory-workflow-addon-release/.github/workflows/reusable-build-test-release.yml@v2.0 secrets: GH_TOKEN_ADMIN: ${{ secrets.GH_TOKEN_ADMIN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-manual.yaml b/.github/workflows/publish-manual.yaml index f28278e3..49e24f0c 100644 --- a/.github/workflows/publish-manual.yaml +++ b/.github/workflows/publish-manual.yaml @@ -1,9 +1,9 @@ name: publish-untested -on: +on: workflow_dispatch: inputs: tag: - description: 'Tag to release' + description: 'Tag to release' required: true jobs: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..a835782b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-merge-conflict + - id: debug-statements + - id: trailing-whitespace + - id: check-yaml + - id: check-xml + - id: check-toml + - id: check-json + - id: end-of-file-fixer + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.4.0 + hooks: + - id: pretty-format-java + args: [ --autofix ] + - repo: https://github.com/eslint/eslint + rev: v8.21.0 + hooks: + - id: eslint + additional_dependencies: + - "@typescript-eslint/parser" + - "@typescript-eslint/eslint-plugin" diff --git a/.pytest.expect b/.pytest.expect index 23f09efa..2347e147 100644 --- a/.pytest.expect +++ b/.pytest.expect @@ -4,4 +4,4 @@ u'tests/knowledge/test_addon.py::Test_App::test_tags[eventtype="UCC_NOT_GENERATE u'tests/knowledge/test_addon.py::Test_App::test_eventtype[eventtype::UCC_NOT_GENERATED]': FAIL u'tests/ui/test_splunk_ta_example_addon_account.py::TestAccount::test_account_basic_fields_label_entity': FAIL u'tests/ui/test_splunk_ta_example_addon_account.py::TestAccount::test_account_oauth_fields_label_entity': FAIL -u'tests/ui/test_splunk_ta_example_addon_input.py::TestInput::test_inputs_delete_enabled_input': FAIL \ No newline at end of file +u'tests/ui/test_splunk_ta_example_addon_input.py::TestInput::test_inputs_delete_enabled_input': FAIL diff --git a/.pytest.expect.baseline b/.pytest.expect.baseline index 23f09efa..2347e147 100644 --- a/.pytest.expect.baseline +++ b/.pytest.expect.baseline @@ -4,4 +4,4 @@ u'tests/knowledge/test_addon.py::Test_App::test_tags[eventtype="UCC_NOT_GENERATE u'tests/knowledge/test_addon.py::Test_App::test_eventtype[eventtype::UCC_NOT_GENERATED]': FAIL u'tests/ui/test_splunk_ta_example_addon_account.py::TestAccount::test_account_basic_fields_label_entity': FAIL u'tests/ui/test_splunk_ta_example_addon_account.py::TestAccount::test_account_oauth_fields_label_entity': FAIL -u'tests/ui/test_splunk_ta_example_addon_input.py::TestInput::test_inputs_delete_enabled_input': FAIL \ No newline at end of file +u'tests/ui/test_splunk_ta_example_addon_input.py::TestInput::test_inputs_delete_enabled_input': FAIL diff --git a/.releaserc b/.releaserc index 924fc746..6dc5b2ce 100644 --- a/.releaserc +++ b/.releaserc @@ -30,7 +30,7 @@ "assets": ["THIRDPARTY"], "message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}", }, - ], + ], ["@semantic-release/github", {}], ] } diff --git a/.semgrepignore b/.semgrepignore index 12ce9da7..5c3b7908 100644 --- a/.semgrepignore +++ b/.semgrepignore @@ -27,4 +27,4 @@ tests/ .github/ .reuse/ .vscode/ -deps/ \ No newline at end of file +deps/ diff --git a/.splunkbase b/.splunkbase index 465565b1..5c330fd0 100755 --- a/.splunkbase +++ b/.splunkbase @@ -1,3 +1,3 @@ SPLUNKBASE_ID=0 SPLUNKBASE_SPLUNK_VERSION=7.2,7.3,8.0 -SPLUNKBASE_SPLUNK_CIM_VERSION=4.x \ No newline at end of file +SPLUNKBASE_SPLUNK_CIM_VERSION=4.x diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 9c29f13e..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Splunk, Inc. - * SPDX-License-Identifier: LicenseRef-Splunk-8-2021 - * - */ -{ - "recommendations": [ - "rogalmic.bash-debug", - "ms-azuretools.vscode-docker", - "cameron.vscode-pytest", - "ms-python.python", - "donjayamanne.python-extension-pack", - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 96284019..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,10 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Splunk, Inc. - * SPDX-License-Identifier: LicenseRef-Splunk-8-2021 - * - */ -{ - "python.pythonPath": ".venv/bin/python", - "python.testing.pytestEnabled": true, - "python.testing.autoTestDiscoverOnSaveEnabled": true -} \ No newline at end of file diff --git a/Dockerfile-http_proxy b/Dockerfile-http_proxy index e6400ad3..cae88700 100644 --- a/Dockerfile-http_proxy +++ b/Dockerfile-http_proxy @@ -20,4 +20,4 @@ RUN echo "auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/pas "http_port 3128\n" > /etc/squid/squid.conf RUN cat /etc/squid/squid.conf RUN service squid start -RUN service squid restart \ No newline at end of file +RUN service squid restart diff --git a/Dockerfile-saucelabs b/Dockerfile-saucelabs index 0ca7e23d..0edc2a82 100644 --- a/Dockerfile-saucelabs +++ b/Dockerfile-saucelabs @@ -9,4 +9,4 @@ FROM circleci/python:3.7 RUN curl https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz -o /home/circleci/saucelabs.tar.gz RUN tar -xzf /home/circleci/saucelabs.tar.gz --directory /home/circleci/ -CMD /home/circleci/sc-4.6.2-linux/bin/sc -u $SAUCE_USERNAME -k $SAUCE_PASSWORD -i $SAUCE_TUNNEL_ID --no-remove-colliding-tunnels -v --se-port 4445 \ No newline at end of file +CMD /home/circleci/sc-4.6.2-linux/bin/sc -u $SAUCE_USERNAME -k $SAUCE_PASSWORD -i $SAUCE_TUNNEL_ID --no-remove-colliding-tunnels -v --se-port 4445 diff --git a/Dockerfile-splunk b/Dockerfile-splunk index dae2f604..bd44a4b4 100644 --- a/Dockerfile-splunk +++ b/Dockerfile-splunk @@ -13,4 +13,4 @@ COPY deps/build/addonfactory_test_matrix_splunk/packages/all/addon_factory_web / COPY $SPLUNK_APP_PACKAGE /opt/splunk/etc/apps/$SPLUNK_APP_ID COPY .pytest.expect /home/circleci/work_backend/.pytest.expect -COPY tests /home/circleci/work_backend/tests \ No newline at end of file +COPY tests /home/circleci/work_backend/tests diff --git a/Dockerfile-splunk-local b/Dockerfile-splunk-local index 234ac053..3de488c8 100644 --- a/Dockerfile-splunk-local +++ b/Dockerfile-splunk-local @@ -11,4 +11,4 @@ COPY deps/build/addonfactory_test_matrix_splunk/packages/all/addon_factory_web / COPY $SPLUNK_APP_PACKAGE /opt/splunk/etc/apps/$SPLUNK_APP_ID COPY .pytest.expect /home/circleci/work_backend/.pytest.expect -COPY tests /home/circleci/work_backend/tests \ No newline at end of file +COPY tests /home/circleci/work_backend/tests diff --git a/Dockerfile-uf b/Dockerfile-uf index 4ea86be1..3f0e455c 100644 --- a/Dockerfile-uf +++ b/Dockerfile-uf @@ -5,4 +5,4 @@ ARG SPLUNK_APP_ID=TA_UNKNOWN ARG SPLUNK_APP_PACKAGE=$SPLUNK_APP_PACKAGE RUN echo Splunk VERSION=$SPLUNK_VERSION -COPY $SPLUNK_APP_PACKAGE /opt/splunkforwarder/etc/apps/$SPLUNK_APP_ID \ No newline at end of file +COPY $SPLUNK_APP_PACKAGE /opt/splunkforwarder/etc/apps/$SPLUNK_APP_ID diff --git a/LICENSES/LicenseRef-Splunk-8-2021.txt b/LICENSES/LicenseRef-Splunk-8-2021.txt index b62c047d..c4063024 100644 --- a/LICENSES/LicenseRef-Splunk-8-2021.txt +++ b/LICENSES/LicenseRef-Splunk-8-2021.txt @@ -4,17 +4,17 @@ Last Updated: August 12, 2021 These Splunk General Terms (“General Terms”) between Splunk Inc., a Delaware corporation, with its principal place of business at 270 Brannan Street, San Francisco, California 94107, U.S.A (“Splunk” or “we” or “us” or “our”) and you (“Customer” or “you” or “your”) apply to the purchase of licenses and subscriptions for Splunk’s Offerings. By clicking on the appropriate button, or by downloading, installing, accessing or using the Offerings, you agree to these General Terms. If you are entering into these General Terms on behalf of Customer, you represent that you have the authority to bind Customer. If you do not agree to these General Terms, or if you are not authorized to accept the General Terms on behalf of the Customer, do not download, install, access, or use any of the Offerings. -See the General Terms Definitions Exhibit attached for definitions of capitalized terms not defined herein. +See the General Terms Definitions Exhibit attached for definitions of capitalized terms not defined herein. 1. License Rights -(A) General Rights. You have the nonexclusive, worldwide, nontransferable and nonsublicensable right, subject to payment of applicable Fees and compliance with the terms of these General Terms, to use your Purchased Offerings for your Internal Business Purposes during the Term and up to the Capacity purchased. +(A) General Rights. You have the nonexclusive, worldwide, nontransferable and nonsublicensable right, subject to payment of applicable Fees and compliance with the terms of these General Terms, to use your Purchased Offerings for your Internal Business Purposes during the Term and up to the Capacity purchased. (B) Copies for On-Premises Products. You have the right to make a reasonable number of copies of On-Premises Products for archival and back-up purposes. -(C) Splunk Extensions. You may use Splunk Extensions solely in connection with the applicable Purchased Offering subject to the same terms and conditions for that Offering (including with respect to Term) and payment of any Fees associated with the Splunk Extensions. Some Splunk Extensions may be made available under license terms that provide broader rights than the license rights you have to the applicable underlying Offering (e.g., if the Extension is Open Source Software). These broader rights will apply to that Splunk Extension. Splunk Extensions may be installed on Hosted Services pursuant to our instructions. +(C) Splunk Extensions. You may use Splunk Extensions solely in connection with the applicable Purchased Offering subject to the same terms and conditions for that Offering (including with respect to Term) and payment of any Fees associated with the Splunk Extensions. Some Splunk Extensions may be made available under license terms that provide broader rights than the license rights you have to the applicable underlying Offering (e.g., if the Extension is Open Source Software). These broader rights will apply to that Splunk Extension. Splunk Extensions may be installed on Hosted Services pursuant to our instructions. (D) Trials, Evaluations, Beta and Free Licenses. -(i) Trials and Evaluations. Offerings provided for trials and evaluations are provided at no charge, and their use will be for a limited duration. +(i) Trials and Evaluations. Offerings provided for trials and evaluations are provided at no charge, and their use will be for a limited duration. (ii) Beta Licenses. Some Offerings and features may be available to you as a preview, or as an alpha, beta or other pre-release version (each, a “Beta Offering”). All rights for Beta Offerings are solely for internal testing and evaluation. Your use of a Beta Offering will be for the term specified by us, and if no term is specified, then for the earlier of one year from the start date of the Beta Offering or when that version of the Beta Offering becomes generally available. We may discontinue the Beta Offering at any time and may decide not to make any of the features and functionality generally available. @@ -29,7 +29,7 @@ See the General Terms Definitions Exhibit attached for definitions of capitalize 2. Purchasing Through Authorized Resellers, Digital Marketplaces, and Splunk Affiliates (A) Authorized Resellers and Digital Marketplaces. If you purchase Offerings through a Splunk authorized reseller or Digital Marketplace, these General Terms will govern those Offerings. Your payment obligations for the Purchased Offerings will be with the authorized reseller or Digital Marketplace, as applicable, not Splunk. You will have no direct Fee payment obligations to Splunk for those Offerings. However, in the event that you fail to pay the Digital Marketplace for your Purchased Offerings, Splunk retains the right to enforce your payment obligations and collect directly from you. -Any terms agreed to between you and the authorized reseller that are in addition to these General Terms are solely between you and the authorized reseller and Digital Marketplace, as applicable. No agreement between you and an authorized reseller or Digital Marketplace is binding on Splunk or will have any force or effect with respect to the rights in, or the operation, use or provision of, the Offerings. +Any terms agreed to between you and the authorized reseller that are in addition to these General Terms are solely between you and the authorized reseller and Digital Marketplace, as applicable. No agreement between you and an authorized reseller or Digital Marketplace is binding on Splunk or will have any force or effect with respect to the rights in, or the operation, use or provision of, the Offerings. (B) Splunk Affiliate Distributors. Splunk has appointed certain Splunk Affiliates as its non-exclusive distributors of the Offerings (each, a “Splunk Affiliate Distributor”). Each Splunk Affiliate Distributor is authorized by Splunk to negotiate and enter into Orders with Customers. Where a purchase from Splunk is offered by a Splunk Affiliate Distributor, Customer will issue Orders, and make payments, to the Splunk Affiliate Distributor which issued the quote for the Offering. Each Order will be deemed a separate contract between Customer and the relevant Splunk Affiliate Distributor and will be subject to these General Terms. For the avoidance of doubt, Customer agrees that: (i) the total liability of Splunk under these General Terms as set forth in Section 22 (Limitation of Liability) states the overall combined liability of Splunk and Splunk Affiliate Distributors; (ii) the entering into Orders by a Splunk Affiliate Distributor will not be deemed to expand Splunk and its Affiliates’ overall responsibilities or liability under these General Terms; and (iii) Customer will have no right to recover more than once from the same event. @@ -59,7 +59,7 @@ Splunk offers standard services to implement and configure your Purchased Offeri Splunk will follow globally recognized data protection principles and industry-leading standards for the security of personal data. Splunk will comply with the requirements and obligations set forth in Splunk’s Data Protection Addendum (“DPA”), located at https://www.splunk.com/en_us/legal/splunk-dpa.html, which includes standard terms for the processing of personal data (including, as applicable, personal data in a Hosted Service). 8. Security -(A) Security for Hosted Services: Standard Environment. Splunk will implement industry leading security safeguards for the protection of Customer Confidential Information, including Customer Content transferred to and stored within the Hosted Services. These safeguards include commercially reasonable administrative, technical, and organizational measures to protect Customer Content against destruction, loss, alteration, unauthorized disclosure, or unauthorized access, including such things as information security policies and procedures, security awareness training, threat and vulnerability management, incident response and breach notification, and vendor risk management. Splunk’s technical safeguards are further described in the Splunk Cloud Platform Security Addendum (“SC-SA”), located at https://www.splunk.com/en_us/legal/splunk-cloud-security-addendum.html, and the Observability Suite Security Addendum (“OS-SA”), located at https://www.splunk.com/en_us/legal/splunk-observability-security-addendum.html, as applicable, and are incorporated herein by reference. +(A) Security for Hosted Services: Standard Environment. Splunk will implement industry leading security safeguards for the protection of Customer Confidential Information, including Customer Content transferred to and stored within the Hosted Services. These safeguards include commercially reasonable administrative, technical, and organizational measures to protect Customer Content against destruction, loss, alteration, unauthorized disclosure, or unauthorized access, including such things as information security policies and procedures, security awareness training, threat and vulnerability management, incident response and breach notification, and vendor risk management. Splunk’s technical safeguards are further described in the Splunk Cloud Platform Security Addendum (“SC-SA”), located at https://www.splunk.com/en_us/legal/splunk-cloud-security-addendum.html, and the Observability Suite Security Addendum (“OS-SA”), located at https://www.splunk.com/en_us/legal/splunk-observability-security-addendum.html, as applicable, and are incorporated herein by reference. (B) Security for Hosted Services: Premium HIPAA Environment. For Hosted Services Offerings provisioned in Splunk Cloud Platform’s Premium HIPAA environment (as specified in an Order), in addition to the protections under the SC-SA and these General Terms, Splunk will comply with the requirements and obligations set forth in Splunk Business Associate Agreement found here: https://www.splunk.com/en_us/legal/splunk-baa.html. @@ -72,7 +72,7 @@ Splunk will follow globally recognized data protection principles and industry-l (F) Maintaining Protections. Notwithstanding anything to contrary in these General Terms, or any policy or terms referenced herein via hyperlink (or any update thereto), Splunk may not, during a Term materially diminish the security protections set forth in these General Terms, any Specific Offering Terms, or the applicable security addendum. 9. Use Restrictions -Except as expressly permitted in an Order, these General Terms or our Documentation, you agree not to (nor allow any user or Third Party Provider to): (a) reverse engineer (except to the extent specifically permitted by statutory law), decompile, disassemble or otherwise attempt to discover source code or underlying structures, ideas or algorithms of any Offering; (b) modify, translate or create derivative works based on the Offerings; (c) use an Offering for service bureau purposes, or for any purpose other than your own Internal Business Purposes; (d) resell, transfer or distribute any Offering; (e) access or use any Offering in order to monitor its availability, performance, or functionality for competitive purposes; (f) attempt to disable or circumvent any license key or other technological mechanisms or measures intended to prevent, limit or control use or copying of, or access to, Offerings; (g) separately use any of the applicable features and functionalities of the Offerings with external applications or code not furnished by Splunk or any data not processed by the Offering; (h) exceed the Capacity purchased or (i) use any Offering in violation of all applicable laws and regulations (including but not limited to any applicable privacy and intellectual property laws). +Except as expressly permitted in an Order, these General Terms or our Documentation, you agree not to (nor allow any user or Third Party Provider to): (a) reverse engineer (except to the extent specifically permitted by statutory law), decompile, disassemble or otherwise attempt to discover source code or underlying structures, ideas or algorithms of any Offering; (b) modify, translate or create derivative works based on the Offerings; (c) use an Offering for service bureau purposes, or for any purpose other than your own Internal Business Purposes; (d) resell, transfer or distribute any Offering; (e) access or use any Offering in order to monitor its availability, performance, or functionality for competitive purposes; (f) attempt to disable or circumvent any license key or other technological mechanisms or measures intended to prevent, limit or control use or copying of, or access to, Offerings; (g) separately use any of the applicable features and functionalities of the Offerings with external applications or code not furnished by Splunk or any data not processed by the Offering; (h) exceed the Capacity purchased or (i) use any Offering in violation of all applicable laws and regulations (including but not limited to any applicable privacy and intellectual property laws). 10. Our Ethics, Compliance and Corporate Responsibility (A) Ethics and Corporate Responsibility. Splunk is committed to acting ethically and in compliance with applicable law, and we have policies and guidelines in place to provide awareness of, and compliance with, the laws and regulations that apply to our business globally. We are committed to ethical business conduct, and we use diligent efforts to perform in accordance with the highest global ethical principles, as described in the Splunk Code of Conduct and Ethics found here: https://investors.splunk.com/code-business-conduct-and-ethics-1. @@ -82,7 +82,7 @@ Except as expressly permitted in an Order, these General Terms or our Documentat (C) Export. We certify that Splunk is not on any of the relevant U.S. or EU government lists of prohibited persons, including the Treasury Department’s List of Specially Designated Nationals and the Commerce Department’s List of Denied Persons or Entity List. Export information regarding our Offerings, including our export control classifications for our Offerings, is found here: https://www.splunk.com/en_us/legal/export-controls.html. 11. Usage Data -From time to time, Splunk may collect Usage Data generated as a by-product of your use of Offerings (e.g., technical information about your operating environment and sessions, systems architecture, page loads and views, product versions, number and type of searches, number of users, source type and format). Usage Data does not include Customer Content. We collect Usage Data for a variety of reasons, such as to identify, understand, and anticipate performance issues and the factors that affect them, to provide updates and personalized experiences to customers, and to improve the Splunk Offerings. Details on Splunk’s Usage Data collection practices are set forth in Splunk's Privacy Policy found here: https://www.splunk.com/en_us/legal/privacy/privacy-policy.html. +From time to time, Splunk may collect Usage Data generated as a by-product of your use of Offerings (e.g., technical information about your operating environment and sessions, systems architecture, page loads and views, product versions, number and type of searches, number of users, source type and format). Usage Data does not include Customer Content. We collect Usage Data for a variety of reasons, such as to identify, understand, and anticipate performance issues and the factors that affect them, to provide updates and personalized experiences to customers, and to improve the Splunk Offerings. Details on Splunk’s Usage Data collection practices are set forth in Splunk's Privacy Policy found here: https://www.splunk.com/en_us/legal/privacy/privacy-policy.html. 12. Capacity and Usage Verification (A) Certification and Verification. At Splunk’s request, you will furnish Splunk a certification signed by your authorized representative verifying that your use of the Purchased Offering is in accordance with these General Terms and the applicable Order. For On-Premises Products, we may also ask you from time to time, but not more frequently than once per calendar period, to cooperate with us to verify usage and adherence to purchased Capacities. If Splunk requests a verification process, you agree to provide Splunk reasonable access to the On-Premises Product installed at your facility (or as hosted by your Third-Party Provider). If Splunk does any verification, it will be performed with as little interference as possible to your use of the On-Premises Product and your business operations. Splunk will comply with your (or your Third-Party Providers’) reasonable security procedures. @@ -118,7 +118,7 @@ You have a nonexclusive, worldwide, nontransferable, nonsublicensable right, sub (E) Acceptable Use. Without limiting any terms under these General Terms, you will also abide by our Hosted Services acceptable use policy: https://www.splunk.com/view/SP-CAAAMB6. 17. Confidentiality -(A) Confidential Information. Each party will protect the Confidential Information of the other. Accordingly, Receiving Party agrees to: (i) protect the Disclosing Party’s Confidential Information using the same degree of care (but in no event less than reasonable care) that it uses to protect its own Confidential Information of a similar nature; (ii) limit use of Disclosing Party’s Confidential Information for purposes consistent with these General Terms, and (iii) use commercially reasonable efforts to limit access to Disclosing Party’s Confidential Information to its employees, contractors and agents or those of its Affiliates who have a bona fide need to access such Confidential Information for purposes consistent with these General Terms and who are subject to confidentiality obligations no less stringent than those herein. +(A) Confidential Information. Each party will protect the Confidential Information of the other. Accordingly, Receiving Party agrees to: (i) protect the Disclosing Party’s Confidential Information using the same degree of care (but in no event less than reasonable care) that it uses to protect its own Confidential Information of a similar nature; (ii) limit use of Disclosing Party’s Confidential Information for purposes consistent with these General Terms, and (iii) use commercially reasonable efforts to limit access to Disclosing Party’s Confidential Information to its employees, contractors and agents or those of its Affiliates who have a bona fide need to access such Confidential Information for purposes consistent with these General Terms and who are subject to confidentiality obligations no less stringent than those herein. (B) Compelled Disclosure of Confidential Information. Notwithstanding the foregoing terms, the Receiving Party may disclose Confidential Information of the Disclosing Party if it is compelled by law enforcement agencies or regulators to do so, provided the Receiving Party gives the Disclosing Party prior notice of such compelled disclosure (to the extent legally permitted) and reasonable assistance, at the Disclosing Party's cost, if the Disclosing Party wishes to contest the disclosure. If the Receiving Party is compelled to disclose the Disclosing Party’s Confidential Information as part of a civil proceeding to which the Disclosing Party is a Party, and the Disclosing Party is not contesting the disclosure, the Disclosing Party will reimburse the Receiving Party for its reasonable cost of compiling and providing secure access to such Confidential Information. @@ -132,7 +132,7 @@ The payment terms below only apply when you purchase Offerings directly from Spl (C) Taxes. All Fees quoted are exclusive of applicable taxes and duties, including any applicable sales and use tax. You are responsible for paying any taxes or similar government assessments (including, without limitation, value-added, sales, use or withholding taxes). We will be solely responsible for taxes assessable against us based on our net income, property, and employees. 19. Splunk’s Warranties -(A) Relationship to Applicable Law. We will not seek to limit our liability, or any of your warranties, rights and remedies, to the extent the limits are not permitted by applicable law (e.g., warranties, remedies or liabilities that cannot be excluded by applicable law). +(A) Relationship to Applicable Law. We will not seek to limit our liability, or any of your warranties, rights and remedies, to the extent the limits are not permitted by applicable law (e.g., warranties, remedies or liabilities that cannot be excluded by applicable law). (B) General Corporate Warranty. Splunk warrants that it has the legal power and authority to enter into these General Terms. @@ -176,7 +176,7 @@ The foregoing disclaimers of damages will also not apply to the extent prohibite (C) Mutual Indemnity. Each party will defend, indemnify and pay all damages (including attorneys’ fees and costs) awarded against the other party, or that are agreed to in a settlement to the extent that an action brought against the other party by a third party is based upon a claim for bodily injury (including death) to any person, or damage to tangible property resulting from the negligent acts or willful misconduct of the indemnifying party or its personnel hereunder, and will pay any reasonable, direct, out-of-pocket costs, damages and reasonable attorneys’ fees attributable to such claim that are awarded against the indemnified party (or are payable in settlement by the indemnified party). -(D) Process for Indemnification. The indemnification obligations above are subject to the party seeking indemnification to: (i) provide the other party with prompt written notice of the specific claim; (ii) give the indemnifying party sole control of the defense and settlement of the claim (except that the indemnifying party may not settle any claim that requires any action or forbearance on the indemnified party’s part without their prior consent, which will not unreasonably withhold or delay); and (iii) gives the indemnifying party all reasonable assistance, at such party’s expense. +(D) Process for Indemnification. The indemnification obligations above are subject to the party seeking indemnification to: (i) provide the other party with prompt written notice of the specific claim; (ii) give the indemnifying party sole control of the defense and settlement of the claim (except that the indemnifying party may not settle any claim that requires any action or forbearance on the indemnified party’s part without their prior consent, which will not unreasonably withhold or delay); and (iii) gives the indemnifying party all reasonable assistance, at such party’s expense. 24. Updates to Offerings Our Offerings and policies may be updated over the course of our relationship. From time to time, Splunk may update or modify an Offering and our policies, provided that: (a) the change and modification applies to all customers generally, and are not targeted to any particular customer; (b) no such change or modification will impose additional fees on you during the applicable Term or additional restrictions on your use of the Offering, (c) no such change will override or supersede the allocation of risk between us under these General Terms, including without limitation the terms under Sections 22 (Limitation of Liability) and 23 (Indemnity); (d) no such change or modification will materially reduce the security protections or overall functionality of the applicable Offering; and (e) any such change or modification will apply only prospectively, and will not apply to any breach or dispute that arose between the parties prior to the effective date of the change or modification. In the event of any conflict between these General Terms and the policies incorporated herein by reference, these General Terms will control. @@ -187,10 +187,10 @@ These General Terms will be governed by and construed in accordance with the law Neither the Uniform Computer Information Transactions Act nor the United Nations Convention for the International Sale of Goods will apply to these General Terms. 26. Use of Customer Name -You agree that we may add your name to our customer list and identify you as a Splunk customer on Splunk’s websites. Any further public use of your name in connection with Splunk marketing activities (e.g., press releases) will require your prior approval. +You agree that we may add your name to our customer list and identify you as a Splunk customer on Splunk’s websites. Any further public use of your name in connection with Splunk marketing activities (e.g., press releases) will require your prior approval. 27. Miscellaneous -(A) Different Terms. Splunk expressly rejects terms or conditions in any Customer purchase order or other similar document that are different from or additional to the terms and conditions set forth in these General Terms. Such different or additional terms and conditions will not become a part of the agreement between the parties notwithstanding any subsequent acknowledgement, invoice or license key that Splunk may issue. +(A) Different Terms. Splunk expressly rejects terms or conditions in any Customer purchase order or other similar document that are different from or additional to the terms and conditions set forth in these General Terms. Such different or additional terms and conditions will not become a part of the agreement between the parties notwithstanding any subsequent acknowledgement, invoice or license key that Splunk may issue. (B) No Future Functionality. You agree that your purchase of any Offering is not contingent on the delivery of any future functionality or features, or dependent on any oral or written statements made by Splunk regarding future functionality or features. @@ -273,7 +273,7 @@ General Terms Definitions Exhibit “Third-Party Content” means information, data, technology, or materials made available to you by any third party that you license and add to a Hosted Service or direct Splunk to install in connection with a Hosted Service. Third-Party Content includes but is not limited to, Third-Party Extensions, web-based or offline software applications, data service or content that are provided by third parties. -“Usage Data” means data generated from the usage, configuration, deployment, access, and performance of an Offering. For example, this may include such things as information about your operating environment, such as your network and systems architecture, or sessions, such as page loads and session views, duration, or interactions, errors, number of searches, source types and format (e.g., json, xml, csv), ingest volume, number of active and licensed users, or search concurrency. Usage Data does not include Customer Content. +“Usage Data” means data generated from the usage, configuration, deployment, access, and performance of an Offering. For example, this may include such things as information about your operating environment, such as your network and systems architecture, or sessions, such as page loads and session views, duration, or interactions, errors, number of searches, source types and format (e.g., json, xml, csv), ingest volume, number of active and licensed users, or search concurrency. Usage Data does not include Customer Content. Support Exhibit to Splunk General Terms @@ -313,7 +313,7 @@ Should we determine that an Offering has a defect, we will, at our sole option, Should you report a purported defect or error in an Offering, we may require you to provide us with the following information: (a) a general description of your operating environment; (b) a list of all hardware components, operating systems and networks; (c) a reproducible test case; and (d) any log files, trace and systems files. Your failure to provide this information may prevent us from identifying and fixing that purported defect. 10. Changes to Support Programs -You acknowledge that, subject to the Support Policy, and subject to any commitment we have during the Term, we have the right to discontinue the manufacture, development, sale or support of any Offering, at any time, in our sole discretion. We further reserve the right to alter Support Programs from time to time, using reasonable discretion, but in no event will such alterations, during the Term of any Order, result in diminished Support Services from the level of your applicable purchased Support Program. +You acknowledge that, subject to the Support Policy, and subject to any commitment we have during the Term, we have the right to discontinue the manufacture, development, sale or support of any Offering, at any time, in our sole discretion. We further reserve the right to alter Support Programs from time to time, using reasonable discretion, but in no event will such alterations, during the Term of any Order, result in diminished Support Services from the level of your applicable purchased Support Program. Configuration and Implementation Services Exhibit to Splunk General Terms @@ -328,11 +328,11 @@ We will perform the C&I Services for you that are set forth in the applicable St In each Statement of Work, we will designate our primary point of contact for you for all matters relating to the applicable C&I Services (which we may change from time to time upon notice). 2. Our Personnel -(A) Qualifications. The Personnel we assign to perform the C&I Services will be qualified, skilled, experienced and otherwise fit for the performance of the C&I Services. If you, in your reasonable judgement, determine that Personnel assigned to your project are unfit, we will in good faith discuss alternatives, and we will replace Personnel as reasonably necessary. You acknowledge that any replacement may cause delay in the performance of the C&I Services. +(A) Qualifications. The Personnel we assign to perform the C&I Services will be qualified, skilled, experienced and otherwise fit for the performance of the C&I Services. If you, in your reasonable judgement, determine that Personnel assigned to your project are unfit, we will in good faith discuss alternatives, and we will replace Personnel as reasonably necessary. You acknowledge that any replacement may cause delay in the performance of the C&I Services. (B) Personnel Conduct. Our Personnel are subject to our Splunk Code of Conduct and Ethics https://investors.splunk.com/code-business-conduct-and-ethics-1, which includes, without limitation, an obligation to comply with our policies on protecting customer information, prohibitions on illegal drugs and any impaired job performance, avoiding conflicts of interest, and acting ethically at all times. We also background check our employees, per the Section below. -(C) Use of Subcontractors. We reserve the right to use subcontractors in performance of the C&I Services, provided: (a) any subcontractor we use meets the requirements herein and conditions of these General Terms and the Statement of Work; (b) we will be responsible for the subcontractor’s compliance with the terms herein and the Statement of Work; and (c) upon your request or inquiry, we will identify any subcontractor that we are using, or plan to use, for C&I Services, and will cooperate in good faith to provide you with all relevant information regarding such subcontractors. +(C) Use of Subcontractors. We reserve the right to use subcontractors in performance of the C&I Services, provided: (a) any subcontractor we use meets the requirements herein and conditions of these General Terms and the Statement of Work; (b) we will be responsible for the subcontractor’s compliance with the terms herein and the Statement of Work; and (c) upon your request or inquiry, we will identify any subcontractor that we are using, or plan to use, for C&I Services, and will cooperate in good faith to provide you with all relevant information regarding such subcontractors. (D) No Employee Benefits. We acknowledge and agree that our Personnel are not eligible for or entitled to receive any compensation, benefits, or other incidents of employment that you make available to your employees. We are solely responsible for all employment related taxes, expenses, withholdings, and other similar statutory obligations arising out of the relationship between us and our Personnel and the performance of C&I Services by such Personnel. @@ -385,7 +385,7 @@ Configuration and Implementation Services Definitions Exhibit “C&I Services” means the services outlined in the Statement of Work. -“C&I Services Materials” means the materials and other deliverables that are provided to you as part of the C&I Services, and any materials, technology, know-how and other innovations of any kind that we or our Personnel may create or reduce to practice in the course of performing the C&I Services, including without limitation all improvements or modifications to our proprietary technology, and all Intellectual Property Rights therein. +“C&I Services Materials” means the materials and other deliverables that are provided to you as part of the C&I Services, and any materials, technology, know-how and other innovations of any kind that we or our Personnel may create or reduce to practice in the course of performing the C&I Services, including without limitation all improvements or modifications to our proprietary technology, and all Intellectual Property Rights therein. “Customer Materials” means the data, information, and materials you provide to us in connection with your use of the C&I Services. @@ -397,4 +397,4 @@ Configuration and Implementation Services Definitions Exhibit “Splunk Preexisting IP” means, with respect to any C&I Services Materials, all associated Splunk technology and all Intellectual Property Rights created or acquired: (a) prior to the date of the Statement of Work that includes such C&I Services Materials, or (b) after the date of such Statement of Work but independently of the C&I Services provided under such Statement of Work. -“Statement of Work” means the statements of work and/or any and all applicable Orders, that describe the specific services to be performed by Splunk, including any materials and deliverables to be delivered by Splunk. \ No newline at end of file +“Statement of Work” means the statements of work and/or any and all applicable Orders, that describe the specific services to be performed by Splunk, including any materials and deliverables to be delivered by Splunk. diff --git a/README-test.md b/README-test.md index 7cc8ec17..6f78e43b 100644 --- a/README-test.md +++ b/README-test.md @@ -152,4 +152,4 @@ Password is "secret" Install [splunk-add-on-for-modinput-test](https://github.com/splunk/splunk-add-on-for-modinput-test/releases/latest/) addon in splunk and set all variables in environment mentioned at [test_credentials.env](test_credentials.env) file with appropriate values encoded with base64 or add variables in pytest command mentioned in conftest file. ```bash pytest -vv --username= --password= --splunk-url= --remote -``` \ No newline at end of file +``` diff --git a/README.md b/README.md index 103e2bd9..a645fccf 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ pip install https://download.splunk.com/misc/appinspect/splunk-appinspect-latest ## Test -Using docker +Using docker ```bash pytest diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml index a3748e26..5fdc1dd3 100644 --- a/docker-compose-ci.yml +++ b/docker-compose-ci.yml @@ -132,7 +132,7 @@ services: hostname: sauceconnect ports: - "4445" - + http_proxy: build: context: . diff --git a/docker-compose.yml b/docker-compose.yml index 283a83c9..1e3f73c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -165,7 +165,7 @@ services: - SPLUNK_START_ARGS=--accept-license volumes: - results:/home/circleci/work - + chrome-grid: image: selenium/standalone-chrome-debug:91.0 shm_size: 2gb @@ -184,4 +184,4 @@ volumes: results: external: false backend_results: - external: false \ No newline at end of file + external: false diff --git a/globalConfig.json b/globalConfig.json index d21d3b58..df391cee 100644 --- a/globalConfig.json +++ b/globalConfig.json @@ -1048,4 +1048,4 @@ "version": "4.0.2ac400e0a", "displayName": "Splunk UCC test Add-on" } -} \ No newline at end of file +} diff --git a/package/README/restmap.conf.spec b/package/README/restmap.conf.spec index e63d7773..9fd0305d 100644 --- a/package/README/restmap.conf.spec +++ b/package/README/restmap.conf.spec @@ -9,4 +9,4 @@ python.version = {default|python|python2|python3} * For Splunk 8.0.x and Python scripts only, selects which Python version to use. * Either "default" or "python" select the system-wide default Python version. * Optional. -* Default: not set; uses the system-wide Python version. \ No newline at end of file +* Default: not set; uses the system-wide Python version. diff --git a/package/default/alert_actions.conf b/package/default/alert_actions.conf index cc7cedd8..74fb5274 100644 --- a/package/default/alert_actions.conf +++ b/package/default/alert_actions.conf @@ -13,8 +13,7 @@ icon_path = test_alert.png is_custom = 1 payload_format = json param.name = xyz -param.all_incidents = +param.all_incidents = param.table_list = problem param.action = two -param.account = - +param.account = diff --git a/test_credentials.env b/test_credentials.env index f93a1675..7bb1bef7 100644 --- a/test_credentials.env +++ b/test_credentials.env @@ -3,4 +3,4 @@ ## SPDX-License-Identifier: LicenseRef-Splunk-8-2021 ## ## -# Add Addon specific Environment variables in this file. Variables must be set in CircleCI Environment." \ No newline at end of file +# Add Addon specific Environment variables in this file. Variables must be set in CircleCI Environment." diff --git a/tests/entrypoint.sh b/tests/entrypoint.sh index 2eeef6e9..9af3b255 100755 --- a/tests/entrypoint.sh +++ b/tests/entrypoint.sh @@ -31,18 +31,18 @@ cp -f .pytest.expect ${TEST_SET} echo "Executing Tests..." RERUN_COUNT=${RERUN_COUNT:-1} -if [ -z ${TEST_BROWSER} ] +if [ -z ${TEST_BROWSER} ] then # echo Test Args $@ ${TEST_DEBUG} --reportportal -o "rp_endpoint=${RP_ENDPOINT}" -o "rp_launch_attributes=${RP_LAUNCH_ATTRIBUTES}" \ # -o "rp_project=${RP_PROJECT}" -o "rp_launch=${RP_LAUNCH}" -o "rp_launch_description='${RP_LAUNCH_DESC}'" -o "rp_ignore_attributes='xfail' 'usefixture'" \ - # ${TEST_SET} - echo Test Args $@ ${TEST_DEBUG} - ${TEST_SET} - + # ${TEST_SET} + echo Test Args $@ ${TEST_DEBUG} + ${TEST_SET} + if [ "${IMAGE_TAG}" = "2.7.17" ] then pytest $@ ${TEST_DEBUG} \ - ${TEST_SET} + ${TEST_SET} test_exit_code=$? else # pytest $@ ${TEST_DEBUG} \ @@ -65,15 +65,15 @@ else # echo Test Args $@ ${TEST_DEBUG} --local --persist-browser --headless --reruns=${RERUN_COUNT} --browser=${TEST_BROWSER}\ # --reportportal -o "rp_endpoint=${RP_ENDPOINT}" -o "rp_launch_attributes=${RP_LAUNCH_ATTRIBUTES}" \ # -o "rp_project=${RP_PROJECT}" -o "rp_launch=${RP_LAUNCH}" -o "rp_launch_description='${RP_LAUNCH_DESC}'" -o "rp_ignore_attributes='xfail' 'usefixture'" \ - # ${TEST_SET} - + # ${TEST_SET} + # pytest $@ ${TEST_DEBUG} --local --persist-browser --headless --reruns=${RERUN_COUNT} --browser=${TEST_BROWSER} \ # --reportportal -o "rp_endpoint=${RP_ENDPOINT}" -o "rp_launch_attributes=${RP_LAUNCH_ATTRIBUTES}" \ # -o "rp_project=${RP_PROJECT}" -o "rp_launch=${RP_LAUNCH}" -o "rp_launch_description='${RP_LAUNCH_DESC}'" -o "rp_ignore_attributes='xfail' 'usefixture'" \ # ${TEST_SET} pytest $@ ${TEST_DEBUG} --local --persist-browser --headless --reruns=${RERUN_COUNT} --browser=${TEST_BROWSER} \ ${TEST_SET} - + test_exit_code=$? else echo "Check Saucelab connection..." @@ -91,4 +91,4 @@ else test_exit_code=$? fi fi -exit "$test_exit_code" \ No newline at end of file +exit "$test_exit_code" diff --git a/tests/knowledge/conftest.py b/tests/knowledge/conftest.py index 4eb25c3d..afe730ec 100644 --- a/tests/knowledge/conftest.py +++ b/tests/knowledge/conftest.py @@ -5,6 +5,7 @@ # import os import pytest + pytest_plugins = "pytester" @@ -13,7 +14,6 @@ def pytest_configure(config): config.addinivalue_line("markers", "docker: Test search time only") - @pytest.fixture(scope="session") def docker_compose_files(request): """ @@ -27,6 +27,6 @@ def docker_compose_files(request): docker_compose_path = os.path.join( str(request.config.invocation_dir), "docker-compose.yml" ) - #LOGGER.info("docker-compose path: %s", docker_compose_path) + # LOGGER.info("docker-compose path: %s", docker_compose_path) - return [docker_compose_path] \ No newline at end of file + return [docker_compose_path] diff --git a/tests/ui/Example_UccLib/__init__.py b/tests/ui/Example_UccLib/__init__.py index 0a63b582..79677e45 100644 --- a/tests/ui/Example_UccLib/__init__.py +++ b/tests/ui/Example_UccLib/__init__.py @@ -2,4 +2,4 @@ # SPDX-FileCopyrightText: 2020 Splunk, Inc. # SPDX-License-Identifier: LicenseRef-Splunk-8-2021 # -# \ No newline at end of file +# diff --git a/tests/ui/Example_UccLib/account.py b/tests/ui/Example_UccLib/account.py index 49eefa72..678f759c 100644 --- a/tests/ui/Example_UccLib/account.py +++ b/tests/ui/Example_UccLib/account.py @@ -22,63 +22,144 @@ from pytest_splunk_addon_ui_smartx.backend_confs import ListBackendConf from selenium.webdriver.common.by import By + class AccountEntity(Entity): """ Form to configure a new Server """ + def __init__(self, browser, container): """ - :param browser: The selenium webdriver - :param container: The container in which the entity is located in + :param browser: The selenium webdriver + :param container: The container in which the entity is located in """ - add_btn = Button(browser, Selector(select=container.select + ' button[data-test="button"][label="Add"]')) + add_btn = Button( + browser, + Selector( + select=container.select + ' button[data-test="button"][label="Add"]' + ), + ) entity_container = Selector(select='[data-test="modal"]') - + super(AccountEntity, self).__init__(browser, entity_container, add_btn=add_btn) # Controls - self.name = TextBox(browser, Selector(select='[data-test="control-group"][data-name="name"]')) - self.environment = SingleSelect(browser, Selector(select='[data-test="control-group"][data-name="custom_endpoint"]'), False) - self.account_radio = Toggle(browser, Selector(select='[data-test="control-group"][data-name="account_radio"]')) - self.example_checkbox = Checkbox(browser, Selector(select='[data-test="control-group"][data-name="account_checkbox"]')) - self.multiple_select = MultiSelect(browser, Selector(select='[data-test="control-group"][data-name="account_multiple_select"]')) - self.auth_key = OAuthSelect(browser, Selector(select='[data-test="control-group"][data-name="auth_type"]')) - self.username = TextBox(browser, Selector(select='[data-test="control-group"][data-name="username"]')) - self.password = TextBox(browser, Selector(select='[data-test="control-group"][data-name="password"]')) - self.security_token = TextBox(browser, Selector(select='[data-test="control-group"][data-name="token"]')) - self.client_id = TextBox(browser, Selector(select='[data-test="control-group"][data-name="client_id"]')) - self.client_secret = TextBox(browser, Selector(select='[data-test="control-group"][data-name="client_secret"]')) - self.redirect_url = TextBox(browser, Selector(select='[data-test="control-group"][data-name="redirect_url"]')) - self.search_query = TextBox(browser, Selector(select='[data-test="textbox"][role="textbox"]')) - self.help_link = LearnMore(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="example_help_link"]')) - self.title = BaseComponent(browser, Selector(select= '[data-test="title"]')) - + self.name = TextBox( + browser, Selector(select='[data-test="control-group"][data-name="name"]') + ) + self.environment = SingleSelect( + browser, + Selector(select='[data-test="control-group"][data-name="custom_endpoint"]'), + False, + ) + self.account_radio = Toggle( + browser, + Selector(select='[data-test="control-group"][data-name="account_radio"]'), + ) + self.example_checkbox = Checkbox( + browser, + Selector( + select='[data-test="control-group"][data-name="account_checkbox"]' + ), + ) + self.multiple_select = MultiSelect( + browser, + Selector( + select='[data-test="control-group"][data-name="account_multiple_select"]' + ), + ) + self.auth_key = OAuthSelect( + browser, + Selector(select='[data-test="control-group"][data-name="auth_type"]'), + ) + self.username = TextBox( + browser, + Selector(select='[data-test="control-group"][data-name="username"]'), + ) + self.password = TextBox( + browser, + Selector(select='[data-test="control-group"][data-name="password"]'), + ) + self.security_token = TextBox( + browser, Selector(select='[data-test="control-group"][data-name="token"]') + ) + self.client_id = TextBox( + browser, + Selector(select='[data-test="control-group"][data-name="client_id"]'), + ) + self.client_secret = TextBox( + browser, + Selector(select='[data-test="control-group"][data-name="client_secret"]'), + ) + self.redirect_url = TextBox( + browser, + Selector(select='[data-test="control-group"][data-name="redirect_url"]'), + ) + self.search_query = TextBox( + browser, Selector(select='[data-test="textbox"][role="textbox"]') + ) + self.help_link = LearnMore( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="example_help_link"]' + ), + ) + self.title = BaseComponent(browser, Selector(select='[data-test="title"]')) + + class AccountPage(Page): """ Page: Server page """ - def __init__(self, ucc_smartx_selenium_helper=None, ucc_smartx_rest_helper=None, open_page=True): + + def __init__( + self, + ucc_smartx_selenium_helper=None, + ucc_smartx_rest_helper=None, + open_page=True, + ): """ - :param ucc_smartx_selenium_helper: smartx configuration fixture + :param ucc_smartx_selenium_helper: smartx configuration fixture """ - super(AccountPage, self).__init__(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page) + super(AccountPage, self).__init__( + ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page + ) account_container = Selector(select='div[id="accountTab"]') - + if ucc_smartx_selenium_helper: - self.title = Message(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="column"] .pageTitle')) - self.description = Message(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="column"] .pageSubtitle')) - self.table = ConfigurationTable(ucc_smartx_selenium_helper.browser, account_container) - self.entity = AccountEntity(ucc_smartx_selenium_helper.browser, account_container) - + self.title = Message( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="column"] .pageTitle'), + ) + self.description = Message( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="column"] .pageSubtitle'), + ) + self.table = ConfigurationTable( + ucc_smartx_selenium_helper.browser, account_container + ) + self.entity = AccountEntity( + ucc_smartx_selenium_helper.browser, account_container + ) + if ucc_smartx_rest_helper: - self.backend_conf = ListBackendConf(self._get_account_endpoint(), ucc_smartx_rest_helper.username, ucc_smartx_rest_helper.password) + self.backend_conf = ListBackendConf( + self._get_account_endpoint(), + ucc_smartx_rest_helper.username, + ucc_smartx_rest_helper.password, + ) def open(self): """ Open the required page. Page(super) class opens the page by default. """ - self.browser.get('{}/en-US/app/Splunk_TA_UCCExample/configuration'.format(self.splunk_web_url)) + self.browser.get( + "{}/en-US/app/Splunk_TA_UCCExample/configuration".format( + self.splunk_web_url + ) + ) tab = Tab(self.browser) tab.open_tab("account") @@ -86,4 +167,6 @@ def _get_account_endpoint(self): """ Get rest endpoint for the configuration """ - return '{}/servicesNS/nobody/Splunk_TA_UCCExample/splunk_ta_uccexample_account'.format(self.splunk_mgmt_url) \ No newline at end of file + return "{}/servicesNS/nobody/Splunk_TA_UCCExample/splunk_ta_uccexample_account".format( + self.splunk_mgmt_url + ) diff --git a/tests/ui/Example_UccLib/alert_action.py b/tests/ui/Example_UccLib/alert_action.py index ff4ffec2..34980198 100644 --- a/tests/ui/Example_UccLib/alert_action.py +++ b/tests/ui/Example_UccLib/alert_action.py @@ -6,10 +6,16 @@ from pytest_splunk_addon_ui_smartx.backend_confs import ListBackendConf from pytest_splunk_addon_ui_smartx.alert_actions import AlertEntity, ActionEntity from pytest_splunk_addon_ui_smartx.alert_actions.components.textbox import AlertTextBox -from pytest_splunk_addon_ui_smartx.alert_actions.components.checkbox import AlertCheckbox -from pytest_splunk_addon_ui_smartx.alert_actions.components.single_select import AlertSingleSelect +from pytest_splunk_addon_ui_smartx.alert_actions.components.checkbox import ( + AlertCheckbox, +) +from pytest_splunk_addon_ui_smartx.alert_actions.components.single_select import ( + AlertSingleSelect, +) from pytest_splunk_addon_ui_smartx.alert_actions.components.toggle import AlertToggle -from pytest_splunk_addon_ui_smartx.alert_actions.components.account_select import AlertAccountSelect +from pytest_splunk_addon_ui_smartx.alert_actions.components.account_select import ( + AlertAccountSelect, +) from pytest_splunk_addon_ui_smartx.alert_actions.components.table import AlertTable from selenium.webdriver.common.by import By @@ -19,36 +25,62 @@ class TestAction(ActionEntity): """ Form to configure a new Input """ + def __init__(self, browser): """ - :param browser: The selenium webdriver - :param container: The container in which the entity is located in + :param browser: The selenium webdriver + :param container: The container in which the entity is located in """ - + super(TestAction, self).__init__(browser) # Controls - self.name = AlertTextBox(browser, Selector(select="#test_alert_name"), use_child_input=True) - self.all_incident = AlertCheckbox(browser, Selector(select="#test_alert_all_incidents")) - self.table_list = AlertSingleSelect(browser, Selector(select="#test_alert_table_list")) - self.action = AlertToggle(browser, Selector(select='input[name="action.test_alert.param.action"]')) - self.account = AlertAccountSelect(browser, Selector(select='#test_alert_account')) + self.name = AlertTextBox( + browser, Selector(select="#test_alert_name"), use_child_input=True + ) + self.all_incident = AlertCheckbox( + browser, Selector(select="#test_alert_all_incidents") + ) + self.table_list = AlertSingleSelect( + browser, Selector(select="#test_alert_table_list") + ) + self.action = AlertToggle( + browser, Selector(select='input[name="action.test_alert.param.action"]') + ) + self.account = AlertAccountSelect( + browser, Selector(select="#test_alert_account") + ) + class AlertPage(Page): - def __init__(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page=True): - super(AlertPage, self).__init__(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page) + def __init__( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page=True + ): + super(AlertPage, self).__init__( + ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page + ) if ucc_smartx_selenium_helper: self.alert_table = AlertTable(ucc_smartx_selenium_helper.browser) - self.alert_entity = AlertEntity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + self.alert_entity = AlertEntity( + ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ) self.action_entity = TestAction(ucc_smartx_selenium_helper.browser) if ucc_smartx_rest_helper: - self.backend_conf = ListBackendConf(self._get_alert_endpoint(), ucc_smartx_rest_helper.username, ucc_smartx_rest_helper.password) + self.backend_conf = ListBackendConf( + self._get_alert_endpoint(), + ucc_smartx_rest_helper.username, + ucc_smartx_rest_helper.password, + ) def open(self): """ Abstract Method. Open the page """ - self.browser.get(self.splunk_web_url + "/en-US/manager/Splunk_TA_UCCExample/saved/searches") + self.browser.get( + self.splunk_web_url + "/en-US/manager/Splunk_TA_UCCExample/saved/searches" + ) def _get_alert_endpoint(self): - return '{}/servicesNS/admin/Splunk_TA_UCCExample/saved/searches/'.format(self.splunk_mgmt_url) + return "{}/servicesNS/admin/Splunk_TA_UCCExample/saved/searches/".format( + self.splunk_mgmt_url + ) diff --git a/tests/ui/Example_UccLib/custom.py b/tests/ui/Example_UccLib/custom.py index c9268bfc..46bed9e1 100644 --- a/tests/ui/Example_UccLib/custom.py +++ b/tests/ui/Example_UccLib/custom.py @@ -1,4 +1,3 @@ - # # SPDX-FileCopyrightText: 2020 Splunk, Inc. # SPDX-License-Identifier: LicenseRef-Splunk-8-2021 @@ -17,39 +16,86 @@ class Custom(Entity): - - def __init__(self, ucc_smartx_selenium_helper=None, ucc_smartx_rest_helper=None, open_page=True): + def __init__( + self, + ucc_smartx_selenium_helper=None, + ucc_smartx_rest_helper=None, + open_page=True, + ): """ - :param ucc_smartx_selenium_helper: fixture contains browser, urls and session key + :param ucc_smartx_selenium_helper: fixture contains browser, urls and session key """ entity_container = Selector(select='div[id="custom_tabTab"]') # Components if ucc_smartx_selenium_helper: - super(Custom, self).__init__(ucc_smartx_selenium_helper.browser, entity_container) + super(Custom, self).__init__( + ucc_smartx_selenium_helper.browser, entity_container + ) self.splunk_web_url = ucc_smartx_selenium_helper.splunk_web_url - self.open() - self.test_string = TextBox(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_string"]')) - self.test_number = TextBox(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_number"]')) - self.test_regex = TextBox(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_regex"]')) - self.test_email = TextBox(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_email"]')) - self.test_ipv4 = TextBox(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_ipv4"]')) - self.test_date = TextBox(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_date"]')) - self.test_url = TextBox(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_url"]')) - self.test_radio = Toggle(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_radio"]')) - self.test_multiselect = MultiSelect(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_multiselect"]')) - self.test_help_link = LearnMore(ucc_smartx_selenium_helper.browser, Selector(select='[data-test="control-group"][data-name="test_help_link"]')) + self.open() + self.test_string = TextBox( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_string"]'), + ) + self.test_number = TextBox( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_number"]'), + ) + self.test_regex = TextBox( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_regex"]'), + ) + self.test_email = TextBox( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_email"]'), + ) + self.test_ipv4 = TextBox( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_ipv4"]'), + ) + self.test_date = TextBox( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_date"]'), + ) + self.test_url = TextBox( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_url"]'), + ) + self.test_radio = Toggle( + ucc_smartx_selenium_helper.browser, + Selector(select='[data-test="control-group"][data-name="test_radio"]'), + ) + self.test_multiselect = MultiSelect( + ucc_smartx_selenium_helper.browser, + Selector( + select='[data-test="control-group"][data-name="test_multiselect"]' + ), + ) + self.test_help_link = LearnMore( + ucc_smartx_selenium_helper.browser, + Selector( + select='[data-test="control-group"][data-name="test_help_link"]' + ), + ) if ucc_smartx_rest_helper: - self.splunk_mgmt_url = ucc_smartx_rest_helper.splunk_mgmt_url - self.backend_conf = SingleBackendConf(self._get_custom_url(), ucc_smartx_rest_helper.username, ucc_smartx_rest_helper.password) + self.splunk_mgmt_url = ucc_smartx_rest_helper.splunk_mgmt_url + self.backend_conf = SingleBackendConf( + self._get_custom_url(), + ucc_smartx_rest_helper.username, + ucc_smartx_rest_helper.password, + ) def open(self): """ Open the required page. Page(super) class opens the page by default. """ self.browser.get( - '{}/en-US/app/Splunk_TA_UCCExample/configuration'.format(self.splunk_web_url)) + "{}/en-US/app/Splunk_TA_UCCExample/configuration".format( + self.splunk_web_url + ) + ) tab = Tab(self.browser) tab.open_tab("custom_tab") @@ -57,4 +103,6 @@ def _get_custom_url(self): """ get rest endpoint for the configuration """ - return '{}/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-splunk_ta_uccexample_settings/custom_tab'.format(self.splunk_mgmt_url) + return "{}/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-splunk_ta_uccexample_settings/custom_tab".format( + self.splunk_mgmt_url + ) diff --git a/tests/ui/Example_UccLib/input_page.py b/tests/ui/Example_UccLib/input_page.py index 62f9fd06..56c48399 100644 --- a/tests/ui/Example_UccLib/input_page.py +++ b/tests/ui/Example_UccLib/input_page.py @@ -1,4 +1,3 @@ - # # SPDX-FileCopyrightText: 2020 Splunk, Inc. # SPDX-License-Identifier: LicenseRef-Splunk-8-2021 @@ -22,93 +21,248 @@ from pytest_splunk_addon_ui_smartx.components.controls.toggle import Toggle from selenium.webdriver.common.by import By + class ExampleInputOne(Entity): """ Form to configure a new Input """ + def __init__(self, browser, container): """ - :param browser: The selenium webdriver - :param container: The container in which the entity is located in + :param browser: The selenium webdriver + :param container: The container in which the entity is located in """ - add_btn = Button(browser, Selector(select=container.select + '[id="addInputBtn"]')) + add_btn = Button( + browser, Selector(select=container.select + '[id="addInputBtn"]') + ) entity_container = Selector(select='[data-test="modal"]') - - super(ExampleInputOne, self).__init__(browser, entity_container, add_btn=add_btn) + + super(ExampleInputOne, self).__init__( + browser, entity_container, add_btn=add_btn + ) # Controls - self.name = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="name"]')) - self.example_checkbox = Checkbox(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="input_one_checkbox"]')) - self.example_radio = Toggle(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="input_one_radio"]')) - self.single_select_group_test = SingleSelect(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="singleSelectTest"]'), allow_new_values=True) - self.multiple_select_test = MultiSelect(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="multipleSelectTest"]')) - self.interval = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="interval"]')) - self.index = SingleSelect(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="index"]'), allow_new_values=True) - self.example_account = SingleSelect(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="account"]')) - self.object = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="object"]')) - self.object_fields = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="object_fields"]')) - self.order_by = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="order_by"]')) - self.query_start_date = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="start_date"]')) - self.limit = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="limit"]')) - self.help_link = LearnMore(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="example_help_link"]')) - self.title = BaseComponent(browser, Selector(select= ' [data-test="title"]')) + self.name = TextBox( + browser, Selector(select=' [data-test="control-group"][data-name="name"]') + ) + self.example_checkbox = Checkbox( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="input_one_checkbox"]' + ), + ) + self.example_radio = Toggle( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="input_one_radio"]' + ), + ) + self.single_select_group_test = SingleSelect( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="singleSelectTest"]' + ), + allow_new_values=True, + ) + self.multiple_select_test = MultiSelect( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="multipleSelectTest"]' + ), + ) + self.interval = TextBox( + browser, + Selector(select=' [data-test="control-group"][data-name="interval"]'), + ) + self.index = SingleSelect( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="index"]' + ), + allow_new_values=True, + ) + self.example_account = SingleSelect( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="account"]' + ), + ) + self.object = TextBox( + browser, Selector(select=' [data-test="control-group"][data-name="object"]') + ) + self.object_fields = TextBox( + browser, + Selector(select=' [data-test="control-group"][data-name="object_fields"]'), + ) + self.order_by = TextBox( + browser, + Selector(select=' [data-test="control-group"][data-name="order_by"]'), + ) + self.query_start_date = TextBox( + browser, + Selector(select=' [data-test="control-group"][data-name="start_date"]'), + ) + self.limit = TextBox( + browser, Selector(select=' [data-test="control-group"][data-name="limit"]') + ) + self.help_link = LearnMore( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="example_help_link"]' + ), + ) + self.title = BaseComponent(browser, Selector(select=' [data-test="title"]')) class ExampleInputTwo(Entity): """ Form to configure a new Input """ + def __init__(self, browser, container): """ - :param browser: The selenium webdriver - :param container: The container in which the entity is located in + :param browser: The selenium webdriver + :param container: The container in which the entity is located in """ - add_btn = Button(browser, Selector(select=container.select + ' [id="addInputBtn"]')) + add_btn = Button( + browser, Selector(select=container.select + ' [id="addInputBtn"]') + ) entity_container = Selector(select=' [data-test="modal"]') - - super(ExampleInputTwo, self).__init__(browser, entity_container, add_btn=add_btn) + + super(ExampleInputTwo, self).__init__( + browser, entity_container, add_btn=add_btn + ) # Controls - self.name = TextBox(browser, Selector(select='[data-test="control-group"][data-name="name"]')) - self.interval = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="interval"]')) - self.index = SingleSelect(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="index"]'), allow_new_values=True) - self.example_account = SingleSelect(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="account"]')) - self.example_multiple_select = MultiSelect(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="input_two_multiple_select"]')) - self.example_checkbox = Checkbox(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="input_two_checkbox"]')) - self.example_radio = Toggle(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="input_two_radio"]')) - self.query_start_date = TextBox(browser, Selector(select=' [data-test="control-group"][data-name="start_date"]')) - self.help_link = LearnMore(browser, Selector(select=entity_container.select + ' [data-test="control-group"][data-name="example_help_link"]')) - self.title = BaseComponent(browser, Selector(select= ' [data-test="title"]')) - - + self.name = TextBox( + browser, Selector(select='[data-test="control-group"][data-name="name"]') + ) + self.interval = TextBox( + browser, + Selector(select=' [data-test="control-group"][data-name="interval"]'), + ) + self.index = SingleSelect( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="index"]' + ), + allow_new_values=True, + ) + self.example_account = SingleSelect( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="account"]' + ), + ) + self.example_multiple_select = MultiSelect( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="input_two_multiple_select"]' + ), + ) + self.example_checkbox = Checkbox( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="input_two_checkbox"]' + ), + ) + self.example_radio = Toggle( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="input_two_radio"]' + ), + ) + self.query_start_date = TextBox( + browser, + Selector(select=' [data-test="control-group"][data-name="start_date"]'), + ) + self.help_link = LearnMore( + browser, + Selector( + select=entity_container.select + + ' [data-test="control-group"][data-name="example_help_link"]' + ), + ) + self.title = BaseComponent(browser, Selector(select=' [data-test="title"]')) + + class InputPage(Page): """ Page: Input page """ - def __init__(self, ucc_smartx_selenium_helper=None, ucc_smartx_rest_helper=None, open_page=True): + def __init__( + self, + ucc_smartx_selenium_helper=None, + ucc_smartx_rest_helper=None, + open_page=True, + ): """ - :param browser: The selenium webdriver - :param urls: Splunk web & management url. {"web": , "mgmt": } - :param session_key: session key to access the rest endpoints + :param browser: The selenium webdriver + :param urls: Splunk web & management url. {"web": , "mgmt": } + :param session_key: session key to access the rest endpoints """ - super(InputPage, self).__init__(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page) + super(InputPage, self).__init__( + ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page + ) input_container = Selector(select=' div[role="main"]') if ucc_smartx_selenium_helper: - self.title = Message(ucc_smartx_selenium_helper.browser, Selector(select=' [data-test="column"] .pageTitle')) - self.description = Message(ucc_smartx_selenium_helper.browser, Selector(select=' [data-test="column"] .pageSubtitle')) - self.create_new_input = Dropdown(ucc_smartx_selenium_helper.browser, Selector(select='[id="addInputBtn"]')) - self.table = InputTable(ucc_smartx_selenium_helper.browser, input_container, mapping={"status": "disabled", "input_type":3}) - self.entity1 = ExampleInputOne(ucc_smartx_selenium_helper.browser, input_container) - self.entity2 = ExampleInputTwo(ucc_smartx_selenium_helper.browser, input_container) - self.pagination = Dropdown(ucc_smartx_selenium_helper.browser, Selector(select='.dropdownPage')) - self.type_filter = Dropdown(ucc_smartx_selenium_helper.browser, Selector(select='.dropdownInput')) - + self.title = Message( + ucc_smartx_selenium_helper.browser, + Selector(select=' [data-test="column"] .pageTitle'), + ) + self.description = Message( + ucc_smartx_selenium_helper.browser, + Selector(select=' [data-test="column"] .pageSubtitle'), + ) + self.create_new_input = Dropdown( + ucc_smartx_selenium_helper.browser, + Selector(select='[id="addInputBtn"]'), + ) + self.table = InputTable( + ucc_smartx_selenium_helper.browser, + input_container, + mapping={"status": "disabled", "input_type": 3}, + ) + self.entity1 = ExampleInputOne( + ucc_smartx_selenium_helper.browser, input_container + ) + self.entity2 = ExampleInputTwo( + ucc_smartx_selenium_helper.browser, input_container + ) + self.pagination = Dropdown( + ucc_smartx_selenium_helper.browser, Selector(select=".dropdownPage") + ) + self.type_filter = Dropdown( + ucc_smartx_selenium_helper.browser, Selector(select=".dropdownInput") + ) + if ucc_smartx_rest_helper: - self.backend_conf = ListBackendConf(self._get_input_endpoint(), ucc_smartx_rest_helper.username, ucc_smartx_rest_helper.password) + self.backend_conf = ListBackendConf( + self._get_input_endpoint(), + ucc_smartx_rest_helper.username, + ucc_smartx_rest_helper.password, + ) + def open(self): - self.browser.get('{}/en-US/app/Splunk_TA_UCCExample/inputs'.format(self.splunk_web_url)) + self.browser.get( + "{}/en-US/app/Splunk_TA_UCCExample/inputs".format(self.splunk_web_url) + ) def _get_input_endpoint(self): - return '{}/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs'.format(self.splunk_mgmt_url) + return "{}/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs".format( + self.splunk_mgmt_url + ) diff --git a/tests/ui/__init__.py b/tests/ui/__init__.py index 0a63b582..79677e45 100644 --- a/tests/ui/__init__.py +++ b/tests/ui/__init__.py @@ -2,4 +2,4 @@ # SPDX-FileCopyrightText: 2020 Splunk, Inc. # SPDX-License-Identifier: LicenseRef-Splunk-8-2021 # -# \ No newline at end of file +# diff --git a/tests/ui/pytest-ci.ini b/tests/ui/pytest-ci.ini index 0ece1a98..5675e0db 100644 --- a/tests/ui/pytest-ci.ini +++ b/tests/ui/pytest-ci.ini @@ -4,7 +4,7 @@ ## ## [pytest] -markers = +markers = proxy: Proxy page UI Test cases logging: Logging page UI Test cases input: Input page UI Test cases @@ -24,9 +24,9 @@ addopts = -v -s --tb=long --splunk-type=external --junitxml=/home/circleci/work/test-results/test.xml --html=report.html - --splunk-host=splunk - --splunkweb-port=8000 - --splunk-port=8089 + --splunk-host=splunk + --splunkweb-port=8000 + --splunk-port=8089 --splunk-password=Chang3d! --splunk-web-scheme=https filterwarnings = diff --git a/tests/ui/test_splunk_ta_example_addon_account.py b/tests/ui/test_splunk_ta_example_addon_account.py index 2686e77d..e36c31ac 100644 --- a/tests/ui/test_splunk_ta_example_addon_account.py +++ b/tests/ui/test_splunk_ta_example_addon_account.py @@ -17,73 +17,85 @@ import requests import urllib import copy -from base64 import b64decode +from base64 import b64decode ACCOUNT_CONFIG = { - 'name': 'TestAccount', - 'account_checkbox': 1, - 'account_multiple_select': 'one', - 'account_radio': 'yes', - 'auth_type': 'basic', - 'custom_endpoint': 'login.example.com', - 'username': 'TestUser', - 'password': "TestPassword", - 'token': "TestToken", - 'client_id': '', - 'client_secret': '', - 'redirect_url': '', - 'endpoint': '', - 'example_help_link': '' + "name": "TestAccount", + "account_checkbox": 1, + "account_multiple_select": "one", + "account_radio": "yes", + "auth_type": "basic", + "custom_endpoint": "login.example.com", + "username": "TestUser", + "password": "TestPassword", + "token": "TestToken", + "client_id": "", + "client_secret": "", + "redirect_url": "", + "endpoint": "", + "example_help_link": "", } + @pytest.fixture def add_input(ucc_smartx_rest_helper): - input_page = InputPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + input_page = InputPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) url = input_page._get_input_endpoint() kwargs = { - 'name': 'example_input_one://dummy_input_one', - 'account':'TestAccount', - 'input_one_checkbox': '1', - 'input_one_radio': '1', - 'interval': '90', - 'limit': '1000', - 'multipleSelectTest': 'a|b', - 'object': 'test_object', - 'object_fields': 'test_field', - 'order_by': 'LastModifiedDate', - 'singleSelectTest': 'two', - 'start_date': '2020-12-11T20:00:32.000z', - 'disabled': 0, + "name": "example_input_one://dummy_input_one", + "account": "TestAccount", + "input_one_checkbox": "1", + "input_one_radio": "1", + "interval": "90", + "limit": "1000", + "multipleSelectTest": "a|b", + "object": "test_object", + "object_fields": "test_field", + "order_by": "LastModifiedDate", + "singleSelectTest": "two", + "start_date": "2020-12-11T20:00:32.000z", + "disabled": 0, } yield input_page.backend_conf.post_stanza(url, kwargs) input_page.backend_conf.delete_all_stanzas("search=dummy_input_one") + @pytest.fixture def add_account(ucc_smartx_rest_helper): - account = AccountPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + account = AccountPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) url = account._get_account_endpoint() kwargs = ACCOUNT_CONFIG yield account.backend_conf.post_stanza(url, kwargs) + @pytest.fixture def add_multiple_account(ucc_smartx_rest_helper): - account = AccountPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + account = AccountPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) url = account._get_account_endpoint() for i in range(12): kwargs = copy.deepcopy(ACCOUNT_CONFIG) - kwargs['name'] = kwargs['name'] + str(i) + kwargs["name"] = kwargs["name"] + str(i) account.backend_conf.post_stanza(url, kwargs) + @pytest.fixture(autouse=True) def delete_accounts(ucc_smartx_rest_helper): yield - account = AccountPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + account = AccountPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) account.backend_conf.delete_all_stanzas() - + class TestAccount(UccTester): - + ############################ ### TEST CASES FOR TABLE ### ############################ @@ -91,162 +103,166 @@ class TestAccount(UccTester): @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_default_rows_in_table(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the default number of rows in the table""" + def test_account_default_rows_in_table( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the default number of rows in the table""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - account.table.get_row_count, - 0 - ) + self.assert_util(account.table.get_row_count, 0) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_sort_functionality(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_account): - """ Verifies sorting functionality for name column""" + def test_account_sort_functionality( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_account + ): + """Verifies sorting functionality for name column""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.sort_column("Name") sort_order = account.table.get_sort_order() column_values = list(account.table.get_column_values("Name")) - column_values = list(str(item)for item in column_values) - sorted_values = sorted(column_values , key = str.lower) - self.assert_util( - sort_order["header"].lower(), - 'name' - ) - self.assert_util( - column_values, - sorted_values - ) + column_values = list(str(item) for item in column_values) + sorted_values = sorted(column_values, key=str.lower) + self.assert_util(sort_order["header"].lower(), "name") + self.assert_util(column_values, sorted_values) self.assert_util(sort_order["ascending"], True) - + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_count(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_account): - """ Verifies count on table""" + def test_account_count( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_account + ): + """Verifies count on table""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) self.assert_util( account.table.get_count_title, - "{} Items".format(len(account.backend_conf.get_all_stanzas())) - ) + "{} Items".format(len(account.backend_conf.get_all_stanzas())), + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_accounts_filter_functionality_negative(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the filter functionality (Negative)""" + def test_accounts_filter_functionality_negative( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the filter functionality (Negative)""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.set_filter("hello") - self.assert_util(account.table.get_row_count, 0) + self.assert_util(account.table.get_row_count, 0) self.assert_util( account.table.get_count_title, - "{} Item".format(account.table.get_row_count()) - ) + "{} Item".format(account.table.get_row_count()), + ) account.table.clean_filter() - + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_accounts_filter_functionality_positive(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the filter functionality (Positive)""" + def test_accounts_filter_functionality_positive( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the filter functionality (Positive)""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.set_filter("TestAccount") - self.assert_util(account.table.get_row_count, 1) + self.assert_util(account.table.get_row_count, 1) self.assert_util( account.table.get_count_title, - "{} Item".format(account.table.get_row_count()) - ) + "{} Item".format(account.table.get_row_count()), + ) account.table.clean_filter() - @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_pagination(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_account): - """ Verifies pagination list""" + def test_account_pagination( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_account + ): + """Verifies pagination list""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) name_column_page1 = account.table.get_column_values("name") account.table.switch_to_next() name_column_page2 = account.table.get_column_values("name") - self.assert_util(name_column_page1, - name_column_page2, - "!=" - ) + self.assert_util(name_column_page1, name_column_page2, "!=") ################################### #### TEST CASES FOR ENTITY #### ################################### - @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_title_and_description(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the title and description of the page""" + def test_account_title_and_description( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the title and description of the page""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - account.title.wait_to_display, - "Configuration" - ) - self.assert_util( - account.description.wait_to_display, - "Set up your add-on" - ) + self.assert_util(account.title.wait_to_display, "Configuration") + self.assert_util(account.description.wait_to_display, "Set up your add-on") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_add_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the title of the 'Add Entity'""" + def test_account_add_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the title of the 'Add Entity'""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util( - account.entity.title.container.get_attribute('textContent').strip(), - "Add Account" - ) + account.entity.title.container.get_attribute("textContent").strip(), + "Add Account", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_edit_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the title of the 'Edit Entity'""" + def test_account_edit_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the title of the 'Edit Entity'""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.edit_row(ACCOUNT_CONFIG["name"]) self.assert_util( - account.entity.title.container.get_attribute('textContent').strip(), - "Update Account" - ) + account.entity.title.container.get_attribute("textContent").strip(), + "Update Account", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_clone_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the title of the 'Clone Entity'""" + def test_account_clone_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the title of the 'Clone Entity'""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.clone_row(ACCOUNT_CONFIG["name"]) self.assert_util( - account.entity.title.container.get_attribute('textContent').strip(), - "Clone Account" - ) + account.entity.title.container.get_attribute("textContent").strip(), + "Clone Account", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_delete_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the title of the 'Delete Entity'""" + def test_account_delete_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the title of the 'Delete Entity'""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.delete_row(ACCOUNT_CONFIG["name"], prompt_msg=True) self.assert_util( - account.entity.title.container.get_attribute('textContent').strip(), - "Delete Confirmation" - ) + account.entity.title.container.get_attribute("textContent").strip(), + "Delete Confirmation", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_add_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies close functionality at time of add""" + def test_account_add_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies close functionality at time of add""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util(account.entity.close, True) @@ -254,8 +270,10 @@ def test_account_add_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_r @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_add_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies cancel functionality at time of add""" + def test_account_add_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies cancel functionality at time of add""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util(account.entity.cancel, True) @@ -263,43 +281,61 @@ def test_account_add_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_ @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_delete_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies close functionality at time of delete""" + def test_account_delete_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies close functionality at time of delete""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util(account.table.delete_row, True, left_args={"name":ACCOUNT_CONFIG["name"], "close":True}) - + self.assert_util( + account.table.delete_row, + True, + left_args={"name": ACCOUNT_CONFIG["name"], "close": True}, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_delete_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies cancel functionality at time of delete""" + def test_account_delete_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies cancel functionality at time of delete""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - - self.assert_util(account.table.delete_row, True, left_args={"name":ACCOUNT_CONFIG["name"], "cancel":True}) - + + self.assert_util( + account.table.delete_row, + True, + left_args={"name": ACCOUNT_CONFIG["name"], "cancel": True}, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_edit_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies close functionality at time of edit""" + def test_account_edit_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies close functionality at time of edit""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.edit_row(ACCOUNT_CONFIG["name"]) self.assert_util(account.entity.close, True) - + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_edit_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies cancel functionality at time of edit""" + def test_account_edit_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies cancel functionality at time of edit""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.edit_row(ACCOUNT_CONFIG["name"]) self.assert_util(account.entity.cancel, True) - + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_clone_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies close functionality at time of clone""" + def test_account_clone_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies close functionality at time of clone""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.clone_row(ACCOUNT_CONFIG["name"]) self.assert_util(account.entity.close, True) @@ -307,30 +343,39 @@ def test_account_clone_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_clone_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies cancel functionality at time of clone""" + def test_account_clone_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies cancel functionality at time of clone""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.clone_row(ACCOUNT_CONFIG["name"]) self.assert_util(account.entity.cancel, True) - @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_delete_valid_prompt_message(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the prompt message of the 'Delete Entity'""" + def test_account_delete_valid_prompt_message( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the prompt message of the 'Delete Entity'""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - prompt_message = account.table.delete_row(ACCOUNT_CONFIG["name"], prompt_msg=True) + prompt_message = account.table.delete_row( + ACCOUNT_CONFIG["name"], prompt_msg=True + ) self.assert_util( prompt_message, - 'Are you sure you want to delete "{}" ? Ensure that no input is configured with "{}" as this will stop data collection for that input.'.format(ACCOUNT_CONFIG["name"],ACCOUNT_CONFIG["name"]) - ) + 'Are you sure you want to delete "{}" ? Ensure that no input is configured with "{}" as this will stop data collection for that input.'.format( + ACCOUNT_CONFIG["name"], ACCOUNT_CONFIG["name"] + ), + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_required_field_username(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field username""" + def test_account_required_field_username( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field username""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) @@ -341,15 +386,17 @@ def test_account_required_field_username(self, ucc_smartx_selenium_helper, ucc_s account.entity.account_radio.select("No") self.assert_util( account.entity.save, - 'Field Username is required', - left_args={'expect_error': True} - ) + "Field Username is required", + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_required_field_password(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field password""" + def test_account_required_field_password( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field password""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) @@ -360,28 +407,29 @@ def test_account_required_field_password(self, ucc_smartx_selenium_helper, ucc_s account.entity.account_radio.select("No") self.assert_util( account.entity.save, - 'Field Password is required', - left_args={'expect_error': True} - ) + "Field Password is required", + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_encrypted_field_password(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies if the password field is masked or not in the Textbox""" + def test_account_encrypted_field_password( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies if the password field is masked or not in the Textbox""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() textbox_type = account.entity.password.get_type() - self.assert_util( - textbox_type, - 'password' - ) + self.assert_util(textbox_type, "password") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_required_field_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field name""" + def test_account_required_field_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field name""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.environment.select("Value2") @@ -392,152 +440,116 @@ def test_account_required_field_name(self, ucc_smartx_selenium_helper, ucc_smart account.entity.account_radio.select("No") self.assert_util( account.entity.save, - 'Field Name is required', - left_args={'expect_error': True} - ) - + "Field Name is required", + left_args={"expect_error": True}, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_basic_fields_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies basic account field label""" + def test_account_basic_fields_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies basic account field label""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() + self.assert_util(account.entity.name.get_input_label, "Name") self.assert_util( - account.entity.name.get_input_label, - 'Name' - ) - self.assert_util( - account.entity.environment.get_input_label, - 'Example Environment' - ) - self.assert_util( - account.entity.example_checkbox.get_input_label, - 'Example Checkbox' - ) - self.assert_util( - account.entity.account_radio.get_input_label, - 'Example Radio' - ) - self.assert_util( - account.entity.multiple_select.get_input_label, - 'Example Multiple Select' - ) + account.entity.environment.get_input_label, "Example Environment" + ) self.assert_util( - account.entity.auth_key.get_input_label, - 'Auth Type' - ) + account.entity.example_checkbox.get_input_label, "Example Checkbox" + ) + self.assert_util(account.entity.account_radio.get_input_label, "Example Radio") self.assert_util( - account.entity.username.get_input_label, - 'Username' - ) + account.entity.multiple_select.get_input_label, "Example Multiple Select" + ) + self.assert_util(account.entity.auth_key.get_input_label, "Auth Type") + self.assert_util(account.entity.username.get_input_label, "Username") + self.assert_util(account.entity.password.get_input_label, "Password") self.assert_util( - account.entity.password.get_input_label, - 'Password' - ) - self.assert_util( - account.entity.security_token.get_input_label, - 'Security Token' - ) - + account.entity.security_token.get_input_label, "Security Token" + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_oauth_fields_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies oauth account field label""" + def test_account_oauth_fields_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies oauth account field label""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() - account.entity.auth_key.select('OAuth 2.0 Authentication') - self.assert_util( - account.entity.name.get_input_label, - 'Name' - ) - self.assert_util( - account.entity.environment.get_input_label, - 'Example Environment' - ) - self.assert_util( - account.entity.example_checkbox.get_input_label, - 'Example Checkbox' - ) - self.assert_util( - account.entity.account_radio.get_input_label, - 'Example Radio' - ) - self.assert_util( - account.entity.multiple_select.get_input_label, - 'Example Multiple Select' - ) - self.assert_util( - account.entity.auth_key.get_input_label, - 'Auth Type' - ) - self.assert_util( - account.entity.client_id.get_input_label, - 'Client Id' - ) - self.assert_util( - account.entity.client_secret.get_input_label, - 'Client Secret' - ) - self.assert_util( - account.entity.redirect_url.get_input_label, - 'Redirect url' - ) + account.entity.auth_key.select("OAuth 2.0 Authentication") + self.assert_util(account.entity.name.get_input_label, "Name") + self.assert_util( + account.entity.environment.get_input_label, "Example Environment" + ) + self.assert_util( + account.entity.example_checkbox.get_input_label, "Example Checkbox" + ) + self.assert_util(account.entity.account_radio.get_input_label, "Example Radio") + self.assert_util( + account.entity.multiple_select.get_input_label, "Example Multiple Select" + ) + self.assert_util(account.entity.auth_key.get_input_label, "Auth Type") + self.assert_util(account.entity.client_id.get_input_label, "Client Id") + self.assert_util(account.entity.client_secret.get_input_label, "Client Secret") + self.assert_util(account.entity.redirect_url.get_input_label, "Redirect url") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_fields_placeholder_value(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies account field placeholder value""" + def test_account_fields_placeholder_value( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies account field placeholder value""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() - self.assert_util( - account.entity.name.get_placeholder_value, - 'Required' - ) - - @pytest.mark.execute_enterprise_cloud_true + self.assert_util(account.entity.name.get_placeholder_value, "Required") + + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.account - def test_account_help_text_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies help text for the field name""" + def test_account_help_text_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies help text for the field name""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util( - account.entity.name.get_help_text, - 'Enter a unique name for this account.' - ) + account.entity.name.get_help_text, "Enter a unique name for this account." + ) self.assert_util( account.entity.example_checkbox.get_help_text, - 'This is an example checkbox for the account entity' - ) + "This is an example checkbox for the account entity", + ) self.assert_util( account.entity.account_radio.get_help_text, - 'This is an example radio button for the account entity' - ) + "This is an example radio button for the account entity", + ) self.assert_util( account.entity.multiple_select.get_help_text, - 'This is an example multipleSelect for account entity' - ) + "This is an example multipleSelect for account entity", + ) self.assert_util( account.entity.username.get_help_text, - 'Enter the username for this account.' - ) + "Enter the username for this account.", + ) self.assert_util( account.entity.password.get_help_text, - 'Enter the password for this account.' - ) + "Enter the password for this account.", + ) self.assert_util( - account.entity.security_token.get_help_text, - 'Enter the security token.' - ) - + account.entity.security_token.get_help_text, "Enter the security token." + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_required_field_example_environment(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field example environment""" + def test_account_required_field_example_environment( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field example environment""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) @@ -545,19 +557,21 @@ def test_account_required_field_example_environment(self, ucc_smartx_selenium_he account.entity.username.set_value("TestEditUser") account.entity.password.set_value("TestEditPassword") account.entity.security_token.set_value("TestEditToken") - account.entity.account_radio.select("No") + account.entity.account_radio.select("No") account.entity.environment.cancel_selected_value() self.assert_util( account.entity.save, - 'Field Example Environment is required', - left_args={'expect_error': True} - ) + "Field Example Environment is required", + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_required_field_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field example multiple select""" + def test_account_required_field_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field example multiple select""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) @@ -568,65 +582,70 @@ def test_account_required_field_example_multiple_select(self, ucc_smartx_seleniu account.entity.account_radio.select("No") self.assert_util( account.entity.save, - 'Field Example Multiple Select is required', - left_args={'expect_error': True} - ) - + "Field Example Multiple Select is required", + left_args={"expect_error": True}, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_required_field_client_id(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field client id""" + def test_account_required_field_client_id( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field client id""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) account.entity.environment.select("Value2") account.entity.account_radio.select("No") account.entity.multiple_select.select("Option Two") - account.entity.auth_key.select('OAuth 2.0 Authentication') + account.entity.auth_key.select("OAuth 2.0 Authentication") self.assert_util( account.entity.save, - 'Field Client Id is required', - left_args={'expect_error': True} - ) - + "Field Client Id is required", + left_args={"expect_error": True}, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_required_field_client_secret(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field client secret""" + def test_account_required_field_client_secret( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field client secret""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() - account.entity.auth_key.select('OAuth 2.0 Authentication') + account.entity.auth_key.select("OAuth 2.0 Authentication") account.entity.name.set_value(ACCOUNT_CONFIG["name"]) account.entity.multiple_select.select("Option One") account.entity.account_radio.select("No") account.entity.client_id.set_value("TestClientId") self.assert_util( account.entity.save, - 'Field Client Secret is required', - left_args={'expect_error': True} - ) + "Field Client Secret is required", + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_encrypted_field_client_secret(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies if the password field is masked or not in the Textbox""" + def test_account_encrypted_field_client_secret( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies if the password field is masked or not in the Textbox""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() - account.entity.auth_key.select('OAuth 2.0 Authentication') + account.entity.auth_key.select("OAuth 2.0 Authentication") textbox_type = account.entity.client_secret.get_type() - self.assert_util( - textbox_type, - 'password' - ) + self.assert_util(textbox_type, "password") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_valid_account_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether adding special characters, number in starting of name field displays validation error""" + def test_account_valid_account_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether adding special characters, number in starting of name field displays validation error""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.username.set_value(ACCOUNT_CONFIG["username"]) @@ -634,161 +653,167 @@ def test_account_valid_account_name(self, ucc_smartx_selenium_helper, ucc_smartx account.entity.name.set_value("123TestAccount") self.assert_util( account.entity.save, - 'Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.', - left_args={'expect_error': True} - ) + "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.", + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_valid_length_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the name field should not be more than 50 characters""" + def test_account_valid_length_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the name field should not be more than 50 characters""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.username.set_value(ACCOUNT_CONFIG["username"]) account.entity.password.set_value(ACCOUNT_CONFIG["password"]) - account.entity.name.set_value("t"*51) + account.entity.name.set_value("t" * 51) self.assert_util( account.entity.save, - 'Length of ID should be between 1 and 50', - left_args={'expect_error': True} - ) + "Length of ID should be between 1 and 50", + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_default_value_example_environment(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of example environment""" + def test_account_default_value_example_environment( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of example environment""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) account.entity.username.set_value(ACCOUNT_CONFIG["username"]) - self.assert_util( - account.entity.environment.get_value, - "Value1" - ) + self.assert_util(account.entity.environment.get_value, "Value1") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_list_example_environment(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies example environment list dropdown""" + def test_account_list_example_environment( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies example environment list dropdown""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util( - account.entity.environment.list_of_values, - ["Value1", "Value2", "Other"] - ) + account.entity.environment.list_of_values, ["Value1", "Value2", "Other"] + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_default_value_auth_type(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of auth type""" + def test_account_default_value_auth_type( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of auth type""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() - self.assert_util( - account.entity.auth_key.get_value, - "basic" - ) + self.assert_util(account.entity.auth_key.get_value, "basic") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_list_auth_type(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies auth type list dropdown""" + def test_account_list_auth_type( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies auth type list dropdown""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util( - account.entity.auth_key.list_of_values(), - ["Basic Authentication", "OAuth 2.0 Authentication"] - ) + account.entity.auth_key.list_of_values(), + ["Basic Authentication", "OAuth 2.0 Authentication"], + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_checked_example_checkbox(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies Check/Uncheck in example checkbox""" + def test_account_checked_example_checkbox( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies Check/Uncheck in example checkbox""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.example_checkbox.check() - self.assert_util( - account.entity.example_checkbox.is_checked, - True - ) + self.assert_util(account.entity.example_checkbox.is_checked, True) account.entity.example_checkbox.uncheck() - self.assert_util( - account.entity.example_checkbox.is_checked, - False - ) - + self.assert_util(account.entity.example_checkbox.is_checked, False) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_select_value_example_environment(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies example environment select value""" + def test_account_select_value_example_environment( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies example environment select value""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.environment.select("Value2") - self.assert_util( - account.entity.environment.get_value, - "Value2" - ) + self.assert_util(account.entity.environment.get_value, "Value2") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_list_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies example multiple select list dropdown""" + def test_account_list_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies example multiple select list dropdown""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util( - account.entity.multiple_select.list_of_values(), - ["Option One", "Option Two"] - ) + account.entity.multiple_select.list_of_values(), + ["Option One", "Option Two"], + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_select_value_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies exampl multiple select value""" + def test_account_select_value_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies exampl multiple select value""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.multiple_select.select("Option One") account.entity.multiple_select.select("Option Two") self.assert_util( - account.entity.multiple_select.get_values, - ['Option One', 'Option Two']) + account.entity.multiple_select.get_values, ["Option One", "Option Two"] + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_search_value_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies exampl multiple select seach funtionality""" + def test_account_search_value_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies exampl multiple select seach funtionality""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() self.assert_util( - account.entity.multiple_select.search_get_list, - ["Option One"], - left_args={'value': "Option One"}) - + account.entity.multiple_select.search_get_list, + ["Option One"], + left_args={"value": "Option One"}, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_default_value_example_radio(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of example radio""" + def test_account_default_value_example_radio( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of example radio""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() - self.assert_util( - account.entity.account_radio.get_value, - "Yes") + self.assert_util(account.entity.account_radio.get_value, "Yes") - @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_add_account_duplicate_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies by saving an entity with duplicate name at time of add it displays and error""" + def test_add_account_duplicate_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies by saving an entity with duplicate name at time of add it displays and error""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) @@ -797,86 +822,90 @@ def test_add_account_duplicate_name(self, ucc_smartx_selenium_helper, ucc_smartx account.entity.password.set_value(ACCOUNT_CONFIG["password"]) account.entity.account_radio.select("Yes") self.assert_util( - account.entity.save, - 'Name {} is already in use'.format(ACCOUNT_CONFIG["name"]), - left_args={'expect_error': True}) - + account.entity.save, + "Name {} is already in use".format(ACCOUNT_CONFIG["name"]), + left_args={"expect_error": True}, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_delete_row_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the frontend delete functionlity""" + def test_account_delete_row_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the frontend delete functionlity""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.delete_row(ACCOUNT_CONFIG["name"]) account.table.wait_for_rows_to_appear(0) - self.assert_util(ACCOUNT_CONFIG["name"], - account.table.get_table, - "not in" - ) + self.assert_util(ACCOUNT_CONFIG["name"], account.table.get_table, "not in") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_edit_uneditable_field_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the frontend uneditable fields at time of edit of the account""" + def test_account_edit_uneditable_field_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the frontend uneditable fields at time of edit of the account""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.edit_row(ACCOUNT_CONFIG["name"]) - self.assert_util( - account.entity.name.is_editable, - False) - + self.assert_util(account.entity.name.is_editable, False) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_credentials_encrypted_value(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the default number of rows in the table""" + def test_account_credentials_encrypted_value( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the default number of rows in the table""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.wait_for_rows_to_appear(1) - assert account.backend_conf.get_stanza(ACCOUNT_CONFIG["name"]) =={ - 'account_checkbox': '1', - 'account_multiple_select' : ACCOUNT_CONFIG['account_multiple_select'], - 'account_radio' : '1', - 'auth_type' : ACCOUNT_CONFIG['auth_type'], - 'username' : ACCOUNT_CONFIG["username"], - 'custom_endpoint': ACCOUNT_CONFIG['custom_endpoint'], - 'disabled': False, - 'password': '******', - 'token': '******' - } - - + assert account.backend_conf.get_stanza(ACCOUNT_CONFIG["name"]) == { + "account_checkbox": "1", + "account_multiple_select": ACCOUNT_CONFIG["account_multiple_select"], + "account_radio": "1", + "auth_type": ACCOUNT_CONFIG["auth_type"], + "username": ACCOUNT_CONFIG["username"], + "custom_endpoint": ACCOUNT_CONFIG["custom_endpoint"], + "disabled": False, + "password": "******", + "token": "******", + } + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_add_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the frontend after adding account""" + def test_account_add_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the frontend after adding account""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() - account.entity.name.set_value(ACCOUNT_CONFIG['name']) - account.entity.username.set_value(ACCOUNT_CONFIG['username']) + account.entity.name.set_value(ACCOUNT_CONFIG["name"]) + account.entity.username.set_value(ACCOUNT_CONFIG["username"]) account.entity.multiple_select.select("Option One") - account.entity.password.set_value(ACCOUNT_CONFIG['password']) + account.entity.password.set_value(ACCOUNT_CONFIG["password"]) account.entity.security_token.set_value("TestToken") self.assert_util(account.entity.save, True) account.table.wait_for_rows_to_appear(1) self.assert_util( - account.table.get_table()[ACCOUNT_CONFIG['name']], + account.table.get_table()[ACCOUNT_CONFIG["name"]], { - 'name': ACCOUNT_CONFIG['name'], - 'auth type': 'basic', - 'actions': 'Edit | Clone | Delete' - } - ) + "name": ACCOUNT_CONFIG["name"], + "auth type": "basic", + "actions": "Edit | Clone | Delete", + }, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_edit_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the frontend edit functionality""" + def test_account_edit_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the frontend edit functionality""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.edit_row(ACCOUNT_CONFIG["name"]) account.entity.environment.select("Value2") @@ -888,33 +917,38 @@ def test_account_edit_frontend_validation(self, ucc_smartx_selenium_helper, ucc_ self.assert_util(account.entity.save, True) account.table.wait_for_rows_to_appear(1) self.assert_util( - account.table.get_table()[ACCOUNT_CONFIG["name"]] , - { - 'name': 'TestAccount', - 'auth type': 'basic', - 'actions': 'Edit | Clone | Delete' - } - ) - + account.table.get_table()[ACCOUNT_CONFIG["name"]], + { + "name": "TestAccount", + "auth type": "basic", + "actions": "Edit | Clone | Delete", + }, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_clone_account_duplicate_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies by saving an entity with duplicate name at time of clone it displays and error""" + def test_clone_account_duplicate_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies by saving an entity with duplicate name at time of clone it displays and error""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.clone_row(ACCOUNT_CONFIG["name"]) account.entity.name.set_value(ACCOUNT_CONFIG["name"]) self.assert_util( - account.entity.save, - 'Name {} is already in use'.format(ACCOUNT_CONFIG["name"]), - left_args={'expect_error': True}) + account.entity.save, + "Name {} is already in use".format(ACCOUNT_CONFIG["name"]), + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_clone_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the frontend clone functionality""" + def test_account_clone_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the frontend clone functionality""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.wait_for_rows_to_appear(1) account.table.clone_row(ACCOUNT_CONFIG["name"]) @@ -925,41 +959,36 @@ def test_account_clone_frontend_validation(self, ucc_smartx_selenium_helper, ucc account.entity.account_radio.select("Yes") self.assert_util(account.entity.save, True) self.assert_util( - account.table.get_table()["TestAccount2"], - { - 'name': 'TestAccount2', - 'auth type': 'basic', - 'actions': 'Edit | Clone | Delete' - } - ) - + account.table.get_table()["TestAccount2"], + { + "name": "TestAccount2", + "auth type": "basic", + "actions": "Edit | Clone | Delete", + }, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_clone_default_values(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the frontend default fields at time of clone""" + def test_account_clone_default_values( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the frontend default fields at time of clone""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.clone_row(ACCOUNT_CONFIG["name"]) - self.assert_util( - account.entity.name.get_value, - "") - self.assert_util( - account.entity.username.get_value, - "TestUser") - self.assert_util( - account.entity.multiple_select.get_values, - ['Option One']) - self.assert_util( - account.entity.auth_key.get_value, - "basic") - + self.assert_util(account.entity.name.get_value, "") + self.assert_util(account.entity.username.get_value, "TestUser") + self.assert_util(account.entity.multiple_select.get_values, ["Option One"]) + self.assert_util(account.entity.auth_key.get_value, "basic") + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_add_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the account in backend after adding account from frontend""" + def test_account_add_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the account in backend after adding account from frontend""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.entity.open() account.entity.name.set_value(ACCOUNT_CONFIG["name"]) @@ -969,23 +998,27 @@ def test_account_add_backend_validation(self, ucc_smartx_selenium_helper, ucc_sm account.entity.security_token.set_value(ACCOUNT_CONFIG["token"]) self.assert_util(account.entity.save, True) account.table.wait_for_rows_to_appear(1) - assert account.backend_conf.get_stanza(ACCOUNT_CONFIG["name"], decrypt=True) =={ - 'account_multiple_select' : ACCOUNT_CONFIG['account_multiple_select'], - 'account_radio' : '1', - 'auth_type' : ACCOUNT_CONFIG['auth_type'], - 'username' : ACCOUNT_CONFIG["username"], - 'custom_endpoint': ACCOUNT_CONFIG['custom_endpoint'], - 'disabled': False, - 'password': ACCOUNT_CONFIG['password'], - 'token': ACCOUNT_CONFIG['token'] - } + assert account.backend_conf.get_stanza( + ACCOUNT_CONFIG["name"], decrypt=True + ) == { + "account_multiple_select": ACCOUNT_CONFIG["account_multiple_select"], + "account_radio": "1", + "auth_type": ACCOUNT_CONFIG["auth_type"], + "username": ACCOUNT_CONFIG["username"], + "custom_endpoint": ACCOUNT_CONFIG["custom_endpoint"], + "disabled": False, + "password": ACCOUNT_CONFIG["password"], + "token": ACCOUNT_CONFIG["token"], + } @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_edit_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the account in backend after editing account from frontend""" + def test_account_edit_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the account in backend after editing account from frontend""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.edit_row(ACCOUNT_CONFIG["name"]) account.entity.multiple_select.select("Option Two") @@ -995,24 +1028,28 @@ def test_account_edit_backend_validation(self, ucc_smartx_selenium_helper, ucc_s account.entity.account_radio.select("No") account.entity.save() account.table.wait_for_rows_to_appear(1) - assert account.backend_conf.get_stanza(ACCOUNT_CONFIG["name"], decrypt=True) == { - 'account_checkbox': '1', - 'account_multiple_select' : 'one,two', - 'account_radio' : '0', - 'auth_type' : 'basic', - 'username' : 'TestEditUser', - 'custom_endpoint': 'login.example.com', - 'disabled': False, - 'password': "TestEditPassword", - 'token': "TestEditToken" - } + assert account.backend_conf.get_stanza( + ACCOUNT_CONFIG["name"], decrypt=True + ) == { + "account_checkbox": "1", + "account_multiple_select": "one,two", + "account_radio": "0", + "auth_type": "basic", + "username": "TestEditUser", + "custom_endpoint": "login.example.com", + "disabled": False, + "password": "TestEditPassword", + "token": "TestEditToken", + } @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_clone_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the account in backend after cloning account from frontend""" + def test_account_clone_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the account in backend after cloning account from frontend""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.wait_for_rows_to_appear(1) account.table.clone_row(ACCOUNT_CONFIG["name"]) @@ -1025,55 +1062,55 @@ def test_account_clone_backend_validation(self, ucc_smartx_selenium_helper, ucc_ account.entity.save() account.table.wait_for_rows_to_appear(2) assert account.backend_conf.get_stanza("TestAccountClone", decrypt=True) == { - 'account_checkbox': '1', - 'account_multiple_select' : 'one,two', - 'account_radio' : '0', - 'auth_type' : 'basic', - 'username' : 'TestCloneUser', - 'custom_endpoint': 'login.example.com', - 'disabled': False, - 'password': "TestEditPassword", - 'token': "TestEditToken" - } - + "account_checkbox": "1", + "account_multiple_select": "one,two", + "account_radio": "0", + "auth_type": "basic", + "username": "TestCloneUser", + "custom_endpoint": "login.example.com", + "disabled": False, + "password": "TestEditPassword", + "token": "TestEditToken", + } + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account @pytest.mark.sanity_test - def test_account_delete_row_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account): - """ Verifies the account in backend after deleting the account from frontend""" + def test_account_delete_row_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account + ): + """Verifies the account in backend after deleting the account from frontend""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) account.table.delete_row(ACCOUNT_CONFIG["name"]) account.table.wait_for_rows_to_appear(0) - self.assert_util(ACCOUNT_CONFIG["name"], - account.backend_conf.get_all_stanzas().keys(), - "not in" - ) - + self.assert_util( + ACCOUNT_CONFIG["name"], + account.backend_conf.get_all_stanzas().keys(), + "not in", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account def test_account_helplink(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether the table help link redirects to the correct URL""" + """Verifies whether the table help link redirects to the correct URL""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) go_to_link = "https://docs.splunk.com/Documentation" account.entity.open() with account.entity.help_link.open_link() as link_url: - self.assert_util( - account.entity.help_link.get_current_url, - go_to_link - ) - + self.assert_util(account.entity.help_link.get_current_url, go_to_link) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.account - def test_account_delete_account_in_use(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account, add_input): - """ Verifies by deleting the input used account""" + def test_account_delete_account_in_use( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_account, add_input + ): + """Verifies by deleting the input used account""" account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) self.assert_util( - account.table.delete_row, - r'Are you sure you want to delete "TestAccount" ? Ensure that no input is configured with "TestAccount" as this will stop data collection for that input.', - left_args={'name': ACCOUNT_CONFIG["name"], "prompt_msg": True}, - ) + account.table.delete_row, + r'Are you sure you want to delete "TestAccount" ? Ensure that no input is configured with "TestAccount" as this will stop data collection for that input.', + left_args={"name": ACCOUNT_CONFIG["name"], "prompt_msg": True}, + ) diff --git a/tests/ui/test_splunk_ta_example_addon_alert_actions.py b/tests/ui/test_splunk_ta_example_addon_alert_actions.py index ef98037c..a530d728 100644 --- a/tests/ui/test_splunk_ta_example_addon_alert_actions.py +++ b/tests/ui/test_splunk_ta_example_addon_alert_actions.py @@ -12,6 +12,7 @@ from .Example_UccLib.alert_action import AlertPage from .test_splunk_ta_example_addon_input import add_account + @pytest.fixture(autouse=True) def setup_alert(ucc_smartx_selenium_helper): """ @@ -22,19 +23,27 @@ def setup_alert(ucc_smartx_selenium_helper): if not setup_alert.first_execution: return AlertPage(ucc_smartx_selenium_helper, None, open_page=False) - intro_popup = Button(ucc_smartx_selenium_helper.browser, Selector(select=".modal-footer .btn-save")) + intro_popup = Button( + ucc_smartx_selenium_helper.browser, + Selector(select=".modal-footer .btn-save"), + ) intro_popup.wait_to_be_clickable() intro_popup.click() setup_alert.first_execution = False # Splunk 8.0.x important_changes_coming = Button( - ucc_smartx_selenium_helper.browser, - Selector(select='div[data-test-name="python3-notification-modal"] button[data-test="button"][data-appearance="secondary"]')) + ucc_smartx_selenium_helper.browser, + Selector( + select='div[data-test-name="python3-notification-modal"] button[data-test="button"][data-appearance="secondary"]' + ), + ) important_changes_coming.wait_to_be_clickable() important_changes_coming.click() except: pass + + setup_alert.first_execution = True @@ -45,15 +54,19 @@ def clean_alert(ucc_smartx_rest_helper): alert_page = AlertPage(None, ucc_smartx_rest_helper, open_page=False) alert_page.backend_conf.delete_all_stanzas(query="search=test_alert") -class TestAlertActions(UccTester): +class TestAlertActions(UccTester): @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder def test_action_in_list(self, ucc_smartx_selenium_helper): alert_page = AlertPage(ucc_smartx_selenium_helper, None) alert_page.alert_entity.open() alert_page.alert_entity.add_action_dropdown.wait_for_values() - self.assert_util("Test Alert", alert_page.alert_entity.add_action_dropdown.get_value_list, "in") + self.assert_util( + "Test Alert", + alert_page.alert_entity.add_action_dropdown.get_value_list, + "in", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @@ -63,7 +76,9 @@ def test_dropdown_list(self, ucc_smartx_selenium_helper): alert_page.alert_entity.add_action_dropdown.wait_for_values() alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") - self.assert_util(alert_page.action_entity.table_list.list_of_values, ["incident", "problem"]) + self.assert_util( + alert_page.action_entity.table_list.list_of_values, ["incident", "problem"] + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @@ -75,11 +90,13 @@ def test_account_functionality(self, ucc_smartx_selenium_helper): alert_page.action_entity.account.select("test_input") alert_page.action_entity.account.wait_for_values() - self.assert_util(alert_page.action_entity.account.get_value, "test_input") + self.assert_util(alert_page.action_entity.account.get_value, "test_input") alert_page.action_entity.account.cancel_selected_value() alert_page.action_entity.account.wait_for_values() self.assert_util(alert_page.action_entity.account.get_value, "test_input", "!=") - self.assert_util("test_input", alert_page.action_entity.account.list_of_values, "in") + self.assert_util( + "test_input", alert_page.action_entity.account.list_of_values, "in" + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @@ -87,7 +104,7 @@ def test_checkbox(self, ucc_smartx_selenium_helper): alert_page = AlertPage(ucc_smartx_selenium_helper, None) alert_page.alert_entity.open() alert_page.alert_entity.add_action_dropdown.wait_for_values() - alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") + alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") alert_page.action_entity.all_incident.toggle() self.assert_util(alert_page.action_entity.all_incident.is_checked, True) @@ -100,9 +117,11 @@ def test_single_select(self, ucc_smartx_selenium_helper): alert_page = AlertPage(ucc_smartx_selenium_helper, None) alert_page.alert_entity.open() alert_page.alert_entity.add_action_dropdown.wait_for_values() - alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") + alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") - self.assert_util(alert_page.action_entity.table_list.list_of_values, ["incident", "problem"]) + self.assert_util( + alert_page.action_entity.table_list.list_of_values, ["incident", "problem"] + ) alert_page.action_entity.table_list.select("problem") self.assert_util(alert_page.action_entity.table_list.get_value, "problem") @@ -112,7 +131,7 @@ def test_toggle(self, ucc_smartx_selenium_helper): alert_page = AlertPage(ucc_smartx_selenium_helper, None) alert_page.alert_entity.open() alert_page.alert_entity.add_action_dropdown.wait_for_values() - alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") + alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") alert_page.action_entity.action.select("Delete") assert alert_page.action_entity.action.get_value() == "Delete" @@ -129,7 +148,7 @@ def test_alert_action_save(self, ucc_smartx_selenium_helper, clean_alert): # Add Alert Configs alert_page.alert_entity.name.set_value("test_alert") - alert_page.alert_entity.search.set_value("| search index=_internal" + '\ue007') + alert_page.alert_entity.search.set_value("| search index=_internal" + "\ue007") # Open Action alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") @@ -152,47 +171,39 @@ def test_alert_help_text_entity(self, ucc_smartx_selenium_helper): alert_page.alert_entity.add_action_dropdown.wait_for_values() alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") self.assert_util( - alert_page.action_entity.name.get_help_text, - 'Please enter your name' - ) + alert_page.action_entity.name.get_help_text, "Please enter your name" + ) self.assert_util( alert_page.action_entity.all_incident.get_help_text, - 'Tick if you want to update all incidents/problems' - ) + "Tick if you want to update all incidents/problems", + ) self.assert_util( - alert_page.action_entity.table_list.get_help_text, - 'Please select the table' - ) + alert_page.action_entity.table_list.get_help_text, "Please select the table" + ) self.assert_util( alert_page.action_entity.action.get_help_text, - 'Select the action you want to perform' - ) + "Select the action you want to perform", + ) self.assert_util( alert_page.action_entity.account.get_help_text, - 'Select the account from the dropdown' - ) + "Select the account from the dropdown", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder - def test_alert_action_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the alert field labels""" + def test_alert_action_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the alert field labels""" alert_page = AlertPage(ucc_smartx_selenium_helper, None) alert_page.alert_entity.open() alert_page.alert_entity.add_action_dropdown.wait_for_values() alert_page.alert_entity.add_action_dropdown.select_action("Test Alert") + self.assert_util(alert_page.action_entity.name.get_input_label, "Name *") self.assert_util( - alert_page.action_entity.name.get_input_label, - 'Name *' - ) - self.assert_util( - alert_page.action_entity.table_list.get_input_label, - 'Table List' - ) - self.assert_util( - alert_page.action_entity.action.get_input_label, - 'Action:' - ) + alert_page.action_entity.table_list.get_input_label, "Table List" + ) + self.assert_util(alert_page.action_entity.action.get_input_label, "Action:") self.assert_util( - alert_page.action_entity.account.get_input_label, - 'Select Account *' - ) \ No newline at end of file + alert_page.action_entity.account.get_input_label, "Select Account *" + ) diff --git a/tests/ui/test_splunk_ta_example_addon_custom.py b/tests/ui/test_splunk_ta_example_addon_custom.py index c57e3cef..492c4834 100644 --- a/tests/ui/test_splunk_ta_example_addon_custom.py +++ b/tests/ui/test_splunk_ta_example_addon_custom.py @@ -12,109 +12,68 @@ import os DEFAULT_CONFIGURATION = { - 'test_number': '', - 'test_regex': '', - 'test_string': '', - 'test_email': '', - 'test_ipv4': '', - 'test_date': '', - 'test_url': '', - 'test_radio': 'Yes', - 'test_multiselect': '' + "test_number": "", + "test_regex": "", + "test_string": "", + "test_email": "", + "test_ipv4": "", + "test_date": "", + "test_url": "", + "test_radio": "Yes", + "test_multiselect": "", } + @pytest.fixture(autouse=True) def reset_configuration(ucc_smartx_selenium_helper, ucc_smartx_rest_helper): yield custom = Custom(ucc_smartx_rest_helper=ucc_smartx_rest_helper) custom.backend_conf.update_parameters(DEFAULT_CONFIGURATION) -class TestCustom(UccTester): +class TestCustom(UccTester): @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_fields_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies custom fields label""" + def test_custom_fields_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies custom fields label""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - custom.test_string.get_input_label, - 'Test String' - ) - self.assert_util( - custom.test_number.get_input_label, - 'Test Number' - ) - self.assert_util( - custom.test_regex.get_input_label, - 'Test Regex' - ) - self.assert_util( - custom.test_email.get_input_label, - 'Test Email' - ) - self.assert_util( - custom.test_ipv4.get_input_label, - 'Test Ipv4' - ) - self.assert_util( - custom.test_date.get_input_label, - 'Test Date' - ) - self.assert_util( - custom.test_url.get_input_label, - 'Test Url' - ) - self.assert_util( - custom.test_radio.get_input_label, - 'Test Radio' - ) - self.assert_util( - custom.test_multiselect.get_input_label, - 'Test Multiselect' - ) + self.assert_util(custom.test_string.get_input_label, "Test String") + self.assert_util(custom.test_number.get_input_label, "Test Number") + self.assert_util(custom.test_regex.get_input_label, "Test Regex") + self.assert_util(custom.test_email.get_input_label, "Test Email") + self.assert_util(custom.test_ipv4.get_input_label, "Test Ipv4") + self.assert_util(custom.test_date.get_input_label, "Test Date") + self.assert_util(custom.test_url.get_input_label, "Test Url") + self.assert_util(custom.test_radio.get_input_label, "Test Radio") + self.assert_util(custom.test_multiselect.get_input_label, "Test Multiselect") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_fields_placeholder_value(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies custom fields placeholder value""" + def test_custom_fields_placeholder_value( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies custom fields placeholder value""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - custom.test_string.get_placeholder_value, - 'Required' - ) - self.assert_util( - custom.test_number.get_placeholder_value, - 'Required' - ) - self.assert_util( - custom.test_regex.get_placeholder_value, - 'optional' - ) - self.assert_util( - custom.test_email.get_placeholder_value, - 'optional' - ) - self.assert_util( - custom.test_ipv4.get_placeholder_value, - 'optional' - ) - self.assert_util( - custom.test_date.get_placeholder_value, - 'optional' - ) - self.assert_util( - custom.test_url.get_placeholder_value, - 'optional' - ) + self.assert_util(custom.test_string.get_placeholder_value, "Required") + self.assert_util(custom.test_number.get_placeholder_value, "Required") + self.assert_util(custom.test_regex.get_placeholder_value, "optional") + self.assert_util(custom.test_email.get_placeholder_value, "optional") + self.assert_util(custom.test_ipv4.get_placeholder_value, "optional") + self.assert_util(custom.test_date.get_placeholder_value, "optional") + self.assert_util(custom.test_url.get_placeholder_value, "optional") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom @pytest.mark.sanity_test - def test_custom_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks the validates frontend save in custom tab""" + def test_custom_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks the validates frontend save in custom tab""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("7") @@ -132,8 +91,10 @@ def test_custom_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx @pytest.mark.forwarder @pytest.mark.custom @pytest.mark.sanity_test - def test_custom_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks the validates backend save in custom tab""" + def test_custom_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks the validates backend save in custom tab""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("7") @@ -149,24 +110,26 @@ def test_custom_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_ self.assert_util( custom.backend_conf.get_stanza, { - 'disabled': False, - 'test_number': '7', - 'test_regex': 'test_rex', - 'test_string': 'test_str', - 'test_email': 'test@a.b', - 'test_ipv4': '1.10.1.100', - 'test_date': '2020-09-18', - 'test_url': 'https://docs.splunk.com/Documentation', - 'test_radio': '0', - 'test_multiselect': 'Option A|Option B' - } - ) + "disabled": False, + "test_number": "7", + "test_regex": "test_rex", + "test_string": "test_str", + "test_email": "test@a.b", + "test_ipv4": "1.10.1.100", + "test_date": "2020-09-18", + "test_url": "https://docs.splunk.com/Documentation", + "test_radio": "0", + "test_multiselect": "Option A|Option B", + }, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_required_field_test_string(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks required field test string""" + def test_custom_required_field_test_string( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks required field test string""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_number.set_value("7") custom.test_regex.set_value("test_rex") @@ -179,40 +142,46 @@ def test_custom_required_field_test_string(self, ucc_smartx_selenium_helper, ucc self.assert_util( custom.save, r"Field Test String is required", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_length_test_string_greater(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks length of test string field should be greater than 4""" + def test_custom_valid_length_test_string_greater( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks length of test string field should be greater than 4""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test") self.assert_util( custom.save, r"Length of Test String should be greater than or equal to 5", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_length_test_string_less(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks length of test string field should be less than 11""" + def test_custom_valid_length_test_string_less( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks length of test string field should be less than 11""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_string") self.assert_util( custom.save, r"Length of Test String should be less than or equal to 10", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_required_field_test_number(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks required field test number""" + def test_custom_required_field_test_number( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks required field test number""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_regex.set_value("test_rex") @@ -225,42 +194,48 @@ def test_custom_required_field_test_number(self, ucc_smartx_selenium_helper, ucc self.assert_util( custom.save, r"Field Test Number is required", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_input_test_number(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks test number field should be interger""" + def test_custom_valid_input_test_number( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks test number field should be interger""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("a") self.assert_util( custom.save, r"Field Test Number is not a number", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_range_test_number(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks range of test number field should be between 1 to 10""" + def test_custom_valid_range_test_number( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks range of test number field should be between 1 to 10""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("50") self.assert_util( custom.save, r"Field Test Number should be within the range of [1 and 10]", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_input_test_regex(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks regex of test regex field""" + def test_custom_valid_input_test_regex( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks regex of test regex field""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("5") @@ -268,14 +243,16 @@ def test_custom_valid_input_test_regex(self, ucc_smartx_selenium_helper, ucc_sma self.assert_util( custom.save, r"Characters of Name should match regex ^\w+$ .", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_input_test_email(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks test email field should be email""" + def test_custom_valid_input_test_email( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks test email field should be email""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("5") @@ -284,14 +261,16 @@ def test_custom_valid_input_test_email(self, ucc_smartx_selenium_helper, ucc_sma self.assert_util( custom.save, r"Field Test Email is not a valid email address", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_input_test_ipv4(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks test ipv4 field should be valid ipv4""" + def test_custom_valid_input_test_ipv4( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks test ipv4 field should be valid ipv4""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("5") @@ -301,14 +280,16 @@ def test_custom_valid_input_test_ipv4(self, ucc_smartx_selenium_helper, ucc_smar self.assert_util( custom.save, r"Field Test Ipv4 is not a valid IPV4 address", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_input_test_date(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks test date field should be in ISO 8601 format""" + def test_custom_valid_input_test_date( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks test date field should be in ISO 8601 format""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("5") @@ -319,14 +300,16 @@ def test_custom_valid_input_test_date(self, ucc_smartx_selenium_helper, ucc_smar self.assert_util( custom.save, r"Field Test Date is not a valid date in ISO 8601 format", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_valid_input_test_url(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks test url field should be valid url""" + def test_custom_valid_input_test_url( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks test url field should be valid url""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_string.set_value("test_str") custom.test_number.set_value("5") @@ -338,97 +321,91 @@ def test_custom_valid_input_test_url(self, ucc_smartx_selenium_helper, ucc_smart self.assert_util( custom.save, r"Field Test Url is not a valid URL", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_select_value_test_radio(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks selected value of test radio""" + def test_custom_select_value_test_radio( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks selected value of test radio""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) custom.test_radio.select("No") - self.assert_util( - custom.test_radio.get_value, - r"No" - ) + self.assert_util(custom.test_radio.get_value, r"No") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_list_test_multiselect(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks values of Multiple Select Test dropdown""" + def test_custom_list_test_multiselect( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks values of Multiple Select Test dropdown""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) test_multiselect = ["Option A", "Option B"] - self.assert_util( - custom.test_multiselect.list_of_values(), - test_multiselect - ) + self.assert_util(custom.test_multiselect.list_of_values(), test_multiselect) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_select_value_test_multiselect(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks selected single value of Multiple Select Test dropdown""" + def test_custom_select_value_test_multiselect( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks selected single value of Multiple Select Test dropdown""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_values = ["Option A"] for each in selected_values: custom.test_multiselect.select(each) - self.assert_util( - custom.test_multiselect.get_values, - selected_values - ) + self.assert_util(custom.test_multiselect.get_values, selected_values) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_select_multiple_values_test_multiselect(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks selected multiple values of Multiple Select Test dropdown""" + def test_custom_select_multiple_values_test_multiselect( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks selected multiple values of Multiple Select Test dropdown""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_values = ["Option A", "Option B"] for each in selected_values: custom.test_multiselect.select(each) - self.assert_util( - custom.test_multiselect.get_values, - selected_values - ) + self.assert_util(custom.test_multiselect.get_values, selected_values) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_search_value_test_multiselect(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks multiple select seach funtionality""" + def test_custom_search_value_test_multiselect( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks multiple select seach funtionality""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) self.assert_util( custom.test_multiselect.search_get_list, ["Option A"], - left_args={'value': "Option A"} - ) + left_args={"value": "Option A"}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom - def test_custom_deselect_test_multiselect(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks deselect funtionality of multiple select""" + def test_custom_deselect_test_multiselect( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks deselect funtionality of multiple select""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_values = ["Option A", "Option B"] for each in selected_values: custom.test_multiselect.select(each) custom.test_multiselect.deselect("Option A") - self.assert_util( - custom.test_multiselect.get_values, - ["Option B"] - ) + self.assert_util(custom.test_multiselect.get_values, ["Option B"]) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.custom def test_custom_help_link(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks whether help link redirects to the correct URL""" + """This test case checks whether help link redirects to the correct URL""" custom = Custom(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) go_to_link = "https://docs.splunk.com/Documentation" with custom.test_help_link.open_link() as link_url: - self.assert_util( - custom.test_help_link.get_current_url, - go_to_link - ) \ No newline at end of file + self.assert_util(custom.test_help_link.get_current_url, go_to_link) diff --git a/tests/ui/test_splunk_ta_example_addon_input.py b/tests/ui/test_splunk_ta_example_addon_input.py index f6b2a90d..ac1a36e0 100644 --- a/tests/ui/test_splunk_ta_example_addon_input.py +++ b/tests/ui/test_splunk_ta_example_addon_input.py @@ -16,28 +16,30 @@ import os import json import copy -from base64 import b64decode +from base64 import b64decode @pytest.fixture(scope="module", autouse=True) def add_account(ucc_smartx_rest_helper): - account = AccountPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + account = AccountPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) url = account._get_account_endpoint() kwargs = { - 'name': 'test_input', - 'account_checkbox': 1, - 'account_multiple_select': 'one', - 'account_radio': 'yes', - 'auth_type': 'basic', - 'custom_endpoint': 'login.example.com', - 'username': 'TestUser', - 'password': "TestPassword", - 'token': "TestToken", - 'client_id': '', - 'client_secret': '', - 'redirect_url': '', - 'endpoint': '', - 'example_help_link': '' + "name": "test_input", + "account_checkbox": 1, + "account_multiple_select": "one", + "account_radio": "yes", + "auth_type": "basic", + "custom_endpoint": "login.example.com", + "username": "TestUser", + "password": "TestPassword", + "token": "TestToken", + "client_id": "", + "client_secret": "", + "redirect_url": "", + "endpoint": "", + "example_help_link": "", } yield account.backend_conf.post_stanza(url, kwargs) account.backend_conf.delete_all_stanzas() @@ -45,83 +47,94 @@ def add_account(ucc_smartx_rest_helper): @pytest.fixture def add_multiple_inputs(ucc_smartx_rest_helper): - input_page = InputPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + input_page = InputPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) url = input_page._get_input_endpoint() for i in range(50): kwargs = { - 'name': 'example_input_one://dummy_input_one' + str(i), - 'account':'test_input', - 'input_one_checkbox': '1', - 'input_one_radio': 'yes', - 'interval': '90', - 'limit': '1000', - 'multipleSelectTest': 'a|b', - 'object': 'test_object', - 'object_fields': 'test_field', - 'order_by': 'LastModifiedDate', - 'singleSelectTest': 'two', - 'start_date': '2020-12-11T20:00:32.000z', - 'disabled': 0, + "name": "example_input_one://dummy_input_one" + str(i), + "account": "test_input", + "input_one_checkbox": "1", + "input_one_radio": "yes", + "interval": "90", + "limit": "1000", + "multipleSelectTest": "a|b", + "object": "test_object", + "object_fields": "test_field", + "order_by": "LastModifiedDate", + "singleSelectTest": "two", + "start_date": "2020-12-11T20:00:32.000z", + "disabled": 0, } input_page.backend_conf.post_stanza(url, kwargs) kwargs = { - 'name': 'example_input_two://dummy_input_two' + str(i), - 'account':'test_input', - 'input_two_checkbox': '1', - 'input_two_radio': 'no', - 'interval': '100', - 'input_two_multiple_select': 'one,two', - 'index': 'main', - 'start_date': '2016-10-10T12:10:15.000z', - 'disabled': 0, + "name": "example_input_two://dummy_input_two" + str(i), + "account": "test_input", + "input_two_checkbox": "1", + "input_two_radio": "no", + "interval": "100", + "input_two_multiple_select": "one,two", + "index": "main", + "start_date": "2016-10-10T12:10:15.000z", + "disabled": 0, } input_page.backend_conf.post_stanza(url, kwargs) + @pytest.fixture def add_input_one(ucc_smartx_rest_helper): - input_page = InputPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + input_page = InputPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) url = input_page._get_input_endpoint() kwargs = { - 'name': 'example_input_one://dummy_input_one', - 'account':'test_input', - 'input_one_checkbox': '1', - 'input_one_radio': 'yes', - 'interval': '90', - 'limit': '1000', - 'multipleSelectTest': 'a|b', - 'object': 'test_object', - 'object_fields': 'test_field', - 'order_by': 'LastModifiedDate', - 'singleSelectTest': 'two', - 'start_date': '2020-12-11T20:00:32.000z', - 'disabled': 0, + "name": "example_input_one://dummy_input_one", + "account": "test_input", + "input_one_checkbox": "1", + "input_one_radio": "yes", + "interval": "90", + "limit": "1000", + "multipleSelectTest": "a|b", + "object": "test_object", + "object_fields": "test_field", + "order_by": "LastModifiedDate", + "singleSelectTest": "two", + "start_date": "2020-12-11T20:00:32.000z", + "disabled": 0, } yield input_page.backend_conf.post_stanza(url, kwargs) + @pytest.fixture def add_input_two(ucc_smartx_rest_helper): - input_page = InputPage(ucc_smartx_rest_helper = ucc_smartx_rest_helper, open_page=False) + input_page = InputPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) url = input_page._get_input_endpoint() kwargs = { - 'name': 'example_input_two://dummy_input_two', - 'account':'test_input', - 'input_two_checkbox': '1', - 'input_two_radio': 'no', - 'interval': '100', - 'input_two_multiple_select': 'one,two', - 'index': 'main', - 'start_date': '2016-10-10T12:10:15.000z', - 'disabled': 0, + "name": "example_input_two://dummy_input_two", + "account": "test_input", + "input_two_checkbox": "1", + "input_two_radio": "no", + "interval": "100", + "input_two_multiple_select": "one,two", + "index": "main", + "start_date": "2016-10-10T12:10:15.000z", + "disabled": 0, } yield input_page.backend_conf.post_stanza(url, kwargs) + @pytest.fixture(autouse=True) -#All the inputs created shoud start with dummy_input as prefix +# All the inputs created shoud start with dummy_input as prefix def delete_inputs(ucc_smartx_rest_helper): yield - input_page = InputPage(ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False) + input_page = InputPage( + ucc_smartx_rest_helper=ucc_smartx_rest_helper, open_page=False + ) input_page.backend_conf.delete_all_stanzas("search=dummy_input") - + class TestInput(UccTester): @@ -129,208 +142,241 @@ class TestInput(UccTester): ### TEST CASES FOR TABLE ### ############################ - @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_displayed_columns(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies headers of input table""" + def test_inputs_displayed_columns( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies headers of input table""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) header_list = ["Name", "Account", "Interval", "Index", "Status", "Actions"] - self.assert_util( - input_page.table.get_headers, - header_list - ) + self.assert_util(input_page.table.get_headers, header_list) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_pagination_list(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies pagination list""" + def test_inputs_pagination_list( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies pagination list""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) self.assert_util( input_page.pagination.get_pagination_list, - ['10 Per Page','25 Per Page','50 Per Page'] - ) + ["10 Per Page", "25 Per Page", "50 Per Page"], + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_pagination(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_inputs): - """ Verifies pagination functionality by creating 100 accounts""" + def test_inputs_pagination( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_inputs + ): + """Verifies pagination functionality by creating 100 accounts""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.open() - self.assert_util(input_page.pagination.select_page_option, True,left_args={'value':"50 Per Page"}) - self.assert_util(input_page.table.switch_to_page, True,left_args={'value': 2}) + self.assert_util( + input_page.pagination.select_page_option, + True, + left_args={"value": "50 Per Page"}, + ) + self.assert_util(input_page.table.switch_to_page, True, left_args={"value": 2}) self.assert_util(input_page.table.switch_to_prev, True) self.assert_util(input_page.table.switch_to_next, True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_sort_functionality(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one, add_input_two): - """ Verifies sorting functionality for name column""" + def test_inputs_sort_functionality( + self, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + add_input_one, + add_input_two, + ): + """Verifies sorting functionality for name column""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.pagination.select_page_option("50 Per Page") input_page.table.sort_column("Name") sort_order = input_page.table.get_sort_order() column_values = list(input_page.table.get_column_values("Name")) - column_values = list(str(item)for item in column_values) - sorted_values = sorted(column_values , key = str.lower) - self.assert_util( - sort_order["header"].lower(), - "name" - ) - self.assert_util( - column_values, - sorted_values - ) + column_values = list(str(item) for item in column_values) + sorted_values = sorted(column_values, key=str.lower) + self.assert_util(sort_order["header"].lower(), "name") + self.assert_util(column_values, sorted_values) self.assert_util(sort_order["ascending"], True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_filter_functionality_negative(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one, add_input_two): - """ Verifies the filter functionality (Negative)""" + def test_inputs_filter_functionality_negative( + self, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + add_input_one, + add_input_two, + ): + """Verifies the filter functionality (Negative)""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.set_filter("hello") self.assert_util(input_page.table.get_row_count, 0) self.assert_util( input_page.table.get_count_title, - "{} Input".format(input_page.table.get_row_count()) - ) + "{} Input".format(input_page.table.get_row_count()), + ) input_page.table.clean_filter() @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_filter_functionality_positive(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one, add_input_two): - """ Verifies the filter functionality (Positive)""" + def test_inputs_filter_functionality_positive( + self, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + add_input_one, + add_input_two, + ): + """Verifies the filter functionality (Positive)""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.set_filter("dummy") self.assert_util(input_page.table.get_row_count, 2) self.assert_util( input_page.table.get_count_title, - "{} Inputs".format(input_page.table.get_row_count()) - ) + "{} Inputs".format(input_page.table.get_row_count()), + ) input_page.table.clean_filter() @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_default_rows_in_table(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the default number of rows in the table""" + def test_inputs_default_rows_in_table( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the default number of rows in the table""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - input_page.table.get_row_count, - 0 - ) + self.assert_util(input_page.table.get_row_count, 0) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_create_new_input_list_values(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies input list dropdown""" + def test_inputs_create_new_input_list_values( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies input list dropdown""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) create_new_input_list = ["Example Input One", "Example Input Two"] self.assert_util( - input_page.create_new_input.get_inputs_list, - create_new_input_list - ) + input_page.create_new_input.get_inputs_list, create_new_input_list + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_input_type_list_values(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one, add_input_two): - """ Verifies input type filter list""" + def test_inputs_input_type_list_values( + self, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + add_input_one, + add_input_two, + ): + """Verifies input type filter list""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) type_filter_list = ["All", "Example Input One", "Example Input Two"] - self.assert_util( - input_page.type_filter.get_input_type_list, - type_filter_list - ) - input_page.type_filter.select_input_type("Example Input One", open_dropdown=False) - self.assert_util( - input_page.table.get_row_count, - 1 - ) + self.assert_util(input_page.type_filter.get_input_type_list, type_filter_list) + input_page.type_filter.select_input_type( + "Example Input One", open_dropdown=False + ) + self.assert_util(input_page.table.get_row_count, 1) input_page.type_filter.select_input_type("Example Input Two") - self.assert_util( - input_page.table.get_row_count, - 1 - ) + self.assert_util(input_page.table.get_row_count, 1) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_delete_enabled_input(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies enabled input should not delete""" + def test_inputs_delete_enabled_input( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies enabled input should not delete""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) self.assert_util( input_page.table.delete_row, r"Can't delete enabled input", - left_args={'name': "dummy_input_one"} - ) + left_args={"name": "dummy_input_one"}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_more_info(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the expand functionality of the inputs table""" + def test_inputs_more_info( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the expand functionality of the inputs table""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) self.assert_util( input_page.table.get_more_info, { - 'Name': 'dummy_input_one', - 'Interval': '90', - 'Index': 'default', - 'Status': 'Enabled', - 'Example Account': 'test_input', - 'Object': 'test_object', - 'Object Fields': 'test_field', - 'Order By': 'LastModifiedDate', - 'Query Start Date': '2020-12-11T20:00:32.000z', - 'Limit': '1000' - }, - left_args={'name': 'dummy_input_one'} - ) + "Name": "dummy_input_one", + "Interval": "90", + "Index": "default", + "Status": "Enabled", + "Example Account": "test_input", + "Object": "test_object", + "Object Fields": "test_field", + "Order By": "LastModifiedDate", + "Query Start Date": "2020-12-11T20:00:32.000z", + "Limit": "1000", + }, + left_args={"name": "dummy_input_one"}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_enable_disable(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the enable and disable functionality of the input""" + def test_inputs_enable_disable( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the enable and disable functionality of the input""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util(input_page.table.input_status_toggle, True, left_args={"name":"dummy_input_one", "enable":False}) - self.assert_util(input_page.table.input_status_toggle, True, left_args={"name":"dummy_input_one", "enable":True}) - + self.assert_util( + input_page.table.input_status_toggle, + True, + left_args={"name": "dummy_input_one", "enable": False}, + ) + self.assert_util( + input_page.table.input_status_toggle, + True, + left_args={"name": "dummy_input_one", "enable": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_count(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one, add_input_two): - """ Verifies count on table""" + def test_inputs_count( + self, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + add_input_one, + add_input_two, + ): + """Verifies count on table""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) self.assert_util( input_page.table.get_count_title, - "{} Inputs".format(input_page.table.get_row_count()) - ) - + "{} Inputs".format(input_page.table.get_row_count()), + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_inputs_title_and_description(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the title and description of the page""" + def test_inputs_title_and_description( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the title and description of the page""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + self.assert_util(input_page.title.wait_to_display, "Inputs") self.assert_util( - input_page.title.wait_to_display, - "Inputs" - ) - self.assert_util( - input_page.description.wait_to_display, - "Manage your data inputs" - ) + input_page.description.wait_to_display, "Manage your data inputs" + ) ########################################## #### TEST CASES FOR EXAMPLE INPUT ONE #### @@ -339,8 +385,10 @@ def test_inputs_title_and_description(self, ucc_smartx_selenium_helper, ucc_smar @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_required_field_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field name in example input one""" + def test_example_input_one_required_field_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field name in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -350,109 +398,118 @@ def test_example_input_one_required_field_name(self, ucc_smartx_selenium_helper, input_page.entity1.example_account.select("test_input") input_page.entity1.object.set_value("test_object") input_page.entity1.object_fields.set_value("test_field") - input_page.entity1.query_start_date.set_value("2020-12-11T20:00:32.000z") + input_page.entity1.query_start_date.set_value("2020-12-11T20:00:32.000z") self.assert_util( input_page.entity1.save, r"Field Name is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_valid_length_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the name field should not be more than 100 characters""" + def test_example_input_one_valid_length_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the name field should not be more than 100 characters""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() - name_value = "a"* 101 + input_page.entity1.example_account.wait_for_values() + name_value = "a" * 101 input_page.entity1.name.set_value(name_value) self.assert_util( input_page.entity1.save, r"Length of input name should be between 1 and 100", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_valid_input_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether adding special characters, name field displays validation error""" + def test_example_input_one_valid_input_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether adding special characters, name field displays validation error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() input_page.entity1.name.set_value("$$test_name") self.assert_util( input_page.entity1.save, r"Input Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_list_single_select_group_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies values Single Select Group Test dropdown in example input one""" + def test_example_input_one_list_single_select_group_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies values Single Select Group Test dropdown in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) single_select_group_test_list = ["One", "Two", "Three", "Four"] input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() self.assert_util( input_page.entity1.single_select_group_test.list_of_values(), - single_select_group_test_list - ) + single_select_group_test_list, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_select_value_single_select_group_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies selected value of Single Select Group Test dropdown in example input one""" + def test_example_input_one_select_value_single_select_group_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies selected value of Single Select Group Test dropdown in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_value = "Two" input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() input_page.entity1.single_select_group_test.select(selected_value) self.assert_util( - input_page.entity1.single_select_group_test.get_value, - selected_value - ) + input_page.entity1.single_select_group_test.get_value, selected_value + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_search_value_single_select_group_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies singleselect seach funtionality properly""" + def test_example_input_one_search_value_single_select_group_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies singleselect seach funtionality properly""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() self.assert_util( input_page.entity1.single_select_group_test.search_get_list, ["one", "One"], - left_args={'value': 'one'}, - ) + left_args={"value": "one"}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_default_value_multiple_select_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default values of Multiple Select Test dropdown in example input one""" + def test_example_input_one_default_value_multiple_select_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default values of Multiple Select Test dropdown in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() default_values = ["A", "B"] self.assert_util( - input_page.entity1.multiple_select_test.get_values, - default_values - ) + input_page.entity1.multiple_select_test.get_values, default_values + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_list_multiple_select_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies values of Multiple Select Test dropdown in example input one""" + def test_example_input_one_list_multiple_select_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies values of Multiple Select Test dropdown in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -460,14 +517,16 @@ def test_example_input_one_list_multiple_select_test(self, ucc_smartx_selenium_h multiple_select_test = ["A", "B"] self.assert_util( input_page.entity1.multiple_select_test.list_of_values(), - multiple_select_test - ) + multiple_select_test, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_select_value_multiple_select_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies selected single value of Multiple Select Test dropdown in example input one""" + def test_example_input_one_select_value_multiple_select_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies selected single value of Multiple Select Test dropdown in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_value = ["A"] input_page.create_new_input.select("Example Input One") @@ -476,15 +535,16 @@ def test_example_input_one_select_value_multiple_select_test(self, ucc_smartx_se for each in selected_value: input_page.entity1.multiple_select_test.select(each) self.assert_util( - input_page.entity1.multiple_select_test.get_values, - selected_value - ) + input_page.entity1.multiple_select_test.get_values, selected_value + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_select_multiple_values_multiple_select_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies selected multiple values of Multiple Select Test dropdown in example input one""" + def test_example_input_one_select_multiple_values_multiple_select_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies selected multiple values of Multiple Select Test dropdown in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_values = ["A", "B"] input_page.create_new_input.select("Example Input One") @@ -493,15 +553,16 @@ def test_example_input_one_select_multiple_values_multiple_select_test(self, ucc for each in selected_values: input_page.entity1.multiple_select_test.select(each) self.assert_util( - input_page.entity1.multiple_select_test.get_values, - selected_values - ) + input_page.entity1.multiple_select_test.get_values, selected_values + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_deselect_multiple_select_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies deselect in Multiple Select Test dropdown in example input one""" + def test_example_input_one_deselect_multiple_select_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies deselect in Multiple Select Test dropdown in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_values = ["A", "B"] input_page.create_new_input.select("Example Input One") @@ -510,16 +571,15 @@ def test_example_input_one_deselect_multiple_select_test(self, ucc_smartx_seleni for each in selected_values: input_page.entity1.multiple_select_test.select(each) input_page.entity1.multiple_select_test.deselect("A") - self.assert_util( - input_page.entity1.multiple_select_test.get_values, - ["B"] - ) + self.assert_util(input_page.entity1.multiple_select_test.get_values, ["B"]) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_search_value_multiple_select_test(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies multiple select seach funtionality properly""" + def test_example_input_one_search_value_multiple_select_test( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies multiple select seach funtionality properly""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -527,73 +587,79 @@ def test_example_input_one_search_value_multiple_select_test(self, ucc_smartx_se self.assert_util( input_page.entity1.multiple_select_test.search_get_list, ["A"], - left_args={'value': 'A'} - ) + left_args={"value": "A"}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_default_value_example_checkbox(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of example checkbox in example input one""" + def test_example_input_one_default_value_example_checkbox( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of example checkbox in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() self.assert_util(input_page.entity1.example_checkbox.is_checked, True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_unchecked_example_checkbox(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies Uncheck in example checkbox in example input one""" + def test_example_input_one_unchecked_example_checkbox( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies Uncheck in example checkbox in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() input_page.entity1.example_checkbox.check() self.assert_util(input_page.entity1.example_checkbox.uncheck, True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_checked_example_checkbox(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies checked in example checkbox in example input one""" + def test_example_input_one_checked_example_checkbox( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies checked in example checkbox in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() input_page.entity1.example_checkbox.uncheck() self.assert_util(input_page.entity1.example_checkbox.check, True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_default_value_example_radio(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of example radio in example input one""" + def test_example_input_one_default_value_example_radio( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of example radio in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() - self.assert_util( - input_page.entity1.example_radio.get_value, - "Yes" - ) + input_page.entity1.example_account.wait_for_values() + self.assert_util(input_page.entity1.example_radio.get_value, "Yes") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_select_value_example_radio(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies selected value of example radio in example input one""" + def test_example_input_one_select_value_example_radio( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies selected value of example radio in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() input_page.entity1.example_radio.select("No") - self.assert_util( - input_page.entity1.example_radio.get_value, - "No" - ) + self.assert_util(input_page.entity1.example_radio.get_value, "No") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_required_field_interval(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field interval in example input one""" + def test_example_input_one_required_field_interval( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field interval in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -607,19 +673,20 @@ def test_example_input_one_required_field_interval(self, ucc_smartx_selenium_hel self.assert_util( input_page.entity1.save, r"Field Interval is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_valid_input_interval(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether adding non numeric values, intreval field displays validation error""" + def test_example_input_one_valid_input_interval( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether adding non numeric values, intreval field displays validation error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() - input_page.entity1.example_account.select("test_input") + input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.select("test_input") input_page.entity1.object.set_value("test_object") input_page.entity1.name.set_value("test_name") input_page.entity1.object_fields.set_value("test_field") @@ -627,15 +694,16 @@ def test_example_input_one_valid_input_interval(self, ucc_smartx_selenium_helper self.assert_util( input_page.entity1.save, r"Interval must be an integer.", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_required_field_index(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field index in example input one""" + def test_example_input_one_required_field_index( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field index in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -651,29 +719,29 @@ def test_example_input_one_required_field_index(self, ucc_smartx_selenium_helper self.assert_util( input_page.entity1.save, r"Field Index is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_default_value_index(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of field index in example input one""" + def test_example_input_one_default_value_index( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of field index in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) default_index = "default" input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() - self.assert_util( - input_page.entity1.index.get_value, - default_index - ) + input_page.entity1.example_account.wait_for_values() + self.assert_util(input_page.entity1.index.get_value, default_index) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_required_field_example_account(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field Salesforce Account in example input one""" + def test_example_input_one_required_field_example_account( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field Salesforce Account in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -687,15 +755,16 @@ def test_example_input_one_required_field_example_account(self, ucc_smartx_selen self.assert_util( input_page.entity1.save, r"Field Example Account is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_required_field_object(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field Object in example input one""" + def test_example_input_one_required_field_object( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field Object in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -709,15 +778,16 @@ def test_example_input_one_required_field_object(self, ucc_smartx_selenium_helpe self.assert_util( input_page.entity1.save, r"Field Object is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_required_field_object_fields(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field Object Fields in example input one""" + def test_example_input_one_required_field_object_fields( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field Object Fields in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -731,15 +801,16 @@ def test_example_input_one_required_field_object_fields(self, ucc_smartx_seleniu self.assert_util( input_page.entity1.save, r"Field Object Fields is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_required_field_order_by(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field Order By in example input one""" + def test_example_input_one_required_field_order_by( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field Order By in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -755,201 +826,172 @@ def test_example_input_one_required_field_order_by(self, ucc_smartx_selenium_hel self.assert_util( input_page.entity1.save, r"Field Order By is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_default_value_order_by(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of field Order By in example input one""" + def test_example_input_one_default_value_order_by( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of field Order By in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) default_order_by = "LastModifiedDate" input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() - self.assert_util( - input_page.entity1.order_by.get_value, - default_order_by - ) + input_page.entity1.example_account.wait_for_values() + self.assert_util(input_page.entity1.order_by.get_value, default_order_by) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_fields_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies example input one field label""" + def test_example_input_one_fields_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies example input one field label""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") + self.assert_util(input_page.entity1.name.get_input_label, "Name") self.assert_util( - input_page.entity1.name.get_input_label, - 'Name' - ) - self.assert_util( - input_page.entity1.example_checkbox.get_input_label, - 'Example Checkbox' - ) + input_page.entity1.example_checkbox.get_input_label, "Example Checkbox" + ) self.assert_util( - input_page.entity1.example_radio.get_input_label, - 'Example Radio' - ) + input_page.entity1.example_radio.get_input_label, "Example Radio" + ) self.assert_util( input_page.entity1.single_select_group_test.get_input_label, - 'Single Select Group Test' - ) + "Single Select Group Test", + ) self.assert_util( input_page.entity1.multiple_select_test.get_input_label, - 'Multiple Select Test' - ) - self.assert_util( - input_page.entity1.interval.get_input_label, - 'Interval' - ) - self.assert_util( - input_page.entity1.index.get_input_label, - 'Index' - ) - self.assert_util( - input_page.entity1.example_account.get_input_label, - 'Example Account' - ) - self.assert_util( - input_page.entity1.object.get_input_label, - 'Object' - ) - self.assert_util( - input_page.entity1.object_fields.get_input_label, - 'Object Fields' - ) + "Multiple Select Test", + ) + self.assert_util(input_page.entity1.interval.get_input_label, "Interval") + self.assert_util(input_page.entity1.index.get_input_label, "Index") self.assert_util( - input_page.entity1.order_by.get_input_label, - 'Order By' - ) + input_page.entity1.example_account.get_input_label, "Example Account" + ) + self.assert_util(input_page.entity1.object.get_input_label, "Object") self.assert_util( - input_page.entity1.query_start_date.get_input_label, - 'Query Start Date' - ) + input_page.entity1.object_fields.get_input_label, "Object Fields" + ) + self.assert_util(input_page.entity1.order_by.get_input_label, "Order By") self.assert_util( - input_page.entity1.limit.get_input_label, - 'Limit' - ) + input_page.entity1.query_start_date.get_input_label, "Query Start Date" + ) + self.assert_util(input_page.entity1.limit.get_input_label, "Limit") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_fields_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies example input two field label""" + def test_example_input_two_fields_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies example input two field label""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") + self.assert_util(input_page.entity2.name.get_input_label, "Name") + self.assert_util(input_page.entity2.interval.get_input_label, "Interval") + self.assert_util(input_page.entity2.index.get_input_label, "Index") self.assert_util( - input_page.entity2.name.get_input_label, - 'Name' - ) - self.assert_util( - input_page.entity2.interval.get_input_label, - 'Interval' - ) - self.assert_util( - input_page.entity2.index.get_input_label, - 'Index' - ) - self.assert_util( - input_page.entity2.example_account.get_input_label, - 'Example Account' - ) + input_page.entity2.example_account.get_input_label, "Example Account" + ) self.assert_util( input_page.entity2.example_multiple_select.get_input_label, - 'Example Multiple Select' - ) + "Example Multiple Select", + ) self.assert_util( - input_page.entity2.example_checkbox.get_input_label, - 'Example Checkbox' - ) + input_page.entity2.example_checkbox.get_input_label, "Example Checkbox" + ) self.assert_util( - input_page.entity2.example_radio.get_input_label, - 'Example Radio' - ) + input_page.entity2.example_radio.get_input_label, "Example Radio" + ) self.assert_util( - input_page.entity2.query_start_date.get_input_label, - 'Query Start Date' - ) - + input_page.entity2.query_start_date.get_input_label, "Query Start Date" + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_fields_placeholder_value(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies example input one field placeholder value""" + def test_example_input_one_fields_placeholder_value( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies example input one field placeholder value""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") self.assert_util( - input_page.entity1.query_start_date.get_placeholder_value, - 'optional' - ) - + input_page.entity1.query_start_date.get_placeholder_value, "optional" + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_fields_placeholder_value(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies example input two field placeholder value""" + def test_example_input_two_fields_placeholder_value( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies example input two field placeholder value""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") self.assert_util( - input_page.entity1.query_start_date.get_placeholder_value, - 'optional' - ) + input_page.entity1.query_start_date.get_placeholder_value, "optional" + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_help_text_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies help text for the field name""" + def test_example_input_one_help_text_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies help text for the field name""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() self.assert_util( - input_page.entity1.name.get_help_text, - 'A unique name for the data input.' - ) + input_page.entity1.name.get_help_text, "A unique name for the data input." + ) self.assert_util( input_page.entity1.example_checkbox.get_help_text, - 'This is an example checkbox for the input one entity' - ) + "This is an example checkbox for the input one entity", + ) self.assert_util( input_page.entity1.example_radio.get_help_text, - 'This is an example radio button for the input one entity' - ) + "This is an example radio button for the input one entity", + ) self.assert_util( input_page.entity1.interval.get_help_text, - 'Time interval of the data input, in seconds.' - ) + "Time interval of the data input, in seconds.", + ) self.assert_util( input_page.entity1.object.get_help_text, - 'The name of the object to query for.' - ) + "The name of the object to query for.", + ) self.assert_util( input_page.entity1.object_fields.get_help_text, - 'Object fields from which to collect data. Delimit multiple fields using a comma.' - ) + "Object fields from which to collect data. Delimit multiple fields using a comma.", + ) self.assert_util( input_page.entity1.query_start_date.get_help_text, - 'The datetime after which to query and index records, in this format: "YYYY-MM-DDThh:mm:ss.000z". Defaults to 90 days earlier from now.' - ) + 'The datetime after which to query and index records, in this format: "YYYY-MM-DDThh:mm:ss.000z". Defaults to 90 days earlier from now.', + ) self.assert_util( input_page.entity1.limit.get_help_text, - 'The maximum number of results returned by the query.' - ) + "The maximum number of results returned by the query.", + ) self.assert_util( input_page.entity1.order_by.get_help_text, - 'The datetime field by which to query results in ascending order for indexing.' - ) + "The datetime field by which to query results in ascending order for indexing.", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_valid_input_query_start_date(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether adding wrong format, Query Start Date field displays validation error""" + def test_example_input_one_valid_input_query_start_date( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether adding wrong format, Query Start Date field displays validation error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() input_page.entity1.name.set_value("test_name") input_page.entity1.interval.set_value("120") input_page.entity1.example_account.select("test_input") @@ -959,39 +1001,35 @@ def test_example_input_one_valid_input_query_start_date(self, ucc_smartx_seleniu self.assert_util( input_page.entity1.save, r"Invalid date and time format", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_default_value_limit(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of field limit in example input one""" + def test_example_input_one_default_value_limit( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of field limit in example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) default_limit = "1000" input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() - self.assert_util( - input_page.entity1.limit.get_value, - default_limit - ) + input_page.entity1.example_account.wait_for_values() + self.assert_util(input_page.entity1.limit.get_value, default_limit) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_help_link(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether the help link redirects to the correct URL""" + def test_example_input_one_help_link( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether the help link redirects to the correct URL""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) go_to_link = "https://docs.splunk.com/Documentation" input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() with input_page.entity1.help_link.open_link() as link_url: - self.assert_util( - input_page.entity1.help_link.get_current_url, - go_to_link - ) - + self.assert_util(input_page.entity1.help_link.get_current_url, go_to_link) ################################### #### TEST CASES FOR ENTITY ONE #### @@ -1001,8 +1039,10 @@ def test_example_input_one_help_link(self, ucc_smartx_selenium_helper, ucc_smart @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_add_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the frontend after adding a Example Input One""" + def test_example_input_one_add_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the frontend after adding a Example Input One""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -1017,16 +1057,16 @@ def test_example_input_one_add_frontend_validation(self, ucc_smartx_selenium_hel self.assert_util(input_page.entity1.save, True) input_page.table.wait_for_rows_to_appear(1) self.assert_util( - input_page.table.get_table()["dummy_input"] , + input_page.table.get_table()["dummy_input"], { - 'name': 'dummy_input', - 'account': 'test_input', - 'interval': '90', - 'index': 'default', - 'status': 'Enabled', - 'actions': 'Edit | Clone | Delete', - } - ) + "name": "dummy_input", + "account": "test_input", + "interval": "90", + "index": "default", + "status": "Enabled", + "actions": "Edit | Clone | Delete", + }, + ) url = input_page._get_input_endpoint() @@ -1034,8 +1074,10 @@ def test_example_input_one_add_frontend_validation(self, ucc_smartx_selenium_hel @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_add_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the backend after adding a example input one""" + def test_example_input_one_add_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the backend after adding a example input one""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") input_page.entity1.example_account.wait_for_values() @@ -1050,33 +1092,36 @@ def test_example_input_one_add_backend_validation(self, ucc_smartx_selenium_help self.assert_util(input_page.entity1.save, True) input_page.table.wait_for_rows_to_appear(1) value_to_test = { - 'account': 'test_input', - 'input_one_checkbox': '1', - 'input_one_radio': '0', - 'interval': '90', - 'limit': '1000', - 'multipleSelectTest': 'a|b', - 'object': 'test_object', - 'object_fields': 'test_field', - 'order_by': 'LastModifiedDate', - 'singleSelectTest': 'two', - 'start_date': '2020-12-11T20:00:32.000z', - 'disabled': 0, - } - backend_stanza = input_page.backend_conf.get_stanza("example_input_one://dummy_input") + "account": "test_input", + "input_one_checkbox": "1", + "input_one_radio": "0", + "interval": "90", + "limit": "1000", + "multipleSelectTest": "a|b", + "object": "test_object", + "object_fields": "test_field", + "order_by": "LastModifiedDate", + "singleSelectTest": "two", + "start_date": "2020-12-11T20:00:32.000z", + "disabled": 0, + } + backend_stanza = input_page.backend_conf.get_stanza( + "example_input_one://dummy_input" + ) for each_key, each_value in value_to_test.items(): assert each_key in backend_stanza self.assert_util( - each_value , - backend_stanza[each_key], - ) - + each_value, + backend_stanza[each_key], + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_edit_uneditable_field_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the frontend uneditable fields at time of edit of the example input one entity""" + def test_example_input_one_edit_uneditable_field_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the frontend uneditable fields at time of edit of the example input one entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_one") self.assert_util(input_page.entity1.name.is_editable, False) @@ -1085,8 +1130,10 @@ def test_example_input_one_edit_uneditable_field_name(self, ucc_smartx_selenium_ @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_edit_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the frontend edit functionality of the example input one entity""" + def test_example_input_one_edit_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the frontend edit functionality of the example input one entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_one") input_page.entity1.example_account.wait_for_values() @@ -1105,23 +1152,25 @@ def test_example_input_one_edit_frontend_validation(self, ucc_smartx_selenium_he self.assert_util(input_page.entity1.save, True) input_page.table.wait_for_rows_to_appear(1) self.assert_util( - input_page.table.get_table()["dummy_input_one"] , + input_page.table.get_table()["dummy_input_one"], { - 'name': "dummy_input_one", - 'account': 'test_input', - 'interval': '3600', - 'index': 'main', - 'status': 'Enabled', - 'actions': 'Edit | Clone | Delete' - } - ) + "name": "dummy_input_one", + "account": "test_input", + "interval": "3600", + "index": "main", + "status": "Enabled", + "actions": "Edit | Clone | Delete", + }, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_edit_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the backend edit functionality of the example input one entity""" + def test_example_input_one_edit_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the backend edit functionality of the example input one entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_one") input_page.entity1.example_account.wait_for_values() @@ -1140,91 +1189,60 @@ def test_example_input_one_edit_backend_validation(self, ucc_smartx_selenium_hel self.assert_util(input_page.entity1.save, True) input_page.table.wait_for_rows_to_appear(1) value_to_test = { - 'account': 'test_input', - 'input_one_checkbox': '0', - 'input_one_radio': '0', - 'interval': '3600', - 'index': 'main', - 'limit': '2000', - 'multipleSelectTest': 'a', - 'object': 'edit_object', - 'object_fields': 'edit_field', - 'order_by': 'LastDate', - 'singleSelectTest': 'four', - 'start_date': '2020-20-20T20:20:20.000z', - 'disabled': 0, - } - backend_stanza = input_page.backend_conf.get_stanza("example_input_one://dummy_input_one") + "account": "test_input", + "input_one_checkbox": "0", + "input_one_radio": "0", + "interval": "3600", + "index": "main", + "limit": "2000", + "multipleSelectTest": "a", + "object": "edit_object", + "object_fields": "edit_field", + "order_by": "LastDate", + "singleSelectTest": "four", + "start_date": "2020-20-20T20:20:20.000z", + "disabled": 0, + } + backend_stanza = input_page.backend_conf.get_stanza( + "example_input_one://dummy_input_one" + ) for each_key, each_value in value_to_test.items(): - self.assert_util( - each_value, - backend_stanza[each_key] - ) + self.assert_util(each_value, backend_stanza[each_key]) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_clone_default_values(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the frontend default fields at time of clone for example input one entity""" + def test_example_input_one_clone_default_values( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the frontend default fields at time of clone for example input one entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_one") input_page.entity1.example_account.wait_for_values() - self.assert_util( - input_page.entity1.name.get_value, - "" - ) + self.assert_util(input_page.entity1.name.get_value, "") self.assert_util(input_page.entity1.example_checkbox.is_checked, True) + self.assert_util(input_page.entity1.example_radio.get_value, "Yes") + self.assert_util(input_page.entity1.single_select_group_test.get_value, "Two") + self.assert_util(input_page.entity1.multiple_select_test.get_values, ["A", "B"]) + self.assert_util(input_page.entity1.interval.get_value, "90") + self.assert_util(input_page.entity1.index.get_value, "default") + self.assert_util(input_page.entity1.example_account.get_value, "test_input") + self.assert_util(input_page.entity1.object.get_value, "test_object") + self.assert_util(input_page.entity1.object_fields.get_value, "test_field") + self.assert_util(input_page.entity1.order_by.get_value, "LastModifiedDate") self.assert_util( - input_page.entity1.example_radio.get_value, - "Yes" - ) - self.assert_util( - input_page.entity1.single_select_group_test.get_value, - "Two" - ) - self.assert_util( - input_page.entity1.multiple_select_test.get_values, - ["A", "B"] - ) - self.assert_util( - input_page.entity1.interval.get_value, - "90" - ) - self.assert_util( - input_page.entity1.index.get_value, - "default" - ) - self.assert_util( - input_page.entity1.example_account.get_value, - "test_input" - ) - self.assert_util( - input_page.entity1.object.get_value, - "test_object" - ) - self.assert_util( - input_page.entity1.object_fields.get_value, - "test_field" - ) - self.assert_util( - input_page.entity1.order_by.get_value, - "LastModifiedDate" - ) - self.assert_util( - input_page.entity1.query_start_date.get_value, - "2020-12-11T20:00:32.000z" - ) - self.assert_util( - input_page.entity1.limit.get_value, - "1000" - ) + input_page.entity1.query_start_date.get_value, "2020-12-11T20:00:32.000z" + ) + self.assert_util(input_page.entity1.limit.get_value, "1000") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_clone_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the frontend clone functionality of the example input one entity""" + def test_example_input_one_clone_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the frontend clone functionality of the example input one entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.wait_for_rows_to_appear(1) input_page.table.clone_row("dummy_input_one") @@ -1235,23 +1253,25 @@ def test_example_input_one_clone_frontend_validation(self, ucc_smartx_selenium_h self.assert_util(input_page.entity1.save, True) input_page.table.wait_for_rows_to_appear(2) self.assert_util( - input_page.table.get_table()["dummy_input_one_Clone_Test"] , + input_page.table.get_table()["dummy_input_one_Clone_Test"], { - 'name': 'dummy_input_one_Clone_Test', - 'account': 'test_input', - 'interval': '180', - 'index': 'default', - 'status': 'Enabled', - 'actions': 'Edit | Clone | Delete', - } - ) + "name": "dummy_input_one_Clone_Test", + "account": "test_input", + "interval": "180", + "index": "default", + "status": "Enabled", + "actions": "Edit | Clone | Delete", + }, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_clone_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the backend clone functionality of the example input one entity""" + def test_example_input_one_clone_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the backend clone functionality of the example input one entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.wait_for_rows_to_appear(1) input_page.table.clone_row("dummy_input_one") @@ -1262,49 +1282,48 @@ def test_example_input_one_clone_backend_validation(self, ucc_smartx_selenium_he self.assert_util(input_page.entity1.save, True) input_page.table.wait_for_rows_to_appear(2) value_to_test = { - 'account': 'test_input', - 'input_one_checkbox': '1', - 'input_one_radio': '1', - 'interval': '180', - 'index': 'default', - 'limit': '500', - 'multipleSelectTest': 'a|b', - 'object': 'test_object', - 'object_fields': 'test_field', - 'order_by': 'LastModifiedDate', - 'singleSelectTest': 'two', - 'start_date': '2020-12-11T20:00:32.000z', - 'disabled': 0, - } - backend_stanza = input_page.backend_conf.get_stanza("example_input_one://dummy_input_one_Clone_Test") + "account": "test_input", + "input_one_checkbox": "1", + "input_one_radio": "1", + "interval": "180", + "index": "default", + "limit": "500", + "multipleSelectTest": "a|b", + "object": "test_object", + "object_fields": "test_field", + "order_by": "LastModifiedDate", + "singleSelectTest": "two", + "start_date": "2020-12-11T20:00:32.000z", + "disabled": 0, + } + backend_stanza = input_page.backend_conf.get_stanza( + "example_input_one://dummy_input_one_Clone_Test" + ) for each_key, each_value in value_to_test.items(): - self.assert_util( - each_value , - backend_stanza[each_key] - ) + self.assert_util(each_value, backend_stanza[each_key]) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_delete_row_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the frontend delete functionlity""" + def test_example_input_one_delete_row_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the frontend delete functionlity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.input_status_toggle("dummy_input_one", enable=False) input_page.table.delete_row("dummy_input_one") input_page.table.wait_for_rows_to_appear(0) - self.assert_util( - "dummy_input_one", - input_page.table.get_table, - "not in" - ) + self.assert_util("dummy_input_one", input_page.table.get_table, "not in") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_one_delete_row_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the backend delete functionlity""" + def test_example_input_one_delete_row_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the backend delete functionlity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.input_status_toggle("dummy_input_one", enable=False) input_page.table.delete_row("dummy_input_one") @@ -1312,24 +1331,28 @@ def test_example_input_one_delete_row_backend_validation(self, ucc_smartx_seleni self.assert_util( "example_input_one://dummy_input_one", input_page.backend_conf.get_all_stanzas().keys(), - "not in" - ) + "not in", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_add_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies close functionality at time of add""" + def test_example_input_one_add_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies close functionality at time of add""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() self.assert_util(input_page.entity1.close, True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_edit_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies close functionality at time of edit""" + def test_example_input_one_edit_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies close functionality at time of edit""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_one") self.assert_util(input_page.entity1.close, True) @@ -1337,8 +1360,10 @@ def test_example_input_one_edit_close_entity(self, ucc_smartx_selenium_helper, u @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_clone_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies close functionality at time of clone""" + def test_example_input_one_clone_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies close functionality at time of clone""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_one") self.assert_util(input_page.entity1.close, True) @@ -1346,26 +1371,36 @@ def test_example_input_one_clone_close_entity(self, ucc_smartx_selenium_helper, @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_delete_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies close functionality at time of delete""" + def test_example_input_one_delete_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies close functionality at time of delete""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util(input_page.table.delete_row, True, left_args={"name":"dummy_input_one", "close":True}) + self.assert_util( + input_page.table.delete_row, + True, + left_args={"name": "dummy_input_one", "close": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_add_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies cancel functionality at time of add""" + def test_example_input_one_add_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies cancel functionality at time of add""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() self.assert_util(input_page.entity1.cancel, True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_edit_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies cancel functionality at time of edit""" + def test_example_input_one_edit_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies cancel functionality at time of edit""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_one") self.assert_util(input_page.entity1.cancel, True) @@ -1373,8 +1408,10 @@ def test_example_input_one_edit_cancel_entity(self, ucc_smartx_selenium_helper, @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_clone_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies cancel functionality at time of clone""" + def test_example_input_one_clone_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies cancel functionality at time of clone""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_one") self.assert_util(input_page.entity1.cancel, True) @@ -1382,33 +1419,42 @@ def test_example_input_one_clone_cancel_entity(self, ucc_smartx_selenium_helper, @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_delete_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies cancel functionality at time of delete""" + def test_example_input_one_delete_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies cancel functionality at time of delete""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util(input_page.table.delete_row, True, left_args={"name":"dummy_input_one", "cancel":True}) + self.assert_util( + input_page.table.delete_row, + True, + left_args={"name": "dummy_input_one", "cancel": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_add_duplicate_names(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies by saving an entity with duplicate name it displays and error""" + def test_example_input_one_add_duplicate_names( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies by saving an entity with duplicate name it displays and error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() input_name = "dummy_input_one" input_page.entity1.name.set_value(input_name) self.assert_util( input_page.entity1.save, "Name {} is already in use".format(input_name), - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_clone_duplicate_names(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies by saving an entity with duplicate name at time of clone it displays and error""" + def test_example_input_one_clone_duplicate_names( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies by saving an entity with duplicate name at time of clone it displays and error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_one") input_page.entity1.example_account.wait_for_values() @@ -1417,72 +1463,79 @@ def test_example_input_one_clone_duplicate_names(self, ucc_smartx_selenium_helpe self.assert_util( input_page.entity1.save, "Name {} is already in use".format(input_name), - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_add_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the title of the 'Add Entity'""" + def test_example_input_one_add_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the title of the 'Add Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input One") - input_page.entity1.example_account.wait_for_values() + input_page.entity1.example_account.wait_for_values() self.assert_util( - input_page.entity1.title.container.get_attribute('textContent').strip(), - "Add Example Input One" - ) + input_page.entity1.title.container.get_attribute("textContent").strip(), + "Add Example Input One", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_edit_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the title of the 'Edit Entity'""" + def test_example_input_one_edit_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the title of the 'Edit Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_one") self.assert_util( - input_page.entity1.title.container.get_attribute('textContent').strip(), - "Update Example Input One" - ) + input_page.entity1.title.container.get_attribute("textContent").strip(), + "Update Example Input One", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_clone_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the title of the 'Clone Entity'""" + def test_example_input_one_clone_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the title of the 'Clone Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_one") self.assert_util( - input_page.entity1.title.container.get_attribute('textContent').strip(), - "Clone Example Input One" - ) + input_page.entity1.title.container.get_attribute("textContent").strip(), + "Clone Example Input One", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_delete_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the title of the 'Delete Entity'""" + def test_example_input_one_delete_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the title of the 'Delete Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.delete_row("dummy_input_one", prompt_msg=True) self.assert_util( - input_page.entity1.title.container.get_attribute('textContent').strip(), - "Delete Confirmation" - ) + input_page.entity1.title.container.get_attribute("textContent").strip(), + "Delete Confirmation", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_one_delete_valid_prompt_message(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one): - """ Verifies the prompt message of the 'Delete Entity'""" + def test_example_input_one_delete_valid_prompt_message( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one + ): + """Verifies the prompt message of the 'Delete Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_name = "dummy_input_one" prompt_message = input_page.table.delete_row("dummy_input_one", prompt_msg=True) self.assert_util( - prompt_message , - 'Are you sure you want to delete "{}" ?'.format(input_name) - ) - + prompt_message, 'Are you sure you want to delete "{}" ?'.format(input_name) + ) ########################################## #### TEST CASES FOR EXAMPLE INPUT TWO #### @@ -1491,8 +1544,10 @@ def test_example_input_one_delete_valid_prompt_message(self, ucc_smartx_selenium @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_required_field_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field name in Example Input Two""" + def test_example_input_two_required_field_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field name in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1502,37 +1557,40 @@ def test_example_input_two_required_field_name(self, ucc_smartx_selenium_helper, input_page.entity2.index.select("main") input_page.entity2.interval.set_value("90") input_page.entity2.example_account.select("test_input") - input_page.entity2.query_start_date.set_value("2020-12-11T20:00:32.000z") + input_page.entity2.query_start_date.set_value("2020-12-11T20:00:32.000z") self.assert_util( input_page.entity2.save, r"Field Name is required", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) input_page.entity2.name.set_value("test_name_two") self.assert_util(input_page.entity2.is_error_closed, True) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_valid_length_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the name field should not be more than 100 characters""" + def test_example_input_two_valid_length_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the name field should not be more than 100 characters""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() - name_value = "a"* 101 + name_value = "a" * 101 input_page.entity2.name.set_value(name_value) self.assert_util( input_page.entity2.save, r"Length of input name should be between 1 and 100", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_valid_input_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether adding special characters, name field displays validation error""" + def test_example_input_two_valid_input_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether adding special characters, name field displays validation error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1540,15 +1598,16 @@ def test_example_input_two_valid_input_name(self, ucc_smartx_selenium_helper, uc self.assert_util( input_page.entity2.save, r"Input Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_required_field_interval(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field interval in Example Input Two""" + def test_example_input_two_required_field_interval( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field interval in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1562,15 +1621,16 @@ def test_example_input_two_required_field_interval(self, ucc_smartx_selenium_hel self.assert_util( input_page.entity2.save, r"Field Interval is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_valid_input_interval(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether adding non numeric values, intreval field displays validation error""" + def test_example_input_two_valid_input_interval( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether adding non numeric values, intreval field displays validation error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1579,15 +1639,16 @@ def test_example_input_two_valid_input_interval(self, ucc_smartx_selenium_helper self.assert_util( input_page.entity2.save, r"Interval must be an integer.", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_required_field_index(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field index in Example Input Two""" + def test_example_input_two_required_field_index( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field index in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1602,29 +1663,29 @@ def test_example_input_two_required_field_index(self, ucc_smartx_selenium_helper self.assert_util( input_page.entity2.save, r"Field Index is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_default_value_index(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of field index in Example Input Two""" + def test_example_input_two_default_value_index( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of field index in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) default_index = "default" input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() - self.assert_util( - input_page.entity2.index.get_value, - default_index - ) + self.assert_util(input_page.entity2.index.get_value, default_index) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_required_field_example_example_account(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field Account in Example Input Two""" + def test_example_input_two_required_field_example_example_account( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field Account in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1638,15 +1699,16 @@ def test_example_input_two_required_field_example_example_account(self, ucc_smar self.assert_util( input_page.entity2.save, r"Field Example Account is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_required_field_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies required field Example Multiple Select in Example Input Two""" + def test_example_input_two_required_field_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies required field Example Multiple Select in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1660,29 +1722,32 @@ def test_example_input_two_required_field_example_multiple_select(self, ucc_smar self.assert_util( input_page.entity2.save, r"Field Example Multiple Select is required", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_list_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies values of Multiple Select Test dropdown in Example Input Two""" + def test_example_input_two_list_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies values of Multiple Select Test dropdown in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() example_multiple_select_list = ["Option One", "Option Two"] self.assert_util( input_page.entity2.example_multiple_select.list_of_values(), - example_multiple_select_list - ) + example_multiple_select_list, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_select_select_value_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies selected single value of Multiple Select Test dropdown in Example Input Two""" + def test_example_input_two_select_select_value_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies selected single value of Multiple Select Test dropdown in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_value = ["Option One"] input_page.create_new_input.select("Example Input Two") @@ -1691,15 +1756,16 @@ def test_example_input_two_select_select_value_example_multiple_select(self, ucc for each in selected_value: input_page.entity2.example_multiple_select.select(each) self.assert_util( - input_page.entity2.example_multiple_select.get_values, - selected_value - ) + input_page.entity2.example_multiple_select.get_values, selected_value + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_select_multiple_values_example_multiple_select(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies selected multiple values of Multiple Select Test dropdown in Example Input Two""" + def test_example_input_two_select_multiple_values_example_multiple_select( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies selected multiple values of Multiple Select Test dropdown in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) selected_values = ["Option One", "Option Two"] input_page.create_new_input.select("Example Input Two") @@ -1708,44 +1774,46 @@ def test_example_input_two_select_multiple_values_example_multiple_select(self, for each in selected_values: input_page.entity2.example_multiple_select.select(each) self.assert_util( - input_page.entity2.example_multiple_select.get_values, - selected_values - ) + input_page.entity2.example_multiple_select.get_values, selected_values + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_help_text_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies help text for the field name""" + def test_example_input_two_help_text_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies help text for the field name""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() self.assert_util( input_page.entity2.example_multiple_select.get_help_text, - 'This is an example multipleSelect for input two entity' - ) + "This is an example multipleSelect for input two entity", + ) self.assert_util( - input_page.entity2.name.get_help_text, - 'A unique name for the data input.' - ) + input_page.entity2.name.get_help_text, "A unique name for the data input." + ) self.assert_util( input_page.entity2.interval.get_help_text, - 'Time interval of the data input, in seconds .' - ) + "Time interval of the data input, in seconds .", + ) self.assert_util( input_page.entity2.example_checkbox.get_help_text, - 'This is an example checkbox for the input two entity' - ) + "This is an example checkbox for the input two entity", + ) self.assert_util( input_page.entity2.example_radio.get_help_text, - 'This is an example radio button for the input two entity' - ) + "This is an example radio button for the input two entity", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_checked_example_checkbox(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies Check in example checkbox in Example Input Two""" + def test_example_input_two_checked_example_checkbox( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies Check in example checkbox in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1754,8 +1822,10 @@ def test_example_input_two_checked_example_checkbox(self, ucc_smartx_selenium_he @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_unchecked_example_checkbox(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies Uncheck in example checkbox in Example Input Two""" + def test_example_input_two_unchecked_example_checkbox( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies Uncheck in example checkbox in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1765,8 +1835,10 @@ def test_example_input_two_unchecked_example_checkbox(self, ucc_smartx_selenium_ @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_required_field_example_radio(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of example radio in Example Input Two""" + def test_example_input_two_required_field_example_radio( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of example radio in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1780,28 +1852,29 @@ def test_example_input_two_required_field_example_radio(self, ucc_smartx_seleniu self.assert_util( input_page.entity2.save, r"Field Example Radio is required", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_select_value_example_radio(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies default value of example radio in Example Input Two""" + def test_example_input_two_select_value_example_radio( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies default value of example radio in Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() input_page.entity2.example_radio.select("No") - self.assert_util( - input_page.entity2.example_radio.get_value, - "No" - ) + self.assert_util(input_page.entity2.example_radio.get_value, "No") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_valid_input_query_start_date(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether adding wrong format, Query Start Date field displays validation error""" + def test_example_input_two_valid_input_query_start_date( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether adding wrong format, Query Start Date field displays validation error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1814,16 +1887,17 @@ def test_example_input_two_valid_input_query_start_date(self, ucc_smartx_seleniu self.assert_util( input_page.entity2.save, r"Invalid date and time format", - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_add_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the frontend after adding a Example Input Two""" + def test_example_input_two_add_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the frontend after adding a Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1839,24 +1913,26 @@ def test_example_input_two_add_frontend_validation(self, ucc_smartx_selenium_hel self.assert_util(input_page.entity2.save, True) input_page.table.wait_for_rows_to_appear(1) self.assert_util( - input_page.table.get_table()["dummy_input"] , + input_page.table.get_table()["dummy_input"], { - 'name': 'dummy_input', - 'account': 'test_input', - 'interval': '90', - 'index': 'main', - 'status': 'Enabled', - 'actions': 'Edit | Clone | Delete', - } - ) + "name": "dummy_input", + "account": "test_input", + "interval": "90", + "index": "main", + "status": "Enabled", + "actions": "Edit | Clone | Delete", + }, + ) url = input_page._get_input_endpoint() - + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_add_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the backend after adding a Example Input Two""" + def test_example_input_two_add_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the backend after adding a Example Input Two""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -1872,27 +1948,28 @@ def test_example_input_two_add_backend_validation(self, ucc_smartx_selenium_help self.assert_util(input_page.entity2.save, True) input_page.table.wait_for_rows_to_appear(1) value_to_test = { - 'account': 'test_input', - 'index': 'main', - 'input_two_checkbox': '1', - 'input_two_radio': '0', - 'interval': '90', - 'input_two_multiple_select': 'one,two', - 'start_date': '2020-12-11T20:00:32.000z', - 'disabled': 0, - } - backend_stanza = input_page.backend_conf.get_stanza("example_input_two://dummy_input") + "account": "test_input", + "index": "main", + "input_two_checkbox": "1", + "input_two_radio": "0", + "interval": "90", + "input_two_multiple_select": "one,two", + "start_date": "2020-12-11T20:00:32.000z", + "disabled": 0, + } + backend_stanza = input_page.backend_conf.get_stanza( + "example_input_two://dummy_input" + ) for each_key, each_value in value_to_test.items(): - self.assert_util( - each_value , - backend_stanza[each_key] - ) + self.assert_util(each_value, backend_stanza[each_key]) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_edit_uneditable_field_name(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the frontend uneditable fields at time of edit of the Example Input Two entity""" + def test_example_input_two_edit_uneditable_field_name( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the frontend uneditable fields at time of edit of the Example Input Two entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_two") input_page.entity2.example_account.wait_for_values() @@ -1902,8 +1979,10 @@ def test_example_input_two_edit_uneditable_field_name(self, ucc_smartx_selenium_ @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_edit_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the frontend edit functionality of the Example Input Two entity""" + def test_example_input_two_edit_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the frontend edit functionality of the Example Input Two entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_two") input_page.entity2.example_account.wait_for_values() @@ -1916,23 +1995,25 @@ def test_example_input_two_edit_frontend_validation(self, ucc_smartx_selenium_he self.assert_util(input_page.entity2.save, True) input_page.table.wait_for_rows_to_appear(1) self.assert_util( - input_page.table.get_table()["dummy_input_two"] , + input_page.table.get_table()["dummy_input_two"], { - 'name': "dummy_input_two", - 'account': 'test_input', - 'interval': '3600', - 'index': 'main', - 'status': 'Enabled', - 'actions': 'Edit | Clone | Delete', - } - ) - + "name": "dummy_input_two", + "account": "test_input", + "interval": "3600", + "index": "main", + "status": "Enabled", + "actions": "Edit | Clone | Delete", + }, + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_edit_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the backend edit functionality of the Example Input Two entity""" + def test_example_input_two_edit_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the backend edit functionality of the Example Input Two entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_two") input_page.entity2.example_account.wait_for_values() @@ -1945,66 +2026,53 @@ def test_example_input_two_edit_backend_validation(self, ucc_smartx_selenium_hel self.assert_util(input_page.entity2.save, True) input_page.table.wait_for_rows_to_appear(1) value_to_test = { - 'account': 'test_input', - 'input_two_checkbox': '0', - 'input_two_radio': '1', - 'interval': '3600', - 'index': 'main', - 'input_two_multiple_select': 'two', - 'start_date': '2020-20-20T20:20:20.000z', - 'disabled': 0, - } - backend_stanza = input_page.backend_conf.get_stanza("example_input_two://dummy_input_two") + "account": "test_input", + "input_two_checkbox": "0", + "input_two_radio": "1", + "interval": "3600", + "index": "main", + "input_two_multiple_select": "two", + "start_date": "2020-20-20T20:20:20.000z", + "disabled": 0, + } + backend_stanza = input_page.backend_conf.get_stanza( + "example_input_two://dummy_input_two" + ) for each_key, each_value in value_to_test.items(): - self.assert_util( - each_value , - backend_stanza[each_key] - ) + self.assert_util(each_value, backend_stanza[each_key]) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_clone_default_values(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the frontend default fields at time of clone for Example Input Two entity""" + def test_example_input_two_clone_default_values( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the frontend default fields at time of clone for Example Input Two entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_two") input_page.entity2.example_account.wait_for_values() - self.assert_util( - input_page.entity2.name.get_value, - "" - ) + self.assert_util(input_page.entity2.name.get_value, "") self.assert_util(input_page.entity2.example_checkbox.is_checked, True) - self.assert_util( - input_page.entity2.example_radio.get_value, - "No" - ) + self.assert_util(input_page.entity2.example_radio.get_value, "No") self.assert_util( input_page.entity2.example_multiple_select.get_values, - ["Option One", "Option Two"] - ) - self.assert_util( - input_page.entity2.interval.get_value, - "100" - ) + ["Option One", "Option Two"], + ) + self.assert_util(input_page.entity2.interval.get_value, "100") + self.assert_util(input_page.entity2.index.get_value, "main") + self.assert_util(input_page.entity2.example_account.get_value, "test_input") self.assert_util( - input_page.entity2.index.get_value, - "main" - ) - self.assert_util( - input_page.entity2.example_account.get_value, - "test_input" - ) - self.assert_util( - input_page.entity2.query_start_date.get_value, - "2016-10-10T12:10:15.000z" - ) + input_page.entity2.query_start_date.get_value, "2016-10-10T12:10:15.000z" + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_clone_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the frontend clone functionality of the Example Input Two entity""" + def test_example_input_two_clone_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the frontend clone functionality of the Example Input Two entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.wait_for_rows_to_appear(1) input_page.table.clone_row("dummy_input_two") @@ -2014,23 +2082,25 @@ def test_example_input_two_clone_frontend_validation(self, ucc_smartx_selenium_h self.assert_util(input_page.entity2.save, True) input_page.table.wait_for_rows_to_appear(2) self.assert_util( - input_page.table.get_table()["dummy_input_two_Clone_Test"] , + input_page.table.get_table()["dummy_input_two_Clone_Test"], { - 'name': 'dummy_input_two_Clone_Test', - 'account': 'test_input', - 'interval': '180', - 'index': 'main', - 'status': 'Enabled', - 'actions': 'Edit | Clone | Delete', - } - ) + "name": "dummy_input_two_Clone_Test", + "account": "test_input", + "interval": "180", + "index": "main", + "status": "Enabled", + "actions": "Edit | Clone | Delete", + }, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_clone_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the backend clone functionality of the Example Input Two entity""" + def test_example_input_two_clone_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the backend clone functionality of the Example Input Two entity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.wait_for_rows_to_appear(1) input_page.table.clone_row("dummy_input_two") @@ -2040,59 +2110,60 @@ def test_example_input_two_clone_backend_validation(self, ucc_smartx_selenium_he self.assert_util(input_page.entity2.save, True) input_page.table.wait_for_rows_to_appear(2) value_to_test = { - 'account': 'test_input', - 'input_two_checkbox': '1', - 'input_two_radio': '0', - 'interval': '180', - 'index': 'main', - 'input_two_multiple_select': 'one,two', - 'start_date': '2016-10-10T12:10:15.000z', - 'disabled': 0, - } - backend_stanza = input_page.backend_conf.get_stanza("example_input_two://Clone_Test") + "account": "test_input", + "input_two_checkbox": "1", + "input_two_radio": "0", + "interval": "180", + "index": "main", + "input_two_multiple_select": "one,two", + "start_date": "2016-10-10T12:10:15.000z", + "disabled": 0, + } + backend_stanza = input_page.backend_conf.get_stanza( + "example_input_two://Clone_Test" + ) for each_key, each_value in value_to_test.items(): - self.assert_util( - each_value , - backend_stanza[each_key] - ) + self.assert_util(each_value, backend_stanza[each_key]) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_delete_row_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the frontend delete functionlity""" + def test_example_input_two_delete_row_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the frontend delete functionlity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.input_status_toggle("dummy_input_two", enable=False) input_page.table.delete_row("dummy_input_two") input_page.table.wait_for_rows_to_appear(0) - self.assert_util( - "dummy_input_two", - input_page.table.get_table, - "not in" - ) + self.assert_util("dummy_input_two", input_page.table.get_table, "not in") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input @pytest.mark.sanity_test - def test_example_input_two_delete_row_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the backend delete functionlity""" + def test_example_input_two_delete_row_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the backend delete functionlity""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.input_status_toggle("dummy_input_two", enable=False) input_page.table.delete_row("dummy_input_two") input_page.table.wait_for_rows_to_appear(0) self.assert_util( - "example_input_two://dummy_input_two", - input_page.backend_conf.get_all_stanzas().keys(), - "not in" - ) + "example_input_two://dummy_input_two", + input_page.backend_conf.get_all_stanzas().keys(), + "not in", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_add_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies close functionality at time of add""" + def test_example_input_two_add_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies close functionality at time of add""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -2101,8 +2172,10 @@ def test_example_input_two_add_close_entity(self, ucc_smartx_selenium_helper, uc @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_edit_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies close functionality at time of edit""" + def test_example_input_two_edit_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies close functionality at time of edit""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_two") self.assert_util(input_page.entity2.close, True) @@ -2110,8 +2183,10 @@ def test_example_input_two_edit_close_entity(self, ucc_smartx_selenium_helper, u @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_clone_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies close functionality at time of clone""" + def test_example_input_two_clone_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies close functionality at time of clone""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_two") self.assert_util(input_page.entity2.close, True) @@ -2119,16 +2194,24 @@ def test_example_input_two_clone_close_entity(self, ucc_smartx_selenium_helper, @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_delete_close_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies close functionality at time of delete""" + def test_example_input_two_delete_close_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies close functionality at time of delete""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util(input_page.table.delete_row, True, left_args={"name":"dummy_input_two", "close":True}) + self.assert_util( + input_page.table.delete_row, + True, + left_args={"name": "dummy_input_two", "close": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_add_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies cancel functionality at time of add""" + def test_example_input_two_add_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies cancel functionality at time of add""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -2137,8 +2220,10 @@ def test_example_input_two_add_cancel_entity(self, ucc_smartx_selenium_helper, u @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_edit_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies cancel functionality at time of edit""" + def test_example_input_two_edit_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies cancel functionality at time of edit""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_two") self.assert_util(input_page.entity2.cancel, True) @@ -2146,8 +2231,10 @@ def test_example_input_two_edit_cancel_entity(self, ucc_smartx_selenium_helper, @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_clone_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies cancel functionality at time of clone""" + def test_example_input_two_clone_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies cancel functionality at time of clone""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_two") self.assert_util(input_page.entity2.cancel, True) @@ -2155,16 +2242,24 @@ def test_example_input_two_clone_cancel_entity(self, ucc_smartx_selenium_helper, @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_delete_cancel_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies cancel functionality at time of delete""" + def test_example_input_two_delete_cancel_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies cancel functionality at time of delete""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util(input_page.table.delete_row, True, left_args={"name":"dummy_input_two", "cancel":True}) + self.assert_util( + input_page.table.delete_row, + True, + left_args={"name": "dummy_input_two", "cancel": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_add_duplicate_names(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies by saving an entity with duplicate name it displays and error""" + def test_example_input_two_add_duplicate_names( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies by saving an entity with duplicate name it displays and error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() @@ -2173,15 +2268,16 @@ def test_example_input_two_add_duplicate_names(self, ucc_smartx_selenium_helper, self.assert_util( input_page.entity2.save, "Name {} is already in use".format(input_name), - left_args={'expect_error': True} - ) - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_clone_duplicate_names(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies by saving an entity with duplicate name at time of clone it displays and error""" + def test_example_input_two_clone_duplicate_names( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies by saving an entity with duplicate name at time of clone it displays and error""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_two") input_page.entity2.example_account.wait_for_values() @@ -2190,71 +2286,78 @@ def test_example_input_two_clone_duplicate_names(self, ucc_smartx_selenium_helpe self.assert_util( input_page.entity2.save, "Name {} is already in use".format(input_name), - left_args={'expect_error': True} - ) - - + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_add_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the title of the 'Add Entity'""" + def test_example_input_two_add_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the title of the 'Add Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.create_new_input.select("Example Input Two") input_page.entity2.example_account.wait_for_values() self.assert_util( - input_page.entity2.title.container.get_attribute('textContent').strip(), - "Add Example Input Two" - ) + input_page.entity2.title.container.get_attribute("textContent").strip(), + "Add Example Input Two", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_edit_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the title of the 'Edit Entity'""" + def test_example_input_two_edit_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the title of the 'Edit Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.edit_row("dummy_input_two") input_page.entity2.example_account.wait_for_values() self.assert_util( - input_page.entity2.title.container.get_attribute('textContent').strip(), - "Update Example Input Two" - ) + input_page.entity2.title.container.get_attribute("textContent").strip(), + "Update Example Input Two", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_clone_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the title of the 'Clone Entity'""" + def test_example_input_two_clone_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the title of the 'Clone Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.clone_row("dummy_input_two") input_page.entity2.example_account.wait_for_values() self.assert_util( - input_page.entity2.title.container.get_attribute('textContent').strip(), - "Clone Example Input Two" - ) + input_page.entity2.title.container.get_attribute("textContent").strip(), + "Clone Example Input Two", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_delete_valid_title(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the title of the 'Delete Entity'""" + def test_example_input_two_delete_valid_title( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the title of the 'Delete Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_page.table.delete_row("dummy_input_two", prompt_msg=True) self.assert_util( - input_page.entity2.title.container.get_attribute('textContent').strip(), - "Delete Confirmation" - ) + input_page.entity2.title.container.get_attribute("textContent").strip(), + "Delete Confirmation", + ) @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.input - def test_example_input_two_delete_valid_prompt_message(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two): - """ Verifies the prompt message of the 'Delete Entity'""" + def test_example_input_two_delete_valid_prompt_message( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_two + ): + """Verifies the prompt message of the 'Delete Entity'""" input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper) input_name = "dummy_input_two" prompt_message = input_page.table.delete_row("dummy_input_two", prompt_msg=True) self.assert_util( - prompt_message , - 'Are you sure you want to delete "{}" ?'.format(input_name) - ) + prompt_message, 'Are you sure you want to delete "{}" ?'.format(input_name) + ) diff --git a/tests/ui/test_splunk_ta_example_addon_logging.py b/tests/ui/test_splunk_ta_example_addon_logging.py index 4f9e3787..d35a264b 100644 --- a/tests/ui/test_splunk_ta_example_addon_logging.py +++ b/tests/ui/test_splunk_ta_example_addon_logging.py @@ -14,9 +14,8 @@ TA_NAME = "Splunk_TA_UCCExample" TA_CONF = "splunk_ta_uccexample_settings" -DEFAULT_CONFIGURATION = { - 'loglevel': 'INFO' -} +DEFAULT_CONFIGURATION = {"loglevel": "INFO"} + @pytest.fixture(autouse=True) def reset_configuration(ucc_smartx_rest_helper): @@ -24,84 +23,95 @@ def reset_configuration(ucc_smartx_rest_helper): logging = Logging(TA_NAME, TA_CONF, ucc_smartx_rest_helper=ucc_smartx_rest_helper) logging.backend_conf.update_parameters(DEFAULT_CONFIGURATION) -class TestLogging(UccTester): +class TestLogging(UccTester): @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.logging - def test_logging_fields_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies logging field label""" - logging = Logging(TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - logging.log_level.get_input_label, - 'Log level' - ) + def test_logging_fields_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies logging field label""" + logging = Logging( + TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ) + self.assert_util(logging.log_level.get_input_label, "Log level") @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.logging - def test_logging_default_log_level(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): + def test_logging_default_log_level( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): """This test case checks verification of default log level""" - logging = Logging(TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + logging = Logging( + TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ) default_log_level = "INFO" self.assert_util( - logging.log_level.get_value().lower() , - default_log_level.lower() - ) - + logging.log_level.get_value().lower(), default_log_level.lower() + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.logging - def test_logging_select_random_log_level(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): + def test_logging_select_random_log_level( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): """This test cases checks the functionality of selecting random log level and verification of the same in UI""" levels = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] - logging = Logging(TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + logging = Logging( + TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ) level = random.choice(levels) logging.log_level.select(level) logging.save() - self.assert_util( - logging.log_level.get_value().lower() , - level.lower() - ) - + self.assert_util(logging.log_level.get_value().lower(), level.lower()) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.logging - def test_logging_list_log_levels(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): + def test_logging_list_log_levels( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): """This test case checks list of log levels present in the drop down""" - logging = Logging(TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + logging = Logging( + TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ) self.assert_util( logging.log_level.list_of_values(), - ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] - ) - + ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], + ) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.logging @pytest.mark.sanity_test - def test_logging_selected_log_level_frontend(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): + def test_logging_selected_log_level_frontend( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): """This test case checks the verification of selected log level""" selection_log = "WARNING" - logging = Logging(TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + logging = Logging( + TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ) logging.log_level.select(selection_log) logging.save() - self.assert_util( - logging.log_level.get_value().lower() , - selection_log.lower() - ) - + self.assert_util(logging.log_level.get_value().lower(), selection_log.lower()) + @pytest.mark.execute_enterprise_cloud_true @pytest.mark.forwarder @pytest.mark.logging @pytest.mark.sanity_test - def test_logging_selected_log_level_backend(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): + def test_logging_selected_log_level_backend( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): """This test case checks the verification of selected log level in backend""" selection_log = "DEBUG" - logging = Logging(TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + logging = Logging( + TA_NAME, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ) logging.log_level.select(selection_log) logging.save() log_level = logging.backend_conf.get_parameter("loglevel") - self.assert_util( - log_level , - selection_log - ) + self.assert_util(log_level, selection_log) diff --git a/tests/ui/test_splunk_ta_example_addon_proxy.py b/tests/ui/test_splunk_ta_example_addon_proxy.py index ff41ce3a..ee8d3c63 100644 --- a/tests/ui/test_splunk_ta_example_addon_proxy.py +++ b/tests/ui/test_splunk_ta_example_addon_proxy.py @@ -13,173 +13,175 @@ TA_NAME = "Splunk_TA_UCCExample" TA_CONF = "splunk_ta_uccexample_settings" -TA_PROXY_URL = "/servicesNS/nobody/Splunk_TA_UCCExample/splunk_ta_uccexample_settings/proxy" +TA_PROXY_URL = ( + "/servicesNS/nobody/Splunk_TA_UCCExample/splunk_ta_uccexample_settings/proxy" +) DEFAULT_CONFIGURATION = { - 'proxy_enabled': 0, - 'proxy_password': '', - 'proxy_port': '', - 'proxy_rdns': 0, - 'proxy_type': 'http', - 'proxy_url': '', - 'proxy_username': '', - + "proxy_enabled": 0, + "proxy_password": "", + "proxy_port": "", + "proxy_rdns": 0, + "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, TA_CONF,ucc_smartx_rest_helper = ucc_smartx_rest_helper) + proxy = Proxy( + TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_rest_helper=ucc_smartx_rest_helper + ) proxy.backend_conf_post.update_parameters(DEFAULT_CONFIGURATION) -class TestProxy(UccTester): +class TestProxy(UccTester): @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_fields_label_entity(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies proxy field label""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - proxy.proxy_enable.get_input_label, - 'Enable' - ) - self.assert_util( - proxy.type.get_input_label, - 'Proxy Type' - ) - self.assert_util( - proxy.host.get_input_label, - 'Host' - ) - self.assert_util( - proxy.port.get_input_label, - 'Port' - ) - self.assert_util( - proxy.username.get_input_label, - 'Username' - ) - self.assert_util( - proxy.password.get_input_label, - 'Password' - ) - self.assert_util( - proxy.dns_enable.get_input_label, - 'Reverse DNS resolution' - ) + def test_proxy_fields_label_entity( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies proxy field label""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) + self.assert_util(proxy.proxy_enable.get_input_label, "Enable") + self.assert_util(proxy.type.get_input_label, "Proxy Type") + self.assert_util(proxy.host.get_input_label, "Host") + self.assert_util(proxy.port.get_input_label, "Port") + self.assert_util(proxy.username.get_input_label, "Username") + self.assert_util(proxy.password.get_input_label, "Password") + self.assert_util(proxy.dns_enable.get_input_label, "Reverse DNS resolution") @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_fields_placeholder_value(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies proxy input field placeholder value""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - proxy.host.get_placeholder_value, - 'optional' - ) - self.assert_util( - proxy.port.get_placeholder_value, - 'optional' - ) - self.assert_util( - proxy.username.get_placeholder_value, - 'optional' - ) - self.assert_util( - proxy.password.get_placeholder_value, - 'optional' - ) + def test_proxy_fields_placeholder_value( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies proxy input field placeholder value""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) + self.assert_util(proxy.host.get_placeholder_value, "optional") + self.assert_util(proxy.port.get_placeholder_value, "optional") + self.assert_util(proxy.username.get_placeholder_value, "optional") + self.assert_util(proxy.password.get_placeholder_value, "optional") @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - 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, TA_CONF, ucc_smartx_selenium_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, - "" - ) + 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, + TA_CONF, + ucc_smartx_selenium_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, "") @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_required_field_host(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether the host field in proxy is required and displays an error if left empty""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_required_field_host( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether the host field in proxy is required and displays an error if left empty""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.proxy_enable.check() proxy.type.cancel_selected_value() proxy.type.select("http") proxy.dns_enable.check() proxy.port.set_value("3285") proxy.username.set_value("Username") - proxy.password.set_value("Password") + proxy.password.set_value("Password") self.assert_util( - proxy.save, - "Proxy Host can not be empty", - left_args={'expect_error': True} - ) + proxy.save, "Proxy Host can not be empty", left_args={"expect_error": True} + ) proxy.dns_enable.check() @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_host_valid_input(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies if host contains special characters displays an error""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_host_valid_input( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies if host contains special characters displays an error""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.host.set_value("abc$$") self.assert_util( proxy.save, "Proxy Host should not have special characters", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_host_field_length_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies host field length validation""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_host_field_length_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies host field length validation""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) host_value = "a" * 4097 proxy.host.set_value(host_value) self.assert_util( - proxy.save, - "Max host length is 4096", - left_args={'expect_error': True} - ) + proxy.save, "Max host length is 4096", left_args={"expect_error": True} + ) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_required_field_port(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether the proxy field is required and displays an error if left empty""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_required_field_port( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether the proxy field is required and displays an error if left empty""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.proxy_enable.check() proxy.type.cancel_selected_value() proxy.type.select("http") @@ -188,59 +190,83 @@ def test_proxy_required_field_port(self, ucc_smartx_selenium_helper, ucc_smartx_ proxy.username.set_value("Username") proxy.password.set_value("Password") self.assert_util( - proxy.save, - "Proxy Port can not be empty", - left_args={'expect_error': True} - ) - + proxy.save, "Proxy Port can not be empty", left_args={"expect_error": True} + ) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_port_field_valid_range(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether the proxy field only allows numeric values""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_port_field_valid_range( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether the proxy field only allows numeric values""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.host.set_value("abc") proxy.port.set_value("abc") self.assert_util( - proxy.save, - "Field Port is not a number", - left_args={'expect_error': True} - ) + proxy.save, "Field Port is not a number", left_args={"expect_error": True} + ) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_port_field_out_of_range(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ verifies out of range port value""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_port_field_out_of_range( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """verifies out of range port value""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.host.set_value("abc") proxy.port.set_value("65536") self.assert_util( proxy.save, "Field Port should be within the range of [1 and 65535]", - left_args={'expect_error': True} - ) + left_args={"expect_error": True}, + ) proxy.port.set_value("") self.assert_util(proxy.is_error_closed, True) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_list_proxy_types(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ This test case checks list of proxy types present in the drop down""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) - self.assert_util( - proxy.type.list_of_values(), - ["http", "socks4", "socks5"] - ) + def test_proxy_list_proxy_types( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """This test case checks list of proxy types present in the drop down""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) + self.assert_util(proxy.type.list_of_values(), ["http", "socks4", "socks5"]) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_required_field_proxy_type(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies whether proxy type is required and displays an error if left empty""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_required_field_proxy_type( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies whether proxy type is required and displays an error if left empty""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.proxy_enable.check() proxy.type.cancel_selected_value() proxy.type.select("http") @@ -251,46 +277,63 @@ def test_proxy_required_field_proxy_type(self, ucc_smartx_selenium_helper, ucc_s proxy.password.set_value("Password") proxy.type.cancel_selected_value() self.assert_util( - proxy.save, - "Proxy type can not be empty", - left_args={'expect_error': True} - ) + proxy.save, "Proxy type can not be empty", left_args={"expect_error": True} + ) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_username_field_length_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): + def test_proxy_username_field_length_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): """Verifies username field length validation""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) username_value = "a" * 51 proxy.host.set_value("abc") proxy.port.set_value("65535") proxy.username.set_value(username_value) self.assert_util( - proxy.save, - "Max length of username is 50", - left_args={'expect_error': True} - ) + proxy.save, "Max length of username is 50", left_args={"expect_error": True} + ) @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy - def test_proxy_encrypted_field_password(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies if the password field is masked or not in the Textbox""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_encrypted_field_password( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies if the password field is masked or not in the Textbox""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) textbox_type = proxy.password.get_type() - self.assert_util( - textbox_type , - 'password' - ) + self.assert_util(textbox_type, "password") @pytest.mark.execute_enterprise_cloud_false @pytest.mark.forwarder @pytest.mark.proxy @pytest.mark.sanity_test - def test_proxy_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the proxy is saved properly in frontend after saving it""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_frontend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the proxy is saved properly in frontend after saving it""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.proxy_enable.check() proxy.type.cancel_selected_value() proxy.type.select("http") @@ -305,9 +348,17 @@ def test_proxy_frontend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_ @pytest.mark.forwarder @pytest.mark.proxy @pytest.mark.sanity_test - def test_proxy_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper): - """ Verifies the proxy is saved properly in frontend after saving it""" - proxy = Proxy(TA_NAME, TA_PROXY_URL, TA_CONF, ucc_smartx_selenium_helper, ucc_smartx_rest_helper) + def test_proxy_backend_validation( + self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper + ): + """Verifies the proxy is saved properly in frontend after saving it""" + proxy = Proxy( + TA_NAME, + TA_PROXY_URL, + TA_CONF, + ucc_smartx_selenium_helper, + ucc_smartx_rest_helper, + ) proxy.proxy_enable.check() proxy.type.cancel_selected_value() proxy.type.select("http") @@ -320,13 +371,13 @@ def test_proxy_backend_validation(self, ucc_smartx_selenium_helper, ucc_smartx_r self.assert_util( proxy.backend_conf_get.get_stanza(decrypt=True), { - 'disabled': False, - 'proxy_enabled': '1', - 'proxy_port': '3285', - 'proxy_rdns': '1', - 'proxy_type': 'http', - 'proxy_url': 'host', - 'proxy_password': 'Password', - 'proxy_username': 'Username' - } - ) \ No newline at end of file + "disabled": False, + "proxy_enabled": "1", + "proxy_port": "3285", + "proxy_rdns": "1", + "proxy_type": "http", + "proxy_url": "host", + "proxy_password": "Password", + "proxy_username": "Username", + }, + )