Skip to content

Conversation

@bheemreddy-samsara
Copy link

Summary

This PR adds comprehensive AWS Device Farm integration for mobile app testing, enabling teams to run tests on real devices in AWS's device cloud.

Features

  • AWS Device Farm Provider: Complete implementation with support for both Android and iOS testing
  • Automated App Upload: Automatically uploads APK/IPA files to Device Farm during test setup
  • ARN Persistence: Intelligently reuses uploaded builds across test runs to minimize upload time
  • Remote Session Management: Creates and manages Device Farm remote access sessions
  • Video Recording: Automatic video capture of test sessions with download capability
  • Flexible Configuration: Support for custom capabilities, interaction modes, and session settings

Technical Details

  • Added comprehensive test suite with 15 tests covering all functionality
  • Implemented proper async cleanup callbacks for resource management
  • Enhanced error handling with descriptive error messages
  • Added support for AWS region configuration
  • Improved WebDriver connection handling with query parameter support

Configuration Example

export default defineConfig({
  use: {
    platform: Platform.ANDROID,
    buildPath: "./app.apk",
    device: {
      provider: "aws-device-farm",
      projectArn: "arn:aws:devicefarm:us-west-2:123:project:456",
      deviceArn: "arn:aws:devicefarm:us-west-2::device:789",
      region: "us-west-2",
      sessionName: "My Test Session",
      remoteRecordEnabled: true,
    },
  },
});

This provider enables teams to leverage AWS Device Farm's extensive device library for comprehensive mobile testing without maintaining physical device labs.

Testing

All tests pass:

  • ✅ 15 AWS Device Farm provider tests
  • ✅ Linting passes
  • ✅ Build successful

This release introduces complete AWS Device Farm integration for mobile app testing,
enabling teams to run tests on real devices in AWS's device cloud.

Features:
- Complete AWS Device Farm provider implementation for Android and iOS
- Automated app upload with intelligent ARN persistence across test runs
- Remote session management with proper cleanup on failures
- Automatic video recording and download capability for test sessions
- Flexible configuration with custom capabilities and session parameters
- Support for both explicit appArn and buildPath configurations

Critical Fixes:
- Preserve appArn during provider construction for explicit configurations
- Stop AWS remote sessions when WebDriver.newSession fails to prevent leaks
- Add required app capability for Appium sessions to work out of the box
- Handle AWS signature query parameters correctly in WebDriver connections
- Implement async cleanup callbacks for proper resource management
- Fix video download stream handling for node-fetch v3 compatibility

Technical Improvements:
- Added comprehensive test suite with 15 tests covering all functionality
- Implemented proper async cleanup callbacks for resource management
- Enhanced error handling with descriptive error messages
- Added support for AWS region configuration
- Improved WebDriver connection handling with query parameter support
- Added pre-commit hooks to prevent lint errors
- Minor refactoring in emulator provider for cleaner code

This enables Playwright tests to run on real devices via AWS Device Farm
with automatic video capture attached to test reports.
@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: d454246

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
appwright Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant