-
Notifications
You must be signed in to change notification settings - Fork 187
feat: implement StartActivity method for Android activities #986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a strongly-typed StartActivity method for the Android driver to simplify launching Android activities with various configuration options. The implementation wraps the mobile:startActivity script command with a type-safe API and includes comprehensive parameter support for intent arguments, flags, and activity options.
Key Changes:
- Added
StartActivitymethod toAndroidCommandExecutionHelperandAndroidDriverwith support for 15 optional parameters including wait, stop, windowing mode, action, URI, categories, extras, and flags - Refactored integration tests in
ElementTest.csto use the new method instead of rawExecuteScriptcalls
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Appium.Net/Appium/Android/AndroidCommandExecutionHelper.cs | Implements the core StartActivity method with parameter validation and dictionary building logic to construct the mobile command |
| src/Appium.Net/Appium/Android/AndroidDriver.cs | Exposes the StartActivity method as a public API on the driver class with XML documentation |
| test/integration/Android/ElementTest.cs | Updates four test methods to use the new StartActivity method for improved readability and type safety |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…hanced flexibility
List of changes
This pull request introduces a new, strongly-typed
StartActivitymethod for starting Android activities in the Appium .NET client, making it easier and safer to launch activities with a variety of parameters. The change is implemented both in the command execution helper and exposed as a convenient method on theAndroidDriverclass. The integration tests are updated to use this new method, replacing direct calls toExecuteScriptfor starting activities.Android Activity Launch Improvements:
StartActivitymethod toAndroidCommandExecutionHelperthat accepts strongly-typed parameters for launching Android activities, supporting all relevant intent arguments and options.StartActivitymethod on theAndroidDriverclass, allowing users to start activities using a simple, type-safe API instead of constructing raw script commands.Test Suite Updates:
ElementTest.csto use the newStartActivitymethod rather than the lower-levelExecuteScriptcall, improving readability and maintainability. [1] [2] [3] [4]Types of changes
What types of changes are you proposing/introducing to the .NET client?
Put an
xin the boxes that applyDocumentation
This can be done by navigating to the documentation section on http://appium.io selecting the appropriate command/endpoint and clicking the 'Edit this doc' link to update the C# example
Integration tests
Details
Please provide more details about changes if necessary. You can provide code samples showing how they work and possible use cases if there are new features. Also, you can create gists with pasted C# code samples or put them here using markdown.
About markdown please read Mastering markdown and Writing on GitHub