From d00972d1d4441c32b65de4e2ae9b6360072b0187 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 00:19:35 +0000 Subject: [PATCH 1/4] dev: bump cypress from 14.5.4 to 15.3.0 Bumps [cypress](https://github.com/cypress-io/cypress) from 14.5.4 to 15.3.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v14.5.4...v15.3.0) --- updated-dependencies: - dependency-name: cypress dependency-version: 15.3.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 49 ++++++++++++++++++------------------------------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index f6ac895a86..be4f2531d0 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^13.0.1", "css-loader": "^6.10.0", - "cypress": "14.5.4", + "cypress": "15.3.0", "cypress-browser-permissions": "^1.1.0", "cypress-file-upload": "^5.0.8", "cypress-log-to-output": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index 2859382348..7ca9686aa7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3248,6 +3248,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== +"@types/tmp@^0.2.3": + version "0.2.6" + resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.6.tgz#d785ee90c52d7cc020e249c948c36f7b32d1e217" + integrity sha512-chhaNf2oKHlRkDGt+tiKE2Z5aJ6qalm7Z9rlLdBwmOiAAf09YQvvoLXjWK4HWPF1xU/fqvMgfNfpVoBscA/tKA== + "@types/tough-cookie@*": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" @@ -4043,11 +4048,6 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async@^3.2.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" - integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -4625,11 +4625,6 @@ check-error@^2.1.1: resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc" integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw== -check-more-types@^2.24.0: - version "2.24.0" - resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" - integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== - cheerio-select@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" @@ -5179,22 +5174,22 @@ cypress-log-to-output@^1.1.2: chalk "^2.4.2" chrome-remote-interface "^0.27.1" -cypress@14.5.4: - version "14.5.4" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-14.5.4.tgz#d821fbb6220c3328e7413acc7724b75319c9e64d" - integrity sha512-0Dhm4qc9VatOcI1GiFGVt8osgpPdqJLHzRwcAB5MSD/CAAts3oybvPUPawHyvJZUd8osADqZe/xzMsZ8sDTjXw== +cypress@15.3.0: + version "15.3.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-15.3.0.tgz#cb9416e5261ee419c8a42e839d4f2d73eef8797c" + integrity sha512-g9rDhoK9y8wW4Vx3Ppr8dtfvThXxPL3mJsV5e98fG+6EerrhXKmeRT2sL86cvNRtEZouXJfsuVL1lqiMuGNGcg== dependencies: "@cypress/request" "^3.0.9" "@cypress/xvfb" "^1.2.4" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" + "@types/tmp" "^0.2.3" arch "^2.2.0" blob-util "^2.0.2" bluebird "^3.7.2" buffer "^5.7.1" cachedir "^2.3.0" chalk "^4.1.0" - check-more-types "^2.24.0" ci-info "^4.1.0" cli-cursor "^3.1.0" cli-table3 "0.6.1" @@ -5209,10 +5204,8 @@ cypress@14.5.4: extract-zip "2.0.1" figures "^3.2.0" fs-extra "^9.1.0" - getos "^3.2.1" hasha "5.2.2" is-installed-globally "~0.4.0" - lazy-ass "^1.6.0" listr2 "^3.8.3" lodash "^4.17.21" log-symbols "^4.0.0" @@ -5224,7 +5217,8 @@ cypress@14.5.4: request-progress "^3.0.0" semver "^7.7.1" supports-color "^8.1.1" - tmp "~0.2.3" + systeminformation "5.27.7" + tmp "~0.2.4" tree-kill "1.2.2" untildify "^4.0.0" yauzl "^2.10.0" @@ -7146,13 +7140,6 @@ get-symbol-description@^1.1.0: es-errors "^1.3.0" get-intrinsic "^1.2.6" -getos@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" - integrity sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q== - dependencies: - async "^3.2.0" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -9004,11 +8991,6 @@ launch-editor@^2.6.1: picocolors "^1.0.0" shell-quote "^1.8.1" -lazy-ass@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" - integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== - leaflet@^1.9.4: version "1.9.4" resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.9.4.tgz#23fae724e282fa25745aff82ca4d394748db7d8d" @@ -12906,6 +12888,11 @@ synckit@^0.11.7, synckit@^0.11.8: dependencies: "@pkgr/core" "^0.2.4" +systeminformation@5.27.7: + version "5.27.7" + resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.27.7.tgz#4dc9d436419948cd5e5f076779a1298220d19a72" + integrity sha512-saaqOoVEEFaux4v0K8Q7caiauRwjXC4XbD2eH60dxHXbpKxQ8kH9Rf7Jh+nryKpOUSEFxtCdBlSUx0/lO6rwRg== + table@^6.9.0: version "6.9.0" resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" @@ -13073,7 +13060,7 @@ tldts@^6.1.32: dependencies: tldts-core "^6.1.60" -tmp@~0.2.3: +tmp@~0.2.4: version "0.2.5" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.5.tgz#b06bcd23f0f3c8357b426891726d16015abfd8f8" integrity sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow== From 1c1b3a2fd930f636fa33fcfbbc9d0e70a87f2fe3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:56:07 +0000 Subject: [PATCH 2/4] dev: bump cypress from 14.5.4 to 15.3.0 Bumps [cypress](https://github.com/cypress-io/cypress) from 14.5.4 to 15.3.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v14.5.4...v15.3.0) --- updated-dependencies: - dependency-name: cypress dependency-version: 15.3.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 49 ++++++++++++++++++------------------------------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index fed0ec16f0..26129e2b69 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^13.0.1", "css-loader": "^6.10.0", - "cypress": "14.5.4", + "cypress": "15.3.0", "cypress-browser-permissions": "^1.1.0", "cypress-file-upload": "^5.0.8", "cypress-log-to-output": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index 6083c019aa..d4ac84a2e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3253,6 +3253,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== +"@types/tmp@^0.2.3": + version "0.2.6" + resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.6.tgz#d785ee90c52d7cc020e249c948c36f7b32d1e217" + integrity sha512-chhaNf2oKHlRkDGt+tiKE2Z5aJ6qalm7Z9rlLdBwmOiAAf09YQvvoLXjWK4HWPF1xU/fqvMgfNfpVoBscA/tKA== + "@types/tough-cookie@*": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" @@ -4048,11 +4053,6 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async@^3.2.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" - integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -4634,11 +4634,6 @@ check-error@^2.1.1: resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc" integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw== -check-more-types@^2.24.0: - version "2.24.0" - resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" - integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== - cheerio-select@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" @@ -5188,22 +5183,22 @@ cypress-log-to-output@^1.1.2: chalk "^2.4.2" chrome-remote-interface "^0.27.1" -cypress@14.5.4: - version "14.5.4" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-14.5.4.tgz#d821fbb6220c3328e7413acc7724b75319c9e64d" - integrity sha512-0Dhm4qc9VatOcI1GiFGVt8osgpPdqJLHzRwcAB5MSD/CAAts3oybvPUPawHyvJZUd8osADqZe/xzMsZ8sDTjXw== +cypress@15.3.0: + version "15.3.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-15.3.0.tgz#cb9416e5261ee419c8a42e839d4f2d73eef8797c" + integrity sha512-g9rDhoK9y8wW4Vx3Ppr8dtfvThXxPL3mJsV5e98fG+6EerrhXKmeRT2sL86cvNRtEZouXJfsuVL1lqiMuGNGcg== dependencies: "@cypress/request" "^3.0.9" "@cypress/xvfb" "^1.2.4" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" + "@types/tmp" "^0.2.3" arch "^2.2.0" blob-util "^2.0.2" bluebird "^3.7.2" buffer "^5.7.1" cachedir "^2.3.0" chalk "^4.1.0" - check-more-types "^2.24.0" ci-info "^4.1.0" cli-cursor "^3.1.0" cli-table3 "0.6.1" @@ -5218,10 +5213,8 @@ cypress@14.5.4: extract-zip "2.0.1" figures "^3.2.0" fs-extra "^9.1.0" - getos "^3.2.1" hasha "5.2.2" is-installed-globally "~0.4.0" - lazy-ass "^1.6.0" listr2 "^3.8.3" lodash "^4.17.21" log-symbols "^4.0.0" @@ -5233,7 +5226,8 @@ cypress@14.5.4: request-progress "^3.0.0" semver "^7.7.1" supports-color "^8.1.1" - tmp "~0.2.3" + systeminformation "5.27.7" + tmp "~0.2.4" tree-kill "1.2.2" untildify "^4.0.0" yauzl "^2.10.0" @@ -7155,13 +7149,6 @@ get-symbol-description@^1.1.0: es-errors "^1.3.0" get-intrinsic "^1.2.6" -getos@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" - integrity sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q== - dependencies: - async "^3.2.0" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -9015,11 +9002,6 @@ launch-editor@^2.6.1: picocolors "^1.0.0" shell-quote "^1.8.1" -lazy-ass@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" - integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== - leaflet@^1.9.4: version "1.9.4" resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.9.4.tgz#23fae724e282fa25745aff82ca4d394748db7d8d" @@ -12917,6 +12899,11 @@ synckit@^0.11.7, synckit@^0.11.8: dependencies: "@pkgr/core" "^0.2.4" +systeminformation@5.27.7: + version "5.27.7" + resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.27.7.tgz#4dc9d436419948cd5e5f076779a1298220d19a72" + integrity sha512-saaqOoVEEFaux4v0K8Q7caiauRwjXC4XbD2eH60dxHXbpKxQ8kH9Rf7Jh+nryKpOUSEFxtCdBlSUx0/lO6rwRg== + table@^6.9.0: version "6.9.0" resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" @@ -13084,7 +13071,7 @@ tldts@^6.1.32: dependencies: tldts-core "^6.1.60" -tmp@~0.2.3: +tmp@~0.2.4: version "0.2.5" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.5.tgz#b06bcd23f0f3c8357b426891726d16015abfd8f8" integrity sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow== From dad415202f36ad78e6a2a3616396a0205d19c7bc Mon Sep 17 00:00:00 2001 From: Pavel Jankoski Date: Wed, 1 Oct 2025 13:33:13 +0200 Subject: [PATCH 3/4] console: Update firefox version --- .github/workflows/console-e2e.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/console-e2e.yml b/.github/workflows/console-e2e.yml index d3a3f5bfe1..65b3fe766c 100644 --- a/.github/workflows/console-e2e.yml +++ b/.github/workflows/console-e2e.yml @@ -213,7 +213,7 @@ jobs: name: cypress-failed-test-spec path: .cache/.failed-specs-*.txt cross-browser-smoke: - name: Cross-browser smoke tests (Firefox 129.0) + name: Cross-browser smoke tests (Firefox 141.0) runs-on: ubuntu-24.04 env: NODE_ENV: development @@ -238,9 +238,10 @@ jobs: name: "build-files" - name: Unzip build artifacts run: unzip -o build.zip - - name: Install FF 115.7.0 ESR + - name: Install Firefox 141.0 ESR run: | - wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/129.0/linux-x86_64/en-US/firefox-129.0.tar.bz2 + FIREFOX_VERSION=141.0 + wget --no-verbose -O /tmp/firefox.tar.bz2 "https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2" tar -C /opt -xjf /tmp/firefox.tar.bz2 rm /tmp/firefox.tar.bz2 sudo ln -fs /opt/firefox/firefox /usr/bin/firefox From 0d8074c1ac3707182e130ddcf3fcf1564fd7d495 Mon Sep 17 00:00:00 2001 From: Pavel Jankoski Date: Wed, 1 Oct 2025 14:08:01 +0200 Subject: [PATCH 4/4] console: Update firefox version --- .github/workflows/console-e2e.yml | 11 +- cypress/e2e/console/devices/import.spec.js | 113 +++++++++++---------- cypress/support/e2e.js | 2 +- cypress/support/utils.js | 11 +- 4 files changed, 77 insertions(+), 60 deletions(-) diff --git a/.github/workflows/console-e2e.yml b/.github/workflows/console-e2e.yml index 65b3fe766c..7eeaba6410 100644 --- a/.github/workflows/console-e2e.yml +++ b/.github/workflows/console-e2e.yml @@ -238,13 +238,14 @@ jobs: name: "build-files" - name: Unzip build artifacts run: unzip -o build.zip - - name: Install Firefox 141.0 ESR + - name: Install Firefox 141.0 (tar.xz) run: | FIREFOX_VERSION=141.0 - wget --no-verbose -O /tmp/firefox.tar.bz2 "https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2" - tar -C /opt -xjf /tmp/firefox.tar.bz2 - rm /tmp/firefox.tar.bz2 - sudo ln -fs /opt/firefox/firefox /usr/bin/firefox + wget --no-verbose -O /tmp/firefox.tar.xz "https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.xz" + sudo rm -rf /opt/firefox + sudo tar -C /opt -xJf /tmp/firefox.tar.xz + sudo ln -sf /opt/firefox/firefox /usr/bin/firefox + firefox --version - name: Generate certs run: tools/bin/mage dev:certificates - name: Restore initialized sql db diff --git a/cypress/e2e/console/devices/import.spec.js b/cypress/e2e/console/devices/import.spec.js index f688f78a7b..d95f5728d2 100644 --- a/cypress/e2e/console/devices/import.spec.js +++ b/cypress/e2e/console/devices/import.spec.js @@ -23,6 +23,11 @@ const user = { const appId = 'import-devices-test-application' const application = { ids: { application_id: appId } } +const consoleRoot = () => Cypress.config('consoleRootPath') + +const selectJsonFixture = (label, fixtureName) => + cy.findByLabelText(label).selectFile(`cypress/fixtures/${fixtureName}`, { force: true }) + describe('End device import', () => { before(() => { cy.dropAndSeedDatabase() @@ -33,7 +38,7 @@ describe('End device import', () => { describe('Default configuration', () => { beforeEach(() => { cy.loginConsole({ user_id: user.ids.user_id, password: user.password }) - cy.visit(`${Cypress.config('consoleRootPath')}/applications/${appId}/devices/import`) + cy.visit(`${consoleRoot()}/applications/${appId}/devices/import`) }) it('succeeds importing a device with fallback values from the device repository', () => { @@ -43,7 +48,7 @@ describe('End device import', () => { ).as('fetchTemplate') const devicesFile = 'fallback-from-device-repo.json' cy.findByLabelText('File format').selectOption('The Things Stack JSON') - cy.findByLabelText('File').attachFile(devicesFile) + selectJsonFixture('File', devicesFile) cy.findByLabelText('Load end device profile from the LoRaWAN Device Repository').check() cy.findByLabelText('End device brand').selectOption('the-things-products') cy.findByLabelText('Model').selectOption('The Things Uno') @@ -58,21 +63,16 @@ describe('End device import', () => { .findByText('All end devices imported successfully') .should('be.visible') cy.findByRole('link', { name: 'Proceed to end device list' }).click() - cy.location('pathname').should( - 'eq', - `${Cypress.config('consoleRootPath')}/applications/${appId}/devices`, - ) + cy.location('pathname').should('eq', `${consoleRoot()}/applications/${appId}/devices`) cy.findByTestId('error-notification').should('not.exist') cy.visit( - `${Cypress.config( - 'consoleRootPath', - )}/applications/${appId}/devices/device-from-device-repo/general-settings`, + `${consoleRoot()}/applications/${appId}/devices/device-from-device-repo/general-settings`, ) cy.findByText('Network layer', { selector: 'h3' }) .closest('[data-test-id="collapsible-section"]') .within(() => { cy.findByRole('button', { name: 'Expand' }).click() - cy.findByText(/Europe 863-870 MHz/).should('be.visible') + cy.findByText(/Europe 863-870 MHz/i).should('be.visible') cy.findByText('LoRaWAN Specification 1.0.2').should('be.visible') cy.findByText('RP001 Regional Parameters 1.0.2 revision B').should('be.visible') }) @@ -82,22 +82,23 @@ describe('End device import', () => { cy.findByText('Import end devices').should('be.visible') cy.findByLabelText('File format').selectOption('The Things Stack JSON') - const devicesFile = 'successful-devices.json' - cy.findByLabelText('File').attachFile(devicesFile) + selectJsonFixture('File', 'successful-devices.json') + cy.findByRole('button', { name: 'Import end devices' }).click() - cy.findByText('0 of 3 (0% finished)') - cy.findByText('Operation finished') - cy.findByText('3 of 3 (100% finished)') + + cy.findByTestId('progress-bar').should('be.visible') + cy.contains(/Operation finished/i).should('be.visible') + cy.contains(/3 of 3.*100%/i).should('be.visible') + cy.findByTestId('notification') .should('be.visible') .findByText('All end devices imported successfully') .should('be.visible') + cy.findByRole('link', { name: 'Proceed to end device list' }).click() - cy.location('pathname').should( - 'eq', - `${Cypress.config('consoleRootPath')}/applications/${appId}/devices`, - ) + cy.location('pathname').should('eq', `${consoleRoot()}/applications/${appId}/devices`) cy.findByTestId('error-notification').should('not.exist') + cy.findByText('migration-test-device').should('be.visible') cy.findByText('some-nice-id').should('be.visible') cy.findByText('this-is-test-id').should('be.visible') @@ -105,68 +106,75 @@ describe('End device import', () => { it('fails adding devices with existant ids', () => { cy.findByLabelText('File format').selectOption('The Things Stack JSON') - cy.findByLabelText('File').attachFile('duplicate-devices-a.json') + selectJsonFixture('File', 'duplicate-devices-a.json') cy.findByRole('button', { name: 'Import end devices' }).click() - cy.findByText('Operation finished').should('be.visible') + + cy.contains(/Operation finished/i).should('be.visible') cy.reload() cy.findByLabelText('File format').selectOption('The Things Stack JSON') - cy.findByLabelText('File').attachFile('duplicate-devices-b.json') + selectJsonFixture('File', 'duplicate-devices-b.json') cy.findByRole('button', { name: 'Import end devices' }).click() - cy.findByText('Operation finished').should('be.visible') - cy.findByText('3 of 3 (100% finished)').should('be.visible') - cy.findByText('Successfully converted 1 of 3 end devices').should('be.visible') + cy.contains(/Operation finished/i).should('be.visible') + cy.contains(/3 of 3.*100%/i).should('be.visible') + cy.contains(/Successfully converted 1 of 3 end devices/i).should('be.visible') + cy.findByTestId('notification') .should('be.visible') .findByText('Not all devices imported successfully') .should('be.visible') - cy.findByText('The registration of the following end devices failed:') + + cy.findByText(/The registration of the following end devices failed:/i) .should('be.visible') .closest('div') .within(() => { - cy.findByText(/ID already taken/).should('be.visible') - cy.findByText(/an end device with/, /is already registered/).should('be.visible') + cy.findByText(/ID already taken/i).should('be.visible') + cy.contains(/an end device with.*is already registered/i).should('be.visible') }) - cy.visit(`${Cypress.config('consoleRootPath')}/applications/${appId}/devices`) + + cy.visit(`${consoleRoot()}/applications/${appId}/devices`) cy.findByText(/End devices \(\d+\)/).should('be.visible') cy.findByText('some-fail-id').should('not.exist') }) it('succeeds setting lorawan_version, lorawan_phy_version and frequency_plan_id from fallback values', () => { - cy.intercept( - 'PUT', - '/api/v3/js/applications/import-devices-test-application/devices/this-is-fallback-test-id', - ).as('importDevice') + // PUT to JS device import for this device id (allow any app + query) + cy.intercept({ + method: 'PUT', + url: '**/api/v3/js/applications/**/devices/this-is-fallback-test-id*', + }).as('importDevice') + const devicesFile = 'freqId-version-phy-device.json' const fallbackValues = { lorawan_version: 'MAC_V1_0', frequency_plan_id: '863-870 MHz', } + cy.findByLabelText('File format').selectOption('The Things Stack JSON') - cy.findByLabelText('File').attachFile(devicesFile) + selectJsonFixture('File', devicesFile) cy.findByLabelText('Enter LoRaWAN versions and frequency plan manually').check() cy.findByLabelText('Frequency plan').selectOption(fallbackValues.frequency_plan_id) cy.findByLabelText('LoRaWAN version').selectOption(fallbackValues.lorawan_version) cy.findByLabelText('LoRaWAN version').blur() + cy.findByRole('button', { name: 'Import end devices' }).click() + cy.findByTestId('progress-bar').should('be.visible') cy.wait('@importDevice') + cy.findByTestId('notification') .findByText('All end devices imported successfully') .should('be.visible') + cy.findByRole('link', { name: 'Proceed to end device list' }).click() - cy.location('pathname').should( - 'eq', - `${Cypress.config('consoleRootPath')}/applications/${appId}/devices`, - ) + cy.location('pathname').should('eq', `${consoleRoot()}/applications/${appId}/devices`) cy.findByTestId('error-notification').should('not.exist') + + // Verify the two devices' network layers cy.visit( - `${Cypress.config( - 'consoleRootPath', - )}/applications/${appId}/devices/fallback-test-device/general-settings`, + `${consoleRoot()}/applications/${appId}/devices/fallback-test-device/general-settings`, ) - cy.findByText('Network layer', { selector: 'h3' }) .closest('[data-test-id="collapsible-section"]') .within(() => { @@ -174,10 +182,9 @@ describe('End device import', () => { cy.findByText('Europe 863-870 MHz (SF12 for RX2)').should('be.visible') cy.findByText('LoRaWAN Specification 1.0.0').should('be.visible') }) + cy.visit( - `${Cypress.config( - 'consoleRootPath', - )}/applications/${appId}/devices/fallback-test-nice-id/general-settings`, + `${consoleRoot()}/applications/${appId}/devices/fallback-test-nice-id/general-settings`, ) cy.findByText('Network layer', { selector: 'h3' }) .closest('[data-test-id="collapsible-section"]') @@ -191,19 +198,23 @@ describe('End device import', () => { it('fails importing device without lorawan_version, lorawan_phy_version and frequency_plan_id', () => { const devicesFile = 'no-freqId-version-phy-device.json' cy.findByLabelText('File format').selectOption('The Things Stack JSON') - cy.findByLabelText('File').attachFile(devicesFile) + selectJsonFixture('File', devicesFile) + cy.findByRole('button', { name: 'Import end devices' }).click() - cy.findByText('Operation finished').should('be.visible') - cy.findByText('3 of 3 (100% finished)').should('be.visible') - cy.findByText('Successfully converted 2 of 3 end devices').should('be.visible') + + cy.contains(/Operation finished/i).should('be.visible') + cy.contains(/3 of 3.*100%/i).should('be.visible') + cy.contains(/Successfully converted 2 of 3 end devices/i).should('be.visible') + cy.findByTestId('notification') .findByText('Not all devices imported successfully') .should('be.visible') - cy.findByText('The registration of the following end device failed:') + + cy.findByText(/The registration of the following end device failed:/i) .should('be.visible') .closest('div') .within(() => { - cy.findByText('frequency plan `` not found').should('be.visible') + cy.findByText(/frequency plan `` not found/i).should('be.visible') }) }) }) diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 203ac997da..e7f16627e5 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -21,7 +21,7 @@ import './commands' const failedSpecsFilename = `./.cache/.failed-specs-${Cypress.env('MACHINE_NUMBER') || '0'}.txt` configure({ testIdAttribute: 'data-test-id' }) -Cypress.SelectorPlayground.defaults({ +Cypress.ElementSelector.defaults({ selectorPriority: ['data-test-id', 'id', 'class', 'tag', 'attributes', 'nth-child'], }) diff --git a/cypress/support/utils.js b/cypress/support/utils.js index 3a2cbc1d74..86eb962594 100644 --- a/cypress/support/utils.js +++ b/cypress/support/utils.js @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import crypto from 'crypto' - /** Stack configuration utitlities. */ /** @@ -124,7 +122,14 @@ const generateJoinServerOnlyConfig = config => { * @param {number} length - The length of the resulting hex value. * @returns {string} - Pseudorandom hex value of length `length`. */ -const generateHexValue = length => crypto.randomBytes(Math.floor(length / 2)).toString('hex') +const generateHexValue = length => { + const byteLen = Math.ceil(length / 2) + const bytes = new Uint8Array(byteLen) + for (let i = 0; i < byteLen; i++) bytes[i] = Math.floor(Math.random() * 256) + let hex = '' + for (let i = 0; i < byteLen; i++) hex += bytes[i].toString(16).padStart(2, '0') + return hex.slice(0, length) +} const generateCollaborator = (entity, type) => { const collabUserId = 'test-collab-user'