In this repository, we will highlight an example of integrating test management, cross browser testing with Selenium, Jira, and Jenkins CI.
Test Management and Cross Browser Testing are done using two world-class SmartBear solutions; Zephyr for Jira and CrossBrowserTesting.
Ditch your VMs and Device Lab. Easily run Manual, Visual, and Selenium Tests in the cloud on 2050+ real desktop and mobile browsers. https://crossbrowsertesting.com/
The #1 Agile Test Management Solution in Jira, perfect for teams focusing on Test Design, Execution, and Test Automation https://marketplace.atlassian.com/apps/1014681/zephyr-for-jira-test-management?hosting=cloud&tab=overview
With these solutions, we can seamlessly execute a Jenkins CI job with a selenium test executing on a real machine from CrossBrowserTesting and results automatically synchronized into Jira via a Zephyr test cycle. This workflow requires being an active user on both tools.
-
Install the CrossBrowserTesting Jenkins plugin https://help.crossbrowsertesting.com/selenium-testing/continuous-integration/installing-jenkins/
-
Download Selenium Tests (selenium_test.py) and Zephyr for Jira Synchronize Script (sync_z4j.py) example from this repo
-
Fill out parameters in config.json file to be authenticated into Zephyr for Jira https://zephyrdocs.atlassian.net/wiki/spaces/ZFJCLOUD/pages/1686798372/A.T.O.M+API+Documentation
-
Set up Jenkins Job with both tools
-
Enable CrossBrowserTesting.com in Build Environment according to above docs. Select desired OS, Browser, and Resolution https://help.crossbrowsertesting.com/wp-content/uploads/2019/06/Build_Environment_1.png
-
Set up first build step to run selenium tests and execute junit xml file as the report
- Note: This can be done in many ways. During the webinar, I used the shining panda jenkins plugin with the pytest module to do this. Sample Command - py.test --junitxml "/Results/results.xml" "selenium_test.py"
-
Set up execution for Z4J Sync scriptas a build or post-build action
- Sample Command - python sync_z4j.py
Screenshots from my demo: https://gyazo.com/c77b1ca8c713509f43ba65ca267b9c6e https://gyazo.com/900c0e33d4180c3d154096287b7bf516
This Script uses three api calls to do the following:
- Generate JWT Token
- Create Zephyr Test Automation Job: Indicating automation type, where results are located, and which test cycle to sync them too
- Execute Job with create job id
You can add more API calls to update and delete jobs as well. https://zephyrdocs.atlassian.net/wiki/spaces/ZFJCLOUD/pages/1686798372/A.T.O.M+API+Documentation
You can see this in action during our SmartBear Webinar - Test, Track, and Analyze: Scaling Test Automation Effectively in Agile https://smartbear.com/resources/webinars/scaling-test-automation-in-agile/
config.json file is required in the same directory as the migration script.
Example config can be found
ACCESS_KEY: Output Directory for Reports.
SECRET_KEY: Vendor ID issued by Atlassian.
ACCOUNT_ID: ID of Vendor Add-on
PROJECT_ID: Email of account with Reporting Permissions to Vendor Account.
REPORT_DIRECTORY: Password of account with Reporting Permissions to Vendor Account.
RESULT_FILE: Array(List) of files that contain search text *NOTE Files should be single column csv with search terms.
All fields are required.