diff --git a/examples/sample-angular-app/package.json b/examples/sample-angular-app/package.json index df2d9702..5a8a0d4c 100644 --- a/examples/sample-angular-app/package.json +++ b/examples/sample-angular-app/package.json @@ -59,4 +59,4 @@ "karma-jasmine-html-reporter": "~1.7.0", "typescript": "~4.9.5" } -} +} \ No newline at end of file diff --git a/package.json b/package.json index b8cdd984..91f2f6ff 100755 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "license": "MIT", "workspaces": [ "examples/*", - "packages/*", - "tests/*" + "packages/*" ], "scripts": { "build": "turbo run build", @@ -54,4 +53,4 @@ "typescript": "4.9.5" }, "packageManager": "yarn@1.22.19" -} +} \ No newline at end of file diff --git a/tests/e2e/.eslintrc.js b/tests/e2e/.eslintrc.js index 4de4cce2..8df00b96 100644 --- a/tests/e2e/.eslintrc.js +++ b/tests/e2e/.eslintrc.js @@ -14,5 +14,7 @@ module.exports = { '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/consistent-type-imports': 'off', 'unicorn/filename-case': 'off', + 'import/no-default-export': 'off', + 'unicorn/prefer-node-protocol': 'off', }, }; diff --git a/tests/e2e/package.json b/tests/e2e/package.json index ed459e06..75ad7b4e 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -23,6 +23,9 @@ "@vechain/repo-config": "https://github.com/vechain/repo-config", "selenium-webdriver": "4.8.2", "testcontainers": "^10.7.2", - "ts-node": "^10.9.2" + "ts-node": "^10.9.2", + "typescript": "4.9.5", + "async-mutex": "^0.2.6", + "thor-devkit": "2.0.5" } -} +} \ No newline at end of file diff --git a/tests/e2e/src/extension/TestDefaults.ts b/tests/e2e/src/extension/TestDefaults.ts index 758d67fc..f060778f 100644 --- a/tests/e2e/src/extension/TestDefaults.ts +++ b/tests/e2e/src/extension/TestDefaults.ts @@ -9,5 +9,4 @@ export default { ADDRESS: '0xf077b491b355E64048cE21E3A6Fc4751eEeA77fa', TIMEOUT: 5_000, TRANSACTION_TIMEOUT: 20_000, - DAPP_URL: 'http://localhost:5001', }; diff --git a/tests/e2e/src/extension/flows/AccessFlows.ts b/tests/e2e/src/extension/flows/AccessFlows.ts index bf0c38d6..3aefeb9d 100644 --- a/tests/e2e/src/extension/flows/AccessFlows.ts +++ b/tests/e2e/src/extension/flows/AccessFlows.ts @@ -1,50 +1,37 @@ -import TestDefaults from '../TestDefaults'; -import DashboardScreen from '../screens/DashboardScreen'; -import UnlockScreen from '../screens/access/UnlockScreen'; -import FirstAccessScreen from '../screens/onboarding/FirstAccessScreen'; import NavigationUtils from '../utils/NavigationUtils'; +import TestDefaults from '../TestDefaults'; +import DashboardScreen from './DashboardFlows'; +import UnlockFlows from './UnlockFlows'; +import FirstAccessFlows from './FirstAccessFlows'; -/** - * Navigate to extension => Then we should be on one of the following screens: - * - DashboardScreen => Immediately returns as we are already unlocked - * - FirstAccessScreen => Immediately throws an error as we are not onboarded - * - UnlockScreen => Enters the password and submits - * @param password - */ export const unlock = async (password?: string) => { - const pw = password || TestDefaults.PASSWORD; + const pw = password ?? TestDefaults.PASSWORD; await NavigationUtils.goToExtension(); const isDashboardScreenActive = await DashboardScreen.isActive(); if (isDashboardScreenActive) return; - const isUnlockScreenActive = await UnlockScreen.isActive(); - if (isUnlockScreenActive) return await UnlockScreen.submitPassword(pw); + const isUnlockFlowsActive = await UnlockFlows.isActive(); + if (isUnlockFlowsActive) return UnlockFlows.submitPassword(pw); - const isFirstAccessScreenActive = await FirstAccessScreen.isActive(); - if (isFirstAccessScreenActive) throw new Error('The user is not onboarded'); + const isFirstAccessFlowsActive = await FirstAccessFlows.isActive(); + if (isFirstAccessFlowsActive) throw new Error('The user is not onboarded'); throw new Error('The application is in an unknown state'); }; -/** - * Navigate to extension => Then we should be on one of the following screens: - * - DashboardScreen => Locks the app - * - UnlockScreen => Immediately returns as we are already locked - * - FirstAccessScreen => Immediately throws an error as we are not onboarded - */ export const lock = async () => { await NavigationUtils.goToExtension(); const isDashboardScreenActive = await DashboardScreen.isActive(); - if (isDashboardScreenActive) return await DashboardScreen.lockApp(); + if (isDashboardScreenActive) return DashboardScreen.lockApp(); - const isUnlockScreenActive = await UnlockScreen.isActive(); - if (isUnlockScreenActive) return; + const isUnlockFlowsActive = await UnlockFlows.isActive(); + if (isUnlockFlowsActive) return; - const isFirstAccessScreenActive = await FirstAccessScreen.isActive(); - if (isFirstAccessScreenActive) throw new Error('The user is not onboarded'); + const isFirstAccessFlowsActive = await FirstAccessFlows.isActive(); + if (isFirstAccessFlowsActive) throw new Error('The user is not onboarded'); throw new Error('The application is in an unknown state'); }; diff --git a/tests/e2e/src/extension/screens/connected-app/ApproveAppScreen.ts b/tests/e2e/src/extension/flows/ApproveFlows.ts similarity index 67% rename from tests/e2e/src/extension/screens/connected-app/ApproveAppScreen.ts rename to tests/e2e/src/extension/flows/ApproveFlows.ts index 1ae16ab4..182d0d4e 100644 --- a/tests/e2e/src/extension/screens/connected-app/ApproveAppScreen.ts +++ b/tests/e2e/src/extension/flows/ApproveFlows.ts @@ -1,8 +1,8 @@ -import NavigationUtils from '../../utils/NavigationUtils'; -import PasswordPrompt from '../PasswordPrompt'; -import TestDefaults from '../../TestDefaults'; -import Locators from '../../selenium/Locators'; -import { extension } from '../../selenium/WebDriver'; +import NavigationUtils from '../utils/NavigationUtils'; +import TestDefaults from '../TestDefaults'; +import Locators from '../selenium/Locators'; +import { extension } from '../selenium/WebDriver'; +import PasswordFlows from './PasswordFlows'; const approveAndSign = async (password?: string) => { await approve(); @@ -13,7 +13,7 @@ const sign = async (password?: string) => { const pw = password || TestDefaults.PASSWORD; //Click the "Sign Cert" button await extension.driver.waitAndClick(Locators.byId('signCertificateButton')); - await PasswordPrompt.submitPassword(pw); + await PasswordFlows.submitPassword(pw); }; const approve = async () => { diff --git a/tests/e2e/src/extension/screens/onboarding/CompletedWalletScreen.ts b/tests/e2e/src/extension/flows/CompletedWalletFlows.ts similarity index 63% rename from tests/e2e/src/extension/screens/onboarding/CompletedWalletScreen.ts rename to tests/e2e/src/extension/flows/CompletedWalletFlows.ts index a3e155ff..791f4b3a 100644 --- a/tests/e2e/src/extension/screens/onboarding/CompletedWalletScreen.ts +++ b/tests/e2e/src/extension/flows/CompletedWalletFlows.ts @@ -1,7 +1,7 @@ -import Locators from '../../selenium/Locators'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; +import Locators from '../selenium/Locators'; +import { ROUTES } from '../enums'; +import ScreenUtils from '../utils/ScreenUtils'; +import { extension } from '../selenium/WebDriver'; const isActive = async () => { const locator = Locators.byId('goToHomepage'); diff --git a/tests/e2e/src/extension/flows/ConnectFlows.ts b/tests/e2e/src/extension/flows/ConnectFlows.ts new file mode 100644 index 00000000..bf590eec --- /dev/null +++ b/tests/e2e/src/extension/flows/ConnectFlows.ts @@ -0,0 +1,36 @@ +import { By } from 'selenium-webdriver'; +import { extension } from '../selenium/WebDriver'; + +const connectWallet = async () => { + // Click connect button + const vdkButtonShadowRoot = await extension.driver + .findElement(By.css('vdk-button')) + .getShadowRoot(); + const connectButton = await vdkButtonShadowRoot.findElement( + By.css('vdk-connect-button'), + ); + const connectButtonShadowRoot = await connectButton.getShadowRoot(); + const button = await connectButtonShadowRoot.findElement(By.css('button')); + await button.click(); + + // // Click veworld source + const vdkModalShadowRoot = await extension.driver + .findElement(By.css('vdk-modal')) + .getShadowRoot(); + const vdkConnectModal = await vdkModalShadowRoot.findElement( + By.css('vdk-connect-modal'), + ); + const vdkBaseModalShadowRoot = await vdkConnectModal.getShadowRoot(); + const vdkSourceCard = await vdkBaseModalShadowRoot.findElements( + By.css('vdk-source-card'), + ); + const vdkSourceCardShadowRoot = await vdkSourceCard[0].getShadowRoot(); + const cardButton = await vdkSourceCardShadowRoot.findElement( + By.css('button'), + ); + await cardButton.click(); +}; + +export default { + connectWallet, +}; diff --git a/tests/e2e/src/extension/flows/DashboardFlow.ts b/tests/e2e/src/extension/flows/DashboardFlows.ts similarity index 98% rename from tests/e2e/src/extension/flows/DashboardFlow.ts rename to tests/e2e/src/extension/flows/DashboardFlows.ts index 189fc773..900ca92b 100644 --- a/tests/e2e/src/extension/flows/DashboardFlow.ts +++ b/tests/e2e/src/extension/flows/DashboardFlows.ts @@ -1,9 +1,9 @@ +import assert from 'assert'; +import { ROUTES } from '../enums'; import ScreenUtils from '../utils/ScreenUtils'; import { extension } from '../selenium/WebDriver'; import Locators from '../selenium/Locators'; import NavigationUtils from '../utils/NavigationUtils'; -import assert from 'assert'; -import { ROUTES } from 'extension/enums'; const isActive = async () => { const locator = Locators.byId('yourBalanceTitle'); diff --git a/tests/e2e/src/extension/flows/DeviceManagementFlows.ts b/tests/e2e/src/extension/flows/DeviceManagementFlows.ts deleted file mode 100644 index f5f7cd79..00000000 --- a/tests/e2e/src/extension/flows/DeviceManagementFlows.ts +++ /dev/null @@ -1,60 +0,0 @@ -import assert from 'assert'; -import ImportLocalMnemonicScreen from '../screens/onboarding/ImportLocalMnemonicScreen'; -import CreateNewWalletScreen from '../screens/onboarding/GenerateNewWallet'; -import NavigationUtils from '../utils/NavigationUtils'; -import { ROUTES } from '../enums'; -import VerifyNewWallet from '../screens/onboarding/VerifyNewWallet'; -import Locators from '../selenium/Locators'; -import { extension } from '../selenium/WebDriver'; - -const setupMnemonic = async (mnemonic: string) => { - await NavigationUtils.goToExtension(ROUTES.IMPORT_LOCAL_WALLET); - await NavigationUtils.goToExtension(ROUTES.IMPORT_LOCAL_WALLET_MNEMONIC); - - await ImportLocalMnemonicScreen.isActive(); - assert( - ImportLocalMnemonicScreen, - 'The user is not on the import local wallet screen', - ); - - await ImportLocalMnemonicScreen.enterMnemonic(mnemonic); - - await extension.driver.waitAndClick( - Locators.byDataTestId('importLocalWalletMnemonicButton'), - ); -}; - -const generateNewWallet = async () => { - await NavigationUtils.goToExtension(ROUTES.NEW_LOCAL_WALLET); - //Check we are on the create new wallet screen - const isNewWalletScreenActive = await CreateNewWalletScreen.isActive(); - assert(isNewWalletScreenActive, 'New wallet screen is not active'); - - //Store the wallet for later - const mnemonic = await CreateNewWalletScreen.copyMnemonic(); - await CreateNewWalletScreen.proceedAfterCopy(); - return mnemonic; -}; - -const verifyMnemonic = async (mnemonic: string[], isValid: boolean) => { - //Check we are on verify mnemonic screen - const isVerifyActive = await VerifyNewWallet.isActive(); - assert(isVerifyActive, 'Not on verify mnemonic screen'); - - assert( - Array.isArray(mnemonic), - "Can't find the previously generated mnemonic", - ); - - await VerifyNewWallet.fillConfirmation(mnemonic, isValid); - - await extension.driver.waitAndClick( - Locators.byId('confirmInsertMnemonicForm'), - ); -}; - -export default { - setupMnemonic, - generateNewWallet, - verifyMnemonic, -}; diff --git a/tests/e2e/src/extension/screens/onboarding/FirstAccessScreen.ts b/tests/e2e/src/extension/flows/FirstAccessFlows.ts similarity index 76% rename from tests/e2e/src/extension/screens/onboarding/FirstAccessScreen.ts rename to tests/e2e/src/extension/flows/FirstAccessFlows.ts index 62986ac6..8b88ef02 100644 --- a/tests/e2e/src/extension/screens/onboarding/FirstAccessScreen.ts +++ b/tests/e2e/src/extension/flows/FirstAccessFlows.ts @@ -1,6 +1,6 @@ -import Locators from '../../selenium/Locators'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; +import Locators from '../selenium/Locators'; +import ScreenUtils from '../utils/ScreenUtils'; +import { extension } from '../selenium/WebDriver'; const isActive = async () => { const locator = Locators.byDataTestId('continueOnboardingButton'); diff --git a/tests/e2e/src/extension/screens/onboarding/ImportLocalMnemonicScreen.ts b/tests/e2e/src/extension/flows/ImportLocalMnemonicFlows.ts similarity index 77% rename from tests/e2e/src/extension/screens/onboarding/ImportLocalMnemonicScreen.ts rename to tests/e2e/src/extension/flows/ImportLocalMnemonicFlows.ts index 99bf9f80..70bbce03 100644 --- a/tests/e2e/src/extension/screens/onboarding/ImportLocalMnemonicScreen.ts +++ b/tests/e2e/src/extension/flows/ImportLocalMnemonicFlows.ts @@ -1,8 +1,8 @@ -import Locators from '../../selenium/Locators'; -import TestDefaults from '../../TestDefaults'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; +import Locators from '../selenium/Locators'; +import TestDefaults from '../TestDefaults'; +import { ROUTES } from '../enums'; +import ScreenUtils from '../utils/ScreenUtils'; +import { extension } from '../selenium/WebDriver'; const isActive = async () => { const locator = Locators.byDataTestId('importLocalWalletMnemonicButton'); diff --git a/tests/e2e/src/extension/flows/OnboardingFlows.ts b/tests/e2e/src/extension/flows/OnboardingFlows.ts index 2c5b9ce4..8a610fdb 100644 --- a/tests/e2e/src/extension/flows/OnboardingFlows.ts +++ b/tests/e2e/src/extension/flows/OnboardingFlows.ts @@ -1,111 +1,37 @@ -import FirstAccessScreen from '../screens/onboarding/FirstAccessScreen'; +/* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable no-param-reassign */ import assert from 'assert'; -import SetupPasswordScreen from '../screens/onboarding/SetupPasswordScreen'; -import ImportLocalMnemonicScreen from '../screens/onboarding/ImportLocalMnemonicScreen'; -import ImportLocalKeystoreScreen from '../screens/onboarding/ImportLocalKeystoreScreen'; -import CreateNewWalletScreen from '../screens/onboarding/GenerateNewWallet'; -import VerifyNewWallet from '../screens/onboarding/VerifyNewWallet'; import TestDefaults from '../TestDefaults'; import NavigationUtils from '../utils/NavigationUtils'; -import CompletedWalletScreen from '../screens/onboarding/CompletedWalletScreen'; -import { HDNode } from 'thor-devkit'; -import ImportLocalPrivateKeyScreen from '../screens/onboarding/ImportLocalPrivateKeyScreen'; +import FirstAccessFlows from './FirstAccessFlows'; +import SetupPasswordFlows from './SetupPasswordFlows'; +import ImportLocalMnemonicFlows from './ImportLocalMnemonicFlows'; +import CompletedWalletFlows from './CompletedWalletFlows'; const setupPassword = async (password: string, confirmPassword: string) => { //Navigate from first access - const isFirstAccess = await FirstAccessScreen.isActive(); + const isFirstAccess = await FirstAccessFlows.isActive(); assert(isFirstAccess, 'The user is not on the first access screen'); - await FirstAccessScreen.navigateToPasswordSetup(); + await FirstAccessFlows.navigateToPasswordSetup(); //Enter the passwords and submit - await SetupPasswordScreen.enterPassword(password); - await SetupPasswordScreen.enterConfirmPassword(confirmPassword); - await SetupPasswordScreen.submit(); + await SetupPasswordFlows.enterPassword(password); + await SetupPasswordFlows.enterConfirmPassword(confirmPassword); + await SetupPasswordFlows.submit(); }; const setupMnemonic = async (mnemonic: string) => { //Navigate from password setup - const isPasswordSubmitted = await SetupPasswordScreen.isPasswordSubmitted(); + const isPasswordSubmitted = await SetupPasswordFlows.isPasswordSubmitted(); assert(isPasswordSubmitted, 'Not on screen after password submission'); - await SetupPasswordScreen.navigateToImportWalletMnemonic(); + await SetupPasswordFlows.navigateToImportWalletMnemonic(); //Enter the mnemonic and submit - await ImportLocalMnemonicScreen.enterMnemonic(mnemonic); - await ImportLocalMnemonicScreen.submit(); + await ImportLocalMnemonicFlows.enterMnemonic(mnemonic); + await ImportLocalMnemonicFlows.submit(); - try { - HDNode.fromMnemonic(mnemonic.split(' ')); - } catch (e) { - console.log('Mnemonic is invalid, not proceeding to dashboard'); - return; - } - - await CompletedWalletScreen.isActive(); - await CompletedWalletScreen.navigateToDashboard(); -}; - -const setupPrivateKey = async (privateKey: string) => { - //Navigate from password setup - const isPasswordSubmitted = await SetupPasswordScreen.isPasswordSubmitted(); - assert(isPasswordSubmitted, 'Not on screen after password submission'); - await SetupPasswordScreen.navigateToImportWalletPrivateKey(); - - //Enter the private key and submit - await ImportLocalPrivateKeyScreen.enterPrivateKey(privateKey); - await ImportLocalPrivateKeyScreen.submit(); - - await CompletedWalletScreen.isActive(); - await CompletedWalletScreen.navigateToDashboard(); -}; - -const setupKeystore = async ( - keystorePath: string, - keystorePassword: string, -) => { - //Navigate from password setup - const isPasswordSubmitted = await SetupPasswordScreen.isPasswordSubmitted(); - assert(isPasswordSubmitted, 'Not on screen after password submission'); - await SetupPasswordScreen.navigateToImportKeystore(); - - //Enter the upload keystore and submit - await ImportLocalKeystoreScreen.uploadKeystore( - keystorePath, - keystorePassword, - ); - await ImportLocalKeystoreScreen.submit(); - - await CompletedWalletScreen.isActive(); - await CompletedWalletScreen.navigateToDashboard(); -}; - -const generateNewWallet = async () => { - //Navigate from password setup - const isPasswordSubmitted = await SetupPasswordScreen.isPasswordSubmitted(); - assert(isPasswordSubmitted, 'Not on screen after password submission'); - await SetupPasswordScreen.navigateToSetupNewWallet(); - - //Check we are on the create new wallet screen - const isNewWalletScreenActive = await CreateNewWalletScreen.isActive(); - assert(isNewWalletScreenActive, 'New wallet screen is not active'); - - //Store the wallet for later - const mnemonic = await CreateNewWalletScreen.copyMnemonic(); - await CreateNewWalletScreen.proceedAfterCopy(); - return mnemonic; -}; - -const verifyMnemonic = async (mnemonic: string[], isValid: boolean) => { - //Check we are on verify mnemonic screen - const isVerifyActive = await VerifyNewWallet.isActive(); - assert(isVerifyActive, 'Not on verify mnemonic screen'); - - assert( - Array.isArray(mnemonic), - "Can't find the previously generated mnemonic", - ); - - await VerifyNewWallet.fillConfirmation(mnemonic, isValid); - await VerifyNewWallet.verifyMnemonic(isValid); + await CompletedWalletFlows.isActive(); + await CompletedWalletFlows.navigateToDashboard(); }; const completeOnboarding = async (mnemonic?: string, password?: string) => { @@ -121,9 +47,5 @@ const completeOnboarding = async (mnemonic?: string, password?: string) => { export default { setupPassword, setupMnemonic, - setupPrivateKey, - setupKeystore, - generateNewWallet, - verifyMnemonic, completeOnboarding, }; diff --git a/tests/e2e/src/extension/screens/PasswordPrompt.ts b/tests/e2e/src/extension/flows/PasswordFlows.ts similarity index 100% rename from tests/e2e/src/extension/screens/PasswordPrompt.ts rename to tests/e2e/src/extension/flows/PasswordFlows.ts diff --git a/tests/e2e/src/extension/screens/onboarding/SetupPasswordScreen.ts b/tests/e2e/src/extension/flows/SetupPasswordFlows.ts similarity index 60% rename from tests/e2e/src/extension/screens/onboarding/SetupPasswordScreen.ts rename to tests/e2e/src/extension/flows/SetupPasswordFlows.ts index fc232c4c..c8678943 100644 --- a/tests/e2e/src/extension/screens/onboarding/SetupPasswordScreen.ts +++ b/tests/e2e/src/extension/flows/SetupPasswordFlows.ts @@ -1,7 +1,7 @@ -import Locators from '../../selenium/Locators'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; +import Locators from '../selenium/Locators'; +import { ROUTES } from '../enums'; +import ScreenUtils from '../utils/ScreenUtils'; +import { extension } from '../selenium/WebDriver'; const isActive = async () => { const locator = Locators.byId('submitPasswordButton'); @@ -30,7 +30,7 @@ const submit = async () => { * Checks for next screen's elements */ const isPasswordSubmitted = async () => { - return await extension.driver.isElementPresent( + return extension.driver.isElementPresent( Locators.byRole('goToImportWallet'), ); }; @@ -45,26 +45,6 @@ const navigateToImportWalletMnemonic = async () => { ); }; -const navigateToImportWalletPrivateKey = async () => { - await extension.driver.waitAndClick(Locators.byRole('goToImportWallet')); - await extension.driver.waitAndClick( - Locators.byRole('goToImportLocalWallet'), - ); - await extension.driver.waitAndClick( - Locators.byRole('goToImportLocalWalletPrivateKey'), - ); -}; - -const navigateToImportKeystore = async () => { - await extension.driver.waitAndClick(Locators.byRole('goToImportWallet')); - await extension.driver.waitAndClick( - Locators.byRole('goToImportLocalWallet'), - ); - await extension.driver.waitAndClick( - Locators.byRole('goToImportLocalWalletKeystore'), - ); -}; - const navigateToSetupNewWallet = async () => { await extension.driver.waitAndClick(Locators.byRole('goToCreateWallet')); await extension.driver.waitAndClick(Locators.byId('skipButton')); @@ -77,7 +57,5 @@ export default { enterConfirmPassword, submit, navigateToImportWalletMnemonic, - navigateToImportWalletPrivateKey, - navigateToImportKeystore, navigateToSetupNewWallet, }; diff --git a/tests/e2e/src/extension/flows/TokenHistoryFlows.ts b/tests/e2e/src/extension/flows/TokenHistoryFlows.ts deleted file mode 100644 index 22994d48..00000000 --- a/tests/e2e/src/extension/flows/TokenHistoryFlows.ts +++ /dev/null @@ -1,37 +0,0 @@ -import assert from 'assert'; -import { ROUTES } from '../enums'; -import TokenTransferScreen from '../screens/token-transfer/TokenTransferScreen'; -import NavigationUtils from '../utils/NavigationUtils'; -import { extension } from '../selenium/WebDriver'; -import Locators from '../selenium/Locators'; -import PasswordPrompt from '../screens/PasswordPrompt'; -import TestDefaults from '../TestDefaults'; -import DashboardScreen from '../screens/DashboardScreen'; - -const sendToken = async (token: string, destinationAddress?: string) => { - await NavigationUtils.goToExtension(ROUTES.SEND); - await extension.driver.sleep(2000); - const isActive = await TokenTransferScreen.isActive(); - assert(isActive, 'The user is not in the send screen'); - await TokenTransferScreen.buildTx(token, true, destinationAddress); - await extension.driver.waitAndClick( - Locators.byDataTestId('sendTransactionButton'), - ); - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); - await extension.driver.sleep(2000); - await extension.driver.waitAndClick(Locators.byRole('pageClose')); - await extension.driver.sleep(2000); -}; - -const receiveToken = async (token: string) => { - await DashboardScreen.goToDashboard(); - await DashboardScreen.changeAccount('1'); - await sendToken(token, TestDefaults.ADDRESS); - await DashboardScreen.goToDashboard(); - await DashboardScreen.changeAccount('0'); -}; - -export default { - sendToken, - receiveToken, -}; diff --git a/tests/e2e/src/extension/flows/TokenManagementFlows.ts b/tests/e2e/src/extension/flows/TokenManagementFlows.ts deleted file mode 100644 index 8d44cabb..00000000 --- a/tests/e2e/src/extension/flows/TokenManagementFlows.ts +++ /dev/null @@ -1,42 +0,0 @@ -import ApproveAppScreen from '../screens/connected-app/ApproveAppScreen'; -import ConnectedAppScreen from '../screens/connected-app/ConnectedAppScreen'; -import TestDefaults from '../TestDefaults'; -import NavigationUtils from '../utils/NavigationUtils'; - -const connectAndInteract = async function ( - requestAction: (windowHandle: string) => Promise, - responseCallback: (windowHandle: string) => Promise, -) { - const windowHandle = await NavigationUtils.goToUrl(TestDefaults.DAPP_URL); - await ConnectedAppScreen.connectWallet(); - return await ApproveAppScreen.approveAndSign(); - // const isConnected = await ConnectedAppScreen.isConnected(windowHandle); - - // console.log('isConnected', isConnected); - - // if (!isConnected) { - // await ConnectedAppScreen.connectWallet(windowHandle); - - // // resolve when 1 of 2 promises resolves - // await new Promise((resolve, reject) => { - // ApproveAppScreen.approveAndSign() - // .then(resolve) - // .catch((e) => console.log('approveAndSign', e)); - // ApproveAppScreen.sign() - // .then(resolve) - // .catch((e) => console.log('sign', e)); - - // setTimeout(() => { - // reject('Timed out'); - // }, 10_000); - // }); - // } - - // await requestAction(windowHandle); - // await ApproveTransactionScreen.approve(); - // return await responseCallback(windowHandle); -}; - -export default { - connectAndInteract, -}; diff --git a/tests/e2e/src/extension/flows/UnlockFlow.ts b/tests/e2e/src/extension/flows/UnlockFlow.ts deleted file mode 100644 index f457a093..00000000 --- a/tests/e2e/src/extension/flows/UnlockFlow.ts +++ /dev/null @@ -1,24 +0,0 @@ -import Locators from 'extension/selenium/Locators'; -import { extension } from 'extension/selenium/WebDriver'; -import ScreenUtils from 'extension/utils/ScreenUtils'; - -const passwordInput = () => Locators.byDataTestId('password-input'); -const submitButton = () => Locators.byDataTestId('unlock-button'); - -const isActive = async () => { - return ScreenUtils.isActive([ - passwordInput(), - submitButton(), - Locators.byForm('unlockWalletForm'), - ]); -}; - -const submitPassword = async (password: string) => { - await extension.driver.waitAndType(passwordInput(), password); - await extension.driver.waitAndClick(submitButton()); -}; - -export default { - isActive, - submitPassword, -}; diff --git a/tests/e2e/src/extension/screens/access/UnlockScreen.ts b/tests/e2e/src/extension/flows/UnlockFlows.ts similarity index 78% rename from tests/e2e/src/extension/screens/access/UnlockScreen.ts rename to tests/e2e/src/extension/flows/UnlockFlows.ts index e314000a..ab722de4 100644 --- a/tests/e2e/src/extension/screens/access/UnlockScreen.ts +++ b/tests/e2e/src/extension/flows/UnlockFlows.ts @@ -1,6 +1,6 @@ -import ScreenUtils from '../../utils/ScreenUtils'; -import Locators from '../../selenium/Locators'; -import { extension } from '../../selenium/WebDriver'; +import ScreenUtils from '../utils/ScreenUtils'; +import Locators from '../selenium/Locators'; +import { extension } from '../selenium/WebDriver'; const passwordInput = () => Locators.byDataTestId('password-input'); const submitButton = () => Locators.byDataTestId('unlock-button'); diff --git a/tests/e2e/src/extension/screens/DashboardScreen.ts b/tests/e2e/src/extension/screens/DashboardScreen.ts deleted file mode 100644 index 1dc1b004..00000000 --- a/tests/e2e/src/extension/screens/DashboardScreen.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { ROUTES } from '../enums'; -import ScreenUtils from '../utils/ScreenUtils'; -import { extension } from '../selenium/WebDriver'; -import Locators from '../selenium/Locators'; -import NavigationUtils from '../utils/NavigationUtils'; -import assert from 'assert'; -import { logging } from 'selenium-webdriver'; - -const isActive = async () => { - const locator = Locators.byId('yourBalanceTitle'); - return ScreenUtils.isActive([locator], ROUTES.DASHBOARD); -}; - -const lockApp = async () => { - await extension.driver.waitAndClick( - Locators.byDataTestId('top-nav-dropdown'), - ); - await extension.driver.waitAndClick(Locators.byDataTestId('lockWallet')); -}; - -const goToDashboard = async () => { - await NavigationUtils.goToExtension(ROUTES.DASHBOARD); - await extension.driver.sleep(1_000); - const isDashboardScreenActive = await isActive(); - assert(isDashboardScreenActive, 'The user is not on the dashboard screen'); -}; - -const checkActiveAccount = async () => { - const addressElement = await extension.driver.waitUntilElementEnabled( - Locators.byId('AddressBoxAccountName'), - ); - return await addressElement.getText(); -}; - -const getCurrentNetwork = async () => { - let currentNetwork; - try { - const bannerFlag = await extension.driver.waitUntilElementEnabled( - Locators.byId('currentNetworkFlag'), - ); - const currentNetworkPhrase = await bannerFlag.getText(); - currentNetwork = currentNetworkPhrase.split(': ')[1]; - } catch (error) { - currentNetwork = ''; - } - return currentNetwork.toLocaleLowerCase(); -}; - -const checkConversionRate = async () => { - try { - await extension.driver.waitUntilElementEnabled( - Locators.byId('exchangeRateConversionId'), - ); - return true; - } catch (error) { - return false; - } -}; - -const checkAccountBalance = async () => { - return extension.driver.isElementPresent( - Locators.byDataTestId('accountBalance'), - ); -}; - -const manuallyUpdateBalances = async () => { - await goToDashboard(); - await extension.driver.waitAndClick( - Locators.byDataTestId('updateBalances'), - ); -}; - -const checkTokenBalance = async (token: string) => { - await goToDashboard(); - return extension.driver.isElementPresent( - Locators.byDataTestId(`token-balance-${token}`), - ); -}; - -const countTransactionsByToken = async (token: string) => { - await extension.driver.sleep(1000); - await extension.driver.waitAndClick(Locators.byId('token-' + token)); - await extension.driver.sleep(2000); - const transactionsCount = await extension.driver.findElements( - Locators.byDataTestId('ft-activity'), - ); - return transactionsCount.length; -}; - -const checkNewTransaction = async (token: string, oldCount: number) => { - await extension.driver.sleep(1000); - const newCount = await countTransactionsByToken(token); - return newCount == oldCount + 1; -}; - -const changeAccount = async (accountNumber = '1') => { - await extension.driver.waitAndClick(Locators.byId('AddressBoxAccountName')); - await extension.driver.waitAndClick( - Locators.byId(`account-checkbox-0-${accountNumber}`), - ); -}; - -const checkSecondAccountNotFound = async () => { - let notFoundAccount = false; - try { - await extension.driver.waitAndClick( - Locators.byDataTestId('addressTxt'), - ); - await extension.driver.findElement( - Locators.byId('account-checkbox-0-1'), - ); - } catch (error) { - notFoundAccount = true; - } - return notFoundAccount; -}; - -export default { - isActive, - lockApp, - goToDashboard, - checkActiveAccount, - getCurrentNetwork, - checkConversionRate, - checkAccountBalance, - manuallyUpdateBalances, - checkTokenBalance, - countTransactionsByToken, - checkNewTransaction, - checkSecondAccountNotFound, - changeAccount, -}; diff --git a/tests/e2e/src/extension/screens/activities/ActivitiesScreen.ts b/tests/e2e/src/extension/screens/activities/ActivitiesScreen.ts deleted file mode 100644 index b439332d..00000000 --- a/tests/e2e/src/extension/screens/activities/ActivitiesScreen.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { extension } from '../../selenium/WebDriver'; -import Locators from '../../selenium/Locators'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { ROUTES } from '../../enums'; -import NavigationUtils from '../../utils/NavigationUtils'; -import assert from 'assert'; - -const isActive = async () => { - const locator = Locators.byDataTestId('appBarTitleId'); - return ScreenUtils.isActive([locator], ROUTES.ACTIVITIES); -}; - -const goToActivities = async () => { - await extension.driver.sleep(500); - await NavigationUtils.goToExtension(ROUTES.ACTIVITIES); -}; - -const isTokenTransferLogged = async (isSent: boolean) => { - const elements = await extension.driver.findElements( - Locators.byDataTestId('ft-activity'), - ); - assert(elements.length === 1, 'Transfer activity log not found'); - - const element = await extension.driver.findElement( - Locators.byDataTestId('activityLabel'), - ); - const txLabel = await element.getText(); - return txLabel === (isSent ? 'Sent 1 VET' : 'Received 1 VET'); -}; - -const goToActivityDetail = async () => { - await extension.driver.waitAndClick(Locators.byId('extension-activity-0')); -}; - -const getGasPayer = async () => { - const element = await extension.driver.waitUntilElement( - Locators.byId('activity-gas-payer'), - ); - return await element.getText(); -}; - -const assertTokenTransferDetailLogged = async () => { - const tokenElement = await extension.driver.findElement( - Locators.byDataTestId('transferDetailToken'), - ); - const tokenValue = await tokenElement.getText(); - assert(tokenValue === 'VET', 'Incorrect token symbol in activity detail'); - - const amountElement = await extension.driver.findElement( - Locators.byDataTestId('transferDetailAmount'), - ); - const amountValue = await amountElement.getText(); - assert(amountValue === '1', 'Incorrect transfer amount in activity detail'); -}; - -const assertConnectedAppActivityLogged = async () => { - await extension.driver.wait( - async () => { - const elements = await extension.driver.findElements( - Locators.byDataTestId('cert-activity'), - ); - return elements.length > 0; - }, - 500, - 'Connected App activity log not found', - ); -}; - -export default { - isActive, - isTokenTransferLogged, - goToActivities, - goToActivityDetail, - assertTokenTransferDetailLogged, - assertConnectedAppActivityLogged, - getGasPayer, -}; diff --git a/tests/e2e/src/extension/screens/connected-app/ApproveTransactionScreen.ts b/tests/e2e/src/extension/screens/connected-app/ApproveTransactionScreen.ts deleted file mode 100644 index 6e4cf388..00000000 --- a/tests/e2e/src/extension/screens/connected-app/ApproveTransactionScreen.ts +++ /dev/null @@ -1,28 +0,0 @@ -import TestDefaults from '../../TestDefaults'; -import NavigationUtils from '../../utils/NavigationUtils'; -import PasswordPrompt from '../PasswordPrompt'; -import Locators from '../../selenium/Locators'; -import { extension } from '../../selenium/WebDriver'; - -const approve = async (password?: string) => { - const pw = password || TestDefaults.PASSWORD; - - await NavigationUtils.switchToExtensionIframe(); - //Wait for loader screen to disappear - await extension.driver.sleep(1500); - await extension.driver.waitAndClick( - Locators.buttonByName('sendTransactionButton'), - ); - await PasswordPrompt.submitPassword(pw); -}; - -const reject = async () => { - await NavigationUtils.switchToExtensionIframe(); - await extension.driver.sleep(1000); - await extension.driver.waitAndClick(Locators.byDataTestId('rejectDappBtn')); -}; - -export default { - approve, - reject, -}; diff --git a/tests/e2e/src/extension/screens/connected-app/ConnectedAppScreen.ts b/tests/e2e/src/extension/screens/connected-app/ConnectedAppScreen.ts deleted file mode 100644 index 1641e1af..00000000 --- a/tests/e2e/src/extension/screens/connected-app/ConnectedAppScreen.ts +++ /dev/null @@ -1,206 +0,0 @@ -import NavigationUtils from '../../utils/NavigationUtils'; -import TestDefaults from '../../TestDefaults'; -import Locators from '../../selenium/Locators'; -import { extension } from '../../selenium/WebDriver'; -import AddressUtils from 'extension/utils/AddressUtils'; -import { By } from 'selenium-webdriver/lib/by'; - -const isActive = async () => { - throw Error('Not implemented'); -}; - -//Clicks on x-1, y-1 of the page to exit the modals -const removeModals = async () => { - await extension.driver.actions().move({ x: 1, y: 1 }).click().perform(); -}; - -const isAccountVisible = async (windowHandle: string) => { - await extension.driver.switchTo().window(windowHandle); - await removeModals(); - - const accountElement = await extension.driver.findElement( - Locators.byId('connect-wallet-address-button'), - ); - const addr = await accountElement.getText(); - return AddressUtils.isValid(addr); -}; - -const connectWallet = async () => { - // Click connect button - const vdkButtonShadowRoot = await extension.driver - .findElement(By.css('vdk-button')) - .getShadowRoot(); - const connectButton = await vdkButtonShadowRoot.findElement( - By.css('vdk-connect-button'), - ); - const connectButtonShadowRoot = await connectButton.getShadowRoot(); - const button = await connectButtonShadowRoot.findElement(By.css('button')); - await button.click(); - - // // Click veworld source - const vdkModalShadowRoot = await extension.driver - .findElement(By.css('vdk-modal')) - .getShadowRoot(); - const vdkConnectModal = await vdkModalShadowRoot.findElement( - By.css('vdk-connect-modal'), - ); - const vdkBaseModalShadowRoot = await vdkConnectModal.getShadowRoot(); - const vdkSourceCard = await vdkBaseModalShadowRoot.findElements( - By.css('vdk-source-card'), - ); - const vdkSourceCardShadowRoot = await vdkSourceCard[0].getShadowRoot(); - const cardButton = await vdkSourceCardShadowRoot.findElement( - By.css('button'), - ); - await cardButton.click(); -}; - -const isConnected = async (windowHandle: string) => { - await NavigationUtils.switchToWindow(windowHandle); - await removeModals(); - - try { - await extension.driver.waitUntilElement( - Locators.bySelector('Connect Wallet'), - ); - return false; - } catch (e) { - return true; - } -}; - -const triggerTokenDeploy = async (windowHandle: string) => { - await NavigationUtils.switchToWindow(windowHandle); - - await extension.driver.waitAndClick( - Locators.byId('get-started-button-fungible'), - ); - await extension.driver.waitAndClick( - Locators.byId('deploy-new-token-button'), - ); - - //VIP 180: Name - await extension.driver.waitAndType( - Locators.byId('token-name'), - 'TestToken', - ); - //VIP 180: Symbol - await extension.driver.waitAndType(Locators.byId('token-symbol'), 'TKN'); - //VIP 180: Decimals - await extension.driver.waitAndType(Locators.byId('token-decimals'), '2'); - - //Submit - await extension.driver.waitAndClick(Locators.byId('submit-deploy-token')); -}; - -const getTokenAddress = async (windowHandle: string): Promise => { - await NavigationUtils.switchToWindow(windowHandle); - - await extension.driver.waitUntilElement( - Locators.byId('transaction-successful-id'), - ); - - await extension.driver.waitAndClick(Locators.byId('back-deploy-token')); - - const addressElement = await extension.driver.waitUntilElement( - Locators.byId('fungible-token-address'), - TestDefaults.TRANSACTION_TIMEOUT, - ); - - return await addressElement.getText(); -}; - -const checkRequestCancellation = async (windowHandle: string) => { - await NavigationUtils.switchToWindow(windowHandle); - - const feedback = await extension.driver.findElement( - Locators.byId('transaction-failed-description'), - ); - const feedbackMessage = await feedback.getText(); - return feedbackMessage === 'User cancelled request'; -}; - -const getConnectedAccount = async (windowHandle: string) => { - await NavigationUtils.switchToWindow(windowHandle); - await removeModals(); - - const accountElement = await extension.driver.findElement( - Locators.byId('connect-wallet-address-button'), - ); - return await accountElement.getText(); -}; - -const mintNFTs = async (windowHandle: string) => { - await NavigationUtils.switchToWindow(windowHandle); - await removeModals(); - - await extension.driver.waitAndClick( - Locators.byId('get-started-button-nfts'), - ); - - await extension.driver.waitAndClick(Locators.byText('Mint', 'button')); - - await extension.driver.waitAndType( - Locators.inputByName('address'), - '0xf077b491b355E64048cE21E3A6Fc4751eEeA77fa', - ); - - await extension.driver.waitAndType( - Locators.inputByName('clausesNumber'), - '100', - ); - - await extension.driver.waitAndClick(Locators.buttonByType('submit')); -}; - -const triggerNFTDeploy = async (windowHandle: string) => { - await NavigationUtils.switchToWindow(windowHandle); - await removeModals(); - - await extension.driver.waitAndClick( - Locators.byId('get-started-button-nfts'), - ); - await extension.driver.waitAndClick( - Locators.byText('Deploy new NFT', 'button'), - ); - - await extension.driver.waitAndType(Locators.inputByName('name'), 'TestNFT'); - await extension.driver.waitAndType(Locators.inputByName('symbol'), 'NFT'); - await extension.driver.waitAndType( - Locators.inputByName('baseTokenURI'), - 'https://myuri.com', - ); - - await extension.driver.waitAndClick(Locators.buttonByType('submit')); -}; - -const getNFTAddress = async (windowHandle: string): Promise => { - await NavigationUtils.switchToWindow(windowHandle); - - await extension.driver.waitUntilElement( - Locators.byId('transaction-successful-id'), - ); - - await extension.driver.waitAndClick(Locators.byTextPart('Back', 'button')); - - const addressElement = await extension.driver.waitUntilElement( - Locators.byId('nft-contract-address'), - TestDefaults.TRANSACTION_TIMEOUT, - ); - - return await addressElement.getText(); -}; - -export default { - isActive, - isAccountVisible, - connectWallet, - triggerTokenDeploy, - getTokenAddress, - checkRequestCancellation, - getConnectedAccount, - triggerNFTDeploy, - getNFTAddress, - mintNFTs, - isConnected, -}; diff --git a/tests/e2e/src/extension/screens/device-management/EditWalletScreen.ts b/tests/e2e/src/extension/screens/device-management/EditWalletScreen.ts deleted file mode 100644 index 78bfd115..00000000 --- a/tests/e2e/src/extension/screens/device-management/EditWalletScreen.ts +++ /dev/null @@ -1,24 +0,0 @@ -import Locators from '../../selenium/Locators'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byId('editWalletForm'); - return ScreenUtils.isActive([locator], ROUTES.ACCOUNTS_WALLET_EDIT); -}; - -const renameWallet = async (newWalletName: string) => { - await extension.driver.waitAndClearAndType( - Locators.byDataTestId('walletAlias'), - newWalletName, - ); - await extension.driver.waitAndClick( - Locators.byId('saveChangesEditWalletButton'), - ); -}; - -export default { - isActive, - renameWallet, -}; diff --git a/tests/e2e/src/extension/screens/device-management/WalletManagementScreen.ts b/tests/e2e/src/extension/screens/device-management/WalletManagementScreen.ts deleted file mode 100644 index 7b42b93b..00000000 --- a/tests/e2e/src/extension/screens/device-management/WalletManagementScreen.ts +++ /dev/null @@ -1,115 +0,0 @@ -import Locators from '../../selenium/Locators'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import EditWalletScreen from './EditWalletScreen'; -import assert from 'assert'; -import TestDefaults from '../../TestDefaults'; -import PasswordPrompt from '../PasswordPrompt'; -import NavigationUtils from '../../utils/NavigationUtils'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byId('accountsWalletManagementOptionsDescription'); - return ScreenUtils.isActive([locator], ROUTES.ACCOUNTS_WALLET_MANAGEMENT); -}; - -const checkWalletName = async (newWalletName: string) => { - const addressElement = await extension.driver.waitUntilElement( - Locators.byRole('device-alias'), - ); - - const walletNameToCheck = await addressElement.getText(); - return walletNameToCheck === newWalletName; -}; - -const checkNewAccountCreated = async ( - oldCountAccount: number, - index: string, -) => { - const newCountAccount = await countAccounts(index); - return newCountAccount == oldCountAccount + 1; -}; - -const removeWallet = async () => { - await extension.driver.sleep(1000); - await extension.driver.waitAndClick( - Locators.byId('GoToEditWalletPageButton1'), - ); - - const isEditWalletScreenActive = await EditWalletScreen.isActive(); - assert( - isEditWalletScreenActive, - 'The user is not on the edit wallet screen', - ); - - await extension.driver.waitAndClick( - Locators.byId('removeWalletButtonOnEditWalletPage'), - ); - - await extension.driver.waitAndClick( - Locators.byId('confirmationCheckboxOnRemoveWalletPage'), - ); - await extension.driver.waitAndClick( - Locators.byId('removeWalletButtonOnRemoveWalletPage'), - ); - - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); -}; - -const tryToRemoveWallet = async () => { - await extension.driver.waitAndClick( - Locators.byId('GoToEditWalletPageButton0'), - ); - - let isEditWalletScreenActive = await EditWalletScreen.isActive(); - assert( - isEditWalletScreenActive, - 'The user is not on the edit wallet screen', - ); - - await extension.driver.waitAndClick( - Locators.byId('removeWalletButtonOnEditWalletPage'), - ); -}; - -const checkRemoveError = async () => { - return await extension.driver.isElementPresent( - Locators.byId('notAllowedToRemoveWalletError'), - ); -}; - -const goToWalletManagement = async () => { - await NavigationUtils.goToExtension(ROUTES.ACCOUNTS_WALLET_MANAGEMENT); - const isWalletManagementScreenActive = await isActive(); - assert( - isWalletManagementScreenActive, - 'The user is not on the wallet management screen', - ); -}; - -const countAccounts = async (index: string) => { - const accountCount = await extension.driver.findElements( - Locators.byId('accountListElement-' + index), - ); - return accountCount.length; -}; - -const hideAccount = async () => { - const hideBtn = await extension.driver.waitUntilElementEnabled( - Locators.byId('accountListElementDisable-0-1'), - ); - await extension.driver.executeScript('arguments[0].click()', hideBtn); - await extension.driver.sleep(3000); -}; - -export default { - isActive, - checkWalletName, - checkNewAccountCreated, - removeWallet, - tryToRemoveWallet, - checkRemoveError, - goToWalletManagement, - countAccounts, - hideAccount, -}; diff --git a/tests/e2e/src/extension/screens/network-management/AddNetworkScreen.ts b/tests/e2e/src/extension/screens/network-management/AddNetworkScreen.ts deleted file mode 100644 index 60db03eb..00000000 --- a/tests/e2e/src/extension/screens/network-management/AddNetworkScreen.ts +++ /dev/null @@ -1,48 +0,0 @@ -import assert from 'assert'; -import { ROUTES } from '../../enums'; -import Locators from '../../selenium/Locators'; -import NavigationUtils from '../../utils/NavigationUtils'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async function () { - const locator = Locators.byId('addNetworkDescription'); - return ScreenUtils.isActive([locator], ROUTES.SETTINGS_NETWORK_ADD); -}; - -const gotoAddNetwork = async function () { - await NavigationUtils.goToExtension(ROUTES.SETTINGS_NETWORK_ADD); - const isNetworkManagement = await isActive(); - assert(isNetworkManagement, 'The user is not on the add network screen'); -}; - -const addNetworkWithWrongUrl = async function () { - await extension.driver.waitAndType( - Locators.byId('networkNameInput'), - 'test', - ); - await extension.driver.waitAndType( - Locators.byId('networkUrlInput'), - 'test', - ); - await extension.driver.waitAndClick(Locators.byId('submitAddEditNetwork')); -}; - -const checkError = async function () { - assert(isActive, 'The user should be on the add network screen'); - try { - await extension.driver.waitUntilElementEnabled( - Locators.byClass('input-error'), - ); - return true; - } catch (error) { - return false; - } -}; - -export default { - isActive, - gotoAddNetwork, - addNetworkWithWrongUrl, - checkError, -}; diff --git a/tests/e2e/src/extension/screens/network-management/NetworkManagementsScreen.ts b/tests/e2e/src/extension/screens/network-management/NetworkManagementsScreen.ts deleted file mode 100644 index 78c0bd8c..00000000 --- a/tests/e2e/src/extension/screens/network-management/NetworkManagementsScreen.ts +++ /dev/null @@ -1,62 +0,0 @@ -import assert from 'assert'; -import { ROUTES } from '../../enums'; -import Locators from '../../selenium/Locators'; -import NavigationUtils from '../../utils/NavigationUtils'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async function () { - const locator = Locators.byId('networkManagementDescription'); - return ScreenUtils.isActive([locator], ROUTES.SETTINGS_NETWORKS); -}; - -const gotoNetworkManagement = async function () { - await NavigationUtils.goToExtension(ROUTES.SETTINGS_NETWORKS); - const isNetworkManagement = await isActive(); - assert( - isNetworkManagement, - 'The user is not on the network management screen', - ); -}; - -const isNetworkActive = async (network: string) => { - const networkElement = await extension.driver.waitUntilElement( - Locators.byId(`network-option-${network}`), - ); - - return await networkElement.isDisplayed(); -}; - -const changeNetwork = async function (network: string) { - const networksDropdown = await extension.driver.waitUntilElementEnabled( - Locators.byId('selectNetworkDropdown'), - ); - await networksDropdown.click(); - const networksSelect = await extension.driver.waitUntilElementEnabled( - Locators.byId(`network-option-${network}`), - ); - await networksSelect.click(); -}; - -const toggleIndicatorSwitch = async function () { - const switchIndicator = await extension.driver.waitUntilElementEnabled( - Locators.byId('showTestNetTagSwitch'), - ); - await switchIndicator.click(); -}; - -const toggleConversionSwitch = async function () { - const switchIndicator = await extension.driver.waitUntilElementEnabled( - Locators.byId('showConversionOtherNetsId'), - ); - await switchIndicator.click(); -}; - -export default { - isActive, - gotoNetworkManagement, - changeNetwork, - toggleIndicatorSwitch, - toggleConversionSwitch, - isNetworkActive, -}; diff --git a/tests/e2e/src/extension/screens/onboarding/GenerateNewWallet.ts b/tests/e2e/src/extension/screens/onboarding/GenerateNewWallet.ts deleted file mode 100644 index ab47c979..00000000 --- a/tests/e2e/src/extension/screens/onboarding/GenerateNewWallet.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import Locators from '../../selenium/Locators'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byId('copyMnemonicPrompt'); - return ScreenUtils.isActive([locator], ROUTES.NEW_LOCAL_WALLET); -}; - -const copyMnemonic = async (): Promise => { - const mnemonic: string[] = []; - - for (let i = 0; i < 12; i++) { - const mnemonicElement = await extension.driver.waitUntilElement( - Locators.byId(`mnemonic-word-${i}`), - ); - mnemonic.push(await mnemonicElement.getText()); - } - - console.log(mnemonic); - - return mnemonic; -}; - -const proceedAfterCopy = async () => { - await extension.driver.waitAndClick(Locators.byId('confirmSavedCheckbox')); - await extension.driver.waitAndClick(Locators.byId('proceedButton')); -}; - -export default { - isActive, - copyMnemonic, - proceedAfterCopy, -}; diff --git a/tests/e2e/src/extension/screens/onboarding/ImportLocalKeystoreScreen.ts b/tests/e2e/src/extension/screens/onboarding/ImportLocalKeystoreScreen.ts deleted file mode 100644 index 176d7a59..00000000 --- a/tests/e2e/src/extension/screens/onboarding/ImportLocalKeystoreScreen.ts +++ /dev/null @@ -1,43 +0,0 @@ -import Locators from '../../selenium/Locators'; -import TestDefaults from '../../TestDefaults'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; -import path from 'path'; - -const isActive = async () => { - const locator = Locators.byDataTestId('importLocalWalletKeystoreButton'); - return ScreenUtils.isActive([locator], ROUTES.IMPORT_LOCAL_WALLET_KEYSTORE); -}; - -const uploadKeystore = async ( - keystorePath?: string, - keystorePassword?: string, -) => { - keystorePath = keystorePath || TestDefaults.KEYSTORE_PATH; - keystorePassword = keystorePassword || TestDefaults.KEYSTORE_PASSWORD; - - const keystoreAbsolutePath = path.resolve(keystorePath); - - await extension.driver.waitAndType( - Locators.byDataTestId(`input-keystore-file`), - keystoreAbsolutePath, - ); - - await extension.driver.waitAndType( - Locators.byDataTestId(`keystore-password`), - keystorePassword, - ); -}; - -const submit = async () => { - await extension.driver.waitAndClick( - Locators.byDataTestId('importLocalWalletKeystoreButton'), - ); -}; - -export default { - isActive, - uploadKeystore, - submit, -}; diff --git a/tests/e2e/src/extension/screens/onboarding/ImportLocalPrivateKeyScreen.ts b/tests/e2e/src/extension/screens/onboarding/ImportLocalPrivateKeyScreen.ts deleted file mode 100644 index a4441546..00000000 --- a/tests/e2e/src/extension/screens/onboarding/ImportLocalPrivateKeyScreen.ts +++ /dev/null @@ -1,34 +0,0 @@ -import Locators from '../../selenium/Locators'; -import TestDefaults from '../../TestDefaults'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byDataTestId('importLocalWalletPrivateKeyButton'); - return ScreenUtils.isActive( - [locator], - ROUTES.IMPORT_LOCAL_WALLET_PRIVATEKEY, - ); -}; - -const enterPrivateKey = async (privateKey?: string) => { - privateKey = privateKey || TestDefaults.PRIVATE_KEY; - - await extension.driver.waitAndType( - Locators.byDataTestId(`private-key`), - privateKey, - ); -}; - -const submit = async () => { - await extension.driver.waitAndClick( - Locators.byDataTestId('importLocalWalletPrivateKeyButton'), - ); -}; - -export default { - isActive, - enterPrivateKey, - submit, -}; diff --git a/tests/e2e/src/extension/screens/onboarding/VerifyNewWallet.ts b/tests/e2e/src/extension/screens/onboarding/VerifyNewWallet.ts deleted file mode 100644 index 673e81a0..00000000 --- a/tests/e2e/src/extension/screens/onboarding/VerifyNewWallet.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import Locators from '../../selenium/Locators'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byRole('confirmButton'); - return ScreenUtils.isActive([locator], ROUTES.NEW_LOCAL_WALLET); -}; - -const fillConfirmation = async (mnemonic: string[], valid: boolean) => { - const mnemonicInputs = await extension.driver.waitUntilElements( - Locators.byRole('mnemonic-input'), - ); - - if (valid) { - for (const input of mnemonicInputs) { - const dataTestId = await input.getAttribute('data-testid'); - await input.sendKeys(mnemonic[+dataTestId]); - } - } else { - for (const input of mnemonicInputs) { - await input.sendKeys(mnemonic[0]); - } - } -}; - -export const verifyMnemonic = async (valid: boolean) => { - await extension.driver.waitAndClick(Locators.byRole('confirmButton')); - - if (valid) - await extension.driver.waitAndClick(Locators.byRole('goToHomepage')); -}; - -export default { - isActive, - fillConfirmation, - verifyMnemonic, -}; diff --git a/tests/e2e/src/extension/screens/settings/advanced/AdvancedSettingsScreen.ts b/tests/e2e/src/extension/screens/settings/advanced/AdvancedSettingsScreen.ts deleted file mode 100644 index eb9280c1..00000000 --- a/tests/e2e/src/extension/screens/settings/advanced/AdvancedSettingsScreen.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Locators from '../../../selenium/Locators'; -import ScreenUtils from '../../../utils/ScreenUtils'; -import { ROUTES } from '../../../enums'; -import { extension } from '../../../selenium/WebDriver'; -import NavigationUtils from '../../../utils/NavigationUtils'; - -const isActive = async () => { - const locator = Locators.byDataTestId('appBarTitleId'); - return ScreenUtils.isActive([locator], ROUTES.SETTINGS_GENERAL); -}; - -const downloadStateLog = async () => { - await extension.driver.waitAndClick(Locators.byDataTestId('downloadLogId')); -}; - -const checkDownloadSuccess = async () => { - try { - const notification = await extension.driver.waitUntilElementEnabled( - Locators.byClass('ant-notification-notice-description'), - ); - const msg = await notification.getText(); - if (msg === 'State logs download successful') return true; - } catch (e) { - console.error(e); - } - return false; -}; - -const clickResetExtension = async () => { - await NavigationUtils.goToExtension(ROUTES.SETTINGS_WALLET_RESET); -}; - -export default { - isActive, - downloadStateLog, - checkDownloadSuccess, - clickResetExtension, -}; diff --git a/tests/e2e/src/extension/screens/settings/advanced/VeWorldResetScreen.ts b/tests/e2e/src/extension/screens/settings/advanced/VeWorldResetScreen.ts deleted file mode 100644 index 2d462e2e..00000000 --- a/tests/e2e/src/extension/screens/settings/advanced/VeWorldResetScreen.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Locators from '../../../selenium/Locators'; -import ScreenUtils from '../../../utils/ScreenUtils'; -import { ROUTES } from '../../../enums'; -import PasswordPrompt from '../../../screens/PasswordPrompt'; -import TestDefaults from '../../../TestDefaults'; -import { extension } from '../../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byDataTestId('appBarTitleId'); - return ScreenUtils.isActive([locator], ROUTES.SETTINGS_WALLET_RESET); -}; - -const confirmResetWallet = async () => { - await extension.driver.waitAndClick( - Locators.byDataTestId('confirmationCheckbox'), - ); - await extension.driver.waitAndClick(Locators.byDataTestId('resetButton')); - - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); -}; - -export default { - isActive, - confirmResetWallet, -}; diff --git a/tests/e2e/src/extension/screens/settings/contact/AddContactScreen.ts b/tests/e2e/src/extension/screens/settings/contact/AddContactScreen.ts deleted file mode 100644 index daf7fbce..00000000 --- a/tests/e2e/src/extension/screens/settings/contact/AddContactScreen.ts +++ /dev/null @@ -1,29 +0,0 @@ -import Locators from '../../../selenium/Locators'; -import ScreenUtils from '../../../utils/ScreenUtils'; -import { extension } from '../../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byId('addContactForm'); - return ScreenUtils.isActive([locator]); -}; - -const typeNewContact = async (name: string, address: string) => { - await extension.driver.waitAndType( - Locators.byDataTestId('aliasInput'), - name, - ); - await extension.driver.waitAndType( - Locators.byDataTestId('addressInput'), - address, - ); -}; - -const submit = async () => { - await extension.driver.waitAndClick(Locators.byDataTestId('submit')); -}; - -export default { - isActive, - typeNewContact, - submit, -}; diff --git a/tests/e2e/src/extension/screens/settings/contact/ContactsManagementScreen.ts b/tests/e2e/src/extension/screens/settings/contact/ContactsManagementScreen.ts deleted file mode 100644 index 35388d2d..00000000 --- a/tests/e2e/src/extension/screens/settings/contact/ContactsManagementScreen.ts +++ /dev/null @@ -1,41 +0,0 @@ -import Locators from '../../../selenium/Locators'; -import ScreenUtils from '../../../utils/ScreenUtils'; -import { extension } from '../../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byId('addContactBtn'); - return ScreenUtils.isActive([locator]); -}; - -const addContact = async () => { - await extension.driver.waitAndClick(Locators.byId('addContactBtn')); -}; - -// Used both to assert presence/absence of element -const isContactAliasVisible = async (alias: string, logException: boolean) => { - await extension.driver.sleep(1000); - try { - const contactElement = await extension.driver.waitUntilElement( - Locators.byDataTestId(`contact-alias-${alias}`), - ); - const contactTitle = await contactElement.getText(); - return alias === contactTitle; - } catch (e) { - if (logException) console.log(e); - return false; - } -}; - -const clickEdit = async (alias: string) => { - await extension.driver.sleep(1000); - await extension.driver.waitAndClick( - Locators.byDataTestId(`contact-update-${alias}`), - ); -}; - -export default { - isActive, - addContact, - isContactAliasVisible, - clickEdit, -}; diff --git a/tests/e2e/src/extension/screens/settings/contact/EditContactScreen.ts b/tests/e2e/src/extension/screens/settings/contact/EditContactScreen.ts deleted file mode 100644 index 41221d8b..00000000 --- a/tests/e2e/src/extension/screens/settings/contact/EditContactScreen.ts +++ /dev/null @@ -1,69 +0,0 @@ -import Locators from '../../../selenium/Locators'; -import ScreenUtils from '../../../utils/ScreenUtils'; -import { compareAddresses } from '../../../utils/AddressUtils/AddressUtils'; -import { extension } from '../../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byId('addEditContactForm'); - return ScreenUtils.isActive([locator]); -}; - -const typeAlias = async (newName: string) => { - let closeToast; - try { - closeToast = await extension.driver.findElement( - Locators.byClass('anticon anticon-close'), - ); - } finally { - if (closeToast) await closeToast.click(); - - await extension.driver.sleep(1000); - await extension.driver.waitAndClearAndType( - Locators.byId('aliasInput'), - newName, - ); - } -}; - -const typeAddress = async (newAddress: string) => { - await extension.driver.waitAndClearAndType( - Locators.byId('addressInput'), - newAddress, - ); -}; - -const update = async () => { - await extension.driver.waitAndClick(Locators.byDataTestId('update')); -}; - -const checkAddressUpdated = async (address: string) => { - const addressInput = await extension.driver.findElement( - Locators.byId('addressInput'), - ); - const inputValue = await addressInput.getAttribute('value'); - return compareAddresses(inputValue, address); -}; - -const isErrorMessageDisplayed = async () => { - const element = await extension.driver.findElement( - Locators.byClass('input-error'), - ); - const value = await element.getText(); - return ( - value === 'Required' || value === 'Please enter a valid Vechain address' - ); -}; - -const remove = async () => { - await extension.driver.waitAndClick(Locators.byDataTestId('remove')); -}; - -export default { - isActive, - typeAlias, - typeAddress, - update, - checkAddressUpdated, - isErrorMessageDisplayed, - remove, -}; diff --git a/tests/e2e/src/extension/screens/settings/general/GeneralSettingsScreen.ts b/tests/e2e/src/extension/screens/settings/general/GeneralSettingsScreen.ts deleted file mode 100644 index d882337e..00000000 --- a/tests/e2e/src/extension/screens/settings/general/GeneralSettingsScreen.ts +++ /dev/null @@ -1,161 +0,0 @@ -import Locators from '../../../selenium/Locators'; -import ScreenUtils from '../../../utils/ScreenUtils'; -import NavigationUtils from '../../../utils/NavigationUtils'; -import { ROUTES } from '../../../enums'; -import { By, WebElement } from 'selenium-webdriver'; -import { asyncFilter } from '../../../utils/AsyncUtils/AsyncUtils'; -import { extension } from '../../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byDataTestId('appBarTitleId'); - return ScreenUtils.isActive([locator], ROUTES.SETTINGS_GENERAL); -}; - -const getSelectedLanguage = async () => { - const languageSelector = extension.driver.findElement( - Locators.byId('languageDropdownId'), - ); - return languageSelector.getText(); -}; - -const changeLanguage = async (newLanguage: string) => { - const oldLanguageElement = await extension.driver.waitUntilElementEnabled( - Locators.byId('languageDropdownId'), - ); - await oldLanguageElement.click(); - - const newLanguageElement = await extension.driver.waitUntilElementEnabled( - Locators.byDataTestId(`option-language-${toLanguageCode(newLanguage)}`), - ); - await newLanguageElement.click(); -}; - -const isScreenTranslated = async (language: string) => { - const element = await extension.driver.waitUntilElement( - Locators.byDataTestId('appBarTitleId'), - ); - const title = await element.getText(); - return language === toLanguage(title); -}; - -const getSelectedCurrency = async () => { - const languageSelector = extension.driver.findElement( - Locators.byId('currencyDropdownId'), - ); - const selectedCurrency = await languageSelector.getText(); - return toCurrencyCode(selectedCurrency); -}; - -const changeCurrency = async (newCurrency: string) => { - const oldCurrencyElement = await extension.driver.waitUntilElementEnabled( - Locators.byId('currencyDropdownId'), - ); - await oldCurrencyElement.click(); - - const newCurrencyElement = await extension.driver.waitUntilElementEnabled( - Locators.byDataTestId(`option-currency-${newCurrency}`), - ); - await newCurrencyElement.click(); -}; - -// Modify network setting to show fiat balance for testnet before checking dashboard currencies -const isConversionInCurrency = async (currency: string) => { - await NavigationUtils.goToExtension(ROUTES.SETTINGS_NETWORKS); - const showConversionElement = - await extension.driver.waitUntilElementEnabled( - Locators.byDataTestId('showConversionOtherNetsId'), - ); - await showConversionElement.click(); - - await NavigationUtils.goToExtension(ROUTES.DASHBOARD); - const fiatBalanceElement = await extension.driver.waitUntilElementEnabled( - Locators.byDataTestId('fiat-balance-VET'), - ); - const fiatBalanceText = await fiatBalanceElement.getText(); - return fiatBalanceText.includes(toCurrencySymbol(currency)); -}; - -const toggleHideTokensNoBalance = async () => { - const isChecked = await extension.driver.isElementChecked( - Locators.byDataTestId('token-no-balance-switch'), - ); - if (!isChecked) { - await extension.driver.waitAndClick( - Locators.byDataTestId('token-no-balance-switch'), - ); - } -}; - -const areTokenNoBalanceInvisible = async () => { - await NavigationUtils.goToExtension(ROUTES.DASHBOARD); - const balances = await extension.driver.findElements( - By.xpath("//span[starts-with(@data-testid, 'token-balance-')]"), - ); - - const noBalanceTokens = await asyncFilter( - balances, - async (b: WebElement) => { - const v = await b.getText(); - return v.split(' ')[0] == '0'; - }, - ); - return noBalanceTokens.length === 0; -}; - -const toLanguage = (label: string) => { - switch (label) { - case 'General': - return 'English (United States)'; - case 'Général': - return 'French (France)'; - default: - return 'unknown'; - } -}; - -const toLanguageCode = (language: string) => { - switch (language) { - case 'English (United States)': - return 'en-US'; - case 'English (Great Britain)': - return 'en-GB'; - case 'French (France)': - return 'fr-FR'; - default: - return 'unknown'; - } -}; - -const toCurrencyCode = (currency: string) => { - switch (currency) { - case 'USD - Dollar (US)': - return 'USD'; - case 'EUR - Euro': - return 'EUR'; - default: - return 'unknown'; - } -}; - -const toCurrencySymbol = (currency: string) => { - switch (currency) { - case 'USD': - return '$'; - case 'EUR': - return '€'; - default: - return 'unknown'; - } -}; - -export default { - isActive, - getSelectedLanguage, - changeLanguage, - isScreenTranslated, - getSelectedCurrency, - changeCurrency, - isConversionInCurrency, - toggleHideTokensNoBalance, - areTokenNoBalanceInvisible, -}; diff --git a/tests/e2e/src/extension/screens/settings/security-privacy/SecurityPrivacySettingsScreen.ts b/tests/e2e/src/extension/screens/settings/security-privacy/SecurityPrivacySettingsScreen.ts deleted file mode 100644 index 69fca698..00000000 --- a/tests/e2e/src/extension/screens/settings/security-privacy/SecurityPrivacySettingsScreen.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { extension } from '../../../selenium/WebDriver'; -import Locators from '../../../selenium/Locators'; -import ScreenUtils from '../../../utils/ScreenUtils'; -import { ROUTES } from '../../../enums'; -import PasswordPrompt from '../../../screens/PasswordPrompt'; -import TestDefaults from '../../../TestDefaults'; -import NavigationUtils from '../../../utils/NavigationUtils'; -import { By, Key, logging, WebElement } from 'selenium-webdriver'; - -const NEW_PASSWORD = 'myPassword124'; -const NON_MATCHING_NEW_PASSWORD = 'myPassword125'; -const INCORRECT_PASSWORD = 'myPassword126'; - -const isActive = async () => { - const locator = Locators.byDataTestId('appBarTitleId'); - return ScreenUtils.isActive([locator], ROUTES.SETTINGS_SECURITY_PRIVACY); -}; - -const updatePasswordAuthorization = async (newMode: boolean) => { - const locator = Locators.byDataTestId('localWalletMode'); - const toggle = await extension.driver.waitUntilElementEnabled(locator); - const isActive = await extension.driver.isElementChecked(locator); - - if (isActive !== newMode) await toggle.click(); - if (newMode === false) { - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); - } -}; - -const attemptSignTransaction = async () => { - await NavigationUtils.goToExtension(ROUTES.SEND); - - const tokenBoxes = await extension.driver.waitUntilElements( - Locators.byDataTestId('tokenbox'), - ); - await tokenBoxes[0].click(); - - await extension.driver.waitAndClick( - Locators.byClass('react-select__value-container'), - ); - - await extension.driver.waitAndType( - Locators.byId('searchInput'), - '0x435933c8064b4Ae76bE665428e0307eF2cCFBD68', - ); - - const element = await extension.driver.waitUntilElementEnabled( - Locators.byId('searchInput'), - ); - await element.sendKeys(Key.ENTER); - - await extension.driver.waitAndType(Locators.byId('amountToTransfer'), '1'); - - await extension.driver.waitAndClick(Locators.byDataTestId('sendTokenBtn')); - //Wait for loader to go away - await extension.driver.sleep(1500); - await extension.driver.waitAndClick(Locators.byId('sendTransactionButton')); -}; - -const isPasswordPrompt = async () => { - return await extension.driver.isElementPresent( - Locators.byId('enterPasswordInput'), - ); -}; - -const attemptPasswordChange = async ( - newPassword = NEW_PASSWORD, - matchingPassword = true, -) => { - const resetPassword = await extension.driver.findElement( - Locators.byId('resetPasswordSettings'), - ); - await resetPassword.click(); - - await extension.driver.waitAndType( - Locators.byId('passwordInput'), - newPassword, - ); - await extension.driver.waitAndType( - Locators.byId('confirmPasswordInput'), - matchingPassword ? newPassword : NON_MATCHING_NEW_PASSWORD, - ); - const resetBtn = await extension.driver.findElement( - Locators.byDataTestId('confirmPasswordButton'), - ); - await resetBtn.click(); -}; - -const isPasswordUpdated = async (isPasswordPrompt = true) => { - if (isPasswordPrompt) - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); - - let isUpdated = false; - try { - // Attempt to restore default password, using the new password - await attemptPasswordChange(TestDefaults.PASSWORD); - await PasswordPrompt.submitPassword(NEW_PASSWORD); - isUpdated = true; - } catch (e) { - // Failure means the password hasn't been updated - console.log(e); - } - - return isUpdated; -}; - -const attemptPasswordChangeWithIncorrectPassword = async () => { - await attemptPasswordChange(); - await PasswordPrompt.submitPassword(INCORRECT_PASSWORD); -}; - -const idleForTheAutoLockTimeout = async () => { - // Wait 60s (minimum idle query state) + 20s inactivity delay - await extension.driver.sleep(80 * 1000); -}; - -const isAutoLockWorkerActive = async () => { - let autoLockWorkerLogs: logging.Entry[] = []; - await extension.driver - .manage() - .logs() - .get(logging.Type.BROWSER) - .then((entries) => { - autoLockWorkerLogs = entries.filter((entry) => - entry.message.includes('Current idle state: '), - ); - }); - console.log(autoLockWorkerLogs); - return autoLockWorkerLogs.length > 0; -}; - -const attemptBackupMnemonic = async () => { - const backupBtn = await extension.driver.findElement( - Locators.byDataTestId('backupMnemonicButton'), - ); - await backupBtn.click(); - await extension.driver.waitAndClick(Locators.byDataTestId('continueBtn')); -}; - -const isMnemonicDisplayed = async () => { - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); - const mnemonicWords = await extension.driver.findElements( - By.xpath("//span[starts-with(@id, 'mnemonic-word-')]"), - ); - return checkValidMnemonic(mnemonicWords); -}; - -const checkValidMnemonic = async (words: WebElement[]) => { - let backupMnemonics: string = ''; - for (let i = 0; i < 12; i++) { - let word = await words[i].getText(); - backupMnemonics = backupMnemonics + ' ' + word; - } - return backupMnemonics.trim() === TestDefaults.MNEMONIC; -}; - -const isAnalyticsOptionEnabled = async () => { - return await extension.driver.isElementChecked( - Locators.byDataTestId('analyticsTracking'), - ); -}; - -export default { - isActive, - updatePasswordAuthorization, - attemptSignTransaction, - isPasswordPrompt, - attemptPasswordChange, - isPasswordUpdated, - attemptPasswordChangeWithIncorrectPassword, - idleForTheAutoLockTimeout, - attemptBackupMnemonic, - isMnemonicDisplayed, - isAutoLockWorkerActive, - isAnalyticsOptionEnabled, -}; diff --git a/tests/e2e/src/extension/screens/token-management/AddTokenScreen.ts b/tests/e2e/src/extension/screens/token-management/AddTokenScreen.ts deleted file mode 100644 index ea58738a..00000000 --- a/tests/e2e/src/extension/screens/token-management/AddTokenScreen.ts +++ /dev/null @@ -1,21 +0,0 @@ -import assert from 'assert'; -import { ROUTES } from '../../enums'; -import Locators from '../../selenium/Locators'; -import NavigationUtils from '../../utils/NavigationUtils'; -import ScreenUtils from '../../utils/ScreenUtils'; - -const isActive = async () => { - const locator = Locators.byId('formAddToken'); - return ScreenUtils.isActive([locator], ROUTES.MANAGE_TOKENS_ADD); -}; - -const goToAddToken = async function () { - await NavigationUtils.goToExtension(ROUTES.MANAGE_TOKENS_ADD); - const isManageTokendsActive = await isActive(); - assert(isManageTokendsActive, 'The user is not on the add token screen'); -}; - -export default { - isActive, - goToAddToken, -}; diff --git a/tests/e2e/src/extension/screens/token-management/ManageTokensScreen.ts b/tests/e2e/src/extension/screens/token-management/ManageTokensScreen.ts deleted file mode 100644 index 9305dbfb..00000000 --- a/tests/e2e/src/extension/screens/token-management/ManageTokensScreen.ts +++ /dev/null @@ -1,81 +0,0 @@ -import Locators from '../../selenium/Locators'; -import { ROUTES } from '../../enums'; -import ScreenUtils from '../../utils/ScreenUtils'; -import assert from 'assert'; -import NavigationUtils from '../../utils/NavigationUtils'; -import TokenManagementFlows from '../../flows/TokenManagementFlows'; -import AddTokenScreen from './AddTokenScreen'; -import { extension } from '../../selenium/WebDriver'; - -const isActive = async () => { - const locator = Locators.byId('manageTokensDescription'); - return ScreenUtils.isActive([locator], ROUTES.MANAGE_TOKENS); -}; - -const gotoManageTokens = async function () { - await NavigationUtils.goToExtension(ROUTES.MANAGE_TOKENS); - const isManageTokendsActive = await isActive(); - assert( - isManageTokendsActive, - 'The user is not on the manage tokens screen', - ); -}; - -const removeCustomToken = async function (contractAddress: string) { - await extension.driver.waitAndClick( - Locators.byId(`delete-token-button-${contractAddress}`.toLowerCase()), - ); -}; - -// const addCustomToken = async function () { -// //const contractAddress = await TokenManagementFlows.deployToken(); -// console.log('contractAddress', contractAddress); -// await AddTokenScreen.goToAddToken(); -// await extension.driver.waitAndType( -// Locators.byId('tokenAddress'), -// contractAddress, -// ); - -// await extension.driver.waitAndClick(Locators.byId('addCustomTokenBtn')); - -// //Wait until we know the token was added -// await extension.driver.waitUntilElement( -// Locators.byId(`remove-${contractAddress.toLowerCase()}`), -// ); - -// return contractAddress; -// }; - -const checkCustomToken = async function (contractAddress: string) { - let tokenFound = true; - try { - await extension.driver.waitUntilElement( - Locators.byId(`remove-${contractAddress}`.toLowerCase()), - ); - } catch (error) { - tokenFound = false; - } - return tokenFound; -}; - -const waitUntilTokenIsRemoved = async function (contractAddress: string) { - try { - await extension.driver.waitUntilElementRemoved( - Locators.byId( - `delete-token-button-${contractAddress.toLowerCase()}`, - ), - ); - return true; - } catch (e) { - console.error(e); - return false; - } -}; - -export default { - isActive, - gotoManageTokens, - removeCustomToken, - checkCustomToken, - waitUntilTokenIsRemoved, -}; diff --git a/tests/e2e/src/extension/screens/token-transfer/TokenTransferScreen.ts b/tests/e2e/src/extension/screens/token-transfer/TokenTransferScreen.ts deleted file mode 100644 index 932bf674..00000000 --- a/tests/e2e/src/extension/screens/token-transfer/TokenTransferScreen.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { extension } from '../../selenium/WebDriver'; -import Locators from '../../selenium/Locators'; -import ScreenUtils from '../../utils/ScreenUtils'; -import { ROUTES } from '../../enums'; -import PasswordPrompt from '../PasswordPrompt'; -import TestDefaults from '../../TestDefaults'; -import NavigationUtils from '../../utils/NavigationUtils'; -import { Key } from 'selenium-webdriver'; - -const isActive = async () => { - const locator = Locators.byDataTestId('appBarTitleId'); - return ScreenUtils.isActive([locator], ROUTES.SEND); -}; - -const hasSufficientFunds = async (token: string) => { - const balanceElement = await extension.driver.findElement( - Locators.byDataTestId(`token-balance-${token}`), - ); - const balanceText = await balanceElement.getText(); - return balanceText.split(' ')[0] != '0'; -}; - -const buildTx = async ( - token: string, - lessThanBalance: boolean, - destinationAddress?: string, -) => { - await extension.driver.waitAndClick( - Locators.byDataTestId(`token-balance-${token}`), - ); - - await extension.driver.waitAndClick( - Locators.byClass('react-select__value-container'), - ); - - await extension.driver.waitAndType( - Locators.byId('searchInput'), - destinationAddress - ? destinationAddress - : '0x435933c8064b4Ae76bE665428e0307eF2cCFBD68', - ); - - const element = await extension.driver.waitUntilElementEnabled( - Locators.byId('searchInput'), - ); - await element.sendKeys(Key.ENTER); - - await extension.driver.waitAndType( - Locators.byId('amountToTransfer'), - lessThanBalance ? '1' : '100000000000', - ); - await extension.driver.waitAndClick(Locators.byDataTestId('sendTokenBtn')); -}; - -const buildAndSendTx = async ( - receiver = '0x435933c8064b4Ae76bE665428e0307eF2cCFBD68', - delegate = false, -) => { - await buildTx('VET', true, receiver); - - if (delegate) await selectAccountDelegation(); - - //Wait for loader screen to disappear - await extension.driver.sleep(1500); - await extension.driver.waitAndClick( - Locators.buttonByName('sendTransactionButton'), - ); - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); - await NavigationUtils.goToExtension(ROUTES.DASHBOARD); -}; - -const submitTx = async () => { - //Wait for loader screen to disappear - await extension.driver.sleep(1500); - await extension.driver.waitAndClick( - Locators.buttonByName('sendTransactionButton'), - ); - await PasswordPrompt.submitPassword(TestDefaults.PASSWORD); - await NavigationUtils.goToExtension(ROUTES.DASHBOARD); -}; - -const isTransferConfirmationShown = async (route: ROUTES) => { - const locator = Locators.byId('sendTokenConfirm'); - return ScreenUtils.isActive([locator], route); -}; - -const isTransferErrorShown = async () => { - return await extension.driver.isElementPresent( - Locators.byClass('input-error'), - ); -}; - -const selectForCrossAccountDelegation = async () => { - const accountRadioId = 'option-ACCOUNT'; - - // Wait for the footer to be rendered in the DOM - await extension.driver.waitUntilElement( - Locators.byClass('spacer-y footer-sticky'), - ); - - await extension.driver.scrollIntoView(accountRadioId); - - await extension.driver.waitAndClick(Locators.byId(accountRadioId)); - await extension.driver.waitAndClick(Locators.byId('account-checkbox-0-2')); -}; - -const selectAccountDelegation = async () => { - const accountRadioId = 'option-ACCOUNT'; - - await extension.driver.scrollIntoView(accountRadioId); - await extension.driver.waitAndClick(Locators.byId(accountRadioId)); - await extension.driver.waitAndClick(Locators.byId('account-checkbox-0-2')); -}; - -export default { - isActive, - hasSufficientFunds, - buildTx, - isTransferConfirmationShown, - isTransferErrorShown, - buildAndSendTx, - selectAccountDelegation, - selectForCrossAccountDelegation, - submitTx, -}; diff --git a/tests/e2e/src/flows/ConnectFlows.ts b/tests/e2e/src/flows/ConnectFlows.ts index 4ba24ea1..95f7dffa 100644 --- a/tests/e2e/src/flows/ConnectFlows.ts +++ b/tests/e2e/src/flows/ConnectFlows.ts @@ -1,9 +1,9 @@ -import ApproveAppScreen from '../extension/screens/connected-app/ApproveAppScreen'; -import ConnectedAppScreen from '../extension/screens/connected-app/ConnectedAppScreen'; +import ApproveFlows from '../extension/flows/ApproveFlows'; import NavigationUtils from '../extension/utils/NavigationUtils'; +import ConnectFlows from '../extension/flows/ConnectFlows'; export const connectDapp = async function (dappUrl: string) { await NavigationUtils.goToUrl(dappUrl); - await ConnectedAppScreen.connectWallet(); - return ApproveAppScreen.approveAndSign(); + await ConnectFlows.connectWallet(); + return ApproveFlows.approveAndSign(); }; diff --git a/tests/e2e/src/steps/extension.ts b/tests/e2e/src/steps/extension.ts index 7ccdd934..db8d8a3f 100644 --- a/tests/e2e/src/steps/extension.ts +++ b/tests/e2e/src/steps/extension.ts @@ -1,10 +1,10 @@ -import { defineStep } from '@cucumber/cucumber'; import assert from 'assert'; -import { DappUrl } from 'constants/dapp'; -import AccessFlows from 'extension/flows/AccessFlows'; -import OnboardingFlows from 'extension/flows/OnboardingFlows'; -import DashboardScreen from 'extension/screens/DashboardScreen'; -import { connectDapp } from 'flows/ConnectFlows'; +import { defineStep } from '@cucumber/cucumber'; +import AccessFlows from '../extension/flows/AccessFlows'; +import OnboardingFlows from '../extension/flows/OnboardingFlows'; +import DashboardFlows from '../extension/flows/DashboardFlows'; +import { connectDapp } from '../flows/ConnectFlows'; +import { DappUrl } from '../constants/dapp'; defineStep('The user has previously onboarded', async function () { await OnboardingFlows.completeOnboarding(); @@ -15,7 +15,7 @@ defineStep('The user has unlocked VeWorld', async function () { }); defineStep('The user should be on the dashboard', async function () { - const isActive = await DashboardScreen.isActive(); + const isActive = await DashboardFlows.isActive(); assert(isActive, 'The user is not on the dashboard'); }); diff --git a/tests/e2e/yarn.lock b/tests/e2e/yarn.lock index a7a92d51..63a12805 100644 --- a/tests/e2e/yarn.lock +++ b/tests/e2e/yarn.lock @@ -10,7 +10,7 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.1": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.1": version "7.24.2" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== @@ -216,6 +216,13 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@cucumber/ci-environment@10.0.0": version "10.0.0" resolved "https://registry.yarnpkg.com/@cucumber/ci-environment/-/ci-environment-10.0.0.tgz#1ad66cc20cad9aefcfe92f4db3553680de2dd365" @@ -367,6 +374,32 @@ wrap-ansi "^8.1.0" wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.5": version "0.3.5" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" @@ -376,7 +409,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== @@ -391,6 +424,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" @@ -569,11 +610,36 @@ which "4.0.0" yargs "17.7.2" +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + "@teppeis/multimaps@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@teppeis/multimaps/-/multimaps-3.0.0.tgz#bb9c3f8d569f589e548586fa0bbf423010ddfdc5" integrity sha512-ID7fosbc50TbT0MK0EG12O+gAP3W3Aa/Pz4DaTtQtEvlc9Odaqi0de+xuZ7Li2GtK4HzEX7IuRWS/JmZLksR3Q== +"@tsconfig/node10@^1.0.7": + version "1.0.10" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.10.tgz#b7ebd3adfa7750628d100594f6726b054d2c33b2" + integrity sha512-PiaIWIoPvO6qm6t114ropMCagj6YAF24j9OkCA2mJDXFnlionEwhsBCJ8yek4aib575BI3OkART/90WsgHgLWw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/chrome@^0.0.262": version "0.0.262" resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.262.tgz#7c188d946da51216a558342637393c998bb85dd2" @@ -629,6 +695,33 @@ resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.15.tgz#f352493638c2f89d706438a19a9eb300b493b506" integrity sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA== +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== + +"@types/istanbul-lib-report@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/jest@^29.5.12": + version "29.5.12" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.12.tgz#7f7dc6eb4cf246d2474ed78744b05d06ce025544" + integrity sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" @@ -646,6 +739,11 @@ dependencies: undici-types "~5.26.4" +"@types/node@^10.3.2": + version "10.17.60" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" + integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== + "@types/node@^18.11.18": version "18.19.26" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.26.tgz#18991279d0a0e53675285e8cf4a0823766349729" @@ -692,6 +790,11 @@ "@types/node" "*" "@types/ssh2-streams" "*" +"@types/stack-utils@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== + "@types/uuid@9.0.1": version "9.0.1" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.1.tgz#98586dc36aee8dacc98cc396dbca8d0429647aa6" @@ -709,6 +812,18 @@ dependencies: "@types/node" "*" +"@types/yargs-parser@*": + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== + +"@types/yargs@^17.0.8": + version "17.0.32" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.32.tgz#030774723a2f7faafebf645f4e5a48371dca6229" + integrity sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog== + dependencies: + "@types/yargs-parser" "*" + "@typescript-eslint/eslint-plugin@^5.30.5", "@typescript-eslint/eslint-plugin@^5.38.1": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" @@ -793,6 +908,22 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" +"@vechain/ethers@^4.0.27-5": + version "4.0.27-5" + resolved "https://registry.yarnpkg.com/@vechain/ethers/-/ethers-4.0.27-5.tgz#2e7d40294b2e14ddf4cf6f6094bbdc871e26e299" + integrity sha512-dR+rTUauPJpqHNBdEgV6Xh+o009uCRPCvN2HWYIAzZP2SvgsPHLxNUzeRbRKhNzz/HC8HjWNvECRxODF88B03Q== + dependencies: + "@types/node" "^10.3.2" + aes-js "3.0.0" + bn.js "^4.4.0" + elliptic "6.5.4" + hash.js "1.1.3" + js-sha3 "0.5.7" + scrypt-js "2.0.4" + setimmediate "1.0.4" + uuid "2.0.1" + xmlhttprequest "1.8.0" + "@vechain/repo-config@https://github.com/vechain/repo-config": version "1.0.1" resolved "https://github.com/vechain/repo-config#41d69124b10f6e0adf2c878294b91eec4b4b5027" @@ -826,6 +957,21 @@ eslint-plugin-unicorn "^43.0.2" prettier-plugin-packagejson "^2.3.0" +acorn-walk@^8.1.1: + version "8.3.2" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" + integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== + +acorn@^8.4.1: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + agent-base@7.1.0, agent-base@^7.0.2, agent-base@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434" @@ -872,6 +1018,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + ansi-styles@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" @@ -927,6 +1078,11 @@ archiver@^5.3.2: tar-stream "^2.2.0" zip-stream "^4.1.0" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + aria-query@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e" @@ -1063,6 +1219,13 @@ async-lock@^1.4.1: resolved "https://registry.yarnpkg.com/async-lock/-/async-lock-1.4.1.tgz#56b8718915a9b68b10fce2f2a9a3dddf765ef53f" integrity sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ== +async-mutex@^0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.2.6.tgz#0d7a3deb978bc2b984d5908a2038e1ae2e54ff40" + integrity sha512-Hs4R+4SPgamu6rSGW8C7cV9gaWUKEHykfzCCvIRuaVv636Ju10ZdeUbvb4TBEW0INuq2DHZqXbK4Nd3yG4RaRw== + dependencies: + tslib "^2.0.0" + async@^3.2.4: version "3.2.5" resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" @@ -1150,6 +1313,11 @@ bcrypt-pbkdf@^1.0.2: dependencies: tweetnacl "^0.14.3" +bignumber.js@^7.2.1: + version "7.2.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" + integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== + bl@^4.0.3: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" @@ -1159,6 +1327,21 @@ bl@^4.0.3: inherits "^2.0.4" readable-stream "^3.4.0" +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +bn.js@^4.11.9, bn.js@^4.4.0: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -1181,6 +1364,11 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + browserslist@^4.22.2: version "4.23.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" @@ -1256,7 +1444,7 @@ capital-case@^1.0.4: tslib "^2.0.3" upper-case-first "^2.0.2" -chalk@4.1.2, chalk@^4.1.2: +chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1278,7 +1466,7 @@ chownr@^1.1.1: resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== -ci-info@^3.3.2: +ci-info@^3.2.0, ci-info@^3.3.2: version "3.9.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== @@ -1400,6 +1588,11 @@ crc32-stream@^4.0.2: crc-32 "^1.2.0" readable-stream "^3.4.0" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.0: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1493,6 +1686,11 @@ detect-newline@^4.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-4.0.1.tgz#fcefdb5713e1fb8cb2839b8b6ee22e6716ab8f23" integrity sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog== +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + diff@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" @@ -1558,6 +1756,19 @@ electron-to-chromium@^1.4.668: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.711.tgz#f9fd04007878cc27ac327d5c6ce300f8b516f635" integrity sha512-hRg81qzvUEibX2lDxnFlVCHACa+LtrCPIsWAxo161LDYIB3jauf57RGsMZV9mvGwE98yGH06icj3zBEoOkxd/w== +elliptic@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -1770,6 +1981,11 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + eslint-config-prettier@^8.5.0: version "8.10.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11" @@ -2040,6 +2256,17 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +expect@^29.0.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== + dependencies: + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2317,7 +2544,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@4.2.11, graceful-fs@^4.2.0, graceful-fs@^4.2.4: +graceful-fs@4.2.11, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -2373,6 +2600,22 @@ has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: dependencies: has-symbols "^1.0.3" +hash.js@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" @@ -2380,6 +2623,15 @@ hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: dependencies: function-bind "^1.1.2" +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + hosted-git-info@^2.1.4: version "2.8.9" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" @@ -2693,11 +2945,68 @@ jackspeak@^2.3.5: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + dependencies: + chalk "^4.0.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.3" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jju@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" integrity sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA== +js-sha3@0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -2873,6 +3182,11 @@ luxon@3.2.1: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.2.1.tgz#14f1af209188ad61212578ea7e3d518d18cee45f" integrity sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg== +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" @@ -2903,6 +3217,16 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -3169,7 +3493,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.3.1: +picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -3199,6 +3523,15 @@ prettier-plugin-packagejson@^2.3.0: sort-package-json "2.8.0" synckit "0.9.0" +pretty-format@^29.0.0, pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -3272,6 +3605,11 @@ react-is@^16.13.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" @@ -3433,6 +3771,13 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rlp@^2.0.0: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -3481,6 +3826,11 @@ safer-buffer@~2.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +scrypt-js@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" + integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== + seed-random@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/seed-random/-/seed-random-2.2.0.tgz#2a9b19e250a817099231a5b99a4daf80b7fbed54" @@ -3541,6 +3891,11 @@ set-function-name@^2.0.1, set-function-name@^2.0.2: functions-have-names "^1.2.3" has-property-descriptors "^1.0.2" +setimmediate@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" + integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -3669,6 +4024,13 @@ ssh2@^1.11.0, ssh2@^1.4.0: cpu-features "~0.0.9" nan "^2.18.0" +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + stackframe@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.3.4.tgz#b881a004c8c149a5e8efef37d51b16e412943310" @@ -3920,6 +4282,19 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" +thor-devkit@2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/thor-devkit/-/thor-devkit-2.0.5.tgz#1cdd6d623f755e82aacf27290624372bfe6d1b90" + integrity sha512-82Z0/sY0+S54bhmg57r7iqoK7sJB1F5md3zWXjXXGPin3ejsR0Whw1O9wzWvE0DkTp1EiPHWFMTPtOejxaiXeA== + dependencies: + "@vechain/ethers" "^4.0.27-5" + bignumber.js "^7.2.1" + blakejs "^1.1.0" + elliptic "6.5.4" + fast-json-stable-stringify "^2.0.0" + js-sha3 "0.5.7" + rlp "^2.0.0" + tiny-case@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tiny-case/-/tiny-case-1.0.3.tgz#d980d66bc72b5d5a9ca86fb7c9ffdb9c898ddd03" @@ -3964,6 +4339,25 @@ trim-repeated@^1.0.0: dependencies: escape-string-regexp "^1.0.2" +ts-node@^10.9.2: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -3979,7 +4373,7 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.6.2: +tslib@^2.0.0, tslib@^2.0.3, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -4060,6 +4454,11 @@ typed-array-length@^1.0.5: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" +typescript@4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" @@ -4112,6 +4511,11 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== +uuid@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" + integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== + uuid@9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" @@ -4122,6 +4526,11 @@ uuid@9.0.1: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -4258,6 +4667,11 @@ xmlbuilder@^15.1.1: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5" integrity sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg== +xmlhttprequest@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" + integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -4296,6 +4710,11 @@ yargs@17.7.2: y18n "^5.0.5" yargs-parser "^21.1.1" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yup@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/yup/-/yup-1.2.0.tgz#9e51af0c63bdfc9be0fdc6c10aa0710899d8aff6"