-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* taquito version bump (#829) * 15.5.5 * TW-391 Changed Skip Ad button on advertisement (#834) * TW-320: Manifest v3 JSON (#807) * TW-317: Abandon XMLHttpRequest in BG. Applied axios fetch adapter. * TW-317: Abandon XMLHttpRequest in BG. Fix BG test * TW-312: Eliminate 'window' reliance in BG script. Resolving 'regenerator-runtime' package version. * TW-312: Eliminate 'window' in BG. Refactored 'is-lock-up' setting * TW-312: Eliminate 'window' in BG. Refactored 'lock-up' feature for MV3 * TW-312: Eliminate 'window' in BG. Refactored 'locale' storing * TW-312: Eliminate 'window' in BG. Refactored 'Vault.spawn' * TW-312: Eliminate 'window' in BG. Refactored 'vault.ts>createLedgerSigner()' * TW-312: Eliminate 'window' in BG. Eliminated LedgerSigner creation to foreground * Merge branch 'development' into TW-312-eliminate-window-in-bg * TW-312: Eliminate 'window' in BG. Refactor * TW-320: Manifest v3 JSON. Edited manifest.json * TW-312: Eliminate 'window' in BG. Fix for lost 'no-use-before-define' rule follow * TW-312: Eliminate 'window' in BG. Fix: removed Intercom server instance from FG * TW-312: Eliminate 'window' in BG. + IDs to TempleLedgerSignerProxy instances * TW-312: Eliminate 'window' in BG. Refactor * TW-317: Abandon XMLHttpRequest in BG. Merged from 'development' branch * TW-312: Eliminate 'window' in BG. Ledger rework. Fix for ledger-bridge's <iframe> interraction * WIP: TW-312: Eliminate 'window' in BG. Ledger rework. Ledger bridge written locally * TW-312: Eliminate 'window' in BG. Ledger rework. Ledger bridge written locally * WIP: TW-317: Abandon XMLHttpRequest in BG. Updated '@taquito/*' to v14.1.0 * TW-317: Abandon XMLHttpRequest in BG. ++ '@taquito/*' * TW-312: Eliminate 'window' in BG. Ledger rework. Fix. LedgerHQ updated * TW-312: Eliminate 'window' in BG. Ledger rework. Fix. LedgerHQ updated * WIP: TW-320: Manifest v3 JSON. WebPack rework * WIP: TW-320: Manifest v3 JSON. WebPack rework * TW-320: Manifest v3 JSON. WebPack rework. Linted * TW-320: Manifest v3 JSON. WebPack rework. Refactor * TW-320: Manifest v3 JSON. WebPack rework. Clean-up fix. * TW-320: Manifest v3 JSON. WebPack rework. TypeScript * TW-320: Manifest v3 JSON. WebPack rework. package.json:version > manifest.json:version * TW-319: Manifest v3. Keep v2 for Firefox * TW-312: Eliminate 'window' in BG. Ledger rework. Dynamic import for ledger-bridge iframe module * WIP: TW-310: Manifest v3. Fix disconnecting Intercom port * TW-312: Eliminate 'window' in BG. Ledger rework. Refactor * TW-312: Eliminate 'window' in BG. Ledger rework. Fix for 'ledger-live in popup window' case * TW-312: Eliminate 'window' in BG. Ledger rework. Refactor * TW-312: Eliminate 'window' in BG. Removed console.log * TW-320: Manifest v3 JSON. WebPack rework. + Definition for 'process.env.MANIFEST_VERSION' * TW-320: Manifest v3 JSON. WebPack rework. Fix for BG script path in MV2 * TW-320: Manifest v3 JSON. WebPack rework. Fix for BG script chunks * TW-310: Manifest v3. Fix disconnecting Intercom port * WIP: TW-310: Manifest v3. Prolong SW lifetime * TW-310: Manifest v3. Prolong SW lifetime. + scripts/keepBackgroundWorkerAlive.js * TW-310: Manifest v3. Prolong SW lifetime. Refactor * TW-312: Eliminate 'window' in BG. Ledger rework. Fix for WebAuthn transport on MV2 * TW-320: Manifest v3 JSON. WebPack rework. + 'safari' vendor * TW-312: Eliminate 'window' in BG. Ledger rework. Fix for Firefox multiple tabs on WebAuthn * TW-312: Eliminate 'window' in BG. Ledger rework. Fix for duplicate 'ledgerlive://bridge' tabs opening * Merge branch 'TW-312-eliminate-window-in-bg' into TW-320-manifest-v3 * TW-312: Eliminate 'window' in BG. Ledger rework. Fix for recurring Ledger Live bridge open fail * TW-312: Eliminate 'window' in BG. Ledger rework. Fix for recurring Ledger Live bridge open fail * TW-312: Eliminate 'window' in BG. Ledger rework. ++ ledger-live.utils * TW-320: Manifest v3 JSON. Refactor * TW-320: Manifest v3 JSON. Fix dev live reload * TW-320: Manifest v3 JSON. WebPack rework. Refactor * TW-320: Manifest v3 JSON. WebPack rework. Fix dev pages reloader * TW-320: Manifest v3 JSON. WebPack rework. + Custom dev pages reloader * TW-320: Manifest v3 JSON. WebPack rework. Exports in ES6 * TW-320: Manifest v3 JSON. WebPack rework. Refactor * TW-320: Manifest v3 JSON. Keeping BG worker alive from extension pages too * TW-320: Manifest v3 JSON. BG, Vault. + Saving session (password hash) * TW-320: Manifest v3 JSON. Fix for 'lock-enabled' feature * TW-320: Manifest v3 JSON. Refactor lib/temple/back/vault (#827) * TW-320: Manifest v3 JSON. Not keeping BG worker alive (#831) * TW-320: Manifest v3 JSON. Refactor * TW-320: Manifest v3 JSON. + Reset of 'browser.sstorage.session' * TW-320: Manifest v3 JSON. Fix for WASM file loading in BG worker * TW-320: Manifest v3 JSON. Refactor * TW-427: Data URI for assets' icons (#839) * TW-427: Data URI for assets' icons. Support at add asset * TW-427: Data URI for assets' icons. Support at displaying icons * TW-427: Data URI for assets' icons. + Fix for decimals display in AssetInfo component * TW-392 Improved search assets (#835) * TW-392 Improved search assets * TW-392 Deleted console.logs * TW-392 Deleted console.logs * TW-392 Filtered assets harder * TW-382: Utorg buy. Rate & min-max correction (#823) * TW-382: Utorg buy. Rate & min-max correction * TW-382: Utorg buy. Rate & min-max correction. Made Currency.network optional * TW-382: Utorg buy. Rate & min-max correction. + 'app/templates/TopUpInput' * TW-382: Utorg buy. Rate & min-max correction. Rate loaded for no less then minAmount * TW-382: Utorg buy. Rate & min-max correction. Fix Alice-Bob top-up rate value * TW-382: Utorg buy. Rate & min-max correction. Refactor * TW406+407: [e2e] Setup pupeeteer + 'Import existing wallet' test (#822) * basicTest+pupeeteer * link test id fixed * duplicate page fix * envs setup + import existing wallet test * envs setup + import existing wallet test * Merge branch 'development' into e2e-setup * [e2e] Setup. Refactor. '/extension-e2e' -> '/e2e' (#832) * [e2e] Setup. Refactor. Fix for secrets setup * TW406+407: [e2e] Setup. + Job to pipeline (#838) * [e2e] Setup. + Job to pipeline * [e2e] Setup. Pipeline. Run with Xvfb * [e2e] Setup. Pipeline. Run with Xvfb. Secrets mock * [e2e] Setup. Pipeline. Run with 'mujo-code/puppeteer-headful' * [e2e] Setup. Pipeline. Gave up 'mujo-code/puppeteer-headful' * [e2e] Setup. Pipeline. Secrets mocks clean-up * TW-406: [e2e] Setup. GitHub workflow. Fix unit tests * TW-406: [e2e] Setup. Throwing on missing secrets * TestIDProps is extended Co-authored-by: Andrii Ivaniv <[email protected]> Co-authored-by: alex-seleznov <[email protected]> Co-authored-by: Alex <[email protected]> * TW-438: Issue #774. Confirm window not showing in dApps (#840) * TW-438: Issue #774. Confirm window not showing in dApps * TW-438: Issue #774. Confirm window not showing in dApps. Refactor * 1.16.0 * TW-439: Fix Plenty images (#841) * TW-439: Fix Plenty images. Trying all sizes now * TW-439: Fix Plenty images. Fix icons in 'select asset' field on 'Send page' Co-authored-by: Dmytro Herko <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: Vlad <[email protected]> Co-authored-by: alex-seleznov <[email protected]>
- Loading branch information
1 parent
90d1255
commit 553b12b
Showing
148 changed files
with
4,851 additions
and
2,511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
TEMPLE_WALLET_LEDGER_BRIDGE_URL = https://templewallet.com/ledger-bridge-v2.0.1 | ||
TEMPLE_WALLET_LOGO_URL = https://templewallet.com/logo.png | ||
TEMPLE_WALLET_SEGMENT_WRITE_KEY = N1pFDJgp6ZJ6s5zfTM0cDhUWWhnE1TkS | ||
TEMPLE_WALLET_EXOLIX_API_KEY = | ||
TEMPLE_WALLET_EVERSTAKE_API_KEY = | ||
TEMPLE_WALLET_EVERSTAKE_LINK_ID = | ||
TEMPLE_WALLET_UTORG_SID = | ||
TEMPLE_WALLET_EVERSTAKE_API_KEY = | ||
TEMPLE_WALLET_EVERSTAKE_LINK_ID = | ||
TEMPLE_WALLET_UTORG_SID = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: End-to-end tests | ||
|
||
description: Prepares and runs e2e tests | ||
|
||
inputs: | ||
DEFAULT_SEED_PHRASE: | ||
required: true | ||
DEFAULT_PASSWORD: | ||
required: true | ||
DEFAULT_HD_ACCOUNT_PRIVATE_KEY: | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- working-directory: ./e2e | ||
shell: bash | ||
run: yarn install | ||
|
||
- name: Secrets setup | ||
working-directory: ./e2e | ||
shell: bash | ||
run: | | ||
cat << EOF > .env | ||
DEFAULT_SEED_PHRASE=${{ inputs.DEFAULT_SEED_PHRASE }} | ||
DEFAULT_PASSWORD=${{ inputs.DEFAULT_PASSWORD }} | ||
DEFAULT_HD_ACCOUNT_PRIVATE_KEY=${{ inputs.DEFAULT_HD_ACCOUNT_PRIVATE_KEY }} | ||
EOF | ||
- name: Run tests | ||
working-directory: ./e2e | ||
shell: bash | ||
env: | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true' | ||
CI: 'true' | ||
run: | | ||
export DISPLAY=:99 | ||
chromedriver --url-base=/wd/hub & | ||
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional | ||
yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DEFAULT_SEED_PHRASE= | ||
DEFAULT_PASSWORD= | ||
DEFAULT_HD_ACCOUNT_PRIVATE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"default": { | ||
"paths": ["src/features/**/*.feature"], | ||
"require": ["src/**/*.ts"], | ||
"requireModule": ["ts-node/register"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "temple-wallet-extension-e2e", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "./node_modules/.bin/cucumber-js", | ||
"start:dev": "yarn start --tags @dev", | ||
"test": "yarn start --exit", | ||
"ts": "tsc --pretty" | ||
}, | ||
"dependencies": { | ||
"@cucumber/cucumber": "^8.7.0", | ||
"puppeteer": "^19.4.0", | ||
"ts-node": "^10.9.1", | ||
"dotenv": "^16.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Browser, Page } from 'puppeteer'; | ||
|
||
import { getEnv } from '../utils/env.utils'; | ||
|
||
const defaultSeedPhrase = getEnv('DEFAULT_SEED_PHRASE'); | ||
const defaultPassword = getEnv('DEFAULT_PASSWORD'); | ||
const defaultPrivateKey = getEnv('DEFAULT_HD_ACCOUNT_PRIVATE_KEY'); | ||
|
||
if (!defaultSeedPhrase) throw new Error('process.env.DEFAULT_SEED_PHRASE not found.'); | ||
if (!defaultPassword) throw new Error('process.env.DEFAULT_PASSWORD not found.'); | ||
|
||
export class BrowserContext { | ||
public static browser: Browser; | ||
public static page: Page; | ||
public static seedPhrase = defaultSeedPhrase; | ||
public static password = defaultPassword; | ||
public static privateKey = defaultPrivateKey; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export abstract class Page { | ||
abstract isVisible(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Feature: Import existing wallet | ||
@dev | ||
Scenario: As a user, I'd like to import account with existing seed phrase | ||
Given I am on the Welcome page | ||
And I press Import Existing Wallet button on the Welcome page | ||
|
||
And I am on the ImportExistingWallet page | ||
And I enter my mnemonic | ||
And I press Next button on the Import Existing Seed Phrase page | ||
|
||
And I am on the SetWallet page | ||
And I enter password into Password Field on the Register Form page | ||
And I enter password into Repeat Password Field on the Register Form page | ||
And I press Skip Onboarding Checkbox on the Register Form page | ||
And I press Accept Terms Checkbox on the Register Form page | ||
And I press Import Button on the Register Form page | ||
|
||
Then I am on the Header page | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { AfterAll } from '@cucumber/cucumber'; | ||
|
||
import { BrowserContext } from '../classes/browser-context.class'; | ||
|
||
AfterAll(async () => { | ||
await BrowserContext.browser.close(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { BeforeAll } from '@cucumber/cucumber'; | ||
|
||
import { initBrowserContext } from '../utils/browser-context.utils'; | ||
import { initBrowser } from '../utils/browser.utils'; | ||
|
||
const LONG_TIMEOUT = 20 * 1000; | ||
BeforeAll({ timeout: LONG_TIMEOUT }, async () => { | ||
const browser = await initBrowser(); | ||
|
||
const [blankPage] = await browser.pages(); | ||
await blankPage.goto('https://www.google.com/'); | ||
await blankPage.close(); | ||
|
||
await initBrowserContext(browser); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Before } from '@cucumber/cucumber'; | ||
|
||
import { BrowserContext } from '../classes/browser-context.class'; | ||
|
||
Before(async () => { | ||
await BrowserContext.page.evaluate(() => void localStorage.clear()); | ||
await BrowserContext.page.reload(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { HeaderPage } from './pages/header.page'; | ||
import { ImportExistingWalletPage } from './pages/importing-existing-wallet.page'; | ||
import { setWalletPage } from './pages/setWalletPassword.page'; | ||
import { WelcomePage } from './pages/welcome.page'; | ||
|
||
export const Pages = { | ||
Welcome: new WelcomePage(), | ||
ImportExistingWallet: new ImportExistingWalletPage(), | ||
SetWallet: new setWalletPage(), | ||
Header: new HeaderPage() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { HeaderSelectors } from '../../../../src/app/layouts/PageLayout/Header.selectors'; | ||
import { Page } from '../../classes/page.class'; | ||
import { createPageElement } from '../../utils/search.utils'; | ||
|
||
export class HeaderPage extends Page { | ||
accountIconButton = createPageElement(HeaderSelectors.AccountIcon); | ||
templeLogoButton = createPageElement(HeaderSelectors.TempleLogo); | ||
|
||
async isVisible() { | ||
await this.accountIconButton.waitForDisplayed(); | ||
await this.templeLogoButton.waitForDisplayed(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
e2e/src/page-objects/pages/importing-existing-wallet.page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ImportFromSeedPhraseTestIds } from '../../../../src/app/pages/NewWallet/import/ImportSeedPhrase/ImportFromSeedPhrase.test-ids'; | ||
import { Page } from '../../classes/page.class'; | ||
import { createPageElement, findElements } from '../../utils/search.utils'; | ||
|
||
export class ImportExistingWalletPage extends Page { | ||
nextButton = createPageElement(ImportFromSeedPhraseTestIds.nextButton); | ||
wordInput = createPageElement(ImportFromSeedPhraseTestIds.wordInput); | ||
|
||
async isVisible() { | ||
await this.nextButton.waitForDisplayed(); | ||
await this.wordInput.waitForDisplayed(); | ||
} | ||
async getWordsInputs() { | ||
return findElements(ImportFromSeedPhraseTestIds.wordInput); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { setWalletPasswordTestIDS } from '../../../../src/app/pages/NewWallet/setWalletPassword/SetWalletPassword.test-ids'; | ||
import { Page } from '../../classes/page.class'; | ||
import { createPageElement } from '../../utils/search.utils'; | ||
|
||
export class setWalletPage extends Page { | ||
passwordField = createPageElement(setWalletPasswordTestIDS.passwordField); | ||
repeatPasswordField = createPageElement(setWalletPasswordTestIDS.repeatPasswordField); | ||
skipOnboarding = createPageElement(setWalletPasswordTestIDS.skipOnboardingCheckbox); | ||
acceptTerms = createPageElement(setWalletPasswordTestIDS.acceptTermsCheckbox); | ||
importButton = createPageElement(setWalletPasswordTestIDS.importButton); | ||
|
||
async isVisible() { | ||
await this.passwordField.waitForDisplayed(); | ||
await this.repeatPasswordField.waitForDisplayed(); | ||
await this.skipOnboarding.waitForDisplayed(); | ||
await this.acceptTerms.waitForDisplayed(); | ||
await this.importButton.waitForDisplayed(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { WelcomeTestIds } from '../../../../src/app/pages/Welcome/Welcome.test-ids'; | ||
import { Page } from '../../classes/page.class'; | ||
import { createPageElement } from '../../utils/search.utils'; | ||
|
||
export class WelcomePage extends Page { | ||
createNewWalletButton = createPageElement(WelcomeTestIds.createNewWallet); | ||
importExistingWalletButton = createPageElement(WelcomeTestIds.importExistingWallet); | ||
|
||
async isVisible() { | ||
await this.createNewWalletButton.waitForDisplayed(); | ||
await this.importExistingWalletButton.waitForDisplayed(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Given } from '@cucumber/cucumber'; | ||
|
||
import { Pages } from '../page-objects'; | ||
import { getInputText } from '../utils/input.utils'; | ||
import { createPageElement } from '../utils/search.utils'; | ||
import { enterMyMnemonicStep } from '../utils/shared-steps.utils'; | ||
|
||
Given(/^I am on the (\w+) page$/, async (page: keyof typeof Pages) => { | ||
await Pages[page].isVisible(); | ||
}); | ||
|
||
Given(/I press (.*) on the (.*) page/, async (elementName: string, pageName: string) => { | ||
await createPageElement(`${pageName}/${elementName}`).click(); | ||
}); | ||
|
||
Given(/I enter my mnemonic/, async () => { | ||
await enterMyMnemonicStep(); | ||
}); | ||
|
||
Given( | ||
/I enter (seed|password) into (.*) on the (.*) page/, | ||
async (inputType: string, elementName: string, pageName: string) => { | ||
const inputText = getInputText(inputType); | ||
|
||
await createPageElement(`${pageName}/${elementName}`).type(inputText); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Browser } from 'puppeteer'; | ||
|
||
import { BrowserContext } from '../classes/browser-context.class'; | ||
|
||
export const initBrowserContext = async (browser: Browser) => { | ||
const [page] = await browser.pages(); | ||
|
||
BrowserContext.browser = browser; | ||
BrowserContext.page = page; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import path from 'path'; | ||
import { launch } from 'puppeteer'; | ||
|
||
const EXTENSION_PATH = path.resolve(__dirname, '../../../dist/chrome_unpacked'); | ||
|
||
export const initBrowser = () => | ||
launch({ | ||
headless: false, | ||
args: [`--disable-extensions-except=${EXTENSION_PATH}`, `--load-extension=${EXTENSION_PATH}`] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as dotenv from 'dotenv'; | ||
|
||
dotenv.config(); | ||
|
||
export const getEnv = (key: string) => process.env[key] ?? ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { BrowserContext } from '../classes/browser-context.class'; | ||
|
||
export const getInputText = (inputType: string) => { | ||
let inputText = ''; | ||
|
||
switch (inputType) { | ||
case 'seed': | ||
inputText = BrowserContext.seedPhrase; | ||
break; | ||
case 'password': | ||
inputText = BrowserContext.password; | ||
break; | ||
} | ||
|
||
return inputText; | ||
}; |
Oops, something went wrong.