diff --git a/playwright.config.ts b/playwright.config.ts index 58d26ea0..7ccf7d60 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -9,8 +9,8 @@ export default defineConfig({ outputDir: "artifacts/test-results", timeout: 60_000, reporter: process.env.CI - ? [["github"], ["html", { open: "never" }], ["json", { outputFile: "artifacts/test-results/results.json" }]] - : [["list"], ["html", { open: "never" }], ["json", { outputFile: "artifacts/test-results/results.json" }]], + ? [["github"], ["html", { open: "never" }]] + : [["list"], ["html", { open: "never" }]], use: { baseURL: BASE_URL, viewport: { width: 1280, height: 720 }, diff --git a/scripts/agent/telemetry-aggregator.mjs b/scripts/agent/telemetry-aggregator.mjs index 73a4afc2..615799b2 100644 --- a/scripts/agent/telemetry-aggregator.mjs +++ b/scripts/agent/telemetry-aggregator.mjs @@ -196,11 +196,7 @@ function collectSmokeTests() { const content = JSON.parse(fs.readFileSync(path.join(ARTIFACTS_DIR, file), 'utf8')); // Expected format: { timestamp, status, error, logs } - // Also handle { timestamp, success: false, logFile } from smoke-test.mjs - if ( - (content.status && (content.status.toLowerCase() === 'failure' || content.status.toLowerCase() === 'fail')) || - (content.success === false) - ) { + if (content.status && (content.status.toLowerCase() === 'failure' || content.status.toLowerCase() === 'fail')) { const errorMsg = content.error || 'Unknown Smoke Test Failure'; const sanitizedError = sanitize(errorMsg); @@ -227,68 +223,6 @@ function collectSmokeTests() { return errors; } -function collectPlaywrightTests() { - const errors = []; - const resultsPath = path.join(ARTIFACTS_DIR, 'test-results', 'results.json'); - - if (!fs.existsSync(resultsPath)) return errors; - - try { - const content = JSON.parse(fs.readFileSync(resultsPath, 'utf8')); - - // Iterate over suites recursively or just check failures - // Playwright JSON structure: { suites: [ { specs: [ { tests: [ { results: [ { status, error } ] } ] } ] } ] } - - function processSuite(suite) { - if (suite.specs) { - for (const spec of suite.specs) { - processSpec(spec); - } - } - if (suite.suites) { - for (const childSuite of suite.suites) { - processSuite(childSuite); - } - } - } - - function processSpec(spec) { - for (const test of spec.tests || []) { - for (const result of test.results || []) { - if (result.status === 'failed' || result.status === 'timedOut') { - const error = result.error || {}; - const message = error.message || 'Unknown Playwright Error'; - const stack = error.stack || message; - - const sanitizedMessage = sanitize(message); - const sanitizedStack = sanitize(stack); - - errors.push({ - source: `playwright:${spec.title}`, - title: `Playwright Failure: ${spec.title}`, - details: [sanitizedMessage], - stack: sanitizedStack, - fingerprint: getFingerprint(sanitizedStack), - severity: 'High', - owner: 'QA Team' // Default owner for e2e failures - }); - } - } - } - } - - if (content.suites) { - for (const suite of content.suites) { - processSuite(suite); - } - } - } catch (err) { - console.warn('Failed to parse Playwright results:', err.message); - } - - return errors; -} - function collectFuzzReports() { const errors = []; if (!fs.existsSync(ARTIFACTS_DIR)) return errors; @@ -570,13 +504,6 @@ async function main() { errors.push(...loadTestErrors); } - // Playwright Tests - const playwrightErrors = collectPlaywrightTests(); - if (playwrightErrors.length > 0) { - console.log(`Collected ${playwrightErrors.length} Playwright test errors.`); - errors.push(...playwrightErrors); - } - // Fuzz Reports const fuzzErrors = collectFuzzReports(); if (fuzzErrors.length > 0) { diff --git a/tests/nostr-login-permissions.test.mjs b/tests/nostr-login-permissions.test.mjs index 0fa80c4c..1a81e753 100644 --- a/tests/nostr-login-permissions.test.mjs +++ b/tests/nostr-login-permissions.test.mjs @@ -313,7 +313,7 @@ test("NIP-07 login falls back when structured permissions fail", async () => { const pubkey = result.pubkey; assert.equal(pubkey, HEX_PUBKEY); assert.ok(env.enableCalls.length >= 2, "should retry with alternate payloads"); - const [objectCall, stringCall] = env.enableCalls; + const [objectCall, stringCall, plainCall] = env.enableCalls; assert.ok(Array.isArray(objectCall?.permissions)); assert.equal( typeof objectCall.permissions[0], diff --git a/tests/visual/overlay-layers.spec.ts b/tests/visual/overlay-layers.spec.ts index 5382c050..6ee65925 100644 --- a/tests/visual/overlay-layers.spec.ts +++ b/tests/visual/overlay-layers.spec.ts @@ -144,8 +144,9 @@ test.describe("overlay layering tokens", () => { // Ensure the footer button is scrolled into view (especially for mobile viewports) await page.evaluate(() => { const sidebar = document.getElementById("sidebar"); - if (sidebar) { - sidebar.scrollTop = sidebar.scrollHeight; + const footerBtn = document.getElementById("footerDropdownButton"); + if (sidebar && footerBtn) { + footerBtn.scrollIntoView({ block: "center", inline: "center" }); } });