Skip to content

Conversation

@akhil-testsigma
Copy link
Contributor

@akhil-testsigma akhil-testsigma commented Oct 27, 2025

Addon Name: Store Device Screen Dimensions
Jarvis Link: https://jarvis.testsigma.com/ui/tenants/2817/addons
Jira : https://testsigma.atlassian.net/browse/CUS-8160
Added scale factor for ios

Summary by CodeRabbit

  • Chores

    • Version updated to 1.0.1
  • New Features

    • Enhanced iOS device screen dimension calculation for improved physical dimension accuracy
  • Bug Fixes

    • Improved error handling with comprehensive diagnostic information

@akhil-testsigma akhil-testsigma merged commit 0519aeb into dev Oct 27, 2025
1 check passed
@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR updates the store_device_screen_dimensions addon with a version bump to 1.0.1 and refactors the iOS screen dimensions retrieval logic to compute physical dimensions dynamically by calculating logical screen size and applying a device-specific retina scale factor.

Changes

Cohort / File(s) Summary
Version Update
store_device_screen_dimensions/pom.xml
Version bumped from 1.0.0 to 1.0.1; no changes to dependencies, plugins, or build configuration.
Physical Dimensions Calculation
store_device_screen_dimensions/src/main/java/com/testsigma/addons/ios/StoreDeviceScreenDimensions.java
Replaced simple width/height retrieval with dynamic physical dimension calculation (logical dimensions × retina scale factor). Added getRetinaScaleFactor() helper method to infer scale based on device name (iPad → 2x, iPhone → 3x) or fallback heuristic. Updated logging, error handling with stack traces, and action description/messages to reflect computed physical dimensions.

Sequence Diagram

sequenceDiagram
    participant Test as Test Execution
    participant Action as StoreDeviceScreenDimensions
    participant Driver as WebDriver (iOS)
    participant Var as Runtime Variables
    
    Test->>Action: execute(driver, element)
    Action->>Driver: getLogicalDimensions()
    Driver-->>Action: logicalWidth, logicalHeight
    
    rect rgb(200, 220, 255)
    Note over Action: Calculate Retina Scale Factor
    Action->>Action: getRetinaScaleFactor(driver, logicalWidth)
    Action->>Driver: getDeviceName()
    Driver-->>Action: deviceName (iPad/iPhone)
    Action->>Action: Determine scale (iPad→2x, iPhone→3x, or heuristic)
    Action-->>Action: scaleFactor
    end
    
    rect rgb(200, 255, 220)
    Note over Action: Compute Physical Dimensions
    Action->>Action: physicalWidth = logicalWidth × scaleFactor
    Action->>Action: physicalHeight = logicalHeight × scaleFactor
    end
    
    Action->>Var: storeVariable(physicalWidth, physicalHeight)
    Var-->>Action: Success
    Action-->>Test: Action Complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas requiring extra attention:
    • Logic correctness of retina scale factor heuristic (logical width threshold of 1000, default scale values for iPad/iPhone)
    • Proper handling of edge cases where device name capability is unavailable or deviceName parsing fails
    • Integration of ExceptionUtils for stack trace inclusion and its impact on log verbosity
    • Verification that computed physical dimensions are semantically correct and meet the addon's contract

Possibly related PRs

Suggested reviewers

  • Ganesh-Testsigma
  • vigneshtestsigma

Poem

🐰 A hop and a bound through dimensions we go,
From logical pixels to physical flow,
The retina scale makes the picture so clear,
iOS dimensions are rendered right here! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/CUS-8160-Added-Store-Device-Screen-Dimensions-addon-for-Android-&-iOS

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae8558d and b36282d.

📒 Files selected for processing (2)
  • store_device_screen_dimensions/pom.xml (1 hunks)
  • store_device_screen_dimensions/src/main/java/com/testsigma/addons/ios/StoreDeviceScreenDimensions.java (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants