TenKeyLabs / dappwright

🏌🏼‍E2E testing for dApps using Playwright + MetaMask & Coinbase Wallet
https://www.npmjs.com/package/@tenkeylabs/dappwright
Other
89 stars 26 forks source link

Cannot change network #240

Closed alejogranerorequest closed 1 year ago

alejogranerorequest commented 1 year ago

Describe the bug During the setup, if I want to change the network to "Goerli", it cannot choose between "Linea Goerli" or "Goerli" and then it fails.

A solution could be adding ".first()" in the method that clicks on the desired network before ".click()".

Logs

Error: locator.click: Error: strict mode violation: locator('.multichain-network-list-menu').getByRole('button', { name: 'goerli' }) resolved to 2 elements:
        1) <button class="mm-box mm-text mm-text--body-md mm-text--…>Goerli</button> aka getByRole('button', { name: 'Goerli', exact: true })
        2) <button class="mm-box mm-text mm-text--body-md mm-text--…>Linea Goerli</button> aka getByRole('button', { name: 'Linea Goerli' })

    =========================== logs ===========================
    waiting for locator('.multichain-network-list-menu').getByRole('button', { name: 'goerli' })
    ============================================================

Dappwright version: 2.5.0

osis commented 1 year ago

Thanks for splitting this out. It looks like these labels have been updated. Easy fix it to make sure Playwright does an exact match on the text vs it's fuzzy match which is the default.