Skip to content

[MOSIP-45718] [MOSIP-45719] Move admin UI automation to Playwright and enrich the test report - #870

Open
jayesh12234 wants to merge 5 commits into
mosip:developfrom
jayesh12234:MOSIP-45718
Open

jayesh12234 wants to merge 5 commits into
mosip:developfrom
jayesh12234:MOSIP-45718

Conversation

@jayesh12234

@jayesh12234 jayesh12234 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Jira: MOSIP-45718, MOSIP-45719

Summary

Moves the admin UI automation (uitest-admin) from Selenium + TestNG to Playwright + Cucumber on the shared uitest-commons library, the same way resident-ui ui-test was migrated, and enriches the test report.

MOSIP-45718 Playwright migration

  • The 15 TestNG classes become 15 feature files (one per master data entity / resource, plus bulk upload) driving shared step definitions and Playwright page objects.
  • Config comes from adminui.properties (tracked with blank secrets) layered over Kernel.properties, uitest.properties and environment variables. The old adminPortalPath variable still works.
  • Each run creates its own Keycloak admin user, maps it to a zone, generates its test data, and afterwards deletes the master data rows it created.
  • Localhost-portal mode is kept (admin token cookie, audit-log stub).
  • Runs 4 scenarios in parallel; scenarios that create types/specs never run alongside the ones that pick them from dropdowns.
  • Dockerfile uses the Playwright Java image; mvn package still skips the live suite when CI=true, so the existing workflow jobs keep working.
  • Old setExcludedGroups codes map to Cucumber tags (table in the README).

MOSIP-45719 Report enhancements

  • Embedded screen recording per scenario (works headless).
  • Screenshot before every element interaction, with the element outlined.
  • Playwright trace for failed scenarios (replay on trace.playwright.dev).
  • API errors (HTTP ≥ 400 and MOSIP errors responses such as KER-MSD-…) and console errors per scenario.
  • Gherkin step text under each numbered step.
  • Each can be switched off in adminui.properties; files live under test-output/artifacts/ and are linked from the report.

Test results (local run against dev2)

Branch state Result Time
After the MOSIP-45718 commit 16 / 16 passed 4.4 min
After the MOSIP-45719 commit (clean build, all evidence on) 16 / 16 passed, 16 recordings 9.4 min

The run with all evidence on also surfaced dev2 portal issues unrelated to this change: every master-data list search returns KER-MSD-390 Invalid filter value, location 14022 gives KER-MSD-026 Location not found, and the Device/Machine pages throw TypeError: Cannot read properties of undefined (reading 'regCenterId').

Notes

Selenium and TestNG are replaced by Playwright and Cucumber on the shared uitest-commons
library, the same setup the resident portal suite uses. The 15 test classes become 15
feature files with shared steps and page objects; all 16 scenarios pass on dev2.

Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
…dmin UI test report.

A failing scenario could only be diagnosed from one screenshot and a step log. The report
now embeds a screen recording per scenario, a screenshot before every element interaction,
a Playwright trace for failures, the API and console errors seen after sign-in, and each
Gherkin step's text. Each kind of evidence can be switched off in adminui.properties.

Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI; Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c2c563b2-601e-453b-a34e-85931b9c70f1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ngs into one zip.

The report only links to its screenshots and recordings, so a shared HTML file showed them
broken. Each run now also writes a zip with the report and that run's evidence in the same
layout, and uploads it with the HTML when reports are pushed to S3.

Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
@jayesh12234

jayesh12234 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Added be992f8 (MOSIP-45719): the report HTML only links to its screenshots and recordings, so a shared HTML file showed them broken. Each run now also writes <report-name>.zip next to the HTML with the report and that run's evidence in the same layout (uploaded with the HTML when push-reports-to-s3=yes; zipReport=yes|no).

Tested on this branch (clean build, dev2): 16 / 16 passed in 7.6 min; the 57.8 MB zip was extracted to an unrelated folder and opened there — 538 / 538 screenshots and 16 / 16 recordings load.

…ault.

Recordings of passing scenarios made up most of a run's 90 MB of evidence and its shareable
zip. recordVideo now defaults to onFailure; set it to always to keep every recording.

Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
@jayesh12234

jayesh12234 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Added 00af117 (MOSIP-45719): recordVideo now defaults to onFailure. Verified on this branch with a clean build: a passing scenario kept no recording, a deliberately failing one kept its recording and trace. Full suite afterwards: 16 / 16 passed on dev2 in 7.9 min; the shareable zip dropped from 57.8 MB to 13.3 MB.

…HTML.

Shared reports needed a zip with the evidence beside them. The report now carries its
screenshots, failure recordings and failure traces inline, so the single HTML file can be
shared and opened as is; the zip bundle and the artifacts folder are gone.

Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
@jayesh12234

jayesh12234 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Added 5b97bbf (MOSIP-45719): screenshots, failure recordings and failure traces are now embedded in the report HTML, so the single file can be shared and opened as is — the zip bundle and test-output/artifacts are removed. Verified on this branch with a clean build: a passing + deliberately failing pair (recording and trace embedded only for the failure), then the full suite — 16 / 16 passed on dev2 in 7.2 min; the 33.6 MB report, copied alone to another folder, shows all screenshots with no external file references.

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