-
-
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 all 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.appium.java_client.ios; | ||
|
||
import static io.appium.java_client.ios.IOSMobileCommandHelper.touchIdCommand; | ||
|
||
import io.appium.java_client.CommandExecutionHelper; | ||
import io.appium.java_client.ExecutesMethod; | ||
|
||
public interface PerformsTouchID extends ExecutesMethod { | ||
|
||
/** | ||
* Simulate touchId event | ||
* | ||
* @param match If true, simulates a successful fingerprint scan. If false, simulates a failed fingerprint scan. | ||
*/ | ||
default void performTouchID(boolean match) { | ||
CommandExecutionHelper.execute(this, touchIdCommand(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 { | ||
|
||
protected static IOSDriver<MobileElement> driver; | ||
|
@@ -91,4 +92,15 @@ public class XCUIAutomationTest { | |
driver.rotate(landscapeLeftRotation); | ||
assertEquals(driver.rotation(), landscapeLeftRotation); | ||
} | ||
|
||
@Test public void testTouchId() { | ||
try { | ||
driver.performTouchID(true); | ||
driver.performTouchID(false); | ||
assertEquals(true, true); | ||
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. Actual Usecase of API Otherwise Can we lock the simulator and unlock the simulator using 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. So test scenario should be something like,
|
||
} catch (Exception e) { | ||
throw e; | ||
} | ||
|
||
} | ||
} |
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 Can you add some tests here?
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.
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.