diff --git a/test/cypress/Dockerfile b/test/cypress/Dockerfile index a56fa7a6..5d7903d3 100644 --- a/test/cypress/Dockerfile +++ b/test/cypress/Dockerfile @@ -1,4 +1,4 @@ -FROM cypress/included:9.4.1 +FROM cypress/included:12.3.0 COPY --chown=1000 ./test /test diff --git a/test/cypress/integration/api/Settings.spec.js b/test/cypress/integration/api/Settings.spec.js index 9ac1212b..e4bffb2e 100644 --- a/test/cypress/integration/api/Settings.spec.js +++ b/test/cypress/integration/api/Settings.spec.js @@ -1,18 +1,10 @@ /// -const generateRandomString = function (length) { - var result = ''; - var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - var charactersLength = characters.length; - for (var i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; +const fns = require('../support/functions'); describe('Settings endpoints', () => { let token; - let settingName = 'cypressSetting_' + generateRandomString(12); + let settingName = 'cypressSetting_' + fns.generateRandomString(12); before(() => { cy.getToken().then((tok) => { diff --git a/test/cypress/integration/api/Users.spec.js b/test/cypress/integration/api/Users.spec.js index 03d6a2b4..78e6a878 100644 --- a/test/cypress/integration/api/Users.spec.js +++ b/test/cypress/integration/api/Users.spec.js @@ -1,18 +1,10 @@ /// -const generateRandomString = function (length) { - var result = ''; - var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - var charactersLength = characters.length; - for (var i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; +const fns = require('../support/functions'); describe('Users endpoints', () => { let token; - let uniqueEmail = 'jc_' + generateRandomString(10) + '@example.com'; + let uniqueEmail = 'jc_' + fns.generateRandomString(10) + '@example.com'; let myUserID = 0; before(() => { diff --git a/test/cypress/support/functions.js b/test/cypress/support/functions.js new file mode 100644 index 00000000..48bdc158 --- /dev/null +++ b/test/cypress/support/functions.js @@ -0,0 +1,11 @@ +module.exports = { + generateRandomString: function (length) { + var result = ''; + var characters = 'ABCDEFGHIJK LMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + var charactersLength = characters.length; + for (var i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; + }, +}; diff --git a/test/package.json b/test/package.json index 46036ec9..bd4d93c4 100644 --- a/test/package.json +++ b/test/package.json @@ -7,7 +7,7 @@ "@jc21/cypress-swagger-validation": "^0.1.0", "@jc21/restler": "^3.4.0", "chalk": "^4.1.1", - "cypress": "^9.4.1", + "cypress": "^12.3.0", "cypress-multi-reporters": "^1.5.0", "cypress-wait-until": "^1.7.2", "eslint": "^7.28.0", diff --git a/test/yarn.lock b/test/yarn.lock index b2b55f9b..ca980742 100644 --- a/test/yarn.lock +++ b/test/yarn.lock @@ -610,10 +610,10 @@ cypress-wait-until@^1.7.2: resolved "https://registry.yarnpkg.com/cypress-wait-until/-/cypress-wait-until-1.7.2.tgz#7f534dd5a11c89b65359e7a0210f20d3dfc22107" integrity sha512-uZ+M8/MqRcpf+FII/UZrU7g1qYZ4aVlHcgyVopnladyoBrpoaMJ4PKZDrdOJ05H5RHbr7s9Tid635X3E+ZLU/Q== -cypress@^9.4.1: - version "9.4.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.4.1.tgz#1a4ba706435829c24b7edf350c2b059e05da9084" - integrity sha512-+JgMG9uT+QFx97JU9kOHE3jO3+0UdkQ9H1oCBiC7A74qme7Jkdy2sYDBCPjjGczutnWnGUTMRlwiNMP/Uq6LrQ== +cypress@^12.3.0: + version "12.3.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.3.0.tgz#ae3fb0540aef4b5eab1ef2bcd0760caf2992b8bf" + integrity sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4" @@ -634,7 +634,7 @@ cypress@^9.4.1: dayjs "^1.10.4" debug "^4.3.2" enquirer "^2.3.6" - eventemitter2 "^6.4.3" + eventemitter2 "6.4.7" execa "4.1.0" executable "^4.1.1" extract-zip "2.0.1" @@ -647,7 +647,7 @@ cypress@^9.4.1: listr2 "^3.8.3" lodash "^4.17.21" log-symbols "^4.0.0" - minimist "^1.2.5" + minimist "^1.2.6" ospath "^1.2.2" pretty-bytes "^5.6.0" proxy-from-env "1.0.0" @@ -931,10 +931,10 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -eventemitter2@^6.4.3: - version "6.4.4" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.4.tgz#aa96e8275c4dbeb017a5d0e03780c65612a1202b" - integrity sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw== +eventemitter2@6.4.7: + version "6.4.7" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.7.tgz#a7f6c4d7abf28a14c1ef3442f21cb306a054271d" + integrity sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg== execa@4.1.0: version "4.1.0" @@ -1618,6 +1618,11 @@ minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@^1.2.6: + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== + mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"