diff --git a/CHANGELOG.md b/CHANGELOG.md index e3a2fef..2281569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @tobelabs/chainwright +## 0.10.5 + +### Patch Changes + +- Fix bug in "renameAccount" action for the Meteor wallet + ## 0.10.4 ### Patch Changes diff --git a/package.json b/package.json index 9a82c07..28b8a55 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chainwright", - "version": "0.10.4", + "version": "0.10.5", "description": "Playwright Web3 wallet testing framework for end-to-end dApp automation with MetaMask, Phantom, Solflare, Petra, Meteor, and Keplr", "type": "module", "license": "MIT", diff --git a/src/wallets/meteor/actions/onboard.meteor.ts b/src/wallets/meteor/actions/onboard.meteor.ts index a3b9351..42cd266 100644 --- a/src/wallets/meteor/actions/onboard.meteor.ts +++ b/src/wallets/meteor/actions/onboard.meteor.ts @@ -19,7 +19,6 @@ export default async function onboard({ page, network, accountName, additionalAc const PASSWORD = await getWalletPasswordFromCache("meteor"); const meteorProfile = new MeteorProfile(); const indexUrl = await meteorProfile.indexUrl(); - await page.setViewportSize({ width: 380, height: 600 }); await page.goto(indexUrl); const switchNetworkButton = page.locator(onboardingSelectors.switchNetworkButton); diff --git a/src/wallets/meteor/actions/rename-account.meteor.ts b/src/wallets/meteor/actions/rename-account.meteor.ts index 3659b81..7540785 100644 --- a/src/wallets/meteor/actions/rename-account.meteor.ts +++ b/src/wallets/meteor/actions/rename-account.meteor.ts @@ -1,4 +1,4 @@ -import { expect, type Page } from "@playwright/test"; +import type { Page } from "@playwright/test"; import { homepageSelectors } from "../selectors/homepage-selectors.meteor"; import type { RenameAccountArgs } from "../types"; @@ -12,10 +12,19 @@ export async function renameAccount({ page, newAccountName }: RenameAccount) { await accountName.click(); const accountNameInput = page.locator("input[placeholder='Ex. My Meteor Wallet']"); + const inputValue = await accountNameInput.inputValue(); + + if (inputValue.toLowerCase() === newAccountName.toLowerCase()) { + console.info( + `Can't rename account. Current account name: ${inputValue} is the same with the new account name: ${newAccountName}`, + ); + const closeButton = page.locator("section[role='dialog'] > button[aria-label='Close']"); + await closeButton.click(); + return; + } + const updateButton = page.locator("button[type='submit']:has-text('Update')"); await accountNameInput.fill(newAccountName); - - await expect(updateButton).toBeEnabled({ timeout: 30_000 }); await updateButton.click(); const closeMenuButton = page.locator("div[id='root'] button[aria-label='Close']");