From b01bd8536ecce3372a7e7ca4c9e702aeb587981a Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Tue, 19 Nov 2024 14:58:04 +0530 Subject: [PATCH 01/10] MOSIP-37454 MOSIP-37452 Signed-off-by: Anup Nehe --- .../main/java/inji/pages/AddNewCardPage.java | 25 ++ .../java/inji/pages/DetailedVcViewPage.java | 8 +- .../java/inji/pages/EsignetLoginPage.java | 2 +- .../src/main/java/inji/pages/HomePage.java | 2 +- .../java/inji/pages/KeyManagementPage.java | 106 ++++++++ .../java/inji/pages/MockCertifyLoginPage.java | 230 ++++++++++++++++++ .../main/java/inji/pages/SettingsPage.java | 7 + .../src/main/java/inji/pages/SharePage.java | 2 + .../java/inji/pages/SunbirdLoginPage.java | 25 +- .../src/main/java/inji/utils/IosUtil.java | 79 ++++++ .../main/java/inji/utils/TestDataReader.java | 16 ++ .../VcDownloadAndVerifyUsingMockIdentity.java | 77 ++++++ .../java/androidTestCases/keyManagement.java | 212 ++++++++++++++++ .../java/iosTestCases/KeyManagmentTest.java | 48 ++++ ...ownloadAndVerifyUsingMockIdentityTest.java | 76 ++++++ 15 files changed, 908 insertions(+), 7 deletions(-) create mode 100644 injitest/src/main/java/inji/pages/KeyManagementPage.java create mode 100644 injitest/src/main/java/inji/pages/MockCertifyLoginPage.java create mode 100644 injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java create mode 100644 injitest/src/test/java/androidTestCases/keyManagement.java create mode 100644 injitest/src/test/java/iosTestCases/KeyManagmentTest.java create mode 100644 injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java diff --git a/injitest/src/main/java/inji/pages/AddNewCardPage.java b/injitest/src/main/java/inji/pages/AddNewCardPage.java index 7ede10786d..388f9b8c02 100644 --- a/injitest/src/main/java/inji/pages/AddNewCardPage.java +++ b/injitest/src/main/java/inji/pages/AddNewCardPage.java @@ -23,6 +23,9 @@ 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; @@ -57,6 +60,10 @@ public class AddNewCardPage extends BasePage{ @iOSXCUITFindBy(accessibility = "credentialTypeHeading-MosipVerifiableCredential") private WebElement credentialTypeHeadingMOSIPVerifiableCredential; + @AndroidFindBy(accessibility = "credentialTypeHeading-MockVerifiableCredential_mdoc") + @iOSXCUITFindBy(accessibility = "credentialTypeHeading-MockVerifiableCredential_mdoc") + private WebElement credentialTypeHeadingMockVerifiableCredential_mdoc; + public AddNewCardPage(AppiumDriver driver) { super(driver); } @@ -101,6 +108,10 @@ public boolean isDownloadViaEsignetDisplayed() { return this.isElementDisplayed(downloadViaEsignet); } + public boolean isDownloadViaMockCertifyDisplayed() { + return this.isElementDisplayed(downloadViaMockCertify); + } + public boolean isDownloadViaEsignetDisplayedInHindi() { return this.isElementDisplayed(downloadViaEsignet); } @@ -123,6 +134,20 @@ 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); diff --git a/injitest/src/main/java/inji/pages/DetailedVcViewPage.java b/injitest/src/main/java/inji/pages/DetailedVcViewPage.java index fa34691d89..f57553a44a 100644 --- a/injitest/src/main/java/inji/pages/DetailedVcViewPage.java +++ b/injitest/src/main/java/inji/pages/DetailedVcViewPage.java @@ -99,6 +99,10 @@ 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); } @@ -218,6 +222,8 @@ public void clickOnMoreOptionsInDetails() { } clickOnElement(moreOptionsButton); } - + public boolean isKeyTypeVcDetailViewValueDisplayed() { + return isElementDisplayed(keyTypeVcDetailViewValue); + } } \ No newline at end of file diff --git a/injitest/src/main/java/inji/pages/EsignetLoginPage.java b/injitest/src/main/java/inji/pages/EsignetLoginPage.java index c72fd0ac3f..1af4a3ac3d 100644 --- a/injitest/src/main/java/inji/pages/EsignetLoginPage.java +++ b/injitest/src/main/java/inji/pages/EsignetLoginPage.java @@ -88,6 +88,7 @@ public class EsignetLoginPage extends BasePage { private WebElement credentialTypeHeadingMOSIPVerifiableCredential; + public EsignetLoginPage(AppiumDriver driver) { super(driver); } @@ -116,7 +117,6 @@ public void clickOnEsignetLoginWithOtpButton() { if(isElementDisplayed(esignetLoginButton)) { clickOnElement(esignetLoginButton); } - } public OtpVerificationPage setEnterIdTextBox(String uinOrVid) { diff --git a/injitest/src/main/java/inji/pages/HomePage.java b/injitest/src/main/java/inji/pages/HomePage.java index 951f23053d..fac1f51666 100644 --- a/injitest/src/main/java/inji/pages/HomePage.java +++ b/injitest/src/main/java/inji/pages/HomePage.java @@ -267,7 +267,7 @@ public boolean isSecondNameDisplayed(String name) { public DetailedVcViewPage openDetailedVcView(String name) { By fullName = By.xpath("//*[contains(@value,'" + name + "') or contains(@text,'" + name + "')]"); - clickOnElement(fullNameValue); + clickOnElement(fullName); return new DetailedVcViewPage(driver); } diff --git a/injitest/src/main/java/inji/pages/KeyManagementPage.java b/injitest/src/main/java/inji/pages/KeyManagementPage.java new file mode 100644 index 0000000000..10ab4ae67e --- /dev/null +++ b/injitest/src/main/java/inji/pages/KeyManagementPage.java @@ -0,0 +1,106 @@ +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; +import org.openqa.selenium.WebElement; + +import java.util.Arrays; +import java.util.List; + +public class KeyManagementPage extends BasePage { + @AndroidFindBy(accessibility = "7done") + @iOSXCUITFindBy(accessibility = "7done") + private WebElement stepCountButton; + + @AndroidFindBy(accessibility = "saveKeyOrderingPreference") + @iOSXCUITFindBy(accessibility = "saveKeyOrderingPreference") + private WebElement saveKeyOrderingPreference; + + @AndroidFindBy(accessibility = "keyOrderingSuccessText") + @iOSXCUITFindBy(accessibility = "keyOrderingSuccessText") + private WebElement keyOrderingSuccessText; + + @AndroidFindBy(accessibility = "arrow-left") + @iOSXCUITFindBy(accessibility = "arrow-left") + private WebElement arrowleftButton; + + + @AndroidFindBy(xpath = "(//android.widget.TextView[@resource-id=\"iconIcon\"])[6]") + @iOSXCUITFindBy(xpath = "(//XCUIElementTypeOther[@name=\"RSA \uE25D\"])[2]") + private WebElement RSAText; + + @AndroidFindBy(xpath = "(//android.widget.TextView[@resource-id=\"iconIcon\"])[3]") + @iOSXCUITFindBy(xpath = "(//XCUIElementTypeOther[@name=\"ED25519 \uE25D\"])[2]") + private WebElement ED25519Text; + + @AndroidFindBy(xpath = "//android.widget.TextView[@resource-id=\"listItemTitle\" and @text=\"ECC R1\"]") + @iOSXCUITFindBy(xpath = "(//XCUIElementTypeOther[@name=\"ED25519 \uE25D\"])[2]") + private WebElement ECCR1Text; + + + + @AndroidFindBy(accessibility = "keyTypeVcDetailViewValue") + @iOSXCUITFindBy(accessibility = "saveKeyOrderingPreference") + private WebElement keyTypeVcDetailViewValue; + + + public KeyManagementPage(AppiumDriver driver) { + super(driver); + } + BasePage basePage = new BasePage(driver); + public boolean isDoneButtonDisplayed() { + return this.isElementDisplayed(stepCountButton); + } + + public void clickOnDoneButton() { + clickOnElement (stepCountButton); + } + + public WebElement getTheCoordinatesForRSA(){ + RSAText.isDisplayed(); + return RSAText; + } + + public WebElement getTheCoordinatesED25519Text(){ + + ECCR1Text.isDisplayed(); + return ECCR1Text; + } + + public WebElement getTheCoordinatesECCR1TextText(){ + ECCR1Text.isDisplayed(); + return ECCR1Text; + } + + public void clickOnSaveKeyOrderingPreferenceButton() { + clickOnElement (saveKeyOrderingPreference); + } + + public void clickOnArrowleftButton() { + clickOnElement (arrowleftButton); + } + + public boolean iskeyOrderingSuccessTextMessageDisplayed() { + return this.isElementDisplayed(keyOrderingSuccessText); + } + + public String getPKeyTypeVcDetailViewValueSunbirdCard() { + IosUtil.scrollToElement(driver,100,800,100,200); + basePage.retryToGetElement(keyTypeVcDetailViewValue); + return this.getTextFromLocator(keyTypeVcDetailViewValue); + } + + public boolean compareListOfKeys() { + List stringList = Arrays.asList("ED25519", "ES256K", "ES256", "RS256"); + String str = getPKeyTypeVcDetailViewValueSunbirdCard(); + + for (String key : stringList) { + if (str.equals(key)) { + return true; + } + } + return false; + } +} diff --git a/injitest/src/main/java/inji/pages/MockCertifyLoginPage.java b/injitest/src/main/java/inji/pages/MockCertifyLoginPage.java new file mode 100644 index 0000000000..60eca638d2 --- /dev/null +++ b/injitest/src/main/java/inji/pages/MockCertifyLoginPage.java @@ -0,0 +1,230 @@ +package inji.pages; + +import io.appium.java_client.AppiumDriver; +import io.appium.java_client.HidesKeyboard; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.iOSXCUITFindBy; +import org.openqa.selenium.WebElement; + +public class MockCertifyLoginPage extends BasePage { + + @iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeStaticText[`label == \"“Inji” Wants to Use “mosip.net” to Sign In\"`]") + private WebElement iosSignInPermissionPopup; + + @iOSXCUITFindBy(accessibility = "Continue") + private WebElement iosContinueButton; + + @AndroidFindBy(xpath = "//*[contains(@text,'Login with OTP')]") + @iOSXCUITFindBy(accessibility = "Login with OTP") + private WebElement esignetLoginButton; + + @AndroidFindBy(xpath = "//*[contains(@text,'Login with e-Signet')]") + @iOSXCUITFindBy(xpath = "//*[contains(@text,'Login with e-Signet')]") + private WebElement esignetLoginHeader; + + @AndroidFindBy(xpath = "//*[contains(@text,'Please enter your UIN/VID')]") + @iOSXCUITFindBy(xpath = "//*[contains(@text,'Please enter your UIN/VID'')]") + private WebElement enterYourVidTextHeader; + + @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.widget.EditText\").instance(0)") + @iOSXCUITFindBy(className = "XCUIElementTypeTextField") + private WebElement enterIdTextBox; + + @AndroidFindBy(xpath = "//android.widget.Button[@text=\"Get OTP\"]") + @iOSXCUITFindBy(accessibility = "Get OTP") + private WebElement getOtpButton; + + + @AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.Button\").instance(1)") + @iOSXCUITFindBy(accessibility = "Verify") + private WebElement verifyButton; + + @AndroidFindBy(xpath = "//*[contains(@text,'OTP has been sent to your registered Mobile Number')]") + @iOSXCUITFindBy(xpath = "//*[contains(@text,'OTP has been sent to your registered Mobile Number')]") + private WebElement otpSendMessage; + + @AndroidFindBy(className = "android.view.ViewGroup") + private WebElement redirectingPage; + + @AndroidFindBy(accessibility = "progressingLogo") + private WebElement progressingLogo; + + @AndroidFindBy(accessibility = "loaderTitle") + private WebElement loadingPageHeader; + + @iOSXCUITFindBy(accessibility = "Done") + private WebElement DoneButton; + + @AndroidFindBy(accessibility = "loaderSubTitle") + private WebElement settingUpTextOrDownloadingCredentials; + + @AndroidFindBy(xpath = "//*[@text=\"OTP is invalid\"]") + private WebElement invalidOtpText; + + @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.widget.TextView\").instance(1)") + @iOSXCUITFindBy(xpath = "(//XCUIElementTypeStaticText)[5]") + private WebElement loginTextHeader; + + @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.widget.TextView\").instance(2)") + @iOSXCUITFindBy(xpath = "(//XCUIElementTypeStaticText)[6]") + private WebElement pleaseEnterUinHeaderText; + + @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.widget.TextView\").instance(5)") + @iOSXCUITFindBy(xpath = "(//XCUIElementTypeStaticText)[9]") + private WebElement dontHaveAccountText; + + @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.widget.TextView\").instance(6)") + @iOSXCUITFindBy(xpath = "(//XCUIElementTypeStaticText)[10]") + private WebElement signUpwithUnifiedLoginText; + + @AndroidFindBy(accessibility = "Close tab") + @iOSXCUITFindBy(xpath ="//XCUIElementTypeButton[@name=\"Cancel\"]") + private WebElement CloseTab; + + @AndroidFindBy(accessibility = "credentialTypeHeading-MOSIPVerifiableCredential") + @iOSXCUITFindBy(accessibility = "credentialTypeHeading-MOSIPVerifiableCredential") + private WebElement credentialTypeHeadingMOSIPVerifiableCredential; + + + public MockCertifyLoginPage(AppiumDriver driver) { + super(driver); + } + + public boolean isLoadingPageTextLoaded() { + return this.isElementDisplayed(loadingPageHeader); + } + + public boolean isSettingUpTextDisplayed() { + return this.isElementDisplayed(settingUpTextOrDownloadingCredentials); + } + + public boolean isDownloadingCredentialsTextDisplayed() { + return this.isElementDisplayed(settingUpTextOrDownloadingCredentials); + } + + public boolean isOtpHasSendMessageDisplayed() { + return this.isElementDisplayed(otpSendMessage); + } + + public boolean isEsignetLoginPageDisplayed() { + return this.isElementDisplayed(esignetLoginHeader); + } + + public void clickOnEsignetLoginWithOtpButton() { + if(isElementDisplayed(esignetLoginButton)) { + clickOnElement(esignetLoginButton); + } + } + + public OtpVerificationPage setEnterIdTextBox(String uinOrVid) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + sendKeysToTextBox(enterIdTextBox, uinOrVid); + return new OtpVerificationPage(driver); + } + + public boolean isEnterYourVidTextDisplayed() { + return this.isElementDisplayed(enterYourVidTextHeader); + } + + public boolean isProgressingLogoDisplayed() { + return redirectingPage.isDisplayed(); + } + + public void clickOnGetOtpButton() { + clickOnElement(getOtpButton); + } + + public void clickOnVerifyButton() { + ((HidesKeyboard) driver).hideKeyboard(); + clickOnElement(verifyButton); + } + + public void clickOnVerifyButtonIos() { + clickOnElement(verifyButton); + } + + public boolean isInvalidOtpMessageDisplayed() { + return this.isElementDisplayed(invalidOtpText); + } + + public boolean verifyLanguageLoginHeaderTextDisplayed(String language){ + String actualText = getTextFromLocator(loginTextHeader); + + switch (language) { + case "English": + boolean isEnglishMatch = (actualText.equalsIgnoreCase("Login")==true) ? true : false; + return isEnglishMatch ; + case "Tamil": + boolean isTamilMatch = (actualText.equalsIgnoreCase("eSignet மூலம் உள்நுழையவும்")==true) ? true : false; + return isTamilMatch ; + case "Kannada": + boolean isKannadaMatch = (actualText.equalsIgnoreCase("ಇಸಿಗ್ನೆಟ್ ಮೂಲಕ ಲಾಗಿನ್ ಮಾಡಿ")==true) ? true : false; + return isKannadaMatch ; + case "Hindi": + boolean isHindiMatch = (actualText.equalsIgnoreCase("ईसिग्नेट से लॉगिन करें")==true) ? true : false; + return isHindiMatch ; + case "HindiIos": + boolean isHindiMatchIos = (actualText.equalsIgnoreCase("ईसिग्नेट से लॉगिन करें")==true) ? true : false; + return isHindiMatchIos ; + case "Arabic": + boolean isArabicMatch = (actualText.equalsIgnoreCase("تسجيل الدخول باستخدام eSignet")==true) ? true : false; + return isArabicMatch ; + } + return false; + } + + public boolean verifyLanguagePleaseEnterUinHeaderTextDisplayed(String language){ + String actualText = getTextFromLocator(pleaseEnterUinHeaderText); + + switch (language) { + case "English": + boolean isEnglishMatch = (actualText.equalsIgnoreCase("Please enter your UIN/VID")==true) ? true : false; + return isEnglishMatch ; + case "Tamil": + boolean isTamilMatch = (actualText.equalsIgnoreCase("உங்கள் UIN/VIDஐ உள்ளிடவும்")==true) ? true : false; + return isTamilMatch ; + case "TamilIos": + boolean isTamilMatchIos = (actualText.equalsIgnoreCase("உங்கள் UIN/VIDஐ உள்ளிடவும்")==true) ? true : false; + return isTamilMatchIos ; + case "Kannada": + boolean isKannadaMatch = (actualText.equalsIgnoreCase("ದಯವಿಟ್ಟು ನಿಮ್ಮ UIN/VID ಅನ್ನು ನಮೂದಿಸಿ")==true) ? true : false; + return isKannadaMatch ; + case "Hindi": + boolean isHindiMatch = (actualText.equalsIgnoreCase("कृपया अपना यूआईएन/वीआईडी \u200B\u200Bदर्ज करें")==true) ? true : false; + return isHindiMatch ; + case "HindiIos": + boolean isHindiMatchIos = (actualText.equalsIgnoreCase("अपना यूआईएन या वीआईडी \u200B\u200Bदर्ज करें")==true) ? true : false; + return isHindiMatchIos ; + case "Arabic": + boolean isArabicMatch = (actualText.equalsIgnoreCase("الرجاء إدخال UIN/VID الخاص بك")==true) ? true : false; + return isArabicMatch ; + } + return false; + } + + public void clickOnCloseButton() { + clickOnElement(CloseTab); + } + + public String getText(){ + System.out.println(getTextFromLocator(enterIdTextBox)); + return getTextFromLocator(enterIdTextBox); + } + + public void clickOnCredentialTypeHeadingMOSIPVerifiableCredential() { + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + if (isElementDisplayed(credentialTypeHeadingMOSIPVerifiableCredential)) { + clickOnElement(credentialTypeHeadingMOSIPVerifiableCredential); + } + } + + +} diff --git a/injitest/src/main/java/inji/pages/SettingsPage.java b/injitest/src/main/java/inji/pages/SettingsPage.java index 65b3fd70f0..0ef69b6a74 100644 --- a/injitest/src/main/java/inji/pages/SettingsPage.java +++ b/injitest/src/main/java/inji/pages/SettingsPage.java @@ -99,6 +99,9 @@ public class SettingsPage extends BasePage { @AndroidFindBy(accessibility = "newLabel") private WebElement newlable; + @AndroidFindBy(accessibility = "keyManagement") + private WebElement keyManagement; + public SettingsPage(AppiumDriver driver) { super(driver); @@ -245,4 +248,8 @@ public String getreceiveCardText(){ return getTextFromLocator(receiveCardText); } + public KeyManagementPage clickOnKeyManagement() { + clickOnElement(keyManagement); + return new KeyManagementPage(driver); + } } diff --git a/injitest/src/main/java/inji/pages/SharePage.java b/injitest/src/main/java/inji/pages/SharePage.java index 739f637e94..98bd62c948 100644 --- a/injitest/src/main/java/inji/pages/SharePage.java +++ b/injitest/src/main/java/inji/pages/SharePage.java @@ -198,6 +198,8 @@ public void clickOnCameraDisabledToasterClose(){ public void clickOnDontAllowCameraAccessButton(){ if(isElementDisplayed(cameraDontAllowAccessPopup)) clickOnElement(cameraDontAllowAccessPopup); + + } public boolean isCameraAccessLostPageLoaded() { diff --git a/injitest/src/main/java/inji/pages/SunbirdLoginPage.java b/injitest/src/main/java/inji/pages/SunbirdLoginPage.java index aee595f6c5..04e3f78433 100644 --- a/injitest/src/main/java/inji/pages/SunbirdLoginPage.java +++ b/injitest/src/main/java/inji/pages/SunbirdLoginPage.java @@ -39,7 +39,7 @@ public class SunbirdLoginPage extends BasePage { @iOSXCUITFindBy(xpath = "//XCUIElementTypeStaticText[@name=\"January 2024\"]") private WebElement January2024; - @AndroidFindBy(xpath = "//android.widget.Button[@resource-id=\"verify_form\"]") + @AndroidFindBy(xpath = "//*[@resource-id=\"verify_form\"]") @iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeButton[`name == \"Login\"`]") private WebElement loginButton; @@ -151,6 +151,15 @@ public class SunbirdLoginPage extends BasePage { @iOSXCUITFindBy(accessibility = "6done") private WebElement doneButton; + @AndroidFindBy(accessibility = "keyTypeVcDetailViewValue") + @iOSXCUITFindBy(accessibility = "keyTypeVcDetailViewValue") + private WebElement keyTypeVcDetailViewValue; + + @AndroidFindBy(xpath = "//*[@text=\"Login failed, please enter correct credentials\"]") + @iOSXCUITFindBy(xpath = "//*[@text=\"Login failed, please enter correct credentials\"]") + private WebElement LoginFailedDueTOInValidCredentials; + + public SunbirdLoginPage(AppiumDriver driver) { super(driver); } @@ -206,11 +215,19 @@ public void enterDateOfBirthTextBox() { clickOnElement(clickOnSetButton); } } - public void clickOnloginButton() { - if(isElementDisplayed(loginButton)) { + public void clickOnloginButton() throws InterruptedException { + + int retryCount = 0; + while (isElementDisplayed(loginButton) && retryCount < 5) { clickOnElement(loginButton); + if (isElementDisplayed(LoginFailedDueTOInValidCredentials)) { + retryCount++; + Thread.sleep(1000); + } else { + break; + } } - else { + if(isElementDisplayed(loginButtonSecond)){ clickOnElement(loginButtonSecond); } } diff --git a/injitest/src/main/java/inji/utils/IosUtil.java b/injitest/src/main/java/inji/utils/IosUtil.java index f67d9d43be..98fafc340c 100644 --- a/injitest/src/main/java/inji/utils/IosUtil.java +++ b/injitest/src/main/java/inji/utils/IosUtil.java @@ -1,9 +1,15 @@ package inji.utils; import io.appium.java_client.AppiumDriver; +import io.appium.java_client.PerformsTouchActions; +import io.appium.java_client.android.AndroidTouchAction; +import io.appium.java_client.ios.IOSTouchAction; +import io.appium.java_client.touch.LongPressOptions; +import io.appium.java_client.touch.offset.ElementOption; import org.openqa.selenium.Dimension; import org.openqa.selenium.Point; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Action; import org.openqa.selenium.interactions.Pause; import org.openqa.selenium.interactions.PointerInput; import org.openqa.selenium.interactions.Sequence; @@ -24,6 +30,79 @@ public static void scrollToElement(AppiumDriver driver, int startX, int startY, } + public static void swipeOrScroll(AppiumDriver driver) { + Dimension size = driver.manage().window().getSize(); + int startX = 68; + int startY = 927; + int endX = startX; + int endY = 474; + PointerInput finger1 = new PointerInput(PointerInput.Kind.TOUCH, "finger1"); + Sequence sequence = new Sequence(finger1, 1) + .addAction(finger1.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), startX, startY)) + .addAction(finger1.createPointerDown(PointerInput.MouseButton.LEFT.asArg())) + .addAction(new Pause(finger1, Duration.ofMillis(200))) + .addAction(finger1.createPointerMove(Duration.ofMillis(100), PointerInput.Origin.viewport(), endX, endY)) + .addAction(finger1.createPointerUp(PointerInput.MouseButton.LEFT.asArg())); + driver.perform(Collections.singletonList(sequence)); + } + + + public static void dragAndDrop(AppiumDriver driver, WebElement eleToDrag, WebElement eleTODrop) { + AndroidTouchAction action = new AndroidTouchAction((PerformsTouchActions) driver); + action.longPress(LongPressOptions.longPressOptions() + .withElement(ElementOption.element(eleToDrag))) + .moveTo(ElementOption.element(eleTODrop)) + .release() + .perform(); + + } + + public static void dragAndDropForIos(AppiumDriver driver, WebElement eleToDrag, WebElement eleTODrop) { + IOSTouchAction action = new IOSTouchAction((PerformsTouchActions) driver); + action.longPress(LongPressOptions.longPressOptions() + .withElement(ElementOption.element(eleToDrag)) + .withDuration(Duration.ofSeconds(1))) + .moveTo(ElementOption.element(eleTODrop)) + .release() + .perform(); + } + + + + + + +// public static void dragAndDrop(AppiumDriver driver, WebElement draggableElement, int startX, int startY, int endX, int endY) { +// PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "first finger"); +// Sequence sequence = new Sequence(finger, 0) +// .addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), startX, startY)) // Move to start position +// .addAction(finger.createPointerDown(Duration.ofMillis(500))) // Long press to initiate drag +// .addAction(finger.createPointerMove(toPointerLocation(draggableElement))) // Move to draggable element +// .addAction(finger.createPointerMove(Duration.ofMillis(100))) // Slight delay after grabbing element +// .concat(repeatWhileMoving(finger, endX, endY)) // Loop and move to end position +// .addAction(finger.createPointerUp()); // Release element at end position +// +// driver.perform(Collections.singleton(sequence)); +// } +// +// private static Action repeatWhileMoving(PointerInput finger, int endX, int endY) { +// CompoundAction action = new CompoundAction(); +// while (true) { +// action.add(finger.createPointerMove(Duration.ofMillis(50), PointerInput.Origin.pointer(), 10, 10)); // Move slightly during loop +// if (isElementAtPosition(driver, draggableElement, endX, endY)) { +// break; +// } +// } +// return action; +// } + + private static boolean isElementAtPosition(AppiumDriver driver, WebElement element, int x, int y) { + // Implement logic to check if element is at desired coordinates (x, y) using Appium locators + // You can use element.getLocation() and compare with (x, y) + // This is a placeholder, replace with your actual implementation + return true; // Replace with actual logic + } + public static void tapOnElement(AppiumDriver driver, WebElement element) { Point location = element.getLocation(); Dimension size = element.getSize(); diff --git a/injitest/src/main/java/inji/utils/TestDataReader.java b/injitest/src/main/java/inji/utils/TestDataReader.java index 05e1d1ae2e..c7218baa00 100644 --- a/injitest/src/main/java/inji/utils/TestDataReader.java +++ b/injitest/src/main/java/inji/utils/TestDataReader.java @@ -34,8 +34,12 @@ private static String getValueForKey(String key) { return "1234567891"; case "fullName": return "TEST_FULLNAMEeng"; + case "fullNameForMobileDrivingLicense": + return "Joseph"; case "idType": return "MOSIP National ID"; + case "idTypeForMobileDrivingLicense": + return "Mobile Driving License"; case "gender": return "MLEeng"; case "genderVidEsignet": @@ -50,6 +54,8 @@ private static String getValueForKey(String key) { return "01/01/1996"; case "dateOfBirthForVidEsignet": return "1996/01/01"; + case "dateOfBirthForMobileDrivingLicense": + return "1994-11-06"; case "aid": return UinGenerationUtil.getRandomAidData(); case "emailPassword": @@ -66,6 +72,8 @@ private static String getValueForKey(String key) { return UinGenerationUtil.getRandomUin(); case "uin2": return "2162743612"; + case "MockVc": + return "1234567"; case "uin2FullName": return "TEST_FULLNAMEeng"; case "newEnv": @@ -100,6 +108,14 @@ private static String getValueForKey(String key) { return "Valid"; case "isDeviceFarmRun": return "true"; + case "ED25519Key": + return "ED25519"; + case "ECCK1Key": + return "ECC K1"; + case "ECCR1Key": + return "ECC R1"; + case "RSAKey": + return "RSA"; default: return "Key not found"; } diff --git a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java new file mode 100644 index 0000000000..5a97156af6 --- /dev/null +++ b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java @@ -0,0 +1,77 @@ +package androidTestCases; + +import BaseTest.AndroidBaseTest; +import inji.api.BaseTestCase; +import inji.constants.Target; +import inji.pages.*; +import inji.utils.TestDataReader; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +public class VcDownloadAndVerifyUsingMockIdentity extends AndroidBaseTest { + @Test + public void downloadAndVerifyVcUsingUinViaMockIdentity() 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.ANDROID); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.ANDROID); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); + assertTrue(addNewCardPage.isIssuerSearchBarDisplayed(), "Verify if issuer search bar displayed"); +// addNewCardPage.sendTextInIssuerSearchBar("Download MOSIP Credentials"); + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + assertTrue(addNewCardPage.isAddNewCardPageGuideMessageForEsignetDisplayed(), "Verify if add new card guide message displayed"); + assertTrue(addNewCardPage.isDownloadViaEsignetDisplayed(), "Verify if download via uin displayed"); + MockCertifyLoginPage mockCertifyLoginPage = addNewCardPage.clickOnDownloadViaMockCertify(); + +// mockCertifyLoginPage.clickOnEsignetLoginWithOtpButton(); + + assertTrue(mockCertifyLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); + + OtpVerificationPage otpVerification= mockCertifyLoginPage.setEnterIdTextBox(TestDataReader.readData("MockVc")); + + mockCertifyLoginPage.clickOnGetOtpButton(); + assertTrue(mockCertifyLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); + + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); + mockCertifyLoginPage.clickOnVerifyButtonIos(); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullNameForMobileDrivingLicense")), "Verify if full name is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullNameForMobileDrivingLicense")); + + detailedVcViewPage.clickOnQrCodeButton(); + SoftAssert softAssert = new SoftAssert(); + softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); + + detailedVcViewPage.clickOnQrCrossIcon(); + assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); +// assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullNameForMobileDrivingLicense"), "Verify if full name is displayed"); +// assertEquals(detailedVcViewPage.getDateOfBirthInDetailedVcView(), TestDataReader.readData("dateOfBirthForMobileDrivingLicense"), "Verify if date of birth is displayed"); + assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idTypeForMobileDrivingLicense"), "Verify if id type is displayed"); + assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); + assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); + detailedVcViewPage.clickOnBackArrow(); + assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + } +} diff --git a/injitest/src/test/java/androidTestCases/keyManagement.java b/injitest/src/test/java/androidTestCases/keyManagement.java new file mode 100644 index 0000000000..a13dfe9b06 --- /dev/null +++ b/injitest/src/test/java/androidTestCases/keyManagement.java @@ -0,0 +1,212 @@ +package androidTestCases; + +import BaseTest.AndroidBaseTest; +import com.google.common.collect.ImmutableMap; +import inji.api.BaseTestCase; +import inji.constants.Target; +import inji.pages.*; +import inji.utils.IosUtil; +import inji.utils.TestDataReader; +import io.appium.java_client.PerformsTouchActions; +import io.appium.java_client.android.AndroidTouchAction; +import io.appium.java_client.touch.LongPressOptions; +import io.appium.java_client.touch.offset.ElementOption; +import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.remote.RemoteWebElement; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +public class keyManagement extends AndroidBaseTest { + @Test + public void downloadAndVerifyVcUsingUinViaSunbird() 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.ANDROID); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.ANDROID); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + + SettingsPage settingsPage = homePage.clickOnSettingIcon(); + settingsPage.clickOnKeyManagement(); + Thread.sleep(3000); + KeyManagementPage keyManagementPage = new KeyManagementPage(driver); + keyManagementPage.clickOnDoneButton(); + Thread.sleep(3000); + + IosUtil.dragAndDrop(driver,keyManagementPage.getTheCoordinatesForRSA(),keyManagementPage.getTheCoordinatesED25519Text()); + keyManagementPage.clickOnSaveKeyOrderingPreferenceButton(); + + assertTrue(keyManagementPage.iskeyOrderingSuccessTextMessageDisplayed(), "Verify if confirm passcode page is displayed"); + keyManagementPage.clickOnArrowleftButton(); + + homePage.clickOnHomeButton(); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + SunbirdLoginPage sunbirdLoginPage = addNewCardPage.clickOnDownloadViaSunbird(); + addNewCardPage.clickOnCredentialTypeHeadingInsuranceCredential(); + + sunbirdLoginPage.enterPolicyNumberTextBox(TestDataReader.readData("policyNumberSunbird")); + sunbirdLoginPage.enterFullNameTextBox(TestDataReader.readData("fullNameSunbird")); + sunbirdLoginPage.enterDateOfBirthTextBox(); + sunbirdLoginPage.clickOnloginButton(); + + assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); + assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); + assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); + sunbirdLoginPage.openDetailedSunbirdVcView(); + assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); + assertTrue(keyManagementPage.compareListOfKeys()); + + } + + @Test + public void downloadAndVerifyVcUsingMockIdentity() 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.ANDROID); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.ANDROID); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + + SettingsPage settingsPage = homePage.clickOnSettingIcon(); + settingsPage.clickOnKeyManagement(); + Thread.sleep(3000); + KeyManagementPage keyManagementPage = new KeyManagementPage(driver); + keyManagementPage.clickOnDoneButton(); + Thread.sleep(3000); + + IosUtil.dragAndDrop(driver,keyManagementPage.getTheCoordinatesECCR1TextText(),keyManagementPage.getTheCoordinatesED25519Text()); + keyManagementPage.clickOnSaveKeyOrderingPreferenceButton(); + + assertTrue(keyManagementPage.iskeyOrderingSuccessTextMessageDisplayed(), "Verify if confirm passcode page is displayed"); + keyManagementPage.clickOnArrowleftButton(); + + homePage.clickOnHomeButton(); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + MockCertifyLoginPage mockCertifyLoginPage = addNewCardPage.clickOnDownloadViaMockCertify(); + +// mockCertifyLoginPage.clickOnEsignetLoginWithOtpButton(); + + assertTrue(mockCertifyLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); + + OtpVerificationPage otpVerification= mockCertifyLoginPage.setEnterIdTextBox(TestDataReader.readData("MockVc")); + + mockCertifyLoginPage.clickOnGetOtpButton(); + assertTrue(mockCertifyLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); + + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); + mockCertifyLoginPage.clickOnVerifyButton(); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullNameForMobileDrivingLicense")), "Verify if full name is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullNameForMobileDrivingLicense")); + + detailedVcViewPage.clickOnQrCodeButton(); + SoftAssert softAssert = new SoftAssert(); + softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); + + detailedVcViewPage.clickOnQrCrossIcon(); + assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); + assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idTypeForMobileDrivingLicense"), "Verify if id type is displayed"); + assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); + assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); + assertTrue(keyManagementPage.compareListOfKeys()); + + } + + @Test + public void downloadAndVerifyVcUsingEsignet() 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.ANDROID); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.ANDROID); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + + SettingsPage settingsPage = homePage.clickOnSettingIcon(); + settingsPage.clickOnKeyManagement(); + Thread.sleep(3000); + KeyManagementPage keyManagementPage = new KeyManagementPage(driver); + keyManagementPage.clickOnDoneButton(); + Thread.sleep(3000); + + IosUtil.dragAndDrop(driver,keyManagementPage.getTheCoordinatesForRSA(),keyManagementPage.getTheCoordinatesED25519Text()); + keyManagementPage.clickOnSaveKeyOrderingPreferenceButton(); + + assertTrue(keyManagementPage.iskeyOrderingSuccessTextMessageDisplayed(), "Verify if confirm passcode page is displayed"); + keyManagementPage.clickOnArrowleftButton(); + + homePage.clickOnHomeButton(); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); + + esignetLoginPage.clickOnEsignetLoginWithOtpButton(); + + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); + String uin=TestDataReader.readData("uin"); + OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(uin); + + esignetLoginPage.clickOnGetOtpButton(); + assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); + + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); + esignetLoginPage.clickOnVerifyButton(); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + detailedVcViewPage.clickOnQrCodeButton(); + SoftAssert softAssert = new SoftAssert(); + softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); + +// detailedVcViewPage.clickOnQrCrossIcon(); +// assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); + assertTrue(keyManagementPage.compareListOfKeys()); + } + + } diff --git a/injitest/src/test/java/iosTestCases/KeyManagmentTest.java b/injitest/src/test/java/iosTestCases/KeyManagmentTest.java new file mode 100644 index 0000000000..657ca565c4 --- /dev/null +++ b/injitest/src/test/java/iosTestCases/KeyManagmentTest.java @@ -0,0 +1,48 @@ +package iosTestCases; + +import BaseTest.IosBaseTest; +import inji.api.BaseTestCase; +import inji.constants.Target; +import inji.pages.*; +import inji.utils.IosUtil; +import inji.utils.TestDataReader; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +public class KeyManagmentTest extends IosBaseTest { + @Test + public void downloadAndVerifyVcUsingUinViaEsignet() 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.IOS); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + SettingsPage settingsPage = homePage.clickOnSettingIcon(); + + settingsPage.clickOnKeyManagement(); + Thread.sleep(3000); + KeyManagementPage keyManagementPage = new KeyManagementPage(driver); + keyManagementPage.clickOnDoneButton(); + Thread.sleep(3000); + + IosUtil.dragAndDropForIos(driver,keyManagementPage.getTheCoordinatesForRSA(),keyManagementPage.getTheCoordinatesED25519Text()); + keyManagementPage.clickOnSaveKeyOrderingPreferenceButton(); + } +} \ No newline at end of file diff --git a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java new file mode 100644 index 0000000000..a62338a274 --- /dev/null +++ b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java @@ -0,0 +1,76 @@ +package iosTestCases; + +import BaseTest.IosBaseTest; +import inji.api.BaseTestCase; +import inji.constants.Target; +import inji.pages.*; +import inji.utils.TestDataReader; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +public class VcDownloadAndVerifyUsingMockIdentityTest extends IosBaseTest { + @Test + public void downloadAndVerifyVcUsingUinViaEsignet() 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.IOS); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); + assertTrue(addNewCardPage.isIssuerSearchBarDisplayed(), "Verify if issuer search bar displayed"); +// addNewCardPage.sendTextInIssuerSearchBar("Download MOSIP Credentials"); + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + assertTrue(addNewCardPage.isAddNewCardPageGuideMessageForEsignetDisplayed(), "Verify if add new card guide message displayed"); + assertTrue(addNewCardPage.isDownloadViaEsignetDisplayed(), "Verify if download via uin displayed"); + MockCertifyLoginPage mockCertifyLoginPage = addNewCardPage.clickOnDownloadViaMockCertify(); + + addNewCardPage.clickOnContinueButtonInSigninPopupIos(); + + Thread.sleep(9000); + OtpVerificationPage otpVerification= mockCertifyLoginPage.setEnterIdTextBox(TestDataReader.readData("MockVc")); + + mockCertifyLoginPage.clickOnGetOtpButton(); +// assertTrue(mockCertifyLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); + + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); + mockCertifyLoginPage.clickOnVerifyButtonIos(); + + assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullNameForMobileDrivingLicense")), "Verify if full name is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullNameForMobileDrivingLicense")); + + detailedVcViewPage.clickOnQrCodeButton(); + SoftAssert softAssert = new SoftAssert(); + softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); + + detailedVcViewPage.clickOnQrCrossIcon(); + assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); +// assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullNameForMobileDrivingLicense"), "Verify if full name is displayed"); +// assertEquals(detailedVcViewPage.getDateOfBirthInDetailedVcView(), TestDataReader.readData("dateOfBirthForMobileDrivingLicense"), "Verify if date of birth is displayed"); + assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idTypeForMobileDrivingLicense"), "Verify if id type is displayed"); + assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); + assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); + detailedVcViewPage.clickOnBackArrow(); + assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + } +} \ No newline at end of file From 3b3a6daeab2149a54296a8726211626823580631 Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Tue, 19 Nov 2024 17:22:41 +0530 Subject: [PATCH 02/10] resolve conflicts Signed-off-by: Anup Nehe --- .../src/main/java/inji/utils/IosUtil.java | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/injitest/src/main/java/inji/utils/IosUtil.java b/injitest/src/main/java/inji/utils/IosUtil.java index 98fafc340c..d4d652c1e3 100644 --- a/injitest/src/main/java/inji/utils/IosUtil.java +++ b/injitest/src/main/java/inji/utils/IosUtil.java @@ -67,42 +67,6 @@ public static void dragAndDropForIos(AppiumDriver driver, WebElement eleToDrag, .perform(); } - - - - - -// public static void dragAndDrop(AppiumDriver driver, WebElement draggableElement, int startX, int startY, int endX, int endY) { -// PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "first finger"); -// Sequence sequence = new Sequence(finger, 0) -// .addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), startX, startY)) // Move to start position -// .addAction(finger.createPointerDown(Duration.ofMillis(500))) // Long press to initiate drag -// .addAction(finger.createPointerMove(toPointerLocation(draggableElement))) // Move to draggable element -// .addAction(finger.createPointerMove(Duration.ofMillis(100))) // Slight delay after grabbing element -// .concat(repeatWhileMoving(finger, endX, endY)) // Loop and move to end position -// .addAction(finger.createPointerUp()); // Release element at end position -// -// driver.perform(Collections.singleton(sequence)); -// } -// -// private static Action repeatWhileMoving(PointerInput finger, int endX, int endY) { -// CompoundAction action = new CompoundAction(); -// while (true) { -// action.add(finger.createPointerMove(Duration.ofMillis(50), PointerInput.Origin.pointer(), 10, 10)); // Move slightly during loop -// if (isElementAtPosition(driver, draggableElement, endX, endY)) { -// break; -// } -// } -// return action; -// } - - private static boolean isElementAtPosition(AppiumDriver driver, WebElement element, int x, int y) { - // Implement logic to check if element is at desired coordinates (x, y) using Appium locators - // You can use element.getLocation() and compare with (x, y) - // This is a placeholder, replace with your actual implementation - return true; // Replace with actual logic - } - public static void tapOnElement(AppiumDriver driver, WebElement element) { Point location = element.getLocation(); Dimension size = element.getSize(); From b88a2ec53dbce6ccfa8bcb2a2827ed80b822e592 Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Tue, 19 Nov 2024 17:33:37 +0530 Subject: [PATCH 03/10] resolve conflicts Signed-off-by: Anup Nehe --- .../src/main/java/inji/pages/SunbirdLoginPage.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/injitest/src/main/java/inji/pages/SunbirdLoginPage.java b/injitest/src/main/java/inji/pages/SunbirdLoginPage.java index 04e3f78433..22edfb4a98 100644 --- a/injitest/src/main/java/inji/pages/SunbirdLoginPage.java +++ b/injitest/src/main/java/inji/pages/SunbirdLoginPage.java @@ -215,19 +215,11 @@ public void enterDateOfBirthTextBox() { clickOnElement(clickOnSetButton); } } - public void clickOnloginButton() throws InterruptedException { - - int retryCount = 0; - while (isElementDisplayed(loginButton) && retryCount < 5) { + public void clickOnloginButton() { + if(isElementDisplayed(loginButton)) { clickOnElement(loginButton); - if (isElementDisplayed(LoginFailedDueTOInValidCredentials)) { - retryCount++; - Thread.sleep(1000); - } else { - break; - } } - if(isElementDisplayed(loginButtonSecond)){ + else { clickOnElement(loginButtonSecond); } } From 79d3551acc8c3bb7edbc849761662a2d27f365e9 Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Fri, 22 Nov 2024 15:55:45 +0530 Subject: [PATCH 04/10] updated the readme Signed-off-by: Anup Nehe --- injitest/src/main/java/inji/pages/OtpVerificationPage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/injitest/src/main/java/inji/pages/OtpVerificationPage.java b/injitest/src/main/java/inji/pages/OtpVerificationPage.java index 47d683e80c..4dcd9e5f4a 100644 --- a/injitest/src/main/java/inji/pages/OtpVerificationPage.java +++ b/injitest/src/main/java/inji/pages/OtpVerificationPage.java @@ -61,8 +61,8 @@ public class OtpVerificationPage extends BasePage { private WebElement waitPopupButton; - @AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"OTP is invalid\")") - @iOSXCUITFindBy(accessibility = "OTP is invalid") + @AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Please enter valid OTP.\")") + @iOSXCUITFindBy(accessibility = "Please enter valid OTP.") private WebElement invalidOtpMessageforEsignet; public OtpVerificationPage(AppiumDriver driver) { From b4817c5a27dd527bf7e7bd3249ad8f23f1691a4f Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Mon, 25 Nov 2024 09:21:16 +0530 Subject: [PATCH 05/10] updated readme Signed-off-by: Anup Nehe --- injitest/README.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/injitest/README.md b/injitest/README.md index a7cd70bedc..0bd134f6b7 100644 --- a/injitest/README.md +++ b/injitest/README.md @@ -8,27 +8,26 @@ Inji Automation is a mobile automation framework designed for iOS and Android pl To set up Appium for use with this framework, please follow the installation instructions provided in the [Appium documentation](https://appium.io/docs/en/2.2/quickstart/install/). -## Build +## Pre-requisites +Ensure the following software is installed on the machine from where the automation tests will be executed: -1. Build the JAR file: `mvn clean package -DskipTests=true` -2. The JAR file will be generated in the `target` directory. -3. For running tests on Device Farm, use the JAR file with dependencies (`zip-with-dependencies`). +1. The project requires JDK 21 ## Configurations -1. Update `Config>>kernal.properties` to modify the environment settings. -2. Update the following keys in `src/main/java>>inji.utils>>TestDataReader.java`: - - `uin` - - `uin2` - - `aid` for environment changes. -3. Update `Config>>config.properties` with the following values: - - `nodePath` - - `appiumServerExecutable` -4. Update `Config>>DesiredCapabilies.json` with the following keys: - - `appium:udid` - - `appium:app` -5. If the run is on Device Farm, set `isDeviceFarmRun` to `true`. -6. To run tests in an IDE, set `isDeviceFarmRun` to `false` and execute the `testng.xml` file. +1. update `resourec/uin.json`,`resourec/Vid.json`,`resourec/aid.json` file as per the uin and vids being used. +2. Update utils/TestDataReader to include updates for FullName, uin, idType, gender, phoneNumber, dateOfBirth, and externalEmail as they are used during creation. + +## BrowserStack +1.singup to browserStack & get the userName and accessKey from home page on browserStack +2.Upload app on browserStack it will return 'bs://', update the same appid in iosConfig.yml/androidconfig.yml +2.update the userName and accessKey from iosConfig.yml/androidconfig.yml +3.update the device from tag platforms from https://www.browserstack.com/list-of-browsers-and-platforms/automate (Windows, Mac) +4.Open command prompt and change directory by using command 'cd ../injitest' +5.Hit the command mvn clean test -DtestngXmlFile=androidSanity.xml -Dbrowserstack.config="androidConfig.yml", for running the sanity for android +6.Hit the command mvn clean test -DtestngXmlFile=iosSanity.xml -Dbrowserstack.config="iosConfig.yml", for running the sanity for ios +7.6.Hit the command mvn clean test -DtestngXmlFile=iosRegression.xml -Dbrowserstack.config="iosConfig.yml", for running the regression for ios +5.Hit the command mvn clean test -DtestngXmlFile=androidRegression.xml -Dbrowserstack.config="androidConfig.yml", for running the Regression for android ## Reports From bce47f89636b42131435363c96b2810ea3b759c6 Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Mon, 25 Nov 2024 10:51:07 +0530 Subject: [PATCH 06/10] update readme Signed-off-by: Anup Nehe --- injitest/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/injitest/README.md b/injitest/README.md index 0bd134f6b7..aca9b3a34d 100644 --- a/injitest/README.md +++ b/injitest/README.md @@ -19,15 +19,15 @@ Ensure the following software is installed on the machine from where the automat 2. Update utils/TestDataReader to include updates for FullName, uin, idType, gender, phoneNumber, dateOfBirth, and externalEmail as they are used during creation. ## BrowserStack -1.singup to browserStack & get the userName and accessKey from home page on browserStack -2.Upload app on browserStack it will return 'bs://', update the same appid in iosConfig.yml/androidconfig.yml -2.update the userName and accessKey from iosConfig.yml/androidconfig.yml -3.update the device from tag platforms from https://www.browserstack.com/list-of-browsers-and-platforms/automate (Windows, Mac) -4.Open command prompt and change directory by using command 'cd ../injitest' -5.Hit the command mvn clean test -DtestngXmlFile=androidSanity.xml -Dbrowserstack.config="androidConfig.yml", for running the sanity for android -6.Hit the command mvn clean test -DtestngXmlFile=iosSanity.xml -Dbrowserstack.config="iosConfig.yml", for running the sanity for ios -7.6.Hit the command mvn clean test -DtestngXmlFile=iosRegression.xml -Dbrowserstack.config="iosConfig.yml", for running the regression for ios -5.Hit the command mvn clean test -DtestngXmlFile=androidRegression.xml -Dbrowserstack.config="androidConfig.yml", for running the Regression for android +1. singup to browserStack & get the userName and accessKey from home page on browserStack +2. Upload app on browserStack it will return 'bs://', update the same appid in iosConfig.yml/androidconfig.yml +2. update the userName and accessKey from iosConfig.yml/androidconfig.yml +3. update the device from tag platforms from https://www.browserstack.com/list-of-browsers-and-platforms/automate (Windows, Mac) +4. Open command prompt and change directory by using command 'cd ../injitest' +5. Hit the command mvn clean test -DtestngXmlFile=androidSanity.xml -Dbrowserstack.config="androidConfig.yml", for running the sanity for android +6. Hit the command mvn clean test -DtestngXmlFile=iosSanity.xml -Dbrowserstack.config="iosConfig.yml", for running the sanity for ios +7. Hit the command mvn clean test -DtestngXmlFile=iosRegression.xml -Dbrowserstack.config="iosConfig.yml", for running the regression for ios +8. Hit the command mvn clean test -DtestngXmlFile=androidRegression.xml -Dbrowserstack.config="androidConfig.yml", for running the Regression for android ## Reports From 849c5d1111f165bf2a48c7ca38ccee27a549a138 Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Wed, 27 Nov 2024 09:55:17 +0530 Subject: [PATCH 07/10] MOSIP-37765 MOSIP-37848 Signed-off-by: Anup Nehe --- injitest/androidRegression.xml | 19 +- injitest/androidSanity.xml | 5 +- injitest/esignetForAndroid.xml | 17 ++ injitest/esignetForIos.xml | 173 ++++++++++++++++++ injitest/iosRegression.xml | 20 +- injitest/iosSanity.xml | 5 +- .../main/java/inji/pages/SettingsPage.java | 2 +- .../main/java/inji/utils/SuiteListener.java | 45 +---- .../main/java/inji/utils/SuiteListeners.java | 10 + 9 files changed, 233 insertions(+), 63 deletions(-) create mode 100644 injitest/esignetForAndroid.xml create mode 100644 injitest/esignetForIos.xml create mode 100644 injitest/src/main/java/inji/utils/SuiteListeners.java diff --git a/injitest/androidRegression.xml b/injitest/androidRegression.xml index d66c3cf0a2..0222451f77 100644 --- a/injitest/androidRegression.xml +++ b/injitest/androidRegression.xml @@ -1,11 +1,11 @@ - + + + - + @@ -28,11 +28,6 @@ - - - - - @@ -98,7 +93,7 @@ - + @@ -149,10 +144,10 @@ - + - + diff --git a/injitest/androidSanity.xml b/injitest/androidSanity.xml index 7adbdffc4a..fe0286d6a6 100644 --- a/injitest/androidSanity.xml +++ b/injitest/androidSanity.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/injitest/esignetForAndroid.xml b/injitest/esignetForAndroid.xml new file mode 100644 index 0000000000..557405b635 --- /dev/null +++ b/injitest/esignetForAndroid.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/injitest/esignetForIos.xml b/injitest/esignetForIos.xml new file mode 100644 index 0000000000..8ff6dccada --- /dev/null +++ b/injitest/esignetForIos.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/injitest/iosRegression.xml b/injitest/iosRegression.xml index f500ad8019..a0be734e77 100644 --- a/injitest/iosRegression.xml +++ b/injitest/iosRegression.xml @@ -1,11 +1,11 @@ - - - + + + + + @@ -27,12 +27,6 @@ - - - - - - @@ -127,8 +121,8 @@ - - + + + \ No newline at end of file diff --git a/injitest/src/main/java/inji/utils/SuiteListener.java b/injitest/src/main/java/inji/utils/SuiteListener.java index ff9430523a..711a656d91 100644 --- a/injitest/src/main/java/inji/utils/SuiteListener.java +++ b/injitest/src/main/java/inji/utils/SuiteListener.java @@ -14,7 +14,7 @@ public class SuiteListener implements ISuiteListener { @Override public void onStart(ISuite suite) { - // No action needed for `onStart` in this case + } @Override @@ -23,7 +23,6 @@ public void onFinish(ISuite suite) { boolean hasFailures = suite.getResults().values().stream() .anyMatch(result -> result.getTestContext().getFailedTests().size() > 0); - // Dynamically skip androidRegression if there are failures if (hasFailures) { System.exit(1); System.out.println("Sanity suite has failures. Skipping Regression suite."); From 008ec529b6dce520181716d8f044c59889621c72 Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Mon, 20 Jan 2025 09:32:59 +0530 Subject: [PATCH 09/10] MOSIP-39001 Signed-off-by: Anup Nehe --- injitest/androidRegression.xml | 12 + .../main/java/inji/pages/AddNewCardPage.java | 72 +- .../java/inji/pages/DetailedVcViewPage.java | 8 +- .../java/inji/pages/EsignetLoginPage.java | 2 +- .../src/main/java/inji/pages/HistoryPage.java | 28 +- .../src/main/java/inji/pages/HomePage.java | 35 +- .../java/inji/pages/OtpVerificationPage.java | 4 +- .../main/java/inji/pages/SettingsPage.java | 2 +- .../src/main/java/inji/pages/SharePage.java | 2 - .../java/inji/pages/SunbirdLoginPage.java | 40 +- .../main/java/inji/utils/SuiteListener.java | 46 +- .../main/java/inji/utils/SuiteListeners.java | 10 - .../main/java/inji/utils/TestDataReader.java | 28 +- injitest/src/main/resources/Uins.json | 15 +- injitest/src/main/resources/Vids.json | 15 +- .../java/androidTestCases/ActivateVcTest.java | 18 +- .../androidTestCases/ChangeLanguageTest.java | 4 +- .../CredentialRegistryTest.java | 180 ++-- .../java/androidTestCases/DeletingVcTest.java | 25 +- .../GenerateUinOrVidTest.java | 5 +- .../MosipOtpAlternativeFlow.java | 62 +- .../NoNetworkAndroidTest.java | 102 +- .../test/java/androidTestCases/PinVcTest.java | 71 +- .../java/androidTestCases/ShareVcTest.java | 7 +- .../VcBackupAndRestoreTest.java | 62 +- .../VcDownloadAndVerifyUsingEsignetTest.java | 47 +- .../VcDownloadAndVerifyUsingMockIdentity.java | 8 +- .../VcDownloadAndVerifyUsingSunbirdTest.java | 6 +- .../VcDownloadAndVerifyUsingUinTest.java | 79 +- .../VcDownloadAndVerifyUsingVidTest.java | 79 +- .../androidTestCases/VerifyHistoryTest.java | 69 +- .../java/androidTestCases/keyManagement.java | 10 +- .../java/iosTestCases/ActivateVcTest.java | 16 +- .../java/iosTestCases/ChangeLanguageTest.java | 7 +- .../iosTestCases/CredentialRegistryTest.java | 177 ++-- .../java/iosTestCases/DeletingVcTest.java | 20 +- .../iosTestCases/GenerateUinOrVidTest.java | 3 +- .../java/iosTestCases/KeyManagmentTest.java | 48 - .../iosTestCases/MosipOtpAlternativeFlow.java | 55 +- .../java/iosTestCases/NoNetworkIosTest.java | 16 +- .../src/test/java/iosTestCases/PinVcTest.java | 30 +- .../test/java/iosTestCases/ShareVcTest.java | 3 +- .../VcDownloadAndVerifyUsingEsignetTest.java | 25 +- ...ownloadAndVerifyUsingMockIdentityTest.java | 76 -- .../VcDownloadAndVerifyUsingUinTest.java | 906 +++++++++--------- .../VcDownloadAndVerifyUsingVidTest.java | 20 +- .../java/iosTestCases/VerifyHistoryTest.java | 27 +- .../iosTestCases/VerifyWelcomePagesTest.java | 20 +- 48 files changed, 1325 insertions(+), 1277 deletions(-) delete mode 100644 injitest/src/main/java/inji/utils/SuiteListeners.java delete mode 100644 injitest/src/test/java/iosTestCases/KeyManagmentTest.java delete mode 100644 injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java diff --git a/injitest/androidRegression.xml b/injitest/androidRegression.xml index 0222451f77..bcd6eca81f 100644 --- a/injitest/androidRegression.xml +++ b/injitest/androidRegression.xml @@ -147,6 +147,18 @@ + + + + + + + + + + + + diff --git a/injitest/src/main/java/inji/pages/AddNewCardPage.java b/injitest/src/main/java/inji/pages/AddNewCardPage.java index 388f9b8c02..40e6d21913 100644 --- a/injitest/src/main/java/inji/pages/AddNewCardPage.java +++ b/injitest/src/main/java/inji/pages/AddNewCardPage.java @@ -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; @@ -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") @@ -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; @@ -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") @@ -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) { @@ -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); } @@ -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); @@ -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); + } + } diff --git a/injitest/src/main/java/inji/pages/DetailedVcViewPage.java b/injitest/src/main/java/inji/pages/DetailedVcViewPage.java index f57553a44a..fa34691d89 100644 --- a/injitest/src/main/java/inji/pages/DetailedVcViewPage.java +++ b/injitest/src/main/java/inji/pages/DetailedVcViewPage.java @@ -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); } @@ -222,8 +218,6 @@ public void clickOnMoreOptionsInDetails() { } clickOnElement(moreOptionsButton); } - public boolean isKeyTypeVcDetailViewValueDisplayed() { - return isElementDisplayed(keyTypeVcDetailViewValue); - } + } \ No newline at end of file diff --git a/injitest/src/main/java/inji/pages/EsignetLoginPage.java b/injitest/src/main/java/inji/pages/EsignetLoginPage.java index 1af4a3ac3d..c72fd0ac3f 100644 --- a/injitest/src/main/java/inji/pages/EsignetLoginPage.java +++ b/injitest/src/main/java/inji/pages/EsignetLoginPage.java @@ -88,7 +88,6 @@ public class EsignetLoginPage extends BasePage { private WebElement credentialTypeHeadingMOSIPVerifiableCredential; - public EsignetLoginPage(AppiumDriver driver) { super(driver); } @@ -117,6 +116,7 @@ public void clickOnEsignetLoginWithOtpButton() { if(isElementDisplayed(esignetLoginButton)) { clickOnElement(esignetLoginButton); } + } public OtpVerificationPage setEnterIdTextBox(String uinOrVid) { diff --git a/injitest/src/main/java/inji/pages/HistoryPage.java b/injitest/src/main/java/inji/pages/HistoryPage.java index 98645f89b6..3f7580f2d5 100644 --- a/injitest/src/main/java/inji/pages/HistoryPage.java +++ b/injitest/src/main/java/inji/pages/HistoryPage.java @@ -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); } @@ -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 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 elements = driver.findElements(locator); return elements.size(); @@ -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); } @@ -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); } } diff --git a/injitest/src/main/java/inji/pages/HomePage.java b/injitest/src/main/java/inji/pages/HomePage.java index fac1f51666..87160d91de 100644 --- a/injitest/src/main/java/inji/pages/HomePage.java +++ b/injitest/src/main/java/inji/pages/HomePage.java @@ -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; @@ -236,6 +240,7 @@ public class HomePage extends BasePage { @iOSXCUITFindBy(accessibility = "cardViewDescription") private WebElement cardViewDescription; + public HomePage(AppiumDriver driver) { super(driver); } @@ -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); } @@ -816,4 +805,14 @@ public void clickOnNextButtonForInjiTour() { clickOnElement(fifthDoneButton); } } + + public boolean isCredentialTypeValueDisplayed() { + if(isElementDisplayed(doneButton)){ + clickOnElement(doneButton); + } + return this.isElementDisplayed(credentialTypeValue); + + +} + } diff --git a/injitest/src/main/java/inji/pages/OtpVerificationPage.java b/injitest/src/main/java/inji/pages/OtpVerificationPage.java index 4dcd9e5f4a..47d683e80c 100644 --- a/injitest/src/main/java/inji/pages/OtpVerificationPage.java +++ b/injitest/src/main/java/inji/pages/OtpVerificationPage.java @@ -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) { diff --git a/injitest/src/main/java/inji/pages/SettingsPage.java b/injitest/src/main/java/inji/pages/SettingsPage.java index 7e1c063ff2..0ef69b6a74 100644 --- a/injitest/src/main/java/inji/pages/SettingsPage.java +++ b/injitest/src/main/java/inji/pages/SettingsPage.java @@ -52,7 +52,7 @@ public class SettingsPage extends BasePage { @AndroidFindBy(xpath = "//*[contains(@text,'Wika')]") - @iOSXCUITFindBy(accessibility = "languageTitle") + @iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeOther[`label == \"\uE037 Wika \uE5CC\"`][1]") private WebElement wikaButton; @AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"listItemTitle\")") diff --git a/injitest/src/main/java/inji/pages/SharePage.java b/injitest/src/main/java/inji/pages/SharePage.java index 98bd62c948..739f637e94 100644 --- a/injitest/src/main/java/inji/pages/SharePage.java +++ b/injitest/src/main/java/inji/pages/SharePage.java @@ -198,8 +198,6 @@ public void clickOnCameraDisabledToasterClose(){ public void clickOnDontAllowCameraAccessButton(){ if(isElementDisplayed(cameraDontAllowAccessPopup)) clickOnElement(cameraDontAllowAccessPopup); - - } public boolean isCameraAccessLostPageLoaded() { diff --git a/injitest/src/main/java/inji/pages/SunbirdLoginPage.java b/injitest/src/main/java/inji/pages/SunbirdLoginPage.java index 22edfb4a98..7a9f167f2a 100644 --- a/injitest/src/main/java/inji/pages/SunbirdLoginPage.java +++ b/injitest/src/main/java/inji/pages/SunbirdLoginPage.java @@ -30,16 +30,16 @@ public class SunbirdLoginPage extends BasePage { @iOSXCUITFindBy(accessibility = "Done") private WebElement clickOnSetButton; - @AndroidFindBy(xpath = "//android.view.View[@content-desc='01 January 2024']") + @AndroidFindBy(xpath = "//android.view.View[@content-desc='01 January 2025']") @iOSXCUITFindBy(xpath = "//XCUIElementTypeButton[@name=\"Monday, January 1\"]") private WebElement dateOfBirth; @iOSXCUITFindBy(xpath = "//XCUIElementTypeCollectionView//XCUIElementTypeButton[@name=\"Monday, 1 January\"]") private WebElement dateOfBirthSecond; - @iOSXCUITFindBy(xpath = "//XCUIElementTypeStaticText[@name=\"January 2024\"]") - private WebElement January2024; + @iOSXCUITFindBy(xpath = "//XCUIElementTypeStaticText[@name=\"January 2025\"]") + private WebElement January2025; - @AndroidFindBy(xpath = "//*[@resource-id=\"verify_form\"]") + @AndroidFindBy(xpath = "//android.widget.Button[@resource-id=\"verify_form\"]") @iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeButton[`name == \"Login\"`]") private WebElement loginButton; @@ -69,6 +69,10 @@ public class SunbirdLoginPage extends BasePage { @iOSXCUITFindBy(accessibility = "fullNameValue") private WebElement fullName; + @AndroidFindBy(accessibility = "credentialTypeValue") + @iOSXCUITFindBy(accessibility = "credentialTypeValue") + private WebElement credentialTypeValue; + @AndroidFindBy(accessibility = "fullNameValue") @iOSXCUITFindBy(accessibility = "fullNameValue") private WebElement fullNameInDetailView; @@ -151,15 +155,9 @@ public class SunbirdLoginPage extends BasePage { @iOSXCUITFindBy(accessibility = "6done") private WebElement doneButton; - @AndroidFindBy(accessibility = "keyTypeVcDetailViewValue") - @iOSXCUITFindBy(accessibility = "keyTypeVcDetailViewValue") - private WebElement keyTypeVcDetailViewValue; - - @AndroidFindBy(xpath = "//*[@text=\"Login failed, please enter correct credentials\"]") - @iOSXCUITFindBy(xpath = "//*[@text=\"Login failed, please enter correct credentials\"]") + @AndroidFindBy(xpath = "//*[contains(@text,'Login failed')]") private WebElement LoginFailedDueTOInValidCredentials; - public SunbirdLoginPage(AppiumDriver driver) { super(driver); } @@ -215,15 +213,23 @@ public void enterDateOfBirthTextBox() { clickOnElement(clickOnSetButton); } } - public void clickOnloginButton() { - if(isElementDisplayed(loginButton)) { + + public void clickOnloginButton() throws InterruptedException { + + int retryCount = 0; + while (isElementDisplayed(loginButton) && retryCount < 5) { clickOnElement(loginButton); + if (isElementDisplayed(LoginFailedDueTOInValidCredentials)) { + retryCount++; + Thread.sleep(1000); + } else { + break; + } } - else { + if(isElementDisplayed(loginButtonSecond)){ clickOnElement(loginButtonSecond); } } - public boolean isSunbirdCardIsActive() { if(isElementDisplayed(doneButton)) clickOnElement(doneButton); @@ -298,8 +304,8 @@ public void clickOnContinueButtonInSigninPopupIos(){ } public void openDetailedSunbirdVcView() { - basePage.retryToGetElement(fullName); - clickOnElement(fullName); + basePage.retryToGetElement(credentialTypeValue); + clickOnElement(credentialTypeValue); } public boolean isSunbirdRCInsuranceVerifiableCredentialHeaderDisplayed() { diff --git a/injitest/src/main/java/inji/utils/SuiteListener.java b/injitest/src/main/java/inji/utils/SuiteListener.java index 711a656d91..12ed0bd7d1 100644 --- a/injitest/src/main/java/inji/utils/SuiteListener.java +++ b/injitest/src/main/java/inji/utils/SuiteListener.java @@ -14,21 +14,47 @@ public class SuiteListener implements ISuiteListener { @Override public void onStart(ISuite suite) { - + // No action needed for `onStart` in this case } @Override public void onFinish(ISuite suite) { - if (suite.getName().equalsIgnoreCase("androidSanity")|| suite.getName().equalsIgnoreCase("iosSanity")) { - boolean hasFailures = suite.getResults().values().stream() - .anyMatch(result -> result.getTestContext().getFailedTests().size() > 0); - - if (hasFailures) { - System.exit(1); - System.out.println("Sanity suite has failures. Skipping Regression suite."); - } else { - System.out.println("Sanity suite passed. Proceeding with Regression suite."); + System.out.println("Test Suite Finished!"); + + for (ISuiteResult result : suite.getResults().values()) { + ITestContext context = result.getTestContext(); + + System.out.println("Failed Test Cases for Context: " + context.getName()); + + Iterator failedTests = context.getFailedTests().getAllResults().iterator(); + while (failedTests.hasNext()) { + ITestResult failedTest = failedTests.next(); + ITestNGMethod method = failedTest.getMethod(); + + System.out.println(" - Failed Test: " + failedTest.getName()); + System.out.println(" - Failed Method: " + method.getQualifiedName()); + + failedTestMethods.add(method); } } + + if (!failedTestMethods.isEmpty()) { + System.out.println("Rerunning failed test cases..."); + + TestNG rerunTestNG = new TestNG(); + XmlSuite xmlSuite = new XmlSuite(); + XmlTest xmlTest = new XmlTest(xmlSuite); + List xmlClasses = new ArrayList<>(); + + for (ITestNGMethod method : failedTestMethods) { + XmlClass xmlClass = new XmlClass(method.getRealClass().getName()); + xmlClass.getIncludedMethods().add(new XmlInclude(method.getMethodName())); + xmlClasses.add(xmlClass); + } + + xmlTest.setXmlClasses(xmlClasses); + rerunTestNG.setXmlSuites(Collections.singletonList(xmlSuite)); + rerunTestNG.run(); + } } } diff --git a/injitest/src/main/java/inji/utils/SuiteListeners.java b/injitest/src/main/java/inji/utils/SuiteListeners.java deleted file mode 100644 index b168b3969a..0000000000 --- a/injitest/src/main/java/inji/utils/SuiteListeners.java +++ /dev/null @@ -1,10 +0,0 @@ -package inji.utils; - -import org.testng.ISuite; -import org.testng.ISuiteListener; -import org.testng.ITestResult; - -public interface SuiteListeners extends ISuiteListener { - - void onTestFailure(ISuite suite); -} diff --git a/injitest/src/main/java/inji/utils/TestDataReader.java b/injitest/src/main/java/inji/utils/TestDataReader.java index c7218baa00..52ce3f7d12 100644 --- a/injitest/src/main/java/inji/utils/TestDataReader.java +++ b/injitest/src/main/java/inji/utils/TestDataReader.java @@ -34,14 +34,10 @@ private static String getValueForKey(String key) { return "1234567891"; case "fullName": return "TEST_FULLNAMEeng"; - case "fullNameForMobileDrivingLicense": - return "Joseph"; case "idType": return "MOSIP National ID"; - case "idTypeForMobileDrivingLicense": - return "Mobile Driving License"; case "gender": - return "MLEeng"; + return "MLE"; case "genderVidEsignet": return "MLE"; case "status": @@ -54,8 +50,6 @@ private static String getValueForKey(String key) { return "01/01/1996"; case "dateOfBirthForVidEsignet": return "1996/01/01"; - case "dateOfBirthForMobileDrivingLicense": - return "1994-11-06"; case "aid": return UinGenerationUtil.getRandomAidData(); case "emailPassword": @@ -72,8 +66,6 @@ private static String getValueForKey(String key) { return UinGenerationUtil.getRandomUin(); case "uin2": return "2162743612"; - case "MockVc": - return "1234567"; case "uin2FullName": return "TEST_FULLNAMEeng"; case "newEnv": @@ -85,7 +77,7 @@ private static String getValueForKey(String key) { case "fullNameSunbird": return "PolicyTestAutomation"; case "policyNameSunbird": - return "Start Insurance Gold Premium"; + return "PolicyTestAutomation"; case "policyNumberSunbird": return "120-720-24"; case "idTypeSunbird": @@ -93,13 +85,13 @@ private static String getValueForKey(String key) { case "idTypeSunbirdHindi": return "Health Insurance"; case "phoneNumberSunbird": - return "0123456789"; + return "1234567890"; case "dateOfBirthSunbird": - return "2024-01-01"; + return "2025-01-01"; case "genderValueSunbird": - return "Male"; + return "Female"; case "emailIdValueSunbird": - return "abhishek@gmail.com"; + return "PolicyTestAutomation@example.com"; case "statusValueSunbird": return "Valid"; case "statusValueSunbirdForVaild": @@ -108,14 +100,6 @@ private static String getValueForKey(String key) { return "Valid"; case "isDeviceFarmRun": return "true"; - case "ED25519Key": - return "ED25519"; - case "ECCK1Key": - return "ECC K1"; - case "ECCR1Key": - return "ECC R1"; - case "RSAKey": - return "RSA"; default: return "Key not found"; } diff --git a/injitest/src/main/resources/Uins.json b/injitest/src/main/resources/Uins.json index 3c41b51482..3fe093e294 100644 --- a/injitest/src/main/resources/Uins.json +++ b/injitest/src/main/resources/Uins.json @@ -1,14 +1,5 @@ [ - 7517467289, - 8351671054, - 2136951498, - 7580598352, - 4390378536, - 6592582976, - 6278290576, - 5631590514, - 2052148513, - 9289481253, - 5681650213, - 2605348964 + 2405782960, + 2185461749, + 2185461749 ] \ No newline at end of file diff --git a/injitest/src/main/resources/Vids.json b/injitest/src/main/resources/Vids.json index 92265c4dbd..3fe093e294 100644 --- a/injitest/src/main/resources/Vids.json +++ b/injitest/src/main/resources/Vids.json @@ -1,14 +1,5 @@ [ - 4391082978460254, - 6519502715914092, - 5796739802316420, - 6198604365109382, - 5485347907205830, - 4352683710970658, - 6083129418507684, - 2594532491641576, - 3863095764821780, - 3258317216730193, - 4806792358640381, - 6205460732457018 + 2405782960, + 2185461749, + 2185461749 ] \ No newline at end of file diff --git a/injitest/src/test/java/androidTestCases/ActivateVcTest.java b/injitest/src/test/java/androidTestCases/ActivateVcTest.java index dc9de8b89b..3fd8266cff 100644 --- a/injitest/src/test/java/androidTestCases/ActivateVcTest.java +++ b/injitest/src/test/java/androidTestCases/ActivateVcTest.java @@ -45,8 +45,8 @@ public void activateVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -165,9 +165,10 @@ public void activateVcFromDetailedViewPage() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); // detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -220,7 +221,8 @@ public void verifyActiveVcAndWaitForOtpTimeOut() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -282,9 +284,9 @@ public void downloadAndActiveVcUsingUinViaEsignet() throws InterruptedException otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); diff --git a/injitest/src/test/java/androidTestCases/ChangeLanguageTest.java b/injitest/src/test/java/androidTestCases/ChangeLanguageTest.java index d368972f7b..bf655d1667 100644 --- a/injitest/src/test/java/androidTestCases/ChangeLanguageTest.java +++ b/injitest/src/test/java/androidTestCases/ChangeLanguageTest.java @@ -519,7 +519,7 @@ public void downloadVcAndChnageLangaugeVerifyVcViaSunbird() throws InterruptedEx homePage.clickOnHomeButton(); assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); - assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); + // assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); sunbirdLoginPage.openDetailedSunbirdVcView(); assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); @@ -582,7 +582,7 @@ public void DownloadAndVerifyVcInArabic() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertEquals(homePage.getFullNameValue(), "TEST_FULLNAMEara"); assertEquals(homePage.GetActivationPendingHeaderText(), "التنشيط معلق لتسجيل الدخول عبر الإنترنت!"); } diff --git a/injitest/src/test/java/androidTestCases/CredentialRegistryTest.java b/injitest/src/test/java/androidTestCases/CredentialRegistryTest.java index 502f3e1482..f9b4c00e0d 100644 --- a/injitest/src/test/java/androidTestCases/CredentialRegistryTest.java +++ b/injitest/src/test/java/androidTestCases/CredentialRegistryTest.java @@ -33,10 +33,10 @@ public void downloadAndVerifyVcInNewEnv() throws InterruptedException { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); @@ -52,8 +52,9 @@ public void downloadAndVerifyVcInNewEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -61,19 +62,20 @@ public void downloadAndVerifyVcInNewEnv() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); OtpVerificationPage otpVerificationPage = pleaseConfirmPopupPage.clickOnConfirmButton(); - + assertTrue(otpVerificationPage.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerificationPage.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); assertTrue(moreOptionsPage.isVcActivatedForOnlineLogin(), "Verify if VC is activated"); moreOptionsPage.clickOnCloseButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isCredentialRegistryTextDisplayed(),"Verify if is credential registry text displayed"); assertEquals(detailedVcViewPage.getCredentialRegistryValue(), TestDataReader.readData("newEnv"), "Verify changed env is displayed in detailed vc"); } - + @Test public void cancelChangeEnvAndVerify() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -95,23 +97,23 @@ public void cancelChangeEnvAndVerify() throws InterruptedException { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnCancelButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + homePage.clickOnSettingIcon(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); assertEquals(credentialRegistryPage.checkEnvNotChanged(),TestDataReader.readData("injiEnv")); } - + @Test public void downloadAndVerifyVcInInvalidEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -133,16 +135,16 @@ public void downloadAndVerifyVcInInvalidEnv() throws InterruptedException { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("invalidenv")).clickOnSaveButton(); assertTrue(credentialRegistryPage.isCredentialRegistryErrorMessageDisplayed(), "Verify if error message is displayed"); } - + @Test public void generateUinInNewEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -164,20 +166,20 @@ public void generateUinInNewEnv() throws InterruptedException { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + 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"); GenerateUinOrVidPage generateUinOrVidPage = retrieveIdPage.clickOnGetItNowText(); @@ -193,9 +195,10 @@ public void generateUinInNewEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } - + @Test public void retrivingUinInOtherEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -217,20 +220,20 @@ public void retrivingUinInOtherEnv() throws InterruptedException { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + 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"); GenerateUinOrVidPage generateUinOrVidPage = retrieveIdPage.clickOnGetItNowText(); @@ -239,7 +242,7 @@ public void retrivingUinInOtherEnv() throws InterruptedException { assertTrue(retrieveIdPage.isAidIsNotReadyYetErrorDisplayed(), "Verify if aid is not ready displayed"); } - + @Test public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -261,16 +264,16 @@ public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); @@ -280,19 +283,20 @@ public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("injiEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); addNewCardPage.clickOnDownloadViaUin(); @@ -303,11 +307,12 @@ public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); +// assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); } - + @Test public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -329,16 +334,16 @@ public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); @@ -348,19 +353,20 @@ public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("injiEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -368,10 +374,10 @@ public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); - + assertTrue(moreOptionsPage.isSomethingIsWrongPopupVisible(), "Verify if somthing went wrong please try again popup displayed"); } - + @Test public void downloadAndVerifyVcInNewEnvForEsignet() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -393,34 +399,35 @@ public void downloadAndVerifyVcInNewEnvForEsignet() throws InterruptedException assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).enterUrlToEsignetHostTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); - + EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); assertTrue(esignetLoginPage.isEsignetLoginPageDisplayed(), "Verify if esignet login page displayed"); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(TestDataReader.readData("newuin")); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(TestDataReader.readData("otp"), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); @@ -437,7 +444,7 @@ public void downloadAndVerifyVcInNewEnvForEsignet() throws InterruptedException assertEquals(detailedVcViewPage.getEmailInDetailedVcView(), TestDataReader.readData("externalemail"), "Verify if email is displayed"); assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); } - + @Test public void downloadAndVerifyVcInInvalidEnvForEsignet() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -459,16 +466,16 @@ public void downloadAndVerifyVcInInvalidEnvForEsignet() throws InterruptedExcept assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("invalidenv")).enterUrlToEsignetHostTextBox(TestDataReader.readData("invalidenv")).clickOnSaveButton(); assertTrue(credentialRegistryPage.isCredentialRegistryErrorMessageDisplayed(), "Verify if error message is displayed"); } - + @Test public void downloadAndVerifyVcInInvalidEnvForEsignetInFillpino() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -496,14 +503,14 @@ public void downloadAndVerifyVcInInvalidEnvForEsignetInFillpino() throws Interru assertTrue(settingsPage.verifyFilipinoLanguage(), "Verify if language is changed to filipino"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderInFilipinoDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("invalidenv")).enterUrlToEsignetHostTextBox(TestDataReader.readData("invalidenv")).clickOnSaveButton(); assertTrue(credentialRegistryPage.isCredentialRegistryErrorMessageDisplayed(), "Verify if error message is displayed"); } - - + + @Test public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -525,10 +532,10 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); @@ -544,8 +551,9 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -553,32 +561,33 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); OtpVerificationPage otpVerificationPage = pleaseConfirmPopupPage.clickOnConfirmButton(); - + assertTrue(otpVerificationPage.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerificationPage.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); assertTrue(moreOptionsPage.isVcActivatedForOnlineLogin(), "Verify if VC is activated"); moreOptionsPage.clickOnCloseButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isCredentialRegistryTextDisplayed(),"Verify if is credential registry text displayed"); assertEquals(detailedVcViewPage.getCredentialRegistryValue(), TestDataReader.readData("newEnv"), "Verify changed env is displayed in detailed vc"); - + detailedVcViewPage.clickOnBackArrow(); homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("injiEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); homePage.downloadCard(); - - + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); addNewCardPage.clickOnDownloadViaUin(); @@ -588,12 +597,13 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + + homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isCredentialRegistryTextDisplayed(),"Verify if is credential registry text displayed"); assertEquals(detailedVcViewPage.getCredentialRegistryValue(), TestDataReader.readData("injiEnv"), "Verify inji env is displayed in detailed vc"); } - + } diff --git a/injitest/src/test/java/androidTestCases/DeletingVcTest.java b/injitest/src/test/java/androidTestCases/DeletingVcTest.java index 2a1e4804fa..81d446b708 100644 --- a/injitest/src/test/java/androidTestCases/DeletingVcTest.java +++ b/injitest/src/test/java/androidTestCases/DeletingVcTest.java @@ -43,7 +43,8 @@ public void deleteVcAndVerifyInHistory() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -58,7 +59,7 @@ public void deleteVcAndVerifyInHistory() throws InterruptedException { assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); historyPage.verifyHistory(uin + " Removed from wallet", Target.ANDROID); assertTrue(historyPage.verifyDeleteHistory(uin, Target.ANDROID), "Verify if deleted history is displayed"); - + SharePage scanPage = homePage.clickOnShareButton(); assertTrue(scanPage.isNoShareableCardsMessageDisplayed(), "Verify if no shareable cards are available message is displayed"); } @@ -96,7 +97,8 @@ public void cancelDeleteVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -108,7 +110,8 @@ public void cancelDeleteVc() throws InterruptedException { // assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); // moreOptionsPage.clickOnCloseButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @Test @@ -144,7 +147,8 @@ public void DownloadingDeletedVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -153,7 +157,8 @@ public void DownloadingDeletedVc() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); - assertFalse(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if VC is removed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.downloadCard(); @@ -166,7 +171,8 @@ public void DownloadingDeletedVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); @@ -221,7 +227,8 @@ public void deleteVcAndVerifyInHistoryForEsignet() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -283,7 +290,7 @@ public void deleteVcAndVerifyInHistoryForSunbird() throws InterruptedException { assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); - assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); +// assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); diff --git a/injitest/src/test/java/androidTestCases/GenerateUinOrVidTest.java b/injitest/src/test/java/androidTestCases/GenerateUinOrVidTest.java index c144492ca2..8fbaf81125 100644 --- a/injitest/src/test/java/androidTestCases/GenerateUinOrVidTest.java +++ b/injitest/src/test/java/androidTestCases/GenerateUinOrVidTest.java @@ -56,7 +56,8 @@ public void generateUinOrVidUsingAid() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @@ -146,5 +147,5 @@ public void generateUinOrVidUsingInvalidAid() { } - + } \ No newline at end of file diff --git a/injitest/src/test/java/androidTestCases/MosipOtpAlternativeFlow.java b/injitest/src/test/java/androidTestCases/MosipOtpAlternativeFlow.java index 2ff824c226..a32cab308d 100644 --- a/injitest/src/test/java/androidTestCases/MosipOtpAlternativeFlow.java +++ b/injitest/src/test/java/androidTestCases/MosipOtpAlternativeFlow.java @@ -95,9 +95,10 @@ public void activateVcFromDetailedViewPage() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -154,7 +155,8 @@ public void verifyActiveVcAndWaitForOtpTimeOut() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -211,7 +213,8 @@ public void cancelDeleteVc() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -223,7 +226,8 @@ public void cancelDeleteVc() throws InterruptedException { // assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); // moreOptionsPage.clickOnCloseButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @Test @@ -264,7 +268,8 @@ public void DownloadingDeletedVc() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -292,7 +297,8 @@ public void DownloadingDeletedVc() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); @@ -341,7 +347,8 @@ public void deleteDownloadedVcInOfflineMode() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -397,17 +404,17 @@ public void openQrOffline() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); SoftAssert softAssert = new SoftAssert(); detailedVcViewPage.clickOnQrCodeButton(); softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); detailedVcViewPage.clickOnQrCrossIcon(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); } @Test @@ -483,7 +490,8 @@ public void VerifyCameraOpenAfterPinVc() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -539,7 +547,8 @@ public void verifyMessageAfterDenyBluetoothPopup() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -590,9 +599,10 @@ public void pinVcInDetailedVcView() throws InterruptedException { esignetLoginPage.clickOnVerifyButton(); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -602,10 +612,11 @@ public void pinVcInDetailedVcView() throws InterruptedException { moreOptionsPage.clickOnPinOrUnPinCard(); detailedVcViewPage.clickOnBackArrow(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -671,9 +682,9 @@ public void pinEsignetVcMultipleTimes() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - 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"); @@ -751,9 +762,8 @@ public void pinSubirdVcMultipleTimes() throws InterruptedException { otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver); // mosip vc @@ -819,7 +829,8 @@ public void verifyActivationFailedRecordInHistory() throws InterruptedException otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -881,8 +892,9 @@ public void verifyActivationFailedRecordInHistoryFromDetailedView() throws Inter otpVerification.enterOtpForEsignet(getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); PleaseConfirmPopupPage pleaseConfirmPopupPage = detailedVcViewPage.clickOnActivateButtonAndroid(); diff --git a/injitest/src/test/java/androidTestCases/NoNetworkAndroidTest.java b/injitest/src/test/java/androidTestCases/NoNetworkAndroidTest.java index 4ed3ebbb23..904f95b9ba 100644 --- a/injitest/src/test/java/androidTestCases/NoNetworkAndroidTest.java +++ b/injitest/src/test/java/androidTestCases/NoNetworkAndroidTest.java @@ -87,7 +87,8 @@ public void openCameraOnFlightMode() throws IOException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -131,7 +132,8 @@ public void activateVcWithoutInternet() throws InterruptedException, IOException assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); BasePage basePage = new BasePage(driver); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -177,7 +179,7 @@ public void verifyListOfLanguagesInOfflineMode() { assertTrue(settingsPage.verifyLanguagesInLanguageFilter("ANDROID"), "Verify if all languages are shown in language filter"); } - + @Test public void verifyHelpPageOfflineMode() { String sessionId = driver.getSessionId().toString(); @@ -210,7 +212,7 @@ public void verifyHelpPageOfflineMode() { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); } - + @Test public void deleteDownloadedVcInOfflineMode() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -244,7 +246,8 @@ public void deleteDownloadedVcInOfflineMode() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -260,7 +263,7 @@ public void deleteDownloadedVcInOfflineMode() throws InterruptedException { UpdateNetworkSettings.resetNetworkProfile(sessionId); assertEquals(homePage.verifyLanguageForNoVCDownloadedPageLoaded(), "Bring your digital identity"); } - + @Test public void openQrOffline() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -295,19 +298,21 @@ public void openQrOffline() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); SoftAssert softAssert = new SoftAssert(); detailedVcViewPage.clickOnQrCodeButton(); softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); - + detailedVcViewPage.clickOnQrCrossIcon(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } - + @Test public void verifyRecivedCardOffline() throws InterruptedException { String sessionId = driver.getSessionId().toString(); @@ -332,16 +337,16 @@ public void verifyRecivedCardOffline() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + ReceiveCardPage receiveCardPage = settingsPage.clickOnReceiveCard(); receiveCardPage.clickOnAllowButton(); assertTrue(receiveCardPage.isReceiveCardHeaderDisplayed(), "Verify if QR code header is displayed"); - + assertTrue(receiveCardPage.isWaitingForConnectionDisplayed(), "Verify if waiting for connection displayed"); } - + @Test public void downloadCardWithoutInternetRetryWithInternet() throws InterruptedException { String sessionId = driver.getSessionId().toString(); @@ -368,17 +373,17 @@ public void downloadCardWithoutInternetRetryWithInternet() throws InterruptedExc assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); AddNewCardPage addNewCardPage = homePage.downloadCard(); - + assertTrue(homePage.verifyLanguageForNoInternetConnectionDisplayed("English"), "Verify if no internet connection is displayed"); assertTrue(homePage.verifyLanguageForTryAgainButtonDisplayed("English"), "Verify if try again button displayed"); UpdateNetworkSettings.resetNetworkProfile(sessionId); assertTrue(homePage.isTryAgainButtonNotDisplayed(), "Wating for network come online"); - + homePage.clickOnTryAgainButton(); - assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); } - + @Test public void downloadVcUsingUinViaEsignetWithoutInternet() throws InterruptedException { String sessionId = driver.getSessionId().toString(); @@ -407,13 +412,13 @@ public void downloadVcUsingUinViaEsignetWithoutInternet() throws InterruptedExce assertTrue(homePage.verifyLanguageForNoInternetConnectionDisplayed("English"), "Verify if no internet connection is displayed"); assertTrue(homePage.verifyLanguageForTryAgainButtonDisplayed("English"), "Verify if Try again button displayed"); - + homePage.clickOnTryAgainButton(); assertTrue(homePage.isTryAgainButtonNotDisplayed(), "Verify if Try again button displayed"); homePage.clickOnTryAgainButton(); } - + @Test public void downloadVcUsingUinViaEsignetNoInternateWhileDownloading() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -441,27 +446,27 @@ public void downloadVcUsingUinViaEsignetNoInternateWhileDownloading() throws Int EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); String uin = TestDataReader.readData("uin"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(uin); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); String sessionId = driver.getSessionId().toString(); // UpdateNetworkSettings.setNoNetworkProfile(sessionId); - + assertTrue(homePage.verifyLanguageForNoInternetConnectionDisplayed("English"), "Verify if no internet connection is displayed"); addNewCardPage.clickOnBack(); UpdateNetworkSettings.resetNetworkProfile(sessionId); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); } - + @Test public void downloadVcViaEsignetAndPinUnpinWithNoNetwork() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -492,15 +497,16 @@ public void downloadVcViaEsignetAndPinUnpinWithNoNetwork() throws InterruptedExc String uin = TestDataReader.readData("uin"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(uin); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -516,7 +522,7 @@ public void downloadVcViaEsignetAndPinUnpinWithNoNetwork() throws InterruptedExc moreOptionsPage.clickOnPinOrUnPinCard(); } - + @Test public void downloadVcUsingUinViaEsignetNoInternateOpenScan() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -541,23 +547,24 @@ public void downloadVcUsingUinViaEsignetNoInternateOpenScan() throws Interrupted AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); - + EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(TestDataReader.readData("uin")); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - + // assertTrue(esignetLoginPage.isProgressingLogoDisplayed(),"verify if Progressing page is displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); - + homePage.clickOnShareButton().acceptPermissionPopupBluetooth().clickOnAllowLocationPopupButton(); SharePage SharePage = new SharePage(driver); SharePage.clickOnAllowGallaryAccessButton(); @@ -565,7 +572,7 @@ public void downloadVcUsingUinViaEsignetNoInternateOpenScan() throws Interrupted assertTrue(SharePage.isCameraPageLoaded(), "Verify camera page is displayed"); } - + @Test public void downloadVcInOtherLanguageViaEsignetWithoutInternet() throws InterruptedException { String sessionId = driver.getSessionId().toString(); @@ -596,32 +603,33 @@ public void downloadVcInOtherLanguageViaEsignetWithoutInternet() throws Interrup assertTrue(settingsPage.verifyFilipinoLanguage(), "Verify if language is changed to filipino"); homePage.clickOnHomeButton(); - + AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(homePage.verifyLanguageForNoInternetConnectionDisplayed("Filipino"), "Verify if no internet connection is displayed in flillpino"); assertTrue(homePage.isTryAgainButtonDisplayedInFlillpino(), "Verify if Try again button displayed in flillpino"); UpdateNetworkSettings.resetNetworkProfile(sessionId); - + homePage.clickOnTryAgainFillpinoButton(); assertEquals(addNewCardPage.verifyLanguageForAddNewCardGuideMessage(), "Mangyaring piliin ang iyong gustong tagabigay mula sa mga opsyon sa ibaba upang magdagdag ng bagong card."); -// +// EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); String uin = TestDataReader.readData("uin"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(uin); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } - + @Test public void changeLanguageToTamilWithoutNetwork() { String sessionId = driver.getSessionId().toString(); @@ -652,11 +660,11 @@ public void changeLanguageToTamilWithoutNetwork() { assertTrue(settingsPage.verifyTamilLanguage(), "Verify if language is changed to tamil"); homePage.clickOnHomeButton(); - + homePage.downloadCard(); assertTrue(homePage.verifyLanguageForNoInternetConnectionDisplayed("Tamil"), "Verify if try again in tamil is displayed"); } - + @Test public void verifyVcIssuerListWithoutNetwork() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -686,7 +694,7 @@ public void verifyVcIssuerListWithoutNetwork() throws InterruptedException { UpdateNetworkSettings.setNoNetworkProfile(sessionId); addNewCardPage.clickOnBack(); - + homePage.downloadCard(); assertTrue(addNewCardPage.isIssuerDescriptionMosipDisplayed(), "Verify if issuer description mosip displayed"); assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); diff --git a/injitest/src/test/java/androidTestCases/PinVcTest.java b/injitest/src/test/java/androidTestCases/PinVcTest.java index 8bda2da929..1930b44708 100644 --- a/injitest/src/test/java/androidTestCases/PinVcTest.java +++ b/injitest/src/test/java/androidTestCases/PinVcTest.java @@ -48,21 +48,22 @@ public void pinVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value 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"); - + homePage.clickOnMoreOptionsButton(); HistoryPage historyPage= moreOptionsPage.clickOnViewActivityLog(); assertTrue(historyPage.verifyActivityLogHeader(uin, Target.ANDROID)); assertTrue(historyPage.verifyHistory(uin, Target.ANDROID)); - + } - + //For IOS bluetooth does not support in simulator, so we can't automate @Test public void VerifyCameraOpenAfterPinVc() throws InterruptedException { @@ -97,7 +98,8 @@ public void VerifyCameraOpenAfterPinVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -105,7 +107,7 @@ public void VerifyCameraOpenAfterPinVc() throws InterruptedException { assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); SharePage scanPage=homePage.clickOnShareButton(); - + scanPage.acceptPermissionPopupBluetooth(); scanPage.acceptPermissionPopupCamera(); scanPage.clickOnAllowLocationPopupButton(); @@ -114,7 +116,7 @@ public void VerifyCameraOpenAfterPinVc() throws InterruptedException { assertTrue(scanPage.isCameraPageLoaded(), "Verify camera page is displayed"); assertTrue(scanPage.isFlipCameraClickable(),"Verify if flip camera is enabled"); } - + @Test public void downloadVcViaEsignetAndPinUnpin() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -142,19 +144,19 @@ public void downloadVcViaEsignetAndPinUnpin() throws InterruptedException { EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); String uin=TestDataReader.readData("uin"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(uin); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -168,25 +170,26 @@ public void downloadVcViaEsignetAndPinUnpin() throws InterruptedException { addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); esignetLoginPage.setEnterIdTextBox(uin); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if second card name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); moreOptionsPage.clickOnPinOrUnPinCard(); - + } - + @Test public void verifyMessageAfterDenyBluetoothPopup() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -220,7 +223,8 @@ public void verifyMessageAfterDenyBluetoothPopup() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -231,7 +235,7 @@ public void verifyMessageAfterDenyBluetoothPopup() throws InterruptedException { scanPage.denyPermissionPopupBluetooth(); assertEquals(scanPage.isBluetoothIsTurnedOffMessageDisplayed(),"Bluetooth is turned OFF, please turn it ON from Quick settings menu"); - + } @Test @@ -269,9 +273,10 @@ public void pinVcInDetailedVcView() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -281,10 +286,11 @@ public void pinVcInDetailedVcView() throws InterruptedException { moreOptionsPage.clickOnPinOrUnPinCard(); detailedVcViewPage.clickOnBackArrow(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -343,9 +349,8 @@ public void pinEsignetVcMultipleTimes() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -368,7 +373,7 @@ public void pinEsignetVcMultipleTimes() throws InterruptedException { moreOptionsPage.clickOnPinOrUnPinCard(); assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); - + } @Test @@ -421,10 +426,8 @@ public void pinMosipVcMultipleTimes() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver); // mosip vc @@ -451,5 +454,5 @@ public void pinMosipVcMultipleTimes() throws InterruptedException { } - + } \ No newline at end of file diff --git a/injitest/src/test/java/androidTestCases/ShareVcTest.java b/injitest/src/test/java/androidTestCases/ShareVcTest.java index 78e1f085ec..87f3fdece3 100644 --- a/injitest/src/test/java/androidTestCases/ShareVcTest.java +++ b/injitest/src/test/java/androidTestCases/ShareVcTest.java @@ -98,7 +98,8 @@ public void verifyPopupsForShareWithSelfi() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); moreOptionsPage.clickOnShareVcWithSelfieFromKebabButton(); @@ -152,8 +153,8 @@ public void rejectingCameraAccessesOnShareScreen() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); SharePage SharePage = homePage.clickOnShareButton(); diff --git a/injitest/src/test/java/androidTestCases/VcBackupAndRestoreTest.java b/injitest/src/test/java/androidTestCases/VcBackupAndRestoreTest.java index 00daf41d84..34791208c1 100644 --- a/injitest/src/test/java/androidTestCases/VcBackupAndRestoreTest.java +++ b/injitest/src/test/java/androidTestCases/VcBackupAndRestoreTest.java @@ -38,7 +38,8 @@ public void VcBackupAndRestoreTest() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -100,7 +101,8 @@ public void VcBackupAndRestoreTest() throws InterruptedException { assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); // assertEquals(homePage.GetActivationPendingText(), "Activation pending for online login"); } @@ -193,7 +195,8 @@ public void RestoreVcTwoTimes() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); assertTrue(settingsPage.isdataBackupAndRestoreDisplayed(), "Verify if backup & restore displayed"); @@ -237,8 +240,8 @@ public void RestoreVcTwoTimes() throws InterruptedException { assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if second vc full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } // @Test @@ -310,7 +313,8 @@ public void VerifyBackUpAndRestorePageInMultipleLanguge() throws InterruptedExce otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -499,7 +503,8 @@ public void ActiveVcAfterBackup() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -620,7 +625,8 @@ public void VerifyDeletingDownloadedvc() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -662,7 +668,8 @@ public void VerifyDeletingDownloadedvc() throws InterruptedException { assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnFirstVcsEllipsisButton(); MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -720,7 +727,8 @@ public void VerifyDeletingRestoredvc() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -763,7 +771,8 @@ public void VerifyDeletingRestoredvc() throws InterruptedException { assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); IosUtil.scrollToElement(driver,100,800,100,200); homePage.clickOnSecondVcsEllipsisButton(); MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver); @@ -818,8 +827,8 @@ public void VerifyPiningDownloadedVc() throws InterruptedException { OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -861,7 +870,8 @@ public void VerifyPiningDownloadedVc() throws InterruptedException { assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); IosUtil.scrollToElement(driver,100,800,100,200); homePage.clickOnSecondVcsEllipsisButton(); MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver); @@ -913,7 +923,8 @@ public void VerifyPiningRestoredVc() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -955,7 +966,8 @@ public void VerifyPiningRestoredVc() throws InterruptedException { assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnFirstVcsEllipsisButton(); MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -1013,7 +1025,8 @@ public void ActiveVcBeforeAndAfterBackup() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -1065,7 +1078,8 @@ public void ActiveVcBeforeAndAfterBackup() throws InterruptedException { assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(moreOptionsPage.isVcActivatedForOnlineLogin(), "Verify if VC is activated"); } @@ -1096,7 +1110,8 @@ public void VcBackupAndRestoreTestAndCheckBackupTosterInOtherPages() throws Inte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -1150,7 +1165,8 @@ public void VcBackupAndRestoreTestAndCheckBackupTosterInOtherPages() throws Inte assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnHistoryButton(); assertTrue(backupAndRestorePage.isDataBackupSuccessPopupDisplayed(), "Verify if backup successful popup displayed"); @@ -1188,7 +1204,8 @@ public void VcBackupAndRestoreTestAndCheckRestoreTosterInOtherPages() throws Int otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -1238,7 +1255,8 @@ public void VcBackupAndRestoreTestAndCheckRestoreTosterInOtherPages() throws Int assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); homePage.clickOnHomeButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnHistoryButton(); assertTrue(backupAndRestorePage.isRestoreBackupSuccessPopUpDisplayed(), " Verify is restore backup successful popup displayed"); diff --git a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingEsignetTest.java b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingEsignetTest.java index 1b5bc64f97..82d4dad428 100644 --- a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingEsignetTest.java +++ b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingEsignetTest.java @@ -45,20 +45,21 @@ public void downloadAndVerifyVcUsingUinViaEsignet() throws InterruptedException EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); String uin=TestDataReader.readData("uin"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(uin); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); - + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); + detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); @@ -75,20 +76,20 @@ public void downloadAndVerifyVcUsingUinViaEsignet() throws InterruptedException assertEquals(detailedVcViewPage.getPhoneInDetailedVcView(), TestDataReader.readData("phoneNumber"), "Verify if phone number is displayed"); assertEquals(detailedVcViewPage.getEmailInDetailedVcView(), TestDataReader.readData("externalemail"), "Verify if email is displayed"); assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); - + PleaseConfirmPopupPage pleaseConfirmPopupPage =detailedVcViewPage.clickOnActivateButtonAndroid(); assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if confirm popup page is displayed"); - + pleaseConfirmPopupPage.clickOnConfirmButton(); assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - + otpVerification.enterOtp(TestDataReader.readData("passcode"), Target.ANDROID); assertTrue(detailedVcViewPage.isProfileAuthenticatedDisplayed(), "Verify profile authenticated displayed"); - + detailedVcViewPage.clickOnBackArrow(); assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); } - + @Test public void downloadAndVerifyVcUsingVidViaEsignet() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -115,7 +116,7 @@ public void downloadAndVerifyVcUsingVidViaEsignet() throws InterruptedException assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); String vid = TestDataReader.readData("vid"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(vid); @@ -125,7 +126,7 @@ public void downloadAndVerifyVcUsingVidViaEsignet() throws InterruptedException esignetLoginPage.clickOnVerifyButton(); Thread.sleep(2000); homePage.clickOnDoneButton(); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); @@ -142,16 +143,16 @@ public void downloadAndVerifyVcUsingVidViaEsignet() throws InterruptedException // assertEquals(detailedVcViewPage.getPhoneInDetailedVcView(), TestDataReader.readData("phoneNumberVidEsignet"), "Verify if phone number is displayed"); assertEquals(detailedVcViewPage.getEmailInDetailedVcView(), TestDataReader.readData("externalemail"), "Verify if email is displayed"); assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); - + PleaseConfirmPopupPage pleaseConfirmPopupPage =detailedVcViewPage.clickOnActivateButtonAndroid(); assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if confirm popup page is displayed"); - + pleaseConfirmPopupPage.clickOnConfirmButton(); assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - + otpVerification.enterOtp(TestDataReader.readData("passcode"), Target.ANDROID); assertTrue(detailedVcViewPage.isProfileAuthenticatedDisplayed(), "Verify profile authenticated displayed"); - + } @Test @@ -198,8 +199,9 @@ public void downloadMultipleVcViaEsignet() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); PleaseConfirmPopupPage pleaseConfirmPopupPage =detailedVcViewPage.clickOnActivateButtonAndroid(); assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if confirm popup page is displayed"); @@ -230,8 +232,9 @@ public void downloadMultipleVcViaEsignet() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + homePage.openDetailedVcView(); } @Test diff --git a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java index 5a97156af6..ca30b4959e 100644 --- a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java +++ b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingMockIdentity.java @@ -55,9 +55,9 @@ public void downloadAndVerifyVcUsingUinViaMockIdentity() throws InterruptedExcep otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); mockCertifyLoginPage.clickOnVerifyButtonIos(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullNameForMobileDrivingLicense")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullNameForMobileDrivingLicense")); + + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); @@ -70,7 +70,7 @@ public void downloadAndVerifyVcUsingUinViaMockIdentity() throws InterruptedExcep // assertEquals(detailedVcViewPage.getDateOfBirthInDetailedVcView(), TestDataReader.readData("dateOfBirthForMobileDrivingLicense"), "Verify if date of birth is displayed"); assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idTypeForMobileDrivingLicense"), "Verify if id type is displayed"); assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); - assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); +// assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); detailedVcViewPage.clickOnBackArrow(); assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); } diff --git a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingSunbirdTest.java b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingSunbirdTest.java index fcfe976dae..0dbd504309 100644 --- a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingSunbirdTest.java +++ b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingSunbirdTest.java @@ -46,10 +46,10 @@ public void downloadAndVerifyVcUsingUinViaSunbird() throws InterruptedException sunbirdLoginPage.enterFullNameTextBox(TestDataReader.readData("fullNameSunbird")); sunbirdLoginPage.enterDateOfBirthTextBox(); sunbirdLoginPage.clickOnloginButton(); - + assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); - assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); +// assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); sunbirdLoginPage.openDetailedSunbirdVcView(); @@ -64,5 +64,5 @@ public void downloadAndVerifyVcUsingUinViaSunbird() throws InterruptedException assertEquals(sunbirdLoginPage.getStatusValueForSunbirdCard(),TestDataReader.readData("statusValueSunbirdForVaild")); } - + } diff --git a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingUinTest.java b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingUinTest.java index d7c5149a6a..e9377a0d47 100644 --- a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingUinTest.java +++ b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingUinTest.java @@ -35,7 +35,7 @@ public void downloadAndVerifyVcUsingUin() throws InterruptedException { 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(); @@ -48,7 +48,7 @@ public void downloadAndVerifyVcUsingUin() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); AddNewCardPage addNewCardPage = homePage.downloadCard(); - + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); assertTrue(addNewCardPage.isIssuerDescriptionMosipDisplayed(), "Verify if issuer description mosip displayed"); assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); @@ -67,11 +67,12 @@ public void downloadAndVerifyVcUsingUin() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - + assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); @@ -121,7 +122,8 @@ public void downloadMultipleVcUsingDifferentUin() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.downloadCard(); @@ -134,8 +136,8 @@ public void downloadMultipleVcUsingDifferentUin() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("uin2FullName")), "Verify if second VC is displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verifying again if first VC is still exists."); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @@ -204,7 +206,8 @@ public void generateMultipleVcWithSameUin() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.downloadCard(); @@ -217,7 +220,8 @@ public void generateMultipleVcWithSameUin() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if second card name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); @@ -302,7 +306,7 @@ public void verifyOtpTimeOutAndGoBack() throws InterruptedException { otpVerification.clickOnCancelPopupButton(); assertEquals(homePage.verifyLanguageForNoVCDownloadedPageLoaded(), "Bring your digital identity"); } - + @Test public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -338,8 +342,9 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + //2 homePage.downloadCard(); addNewCardPage.clickOnDownloadViaUin(); @@ -351,7 +356,8 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); //3 homePage.downloadCard(); addNewCardPage.clickOnDownloadViaUin(); @@ -363,7 +369,8 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); //4 homePage.downloadCard(); addNewCardPage.clickOnDownloadViaUin(); @@ -375,7 +382,8 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); //5 homePage.downloadCard(); addNewCardPage.clickOnDownloadViaUin(); @@ -387,7 +395,8 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); //6 homePage.downloadCard(); @@ -400,7 +409,8 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); //7 homePage.downloadCard(); @@ -413,7 +423,8 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); //8 homePage.downloadCard(); @@ -426,7 +437,8 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); AndroidUtil.forceStopApp(); Thread.sleep(4000); @@ -434,9 +446,10 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeApp() throws Interrupte Thread.sleep(4000); UnlockApplicationPage unlockApplicationPage = new UnlockApplicationPage(driver); unlockApplicationPage.clickOnUnlockApplicationButton(); - + setPasscode.enterPasscode(TestDataReader.readData("passcode"), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @Test @@ -484,7 +497,8 @@ public void downloadMultipleCardsAndVerifySearch() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.downloadCard(); SunbirdLoginPage sunbirdLoginPage = addNewCardPage.clickOnDownloadViaSunbird(); @@ -498,7 +512,8 @@ public void downloadMultipleCardsAndVerifySearch() throws InterruptedException { assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isCardCountDisplayed(), "Verify if card count is displayed"); homePage.sendTextInIssuerSearchBar(TestDataReader.readData("fullNameSunbird")); @@ -508,7 +523,8 @@ public void downloadMultipleCardsAndVerifySearch() throws InterruptedException { assertTrue(homePage.isIssuerSearchBarDisplayed(), "Verify if card search is displayed"); homePage.sendTextInIssuerSearchBar("test"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); //invalid homePage.sendTextInIssuerSearchBar("Annabelle"); @@ -584,10 +600,12 @@ public void downloadCardsAndVerifySearch() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.sendTextInIssuerSearchBar("valid"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.downloadCard(); addNewCardPage.clickOnDownloadViaUin(); @@ -597,8 +615,9 @@ public void downloadCardsAndVerifySearch() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } - + } \ No newline at end of file diff --git a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingVidTest.java b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingVidTest.java index 764a437eb7..b04b344d8d 100644 --- a/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingVidTest.java +++ b/injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingVidTest.java @@ -45,12 +45,13 @@ public void downloadAndVerifyVcUsingVid() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullName"), "Verify if full name is displayed"); } - + @Test public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -84,8 +85,9 @@ public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); @@ -97,7 +99,8 @@ public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); // MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -106,8 +109,9 @@ public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + } @Test @@ -141,7 +145,7 @@ public void verifyInvalidVidErrorMessage() { assertTrue(retrieveIdPage.isIncorrectInputFormatErrorVidMessageDisplayed()); } - + @Test public void downloadAndVerifyVcUsingRevokeVid() { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -173,7 +177,7 @@ public void downloadAndVerifyVcUsingRevokeVid() { assertTrue(otpVerification.vidNotAvailableDisplayed(), "Verify if vid is not available message displayed"); } - + @Test public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -207,9 +211,10 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + + //2 homePage.downloadCard(); @@ -222,10 +227,11 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + //3 - + homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); @@ -237,8 +243,9 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + //4 homePage.downloadCard(); @@ -251,10 +258,11 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + //5 - + homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); @@ -266,10 +274,11 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + //6 - + homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); @@ -281,8 +290,9 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + //7 homePage.downloadCard(); @@ -295,8 +305,9 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + //8 homePage.downloadCard(); @@ -309,17 +320,19 @@ public void DownloadMultipleVcAndForceStopeAndAgainInvokeAppViaVid() throws Inte assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + AndroidUtil.forceStopApp(); Thread.sleep(4000); AndroidUtil.invokeAppFromBackGroundAndroid(); Thread.sleep(4000); UnlockApplicationPage unlockApplicationPage = new UnlockApplicationPage(driver); unlockApplicationPage.clickOnUnlockApplicationButton(); - + setPasscode.enterPasscode(TestDataReader.readData("passcode"), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } - + } \ No newline at end of file diff --git a/injitest/src/test/java/androidTestCases/VerifyHistoryTest.java b/injitest/src/test/java/androidTestCases/VerifyHistoryTest.java index fffbcca401..2c7b967687 100644 --- a/injitest/src/test/java/androidTestCases/VerifyHistoryTest.java +++ b/injitest/src/test/java/androidTestCases/VerifyHistoryTest.java @@ -44,7 +44,8 @@ public void downloadVcAndVerifyHistory() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); @@ -86,7 +87,8 @@ public void verifyActivationFailedRecordInHistory() throws InterruptedException assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -100,7 +102,7 @@ public void verifyActivationFailedRecordInHistory() throws InterruptedException assertTrue(otpVerification.invalidOtpMessageDisplayed(), "Verify if OTP is invalid message is displayed"); otpVerificationPage.enterOtp(TestDataReader.readData("invalidOtp"), Target.ANDROID); - + assertTrue(otpVerificationPage.somethingWetWrongInVcActivationDisplayed(), "Verify if Something is wrong. Please try again later displayed"); assertTrue(otpVerificationPage.isCancelButtonDisplayed(), "Verify if cancel button is displayed"); @@ -143,8 +145,9 @@ public void verifyActivationFailedRecordInHistoryFromDetailedView() throws Inter assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); PleaseConfirmPopupPage pleaseConfirmPopupPage = detailedVcViewPage.clickOnActivateButtonAndroid(); @@ -197,7 +200,8 @@ public void activateVcAndVerifyInHistory() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -243,28 +247,29 @@ public void downloadAndVerifyHistoryUsingUinViaEsignet() throws InterruptedExcep EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); String uin = TestDataReader.readData("uin"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(uin); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); - + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); + assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); PleaseConfirmPopupPage pleaseConfirmPopupPage =detailedVcViewPage.clickOnActivateButtonAndroid(); assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if confirm popup page is displayed"); - + pleaseConfirmPopupPage.clickOnConfirmButton(); assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - + otpVerification.enterOtp(TestDataReader.readData("passcode"), Target.ANDROID); assertTrue(detailedVcViewPage.isProfileAuthenticatedDisplayed(), "Verify profile authenticated displayed"); detailedVcViewPage.clickOnCrossIcon(); @@ -272,20 +277,20 @@ public void downloadAndVerifyHistoryUsingUinViaEsignet() throws InterruptedExcep MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); - + moreOptionsPage.clickOnRemoveFromWallet(); assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); assertEquals(homePage.verifyLanguageForNoVCDownloadedPageLoaded(), "Bring your digital identity"); - + HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); assertTrue(historyPage.verifyActivationSuccessfulRecordInHistory(uin, Target.ANDROID)); assertTrue(historyPage.verifyHistory(uin, Target.ANDROID),"verify if download history is displayed"); assertTrue(historyPage.verifyDeleteHistory(uin, Target.ANDROID), "Verify if deleted history is displayed"); } - + @Test public void downloadAndVerifyHistoryUsingVidViaEsignet() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -313,28 +318,29 @@ public void downloadAndVerifyHistoryUsingVidViaEsignet() throws InterruptedExcep EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); String vid = TestDataReader.readData("vid"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(vid); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); - + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); + assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); - + PleaseConfirmPopupPage pleaseConfirmPopupPage =detailedVcViewPage.clickOnActivateButtonAndroid(); assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if confirm popup page is displayed"); - + pleaseConfirmPopupPage.clickOnConfirmButton(); assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - + otpVerification.enterOtp(TestDataReader.readData("passcode"), Target.ANDROID); assertTrue(detailedVcViewPage.isProfileAuthenticatedDisplayed(), "Verify profile authenticated displayed"); detailedVcViewPage.clickOnCrossIcon(); @@ -347,7 +353,7 @@ public void downloadAndVerifyHistoryUsingVidViaEsignet() throws InterruptedExcep assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); - + HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); assertTrue(historyPage.verifyActivationSuccessfulRecordInHistory(vid, Target.ANDROID)); @@ -395,7 +401,7 @@ public void downloadAndVerifyHistoryForSunbird() throws InterruptedException { assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); - assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); +// assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); sunbirdLoginPage.openDetailedSunbirdVcView(); @@ -448,7 +454,8 @@ public void downloadVcAndVerifyHistoryFromMoreOptions() throws InterruptedExcept assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.ANDROID); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); diff --git a/injitest/src/test/java/androidTestCases/keyManagement.java b/injitest/src/test/java/androidTestCases/keyManagement.java index a13dfe9b06..bfc88e38c1 100644 --- a/injitest/src/test/java/androidTestCases/keyManagement.java +++ b/injitest/src/test/java/androidTestCases/keyManagement.java @@ -127,8 +127,8 @@ public void downloadAndVerifyVcUsingMockIdentity() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); mockCertifyLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullNameForMobileDrivingLicense")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullNameForMobileDrivingLicense")); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); @@ -139,7 +139,7 @@ public void downloadAndVerifyVcUsingMockIdentity() throws InterruptedException { assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idTypeForMobileDrivingLicense"), "Verify if id type is displayed"); assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); - assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); +// assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); assertTrue(keyManagementPage.compareListOfKeys()); } @@ -196,8 +196,8 @@ public void downloadAndVerifyVcUsingEsignet() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.ANDROID); esignetLoginPage.clickOnVerifyButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); diff --git a/injitest/src/test/java/iosTestCases/ActivateVcTest.java b/injitest/src/test/java/iosTestCases/ActivateVcTest.java index 1a7efa734f..b18fa66ec9 100644 --- a/injitest/src/test/java/iosTestCases/ActivateVcTest.java +++ b/injitest/src/test/java/iosTestCases/ActivateVcTest.java @@ -47,7 +47,8 @@ public void activateVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -166,9 +167,10 @@ public void activateVcFromDetailedViewPage() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); IosUtil.scrollToElement(driver,100,800,100,200); PleaseConfirmPopupPage pleaseConfirmPopupPage = detailedVcViewPage.clickOnActivateButtonIos(); @@ -216,7 +218,8 @@ public void verifyActiveVcAndWaitForOtpTimeOut() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -273,8 +276,9 @@ public void downloadAndActiveVcUsingUinViaEsignet() throws InterruptedException otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); diff --git a/injitest/src/test/java/iosTestCases/ChangeLanguageTest.java b/injitest/src/test/java/iosTestCases/ChangeLanguageTest.java index acc0207c20..a8934bdc67 100644 --- a/injitest/src/test/java/iosTestCases/ChangeLanguageTest.java +++ b/injitest/src/test/java/iosTestCases/ChangeLanguageTest.java @@ -506,7 +506,8 @@ public void DownladvcAndVerifyInArabicAndHindiLanguage() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); @@ -515,7 +516,7 @@ public void DownladvcAndVerifyInArabicAndHindiLanguage() { assertTrue(unlockApplicationPage.isUnlockApplicationPageLoadedInArabic(), "Verify if language is changed to arabic"); unlockApplicationPage.clickOnUnlockApplicationButton(); setPasscode.enterPasscode(TestDataReader.readData("passcode"), Target.IOS); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertEquals(homePage.getfullNameTitleText(), "الاسم الكامل"); detailedVcViewPage.clickOnBackArrow(); @@ -525,7 +526,7 @@ public void DownladvcAndVerifyInArabicAndHindiLanguage() { unlockApplicationPage.clickOnUnlockApplicationButton(); setPasscode.enterPasscode(TestDataReader.readData("passcode"), Target.IOS); - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + homePage.openDetailedVcView(); assertEquals(homePage.getfullNameTitleText(), "पूरा नाम"); } diff --git a/injitest/src/test/java/iosTestCases/CredentialRegistryTest.java b/injitest/src/test/java/iosTestCases/CredentialRegistryTest.java index b7d48bd995..ccbb9496d2 100644 --- a/injitest/src/test/java/iosTestCases/CredentialRegistryTest.java +++ b/injitest/src/test/java/iosTestCases/CredentialRegistryTest.java @@ -34,10 +34,10 @@ public void downloadAndVerifyVcInNewEnv() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton().clickOnSaveButton(); @@ -53,8 +53,9 @@ public void downloadAndVerifyVcInNewEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.IOS); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -62,19 +63,20 @@ public void downloadAndVerifyVcInNewEnv() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); OtpVerificationPage otpVerificationPage = pleaseConfirmPopupPage.clickOnConfirmButton(); - + assertTrue(otpVerificationPage.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerificationPage.enterOtp(TestDataReader.readData("otp"), Target.IOS); assertTrue(moreOptionsPage.isVcActivatedForOnlineLogin(), "Verify if VC is activated"); moreOptionsPage.clickOnCloseButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isCredentialRegistryTextDisplayed(),"Verify if is credential registry text displayed"); assertEquals(detailedVcViewPage.getCredentialRegistryValue(), TestDataReader.readData("newEnv"), "Verify changed env is displayed in detailed vc"); } - + @Test public void cancelChangeEnvAndVerify() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -97,23 +99,23 @@ public void cancelChangeEnvAndVerify() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnCancelButton().clickOnCancelButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + homePage.clickOnSettingIcon(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); assertEquals(credentialRegistryPage.checkEnvNotChanged(),"https://api.qa-inji1.mosip.net"); } - + @Test public void downloadAndVerifyVcInInvalidEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -136,16 +138,16 @@ public void downloadAndVerifyVcInInvalidEnv() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("invalidenv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(credentialRegistryPage.isCredentialRegistryErrorMessageDisplayed(), "Verify if error message is displayed"); } - + @Test public void generateUinInNewEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -168,20 +170,20 @@ public void generateUinInNewEnv() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + 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"); GenerateUinOrVidPage generateUinOrVidPage = retrieveIdPage.clickOnGetItNowText(); @@ -197,9 +199,10 @@ public void generateUinInNewEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } - + @Test public void retrivingUinInOtherEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -222,20 +225,20 @@ public void retrivingUinInOtherEnv() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + 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"); GenerateUinOrVidPage generateUinOrVidPage = retrieveIdPage.clickOnGetItNowText(); @@ -244,7 +247,7 @@ public void retrivingUinInOtherEnv() throws InterruptedException { assertTrue(retrieveIdPage.isAidIsNotReadyYetErrorDisplayed(), "Verify if aid is not ready displayed"); } - + @Test public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -267,16 +270,16 @@ public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); @@ -286,19 +289,20 @@ public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.IOS); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("injiEnv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); addNewCardPage.clickOnDownloadViaUin(); @@ -308,11 +312,11 @@ public void downloadAndVerifyVcInTwoEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } - + @Test public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -335,16 +339,16 @@ public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); @@ -354,19 +358,20 @@ public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.IOS); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("injiEnv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -374,10 +379,10 @@ public void downloadVcAndActivateItInOtherEnv() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); OtpVerificationPage otpVerificationPage = pleaseConfirmPopupPage.clickOnConfirmButton(); - + assertTrue(moreOptionsPage.isSomethingIsWrongPopupVisible(), "Verify if somthing went wrong please try again popup displayed"); } - + @Test public void downloadAndVerifyVcInNewEnvForEsignet() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -400,34 +405,35 @@ public void downloadAndVerifyVcInNewEnvForEsignet() throws InterruptedException homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).enterUrlToEsignetHostTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton().clickOnSaveButton(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); - + AddNewCardPage addNewCardPage = homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); - + EsignetLoginPage esignetLoginPage = addNewCardPage.clickOnDownloadViaEsignet(); assertTrue(esignetLoginPage.isEsignetLoginPageDisplayed(), "Verify if esignet login page displayed"); esignetLoginPage.clickOnEsignetLoginWithOtpButton(); - + assertTrue(esignetLoginPage.isEnterYourVidTextDisplayed(), "Verify if enter your vid text is displayed"); OtpVerificationPage otpVerification= esignetLoginPage.setEnterIdTextBox(TestDataReader.readData("newuin")); - + esignetLoginPage.clickOnGetOtpButton(); assertTrue(esignetLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - + otpVerification.enterOtpForEsignet(TestDataReader.readData("otp"), Target.IOS); esignetLoginPage.clickOnVerifyButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); @@ -444,7 +450,7 @@ public void downloadAndVerifyVcInNewEnvForEsignet() throws InterruptedException assertEquals(detailedVcViewPage.getEmailInDetailedVcView(), TestDataReader.readData("externalemail"), "Verify if email is displayed"); assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); } - + @Test public void downloadAndVerifyVcInInvalidEnvForEsignet() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -467,16 +473,16 @@ public void downloadAndVerifyVcInInvalidEnvForEsignet() throws InterruptedExcept homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("invalidenv")).enterUrlToEsignetHostTextBox(TestDataReader.readData("invalidenv")).clickOnSaveButton().clickOnSaveButton(); assertTrue(credentialRegistryPage.isCredentialRegistryErrorMessageDisplayed(), "Verify if error message is displayed"); } - + @Test public void downloadAndVerifyVcInInvalidEnvForEsignetInFillpino() throws InterruptedException { UnlockApplicationPage unlockApplicationPage = new UnlockApplicationPage(driver); @@ -516,13 +522,13 @@ public void downloadAndVerifyVcInInvalidEnvForEsignetInFillpino() throws Interru assertTrue(settingsPage.verifyFilipinoLanguage(), "Verify if language is changed to filipino"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderInFilipinoDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("invalidenv")).enterUrlToEsignetHostTextBox(TestDataReader.readData("invalidenv")).clickOnSaveButton(); assertTrue(credentialRegistryPage.isCredentialRegistryErrorMessageDisplayed(), "Verify if error message is displayed"); } - + @Test public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -545,10 +551,10 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); CredentialRegistryPage credentialRegistryPage =settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("newEnv")).clickOnSaveButton(); @@ -564,8 +570,9 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.IOS); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -573,32 +580,33 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); OtpVerificationPage otpVerificationPage = pleaseConfirmPopupPage.clickOnConfirmButton(); - + assertTrue(otpVerificationPage.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerificationPage.enterOtp(TestDataReader.readData("otp"), Target.IOS); assertTrue(moreOptionsPage.isVcActivatedForOnlineLogin(), "Verify if VC is activated"); moreOptionsPage.clickOnCloseButton(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isCredentialRegistryTextDisplayed(),"Verify if is credential registry text displayed"); assertEquals(detailedVcViewPage.getCredentialRegistryValue(), TestDataReader.readData("newEnv"), "Verify changed env is displayed in detailed vc"); - + detailedVcViewPage.clickOnBackArrow(); homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnCredentialRegistry(); - + assertTrue(credentialRegistryPage.isCredentialRegistryTextBoxHeaderDisplayed(), "Verify if CredentialRegistry page is displayed"); credentialRegistryPage.setEnterIdTextBox(TestDataReader.readData("injiEnv")).clickOnSaveButton(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); credentialRegistryPage.clickOnBackArrow(); homePage.downloadCard(); - - + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); addNewCardPage.clickOnDownloadViaUin(); @@ -607,12 +615,13 @@ public void downloadVcInNewEnvAndVerifyInDetailedVcViewPage() throws Interrupted assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(TestDataReader.readData("otp"), Target.IOS); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + + homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isCredentialRegistryTextDisplayed(),"Verify if is credential registry text displayed"); assertEquals(detailedVcViewPage.getCredentialRegistryValue(), TestDataReader.readData("injiEnv"), "Verify inji env is displayed in detailed vc"); } - + } \ No newline at end of file diff --git a/injitest/src/test/java/iosTestCases/DeletingVcTest.java b/injitest/src/test/java/iosTestCases/DeletingVcTest.java index 1039a0e29c..91f2392f37 100644 --- a/injitest/src/test/java/iosTestCases/DeletingVcTest.java +++ b/injitest/src/test/java/iosTestCases/DeletingVcTest.java @@ -43,7 +43,8 @@ public void deleteVcAndVerifyInHistory() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -94,7 +95,8 @@ public void cancelDeleteVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -106,7 +108,8 @@ public void cancelDeleteVc() throws InterruptedException { // assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); // // moreOptionsPage.clickOnCloseButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @Test @@ -142,7 +145,8 @@ public void DownloadingDeletedVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -151,7 +155,7 @@ public void DownloadingDeletedVc() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); - assertFalse(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if VC is removed"); + assertFalse(homePage.isCredentialTypeValueDisplayed(), "Verify if VC is removed"); homePage.downloadCard(); @@ -164,7 +168,8 @@ public void DownloadingDeletedVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); @@ -213,7 +218,8 @@ public void deleteVcAndVerifyInHistoryForEsignet() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); diff --git a/injitest/src/test/java/iosTestCases/GenerateUinOrVidTest.java b/injitest/src/test/java/iosTestCases/GenerateUinOrVidTest.java index f6bb6b177f..9926767979 100644 --- a/injitest/src/test/java/iosTestCases/GenerateUinOrVidTest.java +++ b/injitest/src/test/java/iosTestCases/GenerateUinOrVidTest.java @@ -57,7 +57,8 @@ public void generateUinOrVidUsingAid() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } diff --git a/injitest/src/test/java/iosTestCases/KeyManagmentTest.java b/injitest/src/test/java/iosTestCases/KeyManagmentTest.java deleted file mode 100644 index 657ca565c4..0000000000 --- a/injitest/src/test/java/iosTestCases/KeyManagmentTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package iosTestCases; - -import BaseTest.IosBaseTest; -import inji.api.BaseTestCase; -import inji.constants.Target; -import inji.pages.*; -import inji.utils.IosUtil; -import inji.utils.TestDataReader; -import org.testng.annotations.Test; -import org.testng.asserts.SoftAssert; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -public class KeyManagmentTest extends IosBaseTest { - @Test - public void downloadAndVerifyVcUsingUinViaEsignet() 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); - SettingsPage settingsPage = homePage.clickOnSettingIcon(); - - settingsPage.clickOnKeyManagement(); - Thread.sleep(3000); - KeyManagementPage keyManagementPage = new KeyManagementPage(driver); - keyManagementPage.clickOnDoneButton(); - Thread.sleep(3000); - - IosUtil.dragAndDropForIos(driver,keyManagementPage.getTheCoordinatesForRSA(),keyManagementPage.getTheCoordinatesED25519Text()); - keyManagementPage.clickOnSaveKeyOrderingPreferenceButton(); - } -} \ No newline at end of file diff --git a/injitest/src/test/java/iosTestCases/MosipOtpAlternativeFlow.java b/injitest/src/test/java/iosTestCases/MosipOtpAlternativeFlow.java index 2d2c97103b..ad373f1e44 100644 --- a/injitest/src/test/java/iosTestCases/MosipOtpAlternativeFlow.java +++ b/injitest/src/test/java/iosTestCases/MosipOtpAlternativeFlow.java @@ -90,9 +90,10 @@ public void activateVcFromDetailedViewPage() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); IosUtil.scrollToElement(driver,100,800,100,200); PleaseConfirmPopupPage pleaseConfirmPopupPage = detailedVcViewPage.clickOnActivateButtonIos(); @@ -143,7 +144,8 @@ public void verifyActiveVcAndWaitForOtpTimeOut() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -197,7 +199,8 @@ public void cancelDeleteVc() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -209,7 +212,8 @@ public void cancelDeleteVc() throws InterruptedException { // assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); // moreOptionsPage.clickOnCloseButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @Test @@ -248,7 +252,8 @@ public void DownloadingDeletedVc() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -257,7 +262,8 @@ public void DownloadingDeletedVc() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); - assertFalse(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if VC is removed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.downloadCard(); @@ -274,7 +280,8 @@ public void DownloadingDeletedVc() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); @@ -321,7 +328,8 @@ public void deleteDownloadedVcInOfflineMode() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -373,17 +381,19 @@ public void openQrOffline() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); detailedVcViewPage.clickOnQrCrossIcon(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @Test @@ -456,7 +466,8 @@ public void VerifyCameraOpenAfterPinVc() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -509,9 +520,10 @@ public void pinVcInDetailedVcView() throws InterruptedException { esignetLoginPage.clickOnVerifyButtonIos(); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -521,10 +533,11 @@ public void pinVcInDetailedVcView() throws InterruptedException { moreOptionsPage.clickOnPinOrUnPinCard(); detailedVcViewPage.clickOnBackArrow(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -569,7 +582,8 @@ public void verifyActivationFailedRecordInHistory() throws InterruptedException otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -628,8 +642,9 @@ public void verifyActivationFailedRecordInHistoryFromDetailedView() throws Inter otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); PleaseConfirmPopupPage pleaseConfirmPopupPage = detailedVcViewPage.clickOnActivateButtonIos(); diff --git a/injitest/src/test/java/iosTestCases/NoNetworkIosTest.java b/injitest/src/test/java/iosTestCases/NoNetworkIosTest.java index 78ada1f324..91fd5ea703 100644 --- a/injitest/src/test/java/iosTestCases/NoNetworkIosTest.java +++ b/injitest/src/test/java/iosTestCases/NoNetworkIosTest.java @@ -84,7 +84,8 @@ public void openCameraOnFlightMode() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -124,7 +125,8 @@ public void activateVcWithoutInternet() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -236,7 +238,8 @@ public void deleteDownloadedVcInOfflineMode() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); @@ -286,17 +289,18 @@ public void openQrOffline() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); String sessionId = driver.getSessionId().toString(); UpdateNetworkSettings.setNoNetworkProfile(sessionId); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); detailedVcViewPage.clickOnQrCrossIcon(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); } @Test diff --git a/injitest/src/test/java/iosTestCases/PinVcTest.java b/injitest/src/test/java/iosTestCases/PinVcTest.java index f27033b894..8227c3015f 100644 --- a/injitest/src/test/java/iosTestCases/PinVcTest.java +++ b/injitest/src/test/java/iosTestCases/PinVcTest.java @@ -47,7 +47,8 @@ public void pinVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -93,7 +94,8 @@ public void VerifyCameraOpenAfterPinVc() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -145,7 +147,8 @@ public void downloadVcViaEsignetAndPinUnpin() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -162,7 +165,7 @@ public void downloadVcViaEsignetAndPinUnpin() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if second card name is displayed"); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -203,7 +206,8 @@ public void verifyMessageAfterDenyBluetoothPopup() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -264,7 +268,8 @@ public void pinEsignetVcMultipleTimes() throws InterruptedException { assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -337,7 +342,8 @@ public void pinMosipVcMultipleTimes() throws InterruptedException { assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver); // mosip vc homePage.clickOnSecondVcEllipsis(); @@ -399,9 +405,10 @@ public void pinVcInDetailedVcView() throws InterruptedException { otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); @@ -411,10 +418,11 @@ public void pinVcInDetailedVcView() throws InterruptedException { moreOptionsPage.clickOnPinOrUnPinCard(); detailedVcViewPage.clickOnBackArrow(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); assertTrue(homePage.isPinIconDisplayed(), "Verify if pin icon on vc is displayed"); - homePage.openDetailedVcView(TestDataReader.readData("fullName")); + homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); detailedVcViewPage.clickOnMoreOptionsInDetails(); diff --git a/injitest/src/test/java/iosTestCases/ShareVcTest.java b/injitest/src/test/java/iosTestCases/ShareVcTest.java index 37942f80c4..4ff98a5f8c 100644 --- a/injitest/src/test/java/iosTestCases/ShareVcTest.java +++ b/injitest/src/test/java/iosTestCases/ShareVcTest.java @@ -105,7 +105,8 @@ public void rejectingCameraAccessesOnShareScreen() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); SharePage SharePage = homePage.clickOnShareButton(); diff --git a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingEsignetTest.java b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingEsignetTest.java index 9d93c275aa..603e158620 100644 --- a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingEsignetTest.java +++ b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingEsignetTest.java @@ -50,10 +50,12 @@ public void downloadAndVerifyVcUsingUinViaEsignet() throws InterruptedException otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); @@ -122,10 +124,10 @@ public void downloadAndVerifyVcUsingVidViaEsignet() throws InterruptedException otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); @@ -224,10 +226,10 @@ public void downloadMultipleVcViaEsignet() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); detailedVcViewPage.clickOnQrCodeButton(); SoftAssert softAssert = new SoftAssert(); @@ -269,10 +271,9 @@ public void downloadMultipleVcViaEsignet() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - homePage.openDetailedVcView(TestDataReader.readData("fullName")); } } \ No newline at end of file diff --git a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java deleted file mode 100644 index a62338a274..0000000000 --- a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package iosTestCases; - -import BaseTest.IosBaseTest; -import inji.api.BaseTestCase; -import inji.constants.Target; -import inji.pages.*; -import inji.utils.TestDataReader; -import org.testng.annotations.Test; -import org.testng.asserts.SoftAssert; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -public class VcDownloadAndVerifyUsingMockIdentityTest extends IosBaseTest { - @Test - public void downloadAndVerifyVcUsingUinViaEsignet() 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); - AddNewCardPage addNewCardPage = homePage.downloadCard(); - - assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); - assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); - assertTrue(addNewCardPage.isIssuerSearchBarDisplayed(), "Verify if issuer search bar displayed"); -// addNewCardPage.sendTextInIssuerSearchBar("Download MOSIP Credentials"); - assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); - assertTrue(addNewCardPage.isAddNewCardPageGuideMessageForEsignetDisplayed(), "Verify if add new card guide message displayed"); - assertTrue(addNewCardPage.isDownloadViaEsignetDisplayed(), "Verify if download via uin displayed"); - MockCertifyLoginPage mockCertifyLoginPage = addNewCardPage.clickOnDownloadViaMockCertify(); - - addNewCardPage.clickOnContinueButtonInSigninPopupIos(); - - Thread.sleep(9000); - OtpVerificationPage otpVerification= mockCertifyLoginPage.setEnterIdTextBox(TestDataReader.readData("MockVc")); - - mockCertifyLoginPage.clickOnGetOtpButton(); -// assertTrue(mockCertifyLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); - - otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); - mockCertifyLoginPage.clickOnVerifyButtonIos(); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullNameForMobileDrivingLicense")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullNameForMobileDrivingLicense")); - - detailedVcViewPage.clickOnQrCodeButton(); - SoftAssert softAssert = new SoftAssert(); - softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); - - detailedVcViewPage.clickOnQrCrossIcon(); - assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); - assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); -// assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullNameForMobileDrivingLicense"), "Verify if full name is displayed"); -// assertEquals(detailedVcViewPage.getDateOfBirthInDetailedVcView(), TestDataReader.readData("dateOfBirthForMobileDrivingLicense"), "Verify if date of birth is displayed"); - assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idTypeForMobileDrivingLicense"), "Verify if id type is displayed"); - assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); - assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); - detailedVcViewPage.clickOnBackArrow(); - assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); - } -} \ No newline at end of file diff --git a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingUinTest.java b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingUinTest.java index 6737633d84..789a63e297 100644 --- a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingUinTest.java +++ b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingUinTest.java @@ -1,453 +1,453 @@ -package iosTestCases; - -import BaseTest.IosBaseTest; -import inji.api.BaseTestCase; -import inji.constants.Target; -import inji.pages.*; -import inji.utils.TestDataReader; -import org.testng.annotations.Test; -import org.testng.asserts.SoftAssert; - -import static org.testng.Assert.*; -import static org.testng.Assert.assertFalse; - -public class VcDownloadAndVerifyUsingUinTest extends IosBaseTest { - @Test - public void downloadAndVerifyVcUsingUin() { - 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); - AddNewCardPage addNewCardPage = homePage.downloadCard(); - - assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); - assertTrue(addNewCardPage.isIssuerDescriptionMosipDisplayed(), "Verify if issuer description mosip displayed"); - assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); - assertTrue(addNewCardPage.isIssuerSearchBarDisplayed(), "Verify if issuer search bar displayed"); - addNewCardPage.sendTextInIssuerSearchBar("Download MOSIP Credentials"); - RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); - - //we will remove below line once bug is fixed https://mosip.atlassian.net/browse/INJI-712 - addNewCardPage.clickOnDownloadViaUin(); - - assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); - assertEquals(retrieveIdPage.getRetrieveIdPageHeader(),"Download your ID"); - assertTrue(retrieveIdPage.verifyDownloadIdPageGuideMessage(), "Verify if retrieve id page guide message is displayed"); - String uin=TestDataReader.readData("uin"); - OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page header is displayed"); - assertTrue(otpVerification.verifyotpVerificationDescriptionDisplayed(), "Verify if otp verification page description is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); -// assertTrue(homePage.isIdTypeDisplayed(), "Verify if id type is displayed"); - - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); - detailedVcViewPage.clickOnQrCodeButton(); - - SoftAssert softAssert = new SoftAssert(); - softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); - - detailedVcViewPage.clickOnQrCrossIcon(); - assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); - assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullName"), "Verify if full name is displayed"); - assertEquals(detailedVcViewPage.getDateOfBirthInDetailedVcView(), TestDataReader.readData("dateOfBirth"), "Verify if date of birth is displayed"); - assertEquals(detailedVcViewPage.getGenderInDetailedVcView(), TestDataReader.readData("gender"), "Verify if gender is displayed"); - assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idType"), "Verify if id type is displayed"); - assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); - assertEquals(detailedVcViewPage.getUinInDetailedVcView(), uin, "Verify if uin is displayed"); - assertEquals(detailedVcViewPage.getPhoneInDetailedVcView(), TestDataReader.readData("phoneNumber"), "Verify if phone number is displayed"); - assertEquals(detailedVcViewPage.getEmailInDetailedVcView(), TestDataReader.readData("externalemail"), "Verify if email is displayed"); - assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); - } - - @Test - public void downloadMultipleVcUsingDifferentUin() { - 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - 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"); - String uin=TestDataReader.readData("uin"); - OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - 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(TestDataReader.readData("uin2")).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("uin2FullName")), "Verify if second VC is displayed"); - 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - 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"); - String uin = TestDataReader.readData("uin"); - OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - 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(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if second card name is displayed"); - HistoryPage historyPage = homePage.clickOnHistoryButton(); - - assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); - - assertEquals(historyPage.getNumberOfRecordsInHistory(uin, Target.IOS),2, "Verify two download records in history page"); - - } - - @Test - public void verifyInvalidUinErrorMessage() { - 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - 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"); - retrieveIdPage.setEnterIdTextBox("00").clickOnGenerateCardButton(); - - assertTrue(retrieveIdPage.isIncorrectInputFormatErrorUinMessageDisplayed()); - } - - @Test - public void verifyOtpTimeOutAndGoBack() 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - homePage.clickOnNextButtonForInjiTour(); - 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"); - String uin = TestDataReader.readData("uin"); - OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.WatingTimeForVerificationTimerComplete(); - assertTrue(otpVerification.verifyOtpVerificationTimerDisplayedAfterClickOnResend(), "Verify if resend code is displayed"); - - otpVerification.clickOnCrossIcon(); - assertTrue(otpVerification.confirmPopupHeaderDisplayed(), "Verify if comfirm popup displayed"); - otpVerification.clickOnCancelPopupButton(); - assertEquals(homePage.verifyLanguageForNoVCDownloadedPageLoaded(), "Bring your digital identity"); - } - - @Test - public void downloadMultipleCardsAndVerifySearch() 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - assertFalse(homePage.isIssuerSearchBarDisplayed(), "Verify if card search not present"); - assertFalse(homePage.isCardCountDisplayed(), "Verify if card count not present"); - - homePage.clickOnNextButtonForInjiTour(); - 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"); - - String uin = TestDataReader.readData("uin"); - OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - homePage.downloadCard(); - SunbirdLoginPage sunbirdLoginPage = addNewCardPage.clickOnDownloadViaSunbird(); - addNewCardPage.clickOnCredentialTypeHeadingInsuranceCredential(); - - addNewCardPage.clickOnContinueButtonInSigninPopupIos(); - sunbirdLoginPage.enterPolicyNumberTextBox(TestDataReader.readData("policyNumberSunbird")); - sunbirdLoginPage.enterFullNameTextBox(TestDataReader.readData("fullNameSunbird")); - sunbirdLoginPage.enterDateOfBirthTextBox(); - sunbirdLoginPage.clickOnloginButton(); - - assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); - assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); - assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - assertTrue(homePage.isCardCountDisplayed(), "Verify if card count is displayed"); - - homePage.sendTextInIssuerSearchBar(TestDataReader.readData("fullNameSunbird")); - assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); - assertTrue(homePage.isCardCountAfterSearchDisplayed(), "Verify if card count is displayed"); - //partial search - - assertTrue(homePage.isIssuerSearchBarDisplayed(), "Verify if card search is displayed"); - homePage.sendTextInIssuerSearchBar("test"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - //invalid - homePage.sendTextInIssuerSearchBar("Annabelle"); - assertTrue(homePage.isNoCardFoundTextDisplayed(), "Verify if no card found displayed"); - - homePage.sendTextInIssuerSearchBar(uin); - homePage.clickOnReturnButton(); - 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(); - //deleted - homePage.sendTextInIssuerSearchBar(uin); - assertTrue(homePage.isNoCardFoundTextDisplayed(), "Verify if no card found displayed"); - homePage.clickOnReturnButton(); - - SettingsPage settingsPage= homePage.clickOnSettingIcon(); - assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); - settingsPage.clickOnLanguage().clickOnFilipinoLanguage(); - - assertTrue(settingsPage.verifyFilipinoLanguage(), "Verify if language is changed to filipino"); - homePage.clickOnHomeButton(); - - homePage.sendTextInIssuerSearchBar(TestDataReader.readData("fullNameSunbird")); - assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); - } - - @Test - public void downloadCardsAndVerifySearch() 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.IOS); - - assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); - HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); - - assertFalse(homePage.isIssuerSearchBarDisplayed(), "Verify if card search not present"); - assertFalse(homePage.isCardCountDisplayed(), "Verify if card count not present"); - - homePage.clickOnNextButtonForInjiTour(); - 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"); - - String uin = TestDataReader.readData("uin"); - OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - - assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - homePage.sendTextInIssuerSearchBar("valid"); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - homePage.clickOnReturnButton(); - homePage.downloadCard(); - addNewCardPage.clickOnDownloadViaUin(); - - TestDataReader.readData("uin"); - retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); - - assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); - otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - SettingsPage settingsPage=homePage.clickOnSettingIcon(); - assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); - - settingsPage.clickOnLanguage().clickOnHindiLanguage(); - assertTrue(settingsPage.verifyHindiLanguage(), "Verify if language is changed to hindi"); - - homePage.clickOnHomeButton(); - homePage.sendTextInIssuerSearchBar("Test"); - assertEquals(homePage.getTextFromVerificationStatus(), "वैध"); - - } -} +//package iosTestCases; +// +//import BaseTest.IosBaseTest; +//import inji.api.BaseTestCase; +//import inji.constants.Target; +//import inji.pages.*; +//import inji.utils.TestDataReader; +//import org.testng.annotations.Test; +//import org.testng.asserts.SoftAssert; +// +//import static org.testng.Assert.*; +//import static org.testng.Assert.assertFalse; +// +//public class VcDownloadAndVerifyUsingUinTest extends IosBaseTest { +// @Test +// public void downloadAndVerifyVcUsingUin() { +// 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// homePage.clickOnNextButtonForInjiTour(); +// assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); +// AddNewCardPage addNewCardPage = homePage.downloadCard(); +// +// assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); +// assertTrue(addNewCardPage.isIssuerDescriptionMosipDisplayed(), "Verify if issuer description mosip displayed"); +// assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); +// assertTrue(addNewCardPage.isIssuerSearchBarDisplayed(), "Verify if issuer search bar displayed"); +// addNewCardPage.sendTextInIssuerSearchBar("Download MOSIP Credentials"); +// RetrieveIdPage retrieveIdPage = addNewCardPage.clickOnDownloadViaUin(); +// +// //we will remove below line once bug is fixed https://mosip.atlassian.net/browse/INJI-712 +// addNewCardPage.clickOnDownloadViaUin(); +// +// assertTrue(retrieveIdPage.isRetrieveIdPageLoaded(), "Verify if retrieve id page is displayed"); +// assertEquals(retrieveIdPage.getRetrieveIdPageHeader(),"Download your ID"); +// assertTrue(retrieveIdPage.verifyDownloadIdPageGuideMessage(), "Verify if retrieve id page guide message is displayed"); +// String uin=TestDataReader.readData("uin"); +// OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page header is displayed"); +// assertTrue(otpVerification.verifyotpVerificationDescriptionDisplayed(), "Verify if otp verification page description is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// +// assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); +//// assertTrue(homePage.isIdTypeDisplayed(), "Verify if id type is displayed"); +// +// DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); +// detailedVcViewPage.clickOnQrCodeButton(); +// +// SoftAssert softAssert = new SoftAssert(); +// softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); +// +// detailedVcViewPage.clickOnQrCrossIcon(); +// assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); +// assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullName"), "Verify if full name is displayed"); +// assertEquals(detailedVcViewPage.getDateOfBirthInDetailedVcView(), TestDataReader.readData("dateOfBirth"), "Verify if date of birth is displayed"); +// assertEquals(detailedVcViewPage.getGenderInDetailedVcView(), TestDataReader.readData("gender"), "Verify if gender is displayed"); +// assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idType"), "Verify if id type is displayed"); +// assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); +// assertEquals(detailedVcViewPage.getUinInDetailedVcView(), uin, "Verify if uin is displayed"); +// assertEquals(detailedVcViewPage.getPhoneInDetailedVcView(), TestDataReader.readData("phoneNumber"), "Verify if phone number is displayed"); +// assertEquals(detailedVcViewPage.getEmailInDetailedVcView(), TestDataReader.readData("externalemail"), "Verify if email is displayed"); +// assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); +// } +// +// @Test +// public void downloadMultipleVcUsingDifferentUin() { +// 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// homePage.clickOnNextButtonForInjiTour(); +// 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"); +// String uin=TestDataReader.readData("uin"); +// OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// +// 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(TestDataReader.readData("uin2")).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("uin2FullName")), "Verify if second VC is displayed"); +// 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// homePage.clickOnNextButtonForInjiTour(); +// 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// homePage.clickOnNextButtonForInjiTour(); +// 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"); +// String uin = TestDataReader.readData("uin"); +// OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// +// 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(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// +// assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if second card name is displayed"); +// HistoryPage historyPage = homePage.clickOnHistoryButton(); +// +// assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); +// +// assertEquals(historyPage.getNumberOfRecordsInHistory(uin, Target.IOS),2, "Verify two download records in history page"); +// +// } +// +// @Test +// public void verifyInvalidUinErrorMessage() { +// 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// homePage.clickOnNextButtonForInjiTour(); +// 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"); +// retrieveIdPage.setEnterIdTextBox("00").clickOnGenerateCardButton(); +// +// assertTrue(retrieveIdPage.isIncorrectInputFormatErrorUinMessageDisplayed()); +// } +// +// @Test +// public void verifyOtpTimeOutAndGoBack() 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// homePage.clickOnNextButtonForInjiTour(); +// 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"); +// String uin = TestDataReader.readData("uin"); +// OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.WatingTimeForVerificationTimerComplete(); +// assertTrue(otpVerification.verifyOtpVerificationTimerDisplayedAfterClickOnResend(), "Verify if resend code is displayed"); +// +// otpVerification.clickOnCrossIcon(); +// assertTrue(otpVerification.confirmPopupHeaderDisplayed(), "Verify if comfirm popup displayed"); +// otpVerification.clickOnCancelPopupButton(); +// assertEquals(homePage.verifyLanguageForNoVCDownloadedPageLoaded(), "Bring your digital identity"); +// } +// +// @Test +// public void downloadMultipleCardsAndVerifySearch() 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// assertFalse(homePage.isIssuerSearchBarDisplayed(), "Verify if card search not present"); +// assertFalse(homePage.isCardCountDisplayed(), "Verify if card count not present"); +// +// homePage.clickOnNextButtonForInjiTour(); +// 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"); +// +// String uin = TestDataReader.readData("uin"); +// OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// +// assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); +// +// homePage.downloadCard(); +// SunbirdLoginPage sunbirdLoginPage = addNewCardPage.clickOnDownloadViaSunbird(); +// addNewCardPage.clickOnCredentialTypeHeadingInsuranceCredential(); +// +// addNewCardPage.clickOnContinueButtonInSigninPopupIos(); +// sunbirdLoginPage.enterPolicyNumberTextBox(TestDataReader.readData("policyNumberSunbird")); +// sunbirdLoginPage.enterFullNameTextBox(TestDataReader.readData("fullNameSunbird")); +// sunbirdLoginPage.enterDateOfBirthTextBox(); +// sunbirdLoginPage.clickOnloginButton(); +// +// assertTrue(sunbirdLoginPage.isSunbirdCardIsActive(), "Verify if download sunbird displayed active"); +// assertTrue(sunbirdLoginPage.isSunbirdCardLogoIsDisplayed(), "Verify if download sunbird logo displayed"); +// assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); +// +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); +// assertTrue(homePage.isCardCountDisplayed(), "Verify if card count is displayed"); +// +// homePage.sendTextInIssuerSearchBar(TestDataReader.readData("fullNameSunbird")); +// assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); +// assertTrue(homePage.isCardCountAfterSearchDisplayed(), "Verify if card count is displayed"); +// //partial search +// +// assertTrue(homePage.isIssuerSearchBarDisplayed(), "Verify if card search is displayed"); +// homePage.sendTextInIssuerSearchBar("test"); +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); +// +// //invalid +// homePage.sendTextInIssuerSearchBar("Annabelle"); +// assertTrue(homePage.isNoCardFoundTextDisplayed(), "Verify if no card found displayed"); +// +// homePage.sendTextInIssuerSearchBar(uin); +// homePage.clickOnReturnButton(); +// 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(); +// //deleted +// homePage.sendTextInIssuerSearchBar(uin); +// assertTrue(homePage.isNoCardFoundTextDisplayed(), "Verify if no card found displayed"); +// homePage.clickOnReturnButton(); +// +// SettingsPage settingsPage= homePage.clickOnSettingIcon(); +// assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); +// settingsPage.clickOnLanguage().clickOnFilipinoLanguage(); +// +// assertTrue(settingsPage.verifyFilipinoLanguage(), "Verify if language is changed to filipino"); +// homePage.clickOnHomeButton(); +// +// homePage.sendTextInIssuerSearchBar(TestDataReader.readData("fullNameSunbird")); +// assertEquals(sunbirdLoginPage.getFullNameForSunbirdCard(),TestDataReader.readData("fullNameSunbird")); +// } +// +// @Test +// public void downloadCardsAndVerifySearch() 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.IOS); +// +// assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); +// HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); +// +// assertFalse(homePage.isIssuerSearchBarDisplayed(), "Verify if card search not present"); +// assertFalse(homePage.isCardCountDisplayed(), "Verify if card count not present"); +// +// homePage.clickOnNextButtonForInjiTour(); +// 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"); +// +// String uin = TestDataReader.readData("uin"); +// OtpVerificationPage otpVerification = retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// +// assertTrue(homePage.isDownloadingVcPopupDisplayed(),"verify downloading vc popup displayed"); +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); +// +// homePage.sendTextInIssuerSearchBar("valid"); +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); +// +// homePage.clickOnReturnButton(); +// homePage.downloadCard(); +// addNewCardPage.clickOnDownloadViaUin(); +// +// TestDataReader.readData("uin"); +// retrieveIdPage.setEnterIdTextBox(uin).clickOnGenerateCardButton(); +// +// assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); +// otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); +// assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); +// +// SettingsPage settingsPage=homePage.clickOnSettingIcon(); +// assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); +// +// settingsPage.clickOnLanguage().clickOnHindiLanguage(); +// assertTrue(settingsPage.verifyHindiLanguage(), "Verify if language is changed to hindi"); +// +// homePage.clickOnHomeButton(); +// homePage.sendTextInIssuerSearchBar("Test"); +// assertEquals(homePage.getTextFromVerificationStatus(), "वैध"); +// +// } +//} diff --git a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingVidTest.java b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingVidTest.java index 71dc82d50e..ee3744d200 100644 --- a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingVidTest.java +++ b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingVidTest.java @@ -44,12 +44,13 @@ public void downloadAndVerifyVcUsingVid() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullName"), "Verify if full name is displayed"); } - + @Test public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -83,8 +84,9 @@ public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + homePage.downloadCard(); assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); @@ -96,7 +98,7 @@ public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isSecondNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); // MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -105,8 +107,8 @@ public void downloadTwoVcDeleteOneUsingVid() throws InterruptedException { assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed"); pleaseConfirmPopupPage.clickOnConfirmButton(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + } @Test @@ -140,7 +142,7 @@ public void verifyInvalidVidErrorMessage() { assertTrue(retrieveIdPage.isIncorrectInputFormatErrorVidMessageDisplayed()); } - + @Test public void downloadAndVerifyVcUsingRevokeVid() { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); diff --git a/injitest/src/test/java/iosTestCases/VerifyHistoryTest.java b/injitest/src/test/java/iosTestCases/VerifyHistoryTest.java index 0f482acdb1..8c20f31ae8 100644 --- a/injitest/src/test/java/iosTestCases/VerifyHistoryTest.java +++ b/injitest/src/test/java/iosTestCases/VerifyHistoryTest.java @@ -45,7 +45,8 @@ public void downloadVcAndVerifyHistory() { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); HistoryPage historyPage = homePage.clickOnHistoryButton(); assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed"); @@ -87,7 +88,8 @@ public void verifyActivationFailedRecordInHistory() throws InterruptedException assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -144,8 +146,9 @@ public void verifyActivationFailedRecordInHistoryFromDetailedView() throws Inter assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); PleaseConfirmPopupPage pleaseConfirmPopupPage = detailedVcViewPage.clickOnActivateButtonIos(); @@ -201,7 +204,8 @@ public void activateVcAndVerifyInHistory() throws InterruptedException { assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed"); otpVerification.enterOtp(BaseTestCase.getOtp(), Target.IOS); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed"); @@ -258,8 +262,9 @@ public void downloadAndVerifyHistoryUsingUinViaEsignet() throws InterruptedExcep otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); @@ -328,8 +333,9 @@ public void downloadAndVerifyHistoryUsingVidViaEsignet() throws InterruptedExcep otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName")); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); assertTrue(detailedVcViewPage.isActivateButtonDisplayed(), "Verify if activate vc button displayed"); @@ -450,7 +456,8 @@ public void downloadVcAndVerifyActivityLog() throws InterruptedException { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton(); diff --git a/injitest/src/test/java/iosTestCases/VerifyWelcomePagesTest.java b/injitest/src/test/java/iosTestCases/VerifyWelcomePagesTest.java index 0b1d14b670..6c8c0379d6 100644 --- a/injitest/src/test/java/iosTestCases/VerifyWelcomePagesTest.java +++ b/injitest/src/test/java/iosTestCases/VerifyWelcomePagesTest.java @@ -91,7 +91,7 @@ public void verifyWelcomePagesFromInjiTourGuide() { assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); } - + @Test public void verifyGoBackFromInjiTourGuide() { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -114,7 +114,7 @@ public void verifyGoBackFromInjiTourGuide() { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnInjiTourGuide(); @@ -153,7 +153,7 @@ public void verifyGoBackFromInjiTourGuide() { assertTrue(homePage.verifyLanguageForHelpAndFrequentlyAskedQuationsHeaderDisplayed("English"), "Verify if help and frequently asked quations header displayed"); assertTrue(homePage.verifyLanguageForHelpAndFrequentlyAskedQuationsDescriptionDisplayed("English"), "Verify if help and frequently asked quations description displayed"); } - + @Test public void verifyClickOnBackFromInjiTourGuide() { ChooseLanguagePage chooseLanguagePage = new ChooseLanguagePage(driver); @@ -176,7 +176,7 @@ public void verifyClickOnBackFromInjiTourGuide() { homePage.clickOnNextButtonForInjiTour(); assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); - + assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); settingsPage.clickOnInjiTourGuide(); @@ -224,7 +224,8 @@ public void verifyWelcomePagesFromInjiTourGuideForFirstCard() { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); @@ -270,10 +271,8 @@ public void verifyWelcomePagesFromInjiTourGuideForFirstCard() { otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); - + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); homePage.clickOnSettingIcon(); assertTrue(settingsPage.isSettingPageLoaded(), "Verify if setting page is displayed"); @@ -345,7 +344,8 @@ public void verifyWelcomePagesFromInjiTourGuideAfterDeleteTheCard() throws Inter otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); esignetLoginPage.clickOnVerifyButtonIos(); - assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed"); + addNewCardPage.clickOnDoneButton(); + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); SettingsPage settingsPage = homePage.clickOnSettingIcon(); From 0803488b6a7b8ce446939a9124df0ec58924979b Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Mon, 20 Jan 2025 09:38:13 +0530 Subject: [PATCH 10/10] INJIMOB-2722 Signed-off-by: Anup Nehe --- .../java/iosTestCases/KeyManagmentTest.java | 48 ++++++++++++ ...ownloadAndVerifyUsingMockIdentityTest.java | 76 +++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 injitest/src/test/java/iosTestCases/KeyManagmentTest.java create mode 100644 injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java diff --git a/injitest/src/test/java/iosTestCases/KeyManagmentTest.java b/injitest/src/test/java/iosTestCases/KeyManagmentTest.java new file mode 100644 index 0000000000..657ca565c4 --- /dev/null +++ b/injitest/src/test/java/iosTestCases/KeyManagmentTest.java @@ -0,0 +1,48 @@ +package iosTestCases; + +import BaseTest.IosBaseTest; +import inji.api.BaseTestCase; +import inji.constants.Target; +import inji.pages.*; +import inji.utils.IosUtil; +import inji.utils.TestDataReader; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +public class KeyManagmentTest extends IosBaseTest { + @Test + public void downloadAndVerifyVcUsingUinViaEsignet() 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.IOS); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + SettingsPage settingsPage = homePage.clickOnSettingIcon(); + + settingsPage.clickOnKeyManagement(); + Thread.sleep(3000); + KeyManagementPage keyManagementPage = new KeyManagementPage(driver); + keyManagementPage.clickOnDoneButton(); + Thread.sleep(3000); + + IosUtil.dragAndDropForIos(driver,keyManagementPage.getTheCoordinatesForRSA(),keyManagementPage.getTheCoordinatesED25519Text()); + keyManagementPage.clickOnSaveKeyOrderingPreferenceButton(); + } +} \ No newline at end of file diff --git a/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java new file mode 100644 index 0000000000..095628d8a6 --- /dev/null +++ b/injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingMockIdentityTest.java @@ -0,0 +1,76 @@ +package iosTestCases; + +import BaseTest.IosBaseTest; +import inji.api.BaseTestCase; +import inji.constants.Target; +import inji.pages.*; +import inji.utils.TestDataReader; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +public class VcDownloadAndVerifyUsingMockIdentityTest extends IosBaseTest { + @Test + public void downloadAndVerifyVcUsingUinViaEsignet() 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.IOS); + + assertTrue(confirmPasscode.isConfirmPassCodePageLoaded(), "Verify if confirm passcode page is displayed"); + HomePage homePage = confirmPasscode.enterPasscodeInConfirmPasscodePage(TestDataReader.readData("passcode"), Target.IOS); + + homePage.clickOnNextButtonForInjiTour(); + assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed"); + AddNewCardPage addNewCardPage = homePage.downloadCard(); + + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + assertTrue(addNewCardPage.isIssuerDescriptionEsignetDisplayed(), "Verify if issuer description esignet displayed"); + assertTrue(addNewCardPage.isIssuerSearchBarDisplayed(), "Verify if issuer search bar displayed"); +// addNewCardPage.sendTextInIssuerSearchBar("Download MOSIP Credentials"); + assertTrue(addNewCardPage.isAddNewCardPageLoaded(), "Verify if add new card page is displayed"); + assertTrue(addNewCardPage.isAddNewCardPageGuideMessageForEsignetDisplayed(), "Verify if add new card guide message displayed"); + assertTrue(addNewCardPage.isDownloadViaEsignetDisplayed(), "Verify if download via uin displayed"); + MockCertifyLoginPage mockCertifyLoginPage = addNewCardPage.clickOnDownloadViaMockCertify(); + + addNewCardPage.clickOnContinueButtonInSigninPopupIos(); + + Thread.sleep(9000); + OtpVerificationPage otpVerification= mockCertifyLoginPage.setEnterIdTextBox(TestDataReader.readData("MockVc")); + + mockCertifyLoginPage.clickOnGetOtpButton(); +// assertTrue(mockCertifyLoginPage.isOtpHasSendMessageDisplayed(),"verify if otp page is displayed"); + + otpVerification.enterOtpForEsignet(BaseTestCase.getOtp(), Target.IOS); + mockCertifyLoginPage.clickOnVerifyButtonIos(); + + assertTrue(homePage.isCredentialTypeValueDisplayed(), "Verify if credential type value is displayed"); + DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(); + + detailedVcViewPage.clickOnQrCodeButton(); + SoftAssert softAssert = new SoftAssert(); + softAssert.assertTrue(detailedVcViewPage.isQrCodeDisplayed(), "Verify if QR Code header is displayed"); + + detailedVcViewPage.clickOnQrCrossIcon(); + assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed"); +// assertEquals(detailedVcViewPage.getNameInDetailedVcView(), TestDataReader.readData("fullNameForMobileDrivingLicense"), "Verify if full name is displayed"); +// assertEquals(detailedVcViewPage.getDateOfBirthInDetailedVcView(), TestDataReader.readData("dateOfBirthForMobileDrivingLicense"), "Verify if date of birth is displayed"); + assertEquals(detailedVcViewPage.getIdTypeValueInDetailedVcView(), TestDataReader.readData("idTypeForMobileDrivingLicense"), "Verify if id type is displayed"); + assertEquals(detailedVcViewPage.getStatusInDetailedVcView(), TestDataReader.readData("status"), "Verify if status is displayed"); +// assertTrue(detailedVcViewPage.isKeyTypeVcDetailViewValueDisplayed(), "Verify if key type detailed Vc value displayed"); + detailedVcViewPage.clickOnBackArrow(); + assertTrue(detailedVcViewPage.isEsignetLogoDisplayed(), "Verify if detailed Vc esignet logo is displayed"); + } +} \ No newline at end of file