Skip to content

Commit

Permalink
chore: add debug console.log for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecco committed Dec 6, 2024
1 parent 574f407 commit 2a8cc2f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions e2e/src/webwallet/page-objects/Dapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ export default class Dapps extends Navigation {
console.log("Sending ERC20 transaction: review transaction visible")
await expect(popup.getByText("Confirm")).toBeVisible()
console.log("Sending ERC20 transaction: confirm visible")
await popup.locator('button[type="submit"]').click()
await popup.getByText("Confirm").click()

Check failure on line 118 in e2e/src/webwallet/page-objects/Dapps.ts

View workflow job for this annotation

GitHub Actions / test-webwallet

[WebWallet] › src/webwallet/specs/transactions.spec.ts:5:7 › Transactions › send an ERC20 from testDapp

4) [WebWallet] › src/webwallet/specs/transactions.spec.ts:5:7 › Transactions › send an ERC20 from testDapp Error: locator.click: Target page, context or browser has been closed Call log: - waiting for getByText('Confirm') - locator resolved to <button disabled type="submit" class="chakra-button css-16m253l">Confirm</button> - attempting click action - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #1 - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #2 - waiting 20ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #3 - waiting 100ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #4 - waiting 100ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #5 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #6 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #7 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #8 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #9 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #10 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #11 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #12 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #13 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #14 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #15 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #16 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #17 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #18 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #19 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #20 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #21 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #22 - waiting 500ms - waiting for element to be visible, enabled and stable - element is not enabled - retrying click action, attempt #23
console.log("Sending ERC20 transaction: confirm clicked")
await popup.waitForEvent("close", { timeout: 10000 })

console.log("Signing message: wait for dialog")
const dialog = await dialogPromise
expect(dialog.message()).toContain("Transaction sent")
await dialog.accept()
Expand All @@ -127,17 +128,22 @@ export default class Dapps extends Navigation {
}

async signMessage({ dapp }: { dapp: Page }) {
console.log("Signing message")
const popupPromise = dapp.waitForEvent("popup")
await dapp.locator('button :text-is("Signing")').click()
await dapp.locator("[name=short-text]").fill("some message to sign")
await dapp.locator('button[type="submit"]').click()

const popup = await popupPromise
await expect(popup.getByText("Sign Message")).toBeVisible()
console.log("Signing message: sign message visible")
await expect(popup.getByText("Confirm")).toBeVisible()
await popup.locator('button[type="submit"]').click()
console.log("Signing message: confirm visible")
await popup.getByText("Confirm").click()
console.log("Signing message: confirm clicked")
await popup.waitForEvent("close", { timeout: 10000 })

console.log("Signing message: wait for ui")
await expect(dapp.getByText("Signer", { exact: true })).toBeVisible()
await expect(dapp.getByText("Cosigner", { exact: true })).toBeVisible()

Expand Down

0 comments on commit 2a8cc2f

Please sign in to comment.