[
https://issues.apache.org/jira/browse/SOLR-8474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18106726#comment-18106726
]
ASF subversion and git services commented on SOLR-8474:
-------------------------------------------------------
Commit b8a3ae0c43d594d523bddbb53957b160eee59b34 in solr's branch
refs/heads/dependabot/gradle/apache-log4j-2.26.1 from Jan Høydahl
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=b8a3ae0c43d ]
SOLR-8474: Add Selenium-based JUnit tests for the Admin UI (#4738)
Co-authored-by: Eric Pugh <[email protected]>
> Test Framework for functional testing Angular UI
> ------------------------------------------------
>
> Key: SOLR-8474
> URL: https://issues.apache.org/jira/browse/SOLR-8474
> Project: Solr
> Issue Type: Improvement
> Components: Admin UI
> Affects Versions: 5.4
> Reporter: Upayavira
> Assignee: Jan Høydahl
> Priority: Major
> Labels: pull-request-available
> Fix For: 10.1
>
> Attachments: SOLR-8474.zip
>
> Time Spent: 6.5h
> Remaining Estimate: 0h
>
> This issue originally (back in 2015!) proposed introducing Karma and friends
> to unit-test the then-new AngularJS Admin UI JavaScript. That never
> materialized, and the issue is now re-purposed for the approach we ended up
> with a decade later.
> h3. Chosen approach
> Instead of a JavaScript unit-test toolchain, we test the Admin UI end-to-end
> in a *real browser* against a {*}real Solr{*}, wrapped into Solr's existing
> JUnit test framework:
> * [Selenium WebDriver|https://www.selenium.dev/] drives a headless Chrome —
> pure JVM dependencies from Maven Central, no Node.js toolchain. Tests skip
> cleanly on machines without a Chrome/Chromium binary (e.g. ASF Jenkins).
> * A new opt-in {{JettyConfig.Builder#enableAdminUi()}} makes
> {{JettySolrRunner}} / {{MiniSolrCloudCluster}} serve the Admin UI exactly
> like the production {{web.xml}} does.
> * Tests live in {{{}solr/webapp/src/test{}}}, grouped per screen/feature,
> and cover both display (asserted against live admin API responses, never
> hardcoded values) and write actions: create/delete collections, aliases and
> replicas, index documents, edit the schema, change log levels, manage
> users/roles/permissions with BasicAuth, core admin add/rename/swap/unload and
> leader/follower replication on standalone nodes, streaming expressions, SQL,
> and more.
> * The test catalog, deliberately skipped areas, and a list of possible UI
> bugs surfaced by the tests are tracked in {{{}dev-docs/admin-ui-tests.md{}}}.
> PR: [GitHub PR #4738|https://github.com/apache/solr/pull/4738]
> h3. Closing remarks
> They say the best time to add UI tests was ten years ago; the second best
> time is now, right before axing it 😜. A big shoutout to [~upayavira] for
> standing up the then-revolutionary UI back in 2015 — I don1t know if you read
> this, but who would have thought this code would live this long. It has for
> sure served us well all these years!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]