From 76d59d8d0801546fb250136fe4dce2ff4069027d Mon Sep 17 00:00:00 2001 From: protom Date: Sat, 22 Aug 2026 16:56:49 +0200 Subject: [PATCH] test: harden NWC browser lifecycle coverage --- e2e/specs/nwc.spec.ts | 3 ++- playwright.config.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/specs/nwc.spec.ts b/e2e/specs/nwc.spec.ts index bfa9a1e..e7a77ce 100644 --- a/e2e/specs/nwc.spec.ts +++ b/e2e/specs/nwc.spec.ts @@ -63,9 +63,10 @@ test.describe('NWC settings page', () => { await expect(page.getByText('shown only once', { exact: false })).toBeVisible(); const uri = (await page.locator('.nwc-connection-string').textContent())?.trim(); expect(uri).toBeTruthy(); + if (!uri) throw new Error('Expected the one-time NWC connection string.'); // a well-formed NIP-47 connection string - const url = new URL(uri!); + const url = new URL(uri); expect(url.protocol).toBe('nostr+walletconnect:'); expect(url.host).toMatch(/^[0-9a-f]{64}$/); expect(url.searchParams.get('secret')).toMatch(/^[0-9a-f]{64}$/); diff --git a/playwright.config.ts b/playwright.config.ts index f4e07da..ebc968a 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -21,7 +21,8 @@ export default defineConfig({ use: { baseURL: 'http://localhost:9333', - trace: 'on-first-retry', + trace: 'retain-on-failure', + screenshot: 'only-on-failure', serviceWorkers: 'block', launchOptions: { executablePath: process.env.CHROMIUM_PATH || findSystemChromium(),