7.3 KiB
7.3 KiB
End-to-End Test Cases
Purpose
Define end-to-end scenarios that exercise:
- Admin entry CRUD
- Public/user display
- CalDAV CRUD
- Display/sync behavior from ICS
This suite uses fixtures in tests/calendar_entries.md.
Pre-Run Setup
- Reset DB to known baseline.
- Seed users:
admin_userwith calendar admin capabilitypending_userwith CalDAVpending_approvalrw_userwith CalDAVactive
- Enable plugin and ensure admin menu with
Users,Setup,Diagnostics.
Admin Entry CRUD
E2E-ADM-001 Create Single Event
- Fixture: CE-001
- Steps:
- Admin logs in.
- Open
/calendaras a write-enabled user. - Create event using CE-001.
- Save.
- Assertions:
- Success feedback shown.
- Event appears in admin list.
- Event appears in public list/day/week/month/year views.
E2E-ADM-002 Update Single Event
- Fixture: CE-001
- Steps:
- Open CE-001 in editor.
- Change title to
Board Meeting (Updated)and location. - Save.
- Assertions:
- Updated values shown in admin list and public views.
- Last-modified metadata changes.
E2E-ADM-003 Delete Single Event
- Fixture: CE-001
- Steps:
- Delete CE-001 from admin list and confirm.
- Assertions:
- Event removed from admin list.
- Event removed from public views.
- Event removed from ICS and CalDAV query results.
E2E-ADM-004 Create Recurrence Types
- Fixtures: CE-003, CE-004, CE-005, CE-006, CE-007
- Steps:
- Create each recurring event via editor.
- Re-open each and verify saved recurrence config.
- Assertions:
- Persisted values match fixture.
- Preview highlights expected near-term occurrences.
- UI views render expected occurrences.
E2E-ADM-005 Delete One Occurrence as Exception
- Fixture: CE-010
- Steps:
- Create CE-010.
- Delete only occurrence
2026-04-17T14:00:00+01:00. - Reload series in editor and public views.
- Assertions:
- Only selected occurrence is removed.
- Series remains a single sequence (not split).
- Exception is represented in sync outputs (CalDAV/ICS rules).
E2E-ADM-006 Table Prefix Configuration
- Steps:
- Open Setup page.
- Verify plugin table prefix defaults to
wp_cs_calendar. - Change prefix to a valid alternative (staging only) and save.
- Reload calendar/admin views.
- Assertions:
- Plugin continues to operate without data loss.
- Event/user records remain available after prefix migration.
E2E-ADM-007 Setup Title Removal
- Steps:
- Open Setup page.
- Inspect available controls.
- Render a page containing
[calendar]with a custom page heading in content.
- Assertions:
- Setup does not show a
Calendar Titlefield. - Calendar shortcode does not inject its own top heading.
- Page/theme heading remains the source of title styling.
- Setup does not show a
E2E-ADM-008 User Removal Revokes Access
- Steps:
- Register, verify, and approve a plugin user.
- Confirm login/me works.
- Remove the same user from
Usersadmin.
- Assertions:
- Subsequent login and
/users/mefail for removed user. - Removed user cannot perform event write actions.
- Subsequent login and
Public/User Display
E2E-UI-001 Cross-View Rendering
- Fixtures: CE-002..CE-007
- Steps:
- Open public calendar UI.
- Switch list/day/week/month/year views.
- Assertions:
- Required fields render correctly (title/time/location/category/description excerpt).
- All-day semantics for CE-002 are correct.
- Empty-state messaging works when date window has no matches.
E2E-UI-002 DST and Leap-Year Display
- Fixtures: CE-008, CE-009
- Steps:
- Navigate to date windows covering fixture dates.
- Assertions:
- CE-008 shows expected local times around DST boundary.
- CE-009 recurrence behavior is correct for non-leap years.
E2E-UI-003 Calendar Shell Control Presence
- Steps:
- Render
[calendar]shortcode.
- Render
- Assertions:
- Login/register/verify/reset controls are present.
- Future-only filter and theme selector controls are present.
- Recurrence occurrence-delete controls are present in editor shell markup.
CalDAV CRUD
E2E-CDV-001 Auth Gate (Pending User)
- User:
pending_user - Fixtures: CE-002, CE-003
- Steps:
- Connect CalDAV client as
pending_user.
- Connect CalDAV client as
- Assertions:
- Authentication is denied until admin approval.
E2E-CDV-002 Create/Update/Delete (Write User)
- User:
rw_user - Fixture: CE-001 as CalDAV-created item
- Steps:
- Create event via CalDAV
PUT. - Modify via CalDAV
PUTwith valid ETag precondition. - Delete via CalDAV
DELETE.
- Create event via CalDAV
- Assertions:
- Admin UI reflects CalDAV-created and updated data.
- Public UI reflects changes.
- Deletion propagates to admin/public views.
E2E-CDV-003 Recurrence Exception Round-Trip
- User:
rw_user - Fixture: CE-010
- Steps:
- Create CE-010 via admin or CalDAV.
- Delete a single occurrence from CalDAV client.
- Sync and inspect in admin editor.
- Assertions:
- Exception is present for deleted occurrence.
- Series stays unified (single UID sequence).
- No split-series artifact created.
E2E-CDV-004 CalDAV Single-Occurrence Delete Sync Persistence
- User:
rw_user - Fixture: CE-010
- Steps:
- Create recurring event via UI or CalDAV.
- In CalDAV client, delete one occurrence only (client emits
EXDATEand/or cancelledRECURRENCE-IDcomponent). - Force sync/refresh in client and fixture UI.
- Restart fixture and refresh again.
- Assertions:
- Deleted occurrence remains deleted after sync cycles and restart.
- Persisted exception exists in fixture data store (
recurrence_exceptions). - No duplicate recurrence series is created.
E2E-CDV-005 Monthly Ordinal Round-Trip
- User:
rw_user - Steps:
- Create a monthly ordinal recurring event (
weekday_of_month,last, chosen weekday). - Sync via CalDAV and read back object.
- Validate resulting occurrence dates in UI/API.
- Create a monthly ordinal recurring event (
- Assertions:
- Monthly ordinal rule round-trips without changing meaning.
- Expected target dates (for example last Sunday of month) are preserved.
- No split or duplicate series created.
ICS Display and Sync
E2E-ICS-001 ICS Link Health and Parsing
- Fixtures: CE-002..CE-007
- Steps:
- Fetch public ICS URL.
- Parse payload with validator/parser.
- Assertions:
- HTTP content type is
text/calendar. - VCALENDAR envelope is valid.
- VEVENT fields map correctly from fixtures.
- HTTP content type is
E2E-ICS-002 Recurrence and Exception Export
- Fixture: CE-010 with deleted occurrence exception
- Steps:
- Fetch ICS after exception delete.
- Assertions:
- Recurrence is represented with RRULE.
- Deleted occurrence is represented as exception (EXDATE and/or RECURRENCE-ID pattern).
- No split into independent series.
E2E-ICS-003 Consumer Sync
- Fixtures: CE-002, CE-003, CE-010
- Steps:
- Subscribe external test calendar to ICS feed.
- Update source entries in admin.
- Refresh subscriber.
- Assertions:
- Create/update/delete changes propagate.
- Exception delete for CE-010 propagates as missing occurrence in subscriber.
E2E-ICS-004 Slug Path Link Consistency
- Steps:
- Set
url_slugin Setup. - Render
[calendar].
- Set
- Assertions:
- Rendered ICS and CalDAV links use slugged path.
- Links remain navigable and consistent with configured endpoint prefix.
Traceability
- Admin CRUD/lifecycle: E2E-ADM-001..008
- User display/UI shell: E2E-UI-001..003
- CalDAV CRUD/sync: E2E-CDV-001..005
- ICS display/sync/pathing: E2E-ICS-001..004