From 26e96b2888c254e4cdf3fd15462fd43fe051ed88 Mon Sep 17 00:00:00 2001 From: yurydubinin <62520712+yury-dubinin@users.noreply.github.com> Date: Mon, 27 Jan 2025 10:28:48 +0100 Subject: [PATCH 1/5] Updated Next versions --- packages/web/package.json | 6 +- yarn.lock | 281 ++++++++++++++++++++++++-------------- 2 files changed, 183 insertions(+), 104 deletions(-) diff --git a/packages/web/package.json b/packages/web/package.json index 917c501c32..0b505b12ae 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -44,7 +44,7 @@ "@keplr-wallet/types": "0.10.24-ibc.go.v7.hot.fix", "@moonpay/moonpay-node": "^0.2.7", "@moonpay/moonpay-react": "^1.8.2", - "@next/bundle-analyzer": "^12.1.6", + "@next/bundle-analyzer": "^14.2.5", "@opentelemetry/api": "^1.9.0", "@opentelemetry/api-logs": "^0.52.1", "@osmosis-labs/bridge": "^1.0.0", @@ -70,7 +70,7 @@ "@react-spring/web": "^9.6.1", "@tanstack/match-sorter-utils": "^8.8.4", "@tanstack/query-async-storage-persister": "^4.36.1", - "@tanstack/react-query": "^4.32.6", + "@tanstack/react-query": "^4.36.1", "@tanstack/react-query-persist-client": "^4.36.1", "@tanstack/react-table": "^8.10.3", "@tanstack/react-virtual": "^3.0.0-beta.63", @@ -154,7 +154,7 @@ "chokidar-cli": "^3.0.0", "concurrently": "^8.2.1", "dotenv-cli": "^7.2.1", - "eslint-config-next": "^13.5.4", + "eslint-config-next": "^14.2.5", "eslint-config-prettier": "^8.3.0", "fake-indexeddb": "5.0.2", "glob": "^9.3.4", diff --git a/yarn.lock b/yarn.lock index ebaa7a99eb..95a62f96d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3227,6 +3227,11 @@ dependencies: uuid "^9.0.1" +"@discoveryjs/json-ext@0.5.7": + version "0.5.7" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== + "@ensdomains/eth-ens-namehash@^2.0.15": version "2.0.15" resolved "https://registry.npmjs.org/@ensdomains/eth-ens-namehash/-/eth-ens-namehash-2.0.15.tgz" @@ -3374,6 +3379,11 @@ dependencies: eslint-visitor-keys "^3.3.0" +"@eslint-community/regexpp@^4.10.0": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== + "@eslint-community/regexpp@^4.5.1": version "4.10.0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" @@ -5145,12 +5155,12 @@ strict-event-emitter "^0.2.4" web-encoding "^1.1.5" -"@next/bundle-analyzer@^12.1.6": - version "12.1.6" - resolved "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-12.1.6.tgz" - integrity sha512-WLydwytAeHoC/neXsiIgK+a6Me12PuSpwopnsZgX5JFNwXQ9MlwPeMGS3aTZkYsv8QmSm0Ns9Yh9FkgLKYaUuQ== +"@next/bundle-analyzer@^14.2.5": + version "14.2.23" + resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-14.2.23.tgz#aa597ff4e41b9647cd78fd09ae365a6b012036e6" + integrity sha512-BZJTrSZY1kemDMl8hOEu5Vj7Oy5rCa5ZPJ/bSAFPoaOQS21YVwX4xbZCEteCKu6FiXnTwnprxbGgEOmyhH0aoA== dependencies: - webpack-bundle-analyzer "4.3.0" + webpack-bundle-analyzer "4.10.1" "@next/env@14.2.5": version "14.2.5" @@ -5162,12 +5172,12 @@ resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.6.tgz#c1148e2e1aa166614f05161ee8f77ded467062bc" integrity sha512-Yac/bV5sBGkkEXmAX5FWPS9Mmo2rthrOPRQQNfycJPkjUAUclomCPH7QFVCDQ4Mp2k2K1SSM6m0zrxYrOwtFQw== -"@next/eslint-plugin-next@13.5.7": - version "13.5.7" - resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.5.7.tgz#9a8cd86a7a27b8f370ec3b130e598688c869bdc6" - integrity sha512-c4vuEOOXeib4js5gDq+zFqAAdRGXX6T0d+zFETiQkRwy7vyj5lBov1dW0Z09nDst2lvxo7VEcKrQMUBH5Vgx7Q== +"@next/eslint-plugin-next@14.2.23": + version "14.2.23" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.23.tgz#b7903c7a99108e73d318fadb5c76de3cc2c58ab4" + integrity sha512-efRC7m39GoiU1fXZRgGySqYbQi6ZyLkuGlvGst7IwkTTczehQTJA/7PoMg4MMjUZvZEGpiSEu+oJBAjPawiC3Q== dependencies: - glob "7.1.7" + glob "10.3.10" "@next/swc-darwin-arm64@14.2.5": version "14.2.5" @@ -5926,10 +5936,10 @@ dependencies: playwright "1.49.0" -"@polka/url@^1.0.0-next.20": - version "1.0.0-next.21" - resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz" - integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@polka/url@^1.0.0-next.24": + version "1.0.0-next.28" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.28.tgz#d45e01c4a56f143ee69c54dd6b12eade9e270a73" + integrity sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw== "@popperjs/core@^2.9.0": version "2.11.2" @@ -6834,7 +6844,7 @@ dependencies: "@tanstack/query-persist-client-core" "4.36.1" -"@tanstack/react-query@^4.32.6": +"@tanstack/react-query@^4.36.1": version "4.36.1" resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.36.1.tgz#acb589fab4085060e2e78013164868c9c785e5d2" integrity sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw== @@ -7513,6 +7523,21 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/eslint-plugin@^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.21.0.tgz#395014a75112ecdb81142b866ab6bb62e3be0f2a" + integrity sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA== + dependencies: + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "8.21.0" + "@typescript-eslint/type-utils" "8.21.0" + "@typescript-eslint/utils" "8.21.0" + "@typescript-eslint/visitor-keys" "8.21.0" + graphemer "^1.4.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^2.0.0" + "@typescript-eslint/eslint-plugin@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz#de61c3083842fc6ac889d2fc83c9a96b55ab8328" @@ -7530,15 +7555,15 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/parser@^5.4.2 || ^6.0.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" - integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== +"@typescript-eslint/parser@^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.21.0.tgz#312c638aaba4f640d45bfde7c6795a9d75deb088" + integrity sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA== dependencies: - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/typescript-estree" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" + "@typescript-eslint/scope-manager" "8.21.0" + "@typescript-eslint/types" "8.21.0" + "@typescript-eslint/typescript-estree" "8.21.0" + "@typescript-eslint/visitor-keys" "8.21.0" debug "^4.3.4" "@typescript-eslint/parser@^7.4.0": @@ -7552,14 +7577,6 @@ "@typescript-eslint/visitor-keys" "7.4.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" - integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== - dependencies: - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - "@typescript-eslint/scope-manager@7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz#acfc69261f10ece7bf7ece1734f1713392c3655f" @@ -7568,6 +7585,14 @@ "@typescript-eslint/types" "7.4.0" "@typescript-eslint/visitor-keys" "7.4.0" +"@typescript-eslint/scope-manager@8.21.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.21.0.tgz#d08d94e2a34b4ccdcc975543c25bb62917437500" + integrity sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA== + dependencies: + "@typescript-eslint/types" "8.21.0" + "@typescript-eslint/visitor-keys" "8.21.0" + "@typescript-eslint/type-utils@7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz#cfcaab21bcca441c57da5d3a1153555e39028cbd" @@ -7578,29 +7603,25 @@ debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/types@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" - integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== +"@typescript-eslint/type-utils@8.21.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.21.0.tgz#2e69d1a93cdbedc73fe694cd6ae4dfedd00430a0" + integrity sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ== + dependencies: + "@typescript-eslint/typescript-estree" "8.21.0" + "@typescript-eslint/utils" "8.21.0" + debug "^4.3.4" + ts-api-utils "^2.0.0" "@typescript-eslint/types@7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.4.0.tgz#ee9dafa75c99eaee49de6dcc9348b45d354419b6" integrity sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw== -"@typescript-eslint/typescript-estree@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" - integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== - dependencies: - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - minimatch "9.0.3" - semver "^7.5.4" - ts-api-utils "^1.0.1" +"@typescript-eslint/types@8.21.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.21.0.tgz#58f30aec8db8212fd886835dc5969cdf47cb29f5" + integrity sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A== "@typescript-eslint/typescript-estree@7.4.0": version "7.4.0" @@ -7616,6 +7637,20 @@ semver "^7.5.4" ts-api-utils "^1.0.1" +"@typescript-eslint/typescript-estree@8.21.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.21.0.tgz#5ce71acdbed3b97b959f6168afba5a03c88f69a9" + integrity sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg== + dependencies: + "@typescript-eslint/types" "8.21.0" + "@typescript-eslint/visitor-keys" "8.21.0" + debug "^4.3.4" + fast-glob "^3.3.2" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^2.0.0" + "@typescript-eslint/utils@7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.4.0.tgz#d889a0630cab88bddedaf7c845c64a00576257bd" @@ -7629,13 +7664,15 @@ "@typescript-eslint/typescript-estree" "7.4.0" semver "^7.5.4" -"@typescript-eslint/visitor-keys@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" - integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== +"@typescript-eslint/utils@8.21.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.21.0.tgz#bc4874fbc30feb3298b926e3b03d94570b3999c5" + integrity sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw== dependencies: - "@typescript-eslint/types" "6.21.0" - eslint-visitor-keys "^3.4.1" + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "8.21.0" + "@typescript-eslint/types" "8.21.0" + "@typescript-eslint/typescript-estree" "8.21.0" "@typescript-eslint/visitor-keys@7.4.0": version "7.4.0" @@ -7645,6 +7682,14 @@ "@typescript-eslint/types" "7.4.0" eslint-visitor-keys "^3.4.1" +"@typescript-eslint/visitor-keys@8.21.0": + version "8.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.21.0.tgz#a89744c4cdc83b5c761eb5878befe6c33d1481b2" + integrity sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w== + dependencies: + "@typescript-eslint/types" "8.21.0" + eslint-visitor-keys "^4.2.0" + "@upstash/redis@^1.31.5": version "1.31.5" resolved "https://registry.yarnpkg.com/@upstash/redis/-/redis-1.31.5.tgz#8d5fe439a2a28638b3a354a23680ecf7f7eb4f54" @@ -10215,10 +10260,10 @@ commander@^4.1.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== -commander@^6.2.0: - version "6.2.1" - resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== commander@^8.3.0: version "8.3.0" @@ -11778,14 +11823,15 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-next@^13.5.4: - version "13.5.7" - resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-13.5.7.tgz#fc5d86b22364c93d9279acab2a6f4848c4dbccaf" - integrity sha512-pdeUuL9KZ8qFzzKqCbxk6FXwG9dNEnot/3+qSFJqxdSGgkFUH8cgZus/meyCi2S0cTAsDbBEE030E6zvL9pUYQ== +eslint-config-next@^14.2.5: + version "14.2.23" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-14.2.23.tgz#5639fe1c01bb7d5a6486a34a16fc37e0a0b603f8" + integrity sha512-qtWJzOsDZxnLtXLNtnVjbutHmnEp6QTTSZBTlTCge/Wy0AsUaq8nwR91dBcZZvFg3eY3zKFPBhUkLMHu3Qpauw== dependencies: - "@next/eslint-plugin-next" "13.5.7" + "@next/eslint-plugin-next" "14.2.23" "@rushstack/eslint-patch" "^1.3.3" - "@typescript-eslint/parser" "^5.4.2 || ^6.0.0" + "@typescript-eslint/eslint-plugin" "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser" "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" eslint-import-resolver-node "^0.3.6" eslint-import-resolver-typescript "^3.5.2" eslint-plugin-import "^2.28.1" @@ -11959,6 +12005,11 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== +eslint-visitor-keys@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45" + integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== + eslint@^8.50.0: version "8.50.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.50.0.tgz#2ae6015fee0240fcd3f83e1e25df0287f487d6b2" @@ -12938,17 +12989,16 @@ glob-promise@^4.2.2: dependencies: "@types/glob" "^7.1.3" -glob@7.1.7: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== +glob@10.3.10: + version "10.3.10" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" + integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" + foreground-child "^3.1.0" + jackspeak "^2.3.5" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" glob@8.0.3: version "8.0.3" @@ -13376,7 +13426,7 @@ html-encoding-sniffer@^3.0.0: dependencies: whatwg-encoding "^2.0.0" -html-escaper@^2.0.0: +html-escaper@^2.0.0, html-escaper@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== @@ -13530,6 +13580,11 @@ ignore@^5.2.0: resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== +ignore@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== + import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" @@ -14376,7 +14431,7 @@ jackspeak@^2.0.3: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" -jackspeak@^2.3.6: +jackspeak@^2.3.5, jackspeak@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== @@ -15758,7 +15813,7 @@ lodash.throttle@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ== -lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0: +lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -16428,6 +16483,13 @@ minimatch@^9.0.1, minimatch@^9.0.3: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" @@ -16625,10 +16687,10 @@ mri@^1.1.0, mri@^1.2.0: resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== -mrmime@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/mrmime/-/mrmime-1.0.0.tgz" - integrity sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ== +mrmime@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-2.0.0.tgz#151082a6e06e59a9a39b46b3e14d5cfe92b3abb4" + integrity sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw== ms@2.1.2: version "2.1.2" @@ -17723,6 +17785,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry@^1.10.2: version "1.10.2" resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.2.tgz#8f6357eb1239d5fa1da8b9f70e9c080675458ba7" @@ -19354,7 +19424,7 @@ semver@^7.5.0, semver@^7.5.4: dependencies: lru-cache "^6.0.0" -semver@^7.6.3: +semver@^7.6.0, semver@^7.6.3: version "7.6.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -19582,14 +19652,14 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" -sirv@^1.0.7: - version "1.0.19" - resolved "https://registry.npmjs.org/sirv/-/sirv-1.0.19.tgz" - integrity sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ== +sirv@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-2.0.4.tgz#5dd9a725c578e34e449f332703eb2a74e46a29b0" + integrity sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ== dependencies: - "@polka/url" "^1.0.0-next.20" - mrmime "^1.0.0" - totalist "^1.0.0" + "@polka/url" "^1.0.0-next.24" + mrmime "^2.0.0" + totalist "^3.0.0" sisteransi@^1.0.5: version "1.0.5" @@ -20601,10 +20671,10 @@ toggle-selection@^1.0.6: resolved "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz" integrity sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ== -totalist@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz" - integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== tough-cookie@^4.1.2: version "4.1.2" @@ -20661,6 +20731,11 @@ ts-api-utils@^1.0.1: resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== +ts-api-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.0.0.tgz#b9d7d5f7ec9f736f4d0f09758b8607979044a900" + integrity sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ== + ts-easing@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/ts-easing/-/ts-easing-0.2.0.tgz" @@ -21541,19 +21616,23 @@ webidl-conversions@^7.0.0: resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== -webpack-bundle-analyzer@4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.3.0.tgz" - integrity sha512-J3TPm54bPARx6QG8z4cKBszahnUglcv70+N+8gUqv2I5KOFHJbzBiLx+pAp606so0X004fxM7hqRu10MLjJifA== +webpack-bundle-analyzer@4.10.1: + version "4.10.1" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz#84b7473b630a7b8c21c741f81d8fe4593208b454" + integrity sha512-s3P7pgexgT/HTUSYgxJyn28A+99mmLq4HsJepMPzu0R8ImJc52QNqaFYW1Z2z2uIb1/J3eYgaAWVpaC+v/1aAQ== dependencies: + "@discoveryjs/json-ext" "0.5.7" acorn "^8.0.4" acorn-walk "^8.0.0" - chalk "^4.1.0" - commander "^6.2.0" + commander "^7.2.0" + debounce "^1.2.1" + escape-string-regexp "^4.0.0" gzip-size "^6.0.0" - lodash "^4.17.20" + html-escaper "^2.0.2" + is-plain-object "^5.0.0" opener "^1.5.2" - sirv "^1.0.7" + picocolors "^1.0.0" + sirv "^2.0.3" ws "^7.3.1" whatwg-encoding@^2.0.0: From a0f2cc67bab897fe4716af0b3156e1717cc697ed Mon Sep 17 00:00:00 2001 From: yurydubinin <62520712+yury-dubinin@users.noreply.github.com> Date: Mon, 27 Jan 2025 10:42:37 +0100 Subject: [PATCH 2/5] Added lint workspace job --- .github/workflows/lint-and-check-format.yml | 25 + packages/e2e/pages/trade-page.ts | 464 +++++++++--------- .../e2e/tests/monitoring.limit.wallet.spec.ts | 124 ++--- .../tests/monitoring.market.wallet.spec.ts | 142 +++--- .../e2e/tests/monitoring.swap.wallet.spec.ts | 92 ++-- packages/e2e/tests/select.spec.ts | 184 +++---- packages/e2e/tests/swap.osmo.wallet.spec.ts | 120 ++--- packages/e2e/tests/swap.usdc.wallet.spec.ts | 264 +++++----- 8 files changed, 720 insertions(+), 695 deletions(-) diff --git a/.github/workflows/lint-and-check-format.yml b/.github/workflows/lint-and-check-format.yml index de5df0bc2a..11936ad38f 100644 --- a/.github/workflows/lint-and-check-format.yml +++ b/.github/workflows/lint-and-check-format.yml @@ -3,6 +3,31 @@ name: Lint and Check Format Workflow on: [push] jobs: + lint-workspace: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: "**/node_modules" + key: ${{ runner.OS }}-20.x-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-20.x- + + - name: Install Dependencies + run: yarn install --frozen-lockfile + + - name: Lint workspace + run: yarn lint:workspace + test: runs-on: ubuntu-latest strategy: diff --git a/packages/e2e/pages/trade-page.ts b/packages/e2e/pages/trade-page.ts index 41f0605bc0..656345430e 100644 --- a/packages/e2e/pages/trade-page.ts +++ b/packages/e2e/pages/trade-page.ts @@ -3,414 +3,414 @@ import { type Locator, type Page, expect, -} from "@playwright/test"; +} from '@playwright/test' -import { BasePage } from "./base-page"; +import { BasePage } from './base-page' export class TradePage extends BasePage { - readonly page: Page; - readonly swapBtn: Locator; - readonly swapMaxBtn: Locator; - readonly flipAssetsBtn: Locator; - readonly exchangeRate: Locator; - readonly trxSuccessful: Locator; - readonly trxBroadcasting: Locator; - readonly trxLink: Locator; - readonly inputAmount: Locator; - readonly confirmSwapBtn: Locator; - readonly buyTabBtn: Locator; - readonly buyBtn: Locator; - readonly sellTabBtn: Locator; - readonly sellBtn: Locator; - readonly limitTabBtn: Locator; - readonly orderHistoryLink: Locator; - readonly limitPrice: Locator; + readonly page: Page + readonly swapBtn: Locator + readonly swapMaxBtn: Locator + readonly flipAssetsBtn: Locator + readonly exchangeRate: Locator + readonly trxSuccessful: Locator + readonly trxBroadcasting: Locator + readonly trxLink: Locator + readonly inputAmount: Locator + readonly confirmSwapBtn: Locator + readonly buyTabBtn: Locator + readonly buyBtn: Locator + readonly sellTabBtn: Locator + readonly sellBtn: Locator + readonly limitTabBtn: Locator + readonly orderHistoryLink: Locator + readonly limitPrice: Locator constructor(page: Page) { - super(page); - this.page = page; - this.swapBtn = page.locator('//button[@data-testid="trade-button-swap"]'); - this.buyTabBtn = page.locator('//div[@class]/button[.="Buy"]/p[@class]/..'); - this.buyBtn = page.locator('//div[@class]/button[@class]/h6[.="Buy"]/..'); - this.sellBtn = page.locator('//div[@class]/button[@class]/h6[.="Sell"]/..'); + super(page) + this.page = page + this.swapBtn = page.locator('//button[@data-testid="trade-button-swap"]') + this.buyTabBtn = page.locator('//div[@class]/button[.="Buy"]/p[@class]/..') + this.buyBtn = page.locator('//div[@class]/button[@class]/h6[.="Buy"]/..') + this.sellBtn = page.locator('//div[@class]/button[@class]/h6[.="Sell"]/..') this.sellTabBtn = page.locator( - '//div[@class]/button[.="Sell"]/p[@class]/..' - ); - this.confirmSwapBtn = page.locator('//div[@class]/button[.="Confirm"]'); - this.swapMaxBtn = page.locator('//span[.="Max"]'); + '//div[@class]/button[.="Sell"]/p[@class]/..', + ) + this.confirmSwapBtn = page.locator('//div[@class]/button[.="Confirm"]') + this.swapMaxBtn = page.locator('//span[.="Max"]') this.flipAssetsBtn = page.locator( - '//div/button[contains(@class, "ease-bounce")]' - ); - this.exchangeRate = page.locator('//span[@data-testid="token-price"]'); - this.trxSuccessful = page.getByText("Transaction Successful"); - this.trxLink = page.getByText("View explorer"); - this.trxBroadcasting = page.locator('//h6[.="Transaction Broadcasting"]'); + '//div/button[contains(@class, "ease-bounce")]', + ) + this.exchangeRate = page.locator('//span[@data-testid="token-price"]') + this.trxSuccessful = page.getByText('Transaction Successful') + this.trxLink = page.getByText('View explorer') + this.trxBroadcasting = page.locator('//h6[.="Transaction Broadcasting"]') this.inputAmount = page.locator( - "//input[contains(@data-testid, 'trade-input')]" - ); - this.limitTabBtn = page.locator('//div[@class="w-full"]/button[.="Limit"]'); - this.orderHistoryLink = page.getByText("Order history"); - this.limitPrice = page.locator("//div/input[@type='text']"); + "//input[contains(@data-testid, 'trade-input')]", + ) + this.limitTabBtn = page.locator('//div[@class="w-full"]/button[.="Limit"]') + this.orderHistoryLink = page.getByText('Order history') + this.limitPrice = page.locator("//div/input[@type='text']") } async goto() { - const assetPromise = this.page.waitForRequest("**/assets.json"); - await this.page.goto("/"); - const request = await assetPromise; - expect(request).toBeTruthy(); + const assetPromise = this.page.waitForRequest('**/assets.json') + await this.page.goto('/') + const request = await assetPromise + expect(request).toBeTruthy() // we expect that after 2 seconds tokens are loaded and any failure after this point should be considered a bug. - await this.page.waitForTimeout(2000); - const currentUrl = this.page.url(); - console.log(`FE opened at: ${currentUrl}`); + await this.page.waitForTimeout(2000) + const currentUrl = this.page.url() + console.log(`FE opened at: ${currentUrl}`) } async gotoOrdersHistory(timeout = 1) { - await this.page.waitForTimeout(1000); - await this.orderHistoryLink.click(); - await this.page.waitForTimeout(1000); - await new Promise((f) => setTimeout(f, timeout * 1000)); - const currentUrl = this.page.url(); - console.log(`FE opened at: ${currentUrl}`); + await this.page.waitForTimeout(1000) + await this.orderHistoryLink.click() + await this.page.waitForTimeout(1000) + await new Promise((f) => setTimeout(f, timeout * 1000)) + const currentUrl = this.page.url() + console.log(`FE opened at: ${currentUrl}`) } async openBuyTab() { - await this.buyTabBtn.click(); + await this.buyTabBtn.click() } async openSellTab() { - await this.sellTabBtn.click(); + await this.sellTabBtn.click() } async openLimit() { - await this.limitTabBtn.click(); - await this.page.waitForTimeout(1000); + await this.limitTabBtn.click() + await this.page.waitForTimeout(1000) } async getLimitPrice() { - const lp = await this.limitPrice.inputValue(); - console.log(`Current limit price is: ${lp}`); - return lp; + const lp = await this.limitPrice.inputValue() + console.log(`Current limit price is: ${lp}`) + return lp } async setLimitPriceChange(change: string) { - const locator = `//button/span[contains(@class, "body2") and .="${change}"]`; - await this.page.locator(locator).click(); - await this.page.waitForTimeout(1000); + const locator = `//button/span[contains(@class, "body2") and .="${change}"]` + await this.page.locator(locator).click() + await this.page.waitForTimeout(1000) } async setLimitPrice(price: string) { - console.log(`Set Order Limit Price to: ${price}`); - await this.limitPrice.fill(price, { timeout: 2000 }); + console.log(`Set Order Limit Price to: ${price}`) + await this.limitPrice.fill(price, { timeout: 2000 }) } async flipTokenPair() { - await this.flipAssetsBtn.click(); - await this.page.waitForTimeout(2000); - console.log("Fliped token pair."); + await this.flipAssetsBtn.click() + await this.page.waitForTimeout(2000) + console.log('Fliped token pair.') } async clickMaxAmountButton() { - await this.swapMaxBtn.click({ timeout: 2000 }); - await this.page.waitForTimeout(1000); - console.log("Clicked Max token amount button."); + await this.swapMaxBtn.click({ timeout: 2000 }) + await this.page.waitForTimeout(1000) + console.log('Clicked Max token amount button.') } async enterAmount(amount: string) { // Just enter an amount for the swap and wait for a quote - await this.inputAmount.fill(amount, { timeout: 2000 }); - await this.page.waitForTimeout(1000); - await expect(this.inputAmount).toHaveValue(amount, { timeout: 1000 }); - const exchangeRate = await this.getExchangeRate(); - console.log(`Swap ${amount} with rate: ${exchangeRate}`); + await this.inputAmount.fill(amount, { timeout: 2000 }) + await this.page.waitForTimeout(1000) + await expect(this.inputAmount).toHaveValue(amount, { timeout: 1000 }) + const exchangeRate = await this.getExchangeRate() + console.log(`Swap ${amount} with rate: ${exchangeRate}`) } private async approveInKeplrAndGetMsg(context: BrowserContext) { - console.log("Wait for 5 seconds for any popup"); - await this.page.waitForTimeout(5_000); - const pages = context.pages(); - console.log(`Number of Open Pages: ${pages.length}`); + console.log('Wait for 5 seconds for any popup') + await this.page.waitForTimeout(5_000) + const pages = context.pages() + console.log(`Number of Open Pages: ${pages.length}`) if (pages.length === 2) { - const approvePage = pages[1]; - const approvePageTitle = approvePage.url(); - console.log(`Approve page is opened at: ${approvePageTitle}`); + const approvePage = pages[1] + const approvePageTitle = approvePage.url() + console.log(`Approve page is opened at: ${approvePageTitle}`) const msgContent = await approvePage - .getByText("type: osmosis/poolmanager/") - .textContent(); - console.log(`Wallet is approving this msg: \n${msgContent}`); + .getByText('type: osmosis/poolmanager/') + .textContent() + console.log(`Wallet is approving this msg: \n${msgContent}`) await approvePage - .getByRole("button", { name: "Approve" }) - .click({ timeout: 4000 }); - return msgContent; + .getByRole('button', { name: 'Approve' }) + .click({ timeout: 4000 }) + return msgContent } - console.log("Second page was not opened in 5 seconds."); + console.log('Second page was not opened in 5 seconds.') } async justApproveIfNeeded(context: BrowserContext) { - console.log("Wait for 7 seconds for any popup"); - await this.page.waitForTimeout(7_000); - const pages = context.pages(); - console.log(`Number of Open Pages: ${pages.length}`); + console.log('Wait for 7 seconds for any popup') + await this.page.waitForTimeout(7_000) + const pages = context.pages() + console.log(`Number of Open Pages: ${pages.length}`) if (pages.length === 2) { - const approvePage = pages[1]; - const approvePageTitle = approvePage.url(); - console.log(`Approve page is opened at: ${approvePageTitle}`); + const approvePage = pages[1] + const approvePageTitle = approvePage.url() + console.log(`Approve page is opened at: ${approvePageTitle}`) await approvePage - .getByRole("button", { name: "Approve" }) - .click({ timeout: 4000 }); + .getByRole('button', { name: 'Approve' }) + .click({ timeout: 4000 }) } - console.log("Second page was not opened in 7 seconds."); + console.log('Second page was not opened in 7 seconds.') } async swapAndGetWalletMsg(context: BrowserContext) { // Make sure to have sufficient balance and swap button is enabled expect( await this.isInsufficientBalanceForSwap(), - "Insufficient balance for the swap!" - ).toBeFalsy(); - console.log("Swap and Sign now.."); - await expect(this.swapBtn, "Swap button is disabled!").toBeEnabled({ + 'Insufficient balance for the swap!', + ).toBeFalsy() + console.log('Swap and Sign now..') + await expect(this.swapBtn, 'Swap button is disabled!').toBeEnabled({ timeout: 7000, - }); - await this.swapBtn.click({ timeout: 4000 }); + }) + await this.swapBtn.click({ timeout: 4000 }) // Handle 1-click by default - const oneClick = '//div[@role="dialog"]//button[@data-state="checked"]'; + const oneClick = '//div[@role="dialog"]//button[@data-state="checked"]' if (await this.page.locator(oneClick).isVisible({ timeout: 2000 })) { - await this.page.locator(oneClick).click({ timeout: 3000 }); + await this.page.locator(oneClick).click({ timeout: 3000 }) } - await this.confirmSwapBtn.click({ timeout: 5000 }); - return await this.approveInKeplrAndGetMsg(context); + await this.confirmSwapBtn.click({ timeout: 5000 }) + return await this.approveInKeplrAndGetMsg(context) } async selectAsset(token: string) { - const tokenLocator = "//div//button[@type]//img[@alt]"; - const fromToken = this.page.locator(tokenLocator).nth(0); - await fromToken.click(); + const tokenLocator = '//div//button[@type]//img[@alt]' + const fromToken = this.page.locator(tokenLocator).nth(0) + await fromToken.click() // we expect that after 1 second token filter is displayed. - await this.page.waitForTimeout(1000); - await this.page.getByPlaceholder("Search").fill(token); + await this.page.waitForTimeout(1000) + await this.page.getByPlaceholder('Search').fill(token) const fromLocator = this.page.locator( - `//div/button[@data-testid='token-select-asset']//span[.='${token}']` - ); - await fromLocator.click(); + `//div/button[@data-testid='token-select-asset']//span[.='${token}']`, + ) + await fromLocator.click() } async selectPair(from: string, to: string) { // Filter does not show already selected tokens - console.log(`Select pair ${from} to ${to}`); + console.log(`Select pair ${from} to ${to}`) const fromToken = this.page.locator( - "//div//button[@data-testid='token-in']//img[@alt]" - ); + "//div//button[@data-testid='token-in']//img[@alt]", + ) const toToken = this.page.locator( - "//div//button[@data-testid='token-out']//img[@alt]" - ); + "//div//button[@data-testid='token-out']//img[@alt]", + ) // Select From Token - await fromToken.click({ timeout: 4000 }); + await fromToken.click({ timeout: 4000 }) // we expect that after 1 second token filter is displayed. - await this.page.waitForTimeout(1000); - await this.page.getByPlaceholder("Search").fill(from); + await this.page.waitForTimeout(1000) + await this.page.getByPlaceholder('Search').fill(from) const fromLocator = this.page .locator( - `//div/button[@data-testid='token-select-asset']//span[.='${from}']` + `//div/button[@data-testid='token-select-asset']//span[.='${from}']`, ) - .first(); - await fromLocator.click({ timeout: 4000 }); + .first() + await fromLocator.click({ timeout: 4000 }) // Select To Token - await toToken.click({ timeout: 4000 }); + await toToken.click({ timeout: 4000 }) // we expect that after 1 second token filter is displayed. - await this.page.waitForTimeout(1000); - await this.page.getByPlaceholder("Search").fill(to); + await this.page.waitForTimeout(1000) + await this.page.getByPlaceholder('Search').fill(to) const toLocator = this.page .locator( - `//div/button[@data-testid='token-select-asset']//span[.='${to}']` + `//div/button[@data-testid='token-select-asset']//span[.='${to}']`, ) - .first(); - await toLocator.click(); + .first() + await toLocator.click() // we expect that after 2 seconds exchange rate is populated. - await this.page.waitForTimeout(2000); - expect(await this.getExchangeRate()).toContain(from); - expect(await this.getExchangeRate()).toContain(to); + await this.page.waitForTimeout(2000) + expect(await this.getExchangeRate()).toContain(from) + expect(await this.getExchangeRate()).toContain(to) } async getExchangeRate() { - return await this.exchangeRate.innerText(); + return await this.exchangeRate.innerText() } async isTransactionSuccesful(delay = 7) { - console.log(`Wait for a transaction success for ${delay} seconds.`); + console.log(`Wait for a transaction success for ${delay} seconds.`) await expect(this.trxSuccessful).toBeVisible({ timeout: delay * 1000, visible: true, - }); + }) } async getTransactionUrl() { - const trxUrl = await this.trxLink.getAttribute("href"); - console.log(`Trx url: ${trxUrl}`); - await this.page.reload(); - return trxUrl; + const trxUrl = await this.trxLink.getAttribute('href') + console.log(`Trx url: ${trxUrl}`) + await this.page.reload() + return trxUrl } async isTransactionBroadcasted(delay = 5) { - console.log(`Wait for a transaction broadcasting for ${delay} seconds.`); - return await this.trxBroadcasting.isVisible({ timeout: delay * 1000 }); + console.log(`Wait for a transaction broadcasting for ${delay} seconds.`) + return await this.trxBroadcasting.isVisible({ timeout: delay * 1000 }) } async isInsufficientBalance() { const issufBalanceBtn = this.page.locator( - '//span[.="Insufficient balance"]' - ); - return await issufBalanceBtn.isVisible({ timeout: 2000 }); + '//span[.="Insufficient balance"]', + ) + return await issufBalanceBtn.isVisible({ timeout: 2000 }) } async isInsufficientBalanceForSwap() { const issufBalanceBtn = this.page.locator( - '//button[.="Insufficient balance"]' - ); - return await issufBalanceBtn.isVisible({ timeout: 2000 }); + '//button[.="Insufficient balance"]', + ) + return await issufBalanceBtn.isVisible({ timeout: 2000 }) } async isSufficientBalanceForTrade() { // Make sure to have sufficient balance for a trade expect( await this.isInsufficientBalance(), - "Insufficient balance for the swap!" - ).toBeFalsy(); + 'Insufficient balance for the swap!', + ).toBeFalsy() } async isError() { - const errorBtn = this.page.locator('//button[.="Error"]'); - return await errorBtn.isVisible({ timeout: 2000 }); + const errorBtn = this.page.locator('//button[.="Error"]') + return await errorBtn.isVisible({ timeout: 2000 }) } async showSwapInfo() { - const swapInfo = this.page.locator("//button//span[.='Show details']"); - await expect(swapInfo, "Show Swap Info button not visible!").toBeVisible({ + const swapInfo = this.page.locator("//button//span[.='Show details']") + await expect(swapInfo, 'Show Swap Info button not visible!').toBeVisible({ timeout: 4000, - }); - await swapInfo.click({ timeout: 2000 }); + }) + await swapInfo.click({ timeout: 2000 }) } async getPriceInpact() { const priceInpactSpan = this.page.locator( - '//span[.="Price Impact"]/..//span[@class="text-bullish-400"]' - ); - return await priceInpactSpan.textContent(); + '//span[.="Price Impact"]/..//span[@class="text-bullish-400"]', + ) + return await priceInpactSpan.textContent() } async takeScreenshot(name: string) { await this.page.screenshot({ path: `screenshot-trade-${name}.png`, fullPage: true, - }); + }) } async getSelectedSwapPair() { - const tokenLocator = "//div//button[@type]//img[@alt]/../h5"; - const fromToken = this.page.locator(tokenLocator).nth(0); - const toToken = this.page.locator(tokenLocator).nth(1); - await expect(fromToken).toBeVisible({ timeout: 2000 }); - const fromTokenText = await fromToken.innerText(); - const toTokenText = await toToken.innerText(); - console.log(`Current pair: ${fromTokenText}/${toTokenText}`); - return `${fromTokenText}/${toTokenText}`; + const tokenLocator = '//div//button[@type]//img[@alt]/../h5' + const fromToken = this.page.locator(tokenLocator).nth(0) + const toToken = this.page.locator(tokenLocator).nth(1) + await expect(fromToken).toBeVisible({ timeout: 2000 }) + const fromTokenText = await fromToken.innerText() + const toTokenText = await toToken.innerText() + console.log(`Current pair: ${fromTokenText}/${toTokenText}`) + return `${fromTokenText}/${toTokenText}` } async buyAndGetWalletMsg(context: BrowserContext, limit = false) { - await expect(this.buyBtn, "Buy button is disabled!").toBeEnabled({ + await expect(this.buyBtn, 'Buy button is disabled!').toBeEnabled({ timeout: 9000, - }); + }) // Handle Pop-up page -> - await this.buyBtn.click(); - const pageApprove = context.waitForEvent("page"); - await this.confirmSwapBtn.click(); - await this.page.waitForTimeout(200); - const approvePage = await pageApprove; - await approvePage.waitForLoadState(); - const approveBtn = approvePage.getByRole("button", { - name: "Approve", - }); - await expect(approveBtn).toBeEnabled(); - let msgTextLocator = "type: osmosis/poolmanager/"; + await this.buyBtn.click() + const pageApprove = context.waitForEvent('page') + await this.confirmSwapBtn.click() + await this.page.waitForTimeout(200) + const approvePage = await pageApprove + await approvePage.waitForLoadState() + const approveBtn = approvePage.getByRole('button', { + name: 'Approve', + }) + await expect(approveBtn).toBeEnabled() + let msgTextLocator = 'type: osmosis/poolmanager/' if (limit) { - msgTextLocator = "Execute contract"; + msgTextLocator = 'Execute contract' } const msgContentAmount = await approvePage .getByText(msgTextLocator) - .textContent(); - console.log(`Wallet is approving this msg: \n${msgContentAmount}`); + .textContent() + console.log(`Wallet is approving this msg: \n${msgContentAmount}`) // Approve trx - await approveBtn.click(); + await approveBtn.click() // wait for trx confirmation - await this.page.waitForTimeout(2000); + await this.page.waitForTimeout(2000) // Handle Pop-up page <- - return { msgContentAmount }; + return { msgContentAmount } } async sellAndGetWalletMsg(context: BrowserContext, limit = false) { // Make sure Sell button is enabled - await expect(this.sellBtn, "Sell button is disabled!").toBeEnabled({ + await expect(this.sellBtn, 'Sell button is disabled!').toBeEnabled({ timeout: 9000, - }); + }) // Handle Pop-up page -> - await this.sellBtn.click(); - const pageApprove = context.waitForEvent("page"); - await this.confirmSwapBtn.click(); - await this.page.waitForTimeout(200); - const approvePage = await pageApprove; - await approvePage.waitForLoadState(); - const approveBtn = approvePage.getByRole("button", { - name: "Approve", - }); - await expect(approveBtn).toBeEnabled(); - let msgTextLocator = "type: osmosis/poolmanager/"; + await this.sellBtn.click() + const pageApprove = context.waitForEvent('page') + await this.confirmSwapBtn.click() + await this.page.waitForTimeout(200) + const approvePage = await pageApprove + await approvePage.waitForLoadState() + const approveBtn = approvePage.getByRole('button', { + name: 'Approve', + }) + await expect(approveBtn).toBeEnabled() + let msgTextLocator = 'type: osmosis/poolmanager/' if (limit) { - msgTextLocator = "Execute contract"; + msgTextLocator = 'Execute contract' } const msgContentAmount = await approvePage .getByText(msgTextLocator) - .textContent(); - console.log(`Wallet is approving this msg: \n${msgContentAmount}`); + .textContent() + console.log(`Wallet is approving this msg: \n${msgContentAmount}`) // Approve trx - await approveBtn.click(); + await approveBtn.click() // wait for trx confirmation - await this.page.waitForTimeout(2000); + await this.page.waitForTimeout(2000) // Handle Pop-up page <- - return { msgContentAmount }; + return { msgContentAmount } } async sellAndApprove(context: BrowserContext) { // Make sure Sell button is enabled - await expect(this.sellBtn, "Sell button is disabled!").toBeEnabled({ + await expect(this.sellBtn, 'Sell button is disabled!').toBeEnabled({ timeout: 9000, - }); - await this.sellBtn.click(); - await this.confirmSwapBtn.click(); - await this.justApproveIfNeeded(context); - await this.page.waitForTimeout(1000); + }) + await this.sellBtn.click() + await this.confirmSwapBtn.click() + await this.justApproveIfNeeded(context) + await this.page.waitForTimeout(1000) } - async buyAndApprove(context: BrowserContext, limit = false) { - await expect(this.buyBtn, "Buy button is disabled!").toBeEnabled({ + async buyAndApprove(context: BrowserContext, _limit = false) { + await expect(this.buyBtn, 'Buy button is disabled!').toBeEnabled({ timeout: 9000, - }); - await this.buyBtn.click(); - await this.confirmSwapBtn.click(); - await this.justApproveIfNeeded(context); - await this.page.waitForTimeout(1000); + }) + await this.buyBtn.click() + await this.confirmSwapBtn.click() + await this.justApproveIfNeeded(context) + await this.page.waitForTimeout(1000) } async swapAndApprove(context: BrowserContext) { // Make sure to have sufficient balance and swap button is enabled expect( await this.isInsufficientBalanceForSwap(), - "Insufficient balance for the swap!" - ).toBeFalsy(); - console.log("Swap and Sign now.."); - await expect(this.swapBtn, "Swap button is disabled!").toBeEnabled({ + 'Insufficient balance for the swap!', + ).toBeFalsy() + console.log('Swap and Sign now..') + await expect(this.swapBtn, 'Swap button is disabled!').toBeEnabled({ timeout: 7000, - }); - await this.swapBtn.click({ timeout: 4000 }); - await this.confirmSwapBtn.click({ timeout: 5000 }); - await this.justApproveIfNeeded(context); + }) + await this.swapBtn.click({ timeout: 4000 }) + await this.confirmSwapBtn.click({ timeout: 5000 }) + await this.justApproveIfNeeded(context) } } diff --git a/packages/e2e/tests/monitoring.limit.wallet.spec.ts b/packages/e2e/tests/monitoring.limit.wallet.spec.ts index 9de6eaf2ab..51b1e714b6 100644 --- a/packages/e2e/tests/monitoring.limit.wallet.spec.ts +++ b/packages/e2e/tests/monitoring.limit.wallet.spec.ts @@ -1,83 +1,83 @@ -import { type BrowserContext, chromium, expect, test } from "@playwright/test"; -import { TestConfig } from "../test-config"; -import { UnzipExtension } from "../unzip-extension"; +import { type BrowserContext, chromium, expect, test } from '@playwright/test' +import { TestConfig } from '../test-config' +import { UnzipExtension } from '../unzip-extension' -import { WalletPage } from "../pages/keplr-page"; -import { TradePage } from "../pages/trade-page"; +import { WalletPage } from '../pages/keplr-page' +import { TradePage } from '../pages/trade-page' -test.describe("Test Filled Limit Order feature", () => { - let context: BrowserContext; - const privateKey = process.env.PRIVATE_KEY ?? "private_key"; - let tradePage: TradePage; +test.describe('Test Filled Limit Order feature', () => { + let context: BrowserContext + const privateKey = process.env.PRIVATE_KEY ?? 'private_key' + let tradePage: TradePage test.beforeAll(async () => { - const pathToExtension = new UnzipExtension().getPathToExtension(); - console.log("\nSetup Wallet Extension before tests."); + const pathToExtension = new UnzipExtension().getPathToExtension() + console.log('\nSetup Wallet Extension before tests.') // Launch Chrome with a Keplr wallet extension context = await chromium.launchPersistentContext( - "", - new TestConfig().getBrowserExtensionConfig(false, pathToExtension) - ); + '', + new TestConfig().getBrowserExtensionConfig(false, pathToExtension), + ) // Get all new pages (including Extension) in the context and wait - const emptyPage = context.pages()[0]; - await emptyPage.waitForTimeout(2000); - const page = context.pages()[1]; - const walletPage = new WalletPage(page); + const emptyPage = context.pages()[0] + await emptyPage.waitForTimeout(2000) + const page = context.pages()[1] + const walletPage = new WalletPage(page) // Import existing Wallet (could be aggregated in one function). - await walletPage.importWalletWithPrivateKey(privateKey); - await walletPage.setWalletNameAndPassword("Monitoring E2E Tests"); - await walletPage.selectChainsAndSave(); - await walletPage.finish(); + await walletPage.importWalletWithPrivateKey(privateKey) + await walletPage.setWalletNameAndPassword('Monitoring E2E Tests') + await walletPage.selectChainsAndSave() + await walletPage.finish() // Switch to Application - tradePage = new TradePage(context.pages()[0]); - await tradePage.goto(); - await tradePage.connectWallet(); - expect(await tradePage.isError(), "Swap is not available!").toBeFalsy(); - }); + tradePage = new TradePage(context.pages()[0]) + await tradePage.goto() + await tradePage.connectWallet() + expect(await tradePage.isError(), 'Swap is not available!').toBeFalsy() + }) test.afterAll(async () => { - await context.close(); - }); + await context.close() + }) // biome-ignore lint/correctness/noEmptyPattern: test.afterEach(async ({}, testInfo) => { - console.log(`Test [${testInfo.title}] status: ${testInfo.status}`); - if (testInfo.status === "failed") { - const name = testInfo.title; - process.env.GITHUB_STEP_SUMMARY = `Test ${name} failed.`; + console.log(`Test [${testInfo.title}] status: ${testInfo.status}`) + if (testInfo.status === 'failed') { + const name = testInfo.title + process.env.GITHUB_STEP_SUMMARY = `Test ${name} failed.` } - }); + }) - test("User should be able to limit sell OSMO", async () => { - await tradePage.goto(); - await tradePage.openSellTab(); - await tradePage.openLimit(); - await tradePage.selectAsset("OSMO"); - await tradePage.enterAmount("1.08"); - await tradePage.setLimitPriceChange("Market"); - await tradePage.sellAndApprove(context); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + test('User should be able to limit sell OSMO', async () => { + await tradePage.goto() + await tradePage.openSellTab() + await tradePage.openLimit() + await tradePage.selectAsset('OSMO') + await tradePage.enterAmount('1.08') + await tradePage.setLimitPriceChange('Market') + await tradePage.sellAndApprove(context) + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to limit buy OSMO", async () => { - const PRICE_INCREASE_FACTOR = 1.07; // 7% increase for limit price - const ORDER_HISTORY_TIMEOUT = 30; // Seconds to wait for order history - await tradePage.goto(); - await tradePage.openBuyTab(); - await tradePage.openLimit(); - await tradePage.selectAsset("OSMO"); - await tradePage.enterAmount("1.04"); - await tradePage.setLimitPriceChange("Market"); - const limitPrice = Number(await tradePage.getLimitPrice()); - const highLimitPrice = (limitPrice * PRICE_INCREASE_FACTOR).toFixed(4); - await tradePage.setLimitPrice(String(highLimitPrice)); - await tradePage.buyAndApprove(context); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); + test('User should be able to limit buy OSMO', async () => { + const PRICE_INCREASE_FACTOR = 1.07 // 7% increase for limit price + const _ORDER_HISTORY_TIMEOUT = 30 // Seconds to wait for order history + await tradePage.goto() + await tradePage.openBuyTab() + await tradePage.openLimit() + await tradePage.selectAsset('OSMO') + await tradePage.enterAmount('1.04') + await tradePage.setLimitPriceChange('Market') + const limitPrice = Number(await tradePage.getLimitPrice()) + const highLimitPrice = (limitPrice * PRICE_INCREASE_FACTOR).toFixed(4) + await tradePage.setLimitPrice(String(highLimitPrice)) + await tradePage.buyAndApprove(context) + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() //await tradePage.gotoOrdersHistory(ORDER_HISTORY_TIMEOUT); //const p = context.pages()[0] //const trxPage = new TransactionsPage(p) //await trxPage.isFilledByLimitPrice(highLimitPrice) - }); -}); + }) +}) diff --git a/packages/e2e/tests/monitoring.market.wallet.spec.ts b/packages/e2e/tests/monitoring.market.wallet.spec.ts index d584ba4755..f31d4d1185 100644 --- a/packages/e2e/tests/monitoring.market.wallet.spec.ts +++ b/packages/e2e/tests/monitoring.market.wallet.spec.ts @@ -1,93 +1,93 @@ -import { type BrowserContext, chromium, expect, test } from "@playwright/test"; +import { type BrowserContext, chromium, expect, test } from '@playwright/test' -import { TestConfig } from "../test-config"; -import { UnzipExtension } from "../unzip-extension"; +import { TestConfig } from '../test-config' +import { UnzipExtension } from '../unzip-extension' -import { WalletPage } from "../pages/keplr-page"; -import { TradePage } from "../pages/trade-page"; +import { WalletPage } from '../pages/keplr-page' +import { TradePage } from '../pages/trade-page' -test.describe("Test Market Buy/Sell Order feature", () => { - let context: BrowserContext; - const privateKey = process.env.PRIVATE_KEY ?? "private_key"; - let tradePage: TradePage; - const TRX_SUCCESS_TIMEOUT = 10000; +test.describe('Test Market Buy/Sell Order feature', () => { + let context: BrowserContext + const privateKey = process.env.PRIVATE_KEY ?? 'private_key' + let tradePage: TradePage + const TRX_SUCCESS_TIMEOUT = 10000 test.beforeAll(async () => { - const pathToExtension = new UnzipExtension().getPathToExtension(); - console.log("\nSetup Wallet Extension before tests."); + const pathToExtension = new UnzipExtension().getPathToExtension() + console.log('\nSetup Wallet Extension before tests.') // Launch Chrome with a Keplr wallet extension context = await chromium.launchPersistentContext( - "", - new TestConfig().getBrowserExtensionConfig(false, pathToExtension) - ); + '', + new TestConfig().getBrowserExtensionConfig(false, pathToExtension), + ) // Get all new pages (including Extension) in the context and wait - const emptyPage = context.pages()[0]; - await emptyPage.waitForTimeout(2000); - const page = context.pages()[1]; - const walletPage = new WalletPage(page); + const emptyPage = context.pages()[0] + await emptyPage.waitForTimeout(2000) + const page = context.pages()[1] + const walletPage = new WalletPage(page) // Import existing Wallet (could be aggregated in one function). - await walletPage.importWalletWithPrivateKey(privateKey); - await walletPage.setWalletNameAndPassword("Monitoring E2E Tests"); - await walletPage.selectChainsAndSave(); - await walletPage.finish(); + await walletPage.importWalletWithPrivateKey(privateKey) + await walletPage.setWalletNameAndPassword('Monitoring E2E Tests') + await walletPage.selectChainsAndSave() + await walletPage.finish() // Switch to Application - tradePage = new TradePage(context.pages()[0]); - await tradePage.goto(); - await tradePage.connectWallet(); - expect(await tradePage.isError(), "Swap is not available!").toBeFalsy(); - }); + tradePage = new TradePage(context.pages()[0]) + await tradePage.goto() + await tradePage.connectWallet() + expect(await tradePage.isError(), 'Swap is not available!').toBeFalsy() + }) test.afterAll(async () => { - await context.close(); - }); + await context.close() + }) // biome-ignore lint/correctness/noEmptyPattern: test.afterEach(async ({}, testInfo) => { - console.log(`Test [${testInfo.title}] status: ${testInfo.status}`); - if (testInfo.status === "failed") { - const name = testInfo.title; - process.env.GITHUB_STEP_SUMMARY = `Test ${name} failed.`; - console.log(`GITHUB_STEP_SUMMARY: ${process.env.GITHUB_STEP_SUMMARY}`); + console.log(`Test [${testInfo.title}] status: ${testInfo.status}`) + if (testInfo.status === 'failed') { + const name = testInfo.title + process.env.GITHUB_STEP_SUMMARY = `Test ${name} failed.` + console.log(`GITHUB_STEP_SUMMARY: ${process.env.GITHUB_STEP_SUMMARY}`) } - }); + }) // biome-ignore lint/complexity/noForEach: - [{ name: "BTC" }, { name: "OSMO" }].forEach(({ name }) => { + ;[{ name: 'BTC' }, { name: 'OSMO' }].forEach(({ name }) => { test(`User should be able to Market Buy ${name}`, async () => { - await tradePage.goto(); - await tradePage.openBuyTab(); - await tradePage.selectAsset(name); - await tradePage.enterAmount("1.55"); - await tradePage.isSufficientBalanceForTrade(); - await tradePage.showSwapInfo(); - await tradePage.buyAndApprove(context); - await tradePage.isTransactionSuccesful(TRX_SUCCESS_TIMEOUT); - await tradePage.getTransactionUrl(); - }); - }); + await tradePage.goto() + await tradePage.openBuyTab() + await tradePage.selectAsset(name) + await tradePage.enterAmount('1.55') + await tradePage.isSufficientBalanceForTrade() + await tradePage.showSwapInfo() + await tradePage.buyAndApprove(context) + await tradePage.isTransactionSuccesful(TRX_SUCCESS_TIMEOUT) + await tradePage.getTransactionUrl() + }) + }) // unwrapped market sell tests just in case this affects anything. - test("User should be able to Market Sell BTC", async () => { - await tradePage.goto(); - await tradePage.openSellTab(); - await tradePage.selectAsset("BTC"); - await tradePage.enterAmount("1.54"); - await tradePage.isSufficientBalanceForTrade(); - await tradePage.showSwapInfo(); - await tradePage.sellAndApprove(context); - await tradePage.isTransactionSuccesful(TRX_SUCCESS_TIMEOUT); - await tradePage.getTransactionUrl(); - }); + test('User should be able to Market Sell BTC', async () => { + await tradePage.goto() + await tradePage.openSellTab() + await tradePage.selectAsset('BTC') + await tradePage.enterAmount('1.54') + await tradePage.isSufficientBalanceForTrade() + await tradePage.showSwapInfo() + await tradePage.sellAndApprove(context) + await tradePage.isTransactionSuccesful(TRX_SUCCESS_TIMEOUT) + await tradePage.getTransactionUrl() + }) - test("User should be able to Market Sell OSMO", async () => { - await tradePage.goto(); - await tradePage.openSellTab(); - await tradePage.selectAsset("OSMO"); - await tradePage.enterAmount("1.54"); - await tradePage.isSufficientBalanceForTrade(); - await tradePage.showSwapInfo(); - await tradePage.sellAndApprove(context); - await tradePage.isTransactionSuccesful(TRX_SUCCESS_TIMEOUT); - await tradePage.getTransactionUrl(); - }); -}); + test('User should be able to Market Sell OSMO', async () => { + await tradePage.goto() + await tradePage.openSellTab() + await tradePage.selectAsset('OSMO') + await tradePage.enterAmount('1.54') + await tradePage.isSufficientBalanceForTrade() + await tradePage.showSwapInfo() + await tradePage.sellAndApprove(context) + await tradePage.isTransactionSuccesful(TRX_SUCCESS_TIMEOUT) + await tradePage.getTransactionUrl() + }) +}) diff --git a/packages/e2e/tests/monitoring.swap.wallet.spec.ts b/packages/e2e/tests/monitoring.swap.wallet.spec.ts index 2c47d52a3b..e5dfdbf919 100644 --- a/packages/e2e/tests/monitoring.swap.wallet.spec.ts +++ b/packages/e2e/tests/monitoring.swap.wallet.spec.ts @@ -1,61 +1,61 @@ -import { type BrowserContext, chromium, expect, test } from "@playwright/test"; +import { type BrowserContext, chromium, expect, test } from '@playwright/test' -import { WalletPage } from "../pages/keplr-page"; -import { TradePage } from "../pages/trade-page"; -import { TestConfig } from "../test-config"; -import { UnzipExtension } from "../unzip-extension"; +import { WalletPage } from '../pages/keplr-page' +import { TradePage } from '../pages/trade-page' +import { TestConfig } from '../test-config' +import { UnzipExtension } from '../unzip-extension' -test.describe("Test Swap Stables feature", () => { - let context: BrowserContext; - const privateKey = process.env.PRIVATE_KEY ?? "private_key"; - let tradePage: TradePage; - const swapAmount = "0.55"; +test.describe('Test Swap Stables feature', () => { + let context: BrowserContext + const privateKey = process.env.PRIVATE_KEY ?? 'private_key' + let tradePage: TradePage + const swapAmount = '0.55' test.beforeAll(async () => { - const pathToExtension = new UnzipExtension().getPathToExtension(); - console.log("\nSetup Wallet Extension before tests."); + const pathToExtension = new UnzipExtension().getPathToExtension() + console.log('\nSetup Wallet Extension before tests.') // Launch Chrome with a Keplr wallet extension context = await chromium.launchPersistentContext( - "", - new TestConfig().getBrowserExtensionConfig(false, pathToExtension) - ); + '', + new TestConfig().getBrowserExtensionConfig(false, pathToExtension), + ) // Get all new pages (including Extension) in the context and wait - const emptyPage = context.pages()[0]; - await emptyPage.waitForTimeout(2000); - let page = context.pages()[1]; - const walletPage = new WalletPage(page); + const emptyPage = context.pages()[0] + await emptyPage.waitForTimeout(2000) + let page = context.pages()[1] + const walletPage = new WalletPage(page) // Import existing Wallet (could be aggregated in one function). - await walletPage.importWalletWithPrivateKey(privateKey); - await walletPage.setWalletNameAndPassword("Test Stables"); - await walletPage.selectChainsAndSave(); - await walletPage.finish(); - page = context.pages()[0]; - tradePage = new TradePage(page); + await walletPage.importWalletWithPrivateKey(privateKey) + await walletPage.setWalletNameAndPassword('Test Stables') + await walletPage.selectChainsAndSave() + await walletPage.finish() + page = context.pages()[0] + tradePage = new TradePage(page) - await tradePage.goto(); - await tradePage.connectWallet(); - expect(await tradePage.isError(), "Swap is not available!").toBeFalsy(); - }); + await tradePage.goto() + await tradePage.connectWallet() + expect(await tradePage.isError(), 'Swap is not available!').toBeFalsy() + }) test.afterAll(async () => { - await context.close(); - }); + await context.close() + }) // biome-ignore lint/complexity/noForEach: - [ - { from: "USDC", to: "USDC.eth.axl" }, - { from: "USDC.eth.axl", to: "USDC" }, - { from: "USDC", to: "USDT" }, - { from: "USDT", to: "USDC" }, + ;[ + { from: 'USDC', to: 'USDC.eth.axl' }, + { from: 'USDC.eth.axl', to: 'USDC' }, + { from: 'USDC', to: 'USDT' }, + { from: 'USDT', to: 'USDC' }, ].forEach(({ from, to }) => { test(`User should be able to swap ${from} to ${to}`, async () => { - await tradePage.goto(); - await tradePage.selectPair(from, to); - await tradePage.enterAmount(swapAmount); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); - }); -}); + await tradePage.goto() + await tradePage.selectPair(from, to) + await tradePage.enterAmount(swapAmount) + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) + }) +}) diff --git a/packages/e2e/tests/select.spec.ts b/packages/e2e/tests/select.spec.ts index f78f4bc23f..5dca8db5be 100644 --- a/packages/e2e/tests/select.spec.ts +++ b/packages/e2e/tests/select.spec.ts @@ -4,104 +4,104 @@ import { type Page, chromium, test, -} from "@playwright/test"; +} from '@playwright/test' -import { TradePage } from "../pages/trade-page"; -import { TestConfig } from "../test-config"; +import { TradePage } from '../pages/trade-page' +import { TestConfig } from '../test-config' // Pairs are selected from top 10 -test.describe("Test Select Swap Pair feature", () => { - let context: BrowserContext; - let swapPage: TradePage; - let page: Page; +test.describe('Test Select Swap Pair feature', () => { + let context: BrowserContext + let swapPage: TradePage + let page: Page test.beforeAll(async () => { context = await chromium.launchPersistentContext( - "", - new TestConfig().getBrowserConfig(true) - ); - page = context.pages()[0]; - swapPage = new TradePage(page); - await swapPage.goto(); - }); + '', + new TestConfig().getBrowserConfig(true), + ) + page = context.pages()[0] + swapPage = new TradePage(page) + await swapPage.goto() + }) test.afterAll(async () => { - await context.close(); - }); - - test("User should be able to select BTC/USDC", async () => { - await swapPage.goto(); - await swapPage.selectPair("nBTC", "USDC"); - await swapPage.enterAmount("0.01"); - await swapPage.showSwapInfo(); - }); - - test("User should be able to select WBTC/USDC", async () => { - await swapPage.goto(); - await swapPage.selectPair("WBTC", "USDC"); - await swapPage.enterAmount("0.1"); - await swapPage.showSwapInfo(); - }); - - test("User should be able to select OSMO/USDC", async () => { - await swapPage.goto(); - await swapPage.selectPair("OSMO", "USDC"); - await swapPage.enterAmount("1"); - await swapPage.showSwapInfo(); - }); - - test("User should be able to select INJ/USDC", async () => { - await swapPage.goto(); - await swapPage.selectPair("INJ", "USDC"); - await swapPage.enterAmount("10"); - await swapPage.showSwapInfo(); - }); - - test("User should be able to select TIA/USDC", async () => { - await swapPage.goto(); - await swapPage.selectPair("TIA", "USDC"); - await swapPage.enterAmount("100"); - await swapPage.showSwapInfo(); - }); - - test("User should be able to select ATOM/USDC", async () => { - await swapPage.selectPair("ATOM", "USDC"); - await swapPage.enterAmount("100"); - }); - - test("User should be able to select USDT/USDC", async () => { - await swapPage.selectPair("USDT", "USDC"); - await swapPage.enterAmount("10000"); - }); - - test("User should be able to select TIA/OSMO", async () => { - await swapPage.selectPair("TIA", "OSMO"); - await swapPage.enterAmount("100"); - }); - - test("User should be able to select AKT/OSMO", async () => { - await swapPage.selectPair("AKT", "OSMO"); - await swapPage.enterAmount("100"); - }); - - test("User should be able to select PICA/OSMO", async () => { - await swapPage.selectPair("PICA", "OSMO"); - await swapPage.enterAmount("100"); - }); - - test("User should be able to select USDT/OSMO", async () => { - await swapPage.selectPair("USDT", "OSMO"); - await swapPage.enterAmount("100"); - }); - - test("User should be able to select TIA/BOOT", async () => { + await context.close() + }) + + test('User should be able to select BTC/USDC', async () => { + await swapPage.goto() + await swapPage.selectPair('nBTC', 'USDC') + await swapPage.enterAmount('0.01') + await swapPage.showSwapInfo() + }) + + test('User should be able to select WBTC/USDC', async () => { + await swapPage.goto() + await swapPage.selectPair('WBTC', 'USDC') + await swapPage.enterAmount('0.1') + await swapPage.showSwapInfo() + }) + + test('User should be able to select OSMO/USDC', async () => { + await swapPage.goto() + await swapPage.selectPair('OSMO', 'USDC') + await swapPage.enterAmount('1') + await swapPage.showSwapInfo() + }) + + test('User should be able to select INJ/USDC', async () => { + await swapPage.goto() + await swapPage.selectPair('INJ', 'USDC') + await swapPage.enterAmount('10') + await swapPage.showSwapInfo() + }) + + test('User should be able to select TIA/USDC', async () => { + await swapPage.goto() + await swapPage.selectPair('TIA', 'USDC') + await swapPage.enterAmount('100') + await swapPage.showSwapInfo() + }) + + test('User should be able to select ATOM/USDC', async () => { + await swapPage.selectPair('ATOM', 'USDC') + await swapPage.enterAmount('100') + }) + + test('User should be able to select USDT/USDC', async () => { + await swapPage.selectPair('USDT', 'USDC') + await swapPage.enterAmount('10000') + }) + + test('User should be able to select TIA/OSMO', async () => { + await swapPage.selectPair('TIA', 'OSMO') + await swapPage.enterAmount('100') + }) + + test('User should be able to select AKT/OSMO', async () => { + await swapPage.selectPair('AKT', 'OSMO') + await swapPage.enterAmount('100') + }) + + test('User should be able to select PICA/OSMO', async () => { + await swapPage.selectPair('PICA', 'OSMO') + await swapPage.enterAmount('100') + }) + + test('User should be able to select USDT/OSMO', async () => { + await swapPage.selectPair('USDT', 'OSMO') + await swapPage.enterAmount('100') + }) + + test('User should be able to select TIA/BOOT', async () => { // Just to verify some odd pair - await swapPage.selectPair("TIA", "BOOT"); - await swapPage.enterAmount("100"); - }); - - test("User should be able to select stATOM/USDC", async () => { - await swapPage.selectPair("stATOM", "USDC"); - await swapPage.enterAmount("100"); - }); -}); + await swapPage.selectPair('TIA', 'BOOT') + await swapPage.enterAmount('100') + }) + + test('User should be able to select stATOM/USDC', async () => { + await swapPage.selectPair('stATOM', 'USDC') + await swapPage.enterAmount('100') + }) +}) diff --git a/packages/e2e/tests/swap.osmo.wallet.spec.ts b/packages/e2e/tests/swap.osmo.wallet.spec.ts index 06302eaca7..3ca6a138f5 100644 --- a/packages/e2e/tests/swap.osmo.wallet.spec.ts +++ b/packages/e2e/tests/swap.osmo.wallet.spec.ts @@ -1,83 +1,83 @@ -import { type BrowserContext, chromium, expect, test } from "@playwright/test"; +import { type BrowserContext, chromium, expect, test } from '@playwright/test' -import { TestConfig } from "../test-config"; -import { UnzipExtension } from "../unzip-extension"; +import { TestConfig } from '../test-config' +import { UnzipExtension } from '../unzip-extension' -import { WalletPage } from "../pages/keplr-page"; -import { TradePage } from "../pages/trade-page"; +import { WalletPage } from '../pages/keplr-page' +import { TradePage } from '../pages/trade-page' -test.describe("Test Swap to/from OSMO feature", () => { - let context: BrowserContext; - const walletId = - process.env.WALLET_ID ?? "osmo1qyc8u7cn0zjxcu9dvrjz5zwfnn0ck92v62ak9l"; - const privateKey = process.env.PRIVATE_KEY ?? "private_key"; - let tradePage: TradePage; - const ATOM = - "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"; +test.describe('Test Swap to/from OSMO feature', () => { + let context: BrowserContext + const _walletId = + process.env.WALLET_ID ?? 'osmo1qyc8u7cn0zjxcu9dvrjz5zwfnn0ck92v62ak9l' + const privateKey = process.env.PRIVATE_KEY ?? 'private_key' + let tradePage: TradePage + const _ATOM = + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' test.beforeAll(async () => { - const pathToExtension = new UnzipExtension().getPathToExtension(); - console.log("\nSetup Wallet Extension before tests."); + const pathToExtension = new UnzipExtension().getPathToExtension() + console.log('\nSetup Wallet Extension before tests.') // Launch Chrome with a Keplr wallet extension context = await chromium.launchPersistentContext( - "", - new TestConfig().getBrowserExtensionConfig(false, pathToExtension) - ); + '', + new TestConfig().getBrowserExtensionConfig(false, pathToExtension), + ) // Get all new pages (including Extension) in the context and wait - const emptyPage = context.pages()[0]; - await emptyPage.waitForTimeout(2000); - const page = context.pages()[1]; - const walletPage = new WalletPage(page); + const emptyPage = context.pages()[0] + await emptyPage.waitForTimeout(2000) + const page = context.pages()[1] + const walletPage = new WalletPage(page) // Import existing Wallet (could be aggregated in one function). - await walletPage.importWalletWithPrivateKey(privateKey); - await walletPage.setWalletNameAndPassword("Test Swaps"); - await walletPage.selectChainsAndSave(); - await walletPage.finish(); + await walletPage.importWalletWithPrivateKey(privateKey) + await walletPage.setWalletNameAndPassword('Test Swaps') + await walletPage.selectChainsAndSave() + await walletPage.finish() // Switch to Application - tradePage = new TradePage(context.pages()[0]); - await tradePage.goto(); - await tradePage.connectWallet(); - expect(await tradePage.isError(), "Swap is not available!").toBeFalsy(); - }); + tradePage = new TradePage(context.pages()[0]) + await tradePage.goto() + await tradePage.connectWallet() + expect(await tradePage.isError(), 'Swap is not available!').toBeFalsy() + }) test.afterAll(async () => { - await context.close(); - }); + await context.close() + }) - test.skip("User should be able to swap OSMO to WBTC", async () => { - await tradePage.goto(); - await tradePage.selectPair("OSMO", "WBTC"); - await tradePage.enterAmount("0.9"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test.skip('User should be able to swap OSMO to WBTC', async () => { + await tradePage.goto() + await tradePage.selectPair('OSMO', 'WBTC') + await tradePage.enterAmount('0.9') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain("denom: uosmo"); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap OSMO to ATOM", async () => { - await tradePage.goto(); - await tradePage.selectPair("OSMO", "ATOM"); - await tradePage.enterAmount("0.2"); - await tradePage.swapAndApprove(context); + test('User should be able to swap OSMO to ATOM', async () => { + await tradePage.goto() + await tradePage.selectPair('OSMO', 'ATOM') + await tradePage.enterAmount('0.2') + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`token_out_denom: ${ATOM}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain("denom: uosmo"); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap ATOM to OSMO", async () => { - await tradePage.goto(); - await tradePage.selectPair("ATOM", "OSMO"); - await tradePage.enterAmount("0.01"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap ATOM to OSMO', async () => { + await tradePage.goto() + await tradePage.selectPair('ATOM', 'OSMO') + await tradePage.enterAmount('0.01') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${ATOM}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain("token_out_denom: uosmo"); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); -}); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) +}) diff --git a/packages/e2e/tests/swap.usdc.wallet.spec.ts b/packages/e2e/tests/swap.usdc.wallet.spec.ts index b7e157a7e7..7e72daf5c7 100644 --- a/packages/e2e/tests/swap.usdc.wallet.spec.ts +++ b/packages/e2e/tests/swap.usdc.wallet.spec.ts @@ -1,184 +1,184 @@ -import { type BrowserContext, chromium, expect, test } from "@playwright/test"; +import { type BrowserContext, chromium, expect, test } from '@playwright/test' -import { TestConfig } from "../test-config"; -import { UnzipExtension } from "../unzip-extension"; +import { TestConfig } from '../test-config' +import { UnzipExtension } from '../unzip-extension' -import { WalletPage } from "../pages/keplr-page"; -import { TradePage } from "../pages/trade-page"; +import { WalletPage } from '../pages/keplr-page' +import { TradePage } from '../pages/trade-page' -test.describe("Test Swap to/from USDC feature", () => { - let context: BrowserContext; - const walletId = - process.env.WALLET_ID ?? "osmo1qyc8u7cn0zjxcu9dvrjz5zwfnn0ck92v62ak9l"; - const privateKey = process.env.PRIVATE_KEY ?? "private_key"; - let tradePage: TradePage; - const USDC = - "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4"; - const ATOM = - "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"; - const TIA = - "ibc/D79E7D83AB399BFFF93433E54FAA480C191248FC556924A2A8351AE2638B3877"; - const INJ = - "ibc/64BA6E31FE887D66C6F8F31C7B1A80C7CA179239677B4088BB55F5EA07DBE273"; - const AKT = - "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4"; +test.describe('Test Swap to/from USDC feature', () => { + let context: BrowserContext + const _walletId = + process.env.WALLET_ID ?? 'osmo1qyc8u7cn0zjxcu9dvrjz5zwfnn0ck92v62ak9l' + const privateKey = process.env.PRIVATE_KEY ?? 'private_key' + let tradePage: TradePage + const _USDC = + 'ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4' + const _ATOM = + 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' + const _TIA = + 'ibc/D79E7D83AB399BFFF93433E54FAA480C191248FC556924A2A8351AE2638B3877' + const _INJ = + 'ibc/64BA6E31FE887D66C6F8F31C7B1A80C7CA179239677B4088BB55F5EA07DBE273' + const _AKT = + 'ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4' test.beforeAll(async () => { - const pathToExtension = new UnzipExtension().getPathToExtension(); - console.log("\nSetup Wallet Extension before tests."); + const pathToExtension = new UnzipExtension().getPathToExtension() + console.log('\nSetup Wallet Extension before tests.') // Launch Chrome with a Keplr wallet extension context = await chromium.launchPersistentContext( - "", - new TestConfig().getBrowserExtensionConfig(false, pathToExtension) - ); + '', + new TestConfig().getBrowserExtensionConfig(false, pathToExtension), + ) // Get all new pages (including Extension) in the context and wait - const emptyPage = context.pages()[0]; - await emptyPage.waitForTimeout(2000); - const page = context.pages()[1]; - const walletPage = new WalletPage(page); + const emptyPage = context.pages()[0] + await emptyPage.waitForTimeout(2000) + const page = context.pages()[1] + const walletPage = new WalletPage(page) // Import existing Wallet (could be aggregated in one function). - await walletPage.importWalletWithPrivateKey(privateKey); - await walletPage.setWalletNameAndPassword("Test Swaps"); - await walletPage.selectChainsAndSave(); - await walletPage.finish(); + await walletPage.importWalletWithPrivateKey(privateKey) + await walletPage.setWalletNameAndPassword('Test Swaps') + await walletPage.selectChainsAndSave() + await walletPage.finish() // Switch to Application - tradePage = new TradePage(context.pages()[0]); - await tradePage.goto(); - await tradePage.connectWallet(); - expect(await tradePage.isError(), "Swap is not available!").toBeFalsy(); - }); + tradePage = new TradePage(context.pages()[0]) + await tradePage.goto() + await tradePage.connectWallet() + expect(await tradePage.isError(), 'Swap is not available!').toBeFalsy() + }) test.afterAll(async () => { - await context.close(); - }); + await context.close() + }) - test("User should be able to swap OSMO to USDC", async () => { - await tradePage.goto(); - await tradePage.selectPair("OSMO", "USDC"); - await tradePage.enterAmount("0.2"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap OSMO to USDC', async () => { + await tradePage.goto() + await tradePage.selectPair('OSMO', 'USDC') + await tradePage.enterAmount('0.2') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`token_out_denom: ${USDC}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain("denom: uosmo"); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap USDC to OSMO", async () => { - await tradePage.goto(); - await tradePage.selectPair("USDC", "OSMO"); - await tradePage.enterAmount("0.1"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap USDC to OSMO', async () => { + await tradePage.goto() + await tradePage.selectPair('USDC', 'OSMO') + await tradePage.enterAmount('0.1') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain("token_out_denom: uosmo"); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`denom: ${USDC}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap ATOM to USDC", async () => { - await tradePage.goto(); - await tradePage.selectPair("ATOM", "USDC"); - await tradePage.enterAmount("0.015"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap ATOM to USDC', async () => { + await tradePage.goto() + await tradePage.selectPair('ATOM', 'USDC') + await tradePage.enterAmount('0.015') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${ATOM}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${USDC}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap USDC to ATOM", async () => { - await tradePage.goto(); - await tradePage.selectPair("USDC", "ATOM"); - await tradePage.enterAmount("0.1"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap USDC to ATOM', async () => { + await tradePage.goto() + await tradePage.selectPair('USDC', 'ATOM') + await tradePage.enterAmount('0.1') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${USDC}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${ATOM}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap USDC to TIA", async () => { - await tradePage.goto(); - await tradePage.selectPair("USDC", "TIA"); - await tradePage.enterAmount("0.1"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap USDC to TIA', async () => { + await tradePage.goto() + await tradePage.selectPair('USDC', 'TIA') + await tradePage.enterAmount('0.1') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${USDC}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${TIA}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap TIA to USDC", async () => { - await tradePage.goto(); - await tradePage.selectPair("TIA", "USDC"); - await tradePage.enterAmount("0.02"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap TIA to USDC', async () => { + await tradePage.goto() + await tradePage.selectPair('TIA', 'USDC') + await tradePage.enterAmount('0.02') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${TIA}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${USDC}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap USDC to INJ", async () => { - await tradePage.goto(); - await tradePage.selectPair("USDC", "INJ"); - await tradePage.enterAmount("0.2"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap USDC to INJ', async () => { + await tradePage.goto() + await tradePage.selectPair('USDC', 'INJ') + await tradePage.enterAmount('0.2') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${USDC}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${INJ}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap INJ to USDC", async () => { - await tradePage.goto(); - await tradePage.selectPair("INJ", "USDC"); - await tradePage.enterAmount("0.01"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap INJ to USDC', async () => { + await tradePage.goto() + await tradePage.selectPair('INJ', 'USDC') + await tradePage.enterAmount('0.01') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${INJ}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${USDC}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap USDC to AKT", async () => { - await tradePage.goto(); - await tradePage.selectPair("USDC", "AKT"); - await tradePage.enterAmount("0.1"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap USDC to AKT', async () => { + await tradePage.goto() + await tradePage.selectPair('USDC', 'AKT') + await tradePage.enterAmount('0.1') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${USDC}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${AKT}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) - test("User should be able to swap AKT to USDC", async () => { - await tradePage.goto(); - await tradePage.selectPair("AKT", "USDC"); - await tradePage.enterAmount("0.025"); - await tradePage.showSwapInfo(); - await tradePage.swapAndApprove(context); + test('User should be able to swap AKT to USDC', async () => { + await tradePage.goto() + await tradePage.selectPair('AKT', 'USDC') + await tradePage.enterAmount('0.025') + await tradePage.showSwapInfo() + await tradePage.swapAndApprove(context) //expect(msgContent).toContain(`denom: ${AKT}`); //expect(msgContent).toContain(`sender: ${walletId}`); //expect(msgContent).toContain(`token_out_denom: ${USDC}`); - await tradePage.isTransactionSuccesful(); - await tradePage.getTransactionUrl(); - }); -}); + await tradePage.isTransactionSuccesful() + await tradePage.getTransactionUrl() + }) +}) From 206712a16d8c8d6d0dadcacae5ad233b7214d1bc Mon Sep 17 00:00:00 2001 From: yurydubinin <62520712+yury-dubinin@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:47:40 +0100 Subject: [PATCH 3/5] fix --- packages/e2e/tests/portfolio.wallet.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e/tests/portfolio.wallet.spec.ts b/packages/e2e/tests/portfolio.wallet.spec.ts index 7ceba58f4b..061f42da03 100644 --- a/packages/e2e/tests/portfolio.wallet.spec.ts +++ b/packages/e2e/tests/portfolio.wallet.spec.ts @@ -16,7 +16,7 @@ test.describe('Test Portfolio feature', () => { let context: BrowserContext const privateKey = process.env.PRIVATE_KEY ?? 'pk' let portfolioPage: PortfolioPage - const dollarBalanceRegEx = /\$\d+/ + const dollarBalanceRegEx = /\d+/ let page: Page test.beforeAll(async () => { From 048b7787bed3330ff7a40ff64fc4475a51b79257 Mon Sep 17 00:00:00 2001 From: yurydubinin <62520712+yury-dubinin@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:55:20 +0100 Subject: [PATCH 4/5] disable no import --- packages/web/pages/api/broadcast-transaction.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/web/pages/api/broadcast-transaction.ts b/packages/web/pages/api/broadcast-transaction.ts index a251400fc2..a82b6588a9 100644 --- a/packages/web/pages/api/broadcast-transaction.ts +++ b/packages/web/pages/api/broadcast-transaction.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line unused-imports/no-unused-imports import { ChainList } from "~/config/generated/chain-list"; /** From 9e0cf1722d75e9c1a96b084067b0cad7e6986e70 Mon Sep 17 00:00:00 2001 From: yurydubinin <62520712+yury-dubinin@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:44:50 +0100 Subject: [PATCH 5/5] revert disable rule --- package.json | 2 +- packages/web/pages/api/broadcast-transaction.ts | 1 - yarn.lock | 15 ++++----------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 01102c0b7b..d1d5255353 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "eslint-plugin-import": "^2.28.1", "eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-unicorn": "^48.0.1", - "eslint-plugin-unused-imports": "^3.0.0", + "eslint-plugin-unused-imports": "^4.1.4", "is-ci-cli": "^2.2.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", diff --git a/packages/web/pages/api/broadcast-transaction.ts b/packages/web/pages/api/broadcast-transaction.ts index a82b6588a9..a251400fc2 100644 --- a/packages/web/pages/api/broadcast-transaction.ts +++ b/packages/web/pages/api/broadcast-transaction.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line unused-imports/no-unused-imports import { ChainList } from "~/config/generated/chain-list"; /** diff --git a/yarn.lock b/yarn.lock index 95a62f96d5..06a648f585 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11980,17 +11980,10 @@ eslint-plugin-unicorn@^48.0.1: semver "^7.5.4" strip-indent "^3.0.0" -eslint-plugin-unused-imports@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.0.0.tgz#d25175b0072ff16a91892c3aa72a09ca3a9e69e7" - integrity sha512-sduiswLJfZHeeBJ+MQaG+xYzSWdRXoSw61DpU13mzWumCkR0ufD0HmO4kdNokjrkluMHpj/7PJeN35pgbhW3kw== - dependencies: - eslint-rule-composer "^0.3.0" - -eslint-rule-composer@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz" - integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== +eslint-plugin-unused-imports@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz#62ddc7446ccbf9aa7b6f1f0b00a980423cda2738" + integrity sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ== eslint-scope@^7.2.2: version "7.2.2"