Skip to content

feat(advanced): PER-8195 Phase 2 — advanced example for percy-appium-app (Python)#17

Open
Shivanshu-07 wants to merge 8 commits into
mainfrom
per-8195-phase-2-appium-python
Open

feat(advanced): PER-8195 Phase 2 — advanced example for percy-appium-app (Python)#17
Shivanshu-07 wants to merge 8 commits into
mainfrom
per-8195-phase-2-appium-python

Conversation

@Shivanshu-07
Copy link
Copy Markdown

@Shivanshu-07 Shivanshu-07 commented May 21, 2026

Summary

Adds an advanced/ example for percy-appium-app (Python). 9 pytest functions in tests/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/A in matrix.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 secrets AA_USERNAME / AA_ACCESS_KEY / APP_BS_URL / PERCY_TOKEN.

Test plan

  • Maintainer triggers Advanced — App Percy workflow manually.
  • Verify a Percy build lands with the 9 advanced screenshots.

🤖 Generated with Claude Code

…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>
Comment thread .github/workflows/advanced.yml Fixed
Shivanshu-07 and others added 2 commits May 27, 2026 17:06
- 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>
@Shivanshu-07 Shivanshu-07 marked this pull request as ready for review May 27, 2026 13:41
@Shivanshu-07 Shivanshu-07 requested a review from a team as a code owner May 27, 2026 13:41
Shivanshu-07 and others added 3 commits May 28, 2026 10:30
…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
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>
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