-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loading cache into browser for tests
- Loading branch information
1 parent
acdf38c
commit 68a6094
Showing
9 changed files
with
117 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
128 changes: 66 additions & 62 deletions
128
wallets/keplr/src/pages/LockPage/actions/importWallet.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 |
---|---|---|
@@ -1,73 +1,77 @@ | ||
import { playwright } from "../../../playwright-kepler"; | ||
import { onboardingElements } from "../selectors"; | ||
// import { playwright } from "../../../playwright-kepler"; | ||
// import { onboardingElements } from "../selectors"; | ||
import type { Page } from "@playwright/test"; | ||
|
||
export async function importWallet(secretWords: string, password: string) { | ||
await playwright.waitAndClickByText( | ||
onboardingElements.createWalletButton, | ||
await playwright.keplrWindow(), | ||
); | ||
await playwright.waitAndClickByText( | ||
onboardingElements.importRecoveryPhraseButton, | ||
await playwright.keplrWindow(), | ||
); | ||
await playwright.waitAndClickByText( | ||
onboardingElements.useRecoveryPhraseButton, | ||
await playwright.keplrWindow(), | ||
); | ||
await playwright.waitAndClickByText( | ||
onboardingElements.phraseCount24, | ||
await playwright.keplrWindow(), | ||
); | ||
export async function importWallet(page: Page, secretWords: string, password: string) { | ||
|
||
for (const [index, word] of secretWords.split(' ').entries()) { | ||
await playwright.waitAndTypeByLocator( | ||
onboardingElements.textAreaSelector, | ||
word, | ||
index, | ||
); | ||
} | ||
await page.waitForSelector('button.submit-button'); | ||
console.log(secretWords, password) | ||
Check failure Code scanning / CodeQL Clear-text logging of sensitive information High
This logs sensitive data returned by
an access to password Error loading related location Loading This logs sensitive data returned by an access to password Error loading related location Loading This logs sensitive data returned by an access to password Error loading related location Loading |
||
// await playwright.waitAndClickByText( | ||
// onboardingElements.createWalletButton, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
// await playwright.waitAndClickByText( | ||
// onboardingElements.importRecoveryPhraseButton, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
// await playwright.waitAndClickByText( | ||
// onboardingElements.useRecoveryPhraseButton, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
// await playwright.waitAndClickByText( | ||
// onboardingElements.phraseCount24, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
|
||
await playwright.waitAndClick( | ||
onboardingElements.submitPhraseButton, | ||
await playwright.keplrWindow(), | ||
); | ||
// for (const [index, word] of secretWords.split(' ').entries()) { | ||
// await playwright.waitAndTypeByLocator( | ||
// onboardingElements.textAreaSelector, | ||
// word, | ||
// index, | ||
// ); | ||
// } | ||
|
||
await playwright.waitAndType( | ||
onboardingElements.walletInput, | ||
onboardingElements.walletName, | ||
); | ||
await playwright.waitAndType(onboardingElements.passwordInput, password); | ||
await playwright.waitAndType( | ||
onboardingElements.confirmPasswordInput, | ||
password, | ||
); | ||
// await playwright.waitAndClick( | ||
// onboardingElements.submitPhraseButton, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
|
||
await playwright.waitAndClick( | ||
onboardingElements.submitWalletDataButton, | ||
await playwright.keplrWindow(), | ||
{ number: 1 }, | ||
); | ||
// await playwright.waitAndType( | ||
// onboardingElements.walletInput, | ||
// onboardingElements.walletName, | ||
// ); | ||
// await playwright.waitAndType(onboardingElements.passwordInput, password); | ||
// await playwright.waitAndType( | ||
// onboardingElements.confirmPasswordInput, | ||
// password, | ||
// ); | ||
|
||
await playwright.waitForByText( | ||
onboardingElements.phraseSelectChain, | ||
await playwright.keplrWindow(), | ||
); | ||
// await playwright.waitAndClick( | ||
// onboardingElements.submitWalletDataButton, | ||
// await playwright.keplrWindow(), | ||
// { number: 1 }, | ||
// ); | ||
|
||
await playwright.waitAndClick( | ||
onboardingElements.submitChainButton, | ||
await playwright.keplrWindow(), | ||
); | ||
// await playwright.waitForByText( | ||
// onboardingElements.phraseSelectChain, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
|
||
await playwright.waitForByText( | ||
onboardingElements.phraseAccountCreated, | ||
await playwright.keplrWindow(), | ||
); | ||
// await playwright.waitAndClick( | ||
// onboardingElements.submitChainButton, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
|
||
await playwright.waitAndClick( | ||
onboardingElements.finishButton, | ||
await playwright.keplrWindow(), | ||
{ dontWait: true }, | ||
); | ||
// await playwright.waitForByText( | ||
// onboardingElements.phraseAccountCreated, | ||
// await playwright.keplrWindow(), | ||
// ); | ||
|
||
return true; | ||
// await playwright.waitAndClick( | ||
// onboardingElements.finishButton, | ||
// await playwright.keplrWindow(), | ||
// { dontWait: true }, | ||
// ); | ||
|
||
// return true; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { testWithSynpress } from "@synthetixio/synpress-core"; | ||
import { keplrFixtures } from "../src"; | ||
import connectedSetup from "./wallet-setup/connected.setup"; | ||
import connectedSetup from "./wallet-setup/connected-keplr.setup"; | ||
|
||
export default testWithSynpress(keplrFixtures(connectedSetup)) |
13 changes: 10 additions & 3 deletions
13
...eplr/test/wallet-setup/connected.setup.ts → ...est/wallet-setup/connected-keplr.setup.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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { defineWalletSetup } from "@synthetixio/synpress-cache"; | ||
import { KeplrWallet } from "../../src"; | ||
import { getExtensionId } from "../../src/fixtureActions"; | ||
import { getExtensionId, prepareExtension } from "../../src/fixtureActions"; | ||
|
||
const SEED_PHRASE = 'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology' | ||
const PASSWORD = 'Test1234' | ||
|
||
export default defineWalletSetup(PASSWORD, async (context, lockPage) => { | ||
await prepareExtension() | ||
console.log('Extension', context) | ||
const extensionId = await getExtensionId(context, 'keplr') | ||
const keplr = new KeplrWallet(lockPage, context, PASSWORD, extensionId) | ||
|
||
await keplr.importWallet(SEED_PHRASE, PASSWORD) | ||
console.log('SEEDP', SEED_PHRASE, PASSWORD) | ||
const page = await context.newPage() | ||
await page.goto(`chrome-extension://${extensionId}/home.html`) | ||
const wallet = await keplr.setupWallet(page, { secretWordsOrPrivateKey: SEED_PHRASE, password: PASSWORD}) | ||
console.log('in here2', wallet) | ||
// const page = await context.newPage() | ||
// await page.close() | ||
}) |