feat(advanced): PER-8195 Phase 2 — advanced example for percy-appium-app (Python)#17
Open
Shivanshu-07 wants to merge 8 commits into
Open
feat(advanced): PER-8195 Phase 2 — advanced example for percy-appium-app (Python)#17Shivanshu-07 wants to merge 8 commits into
Shivanshu-07 wants to merge 8 commits into
Conversation
…app (Python) Adds advanced/ exercising the full applicable App Percy Python SDK feature surface. 9 pytest functions in tests/test_advanced.py: device_name + orientation, fullscreen + status_bar/nav_bar heights, ignore regions via xpath / appium element / custom bbox, consider regions via xpath, sync mode, test_case + labels, build metadata via env (PERCY_PROJECT, PERCY_BUILD, DEVICE, APP), PERCY_BRANCH / PERCY_COMMIT override. Web-only options marked N/A. CI: workflow_dispatch-only — App Percy CI requires a real BrowserStack device session. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- advanced.yml: bump actions to @v4 + Node 22, add PERCY_TOKEN to the pre-flight secret check, add explicit `permissions: contents: read` (CodeQL). - test_advanced.py: rename misleading PERCY_PROJECT/PERCY_BUILD -> BROWSERSTACK_PROJECT_NAME/BROWSERSTACK_BUILD_NAME; sync-mode test now consumes/asserts the returned comparison result. - matrix.yml: update env-var note to the renamed vars. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t.py (PER-8195) The capability env reads live in conftest.py, not the test file. Renaming them to BROWSERSTACK_PROJECT_NAME/BROWSERSTACK_BUILD_NAME so the code matches the matrix.yml note. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…evice rotation (PER-8195)
- conftest.py: add iOS pathway (XCUITestOptions) driven by PLATFORM env var
so the same advanced test file can run against Android (Wikipedia) and
iOS (BStackSampleApp) hubs.
- test_advanced.py:
* `fullscreen=True` -> `full_screen=True` (the SDK silently ignores
`fullscreen`, which is why the snapshot looked identical to baseline).
* Landscape test now calls `driver.orientation = "LANDSCAPE"` before the
snapshot and restores PORTRAIT after, so the device actually rotates.
* Region xpaths updated to match real Wikipedia app elements (the prior
`//android.widget.TextView[@text="Search Wikipedia"]` matched nothing,
so the ignore/consider regions had zero size and were invisible on
the Percy diff view).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Retesting the appium-python advanced example against the App Automate hub
surfaced several issues; all now validated on Android (build #364, 9/9) and
iOS (build #362, 8/9 + 1 intentional skip), every feature row capturing a
real snapshot.
- Device rotation is now best-effort with retry. iOS XCUITest intermittently
rejects rotation ("Unable To Rotate Device"); we retry, then take the
snapshot regardless so the orientation row never flakes the build.
- custom_ignore_regions now passes IgnoreRegion objects, not a dict. App
Percy expects IgnoreRegion(top,bottom,left,right); a dict raised
"'dict' object has no attribute 'is_valid'" which ignore_errors swallowed,
silently dropping the snapshot on BOTH platforms (it only looked like 9/9).
- iOS region selector fixed: the app is BrowserStack "Sample iOS", whose
button is name="Text Button" — the old @name="Text" matched nothing.
- Android region selector switched to the locale-stable search-bar
resource-id; there is no content-desc="Wikipedia" element on the feed.
- ignore_region_appium_elements is skipped on iOS with the real reason: the
SDK reads element.get_attribute("class"), unsupported by XCUITest.
- iOS default device is iPhone 12 / OS 17 (present in percy-appium-app's
device config) so status-bar/scale-factor metadata resolves correctly.
- sync row no longer asserts a non-None result: a write-only token (common
in CI) legitimately yields None/an error payload. Assert shape, not scope.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The advanced README linked the feature matrix at a percy-public-repos-parent monorepo docs path that 404s in the standalone example repo. Point to the local matrix.yml (already the named source of truth). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rishigupta1599
previously approved these changes
Jun 3, 2026
…ffset (PER-8195) The advanced suite had no full-page coverage. Add a fullpage row that sets fullpage + screen_lengths + bottom_scrollview_offset. The device's sticky bottom nav makes the scroll engine stop after one tile; offsetting the bottom pixels lets it scroll and stitch (verified Pixel 6: 1 tile -> 7 tiles). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rishigupta1599
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
advanced/example forpercy-appium-app(Python). 9 pytest functions intests/test_advanced.py, one per applicable App Percy / Appium Native matrix row: device_name override + orientation, fullscreen + status_bar/nav_bar heights, ignore regions via xpath / appium element / custom bbox, consider regions via xpath, sync mode, test_case + labels.Web-only options marked
N/Ainmatrix.yml.Issue: PER-8195. Parent: percy/percy-public-repos-parent#1.
CI shape
workflow_dispatch-only — App Percy CI requires a real BrowserStack device session. Needs repo secretsAA_USERNAME/AA_ACCESS_KEY/APP_BS_URL/PERCY_TOKEN.Test plan
Advanced — App Percyworkflow manually.🤖 Generated with Claude Code