Skip to content

Add Playwright flaky & metrics reporters/configs#400

Open
SteveChurchillSWO wants to merge 4 commits intomainfrom
feature/MPT-20249-Add-metrics-report
Open

Add Playwright flaky & metrics reporters/configs#400
SteveChurchillSWO wants to merge 4 commits intomainfrom
feature/MPT-20249-Add-metrics-report

Conversation

@SteveChurchillSWO
Copy link
Copy Markdown

Description

Introduce dedicated Playwright configs and reporters for flaky-test detection and tag-based metrics. Adds playwright.flaky.config.ts and playwright.metrics.config.ts, new reporters (flaky-test-reporter.ts, metrics-reporter.ts), tags-helper and report-utils helpers, and wiring to output reports to reports/. Updates e2etests package.json with new scripts (playwright:metrics, playwright:flaky) and adds @reportportal/agent-js-playwright as a dependency. Ignore reports/ in .gitignore and apply related adjustments across many e2etests specs to integrate the reporting/metrics workflow.

Related issue number

https://softwareone.atlassian.net/browse/MPT-20249

Introduce dedicated Playwright configs and reporters for flaky-test detection and tag-based metrics. Adds playwright.flaky.config.ts and playwright.metrics.config.ts, new reporters (flaky-test-reporter.ts, metrics-reporter.ts), tags-helper and report-utils helpers, and wiring to output reports to reports/. Updates e2etests package.json with new scripts (playwright:metrics, playwright:flaky) and adds @reportportal/agent-js-playwright as a dependency. Ignore reports/ in .gitignore and apply related adjustments across many e2etests specs to integrate the reporting/metrics workflow.
Import TAGS_MODULE, TAGS_SPEED, TAGS_TYPE and TAGS_DEBUG from tags-helper and remove the duplicated local tag definitions in metrics-reporter.ts. Updated the comment to note tags are sourced from tags-helper (single source of truth). This is a refactor to centralize tag definitions and avoid duplication; no functional changes intended.
});
} else if (failures > 0 && passes === 0) {
// ── Consistently failing ──────────────────────────────────────────
console.log(`❌ FAILED: ${test.title} (${failures}/${totalRuns} failed)`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to show console.log here or should we use debugLog instead ? If use debugLog please apply for whole commited code.

* Usage — add to any playwright config's reporter array:
* reporter: [
* ['list'],
* ['./reporting/flaky-test-reporter.ts'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if all reports are moved to reporting maybe its good idea to default test results (playwright-report, test-results) to /report folder as well, then all will be in one place

Print process.env.ENVIRONMENT in global setup for easier environment debugging. Import LARGE_DATA_TIMEOUT in expenses-tests.spec.ts and pass it to page.waitForResponse for the /pools_expenses/ request to handle large payloads and reduce flaky timeouts during heavy data loads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants