Skip to content

Add accessibility identifiers for Saucelabs test stability#140

Merged
kpujjigit merged 1 commit intomasterfrom
saucelabs-use-attribute-ids
Apr 1, 2026
Merged

Add accessibility identifiers for Saucelabs test stability#140
kpujjigit merged 1 commit intomasterfrom
saucelabs-use-attribute-ids

Conversation

@kpujjigit
Copy link
Copy Markdown
Contributor

Summary

  • Add accessibilityIdentifier to ProductTableViewCell (cell + Add to Cart button) and CartItemCell
  • Enables Saucelabs tests to use stable accessibility id selectors instead of brittle XPath that breaks on view hierarchy changes

Test plan

  • Build and run on iOS Simulator
  • Verify accessibility identifiers are set via Xcode Accessibility Inspector
  • Update Saucelabs test scripts to use accessibility id selectors (e.g. AddToCart_Spider Plant, CartItem_Plant Mood)

🤖 Generated with Claude Code

Enables Saucelabs tests to use stable accessibility ID selectors
instead of brittle XPath that breaks on view hierarchy changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.518%. Comparing base (9c96dad) to head (9753a90).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
EmpowerPlant/CartItemCell.swift 0.000% 1 Missing ⚠️
EmpowerPlant/ProductTableViewCell.swift 75.000% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##            master      #140       +/-   ##
=============================================
+ Coverage   29.460%   37.518%   +8.058%     
=============================================
  Files           14        14               
  Lines         1334      1338        +4     
  Branches       385       385               
=============================================
+ Hits           393       502      +109     
+ Misses         928       817      -111     
- Partials        13        19        +6     
Files with missing lines Coverage Δ
EmpowerPlant/CartItemCell.swift 0.000% <0.000%> (ø)
EmpowerPlant/ProductTableViewCell.swift 78.125% <75.000%> (+78.125%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c96dad...9753a90. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kpujjigit
Copy link
Copy Markdown
Contributor Author

image demo sentry io_issues_6396911541__project=4508968167538688 query=is%3Aunresolved referrer=issue-stream (1)

@kpujjigit kpujjigit merged commit bda5829 into master Apr 1, 2026
6 of 7 checks passed
@kpujjigit kpujjigit deleted the saucelabs-use-attribute-ids branch April 1, 2026 19:02
@maxkosty maxkosty self-requested a review April 1, 2026 19:18
let safeName = name ?? "Unknown"
nameLabel.text = safeName
accessibilityIdentifier = "ProductCell_\(safeName)"
addToCartButton.accessibilityIdentifier = "AddToCart_\(safeName)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I wonder what the heck is name. I guess I'll just have to find out with Appium Inspector

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.

2 participants