diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/BasePage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/BasePage.java index 05aff117d..60328a7ce 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/BasePage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/BasePage.java @@ -59,6 +59,18 @@ private void waitForElementToBeVisible(WebElement element) { WebDriverWait wait = new WebDriverWait(driver, ofSeconds(30)); wait.until(ExpectedConditions.visibilityOf(element)); } + + protected boolean isElementEnabled(WebElement element) { + try { + waitForElementToBeVisible(element); + element.isEnabled(); + ExtentLogger.pass(element + " is displayed"); + return true; + } catch (Exception e) { + //ExtentLogger.fail(elementName + " is not displayed"); + return false; + } + } protected void sendKeysToTextBox(WebElement element, String text, String elementName) { this.waitForElementToBeVisible(element); diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/ConfirmPasscode.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/ConfirmPasscode.java index 4cfcd5bbd..d686cb744 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/ConfirmPasscode.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/ConfirmPasscode.java @@ -11,10 +11,18 @@ public class ConfirmPasscode extends BasePage { @iOSXCUITFindBy(accessibility = "Confirm passcode") @AndroidFindBy(xpath = "//*[contains(@text,'Confirm passcode')]") private WebElement confirmPasscode; + + + @AndroidFindBy(xpath = "//*[contains(@text,'Passcode did not match.')]") + private WebElement invalidPasscode; public ConfirmPasscode(AppiumDriver driver) { super(driver); } + + public boolean isPasscodeInvalidMessageDisplayed() { + return this.isElementDisplayed(invalidPasscode, "Passcode did not match."); + } public boolean isConfirmPassCodePageLoaded() { return this.isElementDisplayed(confirmPasscode, "Confirm passcode page"); diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/HelpPage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/HelpPage.java index 4ae3ed199..90c3968f8 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/HelpPage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/HelpPage.java @@ -3,6 +3,7 @@ import io.appium.java_client.AppiumDriver; import io.appium.java_client.pagefactory.AndroidFindBy; import io.appium.java_client.pagefactory.iOSXCUITFindBy; + import org.openqa.selenium.WebElement; public class HelpPage extends BasePage { @@ -14,7 +15,10 @@ public class HelpPage extends BasePage { @AndroidFindBy(xpath = "//*[@resource-id=\"iconIcon\"]") @iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeOther[`label == \"\uE5CD\"`][2]") private WebElement crossIcon; - + + @AndroidFindBy(uiAutomator = "new UiScrollable(new UiSelector()).scrollIntoView(text(\"How to view activity logs?\"));") + public WebElement howToViewActivity; + public HelpPage(AppiumDriver driver) { super(driver); } @@ -26,5 +30,9 @@ public boolean isHelpPageLoaded() { public void exitHelpPage() { this.clickOnElement(crossIcon); } - + + public void ScrollToViewActivityLog() { + howToViewActivity.click(); + } + } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/HistoryPage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/HistoryPage.java index a2ef15900..86c4b6756 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/HistoryPage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/HistoryPage.java @@ -4,6 +4,9 @@ import io.appium.java_client.AppiumDriver; import io.appium.java_client.pagefactory.AndroidFindBy; import io.appium.java_client.pagefactory.iOSXCUITFindBy; + +import java.util.List; + import org.openqa.selenium.By; import org.openqa.selenium.WebElement; @@ -27,11 +30,30 @@ private boolean verifyHistoryIos(String vcNumber) { By locator = By.xpath("//*[contains(@name,'" + vcNumber + " downloaded')]"); return this.isElementDisplayed(locator, "Downloaded VC in ios"); } + + private boolean verifyHistoryAndroid(String vcNumber) { By locator = By.xpath("//*[contains(@text,'" + vcNumber + " downloaded')]"); return this.isElementDisplayed(locator, "Downloaded VC in android"); } + + private boolean verifyDeleteHistoryAndroid(String vcNumber) { + By locator = By.xpath("//*[contains(@text,'" + vcNumber + " Removed from wallet')]"); + return this.isElementDisplayed(locator, "Downloaded VC in android"); + } + + private int verifyNumberOfRecordsInHistoryAndroid(String vcNumber) throws InterruptedException { + By locator = By.xpath("//*[contains(@text,'" + vcNumber + " downloaded')]"); + List elements = driver.findElements(locator); + return elements.size(); + } + + private int verifyNumberOfRecordsInHistoryIos(String vcNumber) { + By locator = By.xpath("//*[contains(@name,'\" + vcNumber + \" downloaded')]"); + List elements = driver.findElements(locator); + return elements.size(); + } public boolean verifyHistory(String vcNumber, Target os) { switch (os) { @@ -42,8 +64,27 @@ public boolean verifyHistory(String vcNumber, Target os) { } return false; } - + + public int getNumberOfRecordsInHistory(String vcNumber, Target os, String string) throws InterruptedException { + switch (os) { + case ANDROID: + return verifyNumberOfRecordsInHistoryAndroid(vcNumber); + case IOS: + return verifyNumberOfRecordsInHistoryIos(vcNumber); + } + return 0; + } + public boolean noHistoryAvailable() { return this.isElementDisplayed(noHistoryAvailable, "No history available yet"); } + + public boolean verifyDeleteHistory(String vcNumber, Target os) { + switch (os) { + case ANDROID: + return verifyDeleteHistoryAndroid(vcNumber); + + } + return false; + } } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/HomePage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/HomePage.java index 001614aa9..b85a3321a 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/HomePage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/HomePage.java @@ -79,6 +79,12 @@ public boolean isNameDisplayed(String name) { By fullName = By.xpath("//*[contains(@name,'" + name + "') or contains(@text,'" + name + "')]"); return this.isElementDisplayed(fullName, 60, "Name on downloaded card"); } + + public boolean isSecondNameDisplayed(String name) { + By fullName = By.xpath("(//*[contains(@text,'" + name + "')])[2]"); + return this.isElementDisplayed(fullName, 60, "Name on downloaded card"); + + } public DetailedVcViewPage openDetailedVcView(String name) { By fullName = By.xpath("//*[contains(@name,'" + name + "') or contains(@text,'" + name + "')]"); @@ -110,7 +116,8 @@ public MoreOptionsPage clickOnMoreOptionsButton() throws InterruptedException { public boolean isPinIconDisplayed() { return this.isElementDisplayed(pinIcon, "pin icon"); } - + + public boolean isNoVCDownloaded() { return this.isElementDisplayed(bringYourDigitalIdentity, "Bring your digital identity"); } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/MoreOptionsPage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/MoreOptionsPage.java index abda9c5f0..ebe5993dd 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/MoreOptionsPage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/MoreOptionsPage.java @@ -25,6 +25,9 @@ public class MoreOptionsPage extends BasePage { @AndroidFindBy(accessibility = "profileAuthenticated") @iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeOther[`label == \"\uE8E8 Activated for online login!\"`][4]") private WebElement activatedForOnlineLoginButton; + + @AndroidFindBy(xpath = "//*[@resource-id=\"iconIcon\"]") + private WebElement CloseButton; public MoreOptionsPage(AppiumDriver driver) { super(driver); @@ -51,4 +54,9 @@ public PleaseConfirmPopupPage clickOnActivationPending() { public boolean isVcActivatedForOnlineLogin() { return this.isElementDisplayed(activatedForOnlineLoginButton, "Activated for online login text"); } + + public HomePage ClickOnCloseButton() { + clickOnElement(CloseButton); + return new HomePage(driver); + } } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/PleaseConfirmPopupPage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/PleaseConfirmPopupPage.java index 7df4945be..bfc384417 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/PleaseConfirmPopupPage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/PleaseConfirmPopupPage.java @@ -9,6 +9,9 @@ public class PleaseConfirmPopupPage extends BasePage { @AndroidFindBy(accessibility = "yesConfirm") @iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeButton[`label == \"Yes, I confirm\"`]") private WebElement yesButton; + + @AndroidFindBy(accessibility = "no") + private WebElement noButton; public PleaseConfirmPopupPage(AppiumDriver driver) { super(driver); @@ -22,5 +25,10 @@ public OtpVerificationPage clickOnConfirmButton() { clickOnElement(yesButton); return new OtpVerificationPage(driver); } + + public OtpVerificationPage clickOnNoButton() { + clickOnElement(noButton); + return new OtpVerificationPage(driver); + } } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/RetrieveIdPage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/RetrieveIdPage.java index 1ef2b8483..709765d2e 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/RetrieveIdPage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/RetrieveIdPage.java @@ -32,6 +32,11 @@ public class RetrieveIdPage extends BasePage { @AndroidFindBy(xpath = "//*[contains(@text,'Get it now')]") @iOSXCUITFindBy(accessibility = "Get it now") private WebElement getItNowText; + + @AndroidFindBy(xpath = "//*[contains(@text,'UIN invalid')]") + private WebElement invalidUin; + + @AndroidFindBy(xpath = "//*[contains(@text,'The input format is incorrect')]") private WebElement inputFormatErrorMessage; @@ -59,6 +64,10 @@ public GenerateUinOrVidPage clickOnGetItNowText() { this.clickOnElement(getItNowText); return new GenerateUinOrVidPage(driver); } + + public boolean isInvalidUinMassageLoaded() { + return this.isElementDisplayed(invalidUin, "UIN invalid"); + } public RetrieveIdPage clickOnVid(Target os) { diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/pages/ScanPage.java b/injitest/src/main/java/io/mosip/test/mob/inji/pages/ScanPage.java index 1de44ae2f..462ff29c4 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/pages/ScanPage.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/pages/ScanPage.java @@ -18,6 +18,12 @@ public class ScanPage extends BasePage{ @AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Allow\")") private WebElement allowButton; + + @AndroidFindBy(className = "android.widget.ImageView") + private WebElement flipCamera; + + @AndroidFindBy(xpath = "//*[contains(@text,'Hold the phone steady and scan the QR code')]") + private WebElement holdCameraSteady; public ScanPage(AppiumDriver driver) { super(driver); @@ -32,4 +38,13 @@ public ScanPage acceptPermissionPopup(){ public boolean isCameraOpen(){ return isElementDisplayed(camera, "camera"); } + + public boolean isCameraPageLoaded() { + return this.isElementEnabled(holdCameraSteady); + } + + public boolean isFlipCameraClickable() { + return this.isElementEnabled(flipCamera); + } + } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/DeletingVcTest.java b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/DeletingVcTest.java index f5da3def3..e61a390f8 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/DeletingVcTest.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/DeletingVcTest.java @@ -6,6 +6,7 @@ import io.mosip.test.mob.inji.pages.*; import io.mosip.test.mob.inji.utils.TestDataReader; +import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; @@ -57,4 +58,120 @@ public void deleteVcAndVerifyInHistory() throws InterruptedException { historyPage.verifyHistory(BaseTestCase.uin + " Removed from wallet", target); } -} + + @Test + public void cancelDeleteVc() throws InterruptedException { + ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); + + assertTrue(chooseLanguagePage.isChooseLanguagePageLoaded(), "Verify if choose language page is displayed"); + WelcomePage welcomePage = chooseLanguagePage.clickOnSavePreference(); + + assertTrue(welcomePage.isWelcomePageLoaded(), "Verify if welcome page is loaded"); + AppUnlockMethodPage appUnlockMethodPage = welcomePage.clickOnSkipButton(); + + assertTrue(appUnlockMethodPage.isAppUnlockMethodPageLoaded(), "Verify if app unlocked page is displayed"); + SetPasscode setPasscode = appUnlockMethodPage.clickOnUsePasscode(); + + assertTrue(setPasscode.isSetPassCodePageLoaded(), "Verify if set passcode page is displayed"); + ConfirmPasscode confirmPasscode = setPasscode.enterPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.confirmPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(BaseTestCase.uin).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); + assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); + + PleaseConfirmPopupPage pleaseConfirmPopupPage = moreOptionsPage.clickOnRemoveFromWallet(); + assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); + + pleaseConfirmPopupPage.clickOnNoButton(); + assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); + + moreOptionsPage.ClickOnCloseButton(); + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + } + + @Test + public void DownloadingDeletedVc() throws InterruptedException { + ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); + + assertTrue(chooseLanguagePage.isChooseLanguagePageLoaded(), "Verify if choose language page is displayed"); + WelcomePage welcomePage = chooseLanguagePage.clickOnSavePreference(); + + assertTrue(welcomePage.isWelcomePageLoaded(), "Verify if welcome page is loaded"); + AppUnlockMethodPage appUnlockMethodPage = welcomePage.clickOnSkipButton(); + + assertTrue(appUnlockMethodPage.isAppUnlockMethodPageLoaded(), "Verify if app unlocked page is displayed"); + SetPasscode setPasscode = appUnlockMethodPage.clickOnUsePasscode(); + + assertTrue(setPasscode.isSetPassCodePageLoaded(), "Verify if set passcode page is displayed"); + ConfirmPasscode confirmPasscode = setPasscode.enterPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.confirmPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(BaseTestCase.uin).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); + assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); + + PleaseConfirmPopupPage pleaseConfirmPopupPage = moreOptionsPage.clickOnRemoveFromWallet(); + assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); + + pleaseConfirmPopupPage.clickOnConfirmButton(); + assertFalse(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if VC is removed"); + + homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + retrieveIdPage.setEnterIdTextBox(BaseTestCase.uin).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + HistoryPage historyPage = homePage.clickOnHistoryButton(); + assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); + + assertTrue(historyPage.verifyHistory(BaseTestCase.uin, target)); + + historyPage.getNumberOfRecordsInHistory(BaseTestCase.uin, target,"Verify two download records in history page"); + assertEquals(historyPage.getNumberOfRecordsInHistory(BaseTestCase.uin, target,"Asserting two records"),2); + + + assertTrue(historyPage.verifyDeleteHistory(BaseTestCase.uin, target), "Verify if deleted history is displayed"); + + + } + +} \ No newline at end of file diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/GenerateUinOrVidTest.java b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/GenerateUinOrVidTest.java index 6c9540626..f76504959 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/GenerateUinOrVidTest.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/GenerateUinOrVidTest.java @@ -50,6 +50,6 @@ public void generateUinOrVidUsingAid() { assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - } -} + +} \ No newline at end of file diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/PinVcTest.java b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/PinVcTest.java index dfd51e837..ce8905657 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/PinVcTest.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/PinVcTest.java @@ -11,7 +11,7 @@ public class PinVcTest extends BaseTest { @Test - public void pinVc() throws InterruptedException { + public void pinVc() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -50,4 +50,50 @@ public void pinVc() throws InterruptedException { assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); } + + @Test + public void VerifyCameraOpenAfterPinVc() throws InterruptedException { + ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); + + assertTrue(chooseLanguagePage.isChooseLanguagePageLoaded(), "Verify if choose language page is displayed"); + WelcomePage welcomePage = chooseLanguagePage.clickOnSavePreference(); + + assertTrue(welcomePage.isWelcomePageLoaded(), "Verify if welcome page is loaded"); + AppUnlockMethodPage appUnlockMethodPage = welcomePage.clickOnSkipButton(); + + assertTrue(appUnlockMethodPage.isAppUnlockMethodPageLoaded(), "Verify if app unlocked page is displayed"); + SetPasscode setPasscode = appUnlockMethodPage.clickOnUsePasscode(); + + assertTrue(setPasscode.isSetPassCodePageLoaded(), "Verify if set passcode page is displayed"); + ConfirmPasscode confirmPasscode = setPasscode.enterPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.confirmPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(BaseTestCase.uin).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); + + assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); + moreOptionsPage.clickOnPinOrUnPinCard(); + + assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); + ScanPage scanPage=homePage.clickOnScanButton(); + + assertTrue(scanPage.isCameraPageLoaded(), "Verify if pin icon on vc is displayed"); + assertTrue(scanPage.isFlipCameraClickable(),"Verify if flip camera is enabled"); + + } + } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/UnlockWithPasscodeTest.java b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/UnlockWithPasscodeTest.java index 7f0bcaec9..b9f96241f 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/UnlockWithPasscodeTest.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/UnlockWithPasscodeTest.java @@ -42,4 +42,27 @@ public void logoutAndLoginWithPasscode() { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); } + + @Test + public void loginWithInvalidPasscode() { + ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); + + assertTrue(chooseLanguagePage.isChooseLanguagePageLoaded(), "Verify if choose language page is displayed"); + WelcomePage welcomePage = chooseLanguagePage.clickOnSavePreference(); + + assertTrue(welcomePage.isWelcomePageLoaded(), "Verify if welcome page is loaded"); + AppUnlockMethodPage appUnlockMethodPage = welcomePage.clickOnSkipButton(); + + assertTrue(appUnlockMethodPage.isAppUnlockMethodPageLoaded(), "Verify if app unlocked page is displayed"); + SetPasscode setPasscode = appUnlockMethodPage.clickOnUsePasscode(); + + assertTrue(setPasscode.isSetPassCodePageLoaded(), "Verify if set passcode page is displayed"); + ConfirmPasscode confirmPasscode = setPasscode.enterPasscode(TestDataReader.readData("invalidpasscode"), target); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.confirmPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(confirmPasscode.isPasscodeInvalidMessageDisplayed(), "verify if invalid passcode is displayed"); + + } } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingUinTest.java b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingUinTest.java index cdd7a9d2e..5887239d6 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingUinTest.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingUinTest.java @@ -7,6 +7,7 @@ import io.mosip.test.mob.inji.utils.TestDataReader; import static org.testng.Assert.assertTrue; +import static org.testng.Assert.assertEquals; public class VcDownloadAndVerifyUsingUinTest extends BaseTest { @Test @@ -96,4 +97,91 @@ public void downloadMultipleVcUsingDifferentUin() { assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verifying again if first VC is still exists."); } + + @Test + public void downloadWithEmptyUin() { + ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); + + assertTrue(chooseLanguagePage.isChooseLanguagePageLoaded(), "Verify if choose language page is displayed"); + WelcomePage welcomePage = chooseLanguagePage.clickOnSavePreference(); + + assertTrue(welcomePage.isWelcomePageLoaded(), "Verify if welcome page is loaded"); + AppUnlockMethodPage appUnlockMethodPage = welcomePage.clickOnSkipButton(); + + assertTrue(appUnlockMethodPage.isAppUnlockMethodPageLoaded(), "Verify if app unlocked page is displayed"); + SetPasscode setPasscode = appUnlockMethodPage.clickOnUsePasscode(); + + assertTrue(setPasscode.isSetPassCodePageLoaded(), "Verify if set passcode page is displayed"); + ConfirmPasscode confirmPasscode = setPasscode.enterPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.confirmPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox("").clickOnGenerateCardButton(); + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + + } + + @Test + public void generateMultipleVcWithSameUin() throws InterruptedException { + ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); + + assertTrue(chooseLanguagePage.isChooseLanguagePageLoaded(), "Verify if choose language page is displayed"); + WelcomePage welcomePage = chooseLanguagePage.clickOnSavePreference(); + + assertTrue(welcomePage.isWelcomePageLoaded(), "Verify if welcome page is loaded"); + AppUnlockMethodPage appUnlockMethodPage = welcomePage.clickOnSkipButton(); + + assertTrue(appUnlockMethodPage.isAppUnlockMethodPageLoaded(), "Verify if app unlocked page is displayed"); + SetPasscode setPasscode = appUnlockMethodPage.clickOnUsePasscode(); + + assertTrue(setPasscode.isSetPassCodePageLoaded(), "Verify if set passcode page is displayed"); + ConfirmPasscode confirmPasscode = setPasscode.enterPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.confirmPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(BaseTestCase.uin).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + retrieveIdPage.setEnterIdTextBox(BaseTestCase.uin).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + HistoryPage historyPage = homePage.clickOnHistoryButton(); + + assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); + assertTrue(historyPage.verifyHistory(BaseTestCase.uin, target)); + + historyPage.getNumberOfRecordsInHistory(BaseTestCase.uin, target,"Verify two download records inhistory page"); + assertEquals(historyPage.getNumberOfRecordsInHistory(BaseTestCase.uin, target,""),2); + + } + } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingVidTest.java b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingVidTest.java index 6d9b34d75..aaef9538e 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingVidTest.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VcDownloadAndVerifyUsingVidTest.java @@ -1,11 +1,9 @@ package io.mosip.test.mob.inji.testcases; import org.testng.annotations.Test; - import io.mosip.test.mob.inji.api.BaseTestCase; import io.mosip.test.mob.inji.pages.*; import io.mosip.test.mob.inji.utils.TestDataReader; - import static org.testng.Assert.assertTrue; public class VcDownloadAndVerifyUsingVidTest extends BaseTest { @@ -45,4 +43,62 @@ public void downloadAndVerifyVcUsingVid() { assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); assertTrue(detailedVcViewPage.isDetailedVcViewLoaded(TestDataReader.readData("fullName"))); } + + @Test + public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { + ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); + + assertTrue(chooseLanguagePage.isChooseLanguagePageLoaded(), "Verify if choose language page is displayed"); + WelcomePage welcomePage = chooseLanguagePage.clickOnSavePreference(); + + assertTrue(welcomePage.isWelcomePageLoaded(), "Verify if welcome page is loaded"); + AppUnlockMethodPage appUnlockMethodPage = welcomePage.clickOnSkipButton(); + + assertTrue(appUnlockMethodPage.isAppUnlockMethodPageLoaded(), "Verify if app unlocked page is displayed"); + SetPasscode setPasscode = appUnlockMethodPage.clickOnUsePasscode(); + + assertTrue(setPasscode.isSetPassCodePageLoaded(), "Verify if set passcode page is displayed"); + ConfirmPasscode confirmPasscode = setPasscode.enterPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.confirmPasscode(TestDataReader.readData("passcode"), target); + + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + OtpVerificationPage otpVerification = retrieveIdPage.clickOnVid(target).setEnterIdTextBox(BaseTestCase.perpetualVid).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + addNewCardPage.clickOnDownloadViaUin(); + + assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); + retrieveIdPage.clickOnVid(target).setEnterIdTextBox(BaseTestCase.perpetualVid).clickOnGenerateCardButton(); + + assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); + otpVerification.enterOtp(GetOtp(), target); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + // + MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); + assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); + + PleaseConfirmPopupPage pleaseConfirmPopupPage = moreOptionsPage.clickOnRemoveFromWallet(); + assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); + + pleaseConfirmPopupPage.clickOnConfirmButton(); + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + } + } diff --git a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VerifyHelpPageTest.java b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VerifyHelpPageTest.java index 91857aae6..05f0fdf24 100644 --- a/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VerifyHelpPageTest.java +++ b/injitest/src/main/java/io/mosip/test/mob/inji/testcases/VerifyHelpPageTest.java @@ -30,6 +30,8 @@ public void verifyHelpPage() { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); HelpPage helpPage = homePage.clickOnHelpIcon(); + + helpPage.ScrollToViewActivityLog(); assertTrue(helpPage.isHelpPageLoaded(), "Verify if help page is displayed"); helpPage.exitHelpPage(); diff --git a/injitest/testng.xml b/injitest/testng.xml index cf1d67d66..e3c02b240 100644 --- a/injitest/testng.xml +++ b/injitest/testng.xml @@ -10,6 +10,8 @@ + + @@ -20,14 +22,16 @@ + - + + - + @@ -35,14 +39,17 @@ + + + - + - + @@ -55,6 +62,7 @@ +