test: create automated tests for ldap login
Merged
JE
1mo ago+284+284+012345678901234567890123456789-51-51-01234567890123456789
Proposed changes
Adds end-to-end coverage for LDAP authentication using the existing OpenLDAP CI service.
- Configures the LDAP settings required by the test while preserving and restoring their original values.
- Verifies LDAP connectivity and user search through
/ldap.testConnectionand/ldap.testSearch. - Verifies login and LDAP field mapping for username, name, and email.
- Adds a dedicated
ldap.e2eidentity underou=othersso the test does not overlap with ABAC synchronization. - Verifies
jpegPhotoavatar synchronization by comparing the served avatar with a Playwright image snapshot. - Removes the test user through
/users.deletebefore and after the suite to keep runs isolated.
Issue(s)
Test coverage
- LDAP connection
- LDAP user search
- LDAP login
- Username, name, and email mapping
- LDAP avatar synchronization
- Settings restoration and test-user cleanup
- Enterprise CI execution
Further comments
The avatar baseline is intentionally committed because Playwright uses it for pixel comparison. The Linux suffix is generated automatically by Playwright and matches the CI platform.
Summary by CodeRabbit
- Tests
- Added end-to-end coverage for LDAP connection testing, user search, credential-based login, field mapping, and avatar synchronization.
- Added test data for an LDAP user with profile details, email, password, and photo.
- LDAP tests run only in Enterprise Edition environments and clean up test data afterward.