-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wallet): Proper check of tx result after signing (#4328)
* fix(wallet): Proper check of rx result after signing * chore: Update wallet e2e tests * chore: better tests * add sleep
- Loading branch information
Showing
3 changed files
with
50 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// Modifications Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { type Page } from '@playwright/test'; | ||
import { expect, test } from './fixtures'; | ||
import { createWallet } from './utils/auth'; | ||
import { demoDappConnect } from './utils/dapp-connect'; | ||
import dotenv from 'dotenv'; | ||
|
||
dotenv.config(); | ||
|
||
test.beforeEach(async ({ page, extensionUrl }) => { | ||
await createWallet(page, extensionUrl); | ||
await page.close(); | ||
}); | ||
|
||
test.describe('Wallet API', () => { | ||
let demoPage: Page; | ||
|
||
test.beforeEach(async ({ context, demoPageUrl }) => { | ||
demoPage = await context.newPage(); | ||
await demoPage.goto(demoPageUrl); | ||
await demoDappConnect(demoPage, demoPageUrl, context); | ||
}); | ||
test('signing message works', async ({ context }) => { | ||
const newPage = context.waitForEvent('page'); | ||
await demoPage.getByRole('button', { name: 'Sign message' }).click(); | ||
const walletPage = await newPage; | ||
await walletPage | ||
.getByRole('button', { | ||
name: 'Sign', | ||
}) | ||
.click(); | ||
await demoPage.waitForTimeout(3000); | ||
await expect(demoPage.getByText('Error')).toHaveCount(0); | ||
}); | ||
}); |
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