diff --git a/package-lock.json b/package-lock.json index 5354862..fabfe70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,9 +21,9 @@ "devDependencies": { "@babel/core": "^7.21.4", "@grafana/eslint-config": "^7.0.0", - "@grafana/plugin-e2e": "^1.10.0", + "@grafana/plugin-e2e": "^1.12.1", "@grafana/tsconfig": "^2.0.0", - "@playwright/test": "^1.41.2", + "@playwright/test": "^1.48.2", "@swc/core": "^1.3.90", "@swc/helpers": "^0.5.0", "@swc/jest": "^0.2.26", @@ -48,6 +48,7 @@ "replace-in-file-webpack-plugin": "^1.0.6", "sass": "1.63.2", "sass-loader": "13.3.1", + "semver": "^7.6.3", "style-loader": "3.3.3", "swc-loader": "^0.2.3", "terser-webpack-plugin": "^5.3.10", @@ -143,6 +144,16 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/generator": { "version": "7.24.5", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.5.tgz", @@ -177,6 +188,16 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", @@ -1064,54 +1085,48 @@ } }, "node_modules/@grafana/plugin-e2e": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@grafana/plugin-e2e/-/plugin-e2e-1.10.0.tgz", - "integrity": "sha512-3I49jLwN5rKYhmxLMC5DIHiUISw0ENaUTEZBJ/dgY2i4gYS3jbPhkFte4+rgYOufO07BfrRAipCQnf1ndtukVA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@grafana/plugin-e2e/-/plugin-e2e-1.12.1.tgz", + "integrity": "sha512-pxmtBn/zFGoyNwfHgwSYEqfH1vTp4r6GnMl0cl3tsQJXO8S58QCD0PFG5Op/OcHhsoglIQTWFVkGvUqu8c5q0A==", "dev": true, "license": "Apache-2.0", "dependencies": { + "@grafana/e2e-selectors": "^11.4.0-207766", "semver": "^7.5.4", - "uuid": "^10.0.0", + "uuid": "^11.0.2", "yaml": "^2.3.4" }, "engines": { - "node": ">=18 <=20" + "node": ">=18 <=22" }, "peerDependencies": { "@playwright/test": "^1.41.2" } }, - "node_modules/@grafana/plugin-e2e/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/@grafana/plugin-e2e/node_modules/@grafana/e2e-selectors": { + "version": "11.4.0-208105", + "resolved": "https://registry.npmjs.org/@grafana/e2e-selectors/-/e2e-selectors-11.4.0-208105.tgz", + "integrity": "sha512-szRZVcTtgE9m4wPdBIArKg9sJUAOcKAowUdGsfI/1y7oAsGahoSIn4E629cS1qFhzCfoeJv9fC/pnjuGZnThZA==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" + "@grafana/tsconfig": "^2.0.0", + "semver": "7.6.3", + "tslib": "2.7.0", + "typescript": "5.5.4" } }, - "node_modules/@grafana/plugin-e2e/node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "node_modules/@grafana/plugin-e2e/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } + "license": "0BSD" }, "node_modules/@grafana/plugin-e2e/node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.3.tgz", + "integrity": "sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==", "dev": true, "funding": [ "https://github.com/sponsors/broofa", @@ -1119,15 +1134,9 @@ ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, - "node_modules/@grafana/plugin-e2e/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@grafana/runtime": { "version": "11.2.2", "resolved": "https://registry.npmjs.org/@grafana/runtime/-/runtime-11.2.2.tgz", @@ -3035,18 +3044,19 @@ } }, "node_modules/@playwright/test": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", - "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.2.tgz", + "integrity": "sha512-54w1xCWfXuax7dz4W2M9uw0gDyh+ti/0K/MxcCUxChFh37kkdxPdfZDw5QBbuPUJHr1CiHJ1hXgSs+GgeQc5Zw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright": "1.41.2" + "playwright": "1.48.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/@popperjs/core": { @@ -4341,18 +4351,6 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/parser": { "version": "6.18.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.18.1.tgz", @@ -4490,18 +4488,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/utils": { "version": "6.18.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.18.1.tgz", @@ -4527,18 +4513,6 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/visitor-keys": { "version": "6.18.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.18.1.tgz", @@ -5994,39 +5968,6 @@ "webpack": "^5.0.0" } }, - "node_modules/css-loader/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/css-loader/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/css-loader/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/css-tree": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", @@ -7382,18 +7323,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/eslint-plugin-deprecation/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-deprecation/node_modules/minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -7409,27 +7338,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/eslint-plugin-deprecation/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-deprecation/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/eslint-plugin-jsdoc": { "version": "46.8.2", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.2.tgz", @@ -7453,18 +7361,6 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/eslint-plugin-jsdoc/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-react": { "version": "7.33.2", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", @@ -7536,6 +7432,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -8205,18 +8111,6 @@ "node": ">=8" } }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/schema-utils": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", @@ -8235,21 +8129,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -8262,12 +8141,6 @@ "node": ">=8" } }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/fs-monkey": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.4.tgz", @@ -9529,6 +9402,16 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", @@ -11733,18 +11616,6 @@ "node": ">=8" } }, - "node_modules/jest-snapshot/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/jest-snapshot/node_modules/pretty-format": { "version": "29.6.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", @@ -11777,21 +11648,6 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/jest-snapshot/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -11804,12 +11660,6 @@ "node": ">=8" } }, - "node_modules/jest-snapshot/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/jest-util": { "version": "29.6.1", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.1.tgz", @@ -12680,6 +12530,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -13506,33 +13366,35 @@ } }, "node_modules/playwright": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", - "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.2.tgz", + "integrity": "sha512-NjYvYgp4BPmiwfe31j4gHLa3J7bD2WiBz8Lk2RoSsmX38SVIARZ18VYjxLjAcDsAhA+F4iSEXTSGgjua0rrlgQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.41.2" + "playwright-core": "1.48.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", - "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.2.tgz", + "integrity": "sha512-sjjw+qrLFlriJo64du+EK0kJgZzoQPsabGF4lBvsid+3CNIZIYLgnMj9V6JY5VhM2Peh20DJWIVpVljLLnlawA==", "dev": true, + "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/portfinder": { @@ -15110,12 +14972,16 @@ "license": "MIT" }, "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/serialize-javascript": { diff --git a/package.json b/package.json index dac013c..c303017 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,9 @@ "devDependencies": { "@babel/core": "^7.21.4", "@grafana/eslint-config": "^7.0.0", - "@grafana/plugin-e2e": "^1.10.0", + "@grafana/plugin-e2e": "^1.12.1", "@grafana/tsconfig": "^2.0.0", - "@playwright/test": "^1.41.2", + "@playwright/test": "^1.48.2", "@swc/core": "^1.3.90", "@swc/helpers": "^0.5.0", "@swc/jest": "^0.2.26", @@ -31,6 +31,8 @@ "@types/jest": "^29.5.0", "@types/lodash": "^4.14.194", "@types/node": "^20.8.7", + "@types/react-router-dom": "^5.2.0", + "@types/testing-library__jest-dom": "5.14.8", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.3", "eslint-plugin-deprecation": "^2.0.0", @@ -38,26 +40,25 @@ "fork-ts-checker-webpack-plugin": "^8.0.0", "glob": "^10.2.7", "identity-obj-proxy": "3.0.0", + "imports-loader": "^5.0.0", "jest": "^29.5.0", "jest-environment-jsdom": "^29.5.0", "prettier": "^2.8.7", "replace-in-file-webpack-plugin": "^1.0.6", "sass": "1.63.2", "sass-loader": "13.3.1", + "semver": "^7.6.3", "style-loader": "3.3.3", "swc-loader": "^0.2.3", + "terser-webpack-plugin": "^5.3.10", "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", "typescript": "5.5.4", "webpack": "^5.94.0", "webpack-cli": "^5.1.4", "webpack-livereload-plugin": "^3.0.2", - "@types/react-router-dom": "^5.2.0", - "@types/testing-library__jest-dom": "5.14.8", - "imports-loader": "^5.0.0", - "webpack-virtual-modules": "^0.6.2", - "terser-webpack-plugin": "^5.3.10", - "webpack-subresource-integrity": "^5.1.0" + "webpack-subresource-integrity": "^5.1.0", + "webpack-virtual-modules": "^0.6.2" }, "engines": { "node": ">=16" @@ -66,11 +67,11 @@ "@emotion/css": "11.10.6", "@grafana/data": "^11.2.2", "@grafana/runtime": "^11.2.2", + "@grafana/schema": "^11.2.2", "@grafana/ui": "^11.2.2", "react": "18.2.0", "react-dom": "18.2.0", - "tslib": "2.5.3", - "@grafana/schema": "^11.2.2" + "tslib": "2.5.3" }, "packageManager": "npm@9.5.1" } diff --git a/tests/traffic-light.spec.ts b/tests/traffic-light.spec.ts index 40c3ec3..911b857 100644 --- a/tests/traffic-light.spec.ts +++ b/tests/traffic-light.spec.ts @@ -1,6 +1,7 @@ import { test, expect } from '@grafana/plugin-e2e'; import { TEST_IDS } from '../src/constants'; import { Locator } from '@playwright/test'; +import { gte } from 'semver'; test.describe.configure({ mode: 'parallel' }); @@ -36,7 +37,7 @@ test('Panel displays a traffic light when thresholds are correctly set', async ( await expect(trafficLightPanel.getByTestId(TEST_IDS.stop)).toBeVisible(); }); -test('Panel options toggle values component correctly', async ({ panelEditPage, page, selectors }) => { +test('Panel options toggle values component correctly', async ({ panelEditPage, page, selectors, grafanaVersion }) => { await panelEditPage.setVisualization('Traffic Light'); await page.getByRole('button', { name: /add Threshold/i }).click(); @@ -50,24 +51,38 @@ test('Panel options toggle values component correctly', async ({ panelEditPage, const trendColor = await getBackgroundColor(trafficLightValueContainer); await expect(trendColor).not.toBe('rgba(0, 0, 0, 0)'); - const showTrendSwitch = panelEditPage - .getByGrafanaSelector(selectors.components.PanelEditor.OptionsPane.fieldLabel('Traffic Light Show trend')) - .getByLabel('Toggle switch'); - await showTrendSwitch.uncheck(); + const trendSwitchLabel = panelEditPage.getByGrafanaSelector( + selectors.components.PanelEditor.OptionsPane.fieldLabel('Traffic Light Show trend') + ); + const showTrendSwitch = gte(grafanaVersion, '11.4.0') + ? trendSwitchLabel.getByRole('switch') + : trendSwitchLabel.getByLabel('Toggle switch'); + + await showTrendSwitch.click({ force: true }); const noTrendColor = await getBackgroundColor(trafficLightValueContainer); await expect(noTrendColor).toBe('rgba(0, 0, 0, 0)'); - const showValueSwitch = panelEditPage - .getByGrafanaSelector(selectors.components.PanelEditor.OptionsPane.fieldLabel('Traffic Light Show value')) - .getByLabel('Toggle switch'); - await showValueSwitch.uncheck(); + const valueSwitchLabel = panelEditPage.getByGrafanaSelector( + selectors.components.PanelEditor.OptionsPane.fieldLabel('Traffic Light Show value') + ); + const showValueSwitch = gte(grafanaVersion, '11.4.0') + ? valueSwitchLabel.getByRole('switch') + : valueSwitchLabel.getByLabel('Toggle switch'); + + await showValueSwitch.click({ force: true }); await expect(trafficLightPanelValue).not.toBeVisible(); - const showLegendSwitch = panelEditPage - .getByGrafanaSelector(selectors.components.PanelEditor.OptionsPane.fieldLabel('Traffic Light Show legend')) - .getByLabel('Toggle switch'); - await showLegendSwitch.uncheck(); + const legendSwitchLabel = panelEditPage.getByGrafanaSelector( + selectors.components.PanelEditor.OptionsPane.fieldLabel('Traffic Light Show legend') + ); + + const showLegendSwitch = gte(grafanaVersion, '11.4.0') + ? legendSwitchLabel.getByRole('switch') + : legendSwitchLabel.getByLabel('Toggle switch'); + + await showLegendSwitch.click({ force: true }); + await expect(trafficLightPanelLegend).not.toBeVisible(); await expect(trafficLightValueContainer).not.toBeVisible(); }); @@ -92,7 +107,6 @@ test('Table data: panel displays a traffic light for each row', async ({ panelEd await expect(trafficLightPanel.getByTestId(TEST_IDS.go)).toBeVisible(); const trafficLightPanelValues = await page.getByTestId(TEST_IDS.trafficLightValue).all(); await expect(trafficLightPanelValues.length).toBe(5); - }); async function getBackgroundColor(el: Locator) {