https://github.com/xray-app/tutorial-js-webdriverio-cucumber
https://github.com/xray-app/tutorial-js-webdriverio-cucumber
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/xray-app/tutorial-js-webdriverio-cucumber
- Owner: Xray-App
- Created: 2021-06-17T18:14:44.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-02-01T15:32:43.000Z (over 4 years ago)
- Last Synced: 2025-02-28T15:16:59.153Z (over 1 year ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tutorial with Cypress tests, in JavaScript, using Cucumber, integrated with Xray
[](https://github.com/Xray-App/tutorial-js-webdriverio-cucumber/actions/workflows/main-cloud.yml)
[](https://opensource.org/licenses/BSD-3-Clause)
[](https://gitter.im/Xray-App/community)
## Overview
Code that supports the tutorial [Testing using WebDriverIO and Cucumber in JavaScript](https://docs.getxray.app/display/XRAYCLOUD/Testing+using+WebDriverIO+and+Cucumber+in+JavaScript) showcasing the integration between [Xray Test Management](https://www.getxray.app/) on Jira and WebDriverIO.
The test automation code implements some UI tests for doing authentication, targeting a dummy website having a login page.
## Prerequisites
In order to run this tutorial, you need to have Node.js.
Dependencies can be installed using:
```bash
npm install
```
## Running
The straighforward approach to run everything in a single shot is to invoke the auxiliary script [run_all_cloud_standard_workflow.sh](run_all_cloud_standard_workflow.sh).
You need to update the client_id and client_secret to interact with your Xray cloud instance (obtainable from Xray API Keys section); you also need to update the issue keys of the corresponding stories in Jira, that you'll use as basis to generate the .feature file(s).
Remember that to be able to run the scenarios, we need to have the corresponding .feature files. The previous script assumes you are using Xray to manage the specification of the scenarios, so you need to extract them from Jira (more on the possible workflows [here](https://docs.getxray.app/pages/viewpage.action?pageId=31622264)).
When you have the .feature files, containing the Feature along with the Scenario properly tagged, you can finally run the tests.
```bash
npx wdio run ./wdio.conf.js
```
or simply
```bash
npm test
```
## Submitting results to Jira
Results can be submitted to Jira so that they can be shared with the team and their impacts be easily analysed.
This can be achieved using [Xray Test Management](https://www.getxray.app/) as shown in further detail in this [tutorial](https://docs.getxray.app/pages/viewpage.action?pageId=76982913).
This repo contains an auxiliary script [import_results_cloud.sh](import_results_cloud.sh) that does that; it uses a configuration file to have Xray's client_id and client_secret.
You can also have a look at the [workflows implemented in this repo](.github/workflows) using GitHub Actions.
## Auxiliary scripts
This repo also contains some auxiliary shell scripts, provided as an example; feel free to download and customize them to your needs.
You may find scripts for interacting both with Xray server/DC or Xray cloud, which have slightly different APIs.
## Contact
Any questions related with this code, please raise issues in this GitHub project. Feel free to contribute and submit PR's.
For Xray specific questions, please contact [Xray's support team](https://jira.getxray.app/servicedesk/customer/portal/2).
## References
- [WebDriverIO](https://webdriver.io/)
- [WebDriverIO Documentation](https://webdriver.io/docs/what-is-webdriverio)
- [Detailed tutorial for Xray Cloud showcasing the integration with Jira Cloud](https://docs.getxray.app/display/XRAYCLOUD/Testing+using+WebDriverIO+and+Cucumber+in+JavaScript)
## LICENSE
[BSD 3-Clause](LICENSE)