Skip to content

MPT-16070 / MPT-16069 agreements subscriptions list pages#103

Merged
bpolgar-swo merged 9 commits intomainfrom
MPT-16070_MPT-16069_agreements-subscriptions-list-pages
Jan 27, 2026
Merged

MPT-16070 / MPT-16069 agreements subscriptions list pages#103
bpolgar-swo merged 9 commits intomainfrom
MPT-16070_MPT-16069_agreements-subscriptions-list-pages

Conversation

@bpolgar-swo
Copy link
Contributor

Branch: MPT-16070_MPT-16069_agreements-subscriptions-list-pages
Tickets: MPT-16070, MPT-16069

Summary

E2E test coverage for Agreements and Subscriptions list pages, with critical fixes for Android selectors and updated documentation clarifying the testID vs accessibilityLabel distinction on Android.

Changes

Test Suites

  • agreements.e2e.js:
    • Navigation via More menu
    • Page structure validation (header, footer, back button)
    • Empty state handling
    • Agreements list with ID/status validation
    • API integration tests
  • subscriptions.e2e.js - Enhanced with:
    • Header title and account button tests
    • Subscription items with ID/status parsing
    • API integration for count/data validation
    • Status filtering (Active, Terminated, Updating, Terminating)

Page Objects

  • agreements.page.js:
    • Loading/empty/error state selectors
    • Agreement list item selectors with status parsing
    • Navigation helpers (goBack, waitForScreenReady)
    • Cross-platform selectors using @resource-id for Android
  • more.page.js - Extended with:
    • All menu item selectors (Agreements, Credit Memos, Invoices, Statements, Users, Programs)
    • Navigation helpers for each menu item
    • Fixed Android selectors to use @resource-id instead of ~id
  • subscriptions.page.js - Extended with:
    • Subscription list item selectors
    • Status-based filtering
    • ensureSubscriptionsPage() navigation helper
    • Fixed accountButton selector for Android
  • orders.page.js - Fixed accountButton selector for Android

Infrastructure

  • api-client.js - Added methods:
    • getSubscriptions(), getSubscriptionById(), getSubscriptionsByStatus()
    • getAgreements(), getAgreementById(), getAgreementsByStatus()
  • selectors.js - Enhanced JSDoc documentation:
    • byResourceId() marked as RECOMMENDED for testID
    • byAccessibilityId() warning about Android content-desc behavior
  • wdio.conf.js - Added subscriptions and agreements test suites

Documentation Updates

  • TEST_ELEMENT_IDENTIFICATION_STRATEGY.md - Critical clarifications:
    • testID maps to resource-id on Android (NOT content-desc)
    • byResourceId() is the correct selector for testID elements
    • byAccessibilityId() only works for accessibilityLabel on Android
    • Updated all code examples to use correct patterns
  • EXTENDING_TEST_FRAMEWORK.md - Added:
    • Warning about Android selector distinction
    • Correct usage examples for testID-based elements

Key Bug Fix: Android Selectors

Problem: Tests were failing on Android because ~nav-account-button and ~nav-menu-agreements selectors weren't finding elements.

Root Cause: On Android:

  • ~id selector looks at content-desc attribute
  • React Native testID prop maps to resource-id attribute (NOT content-desc)

Solution: Use @resource-id XPath for Android:

// Before (broken on Android)
get accountButton() {
    return $(selectors.byAccessibilityId('nav-account-button'));
}

// After (works on both platforms)
get accountButton() {
    return $(getSelector({
        ios: '~nav-account-button',
        android: '//*[@resource-id="nav-account-button"]'
    }));
}

Testing

# Run agreements tests
./scripts/run-local-test.sh agreements
./scripts/run-local-test.sh -p android agreements

# Run subscriptions tests  
./scripts/run-local-test.sh subscriptions
./scripts/run-local-test.sh -p android subscriptions

Files Changed

File Change
app/test/pageobjects/agreements.page.js NEW - Agreements page object
app/test/pageobjects/more.page.js Extended with menu items + Android fixes
app/test/pageobjects/subscriptions.page.js Extended with list items + Android fixes
app/test/pageobjects/orders.page.js Android selector fix
app/test/pageobjects/utils/selectors.js Enhanced JSDoc
app/test/specs/agreements.e2e.js NEW - Agreements test suite
app/test/specs/subscriptions.e2e.js Extended with API integration
app/test/specs/welcome.e2e.js Timeout adjustments
app/test/utils/api-client.js Subscriptions + Agreements API methods
app/wdio.conf.js New test suites
documents/EXTENDING_TEST_FRAMEWORK.md Android selector guidance
documents/TEST_ELEMENT_IDENTIFICATION_STRATEGY.md Critical corrections

Copy link
Collaborator

@GitchalWoo GitchalWoo left a comment

Choose a reason for hiding this comment

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

Looks fantastic

@bpolgar-swo bpolgar-swo merged commit cd67aca into main Jan 27, 2026
6 checks passed
@bpolgar-swo bpolgar-swo deleted the MPT-16070_MPT-16069_agreements-subscriptions-list-pages branch January 27, 2026 11:39
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