Skip to content

BREAKING CHANGE: use extension commands for deprecated endpoints #939

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

Merged
merged 49 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
66e9efc
feat: use mobile:background
KazuCocoa May 5, 2025
bb601d3
pdate clipboard stuff
KazuCocoa May 11, 2025
2542436
simplify a bit
KazuCocoa May 11, 2025
59a7989
turn
KazuCocoa May 11, 2025
06ca05d
query app state
KazuCocoa May 11, 2025
60f44e5
add /se
KazuCocoa May 15, 2025
7e0c572
update for device time
KazuCocoa May 15, 2025
36c8977
update for system bar
KazuCocoa May 15, 2025
8ff9220
device density command
KazuCocoa May 15, 2025
aecf529
gps
KazuCocoa May 15, 2025
83cbd42
replace android smulator stuff
KazuCocoa May 15, 2025
c990f61
activities
KazuCocoa May 15, 2025
efe2039
pressKeys
KazuCocoa May 15, 2025
093bc24
long press
KazuCocoa May 15, 2025
fcecd7f
keyboards
KazuCocoa May 16, 2025
a976847
touch id etc
KazuCocoa May 16, 2025
e247c7d
change rest
KazuCocoa May 16, 2025
e6d66b4
use Array.Empty<object>
KazuCocoa May 17, 2025
8fdec23
use proper args
KazuCocoa May 17, 2025
e4cef26
adjust arguments
KazuCocoa May 17, 2025
bce7f86
remove ToggleAirplaneMode
KazuCocoa May 17, 2025
0b800b9
remove ToggleData
KazuCocoa May 17, 2025
1aa6456
remove ToggleWifi
KazuCocoa May 17, 2025
a07868e
remove connection type stuff
KazuCocoa May 17, 2025
e90ea69
remove EndTestCoverage
KazuCocoa May 17, 2025
daa2180
update start activity
KazuCocoa May 17, 2025
1a0a020
Update test/integration/Android/Device/App/AppTests.cs
KazuCocoa May 19, 2025
19b5a35
replace windows stuff
KazuCocoa May 19, 2025
fe1f83a
Merge branch 'extention-commands' of github.com:appium/dotnet-client …
KazuCocoa May 19, 2025
28f77ea
update readme and rmeove redundant spaces
KazuCocoa May 19, 2025
da7f31d
fix review
KazuCocoa May 19, 2025
3b2a205
tweak review
KazuCocoa May 19, 2025
ad5834c
fix typo
KazuCocoa May 19, 2025
823e020
cleanup a bit more
KazuCocoa May 19, 2025
862f7f5
tweak the readme
KazuCocoa May 19, 2025
e62c602
Apply suggestions from code review
KazuCocoa May 19, 2025
b200293
update readme
KazuCocoa May 25, 2025
54fdc79
modify the readme format
KazuCocoa May 25, 2025
bdb386d
add xml doc
KazuCocoa May 25, 2025
cfbf58e
Merge branch 'extention-commands' of github.com:appium/dotnet-client …
KazuCocoa May 25, 2025
acab15b
extract to private methods for press key code stuff
KazuCocoa May 25, 2025
bae40c6
fix table format
KazuCocoa May 25, 2025
47c51ea
add xml doc
KazuCocoa May 25, 2025
b99efa7
Update README.md
KazuCocoa May 25, 2025
f109cc0
applyl suggestion
KazuCocoa May 25, 2025
93ca05b
Merge branch 'extention-commands' of github.com:appium/dotnet-client …
KazuCocoa May 25, 2025
94dd159
update readme
KazuCocoa May 28, 2025
dd58fe7
use shared method
KazuCocoa May 28, 2025
3812d96
fix typo
KazuCocoa May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/Appium.Net/Appium/AppiumCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ public class AppiumCommand

#endregion

// TODO: Use mobile:shake
new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.ShakeDevice,
"/session/{sessionId}/appium/device/shake"),
// TODO: Use mobile:pressKey
new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.PressKeyCode,
"/session/{sessionId}/appium/device/press_keycode"),
Expand Down Expand Up @@ -148,9 +145,6 @@ public class AppiumCommand

#endregion (WinAppDriver) legacy app management

// TODO: Use mobile:backgroundApp
new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.BackgroundApp,
"/session/{sessionId}/appium/app/background"),
// TODO: Remove
new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.EndTestCoverage,
"/session/{sessionId}/appium/app/end_test_coverage"),
Expand Down
26 changes: 20 additions & 6 deletions src/Appium.Net/Appium/AppiumDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,27 @@ public void PushFile(string pathOnDevice, FileInfo file) =>
public void FingerPrint(int fingerprintId) =>
AppiumCommandExecutionHelper.FingerPrint(this, fingerprintId);

public void BackgroundApp() =>
Execute(AppiumDriverCommand.BackgroundApp,
AppiumCommandExecutionHelper.PrepareArgument("seconds", -1));
public void BackgroundApp() {
Execute(DriverCommand.ExecuteScript, new Dictionary<string, object> {
["script"] = "mobile:backgroundApp",
["args"] = new object[] {
new Dictionary<string, object> {
["seconds"] = -1
}
}
});
}

public void BackgroundApp(TimeSpan timeSpan) =>
Execute(AppiumDriverCommand.BackgroundApp,
AppiumCommandExecutionHelper.PrepareArgument("seconds", timeSpan.TotalSeconds));
public void BackgroundApp(TimeSpan timeSpan) {
Execute(DriverCommand.ExecuteScript, new Dictionary<string, object> {
["script"] = "mobile:backgroundApp",
["args"] = new object[] {
new Dictionary<string, object> {
["seconds"] = timeSpan.TotalSeconds
}
}
});
}

public AppState GetAppState(string appId) =>
(AppState)Convert.ToInt32(Execute(AppiumDriverCommand.GetAppState,
Expand Down
8 changes: 6 additions & 2 deletions src/Appium.Net/Appium/iOS/IOSCommandExecutionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ namespace OpenQA.Selenium.Appium.iOS
{
public sealed class IOSCommandExecutionHelper
{
public static void ShakeDevice(IExecuteMethod executeMethod) =>
executeMethod.Execute(AppiumDriverCommand.ShakeDevice);
public static void ShakeDevice(IExecuteMethod executeMethod) {
executeMethod.Execute(DriverCommand.ExecuteScript, new Dictionary<string, object> {
["script"] = "mobile: shake",
["args"] = new object[] {}
});
}

public static void PerformTouchID(IExecuteMethod executeMethod, bool match) =>
executeMethod.Execute(AppiumDriverCommand.TouchID,
Expand Down