-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from argentlabs/tests/e2e-POC
Tests/e2e-POC
- Loading branch information
Showing
57 changed files
with
5,615 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import path from "path" | ||
import dotenv from "dotenv" | ||
import fs from "fs" | ||
|
||
const envPath = path.resolve(__dirname || "", ".env") | ||
if (fs.existsSync(envPath)) { | ||
dotenv.config({ path: envPath }) | ||
} | ||
const commonConfig = { | ||
isProdTesting: process.env.ARGENT_X_ENVIRONMENT === "prod" ? true : false || "", | ||
password: "MyP@ss3!", | ||
//accounts used for setup | ||
senderAddrs: process.env.E2E_SENDER_ADDRESSES?.split(",") || "", | ||
senderKeys: process.env.E2E_SENDER_PRIVATEKEYS?.split(",") || "", | ||
destinationAddress: process.env.E2E_SENDER_ADDRESSES?.split(",")[0] ||"", //used as transfers destination | ||
// urls | ||
rpcUrl: process.env.ARGENT_SEPOLIA_RPC_URL || "", | ||
beAPIUrl: | ||
process.env.ARGENT_X_ENVIRONMENT === "prod" | ||
? "" | ||
: process.env.ARGENT_API_BASE_URL || "", | ||
viewportSize: { width: 360, height: 800 }, | ||
artifactsDir: path.resolve(__dirname, "./artifacts/playwright"), | ||
isCI: Boolean(process.env.CI), | ||
migDir: path.join(__dirname, "../../e2e/argent-x-dist/"), | ||
distDir: path.join(__dirname, "../../extension/dist/"), | ||
migVersionDir: path.join(__dirname || "", "../../e2e/argent-x-dist/dist"), | ||
migRepo: process.env.E2E_REPO || "", | ||
migRepoToken: process.env.E2E_REPO_TOKEN || "", | ||
migRepoOwner: process.env.E2E_REPO_OWNER || "", | ||
migReleaseName: process.env.E2E_REPO_RELEASE_NAME || "", | ||
} | ||
|
||
const extensionHydrogenConfig = { | ||
...commonConfig || "", | ||
testSeed1: process.env.E2E_TESTNET_SEED1 || "", //wallet with 33 regular deployed accounts and 1 multisig deployed account | ||
testSeed3: process.env.E2E_TESTNET_SEED3 || "", //wallet with 1 deployed account|| "", and multisig with removed user | ||
testSeed4: process.env.E2E_TESTNET_SEED4 || "", //wallet with non deployed account but with funds | ||
senderSeed: process.env.E2E_SENDER_SEED || "", | ||
account1Seed2: process.env.E2E_ACCOUNT_1_SEED2 || "", | ||
spokCampaignName: process.env.E2E_SPOK_CAMPAIGN_NAME || "", | ||
spokCampaignUrl: process.env.E2E_SPOK_CAMPAIGN_URL || "", | ||
guardianEmail: process.env.E2E_GUARDIAN_EMAIL || "", | ||
useStrkAsFeeToken: process.env.E2E_USE_STRK_AS_FEE_TOKEN || "", | ||
skipTXTests: process.env.E2E_SKIP_TX_TESTS || "", | ||
accountsToImport: process.env.E2E_ACCOUNTS_TO_IMPORT || "", | ||
accountToImportAndTx: process.env.E2E_ACCOUNT_TO_IMPORT_AND_TX?.split(",") || "", | ||
qaUtilsURL: process.env.E2E_QA_UTILS_URL || "", | ||
qaUtilsAuthToken: process.env.E2E_QA_UTILS_AUTH_TOKEN || "", | ||
initialBalanceMultiplier: process.env.INITIAL_BALANCE_MULTIPLIER || 1 || "", | ||
migAccountAddress: process.env.E2E_MIG_ACCOUNT_ADDRESS || "", | ||
} | ||
|
||
const extensionProdConfig = { | ||
...commonConfig, | ||
testSeed1: process.env.E2E_MAINNET_SEED1 || "", | ||
testSeed3: "", | ||
testSeed4: "", | ||
senderSeed: process.env.E2E_SENDER_SEED || "", | ||
account1Seed2:"", | ||
account1Seed3:"", | ||
spokCampaignName:"", | ||
spokCampaignUrl:"", | ||
guardianEmail:"", | ||
useStrkAsFeeToken: "false", | ||
skipTXTests: "true", | ||
accountsToImport:"", | ||
accountToImportAndTx:"", | ||
qaUtilsURL:"", | ||
qaUtilsAuthToken:"", | ||
initialBalanceMultiplier: 1, | ||
migAccountAddress:"", | ||
migVersions:"", | ||
} | ||
|
||
const config = commonConfig.isProdTesting | ||
? extensionProdConfig | ||
: extensionHydrogenConfig | ||
// check that no value of config is undefined|| "", otherwise throw error | ||
Object.entries(config).forEach(([key, value]) => { | ||
if (value === undefined) { | ||
throw new Error(`Missing ${key} config variable; check .env file`) | ||
} | ||
}) | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "@demo-dapp-starket/e2e", | ||
"private": true, | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"@scure/base": "^1.1.1", | ||
"@scure/bip39": "^1.2.1", | ||
"axios": "^1.7.7", | ||
"fs-extra": "^11.2.0", | ||
"lodash-es": "^4.17.21", | ||
"object-hash": "^3.0.0", | ||
"react": "^18.0.0", | ||
"react-dom": "^18.0.0", | ||
"swr": "^1.3.0", | ||
"zod": "^3.23.8" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.48.1", | ||
"@types/axios": "^0.14.0", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/imap-simple": "^4.2.9", | ||
"@types/mailparser": "^3.4.5", | ||
"@types/node": "^22.0.0", | ||
"@types/nodemailer": "^6.4.17", | ||
"@types/uuid": "^10.0.0", | ||
"dotenv": "^16.3.1", | ||
"starknet": "6.11.0", | ||
"uuid": "^11.0.0" | ||
}, | ||
"scripts": { | ||
"test:argentx": "pnpm playwright test --project=ArgentX", | ||
"test:webwallet": "pnpm playwright test --project=WebWallet" | ||
}, | ||
"dependencies": { | ||
"imap-simple": "^5.1.0", | ||
"mailparser": "^3.7.1", | ||
"nodemailer": "^6.9.16" | ||
} | ||
} |
Oops, something went wrong.