janhoy opened a new pull request, #4738: URL: https://github.com/apache/solr/pull/4738
https://issues.apache.org/jira/browse/SOLR-8474 The old (AngularJS) Admin UI has had no automated test coverage. This PR adds JUnit tests that drive the real UI in a headless Chrome browser via Selenium WebDriver — pure JVM dependencies, no Node.js toolchain. ## What's included - **UI serving in tests**: new opt-in `JettyConfig.Builder#enableAdminUi(boolean)` makes `JettySolrRunner` (and thus `MiniSolrCloudCluster`) serve the Admin UI static files and `LoadAdminUiServlet` exactly as the production `web.xml` does — addressing the long-standing `TODO` in `JettySolrRunner`. - **Test harness** (`solr/webapp/src/test`): `AdminUiTestBase` starts a 2-node cloud cluster with the UI enabled and a headless Chrome. Tests skip cleanly (JUnit `Assume`) on machines without Chrome — e.g. ASF Jenkins — and run wherever Chrome is installed (`-Dtests.ui.chrome.binary=` to override discovery). Includes screenshot + page-source capture on failure, a browser console error assertion, and a stub of the generated js-client bundle so the Collections screen works from a source checkout. - **27 tests, all green locally** (`./gradlew :solr:webapp:test`): - `AdminUiSmokeTest` — navigates every screen (node-level, cloud views, per-collection, per-core), asserting each renders without severe console errors - `AdminUiDashboardTest` — dashboard versions/JVM/memory vs `/admin/info/system` - `AdminUiNodeScreensTest` — java properties, thread dump, logging tree, cloud nodes/tree, collections detail, core admin, security, login - `AdminUiCollectionScreensTest` — query execution, analysis, schema browser, files, segments, plugins, documents form, paramsets - `AdminUiWriteActionsTest` — create + delete a collection through the UI dialogs, index a document through the Documents screen, change and revert a log level - **Dependencies kept slim**: only the 8 core `selenium-*` jars (Apache-2.0) plus a byte-buddy version alignment; opentelemetry comes from solr-core, `selenium-support` was avoided by a small poll-based wait helper. - Test catalog / status doc: `dev-docs/admin-ui-tests.md` ## TODOs for full coverage - [ ] Collections screen: create/delete alias, add/delete replica, reload collection - [ ] Schema Browser: add/delete field, dynamic field, copy field; per-field flag assertions vs `/schema` API - [ ] Query screen: paramsets dropdown, dismax/edismax/raw-params toggles - [ ] Paramsets: create/update/delete paramset round-trip - [ ] Stream screen: execute a streaming expression (and SQL screen with the sql module on the classpath) - [ ] Core Admin write actions: reload; rename/swap/unload in a standalone (non-cloud) harness - [ ] Replication screen in standalone mode (leader/follower fixture) - [ ] Security screen with BasicAuth: login form, add user/role/permission (`@Nightly`) - [ ] Schema Designer happy path (`@Nightly`) - [ ] Cloud graph/ZK-status deeper assertions (replica leaves in SVG, ensemble details) - [ ] Logging events viewer content assertions - [ ] Serve the real js-client bundle when built, instead of the test stub - [ ] GitHub Actions workflow to run these tests in CI (Chrome is preinstalled on `ubuntu-latest`) - [ ] Investigate the benign `TypeError ... reading 'name'` menu race and the ping-widget 503 surfaced by these tests -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
