-
Notifications
You must be signed in to change notification settings - Fork 71
test: SDKE-535 Implement Test Coverage for iOS SDK - Part 1 #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: SDKE-535 Implement Test Coverage for iOS SDK - Part 1 #456
Conversation
- Tests transaction events with nested dictionaries - Covers Date objects, Numbers, and Strings in attributes - Verifies custom flags are properly handled
- Automatically replace API keys in URLs with {API_KEY} placeholder
- Rename body files to remove API keys from filenames
- Auto-regenerate mapping files with sanitized data
- Update all references automatically
This ensures no API keys are committed to the repository.
- Tests transaction event type with MPEvent - Covers custom attributes: string, number, date, nested dictionary - Verifies custom flags (Not_forwarded_to_providers) - Uses static dates for deterministic testing - Based on ViewController.m logEvent method (lines 131-147)
- Tests screen view logging functionality - Based on ViewController.m logScreen method (lines 149-151) - Verifies screen name 'Home Screen' is properly tracked - Covers screen view event type (dt: 'v') serialization
- Tests logCommerceEvent with product and transaction attributes - Covers product attributes (name, SKU, price, brand, category, coupon) - Covers transaction attributes (revenue, tax, shipping, affiliation, transaction ID) - Verifies commerce event custom attributes and checkout options - Based on ViewController.m logCommerceEvent method (lines 153-180) - Related to SDKE-535 test coverage implementation
- Added Test 5: Rokt Select Overlay Placement - Tests Rokt SDK integration through mParticle - Verifies identity change when selecting placements with custom attributes - Based on ViewController.m selectOverlayPlacement method (lines 182-192)
| } | ||
|
|
||
| // Test 4: Log Commerce Event with Product and Transaction | ||
| // Based on ViewController.m logCommerceEvent method (lines 153-180) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Based on ViewController.m logCommerceEvent method (lines 153-180) | |
| // Based on ViewController.m logCommerceEvent method |
Nit: Line numbers here and other comments with line numbers are highly likely to change separately to the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks will update
|
🎉 This PR is included in version 9.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Background
First PR in a series establishing automated integration test infrastructure for the iOS SDK. This PR sets up WireMock-based testing framework with automated recording/verification and adds initial test coverage for core SDK functionality. Future PRs will incrementally add more test scenarios.
What Has Changed
Mappings are now stored in unescaped (readable) format
🛠 Utility Scripts
Two new scripts for mapping management:
transform_mapping_body.py- Handles escape/unescape transformationssanitize_mapping.py- Prepares mappings for useChecklist
Additional Notes
This is part 1 of the test coverage implementation. Subsequent PRs will add more test cases as tracked in subtask SDKE-632.
All integration tests pass successfully with 100% mapping match rate.
Reference Issue (For employees only. Ignore if you are an outside contributor)