Skip to content
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

INJIMOB-2722 MOSIP-39001 incorporated changes and updated the prerequisite data #1760

Merged
merged 15 commits into from
Jan 20, 2025
13 changes: 13 additions & 0 deletions injitest/androidRegression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,23 @@
<!-- <include name="verifyTuvaliVersion"/> invalid testcase-->
</methods>
</class>
<class name="androidTestCases.VcDownloadAndVerifyUsingMockIdentity">
<methods>
<include name="downloadAndVerifyVcUsingUinViaMockIdentity"/>
</methods>
</class>
<class name="androidTestCases.keyManagement">
<methods>
<include name="downloadAndVerifyVcUsingUinViaMockIdentity"/>
<include name="downloadAndVerifyVcUsingMockIdentity"/>
<include name="downloadAndVerifyVcUsingEsignet"/>
</methods>
</class>
</classes>
</test>
</suite>


<!--<suite name="All Test Suite">
<listeners>
<listener class-name="inji.utils.SuiteListener" />
Expand Down
72 changes: 45 additions & 27 deletions injitest/src/main/java/inji/pages/AddNewCardPage.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package inji.pages;

import inji.utils.IosUtil;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.iOSXCUITFindBy;
Expand All @@ -11,8 +12,8 @@ public class AddNewCardPage extends BasePage{
@iOSXCUITFindBy(accessibility = "title")
private WebElement addNewCardHeader;

@AndroidFindBy(accessibility = "issuerHeading-MosipOtp")
@iOSXCUITFindBy(accessibility = "issuerHeading-MosipOtp")
@AndroidFindBy(accessibility = "issuerHeading-Mosip")
@iOSXCUITFindBy(accessibility = "issuerHeading-Mosip")
private WebElement downloadViaUin;

@AndroidFindBy(accessibility = "goBack")
Expand All @@ -23,9 +24,6 @@ public class AddNewCardPage extends BasePage{
@iOSXCUITFindBy(accessibility = "issuerHeading-Mosip")
private WebElement downloadViaEsignet;

@AndroidFindBy(accessibility = "issuerHeading-MockCertify")
@iOSXCUITFindBy(accessibility = "issuerHeading-MockCertify")
private WebElement downloadViaMockCertify;
@iOSXCUITFindBy(accessibility = "Continue")
private WebElement continueButton;

Expand All @@ -36,8 +34,8 @@ public class AddNewCardPage extends BasePage{
@iOSXCUITFindBy(accessibility = "issuersScreenDescription")
private WebElement addNewCardGuideMessage;

@AndroidFindBy(accessibility = "issuerDescription-MosipOtp")
@iOSXCUITFindBy(accessibility = "issuerDescription-MosipOtp")
@AndroidFindBy(accessibility = "issuerDescription-Mosip")
@iOSXCUITFindBy(accessibility = "issuerDescription-Mosip")
private WebElement issuerDescriptionMosip;

@AndroidFindBy(accessibility = "issuerDescription-Mosip")
Expand All @@ -60,8 +58,20 @@ public class AddNewCardPage extends BasePage{
@iOSXCUITFindBy(accessibility = "credentialTypeHeading-MosipVerifiableCredential")
private WebElement credentialTypeHeadingMOSIPVerifiableCredential;

@AndroidFindBy(accessibility = "credentialTypeHeading-MockVerifiableCredential_mdoc")
@iOSXCUITFindBy(accessibility = "credentialTypeHeading-MockVerifiableCredential_mdoc")
@AndroidFindBy(accessibility = "credentialTypeValue")
@iOSXCUITFindBy(accessibility = "credentialTypeValue")
private WebElement credentialTypeValue;

@AndroidFindBy(accessibility = "6stepCount")
@iOSXCUITFindBy(accessibility = "6stepCount")
private WebElement DoneButton;

@AndroidFindBy(accessibility = "issuerHeading-MockMdl")
@iOSXCUITFindBy(accessibility = "issuerHeading-MockMdl")
private WebElement downloadViaMockCertify;

@AndroidFindBy(accessibility = "credentialTypeHeading-DrivingLicenseCredential")
@iOSXCUITFindBy(accessibility = "credentialTypeHeading-DrivingLicenseCredential")
private WebElement credentialTypeHeadingMockVerifiableCredential_mdoc;

public AddNewCardPage(AppiumDriver driver) {
Expand Down Expand Up @@ -108,10 +118,6 @@ public boolean isDownloadViaEsignetDisplayed() {
return this.isElementDisplayed(downloadViaEsignet);
}

public boolean isDownloadViaMockCertifyDisplayed() {
return this.isElementDisplayed(downloadViaMockCertify);
}

public boolean isDownloadViaEsignetDisplayedInHindi() {
return this.isElementDisplayed(downloadViaEsignet);
}
Expand All @@ -134,20 +140,6 @@ public EsignetLoginPage clickOnDownloadViaEsignet(){
return new EsignetLoginPage(driver);
}

public MockCertifyLoginPage clickOnDownloadViaMockCertify(){
clickOnElement(downloadViaMockCertify);

try {
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
if(isElementDisplayed(credentialTypeHeadingMockVerifiableCredential_mdoc)) {
clickOnElement(credentialTypeHeadingMockVerifiableCredential_mdoc);
}
return new MockCertifyLoginPage(driver);
}

public void clickOnContinueButtonInSigninPopupIos(){
if(isElementDisplayed(continueButton))
clickOnElement(continueButton);
Expand Down Expand Up @@ -204,5 +196,31 @@ public void clickOnCredentialTypeHeadingInsuranceCredential(){
clickOnElement(credentialTypeHeadingInsuranceCredential);
}
}
public void clickOnDoneButton(){
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
if (isElementDisplayed(DoneButton )){
clickOnElement(DoneButton);
IosUtil.scrollToElement(driver,100,800,100,200);
}
}

public MockCertifyLoginPage clickOnDownloadViaMockCertify(){
clickOnElement(downloadViaMockCertify);

try {
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
if(isElementDisplayed(credentialTypeHeadingMockVerifiableCredential_mdoc)) {
clickOnElement(credentialTypeHeadingMockVerifiableCredential_mdoc);
}
return new MockCertifyLoginPage(driver);
}

}

8 changes: 1 addition & 7 deletions injitest/src/main/java/inji/pages/DetailedVcViewPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ public class DetailedVcViewPage extends BasePage{
@iOSXCUITFindBy(accessibility = "KebabIcon")
public WebElement moreOptionsButton;

@AndroidFindBy(accessibility = "keyTypeVcDetailViewValue")
@iOSXCUITFindBy(accessibility = "keyTypeVcDetailViewValue")
public WebElement keyTypeVcDetailViewValue;

public DetailedVcViewPage(AppiumDriver driver) {
super(driver);
}
Expand Down Expand Up @@ -222,8 +218,6 @@ public void clickOnMoreOptionsInDetails() {
}
clickOnElement(moreOptionsButton);
}
public boolean isKeyTypeVcDetailViewValueDisplayed() {
return isElementDisplayed(keyTypeVcDetailViewValue);
}


}
2 changes: 1 addition & 1 deletion injitest/src/main/java/inji/pages/EsignetLoginPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public class EsignetLoginPage extends BasePage {
private WebElement credentialTypeHeadingMOSIPVerifiableCredential;



public EsignetLoginPage(AppiumDriver driver) {
super(driver);
}
Expand Down Expand Up @@ -117,6 +116,7 @@ public void clickOnEsignetLoginWithOtpButton() {
if(isElementDisplayed(esignetLoginButton)) {
clickOnElement(esignetLoginButton);
}

}

public OtpVerificationPage setEnterIdTextBox(String uinOrVid) {
Expand Down
28 changes: 14 additions & 14 deletions injitest/src/main/java/inji/pages/HistoryPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ public boolean isHistoryPageLoaded() {
}

private boolean verifyHistoryIos(String vcNumber) {
By locator = By.xpath("//*[contains(@name,'National ID " + vcNumber + " is downloaded.')]");
By locator = By.xpath("//*[contains(@name,'National ID is downloaded.')]");
return this.isElementDisplayed(locator);
}

private boolean verifyHistoryAndroid(String vcNumber) {
By locator = By.xpath("//*[contains(@text,'National ID " + vcNumber + " is downloaded.')]");
By locator = By.xpath("//*[contains(@text,'National ID is downloaded.')]");
return this.isElementDisplayed(locator);
}

private boolean verifyHistoryAndroidforInsuranceCard(String vcNumber) {
By locator = By.xpath("//*[contains(@text,'Health Insurance " + vcNumber + " is downloaded.')]");
By locator = By.xpath("//*[contains(@text,'Health Insurance is downloaded.')]");
return this.isElementDisplayed(locator);
}

private boolean verifyHistoryIosInsuranceCard(String vcNumber) {
By locator = By.xpath("//*[@name=\"Health Insurance " + vcNumber + " is downloaded.\"]");
By locator = By.xpath("//*[@name=\"Health Insurance is downloaded.\"]");
return this.isElementDisplayed(locator);
}

Expand All @@ -61,33 +61,33 @@ private boolean verifyActivityHeaderAndroid(String vcNumber) {
}

private boolean verifyDeleteHistoryAndroid(String vcNumber) {
By locator = By.xpath("//*[contains(@text,'MOSIP National ID " + vcNumber + " is removed from wallet.')]");
By locator = By.xpath("//*[contains(@text,'MOSIP National ID is removed from wallet.')]");
return this.isElementDisplayed(locator);
}

private boolean verifyDeletedHistoryIos(String vcNumber) {
By locator = By.xpath("//*[contains(@name,'MOSIP National ID " + vcNumber + " is removed from wallet.')]");
By locator = By.xpath("//*[contains(@name,'MOSIP National ID is removed from wallet.')]");
return this.isElementDisplayed(locator);
}

private boolean verifyDeleteHistoryAndroidInsuranceCard(String vcNumber) {
By locator = By.xpath("//*[contains(@text,'Health Insurance " + vcNumber + " is removed from wallet.')]");
By locator = By.xpath("//*[contains(@text,'Health Insurance is removed from wallet.')]");
return this.isElementDisplayed(locator);
}

private boolean verifyDeletedHistoryIosInsuranceCard(String vcNumber) {
By locator = By.xpath("//*[contains(@name,'Health Insurance " + vcNumber + " is removed from wallet.')]");
By locator = By.xpath("//*[contains(@name,'Health Insurance is removed from wallet.')]");
return this.isElementDisplayed(locator);
}

private int verifyNumberOfRecordsInHistoryAndroid(String vcNumber) throws InterruptedException {
By locator = By.xpath("//*[contains(@text,'" + vcNumber + " is downloaded.')]");
By locator = By.xpath("//*[contains(@text,'is downloaded.')]");
List<WebElement> elements = driver.findElements(locator);
return elements.size();
}

private int verifyNumberOfRecordsInHistoryIos(String vcNumber) {
By locator = By.xpath("//XCUIElementTypeStaticText[@name=\"National ID "+ vcNumber +" is downloaded.\"]");
By locator = By.xpath("//XCUIElementTypeStaticText[@name=\"National ID is downloaded.\"]");

List<WebElement> elements = driver.findElements(locator);
return elements.size();
Expand Down Expand Up @@ -168,12 +168,12 @@ public boolean verifyActivationFailedRecordInHistory(String vcNumber, Target os)
}

private boolean verifyActivationFailedRecordIos(String vcNumber) {
By locator = By.xpath("//*[contains(@name,'National ID " + vcNumber + " has failed.')]");
By locator = By.xpath("//*[contains(@name,'National ID has failed.')]");
return this.isElementDisplayed(locator);
}

private boolean verifyActivationFailedRecordAndroid(String vcNumber) {
By locator = By.xpath("//*[contains(@text,'National ID " + vcNumber + " has failed.')]");
By locator = By.xpath("//*[contains(@text,'National ID has failed.')]");
return this.isElementDisplayed(locator);
}

Expand All @@ -188,14 +188,14 @@ public boolean verifyActivationSuccessfulRecordInHistory(String vcNumber, Target
}

private boolean verifyActivationSuccessfulRecordIos(String vcNumber) {
By locator = By.xpath("//*[contains(@name,'Activation of MOSIP National ID " + vcNumber + " is successful.')]");
By locator = By.xpath("//*[contains(@name,'Activation of MOSIP National ID is successful.')]");
return this.isElementDisplayed(locator);
}



private boolean verifyActivationSuccessfulRecordAndroid(String vcNumber) {
By locator = By.xpath("//*[contains(@text,'Activation of MOSIP National ID " + vcNumber + " is successful.')]");
By locator = By.xpath("//*[contains(@text,'Activation of MOSIP National ID is successful.')]");
return this.isElementDisplayed(locator);
}
}
35 changes: 17 additions & 18 deletions injitest/src/main/java/inji/pages/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public class HomePage extends BasePage {
@iOSXCUITFindBy(accessibility = "fullNameValue")
private WebElement fullNameValue;

@AndroidFindBy(accessibility = "credentialTypeValue")
@iOSXCUITFindBy(accessibility = "credentialTypeValue")
private WebElement credentialTypeValue;

@AndroidFindBy(accessibility = "activationPending")
@iOSXCUITFindBy(accessibility = "activationPending")
private WebElement activationPending;
Expand Down Expand Up @@ -236,6 +240,7 @@ public class HomePage extends BasePage {
@iOSXCUITFindBy(accessibility = "cardViewDescription")
private WebElement cardViewDescription;


public HomePage(AppiumDriver driver) {
super(driver);
}
Expand All @@ -250,24 +255,8 @@ public AddNewCardPage downloadCard() {
return new AddNewCardPage(driver);
}

public boolean isNameDisplayed(String name) {

if(isElementDisplayed(doneButton)){
clickOnElement(doneButton);
}
By fullName = By.xpath("//*[contains(@value,'" + name + "') or contains(@text,'" + name + "')]");
return this.isElementDisplayed(fullName, 150);
}

public boolean isSecondNameDisplayed(String name) {
By fullName = By.xpath("(//*[contains(@value,'" + name + "') or contains(@text,'" + name + "')])[2]");
return this.isElementDisplayed(fullName, 80);

}

public DetailedVcViewPage openDetailedVcView(String name) {
By fullName = By.xpath("//*[contains(@value,'" + name + "') or contains(@text,'" + name + "')]");
clickOnElement(fullName);
public DetailedVcViewPage openDetailedVcView() {
clickOnElement(credentialTypeValue);
return new DetailedVcViewPage(driver);
}

Expand Down Expand Up @@ -816,4 +805,14 @@ public void clickOnNextButtonForInjiTour() {
clickOnElement(fifthDoneButton);
}
}

public boolean isCredentialTypeValueDisplayed() {
if(isElementDisplayed(doneButton)){
clickOnElement(doneButton);
}
return this.isElementDisplayed(credentialTypeValue);


}

}
4 changes: 2 additions & 2 deletions injitest/src/main/java/inji/pages/OtpVerificationPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public class OtpVerificationPage extends BasePage {
private WebElement waitPopupButton;


@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Please enter valid OTP.\")")
@iOSXCUITFindBy(accessibility = "Please enter valid OTP.")
@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"OTP is invalid\")")
@iOSXCUITFindBy(accessibility = "OTP is invalid")
private WebElement invalidOtpMessageforEsignet;

public OtpVerificationPage(AppiumDriver driver) {
Expand Down
2 changes: 0 additions & 2 deletions injitest/src/main/java/inji/pages/SharePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ public void clickOnCameraDisabledToasterClose(){
public void clickOnDontAllowCameraAccessButton(){
if(isElementDisplayed(cameraDontAllowAccessPopup))
clickOnElement(cameraDontAllowAccessPopup);


}

public boolean isCameraAccessLostPageLoaded() {
Expand Down
Loading
Loading