Skip to content

Commit

Permalink
MOSIP-32580 automated new ios testcases (mosip#1409)
Browse files Browse the repository at this point in the history
* MOSIP-31384

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflict

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflict

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-31384

Signed-off-by: Anup Nehe <[email protected]>

* incorprated changes

Signed-off-by: Anup Nehe <[email protected]>

* INJIMOB-924 MOSIP-31927

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-31384

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-31874

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-31384

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* resolve conlifcts

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* updating to unblock deveops

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-32267 MOSIP-32204

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-32204

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-32580

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-32580 MOSIP-32641

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* MOSIP-32580

Signed-off-by: Anup Nehe <[email protected]>

---------

Signed-off-by: Anup Nehe <[email protected]>
  • Loading branch information
anup-nehe authored May 3, 2024
1 parent 5351a90 commit 40164c3
Show file tree
Hide file tree
Showing 26 changed files with 794 additions and 127 deletions.
16 changes: 16 additions & 0 deletions injitest/iosRegression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<include name="noPreDownloadedVCAndNoHistoryInFreshInstallation"/>
<include name="verifyInvalidOtpMessage"/>
<include name="activateVcFromDetailedViewPage"/>
<include name="verifyActiveVcAndWaitForOtpTimeOut"/>
<include name="downloadAndActiveVcUsingUinViaEsignet"/>
</methods>
</class>
<class name="iosTestCases.ChangeLanguageTest">
Expand All @@ -42,12 +44,15 @@
<include name="deleteVcAndVerifyInHistory"/>
<include name="cancelDeleteVc"/>
<include name="DownloadingDeletedVc"/>
<include name="deleteVcAndVerifyInHistoryForEsignet"/>
<include name="deleteVcAndVerifyInHistoryForSunbird"/>
</methods>
</class>
<class name="iosTestCases.GenerateUinOrVidTest">
<methods>
<include name="generateUinOrVidUsingAid"/>
<include name="goBackToGenerateUinOrVidUsingAidFromOtpVerificationPage"/>
<include name="generateUinOrVidUsingInvalidAid"/>
</methods>
</class>
<class name="iosTestCases.PinVcTest">
Expand All @@ -56,6 +61,9 @@
<include name="VerifyCameraOpenAfterPinVc"/>
<include name="downloadVcViaEsignetAndPinUnpin"/>
<include name="verifyMessageAfterDenyBluetoothPopup"/>
<include name="pinEsignetVcMultipleTimes"/>
<include name="pinMosipVcMultipleTimes"/>
<include name="pinVcInDetailedVcView"/>
</methods>
</class>
<class name="iosTestCases.ShareVcTest">
Expand All @@ -76,6 +84,9 @@
<include name="verifyRecivedCardOffline"/>
<include name="downloadCardWithoutInternetRetryWithInternet"/>
<include name="verifyVcIssuerListWithoutNetwork"/>
<include name="DownloadVcWithUinWithoutNetwork"/>
<include name="DownloadVcWithEsignetWithoutNetwork"/>
<include name="verifyGetUinHeaderOffline"/>
</methods>
</class>
<class name="iosTestCases.UnlockWithPasscodeTest">
Expand All @@ -89,6 +100,8 @@
<include name="downloadAndVerifyVcUsingUinViaEsignet"/>
<include name="downloadAndVerifyVcUsingVidViaEsignet"/>
<include name="denyPopupforEsignetLoginWebPage"/>
<include name="downloadMultipleVcViaEsignet"/>

</methods>
</class>
<class name="iosTestCases.VcDownloadAndVerifyUsingSunbirdTest">
Expand All @@ -104,6 +117,8 @@
<include name="generateMultipleVcWithSameUin"/>
<include name="verifyInvalidUinErrorMessage"/>
<include name="verifyOtpTimeOutAndGoBack"/>
<include name="downloadMultipleCardsAndVerifySearch"/>
<include name="downloadCardsAndVerifySearch"/>
</methods>
</class>
<class name="iosTestCases.VcDownloadAndVerifyUsingVidTest">
Expand All @@ -128,6 +143,7 @@
<include name="downloadAndVerifyHistoryUsingUinViaEsignet"/>
<include name="downloadAndVerifyHistoryUsingVidViaEsignet"/>
<include name="downloadAndVerifyHistoryForSunbird"/>
<include name="downloadVcAndVerifyActivityLog"/>
</methods>
</class>
<class name="iosTestCases.VerifyWelcomePagesTest">
Expand Down
4 changes: 2 additions & 2 deletions injitest/src/main/java/inji/pages/AddNewCardPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class AddNewCardPage extends BasePage{
@iOSXCUITFindBy(accessibility = "issuerSearchBar")
private WebElement issuerSearchBar;

@AndroidFindBy(accessibility = "issuerHeading-Sunbirdtemp")
@iOSXCUITFindBy(accessibility = "issuerHeading-Sunbirdtemp")
@AndroidFindBy(accessibility = "issuerHeading-Sunbird")
@iOSXCUITFindBy(accessibility = "issuerHeading-Sunbird")
private WebElement downloadViaSunbird;

@AndroidFindBy(accessibility = "credentialTypeHeading-InsuranceCredential")
Expand Down
45 changes: 12 additions & 33 deletions injitest/src/main/java/inji/pages/BackupAndRestorePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,24 @@
public class BackupAndRestorePage extends BasePage {

@AndroidFindBy(accessibility = "backupAndRestore")
@iOSXCUITFindBy(accessibility = "backupAndRestore")
private WebElement backupAndRestoreHeader;

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

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

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

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

@AndroidFindBy(accessibility = "goBack")
@iOSXCUITFindBy(accessibility = "goBack")
private WebElement goBackButton;

@AndroidFindBy(className = "android.view.View")
@iOSXCUITFindBy(accessibility = "proceed")
private WebElement proceedButton;

@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Add another account\")")
Expand Down Expand Up @@ -60,77 +53,62 @@ public class BackupAndRestorePage extends BasePage {
public WebElement agreeButton;

@AndroidFindBy(accessibility = "backup")
@iOSXCUITFindBy(accessibility = "backup")
private WebElement BackupButton;

@AndroidFindBy(accessibility = "restore")
@iOSXCUITFindBy(accessibility = "restore")
private WebElement restoreButton;

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

@AndroidFindBy(accessibility = "dataBackupSuccessPopup")
@iOSXCUITFindBy(accessibility = "dataBackupSuccessPopup")
@AndroidFindBy(accessibility = "dataBackupSuccessPopupText")
private WebElement dataBackupSuccessPopup;

@AndroidFindBy(accessibility = "close")
@iOSXCUITFindBy(accessibility = "close")
private WebElement closeButton;

@AndroidFindBy(accessibility = "arrowLeft")
@iOSXCUITFindBy(accessibility = "arrowLeft")
@AndroidFindBy(accessibility = "dataBackupInProgressText")
private WebElement dataBackupInProgressText;

@AndroidFindBy(accessibility = "arrow-left")
private WebElement arrowLeftButton;

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

@AndroidFindBy(accessibility = "restoreBackupSuccessPopup")
@iOSXCUITFindBy(accessibility = "restoreBackupSuccessPopup")
@AndroidFindBy(accessibility = "restoreBackupSuccessPopupText")
private WebElement restoreBackupSuccessPopUp;


@AndroidFindBy(accessibility = "CloudBackupConsentDeniedTitle")
@iOSXCUITFindBy(accessibility = "CloudBackupConsentDeniedTitle")
private WebElement permissionDeniedHeader;

@AndroidFindBy(accessibility = "CloudBackupConsentDeniedMessage")
@iOSXCUITFindBy(accessibility = "CloudBackupConsentDeniedMessage")
private WebElement errorMessageDescription;

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


@AndroidFindBy(accessibility = "allowAccess")
@iOSXCUITFindBy(accessibility = "allowAccess")
private WebElement allowAccessButton;

@AndroidFindBy(accessibility = "LastBackupSectionHeader")
@iOSXCUITFindBy(accessibility = "LastBackupSectionHeader")
private WebElement lastBackupSectionHeader;

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

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

@AndroidFindBy(accessibility = "associatedAccount")
@iOSXCUITFindBy(accessibility = "associatedAccount")
@AndroidFindBy(accessibility = "associatedAccountEmail")
private WebElement associatedAccount;

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

@AndroidFindBy(accessibility = "restoreFailure-noBackupFilePopup")
@iOSXCUITFindBy(accessibility = "restoreFailure-noBackupFilePopup")
private WebElement restoreFailurePopup;

@AndroidFindBy(accessibility = "restoreInfo")
Expand All @@ -142,9 +120,8 @@ public class BackupAndRestorePage extends BasePage {
@AndroidFindBy(xpath = "//*[@resource-id=\"com.google.android.gms:id/account_display_name\"]")
private WebElement selectAccount;

@AndroidFindBy(accessibility = "dataBackupInProgressText")
@iOSXCUITFindBy(accessibility = "dataBackupInProgressText")
private WebElement dataBackupInProgressText;
@AndroidFindBy(accessibility = "restoreBackupSuccessPopupText")
private WebElement restoreBackupSuccessPopupText;


public BackupAndRestorePage(AppiumDriver driver) {
Expand Down Expand Up @@ -310,7 +287,9 @@ public void clickOnHelpButton() {
}

public void clickOnEmailHeader() {
clickOnElement(selectAccount);
if(isElementDisplayed(selectAccount)) {
clickOnElement(selectAccount);
}
}

public boolean isBackupFQADisplayed() throws InterruptedException {
Expand Down
10 changes: 8 additions & 2 deletions injitest/src/main/java/inji/pages/DetailedVcViewPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,23 @@ public HomePage clickOnBackArrow() {
}

public HomePage clickOnQrCrossIcon() {
if (isElementDisplayed(qrCloseIcon)){
clickOnElement(qrCloseIcon);
}
return new HomePage(driver);
}

public HomePage clickOnCrossIcon() {
clickOnElement(crossIcon);
if(isElementDisplayed(crossIcon)) {
clickOnElement(crossIcon);
}
return new HomePage(driver);
}

public void clickOnQrCodeButton() {
clickOnElement(detailedVcViewPageQr);
if(isElementDisplayed(detailedVcViewPageQr)) {
clickOnElement(detailedVcViewPageQr);
}
new PleaseConfirmPopupPage(driver);
}

Expand Down
4 changes: 4 additions & 0 deletions injitest/src/main/java/inji/pages/GenerateUinOrVidPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public boolean isGenerateUinOrVidPageLoaded() {
return this.isElementDisplayed(retrieveUinVidText);
}

public String getRetrieveUinVidText() {
return this.getTextFromLocator(retrieveUinVidText);
}

public GenerateUinOrVidPage enterApplicationID(String applicationId) {
sendKeysToTextBox(applicationIdTextBox, applicationId);
return this;
Expand Down
6 changes: 5 additions & 1 deletion injitest/src/main/java/inji/pages/HelpPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class HelpPage extends BasePage {
public WebElement helpPageContent;

@AndroidFindBy(uiAutomator = "new UiScrollable(new UiSelector()).scrollIntoView(text(\"What is Share with selfie?\"));")
@iOSXCUITFindBy(accessibility = "How to add a card?")
@iOSXCUITFindBy(accessibility = "new UiScrollable(new UiSelector()).scrollIntoView(text(\"What is Share with selfie?\"));")
public WebElement whatIsShareWithSelfieTextdHeader;

public HelpPage(AppiumDriver driver) {
Expand Down Expand Up @@ -61,6 +61,10 @@ public boolean isWhatIsShareWithSelfieTextdHeader() {

return this.isElementDisplayed(whatIsShareWithSelfieTextdHeader);
}

public void clickOnCrossButton(){
clickOnElement(crossIcon);
}
}


43 changes: 36 additions & 7 deletions injitest/src/main/java/inji/pages/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public class HomePage extends BasePage {
@iOSXCUITFindBy(accessibility = "activationPending")
private WebElement activationPending;

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

@AndroidFindBy(xpath = "(//android.view.ViewGroup[@content-desc=\"ellipsis\"])[1]")
private WebElement moreOptionsforFirstVc;

Expand All @@ -113,26 +117,38 @@ public class HomePage extends BasePage {
@iOSXCUITFindBy(accessibility = "activatedVcPopupText")
private WebElement activatedVcPopupText;

@AndroidFindBy(accessibility = "fullNameValue")
@iOSXCUITFindBy(accessibility = "fullNameValue")
@AndroidFindBy(accessibility = "fullNameTitle")
@iOSXCUITFindBy(accessibility = "fullNameTitle")
private WebElement fullNameTitle;

@AndroidFindBy(xpath = "//android.widget.EditText[@resource-id=\"issuerSearchBar\"]")
@iOSXCUITFindBy(accessibility = "issuerSearchBar")
private WebElement issuerSearchBar;

@AndroidFindBy(xpath = "//*[@text=\"2 card\"]")
@iOSXCUITFindBy(xpath = "//*[@text=\"2 card\"]")
@iOSXCUITFindBy(xpath = "//*[@name=\"2 cards\"]")
private WebElement visibleCard;

@AndroidFindBy(xpath = "//*[@text=\"2 card\"]")
@iOSXCUITFindBy(xpath = "//*[@name=\"1 card\"]")
private WebElement visibleCardOne;


@AndroidFindBy(xpath = "//*[@text=\"No Cards Found!\"]")
@iOSXCUITFindBy(xpath = "//*[@text=\"No Cards Found!\"]")
@iOSXCUITFindBy(accessibility = "No Cards Found!")
private WebElement noCardFound;

@iOSXCUITFindBy(accessibility = "Return")
private WebElement ReturnButton;

@AndroidFindBy(accessibility = "wallet-unactivated-icon")
@iOSXCUITFindBy(accessibility = "wallet-unactivated-icon")
private WebElement walletUnactivatedIcon;

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


public HomePage(AppiumDriver driver) {
super(driver);
Expand Down Expand Up @@ -167,7 +183,7 @@ public boolean isSecondNameDisplayed(String name) {

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

Expand All @@ -188,8 +204,7 @@ public HistoryPage clickOnHistoryButton() {

public MoreOptionsPage clickOnMoreOptionsButton() throws InterruptedException {
Thread.sleep(2000);
if(retrieIsElementVisible(moreOptionsButton)){
clickOnElement(moreOptionsButton);}
clickOnElement(moreOptionsButton);
return new MoreOptionsPage(driver);
}

Expand Down Expand Up @@ -288,6 +303,10 @@ public String GetActivationPendingText() {
return this.getTextFromLocator(activationPending);
}

public String GetActivationPendingHeaderText() {
return this.getTextFromLocator(offlineAuthDisabledHeader);
}

public void clickOnFirstVcsEllipsisButton() {
clickOnElement(moreOptionsforFirstVc);
}
Expand Down Expand Up @@ -320,6 +339,10 @@ public boolean isCardCountDisplayed() {
return this.isElementDisplayed(visibleCard);
}

public boolean isCardCountAfterSearchDisplayed() {
return this.isElementDisplayed(visibleCardOne);
}

public boolean isNoCardFoundTextDisplayed() {
return this.isElementDisplayed(noCardFound);
}
Expand All @@ -336,6 +359,12 @@ public void clickOnFirstVcEllipsis() {
clickOnElement(moreOptionsButtonForFirstVc);
}

public void clickOnReturnButton(){
clickOnElement(ReturnButton);
}

public String getTextFromVerificationStatus(){
return getTextFromLocator(verificationStatus);
}

}
Loading

0 comments on commit 40164c3

Please sign in to comment.