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 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(); | |
} |
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="Instrumentation App Biometric Authentication Tests" > | |
<classes> | |
<class name="io.github.mfaisalkhatri.tests.BiometricAuthTests"> | |
<methods> | |
<include name="testSuccessfulBiometricAuthenticationUsingLambdaTest"/> | |
<include name="testFailedBiometricAuthenticationUsingLambdaTest"/> | |
</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 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")); |
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 testSuccessfulBiometricAuthenticationUsingLambdaTest() { | |
final HomePage homePage = new HomePage(this.androidDriverManager.getAndroidDriver()); | |
homePage.performSuccessBioMetricAuthenticationOnRealDevice(); | |
assertEquals(homePage.getMessageText(), "Success"); | |
} |
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; | |
@BeforeClass(alwaysRun = true) | |
public void setup(final String deviceType) { | |
this.androidDriverManager = new AndroidDriverManager(); | |
this.androidDriverManager.createAndroidDriverInCloud(); | |
} |
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 AndroidDriverManager { | |
private AndroidDriver androidDriver; | |
public void createAndroidDriverInCloud() { | |
final String ltUserName = System.getenv("LT_USERNAME"); | |
final String ltAccessKey = System.getenv("LT_ACCESS_KEY"); | |
final String gridUrl = "@mobile-hub.lambdatest.com/wd/hub"; |
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="Automating Pagination with Selenium"> | |
<test name="Pagination tests - LambdaTest e-commerce website"> | |
<classes> | |
<class name="io.github.mfaisalkhatri.paginationdemo.tests.SeleniumPaginationTests"> | |
<methods> | |
<include name="testProductDetailsOnAllPage"/> | |
<include name="testFilterRecordsOnPage"/> | |
<include name="testSearchForProduct"/> |
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 RemoteWebDriver driver; | |
@BeforeClass | |
public void setup() { | |
String USERNAME = System.getenv("LT_USERNAME") == null ? "LT_USERNAME" : System.getenv("LT_USERNAME"); | |
String ACCESS_KEY = System.getenv("LT_ACCESS_KEY") == null ? "LT_ACCESS_KEY" : System.getenv("LT_ACCESS_KEY"); | |
String GRID_URL = "@hub.lambdatest.com/wd/hub"; |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>io.github.mfaisalkhatri</groupId> | |
<artifactId>selenium-lambdatest-demo</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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
from selenium import webdriver | |
from base import SampleTest | |
import unittest | |
class DataIntegrityTest(SampleTest): | |
def test_data_integration(self): | |
driver = self.driver | |
driver.get("https://ecommerce-playground.lambdatest.io/index.php?route=common/home") |