Package: pytest-typhoon-polarion
Pytest plugin for integration with Siemens PolarionThis plugin is part ofpytest frameworkintegration with Siemens Polarion developed by Typhoon HIL. Developed on top ofan open-source Polarion project.Developed using Siemens Polarion ALM 2304 version.On Polarion struct the template used wasAgile Software Project (Product and Release Backlogs, Sprint Management, Quality Assurance, Builds). On this template is possible to writeTest Casesand also to createTest Runswith the tests case selected.In order to make work, in this version of the plugin, the user needs to describe the test cases and connect then with theTest Runs, run the tests once and then the plugin will be able using the secrets file and the options to sync the test result with Polarion Test Runs.More FeaturesMarker@pytest.mark.polarioncreated to link Polarion Test Case with the Pytest prodedure.When@pytest.mark.parametrizeare used all the test cases can be shown on Work Items comments.Hyperlink to the Allure Report on the Work Items page.Requirementstyphoontest>=1.27.0polarion==1.3.0InstallationYou can create a new environment or install on system Python directly from PyPI, using:pipinstall pytest-typhoon-polarionOr cloning the repository using the follow commands:gitclone https://github.com/typhoon-hil/pytest-typhoon-polarion.gitAnd usepip installcommand locally in the root of the project:pipinstall .Getting StartedGet your credentials and filled thesecretsfile:POLARION_HOST=<Polarion-Host-Location># If is on localhost then ``http://localhost:80/polarion``POLARION_USER=<Username>POLARION_PASSWORD=<password># Is not needed if you have the TokenPOLARION_TOKEN=<Personal-Access-Token>POLARION_VERIFY_CERTIFICATE=False# In case of HTTPS is used, SSL Error may happen and this option needs to be set as 'False'More recently, from version 1.0.2 is possible to configure aconfig.inifile and set information regarding the project and plugin functionalities:[polarion]POLARION_PROJECT_ID=TestDevPOLARION_TEST_RUN=REL-001ALLOW_COMMENTS=TrueWEB_URL=http://localhost:8000/allure-html/POLARION_VERSION=2304# POLARION_VERSION="22 R2"USER_COMMENTS=I write my own comment\nBy config file.[log_file]ENABLE_LOG_FILE=TrueLOG_FILE_PATH=C:\Users\user\DesktopFurther on this document is shown the options available and how to configure (List of options available)Now, theProject IDused when created and theTest Run IDneeds to be passed to the options, like:pytest<tests_folder> --secrets=secrets --polarion-project-id=<Project_id> --polarion-test-run=<TestRun_id>And the test cases needs to be link with the pytest test implemented, for each test case you need one pytest test, if the Test ID is not used to sync with Polarion that test case will be ignored:importpytest@pytest.mark.polarion(test_id="<test_case_id>")deftest_check_signal_Vab_freq():...assertTrueMore details and a Demo of the plugin can be found on theGithub Page.More options availableUsing the Work Items comments and hyperlinks can be added on Polarion the address for the Allure report and the outcome result with the assertion message.Using the option--web-urlyou can point to the Allure Report placeholder, when running Jenkins or locally serve, and the link in the Work Item result will be added to the report. For example:typhoon-python-m pytest ... --web-url=http://localhost:8000/allure-html/And in order to add extra information about the test outcome, or when the test has several test cases, using the@pytest.mark.parametrizethe option--allow-commentscan be also used:typhoon-python-m pytest ... --allow-commentsIn order to inform theconfig.inifile the option--configis add to the plugin:typhoon-python-m pytest ... --config=config.iniList of options availableHere follows a list of options available through the newconfig.inifile and also as options, from the previous versions:Parameterconfig.inifileconfig.inisectionCommand-line optionsSecrets file path(*) Only command-line---secretsConfiguration file pathOnly command-line---configPolarion Project IDPOLARION_PROJECT_ID=TestDev[polarion]--polarion-project-id=TestDevPolarion Test Run IDPOLARION_TEST_RUN=REL-001[polarion]--polarion-test-run=REL-001Comments by the pluginALLOW_COMMENTS=True[polarion]--allow-commentsAllure URLWEB_URL=http://localhost:8000/allure-html[polarion]--web-url=http://localhost:8000/allure-html/User CommentUSER_COMMENTS=My own comment[polarion]--user-comments=My own commentPolarion VersionPOLARION_VERSION=22 R2[polarion]Only throughconfig.inifileEnable Log FileENABLE_LOG_FILE=True[log_file]Only throughconfig.inifileLog File PathLOG_FILE_PATH=C:\Users\user\Desktop[log_file]--log-plugin-report-path=C:\User\user\Desktop(*) This option is mandatory.Description:Secrets file path: Path to the files with the user/agent credentials.Configuration file path: Path to the files with the Polarion and plugin configuration.Polarion Project ID: ID of the project to be sync on Polarion Server.Polarion Test Run ID: ID for the Test Run of project configured in the previous option.Comments by the plugin: Comments that contains the assertion data for each Test Case/Work Item.Allure URL: The address that points to the Allure report used in the hyperlinks of each Test Case/Work Item.User Comments: Adds to all plugin comments a customized text passed by the user, or CI tool.Polarion Version: Informs the plugin which Polarion Server version is being used.Enable Log File: Internal log_file with information regarding configuration (Warning:The token info is also logged, be careful to share this data).Log File Path: Path to save the log file. If not inform will be used the same as the one running the tests.MiscellaneousHow to create a tokenShow Settings (Engine below the Pn symbol in the left-up corner) > My Account > Personal Access Token (upper-center, below the page header).Also, by usage, is noticed that Polarion don`t allow request after a token or XML key is configured, after configuring any stronger authentication method the password is deprecated, even if this one is expired or deleted.