Skip to content

Conversation

@bheemreddy-samsara
Copy link

Summary

  • Add device.backgroundApp() method to send mobile apps to background during testing
  • Delegates to Appium's native mobile: backgroundApp command
  • Supports both timed (auto-return) and indefinite backgrounding

Changes

  • Added backgroundApp(seconds: number = -1) method to Device class
  • Created comprehensive unit tests for the new method
  • Added changeset for version management (patch bump)

Use Cases

  • Testing app behavior when backgrounded for a specific duration
  • Testing app state restoration after being backgrounded
  • Battery/power testing scenarios (backgrounding indefinitely)
  • Simulating user switching between apps

Test Plan

  • Unit tests added and passing (2 tests)
  • Tests cover default behavior (indefinite backgrounding)
  • Tests cover custom duration parameter
  • Manual testing on iOS simulator
  • Manual testing on Android emulator

🤖 Generated with Claude Code

@changeset-bot
Copy link

changeset-bot bot commented Nov 2, 2025

🦋 Changeset detected

Latest commit: 1138ece

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

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

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

@bheemreddy-samsara bheemreddy-samsara force-pushed the background-app-support branch 7 times, most recently from 8ad4f46 to 56a9c99 Compare November 2, 2025 21:23
Add backgroundApp() method to delegate to Appium's mobile: backgroundApp command.
Allows sending apps to background for testing scenarios like state restoration
and battery testing.
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