This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pytest | |
from os import environ | |
import time | |
from selenium.webdriver import ChromeOptions | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium import webdriver | |
from selenium.webdriver.support import expected_conditions as EC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
import aiohttp | |
import sys | |
import os | |
# Add the project directory to the system path | |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'app'))) | |
from fastapi.testclient import TestClient | |
from main import app # Import the app from app/main.py | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import ssl | |
import certifi | |
import aiohttp | |
from fastapi import FastAPI, HTTPException | |
from dotenv import load_dotenv | |
load_dotenv() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lambdatest_auth": { | |
"username": "<username>", | |
"access_key": "<access_key>" | |
}, | |
"browsers": [ | |
{ | |
"browser": "Chrome", | |
"platform": "Windows 10", | |
"versions": ["latest"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) { |