Skip to content

Commit

Permalink
Merge pull request #104 from lidofinance/wallets-fixes
Browse files Browse the repository at this point in the history
Wallets update
  • Loading branch information
skhomuti authored Nov 2, 2023
2 parents 47dda82 + 6cbdd35 commit 8437e45
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 141 deletions.
10 changes: 0 additions & 10 deletions packages/wallets/src/gamestop/gamestop.constants.ts

This file was deleted.

97 changes: 0 additions & 97 deletions packages/wallets/src/gamestop/gamestop.page.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/wallets/src/gamestop/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/wallets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export * from './phantom';
export * from './coinbase';
export * from './taho';
export * from './exodus';
export * from './gamestop';
export * from './xdefi';
export * from './okx';
export * from './bitget';
40 changes: 17 additions & 23 deletions packages/wallets/src/metamask/metamask.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ export class MetamaskPage implements WalletPage {
this.page = await this.browserContext.newPage();
await this.page.goto(
this.extensionUrl + this.config.COMMON.EXTENSION_START_PATH,
{ waitUntil: 'load' },
);
await this.page.reload();
await this.page.waitForTimeout(1000);
await this.closePopover();
await this.unlock();
});
Expand All @@ -28,20 +27,12 @@ export class MetamaskPage implements WalletPage {
async setup() {
await test.step('Setup', async () => {
// added explicit route to #onboarding due to unexpected first time route from /home.html to /onboarding - page is close
this.page = await this.browserContext.newPage();
await this.page.goto(this.extensionUrl + '/home.html#onboarding/welcome');
await this.navigate();
if (!this.page) throw "Page isn't ready";
// Remove me when MM to be more stable
// const firstTime =
// (await this.page.locator('data-testid=onboarding-welcome').count()) > 0;
// if (firstTime) await this.firstTimeSetup();
do {
await this.page.reload();
} while (
(await this.page.locator('data-testid=onboarding-welcome').count()) ===
0
);
await this.firstTimeSetup();
const firstTime = await this.page
.locator('data-testid=onboarding-welcome')
.isVisible();
if (firstTime) await this.firstTimeSetup();
});
}

Expand All @@ -68,13 +59,16 @@ export class MetamaskPage implements WalletPage {
async closePopover() {
await test.step('Close popover if exists', async () => {
if (!this.page) throw "Page isn't ready";
const popover =
(await this.page.getByTestId('popover-close').count()) > 0;
if (popover) {
await this.page.click('data-testid=popover-close');
const popover = this.page.getByTestId('popover-close');
try {
await popover.waitFor({ state: 'visible', timeout: 7000 });
} catch (error) {
return;
}

if (await popover.isVisible()) {
await popover.click();
// Remove me when MM to be more stable
await this.page.waitForTimeout(1000);
expect((await this.page.getByTestId('popover-close').count()) === 0);
}
});
}
Expand Down Expand Up @@ -174,9 +168,9 @@ export class MetamaskPage implements WalletPage {
await this.closePopover();
await this.page.click('data-testid=account-menu-icon');
} while (
(await this.page
!(await this.page
.locator('text=Add account or hardware wallet')
.count()) === 0
.isVisible())
);
await this.page.click('text=Add account or hardware wallet');
await this.page.click('text=Import account');
Expand Down
2 changes: 0 additions & 2 deletions wallets-testing/browser/browser.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
PhantomPage,
CoinbasePage,
TahoPage,
GameStopPage,
XdefiPage,
OkxPage,
BitgetPage,
Expand All @@ -29,7 +28,6 @@ export const WALLET_PAGES = {
phantom: PhantomPage,
coinbase: CoinbasePage,
taho: TahoPage,
gamestop: GameStopPage,
xdefi: XdefiPage,
okx: OkxPage,
bitget: BitgetPage,
Expand Down
6 changes: 0 additions & 6 deletions wallets-testing/test/widgets/ethereum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
COIN98_COMMON_CONFIG,
MATHWALLET_COMMON_CONFIG,
METAMASK_COMMON_CONFIG,
GAMESTOP_COMMON_CONFIG,
TRUST_WALLET_COMMON_CONFIG,
COINBASE_COMMON_CONFIG,
TAHO_COMMON_CONFIG,
Expand Down Expand Up @@ -57,11 +56,6 @@ test.describe('Ethereum', () => {
await browserService.connectWallet();
});

test(`GameStop connect`, async () => {
await browserService.setup(GAMESTOP_COMMON_CONFIG, ETHEREUM_WIDGET_CONFIG);
await browserService.connectWallet();
});

test.skip(`Exodus connect`, async () => {
await browserService.setup(EXODUS_COMMON_CONFIG, ETHEREUM_WIDGET_CONFIG);
await browserService.connectWallet();
Expand Down

0 comments on commit 8437e45

Please sign in to comment.