diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/.env b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/.env new file mode 100644 index 00000000000..a4335e26797 --- /dev/null +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/.env @@ -0,0 +1,2 @@ +APP_URL=http://app:80 +WALLET1_SEED_WORD=stomach,horn,rail,afraid,flip,also,abandon,speed,chaos,daring,soon,soft,okay,online,benefit \ No newline at end of file diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/.nvmrc b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/.nvmrc new file mode 100644 index 00000000000..238155bf8d1 --- /dev/null +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/.nvmrc @@ -0,0 +1 @@ +v20.12.2 \ No newline at end of file diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/README.md b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/README.md new file mode 100644 index 00000000000..ea9dcb9323d --- /dev/null +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/README.md @@ -0,0 +1,39 @@ +## Introduction + +Wallet automation is a testing package in Playwright that automates the wallet creation process for the Catalyst project. It is a part of the Catalyst Voices ecosystem. + +## Getting Started + +1. Clone this repository: + +```sh +git clone +cd catalyst-voices +``` + +2. Install Flutter and Dart: + +```sh +brew install flutter +``` + +3. Bootstrap the project: + +```sh +melos bootstrap +``` + +4. Execute earthly command from this directory: + +```sh +earthly +package-app +``` + +5. Use docker compose to run the app: + +```sh +docker-compose up +``` +The app should be running on `localhost:8000`. + +6. You can now \ No newline at end of file diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/package-lock.json b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/package-lock.json index cf27ca6fc0a..d8d876b4189 100644 --- a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/package-lock.json +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/package-lock.json @@ -23,12 +23,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.45.3", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.3.tgz", - "integrity": "sha512-UKF4XsBfy+u3MFWEH44hva1Q8Da28G6RFtR2+5saw+jgAFQV5yYnB1fu68Mz7fO+5GJF3wgwAIs0UelU8TxFrA==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.0.tgz", + "integrity": "sha512-W5lhqPUVPqhtc/ySvZI5Q8X2ztBOUgZ8LbAFy0JQgrXZs2xaILrUcNO3rQjwbLPfGK13+rZsDa1FpG+tqYkT5w==", "dev": true, "dependencies": { - "playwright": "1.45.3" + "playwright": "1.48.0" }, "bin": { "playwright": "cli.js" @@ -38,11 +38,11 @@ } }, "node_modules/@types/node": { - "version": "20.14.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz", - "integrity": "sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==", + "version": "20.16.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", + "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/node-fetch": { @@ -84,20 +84,20 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -230,9 +230,9 @@ } }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -254,11 +254,11 @@ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "node_modules/playwright": { - "version": "1.45.3", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.3.tgz", - "integrity": "sha512-QhVaS+lpluxCaioejDZ95l4Y4jSFCsBvl2UZkpeXlzxmqS+aABr5c82YmfMHrL6x27nvrvykJAFpkzT2eWdJww==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.0.tgz", + "integrity": "sha512-qPqFaMEHuY/ug8o0uteYJSRfMGFikhUysk8ZvAtfKmUK3kc/6oNl/y3EczF8OFGYIi/Ex2HspMfzYArk6+XQSA==", "dependencies": { - "playwright-core": "1.45.3" + "playwright-core": "1.48.0" }, "bin": { "playwright": "cli.js" @@ -271,9 +271,9 @@ } }, "node_modules/playwright-core": { - "version": "1.45.3", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.3.tgz", - "integrity": "sha512-+ym0jNbcjikaOwwSZycFbwkWgfruWvYlJfThKYAlImbxUgdWFO2oW70ojPm4OpE4t6TAo2FY/smM+hpVTtkhDA==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.0.tgz", + "integrity": "sha512-RBvzjM9rdpP7UUFrQzRwR8L/xR4HyC1QXMzGYTbf1vjw25/ya9NRAVnXi/0fvFopjebvyPzsmoK58xxeEOaVvA==", "bin": { "playwright-core": "cli.js" }, @@ -324,9 +324,9 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" }, "node_modules/universalify": { "version": "2.0.1", diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/playwright.config.ts b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/playwright.config.ts index ba735751faa..83d2843f868 100644 --- a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/playwright.config.ts +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/playwright.config.ts @@ -1,11 +1,14 @@ import { defineConfig, devices } from '@playwright/test'; +import dotenv from 'dotenv'; +import path from 'path'; -if (process.env.APP_URL == undefined){ - throw new Error("APP_URL env variable undefined"); -} +dotenv.config({ path: path.resolve(__dirname, '.env') }); +// if (process.env.APP_URL == undefined){ +// throw new Error("APP_URL env variable undefined"); +// } export default defineConfig({ - testDir: '.', + testDir: './tests', fullyParallel: false, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 1, @@ -19,14 +22,18 @@ export default defineConfig({ reporter: [['junit', { outputFile: '/results/cardano-wallet.junit-report.xml' }]], timeout: 60 * 1000, projects: [ - { - name: 'setup', - testMatch: /global-setup\.ts/, - }, + // { + // name: 'setup', + // testMatch: /global-setup\.ts/, + // }, + // { + // name: 'chromium', + // use: { ...devices['Desktop Chrome'] }, + // dependencies: ['setup'] + // }, { name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - dependencies: ['setup'] + use: { ...devices['Desktop Chrome'] } }, ] }); diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/test-fixtures.ts b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/test-fixtures.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/wallet-tests.spec.ts b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tests/wallet-tests.spec.ts similarity index 98% rename from catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/wallet-tests.spec.ts rename to catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tests/wallet-tests.spec.ts index 8c851f25713..269a760ed3c 100644 --- a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/wallet-tests.spec.ts +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tests/wallet-tests.spec.ts @@ -1,5 +1,5 @@ import { test, chromium, expect, BrowserContext, Page } from '@playwright/test'; -import { allowExtension, downloadExtension, getWalletCredentials, importWallet, signData, signDataBadPwd} from './utils'; +import { allowExtension, downloadExtension, getWalletCredentials, importWallet, signData, signDataBadPwd} from '../utils'; let browser: BrowserContext; let extensionPath: string; @@ -13,9 +13,9 @@ let wallets = wallets.forEach(({ name, id, url }) => { test.describe(`Testing with ${name}`,() => { test.skip(name === 'Typhon', 'https://github.com/input-output-hk/catalyst-voices/issues/753'); - test.afterAll(async () => { - browser.close() - }); + // test.afterAll(async () => { + // browser.close() + // }); test.beforeAll(async () => { // Download extension and import wallet into wallet extension diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tests/wallets.spec.ts b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tests/wallets.spec.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tsconfig.json b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tsconfig.json new file mode 100644 index 00000000000..afe105476cc --- /dev/null +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "types": ["node"], // Add this line + "typeRoots": ["./node_modules/@types"] + }, + "exclude": ["node_modules", "dist"] +}