-
-
Notifications
You must be signed in to change notification settings - Fork 762
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
TouchID Implementation [iOS Sim Only] #509
Changes from 2 commits
934d819
7ec088f
9f214cd
897330c
39823da
e5a500b
6880006
7ee13c9
1e395ff
56dc2f0
fd9543c
5b561e9
8071a8b
605eb3e
a9e580b
d6a93c8
2f6f8ab
309862d
fec5168
847dd63
4233982
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
|
||
import static io.appium.java_client.ios.IOSMobileCommandHelper.hideKeyboardCommand; | ||
import static io.appium.java_client.ios.IOSMobileCommandHelper.shakeCommand; | ||
import static io.appium.java_client.ios.IOSMobileCommandHelper.touchIdCommand; | ||
|
||
import io.appium.java_client.CommandExecutionHelper; | ||
import io.appium.java_client.DeviceActionShortcuts; | ||
|
@@ -56,5 +57,14 @@ default void hideKeyboard(String strategy, String keyName) { | |
default void shake() { | ||
CommandExecutionHelper.execute(this, shakeCommand()); | ||
} | ||
|
||
/** | ||
* Simulate touchId event | ||
* | ||
* @param match Are we simulating a successful fingerprint scan? | ||
*/ | ||
default void touchId(boolean match) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add in doc as it is Simulator only? |
||
CommandExecutionHelper.execute(this, touchIdCommand(match)); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,4 +81,15 @@ public class IOSMobileCommandHelper extends MobileCommand { | |
return new AbstractMap.SimpleEntry<>( | ||
SHAKE, ImmutableMap.<String, Object>of()); | ||
} | ||
|
||
/** | ||
* This method forms a {@link java.util.Map} of parameters for the touchId simulator | ||
* | ||
* @param match Are we simulating a successful fingerprint scan? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is it a question here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's how I've documented boolean parameters in the past. I'll change it to be more in line with how it's normally documented. |
||
* | ||
*/ | ||
public static Map.Entry<String, Map<String, ?>> touchIdCommand(boolean match) { | ||
return new AbstractMap.SimpleEntry<>( | ||
TOUCH_ID, prepareArguments("match", match)); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ | |
|
||
package io.appium.java_client.ios; | ||
|
||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import io.appium.java_client.MobileElement; | ||
import io.appium.java_client.remote.AutomationName; | ||
import io.appium.java_client.remote.IOSMobileCapabilityType; | ||
|
@@ -31,8 +34,6 @@ | |
|
||
import java.io.File; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class XCUIAutomationTest { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dpgraham Can you add some tests here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the test. It doesn't do any assertions because there isn't anything to check, it just calls the methods to verify that there aren't any exceptions. |
||
|
||
protected static IOSDriver<MobileElement> driver; | ||
|
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.
@dpgraham
I am against the adding to the
IOSDeviceActionShortcuts
. This interface is going to be deprecated. Please take a look at this working branch. IOSDeviceActionShortcuts is going to be deprecated.It is better to add such interface:
and make IOSDriver implement it.
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.
Thanks for the input Sergey. I made the change.