Skip to content

Instantly share code, notes, and snippets.

@SarahElson
SarahElson / lambdatest-config.json
Last active September 17, 2024 14:57
How To Run Cypress Tests In Azure DevOps Pipeline
{
"lambdatest_auth": {
"username": "<username>",
"access_key": "<access_key>"
},
"browsers": [
{
"browser": "Chrome",
"platform": "Windows 10",
"versions": ["latest"]
@SarahElson
SarahElson / azure-pipelines.yml
Created September 17, 2024 14:05
How To Run Cypress Tests In Azure DevOps Pipeline
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
@SarahElson
SarahElson / testng.xml
Created September 13, 2024 12:54
How to Test Biometric Authentication With Appium
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Biometric authentication tests for Android using appium">
<test name="WebDriverIO Android App Biometric Authentication Test">
<parameter name="deviceType" value="local"/>
<classes>
<class name="io.github.mfaisalkhatri.tests.BiometricAuthTests">
<methods>
<include name="testFingerPrintAuthenticationLogin"/>
</methods>
@SarahElson
SarahElson / LoginPage.java
Created September 13, 2024 12:54
How to Test Biometric Authentication With Appium
public class LoginPage {
private final AndroidDriver androidDriver;
private final WebDriverWait wait;
public LoginPage(final AndroidDriver androidDriver) {
this.androidDriver = androidDriver;
this.wait = new WebDriverWait(androidDriver, Duration.ofSeconds(10));
}
@SarahElson
SarahElson / MainPage.java
Created September 13, 2024 12:53
How to Test Biometric Authentication With Appium
public class MainPage {
private final AndroidDriver androidDriver;
public MainPage(final AndroidDriver androidDriver) {
this.androidDriver = androidDriver;
}
public void openMenu(final String menuName) {
this.androidDriver.findElement(AppiumBy.accessibilityId(menuName)).click();
@SarahElson
SarahElson / BiometricAuthTests.java
Created September 13, 2024 12:51
How to Test Biometric Authentication With Appium
public class BiometricAuthTests extends BaseTest {
@Test
public void testFingerPrintAuthenticationLogin() {
final MainPage mainPage = new MainPage(this.androidDriverManager.getAndroidDriver());
final LoginPage loginPage = mainPage.openLoginPage();
loginPage.performBioMetricLogin(1);
@SarahElson
SarahElson / BaseTest.java
Created September 13, 2024 12:50
How to Test Biometric Authentication With Appium
public class BaseTest {
protected AndroidDriverManager androidDriverManager;
@Parameters({"deviceType"})
@BeforeClass(alwaysRun = true)
public void setup(final String deviceType) {
this.androidDriverManager = new AndroidDriverManager();
if (deviceType.equalsIgnoreCase("LOCAL")) {
@SarahElson
SarahElson / AndroidDriverManager.java
Created September 13, 2024 12:49
How to Test Biometric Authentication With Appium
public void createAndroidDriver() {
try {
this.androidDriver = new AndroidDriver(new URL("http://127.0.0.1:4723/"), uiAutomator2Options());
} catch (final MalformedURLException e) {
throw new Error("Error while setting up Android Driver", e);
}
setupDriverTimeouts();
}
@SarahElson
SarahElson / testng.xml
Created September 13, 2024 12:43
How to Test Biometric Authentication With Appium
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Biometric authentication tests for Android using appium">
<test name="Instrumentation App Biometric Authentication Tests" >
<classes>
<class name="io.github.mfaisalkhatri.tests.BiometricAuthTests">
<methods>
<include name="testSuccessfulBiometricAuthenticationUsingLambdaTest"/>
<include name="testFailedBiometricAuthenticationUsingLambdaTest"/>
</methods>
@SarahElson
SarahElson / Homepage.java
Last active September 13, 2024 14:49
How to Test Biometric Authentication With Appium
public class HomePage {
private final AndroidDriver androidDriver;
public HomePage(final AndroidDriver androidDriver) {
this.androidDriver = androidDriver;
}
private WebElement biometricBtn() {
return this.androidDriver.findElement(AppiumBy.id("com.poc.sample:id/biometric"));