From e93a7730e5ecd93321e0ad627e0591d12579a458 Mon Sep 17 00:00:00 2001 From: matstyler Date: Mon, 11 Mar 2024 19:28:53 +0100 Subject: [PATCH 1/4] :sparkles: feat: Cypress configuration --- docs/docs/guides/playwright.md | 8 +- examples/new-dawn/test/e2e/01_basic.spec.ts | 2 +- pnpm-lock.yaml | 659 +++++++++++++++++- wallets/metamask/cypress.config.ts | 30 + wallets/metamask/package.json | 3 + wallets/metamask/src/constants.ts | 3 + wallets/metamask/src/support/commands.ts | 37 + wallets/metamask/src/support/e2e.ts | 19 + .../test/e2e/cypress/addNetwork.cy.ts | 5 + .../{ => playwright}/metamask/PPOM.spec.ts | 6 +- .../metamask/addNetwork.spec.ts | 4 +- .../metamask/addNewAccount.spec.ts | 3 +- .../metamask/addNewToken.spec.ts | 2 +- .../metamask/approveNewNetwork.spec.ts | 0 .../metamask/approvePermission.spec.ts | 0 .../metamask/approveSwitchNetwork.spec.ts | 0 .../metamask/batchTransfer.spec.ts | 0 .../metamask/closeTransactionDetails.spec.ts | 0 .../metamask/confirmSignature.spec.ts | 0 .../metamask/confirmTransaction.spec.ts | 0 ...confirmTransactionAndWaitForMining.spec.ts | 0 .../metamask/connectToDapp.spec.ts | 2 +- .../{ => playwright}/metamask/encrypt.spec.ts | 0 .../metamask/goBackToHomePage.spec.ts | 2 +- .../metamask/importWallet.spec.ts | 4 +- .../importWalletFromPrivateKey.spec.ts | 2 +- .../{ => playwright}/metamask/lock.spec.ts | 2 +- .../metamask/openSettings.spec.ts | 2 +- .../metamask/openSidebarMenu.spec.ts | 2 +- .../metamask/openTransactionDetails.spec.ts | 0 .../metamask/rejectAddNetwork.spec.ts | 0 .../metamask/rejectPermission.spec.ts | 2 +- .../metamask/rejectSignature.spec.ts | 0 .../metamask/rejectSwitchNetwork.spec.ts | 0 .../metamask/rejectTransaction.spec.ts | 2 +- .../metamask/resetAccount.spec.ts | 2 +- .../metamask/switchAccount.spec.ts | 2 +- .../metamask/switchNetwork.spec.ts | 2 +- ...ismissSecretRecoveryPhraseReminder.spec.ts | 4 +- .../metamask/toggleShowTestNetworks.spec.ts | 4 +- .../{ => playwright}/metamask/unlock.spec.ts | 2 +- .../e2e/{ => playwright}/testWithMetaMask.ts | 2 +- .../wallet-setup/basic.setup.ts | 6 +- .../wallet-setup/connected.setup.ts | 6 +- wallets/metamask/tsconfig.json | 4 +- 45 files changed, 775 insertions(+), 60 deletions(-) create mode 100644 wallets/metamask/cypress.config.ts create mode 100644 wallets/metamask/src/constants.ts create mode 100644 wallets/metamask/src/support/commands.ts create mode 100644 wallets/metamask/src/support/e2e.ts create mode 100644 wallets/metamask/test/e2e/cypress/addNetwork.cy.ts rename wallets/metamask/test/e2e/{ => playwright}/metamask/PPOM.spec.ts (92%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/addNetwork.spec.ts (96%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/addNewAccount.spec.ts (93%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/addNewToken.spec.ts (93%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/approveNewNetwork.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/approvePermission.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/approveSwitchNetwork.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/batchTransfer.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/closeTransactionDetails.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/confirmSignature.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/confirmTransaction.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/confirmTransactionAndWaitForMining.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/connectToDapp.spec.ts (95%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/encrypt.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/goBackToHomePage.spec.ts (91%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/importWallet.spec.ts (95%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/importWalletFromPrivateKey.spec.ts (96%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/lock.spec.ts (88%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/openSettings.spec.ts (90%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/openSidebarMenu.spec.ts (93%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/openTransactionDetails.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/rejectAddNetwork.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/rejectPermission.spec.ts (87%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/rejectSignature.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/rejectSwitchNetwork.spec.ts (100%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/rejectTransaction.spec.ts (87%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/resetAccount.spec.ts (90%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/switchAccount.spec.ts (95%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/switchNetwork.spec.ts (96%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts (87%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/toggleShowTestNetworks.spec.ts (90%) rename wallets/metamask/test/e2e/{ => playwright}/metamask/unlock.spec.ts (89%) rename wallets/metamask/test/e2e/{ => playwright}/testWithMetaMask.ts (96%) rename wallets/metamask/test/e2e/{ => playwright}/wallet-setup/basic.setup.ts (61%) rename wallets/metamask/test/e2e/{ => playwright}/wallet-setup/connected.setup.ts (84%) diff --git a/docs/docs/guides/playwright.md b/docs/docs/guides/playwright.md index 10d2040c..fd10839d 100644 --- a/docs/docs/guides/playwright.md +++ b/docs/docs/guides/playwright.md @@ -7,7 +7,7 @@ Let's digest a simple test step by step: ::: code-group ```typescript [example.spec.ts] import { MetaMask, testWithSynpress, unlockForFixture } from '@synthetixio/synpress' -import BasicSetup from '../wallet-setup/basic.setup' +import BasicSetup from '../playwright/wallet-setup/basic.setup' const test = testWithSynpress(BasicSetup, unlockForFixture) @@ -34,7 +34,7 @@ First, you need to import the `testWithSynpress` function from `@synthetixio/syn ```typescript import { MetaMask, testWithSynpress, unlockForFixture } from '@synthetixio/synpress' -import BasicSetup from '../wallet-setup/basic.setup' +import BasicSetup from '../playwright/wallet-setup/basic.setup' const test = testWithSynpress(BasicSetup, unlockForFixture) ``` @@ -98,7 +98,7 @@ export const testWithMetaMask = testWithSynpress(connectedSetup, unlockForFixtur ``` ```typescript [basic.spec.ts] -import {testWithMetaMask as test} from './testWithMetaMask' +import {testWithMetaMask as test} from './playwright/testWithMetaMask' const { expect } = test @@ -114,7 +114,7 @@ test('should connect wallet to dapp', async ({ context, page, extensionId, metam }) ``` ```typescript [basic.spec.ts] -import { testWithMetaMask as test } from './testWithMetaMask'; +import { testWithMetaMask as test } from './playwright/testWithMetaMask'; const { expect } = test; diff --git a/examples/new-dawn/test/e2e/01_basic.spec.ts b/examples/new-dawn/test/e2e/01_basic.spec.ts index 08ce4f9b..9bc5594f 100644 --- a/examples/new-dawn/test/e2e/01_basic.spec.ts +++ b/examples/new-dawn/test/e2e/01_basic.spec.ts @@ -1,5 +1,5 @@ import { MetaMask, testWithSynpress, unlockForFixture } from '@synthetixio/synpress' -import BasicSetup from '../wallet-setup/basic.setup' +import BasicSetup from '../playwright/wallet-setup/basic.setup' const test = testWithSynpress(BasicSetup, unlockForFixture) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5820709b..076317a7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,6 +85,31 @@ importers: specifier: 5.3.3 version: 5.3.3 + examples/new-dawn-cypress: + dependencies: + '@synthetixio/synpress': + specifier: 4.0.0-alpha.3 + version: link:../../release + dotenv: + specifier: 16.4.2 + version: 16.4.2 + devDependencies: + '@metamask/test-dapp': + specifier: 8.1.0 + version: 8.1.0 + '@types/node': + specifier: 20.11.17 + version: 20.11.17 + cypress: + specifier: 13.6.6 + version: 13.6.6 + serve: + specifier: 14.2.1 + version: 14.2.1 + typescript: + specifier: 5.3.3 + version: 5.3.3 + packages/core: dependencies: axios: @@ -261,6 +286,9 @@ importers: '@vitest/coverage-v8': specifier: 1.2.2 version: 1.2.2(vitest@1.2.2) + cypress: + specifier: 13.6.6 + version: 13.6.6 rimraf: specifier: 5.0.5 version: 5.0.5 @@ -750,6 +778,39 @@ packages: chalk: 4.1.2 dev: true + /@cypress/request@3.0.1: + resolution: {integrity: sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==} + engines: {node: '>= 6'} + dependencies: + aws-sign2: 0.7.0 + aws4: 1.12.0 + caseless: 0.12.0 + combined-stream: 1.0.8 + extend: 3.0.2 + forever-agent: 0.6.1 + form-data: 2.3.3 + http-signature: 1.3.6 + is-typedarray: 1.0.0 + isstream: 0.1.2 + json-stringify-safe: 5.0.1 + mime-types: 2.1.35 + performance-now: 2.1.0 + qs: 6.10.4 + safe-buffer: 5.2.1 + tough-cookie: 4.1.3 + tunnel-agent: 0.6.0 + uuid: 8.3.2 + dev: true + + /@cypress/xvfb@1.2.4(supports-color@8.1.1): + resolution: {integrity: sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==} + dependencies: + debug: 3.2.7(supports-color@8.1.1) + lodash.once: 4.1.1 + transitivePeerDependencies: + - supports-color + dev: true + /@docsearch/css@3.5.2: resolution: {integrity: sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==} dev: true @@ -1734,6 +1795,14 @@ packages: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true + /@types/sinonjs__fake-timers@8.1.1: + resolution: {integrity: sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==} + dev: true + + /@types/sizzle@2.3.8: + resolution: {integrity: sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==} + dev: true + /@types/statuses@2.0.4: resolution: {integrity: sha512-eqNDvZsCNY49OAXB0Firg/Sc2BgoWsntsLUdybGFOhAfCD6QJ2n9HXUIHGqt5qjrxmMv4wS8WLAw43ZkKcJ8Pw==} dev: true @@ -1755,6 +1824,14 @@ packages: resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} dev: true + /@types/yauzl@2.10.3: + resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} + requiresBuild: true + dependencies: + '@types/node': 20.11.17 + dev: true + optional: true + /@viem/anvil@0.0.7: resolution: {integrity: sha512-F+3ljCT1bEt8T4Fzm9gWpIgO3Dc7bzG1TtUtkStkJFMuummqZ8kvYc3UFMo5j3F51fSWZZvEkjs3+i7qf0AOqQ==} dependencies: @@ -1786,7 +1863,7 @@ packages: dependencies: '@ampproject/remapping': 2.2.1 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 @@ -2047,7 +2124,7 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -2258,23 +2335,51 @@ packages: engines: {node: '>=0.10.0'} dev: true + /asn1@0.2.6: + resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /assert-plus@1.0.0: + resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} + engines: {node: '>=0.8'} + dev: true + /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true + /astral-regex@2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + dev: true + /async@3.2.5: resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} dev: true /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: false + + /at-least-node@1.0.0: + resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} + engines: {node: '>= 4.0.0'} + dev: true /available-typed-arrays@1.0.6: resolution: {integrity: sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==} engines: {node: '>= 0.4'} dev: true + /aws-sign2@0.7.0: + resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} + dev: true + + /aws4@1.12.0: + resolution: {integrity: sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==} + dev: true + /axios@1.6.7: resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} dependencies: @@ -2292,6 +2397,16 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + /base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: true + + /bcrypt-pbkdf@1.0.2: + resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} + dependencies: + tweetnacl: 0.14.5 + dev: true + /better-path-resolve@1.0.0: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} @@ -2315,10 +2430,18 @@ packages: chainsaw: 0.1.0 dev: false + /blob-util@2.0.2: + resolution: {integrity: sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==} + dev: true + /bluebird@3.4.7: resolution: {integrity: sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==} dev: false + /bluebird@3.7.2: + resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} + dev: true + /boxen@7.0.0: resolution: {integrity: sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==} engines: {node: '>=14.16'} @@ -2383,6 +2506,13 @@ packages: engines: {node: '>=0.10'} dev: false + /buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + /buffers@0.1.1: resolution: {integrity: sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==} engines: {node: '>=0.2.0'} @@ -2474,6 +2604,11 @@ packages: responselike: 3.0.0 dev: true + /cachedir@2.4.0: + resolution: {integrity: sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==} + engines: {node: '>=6'} + dev: true + /call-bind@1.0.5: resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} dependencies: @@ -2501,6 +2636,10 @@ packages: engines: {node: '>=14.16'} dev: true + /caseless@0.12.0: + resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} + dev: true + /chai@4.4.1: resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} engines: {node: '>=4'} @@ -2562,6 +2701,11 @@ packages: get-func-name: 2.0.2 dev: true + /check-more-types@2.24.0: + resolution: {integrity: sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==} + engines: {node: '>= 0.8.0'} + dev: true + /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -2596,6 +2740,13 @@ packages: engines: {node: '>=10'} dev: true + /cli-cursor@3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + dependencies: + restore-cursor: 3.1.0 + dev: true + /cli-cursor@4.0.0: resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2617,6 +2768,14 @@ packages: '@colors/colors': 1.5.0 dev: true + /cli-truncate@2.1.0: + resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==} + engines: {node: '>=8'} + dependencies: + slice-ansi: 3.0.0 + string-width: 4.2.3 + dev: true + /cli-truncate@4.0.0: resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} engines: {node: '>=18'} @@ -2694,7 +2853,6 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 - dev: false /commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} @@ -2715,6 +2873,11 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} + /commander@6.2.1: + resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==} + engines: {node: '>= 6'} + dev: true + /commitlint-config-gitmoji@2.3.1: resolution: {integrity: sha512-T15ssbsyNc6szHlnGWo0/xvIA1mObqM70E9TwKNVTpksxhm+OdFht8hvDdKJAVi4nlZX5tcfTeILOi7SHBGH3w==} dependencies: @@ -2732,6 +2895,11 @@ packages: gitmojis: 3.14.0 dev: true + /common-tags@1.8.2: + resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} + engines: {node: '>=4.0.0'} + dev: true + /compress-commons@5.0.1: resolution: {integrity: sha512-MPh//1cERdLtqwO3pOFLeXtpuai0Y2WCd5AhtKxznqM7WtaMYaOEMSgn45d9D10sIHSfIKE603HlOp8OPGrvag==} engines: {node: '>= 12.0.0'} @@ -2803,6 +2971,10 @@ packages: engines: {node: '>= 0.6'} dev: true + /core-util-is@1.0.2: + resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} + dev: true + /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -2869,6 +3041,67 @@ packages: stream-transform: 2.1.3 dev: true + /cypress@13.6.6: + resolution: {integrity: sha512-S+2S9S94611hXimH9a3EAYt81QM913ZVA03pUmGDfLTFa5gyp85NJ8dJGSlEAEmyRsYkioS1TtnWtbv/Fzt11A==} + engines: {node: ^16.0.0 || ^18.0.0 || >=20.0.0} + hasBin: true + requiresBuild: true + dependencies: + '@cypress/request': 3.0.1 + '@cypress/xvfb': 1.2.4(supports-color@8.1.1) + '@types/sinonjs__fake-timers': 8.1.1 + '@types/sizzle': 2.3.8 + arch: 2.2.0 + blob-util: 2.0.2 + bluebird: 3.7.2 + buffer: 5.7.1 + cachedir: 2.4.0 + chalk: 4.1.2 + check-more-types: 2.24.0 + cli-cursor: 3.1.0 + cli-table3: 0.6.3 + commander: 6.2.1 + common-tags: 1.8.2 + dayjs: 1.11.10 + debug: 4.3.4(supports-color@8.1.1) + enquirer: 2.4.1 + eventemitter2: 6.4.7 + execa: 4.1.0 + executable: 4.1.1 + extract-zip: 2.0.1(supports-color@8.1.1) + figures: 3.2.0 + fs-extra: 9.1.0 + getos: 3.2.1 + is-ci: 3.0.1 + is-installed-globally: 0.4.0 + lazy-ass: 1.6.0 + listr2: 3.14.0(enquirer@2.4.1) + lodash: 4.17.21 + log-symbols: 4.1.0 + minimist: 1.2.8 + ospath: 1.2.2 + pretty-bytes: 5.6.0 + process: 0.11.10 + proxy-from-env: 1.0.0 + request-progress: 3.0.0 + semver: 7.5.4 + supports-color: 8.1.1 + tmp: 0.2.3 + untildify: 4.0.0 + yauzl: 2.10.0 + dev: true + + /dashdash@1.14.1: + resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} + engines: {node: '>=0.10'} + dependencies: + assert-plus: 1.0.0 + dev: true + + /dayjs@1.11.10: + resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} + dev: true + /debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -2880,7 +3113,19 @@ packages: ms: 2.0.0 dev: true - /debug@4.3.4: + /debug@3.2.7(supports-color@8.1.1): + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + supports-color: 8.1.1 + dev: true + + /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -2890,6 +3135,7 @@ packages: optional: true dependencies: ms: 2.1.2 + supports-color: 8.1.1 /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} @@ -2955,7 +3201,6 @@ packages: /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - dev: false /delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} @@ -3008,6 +3253,13 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + /ecc-jsbn@0.1.2: + resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} + dependencies: + jsbn: 0.1.1 + safer-buffer: 2.1.2 + dev: true + /emoji-regex@10.3.0: resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} dev: true @@ -3026,6 +3278,12 @@ packages: dev: true optional: true + /end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + dependencies: + once: 1.4.0 + dev: true + /enquirer@2.4.1: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} @@ -3215,6 +3473,10 @@ packages: '@types/estree': 1.0.5 dev: true + /eventemitter2@6.4.7: + resolution: {integrity: sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==} + dev: true + /eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: false @@ -3223,6 +3485,21 @@ packages: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} dev: true + /execa@4.1.0: + resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 5.2.0 + human-signals: 1.1.1 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -3267,10 +3544,21 @@ packages: strip-final-newline: 3.0.0 dev: true + /executable@4.1.1: + resolution: {integrity: sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==} + engines: {node: '>=4'} + dependencies: + pify: 2.3.0 + dev: true + /exponential-backoff@3.1.1: resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} dev: true + /extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + dev: true + /extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} dev: true @@ -3284,6 +3572,25 @@ packages: tmp: 0.0.33 dev: true + /extract-zip@2.0.1(supports-color@8.1.1): + resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} + engines: {node: '>= 10.17.0'} + hasBin: true + dependencies: + debug: 4.3.4(supports-color@8.1.1) + get-stream: 5.2.0 + yauzl: 2.10.0 + optionalDependencies: + '@types/yauzl': 2.10.3 + transitivePeerDependencies: + - supports-color + dev: true + + /extsprintf@1.3.0: + resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} + engines: {'0': node >=0.6.0} + dev: true + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -3321,6 +3628,12 @@ packages: dependencies: reusify: 1.0.4 + /fd-slicer@1.1.0: + resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + dependencies: + pend: 1.2.0 + dev: true + /figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} @@ -3386,11 +3699,24 @@ packages: cross-spawn: 7.0.3 signal-exit: 4.1.0 + /forever-agent@0.6.1: + resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} + dev: true + /form-data-encoder@2.1.4: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} engines: {node: '>= 14.17'} dev: true + /form-data@2.3.3: + resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} + engines: {node: '>= 0.12'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -3432,6 +3758,16 @@ packages: universalify: 0.1.2 dev: true + /fs-extra@9.1.0: + resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} + engines: {node: '>=10'} + dependencies: + at-least-node: 1.0.0 + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + dev: true + /fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} @@ -3544,6 +3880,13 @@ packages: engines: {node: '>=12'} dev: true + /get-stream@5.2.0: + resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} + engines: {node: '>=8'} + dependencies: + pump: 3.0.0 + dev: true + /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -3561,6 +3904,18 @@ packages: get-intrinsic: 1.2.2 dev: true + /getos@3.2.1: + resolution: {integrity: sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==} + dependencies: + async: 3.2.5 + dev: true + + /getpass@0.1.7: + resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} + dependencies: + assert-plus: 1.0.0 + dev: true + /git-hooks-list@3.1.0: resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==} dev: true @@ -3787,7 +4142,7 @@ packages: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -3803,6 +4158,15 @@ packages: - debug dev: false + /http-signature@1.3.6: + resolution: {integrity: sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==} + engines: {node: '>=0.10'} + dependencies: + assert-plus: 1.0.0 + jsprim: 2.0.2 + sshpk: 1.18.0 + dev: true + /http2-wrapper@2.2.1: resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} engines: {node: '>=10.19.0'} @@ -3816,7 +4180,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -3825,6 +4189,11 @@ packages: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} dev: true + /human-signals@1.1.1: + resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} + engines: {node: '>=8.12.0'} + dev: true + /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -3872,6 +4241,10 @@ packages: dev: true optional: true + /ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: true + /ignore-walk@6.0.4: resolution: {integrity: sha512-t7sv42WkwFkyKbivUCglsQW5YWMskWtbEf4MNKX5u/CCWHKSPzN4FtBQGsQZgCLbxOzpVlcbWVK5KB3auIOjSw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -4143,6 +4516,11 @@ packages: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} dev: true + /is-unicode-supported@0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + dev: true + /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: @@ -4176,6 +4554,10 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + /isstream@0.1.2: + resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} + dev: true + /istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -4194,7 +4576,7 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -4244,6 +4626,10 @@ packages: argparse: 2.0.1 dev: true + /jsbn@0.1.1: + resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} + dev: true + /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} dev: true @@ -4283,6 +4669,14 @@ packages: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: true + /json-schema@0.4.0: + resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + dev: true + + /json-stringify-safe@5.0.1: + resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + dev: true + /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -4305,7 +4699,6 @@ packages: universalify: 2.0.1 optionalDependencies: graceful-fs: 4.2.11 - dev: false /jsonlines@0.1.1: resolution: {integrity: sha512-ekDrAGso79Cvf+dtm+mL8OBI2bmAOt3gssYs833De/C9NmIpWDWyUO4zPgB5x2/OhY366dkhgfPMYfwZF7yOZA==} @@ -4316,6 +4709,16 @@ packages: engines: {'0': node >= 0.2.0} dev: true + /jsprim@2.0.2: + resolution: {integrity: sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==} + engines: {'0': node >=0.6.0} + dependencies: + assert-plus: 1.0.0 + extsprintf: 1.3.0 + json-schema: 0.4.0 + verror: 1.10.0 + dev: true + /keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} dependencies: @@ -4339,6 +4742,11 @@ packages: package-json: 8.1.1 dev: true + /lazy-ass@1.6.0: + resolution: {integrity: sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==} + engines: {node: '> 0.8'} + dev: true + /lazystream@1.0.1: resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} engines: {node: '>= 0.6.3'} @@ -4360,7 +4768,7 @@ packages: dependencies: chalk: 5.3.0 commander: 11.1.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) execa: 8.0.1 lilconfig: 3.0.0 listr2: 8.0.1 @@ -4376,6 +4784,26 @@ packages: resolution: {integrity: sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ==} dev: false + /listr2@3.14.0(enquirer@2.4.1): + resolution: {integrity: sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==} + engines: {node: '>=10.0.0'} + peerDependencies: + enquirer: '>= 2.3.0 < 3' + peerDependenciesMeta: + enquirer: + optional: true + dependencies: + cli-truncate: 2.1.0 + colorette: 2.0.20 + enquirer: 2.4.1 + log-update: 4.0.0 + p-map: 4.0.0 + rfdc: 1.3.1 + rxjs: 7.8.1 + through: 2.3.8 + wrap-ansi: 7.0.0 + dev: true + /listr2@8.0.1: resolution: {integrity: sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==} engines: {node: '>=18.0.0'} @@ -4432,6 +4860,10 @@ packages: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} dev: true + /lodash.once@4.1.1: + resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} + dev: true + /lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} @@ -4443,6 +4875,24 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true + /log-symbols@4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + dev: true + + /log-update@4.0.0: + resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} + engines: {node: '>=10'} + dependencies: + ansi-escapes: 4.3.2 + cli-cursor: 3.1.0 + slice-ansi: 4.0.0 + wrap-ansi: 6.2.0 + dev: true + /log-update@6.0.0: resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} engines: {node: '>=18'} @@ -5115,6 +5565,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /ospath@1.2.2: + resolution: {integrity: sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==} + dev: true + /outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} dev: true @@ -5293,10 +5747,18 @@ packages: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true + /pend@1.2.0: + resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} + dev: true + /perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} dev: true + /performance-now@2.1.0: + resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + dev: true + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true @@ -5311,6 +5773,11 @@ packages: hasBin: true dev: true + /pify@2.3.0: + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} + engines: {node: '>=0.10.0'} + dev: true + /pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} @@ -5401,6 +5868,11 @@ packages: hasBin: true dev: true + /pretty-bytes@5.6.0: + resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} + engines: {node: '>=6'} + dev: true + /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5418,6 +5890,11 @@ packages: /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + /process@0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + dev: true + /progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} @@ -5451,6 +5928,10 @@ packages: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} dev: true + /proxy-from-env@1.0.0: + resolution: {integrity: sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==} + dev: true + /proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} dev: false @@ -5459,6 +5940,17 @@ packages: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true + /psl@1.9.0: + resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + dev: true + + /pump@3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: true + /punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} dev: true @@ -5474,6 +5966,17 @@ packages: escape-goat: 4.0.0 dev: true + /qs@6.10.4: + resolution: {integrity: sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /querystringify@2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + dev: true + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -5508,7 +6011,7 @@ packages: /rc-config-loader@4.1.3: resolution: {integrity: sha512-kD7FqML7l800i6pS6pvLyIE2ncbk9Du8Q0gp/4hMPhJU6ZxApkoLcGD8ZeqgiAlfwZ6BlETq6qqe+12DUL207w==} dependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) js-yaml: 4.1.0 json5: 2.2.3 require-from-string: 2.0.2 @@ -5663,6 +6166,12 @@ packages: engines: {node: '>=8'} dev: true + /request-progress@3.0.0: + resolution: {integrity: sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==} + dependencies: + throttleit: 1.0.1 + dev: true + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -5679,7 +6188,6 @@ packages: /requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} - dev: false /resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} @@ -5705,6 +6213,14 @@ packages: lowercase-keys: 3.0.0 dev: true + /restore-cursor@3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + /restore-cursor@4.0.0: resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -5988,6 +6504,24 @@ packages: engines: {node: '>=12'} dev: true + /slice-ansi@3.0.0: + resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + dev: true + + /slice-ansi@4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + dev: true + /slice-ansi@5.0.0: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} engines: {node: '>=12'} @@ -6027,7 +6561,7 @@ packages: engines: {node: '>= 10'} dependencies: agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -6126,6 +6660,22 @@ packages: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true + /sshpk@1.18.0: + resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} + engines: {node: '>=0.10.0'} + hasBin: true + dependencies: + asn1: 0.2.6 + assert-plus: 1.0.0 + bcrypt-pbkdf: 1.0.2 + dashdash: 1.14.1 + ecc-jsbn: 0.1.2 + getpass: 0.1.7 + jsbn: 0.1.1 + safer-buffer: 2.1.2 + tweetnacl: 0.14.5 + dev: true + /ssri@10.0.5: resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -6310,6 +6860,12 @@ packages: dependencies: has-flag: 4.0.0 + /supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -6373,6 +6929,14 @@ packages: tslib: 2.6.2 dev: true + /throttleit@1.0.1: + resolution: {integrity: sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==} + dev: true + + /through@2.3.8: + resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + dev: true + /tinybench@2.6.0: resolution: {integrity: sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==} dev: true @@ -6405,6 +6969,11 @@ packages: os-tmpdir: 1.0.2 dev: true + /tmp@0.2.3: + resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==} + engines: {node: '>=14.14'} + dev: true + /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} @@ -6416,6 +6985,16 @@ packages: dependencies: is-number: 7.0.0 + /tough-cookie@4.1.3: + resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==} + engines: {node: '>=6'} + dependencies: + psl: 1.9.0 + punycode: 2.3.1 + universalify: 0.2.0 + url-parse: 1.5.10 + dev: true + /tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} dependencies: @@ -6463,7 +7042,7 @@ packages: bundle-require: 4.0.2(esbuild@0.19.12) cac: 6.7.14 chokidar: 3.5.3 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) esbuild: 0.19.12 execa: 5.1.1 globby: 11.1.0 @@ -6498,12 +7077,18 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: '@tufjs/models': 1.0.4 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) make-fetch-happen: 11.1.1 transitivePeerDependencies: - supports-color dev: true + /tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + dependencies: + safe-buffer: 5.2.1 + dev: true + /turbo-darwin-64@1.12.3: resolution: {integrity: sha512-dDglIaux+A4jOnB9CDH69sujmrnuLJLrKw1t3J+if6ySlFuxSwC++gDq9TVuOZo2+S7lFkGh+x5ytn3wp+jE8Q==} cpu: [x64] @@ -6564,6 +7149,10 @@ packages: turbo-windows-arm64: 1.12.3 dev: true + /tweetnacl@0.14.5: + resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} + dev: true + /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -6745,10 +7334,14 @@ packages: engines: {node: '>= 4.0.0'} dev: true + /universalify@0.2.0: + resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} + engines: {node: '>= 4.0.0'} + dev: true + /universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} - dev: false /untildify@4.0.0: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} @@ -6803,9 +7396,21 @@ packages: punycode: 2.3.1 dev: true + /url-parse@1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + dev: true + /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + /uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: true + /v8-to-istanbul@9.2.0: resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} @@ -6834,13 +7439,22 @@ packages: engines: {node: '>= 0.8'} dev: true + /verror@1.10.0: + resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} + engines: {'0': node >=0.6.0} + dependencies: + assert-plus: 1.0.0 + core-util-is: 1.0.2 + extsprintf: 1.3.0 + dev: true + /vite-node@1.2.2(@types/node@20.11.17): resolution: {integrity: sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: cac: 6.7.14 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) pathe: 1.1.2 picocolors: 1.0.0 vite: 5.0.12(@types/node@20.11.17) @@ -6980,7 +7594,7 @@ packages: acorn-walk: 8.3.2 cac: 6.7.14 chai: 4.4.1 - debug: 4.3.4 + debug: 4.3.4(supports-color@8.1.1) execa: 8.0.1 local-pkg: 0.5.0 magic-string: 0.30.6 @@ -7263,6 +7877,13 @@ packages: yargs-parser: 21.1.1 dev: true + /yauzl@2.10.0: + resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} + dependencies: + buffer-crc32: 0.2.13 + fd-slicer: 1.1.0 + dev: true + /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} diff --git a/wallets/metamask/cypress.config.ts b/wallets/metamask/cypress.config.ts new file mode 100644 index 00000000..b16945de --- /dev/null +++ b/wallets/metamask/cypress.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from 'cypress' +import { prepareExtension } from './src/prepareExtension' + +export default defineConfig({ + e2e: { + baseUrl: 'http://localhost:9999', + supportFile: 'src/support/e2e.{js,jsx,ts,tsx}', + specPattern: 'test/**/*.cy.{js,jsx,ts,tsx}', + fixturesFolder: 'src/fixture-actions', + testIsolation: false, + setupNodeEvents(on, config) { + const browsers = config.browsers.filter((b) => b.name === 'chrome') + if (browsers.length === 0) { + throw new Error('No Chrome browser found in the configuration') + } + + on('before:browser:launch', async (browser, launchOptions) => { + const metamasExtensionPath = await prepareExtension() + launchOptions.extensions.push(metamasExtensionPath) + + return launchOptions + }) + + return { + ...config, + browsers + } + } + } +}) diff --git a/wallets/metamask/package.json b/wallets/metamask/package.json index 1117c6d3..958996e7 100644 --- a/wallets/metamask/package.json +++ b/wallets/metamask/package.json @@ -24,7 +24,9 @@ "test": "vitest run", "test:coverage": "vitest run --coverage", "test:e2e:headful": "playwright test", + "test:e2e:headful:cypress": "cypress run --browser chrome --headed", "test:e2e:headless": "HEADLESS=true playwright test", + "test:e2e:headless:cypress": "cypress run --browser chrome", "test:e2e:headless:ui": "HEADLESS=true playwright test --ui", "test:watch": "vitest watch", "types:check": "tsc --noEmit" @@ -38,6 +40,7 @@ "@synthetixio/synpress-tsconfig": "0.0.1-alpha.3", "@types/node": "20.11.17", "@vitest/coverage-v8": "1.2.2", + "cypress": "13.6.6", "rimraf": "5.0.5", "tsup": "8.0.2", "typescript": "5.3.3", diff --git a/wallets/metamask/src/constants.ts b/wallets/metamask/src/constants.ts new file mode 100644 index 00000000..3da5f154 --- /dev/null +++ b/wallets/metamask/src/constants.ts @@ -0,0 +1,3 @@ +export const SEED_PHRASE = 'test test test test test test test test test test test junk' + +export const PASSWORD = 'Tester@1234' diff --git a/wallets/metamask/src/support/commands.ts b/wallets/metamask/src/support/commands.ts new file mode 100644 index 00000000..698b01a4 --- /dev/null +++ b/wallets/metamask/src/support/commands.ts @@ -0,0 +1,37 @@ +/// +// *********************************************** +// This example commands.ts shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add('login', (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) +// +// declare global { +// namespace Cypress { +// interface Chainable { +// login(email: string, password: string): Chainable +// drag(subject: string, options?: Partial): Chainable +// dismiss(subject: string, options?: Partial): Chainable +// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable +// } +// } +// } \ No newline at end of file diff --git a/wallets/metamask/src/support/e2e.ts b/wallets/metamask/src/support/e2e.ts new file mode 100644 index 00000000..0eef2ce9 --- /dev/null +++ b/wallets/metamask/src/support/e2e.ts @@ -0,0 +1,19 @@ +// *********************************************************** +// This example support/e2e.ts is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// TODO: Add MetaMask initial setup here. diff --git a/wallets/metamask/test/e2e/cypress/addNetwork.cy.ts b/wallets/metamask/test/e2e/cypress/addNetwork.cy.ts new file mode 100644 index 00000000..adb8e603 --- /dev/null +++ b/wallets/metamask/test/e2e/cypress/addNetwork.cy.ts @@ -0,0 +1,5 @@ +describe('My First Test', () => { + it('Does not do much!', () => { + expect(true).to.equal(true) + }) +}) diff --git a/wallets/metamask/test/e2e/metamask/PPOM.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/PPOM.spec.ts similarity index 92% rename from wallets/metamask/test/e2e/metamask/PPOM.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/PPOM.spec.ts index 37e2ca03..12fd8117 100644 --- a/wallets/metamask/test/e2e/metamask/PPOM.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/PPOM.spec.ts @@ -1,6 +1,6 @@ -import { getNotificationPageAndWaitForLoad } from '../../../src/utils/getNotificationPageAndWaitForLoad' -import { createDataTestSelector } from '../../../src/utils/selectors/createDataTestSelector' -import { testWithMetaMask } from '../testWithMetaMask' +import { getNotificationPageAndWaitForLoad } from '../../../../src/utils/getNotificationPageAndWaitForLoad' +import { createDataTestSelector } from '../../../../src/utils/selectors/createDataTestSelector' +import { testWithMetaMask } from '..//testWithMetaMask' const test = testWithMetaMask diff --git a/wallets/metamask/test/e2e/metamask/addNetwork.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/addNetwork.spec.ts similarity index 96% rename from wallets/metamask/test/e2e/metamask/addNetwork.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/addNetwork.spec.ts index b15b745d..169fa4bd 100644 --- a/wallets/metamask/test/e2e/metamask/addNetwork.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/addNetwork.spec.ts @@ -1,7 +1,7 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { z } from 'zod' -import { MetaMask, unlockForFixture } from '../../../src' -import { waitFor } from '../../../src/utils/waitFor' +import { MetaMask, unlockForFixture } from '../../../../src' +import { waitFor } from '../../../../src/utils/waitFor' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/addNewAccount.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/addNewAccount.spec.ts similarity index 93% rename from wallets/metamask/test/e2e/metamask/addNewAccount.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/addNewAccount.spec.ts index c5a43b20..123a68f2 100644 --- a/wallets/metamask/test/e2e/metamask/addNewAccount.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/addNewAccount.spec.ts @@ -1,6 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' - +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' const test = testWithSynpress(basicSetup, unlockForFixture) diff --git a/wallets/metamask/test/e2e/metamask/addNewToken.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/addNewToken.spec.ts similarity index 93% rename from wallets/metamask/test/e2e/metamask/addNewToken.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/addNewToken.spec.ts index a7f883cd..4ffadaa0 100644 --- a/wallets/metamask/test/e2e/metamask/addNewToken.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/addNewToken.spec.ts @@ -1,4 +1,4 @@ -import Selectors from '../../../src/pages/HomePage/selectors' +import Selectors from '../../../../src/pages/HomePage/selectors' import { testWithMetaMask } from '../testWithMetaMask' const test = testWithMetaMask diff --git a/wallets/metamask/test/e2e/metamask/approveNewNetwork.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/approveNewNetwork.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/approveNewNetwork.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/approveNewNetwork.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/approvePermission.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/approvePermission.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/approvePermission.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/approvePermission.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/approveSwitchNetwork.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/approveSwitchNetwork.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/approveSwitchNetwork.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/approveSwitchNetwork.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/batchTransfer.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/batchTransfer.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/batchTransfer.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/batchTransfer.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/closeTransactionDetails.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/closeTransactionDetails.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/closeTransactionDetails.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/closeTransactionDetails.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/confirmSignature.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/confirmSignature.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/confirmSignature.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/confirmSignature.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/confirmTransaction.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/confirmTransaction.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/confirmTransaction.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/confirmTransaction.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/confirmTransactionAndWaitForMining.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/confirmTransactionAndWaitForMining.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/confirmTransactionAndWaitForMining.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/confirmTransactionAndWaitForMining.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts similarity index 95% rename from wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts index 0a9e5629..89a4df37 100644 --- a/wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/encrypt.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/encrypt.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/encrypt.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/encrypt.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/goBackToHomePage.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/goBackToHomePage.spec.ts similarity index 91% rename from wallets/metamask/test/e2e/metamask/goBackToHomePage.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/goBackToHomePage.spec.ts index 4992628d..3a9f950a 100644 --- a/wallets/metamask/test/e2e/metamask/goBackToHomePage.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/goBackToHomePage.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/importWallet.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/importWallet.spec.ts similarity index 95% rename from wallets/metamask/test/e2e/metamask/importWallet.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/importWallet.spec.ts index 436e21d6..5cff00ea 100644 --- a/wallets/metamask/test/e2e/metamask/importWallet.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/importWallet.spec.ts @@ -1,6 +1,6 @@ import { type Page, chromium, test as base } from '@playwright/test' -import { MetaMask } from '../../../src' -import { prepareExtension } from '../../../src/prepareExtension' +import { MetaMask } from '../../../../src' +import { prepareExtension } from '../../../../src/prepareExtension' const SEED_PHRASE = 'test test test test test test test test test test test junk' const PASSWORD = 'Tester@1234' diff --git a/wallets/metamask/test/e2e/metamask/importWalletFromPrivateKey.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/importWalletFromPrivateKey.spec.ts similarity index 96% rename from wallets/metamask/test/e2e/metamask/importWalletFromPrivateKey.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/importWalletFromPrivateKey.spec.ts index b6b17ce5..cafc897a 100644 --- a/wallets/metamask/test/e2e/metamask/importWalletFromPrivateKey.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/importWalletFromPrivateKey.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/lock.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/lock.spec.ts similarity index 88% rename from wallets/metamask/test/e2e/metamask/lock.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/lock.spec.ts index b8d2305a..4dcf16cf 100644 --- a/wallets/metamask/test/e2e/metamask/lock.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/lock.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/openSettings.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/openSettings.spec.ts similarity index 90% rename from wallets/metamask/test/e2e/metamask/openSettings.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/openSettings.spec.ts index 7971af11..f5658e56 100644 --- a/wallets/metamask/test/e2e/metamask/openSettings.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/openSettings.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/openSidebarMenu.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/openSidebarMenu.spec.ts similarity index 93% rename from wallets/metamask/test/e2e/metamask/openSidebarMenu.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/openSidebarMenu.spec.ts index 2b31b2a0..435604d8 100644 --- a/wallets/metamask/test/e2e/metamask/openSidebarMenu.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/openSidebarMenu.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/openTransactionDetails.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/openTransactionDetails.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/openTransactionDetails.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/openTransactionDetails.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/rejectAddNetwork.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/rejectAddNetwork.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/rejectAddNetwork.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/rejectAddNetwork.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/rejectPermission.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/rejectPermission.spec.ts similarity index 87% rename from wallets/metamask/test/e2e/metamask/rejectPermission.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/rejectPermission.spec.ts index 25f31d7d..621ac86e 100644 --- a/wallets/metamask/test/e2e/metamask/rejectPermission.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/rejectPermission.spec.ts @@ -1,4 +1,4 @@ -import { testWithMetaMask } from '../testWithMetaMask' +import { testWithMetaMask } from '..//testWithMetaMask' const test = testWithMetaMask diff --git a/wallets/metamask/test/e2e/metamask/rejectSignature.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/rejectSignature.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/rejectSignature.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/rejectSignature.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/rejectSwitchNetwork.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/rejectSwitchNetwork.spec.ts similarity index 100% rename from wallets/metamask/test/e2e/metamask/rejectSwitchNetwork.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/rejectSwitchNetwork.spec.ts diff --git a/wallets/metamask/test/e2e/metamask/rejectTransaction.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/rejectTransaction.spec.ts similarity index 87% rename from wallets/metamask/test/e2e/metamask/rejectTransaction.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/rejectTransaction.spec.ts index 7a889ce1..9752b28c 100644 --- a/wallets/metamask/test/e2e/metamask/rejectTransaction.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/rejectTransaction.spec.ts @@ -1,4 +1,4 @@ -import { testWithMetaMask } from '../testWithMetaMask' +import { testWithMetaMask } from '..//testWithMetaMask' const test = testWithMetaMask diff --git a/wallets/metamask/test/e2e/metamask/resetAccount.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/resetAccount.spec.ts similarity index 90% rename from wallets/metamask/test/e2e/metamask/resetAccount.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/resetAccount.spec.ts index 64d772aa..299a86a2 100644 --- a/wallets/metamask/test/e2e/metamask/resetAccount.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/resetAccount.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/switchAccount.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/switchAccount.spec.ts similarity index 95% rename from wallets/metamask/test/e2e/metamask/switchAccount.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/switchAccount.spec.ts index 6365240d..33d276fb 100644 --- a/wallets/metamask/test/e2e/metamask/switchAccount.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/switchAccount.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/switchNetwork.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/switchNetwork.spec.ts similarity index 96% rename from wallets/metamask/test/e2e/metamask/switchNetwork.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/switchNetwork.spec.ts index 0ab2b36b..accc4ae1 100644 --- a/wallets/metamask/test/e2e/metamask/switchNetwork.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/switchNetwork.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts similarity index 87% rename from wallets/metamask/test/e2e/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts index 4d7b13a8..4605624a 100644 --- a/wallets/metamask/test/e2e/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts @@ -1,7 +1,7 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' -import Selectors from '../../../src/pages/HomePage/selectors' +import Selectors from '../../../../src/pages/HomePage/selectors' import basicSetup from '../wallet-setup/basic.setup' const test = testWithSynpress(basicSetup, unlockForFixture) diff --git a/wallets/metamask/test/e2e/metamask/toggleShowTestNetworks.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/toggleShowTestNetworks.spec.ts similarity index 90% rename from wallets/metamask/test/e2e/metamask/toggleShowTestNetworks.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/toggleShowTestNetworks.spec.ts index 879628d5..c4834322 100644 --- a/wallets/metamask/test/e2e/metamask/toggleShowTestNetworks.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/toggleShowTestNetworks.spec.ts @@ -1,7 +1,7 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' -import Selectors from '../../../src/pages/HomePage/selectors' +import Selectors from '../../../../src/pages/HomePage/selectors' import basicSetup from '../wallet-setup/basic.setup' const test = testWithSynpress(basicSetup, unlockForFixture) diff --git a/wallets/metamask/test/e2e/metamask/unlock.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/unlock.spec.ts similarity index 89% rename from wallets/metamask/test/e2e/metamask/unlock.spec.ts rename to wallets/metamask/test/e2e/playwright/metamask/unlock.spec.ts index 45f090c6..77b4f25b 100644 --- a/wallets/metamask/test/e2e/metamask/unlock.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/unlock.spec.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../../src' +import { MetaMask, unlockForFixture } from '../../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/testWithMetaMask.ts b/wallets/metamask/test/e2e/playwright/testWithMetaMask.ts similarity index 96% rename from wallets/metamask/test/e2e/testWithMetaMask.ts rename to wallets/metamask/test/e2e/playwright/testWithMetaMask.ts index c81c3808..392d9a3a 100644 --- a/wallets/metamask/test/e2e/testWithMetaMask.ts +++ b/wallets/metamask/test/e2e/playwright/testWithMetaMask.ts @@ -1,5 +1,5 @@ import { testWithSynpress } from '@synthetixio/synpress-fixtures' -import { MetaMask, unlockForFixture } from '../../src' +import { MetaMask, unlockForFixture } from '../../../src' import { expect } from '@playwright/test' import connectedSetup from './wallet-setup/connected.setup' diff --git a/wallets/metamask/test/e2e/wallet-setup/basic.setup.ts b/wallets/metamask/test/e2e/playwright/wallet-setup/basic.setup.ts similarity index 61% rename from wallets/metamask/test/e2e/wallet-setup/basic.setup.ts rename to wallets/metamask/test/e2e/playwright/wallet-setup/basic.setup.ts index b7005046..7776eead 100644 --- a/wallets/metamask/test/e2e/wallet-setup/basic.setup.ts +++ b/wallets/metamask/test/e2e/playwright/wallet-setup/basic.setup.ts @@ -1,9 +1,7 @@ import { defineWalletSetup } from '@synthetixio/synpress-core' -import { MetaMask } from '../../../src' +import { MetaMask } from '../../../../src' -const SEED_PHRASE = 'test test test test test test test test test test test junk' - -const PASSWORD = 'Tester@1234' +import { SEED_PHRASE, PASSWORD } from '../../../../src/constants' export default defineWalletSetup(PASSWORD, async (context, walletPage) => { const metamask = new MetaMask(context, walletPage, PASSWORD) diff --git a/wallets/metamask/test/e2e/wallet-setup/connected.setup.ts b/wallets/metamask/test/e2e/playwright/wallet-setup/connected.setup.ts similarity index 84% rename from wallets/metamask/test/e2e/wallet-setup/connected.setup.ts rename to wallets/metamask/test/e2e/playwright/wallet-setup/connected.setup.ts index 460570ea..454b4ea8 100644 --- a/wallets/metamask/test/e2e/wallet-setup/connected.setup.ts +++ b/wallets/metamask/test/e2e/playwright/wallet-setup/connected.setup.ts @@ -1,10 +1,8 @@ import { defineWalletSetup } from '@synthetixio/synpress-core' import { getExtensionId } from '@synthetixio/synpress-fixtures' -import { MetaMask } from '../../../src' +import { MetaMask } from '../../../../src' -const SEED_PHRASE = 'test test test test test test test test test test test junk' - -const PASSWORD = 'Tester@1234' +import { SEED_PHRASE, PASSWORD } from '../../../../src/constants' export default defineWalletSetup(PASSWORD, async (context, walletPage) => { const extensionId = await getExtensionId(context, 'MetaMask') diff --git a/wallets/metamask/tsconfig.json b/wallets/metamask/tsconfig.json index d5e9e89c..142ad557 100644 --- a/wallets/metamask/tsconfig.json +++ b/wallets/metamask/tsconfig.json @@ -2,7 +2,9 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "rootDir": ".", - "exactOptionalPropertyTypes": false // Allows for `undefined` in `playwright.config.ts` + "exactOptionalPropertyTypes": false, // Allows for `undefined` in `playwright.config.ts` + "types": ["cypress"], + "sourceMap": false }, "include": [ "src", From 8455a7a80a9bbc71c73b3772cb42269efe01c15e Mon Sep 17 00:00:00 2001 From: matstyler Date: Mon, 11 Mar 2024 19:41:14 +0100 Subject: [PATCH 2/4] fix: cache dir --- wallets/metamask/package.json | 6 +++--- wallets/metamask/src/support/commands.ts | 2 +- .../test/e2e/playwright/wallet-setup/basic.setup.ts | 2 +- .../test/e2e/playwright/wallet-setup/connected.setup.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wallets/metamask/package.json b/wallets/metamask/package.json index 958996e7..75c13b2f 100644 --- a/wallets/metamask/package.json +++ b/wallets/metamask/package.json @@ -15,9 +15,9 @@ ], "scripts": { "build": "pnpm run clean && pnpm run build:dist && pnpm run build:types", - "build:cache": "synpress-core test/e2e/wallet-setup", - "build:cache:headless": "synpress-core test/e2e/wallet-setup --headless", - "build:cache:headless:force": "synpress-core test/e2e/wallet-setup --headless --force", + "build:cache": "synpress-core test/e2e/playwright/wallet-setup", + "build:cache:headless": "synpress-core test/e2e/playwright/wallet-setup --headless", + "build:cache:headless:force": "synpress-core test/e2e/playwright/wallet-setup --headless --force", "build:dist": "tsup --tsconfig tsconfig.build.json", "build:types": "tsc --emitDeclarationOnly --project tsconfig.build.json", "clean": "rimraf dist types", diff --git a/wallets/metamask/src/support/commands.ts b/wallets/metamask/src/support/commands.ts index 698b01a4..95857aea 100644 --- a/wallets/metamask/src/support/commands.ts +++ b/wallets/metamask/src/support/commands.ts @@ -34,4 +34,4 @@ // visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable // } // } -// } \ No newline at end of file +// } diff --git a/wallets/metamask/test/e2e/playwright/wallet-setup/basic.setup.ts b/wallets/metamask/test/e2e/playwright/wallet-setup/basic.setup.ts index 7776eead..f8a15223 100644 --- a/wallets/metamask/test/e2e/playwright/wallet-setup/basic.setup.ts +++ b/wallets/metamask/test/e2e/playwright/wallet-setup/basic.setup.ts @@ -1,7 +1,7 @@ import { defineWalletSetup } from '@synthetixio/synpress-core' import { MetaMask } from '../../../../src' -import { SEED_PHRASE, PASSWORD } from '../../../../src/constants' +import { PASSWORD, SEED_PHRASE } from '../../../../src/constants' export default defineWalletSetup(PASSWORD, async (context, walletPage) => { const metamask = new MetaMask(context, walletPage, PASSWORD) diff --git a/wallets/metamask/test/e2e/playwright/wallet-setup/connected.setup.ts b/wallets/metamask/test/e2e/playwright/wallet-setup/connected.setup.ts index 454b4ea8..2d4e49b0 100644 --- a/wallets/metamask/test/e2e/playwright/wallet-setup/connected.setup.ts +++ b/wallets/metamask/test/e2e/playwright/wallet-setup/connected.setup.ts @@ -2,7 +2,7 @@ import { defineWalletSetup } from '@synthetixio/synpress-core' import { getExtensionId } from '@synthetixio/synpress-fixtures' import { MetaMask } from '../../../../src' -import { SEED_PHRASE, PASSWORD } from '../../../../src/constants' +import { PASSWORD, SEED_PHRASE } from '../../../../src/constants' export default defineWalletSetup(PASSWORD, async (context, walletPage) => { const extensionId = await getExtensionId(context, 'MetaMask') From 1b28bbde9545594d78d0f9046e79bc6cb360e3f1 Mon Sep 17 00:00:00 2001 From: matstyler Date: Mon, 11 Mar 2024 21:55:47 +0100 Subject: [PATCH 3/4] fix: tests --- .../metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallets/metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts b/wallets/metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts index 89a4df37..b4c8b744 100644 --- a/wallets/metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts +++ b/wallets/metamask/test/e2e/playwright/metamask/connectToDapp.spec.ts @@ -32,6 +32,6 @@ test('should connect multiple wallets to dapp', async ({ context, page, metamask await metamask.connectToDapp(['Account x2', 'Account 1']) await expect(page.locator('#accounts')).toHaveText( - '0x70997970c51812dc3a010c7d01b50e0d17dc79c8,0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266' + '0x90f79bf6eb2c4f870365e785982e1f101e93b906,0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266' ) }) From f5375e81b0162fd79a71848b2ebe5a266ae82a65 Mon Sep 17 00:00:00 2001 From: matstyler Date: Fri, 29 Mar 2024 11:35:24 +0100 Subject: [PATCH 4/4] feat: synpress plugin for cypress --- docs/docs/guides/playwright.md | 4 +- examples/new-dawn/test/e2e/01_basic.spec.ts | 2 +- wallets/metamask/cypress.config.ts | 38 +++------ wallets/metamask/package.json | 2 +- wallets/metamask/src/cypress/errors.ts | 4 + wallets/metamask/src/cypress/index.ts | 3 + wallets/metamask/src/cypress/initMetaMask.ts | 83 +++++++++++++++++++ .../metamask/src/cypress/installSynpress.ts | 58 +++++++++++++ wallets/metamask/src/cypress/setupTasks.ts | 34 ++++++++ .../src/{ => cypress}/support/commands.ts | 33 +++++--- .../metamask/src/{ => cypress}/support/e2e.ts | 2 - wallets/metamask/src/index.ts | 7 +- .../test/e2e/cypress/addNetwork.cy.ts | 5 -- .../e2e/cypress/metamask/setupMetaMask.cy.ts | 11 +++ 14 files changed, 236 insertions(+), 50 deletions(-) create mode 100644 wallets/metamask/src/cypress/errors.ts create mode 100644 wallets/metamask/src/cypress/index.ts create mode 100644 wallets/metamask/src/cypress/initMetaMask.ts create mode 100644 wallets/metamask/src/cypress/installSynpress.ts create mode 100644 wallets/metamask/src/cypress/setupTasks.ts rename wallets/metamask/src/{ => cypress}/support/commands.ts (53%) rename wallets/metamask/src/{ => cypress}/support/e2e.ts (93%) delete mode 100644 wallets/metamask/test/e2e/cypress/addNetwork.cy.ts create mode 100644 wallets/metamask/test/e2e/cypress/metamask/setupMetaMask.cy.ts diff --git a/docs/docs/guides/playwright.md b/docs/docs/guides/playwright.md index fd10839d..aa065968 100644 --- a/docs/docs/guides/playwright.md +++ b/docs/docs/guides/playwright.md @@ -7,7 +7,7 @@ Let's digest a simple test step by step: ::: code-group ```typescript [example.spec.ts] import { MetaMask, testWithSynpress, unlockForFixture } from '@synthetixio/synpress' -import BasicSetup from '../playwright/wallet-setup/basic.setup' +import BasicSetup from '../wallet-setup/basic.setup' const test = testWithSynpress(BasicSetup, unlockForFixture) @@ -34,7 +34,7 @@ First, you need to import the `testWithSynpress` function from `@synthetixio/syn ```typescript import { MetaMask, testWithSynpress, unlockForFixture } from '@synthetixio/synpress' -import BasicSetup from '../playwright/wallet-setup/basic.setup' +import BasicSetup from '../wallet-setup/basic.setup' const test = testWithSynpress(BasicSetup, unlockForFixture) ``` diff --git a/examples/new-dawn/test/e2e/01_basic.spec.ts b/examples/new-dawn/test/e2e/01_basic.spec.ts index 9bc5594f..64a0cd6f 100644 --- a/examples/new-dawn/test/e2e/01_basic.spec.ts +++ b/examples/new-dawn/test/e2e/01_basic.spec.ts @@ -1,5 +1,5 @@ import { MetaMask, testWithSynpress, unlockForFixture } from '@synthetixio/synpress' -import BasicSetup from '../playwright/wallet-setup/basic.setup' +import BasicSetup from '../wallet-setup/basic.setup'; const test = testWithSynpress(BasicSetup, unlockForFixture) diff --git a/wallets/metamask/cypress.config.ts b/wallets/metamask/cypress.config.ts index b16945de..795d6764 100644 --- a/wallets/metamask/cypress.config.ts +++ b/wallets/metamask/cypress.config.ts @@ -1,30 +1,16 @@ -import { defineConfig } from 'cypress' -import { prepareExtension } from './src/prepareExtension' +import { defineConfig } from "cypress"; +import { installSynpress } from "./src/cypress"; export default defineConfig({ + chromeWebSecurity: false, e2e: { - baseUrl: 'http://localhost:9999', - supportFile: 'src/support/e2e.{js,jsx,ts,tsx}', - specPattern: 'test/**/*.cy.{js,jsx,ts,tsx}', - fixturesFolder: 'src/fixture-actions', + baseUrl: "http://localhost:9999", + supportFile: "src/cypress/support/e2e.{js,jsx,ts,tsx}", + specPattern: "test/**/*.cy.{js,jsx,ts,tsx}", + fixturesFolder: "src/cypress/fixtures", testIsolation: false, - setupNodeEvents(on, config) { - const browsers = config.browsers.filter((b) => b.name === 'chrome') - if (browsers.length === 0) { - throw new Error('No Chrome browser found in the configuration') - } - - on('before:browser:launch', async (browser, launchOptions) => { - const metamasExtensionPath = await prepareExtension() - launchOptions.extensions.push(metamasExtensionPath) - - return launchOptions - }) - - return { - ...config, - browsers - } - } - } -}) + async setupNodeEvents(on, config) { + return installSynpress(on, config); + }, + }, +}); diff --git a/wallets/metamask/package.json b/wallets/metamask/package.json index 75c13b2f..9ef00b4a 100644 --- a/wallets/metamask/package.json +++ b/wallets/metamask/package.json @@ -26,7 +26,7 @@ "test:e2e:headful": "playwright test", "test:e2e:headful:cypress": "cypress run --browser chrome --headed", "test:e2e:headless": "HEADLESS=true playwright test", - "test:e2e:headless:cypress": "cypress run --browser chrome", + "test:e2e:headless:cypress": "cypress run --headless --browser chrome", "test:e2e:headless:ui": "HEADLESS=true playwright test --ui", "test:watch": "vitest watch", "types:check": "tsc --noEmit" diff --git a/wallets/metamask/src/cypress/errors.ts b/wallets/metamask/src/cypress/errors.ts new file mode 100644 index 00000000..105c9eef --- /dev/null +++ b/wallets/metamask/src/cypress/errors.ts @@ -0,0 +1,4 @@ +export const NO_CONTEXT = + "No browser context found. Connect Playwright first - connectPlaywright()"; +export const NO_METAMASK_PAGE = "No MetaMask page found. Use getMetaMaskPage()"; +export const MISSING_INIT = "MetaMask not initialized. Use initMetaMask()"; diff --git a/wallets/metamask/src/cypress/index.ts b/wallets/metamask/src/cypress/index.ts new file mode 100644 index 00000000..9847db27 --- /dev/null +++ b/wallets/metamask/src/cypress/index.ts @@ -0,0 +1,3 @@ +export * from "./initMetaMask"; +export { default as setupTasks } from "./setupTasks"; +export { default as installSynpress } from "./installSynpress"; diff --git a/wallets/metamask/src/cypress/initMetaMask.ts b/wallets/metamask/src/cypress/initMetaMask.ts new file mode 100644 index 00000000..2aeace0b --- /dev/null +++ b/wallets/metamask/src/cypress/initMetaMask.ts @@ -0,0 +1,83 @@ +import { type BrowserContext, type Page, chromium } from "@playwright/test"; +import { getExtensionId } from "@synthetixio/synpress-fixtures"; +import { PASSWORD, SEED_PHRASE } from "../constants"; +import { MetaMask } from "../metamask"; +import { MISSING_INIT, NO_CONTEXT, NO_METAMASK_PAGE } from "./errors"; + +let context: BrowserContext | undefined; +let extensionId: string | undefined; +let metamaskPage: Page | undefined; +let metamask: MetaMask | undefined; + +export async function getMetaMaskExtensionId() { + if (extensionId) return extensionId; + + if (!context) { + console.error(NO_CONTEXT); + return; + } + + extensionId = await getExtensionId(context, "MetaMask"); + return extensionId; +} + +const isMetaMaskPage = (page: Page) => + page.url().includes(`chrome-extension://${extensionId}`); + +const getMetaMaskPage = async () => { + await getMetaMaskExtensionId(); + + if (!context) { + console.error(NO_CONTEXT); + return; + } + + metamaskPage = context.pages().find(isMetaMaskPage); + return metamaskPage; +}; + +export async function connectPlaywrightToChrome(port: number) { + const debuggerDetails = await fetch(`http://127.0.0.1:${port}/json/version`); + + const debuggerDetailsConfig = (await debuggerDetails.json()) as { + webSocketDebuggerUrl: string; + }; + + const browser = await chromium.connectOverCDP( + debuggerDetailsConfig.webSocketDebuggerUrl + ); + + context = browser.contexts()[0]; + + return browser.isConnected(); +} + +export async function initMetaMask(port: number) { + await connectPlaywrightToChrome(port); + + if (!context) { + console.error(NO_CONTEXT); + return; + } + + await getMetaMaskPage(); + + if (!metamaskPage) { + console.error(NO_METAMASK_PAGE); + return; + } + + metamask = new MetaMask(context, metamaskPage, PASSWORD); + await metamask.importWallet(SEED_PHRASE); +} + +export function getMetaMask() { + if (!context || !metamaskPage || !metamask) { + console.error(MISSING_INIT); + return; + } + + if (metamask) return metamask; + + return new MetaMask(context, metamaskPage, PASSWORD); +} diff --git a/wallets/metamask/src/cypress/installSynpress.ts b/wallets/metamask/src/cypress/installSynpress.ts new file mode 100644 index 00000000..4494160f --- /dev/null +++ b/wallets/metamask/src/cypress/installSynpress.ts @@ -0,0 +1,58 @@ +import { initMetaMask, setupTasks } from "."; +import { prepareExtension } from "../prepareExtension"; + +let port = 0; + +function ensureRdpPort(args: string[]) { + const existing = args.find( + (arg) => arg.slice(0, 23) === "--remote-debugging-port" + ); + + if (existing) { + return Number(existing.split("=")[1]); + } + + const port = 40000 + Math.round(Math.random() * 25000); + + args.push(`--remote-debugging-port=${port}`); + + return port; +} + +export default function installSynpress( + on: Cypress.PluginEvents, + config: Cypress.PluginConfigOptions +) { + const browsers = config.browsers.filter((b) => b.name === "chrome"); + if (browsers.length === 0) { + throw new Error("No Chrome browser found in the configuration"); + } + + on("before:browser:launch", async (_, launchOptions) => { + // Enable debug mode to establish playwright connection + const args = Array.isArray(launchOptions) + ? launchOptions + : launchOptions.args; + port = ensureRdpPort(args); + + // Preserved cache is not supported for Cypress - https://docs.cypress.io/guides/guides/launching-browsers#Cypress-Profile + // launchOptions.args.push('--user-data-dir=X') + + // Add MetaMask extension + const metamaskExtensionPath = await prepareExtension(); + launchOptions.extensions.push(metamaskExtensionPath); + + return launchOptions; + }); + + on("before:spec", async () => { + await initMetaMask(port); + }); + + setupTasks(on); + + return { + ...config, + browsers, + }; +} diff --git a/wallets/metamask/src/cypress/setupTasks.ts b/wallets/metamask/src/cypress/setupTasks.ts new file mode 100644 index 00000000..6b761014 --- /dev/null +++ b/wallets/metamask/src/cypress/setupTasks.ts @@ -0,0 +1,34 @@ +import { getMetaMask } from "."; + +export default function setupTasks(on: Cypress.PluginEvents) { + on("task", { + importWallet: async function (seedPhrase: string) { + const metamask = getMetaMask(); + if (metamask) { + await metamask.importWallet(seedPhrase); + } + return true; + }, + addNewAccount: async function (accountName: string) { + const metamask = getMetaMask(); + if (metamask) { + await metamask.addNewAccount(accountName); + } + return true; + }, + importWalletFromPrivateKey: async function (privateKey: string) { + const metamask = getMetaMask(); + if (metamask) { + await metamask.importWalletFromPrivateKey(privateKey); + } + return true; + }, + openSettings: async function () { + const metamask = getMetaMask(); + if (metamask) { + await metamask.openSettings(); + } + return true; + }, + }); +} diff --git a/wallets/metamask/src/support/commands.ts b/wallets/metamask/src/cypress/support/commands.ts similarity index 53% rename from wallets/metamask/src/support/commands.ts rename to wallets/metamask/src/cypress/support/commands.ts index 95857aea..95e26a6c 100644 --- a/wallets/metamask/src/support/commands.ts +++ b/wallets/metamask/src/cypress/support/commands.ts @@ -25,13 +25,26 @@ // -- This will overwrite an existing command -- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) // -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } +// import { MetaMask } from "../metamask"; +// import { PASSWORD } from "../constants"; + +declare global { + namespace Cypress { + interface Chainable { + importWallet(seedPhrase: string): Chainable; + addNewAccount(accountName: string): Chainable; + importWalletFromPrivateKey(privateKey: string): Chainable; + openSettings(): Chainable; + } + } +} +Cypress.Commands.add("importWallet", (seedPhrase) => + cy.task("importWallet", seedPhrase) +); +Cypress.Commands.add("addNewAccount", (accountName) => + cy.task("addNewAccount", accountName) +); +Cypress.Commands.add("importWalletFromPrivateKey", (privateKey) => + cy.task("importWalletFromPrivateKey", privateKey) +); +Cypress.Commands.add("openSettings", () => cy.task("openSettings")); diff --git a/wallets/metamask/src/support/e2e.ts b/wallets/metamask/src/cypress/support/e2e.ts similarity index 93% rename from wallets/metamask/src/support/e2e.ts rename to wallets/metamask/src/cypress/support/e2e.ts index 0eef2ce9..c90b6b6d 100644 --- a/wallets/metamask/src/support/e2e.ts +++ b/wallets/metamask/src/cypress/support/e2e.ts @@ -15,5 +15,3 @@ // Import commands.js using ES2015 syntax: import './commands' - -// TODO: Add MetaMask initial setup here. diff --git a/wallets/metamask/src/index.ts b/wallets/metamask/src/index.ts index 72f433c8..8ff7d092 100644 --- a/wallets/metamask/src/index.ts +++ b/wallets/metamask/src/index.ts @@ -1,3 +1,4 @@ -export * from './metamask' -export * from './fixture-actions/unlockForFixture' -export { default as homePageSelectors } from './pages/HomePage/selectors' +export * from "./metamask"; +export * from "./fixture-actions/unlockForFixture"; +export * from "./cypress"; +export { default as homePageSelectors } from "./pages/HomePage/selectors"; diff --git a/wallets/metamask/test/e2e/cypress/addNetwork.cy.ts b/wallets/metamask/test/e2e/cypress/addNetwork.cy.ts deleted file mode 100644 index adb8e603..00000000 --- a/wallets/metamask/test/e2e/cypress/addNetwork.cy.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('My First Test', () => { - it('Does not do much!', () => { - expect(true).to.equal(true) - }) -}) diff --git a/wallets/metamask/test/e2e/cypress/metamask/setupMetaMask.cy.ts b/wallets/metamask/test/e2e/cypress/metamask/setupMetaMask.cy.ts new file mode 100644 index 00000000..89252d8b --- /dev/null +++ b/wallets/metamask/test/e2e/cypress/metamask/setupMetaMask.cy.ts @@ -0,0 +1,11 @@ +it("should add new MetaMask account", () => { + cy.addNewAccount("Synpress with Cypress test"); + + cy.wait(10000); +}); + +it("should open MetaMask settings", () => { + cy.openSettings(); + + cy.wait(10000); +});