-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
115 additions
and
47 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
33 changes: 12 additions & 21 deletions
33
wallets/keplr/src/pages/HomePage/actions/getWalletAddress.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,25 +1,16 @@ | ||
import type { Page } from '@playwright/test'; | ||
import { homePageElements } from '../selectors'; | ||
|
||
export const getWalletAddress = async (page: Page) => { | ||
console.log('getWalletAddress', page); | ||
// return await playwright.waitAndGetValue(homePageElements.walletAddress); | ||
// playwright.switchToKeplrWindow(); | ||
// await module.exports.goToHome(); | ||
// const newTokensSelctorExists = | ||
// await playwright.waitForAndCheckElementExistence( | ||
// homePageElements.newTokensFoundSelector, | ||
// ); | ||
|
||
// if (newTokensSelctorExists) { | ||
// await module.exports.addNewTokensFound(false); | ||
// } | ||
|
||
// await playwright.waitAndClickByText(notificationPageElements.copyAddress); | ||
// await playwright.waitAndClick( | ||
// notificationPageElements.walletSelectors(chainName), | ||
// ); | ||
|
||
// walletAddress = clipboardy.readSync(); | ||
// await playwright.switchToCypressWindow(); | ||
// return walletAddress; | ||
await page.waitForLoadState('domcontentloaded'); | ||
console.log(3) | ||
const newTokensFoundSelector = await page.waitForSelector(homePageElements.newTokensFoundSelector); | ||
console.log('New tokens found', newTokensFoundSelector); | ||
if (newTokensFoundSelector) { | ||
await page.waitForSelector(homePageElements.newTokensFoundSelector); | ||
} | ||
await page.waitForSelector(homePageElements.copyAddress); | ||
const walletAddress = await page.click(homePageElements.copyAddress); | ||
console.log('Wallet address copied', walletAddress); | ||
return walletAddress; | ||
} |
13 changes: 13 additions & 0 deletions
13
wallets/keplr/src/pages/HomePage/selectors/NotificationPage/actions/acceptAccess.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,13 @@ | ||
|
||
import { notificationPageElements } from '../selectors'; | ||
|
||
export const acceptAccess = async () => { | ||
console.log('Accepting access in Keplr wallet', notificationPageElements); | ||
// const notificationPage = await playwright.switchToKeplrNotification(); | ||
// await playwright.waitAndClick( | ||
// notificationPageElements.approveButton, | ||
// notificationPage, | ||
// { waitForEvent: 'close' }, | ||
// ); | ||
// return true; | ||
} |
12 changes: 12 additions & 0 deletions
12
wallets/keplr/src/pages/HomePage/selectors/NotificationPage/actions/confirmAccess.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,12 @@ | ||
import { notificationPageElements } from "../selectors"; | ||
|
||
export const confirmTransaction = async () => { | ||
console.log('Confirming transaction in Keplr wallet', notificationPageElements) | ||
// const notificationPage = await playwright.switchToKeplrNotification(); | ||
// await playwright.waitAndClick( | ||
// notificationPageElements.approveButton, | ||
// notificationPage, | ||
// { waitForEvent: 'close' }, | ||
// ); | ||
return true; | ||
} |
2 changes: 2 additions & 0 deletions
2
wallets/keplr/src/pages/HomePage/selectors/NotificationPage/actions/index.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,2 @@ | ||
export * from './acceptAccess'; | ||
export * from './confirmAccess'; |
22 changes: 22 additions & 0 deletions
22
wallets/keplr/src/pages/HomePage/selectors/NotificationPage/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,22 @@ | ||
import type { Page } from '@playwright/test' | ||
import { notificationPageElements } from './selectors' | ||
import { confirmTransaction, acceptAccess } from './actions' | ||
|
||
export class NotificationPage { | ||
static readonly selectors = notificationPageElements | ||
readonly selectors = notificationPageElements | ||
|
||
readonly page: Page | ||
|
||
constructor(page: Page) { | ||
this.page = page | ||
} | ||
|
||
async confirmTransaction() { | ||
await confirmTransaction() | ||
} | ||
|
||
async acceptAccess() { | ||
await acceptAccess() | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
wallets/keplr/src/pages/HomePage/selectors/NotificationPage/selectors/index.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,5 @@ | ||
export const notificationPageElements = { | ||
approveButton: 'button', | ||
copyAddress: 'Copy Address', | ||
walletSelectors: (chainName: string) => `img[alt="${chainName}"]`, | ||
}; |
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 was deleted.
Oops, something went wrong.
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 test from '../synpress' | ||
const { expect } = test | ||
|
||
test.only('should get address', async ({ page, keplr }) => { | ||
console.log('page', page, keplr) | ||
expect(await keplr.getWalletAddress(page)).toBeTruthy() | ||
}) |
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,9 @@ | ||
export declare const SEED_PHRASE = 'test test test test test test test test test test test junk' | ||
export declare const PASSWORD = 'Tester@1234' | ||
declare const _default: { | ||
hash: string | ||
fn: import('@synthetixio/synpress-cache').WalletSetupFunction | ||
walletPassword: string | ||
} | ||
export default _default | ||
//# sourceMappingURL=basic.setup.d.ts.map |