Skip to content

Commit

Permalink
[patch] added cypress badges (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmisty committed Jun 25, 2024
1 parent c9579fc commit c73ad85
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .scripts/update-badge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs');
const packageJson = require('../package.json');

const packageName = 'cypress';
const prefix = 'latest%20supported%20';
const readmeFile = 'README.pack.md'
const version = packageJson.devDependencies[packageName].replace(/^[^0-9]+/, ''); // Extracts version number

const badgeUrl = `https://img.shields.io/badge/${prefix}${packageName}-${version}-blue`;

let readme = fs.readFileSync(readmeFile, 'utf8');
const badgeRegex = new RegExp(`https://img.shields.io/badge/${prefix}${packageName}-.*-blue`);
readme = readme.replace(badgeRegex, badgeUrl);

fs.writeFileSync(readmeFile, readme, 'utf8');

console.log(`Updated ${packageName} version badge to ${version}`);
4 changes: 4 additions & 0 deletions README.pack.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# cypress-allure-adapter

![actions](https://github.com/mmisty/cypress-allure-adapter/actions/workflows/build.yml/badge.svg?branch=main)
![cypress version](https://img.shields.io/badge/latest%20supported%20cypress-13.12.0-blue)
![supported cypress](https://img.shields.io/badge/cypress-12.x-blue)
![supported cypress](https://img.shields.io/badge/cypress-11.x-blue)
![supported cypress](https://img.shields.io/badge/cypress-10.x-blue)

This is allure adapter for Cypress providing realtime results.
It is useful when using Allure TestOps - so you can watch tests execution. It adds tests, steps, suites and screenshots during tests execution.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
"cov:check": "COVERAGE_TEMP=reports/coverage-temp nyc check-coverage",
"all": "npm run pre && npm run cov:check && npm run cov",
"pre": "rm -rf ./node_modules/.cache lib reports coverage-nyc .nyc_output && npm run lint && npm run build:all && npm run test:cov && npm run cov:merge",
"pack": "npm run build && cp package.json ./lib/package.json && cp README.pack.md ./lib/README.md && cp CHANGELOG.md ./lib/CHANGELOG.md && sh .scripts/remove.sh && cd lib && npm version $ver --no-git-tag-version ",
"pack": "npm run build && npm run update-badge && cp package.json ./lib/package.json && cp README.pack.md ./lib/README.md && cp CHANGELOG.md ./lib/CHANGELOG.md && sh .scripts/remove.sh && cd lib && npm version $ver --no-git-tag-version ",
"prepublish": "npm run lint",
"update-badge": "node ./.scripts/update-badge.js",
"prepublishOnly": "{ echo \"Run script 'npm run publish:pack', 'npm run publish:minor', etc from package.json\n\"; exit 1; }",
"publishPack": "npm run pack && cd lib && npm publish --tag $TAG",
"publish:alpha": "export TAG=alpha && export ver=$(semver $(npm show . version --tag alpha || npm show . version) --increment -i prerelease --preid 'alpha') && npm run publishPack && npm run postpublish",
Expand Down Expand Up @@ -93,7 +94,7 @@
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"allure-commandline": "^2.29.0",
"cypress": "^13.11.0",
"cypress": "^13.12.0",
"cypress-redirect-browser-log": "^1.3.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
Expand Down

0 comments on commit c73ad85

Please sign in to comment.