Files
inji-wallet/injitest/src/test/java/androidTestCases/ActivateVcTest.java
anup-nehe e580e24f7a stabilized for sprint 28 and added testcases for esignet multi language support (#1465)
* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflict

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflict

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* incorprated changes

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* INJIMOB-924 MOSIP-31927

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31874

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conlifcts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* updating to unblock deveops

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-32267 MOSIP-32204

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-32204

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-32580

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-32580 MOSIP-32641

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-32580

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-32641

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* reslove conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* reslove conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* Update MoreOptionsPage.java

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* changes for sprint 27

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* INJIMOB-1406 INJIMOB-1407

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* androidConfig And IosConfig changes

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

---------

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>
Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>
2024-05-29 16:49:09 +05:30

314 lines
19 KiB
Java

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 ActivateVcTest extends AndroidBaseTest {
@Test
public void activateVc() 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);
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.ANDROID);
assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed");
MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton();
assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed");
PleaseConfirmPopupPage pleaseConfirmPopupPage = moreOptionsPage.clickOnActivationPending();
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("passcode"), Target.ANDROID);
assertTrue(moreOptionsPage.isVcActivatedForOnlineLogin(), "Verify if VC is activated");
}
@Test
public void noPreDownloadedVCAndNoHistoryInFreshInstallation() {
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);
assertTrue(homePage.isHomePageLoaded(), "Verify if home page is displayed");
assertEquals(homePage.verifyLanguageForNoVCDownloadedPageLoaded(), "Bring your digital identity");
HistoryPage historyPage = homePage.clickOnHistoryButton();
assertTrue(historyPage.isHistoryPageLoaded(), "Verify if history page is displayed");
assertTrue(historyPage.noHistoryAvailable());
}
@Test
public void verifyInvalidOtpMessage() {
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);
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(TestDataReader.readData("invalidOtp"), Target.ANDROID);
assertTrue(otpVerification.invalidOtpMessageDisplayed(), "Verify if OTP is invalid message is displayed");
}
@Test
public void activateVcFromDetailedViewPage() 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);
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.ANDROID);
assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed");
DetailedVcViewPage detailedVcViewPage = homePage.openDetailedVcView(TestDataReader.readData("fullName"));
assertTrue(detailedVcViewPage.isDetailedVcViewPageLoaded(), "Verify if detailed Vc view page is displayed");
// detailedVcViewPage.clickOnMoreOptionsInDetails();
MoreOptionsPage moreOptionsPage = new MoreOptionsPage(driver);
moreOptionsPage.clickOnActivationButton();
PleaseConfirmPopupPage pleaseConfirmPopupPage = new PleaseConfirmPopupPage(driver);
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("passcode"), Target.ANDROID);
assertTrue(detailedVcViewPage.isProfileAuthenticatedDisplayed(), "Verify if VC is activated");
}
@Test
public void verifyActiveVcAndWaitForOtpTimeOut() 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);
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.ANDROID);
assertTrue(homePage.isNameDisplayed(TestDataReader.readData("fullName")), "Verify if full name is displayed");
MoreOptionsPage moreOptionsPage = homePage.clickOnMoreOptionsButton();
assertTrue(moreOptionsPage.isMoreOptionsPageLoaded(), "Verify if more options page is displayed");
PleaseConfirmPopupPage pleaseConfirmPopupPage = moreOptionsPage.clickOnActivationPending();
assertTrue(pleaseConfirmPopupPage.isPleaseConfirmPopupPageLoaded(), "Verify if pop up page is displayed");
OtpVerificationPage otpVerificationPage = pleaseConfirmPopupPage.clickOnConfirmButton();
assertTrue(otpVerification.isOtpVerificationPageLoaded(), "Verify if otp verification page is displayed");
assertTrue(otpVerification.verifyotpVerificationDescriptionDisplayed(), "Verify if otp verification description displayed");
otpVerification.WatingTimeForVerificationTimerComplete();
assertTrue(otpVerification.verifyResendCodeButtonDisplayedEnabled(), "Verify if resend code is enabled");
otpVerification.clickOnResendButton();
otpVerification.clickOnResendButton();
assertTrue(otpVerification.verifyOtpVerificationTimerDisplayedAfterClickOnResend(), "verify is You can resend the code displayed again after click on resend button ");
}
@Test
public void downloadAndActiveVcUsingUinViaEsignet() 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);
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");
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(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"));
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("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("statusForEsignet"), "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");
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");
}
}