-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from saucelabs/init
Init cypress-junit-plugin
- Loading branch information
Showing
24 changed files
with
11,450 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:cypress/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'cypress'], | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
}; |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @saucelabs/devx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: 'Release type - major, minor or patch' | ||
required: false | ||
default: 'patch' | ||
|
||
jobs: | ||
publish-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Setup Git | ||
run: | | ||
git config --global user.name "devx-sauce-bot" | ||
git config --global user.email "devx.bot@saucelabs.com" | ||
- name: Login to NPM | ||
run: npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Release | ||
run: npm run release:ci -- ${{ github.event.inputs.releaseType }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Lint | ||
run: npm run lint | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Run Integration Tests | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,77 @@ | ||
# cypress-junit-plugin | ||
# @saucelabs/cypress-junit-plugin | ||
|
||
`@saucelabs/cypress-junit-plugin` is a third-party plugin designed to enhance your Cypress testing workflow by generating comprehensive JUnit test reports. | ||
|
||
Please be aware that this plugin is not an official product of Sauce Labs. | ||
|
||
## Unique Features | ||
|
||
Unlike Cypress' built-in [junit reporter](https://docs.cypress.io/guides/tooling/reporters), this plugin generates a single, consolidated JUnit file for the entire test run, rather than individual files per spec that then need to be merged. | ||
|
||
## Prerequisites | ||
|
||
**Cypress Version**: This plugin is compatible with Cypress version 13 and above. Make sure your project is updated to meet this version requirement. | ||
|
||
## Installation | ||
|
||
To install the plugin, run the following command in your project directory: | ||
|
||
```bash | ||
npm install @saucelabs/cypress-junit-plugin --save-dev | ||
``` | ||
|
||
## Configuration | ||
|
||
After installation, configure the plugin to work with your Cypress setup. | ||
|
||
### `cypress.config.mjs` Example: | ||
|
||
```javascript | ||
import { defineConfig } from 'cypress'; | ||
import { setupJUnitPlugin } from '@saucelabs/cypress-junit-plugin'; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
setupJUnitPlugin(on, config, { filename: "path/to/my_junit.xml" }); | ||
return config; | ||
} | ||
}, | ||
}); | ||
``` | ||
|
||
### `cypress.config.cjs` Example: | ||
|
||
```javascript | ||
const { defineConfig } = require('cypress'); | ||
const { setupJUnitPlugin } = require('@saucelabs/cypress-junit-plugin'); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
setupJUnitPlugin(on, config, { filename: 'path/to/my_junit.xml' }); | ||
return config; | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
## Usage | ||
|
||
Simply run your Cypress tests as usual. The plugin will automatically generate a JUnit report at the specified location (default: `junit.xml`) after the test run is complete. | ||
|
||
```bash | ||
cypress run | ||
``` | ||
|
||
## Contributing | ||
|
||
Contributions to the `@saucelabs/cypress-junit-plugin` are welcome! Check out our contributing guidelines for more information on how to participate. | ||
|
||
## Support | ||
|
||
If you run into any issues or have questions about the plugin, feel free to open an issue on our GitHub repository. | ||
|
||
## License | ||
|
||
This plugin is released under the [MIT License](LICENSE). |
Oops, something went wrong.