Skip to content
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

fix: Refactor parameter names and update documentation #901

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

Dor-bl
Copy link
Collaborator

@Dor-bl Dor-bl commented Feb 9, 2025

Refactored parameter names across multiple interfaces for clarity:

  • IPushesFiles.PushFile: base64Data to stringData and file
  • IFindsByFluentSelector.FindElements: by to selector
  • IInteractsWithApps: appPath to bundleId and appId
  • ITouchAction.LongPress: el to element

Updated documentation comments for better compatibility:

  • INetworkActions.ToggleData: <= to &lt;=
  • Removed empty <param> tag in INetworkActions.SetGsmSignalStrength

List of changes

Please provide a briefly described change list that you are going to propose.

Types of changes

What types of changes are you proposing/introducing to the .NET client?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change that adds functionality or value)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • Test fix (non-breaking change that improves test stability or correctness)

Documentation

  • Have you proposed a file change/ PR with Appium to update documentation?

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

  • Have you provided integration tests for your changes? (required for Bugfix, New feature, or Test fix)

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

Refactored parameter names across multiple interfaces for clarity:
- `IPushesFiles.PushFile`: `base64Data` to `stringData` and `file`
- `IFindsByFluentSelector.FindElements`: `by` to `selector`
- `IInteractsWithApps`: `appPath` to `bundleId` and `appId`
- `ITouchAction.LongPress`: `el` to `element`

Updated documentation comments for better compatibility:
- `INetworkActions.ToggleData`: `<=` to `&lt;=`
- Removed empty `<param>` tag in `INetworkActions.SetGsmSignalStrength`
@@ -24,7 +24,7 @@ public interface IPushesFiles : IInteractsWithFiles
/// </summary>
/// <param name="pathOnDevice">Path to file to write data to on remote device</param>
/// <param name="stringData">A string to write to remote device</param>
void PushFile(string pathOnDevice, string base64Data);
void PushFile(string pathOnDevice, string stringData);
Copy link

@mykola-mokhnach mykola-mokhnach Feb 10, 2025

Choose a reason for hiding this comment

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

I'm confused here. Which data type is actually expected by this API? The appium server API does expect a base64-encoded string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is indeed an overload that also accepts base64-encoded string.

/// <summary>
/// Saves a string as a file on the remote mobile device.
/// </summary>
/// <param name="pathOnDevice">Path to file to write data to on remote device</param>
/// <param name="stringData">A string to write to remote device</param>
void PushFile(string pathOnDevice, string stringData);
/// <summary>
/// Saves base64 encoded data as a file on the remote mobile device.
/// </summary>
/// <param name="pathOnDevice">Path to file to write data to on remote device</param>
/// <param name="base64Data">Base64 encoded byte array of data to write to remote device</param>
void PushFile(string pathOnDevice, byte[] base64Data);

Choose a reason for hiding this comment

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

I just wanted to make sure the argument that is actually sent to the server is base64-encoded.

@Dor-bl Dor-bl merged commit 5e8a09c into appium:main Feb 11, 2025
3 checks passed
@Dor-bl Dor-bl deleted the xml_fixes branch March 10, 2025 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants