diff --git a/inji-web-test/src/main/java/pages/HomePage.java b/inji-web-test/src/main/java/pages/HomePage.java index ad9e1332..cbe876ff 100644 --- a/inji-web-test/src/main/java/pages/HomePage.java +++ b/inji-web-test/src/main/java/pages/HomePage.java @@ -23,8 +23,11 @@ public HomePage(WebDriver driver) { } public void clickOnHelp() { - if (isElementIsVisible(driver, By.xpath("//div[@data-testid='Header-Menu-Help']"))) { - clickOnElement(driver, By.xpath("//div[@data-testid='Header-Menu-Help']")); + if (isElementIsVisible(driver, By.xpath("//*[@data-testid='Header-Menu-Help']"))) { + clickOnElement(driver, By.xpath("(//*[@data-testid='Header-Menu-Help'])[1]")); + clickOnElement(driver, By.xpath("//*[@data-testid='Help-DropDown-Item']")); + + } else { clickOnElement(driver, By.xpath("//li[@data-testid='Header-Menu-Help']")); } @@ -81,13 +84,17 @@ public String isPageTitleDisplayed() { } public String isHomePageTextDisplayed() { - return getElementText(driver, By.xpath("//h2[@data-testid='IntroBox-Text']")); + return getElementText(driver, By.xpath("//h2[@data-testid='IntroBox-Text']")); } - public String isHomePageDescriptionTextDisplayed() { + public String getHomePageDescriptionText() { return getElementText(driver, By.xpath("//p[@data-testid='IntroBox-SubText']")); } + public boolean isHomePageDescriptionTextDisplayed() { + return isElementIsVisible(driver, By.xpath("//p[@data-testid='IntroBox-SubText']")); + } + public void clickOnDownloadMosipCredentials() { clickOnElement(driver, By.xpath("(//h3[@data-testid='ItemBox-Text'])[1]")); } @@ -150,7 +157,7 @@ public Boolean isGoHomeButtonDisplayed() { // TODO Auto-generated catch block e.printStackTrace(); } - return isElementIsVisible(driver, By.xpath("//button[text()='Go To Home']")); + return isElementIsVisible(driver, By.xpath("//*[text()='Go To Home']")); } public Boolean isBackButtonDisplayed() { @@ -178,7 +185,7 @@ public void clickOnLanguageButton() { } public boolean verifyLanguagesInLanguageFilter() { - List expectedLanguages = Arrays.asList("English", "தமிழ்", "ಕನ್ನಡ", "हिंदी", "Français", "عربي"); + List expectedLanguages = Arrays.asList("English", "தமிழ்", "ಕನ್ನಡ", "हिंदी", "Français", "عربي","Português"); List actualLanguages = null; try { actualLanguages = getElementTexts(driver, By.xpath("//ul[@class='py-1 divide-y divide-gray-200']//li")); @@ -269,10 +276,186 @@ public String isListOfIssuersTextDisplayed() { } public String isListOfIssuersDescriptionTextDisplayed() { - return getElementText(driver, By.xpath("(//*[@data-testid='HeaderTile-Text'])[2]")); + return getElementText(driver, By.xpath("//*[@data-testid='HeaderTile-Text-SubContent']")); } public boolean isAboutPageDisplayed() { return isElementIsVisible(driver, By.xpath("//p[text()='Overview']")); } + + + public boolean isHomeBannerHeadingDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeBanner-Heading']")); + } + + public boolean isHomeBannerHeadingDescriptionDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeBanner-Description']")); + } + + public boolean isGetStartedButtonDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeBanner-Get-Started']")); + } + + public boolean isFeatureHeadingDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatures-Heading']")); + } + + public boolean isFeatureDescriptionDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatures-Description1']")); + } + + public boolean isFeatureMobileImageDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatures-MobileImage']")); + } + + public boolean isFeatureDesktopImageDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatures-DesktopImage']")); + } + + public boolean isAccessYourCredentialsTextHeaderDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem2-Heading']")); + } + + public boolean isYourDocumentsDownloadedTextHeaderDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem2-Heading']")); + } + + public boolean isEasySharingTextHeaderDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem3-Heading']")); + } + + public boolean isSecureAndPrivateDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem4-Heading']")); + } + + public boolean isWiderAccessAndCompatibilityDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem5-Heading']")); + } + + + + public boolean isCredentialsSimplifiedTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem1-FirstFeature-Item']")); + } + + public boolean isNoMorePaperworkTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem1-SecondFeature-Item']")); + } + public boolean isDownloadWithConfidenceTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem2-FirstFeature-Item']")); + } + + public boolean isSafeAndSoundTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem2-SecondFeature-Item']")); + } + + public boolean isShareWithQRCodeTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem3-FirstFeature-Item']")); + } + + public boolean isReadSetShareTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem3-SecondFeature-Item']")); + } + + public boolean isYourCredentialsProtectedTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem4-FirstFeature-Item']")); + } + + public boolean isRestEasyTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem4-SecondFeature-Item']")); + } + + public boolean isAvailableOnYourFavouriteBrowserTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem5-FirstFeature-Item']")); + } + + public boolean isAlwaysWithinReachTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem5-SecondFeature-Item']")); + } + + public void clickOnGetStartedButton() { + clickOnElement(driver, By.xpath("//*[@data-testid='HomeBanner-Get-Started']")); + } + + + + public boolean isCredentialsSimplifiedDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem1-FirstFeature-Description']")); + } + + public boolean isNomorePaperworkDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem1-SecondFeature-Description']")); + } + + public boolean isDownloadwithConfidenceDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem2-FirstFeature-Description']")); + } + + public boolean isSafeAndSoundDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem2-SecondFeature-Description']")); + } + + public boolean isSharewithQRCodeDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem3-FirstFeature-Description']")); + } + + public boolean isReadSetShareDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem3-SecondFeature-Description']")); + } + + public boolean isYourCredentialsProtectedDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem4-FirstFeature-Description']")); + } + + public boolean isRestEasyDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem4-SecondFeature-Description']")); + } + + public boolean isAvailableOnYourFavouriteBrowserDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem5-FirstFeature-Description']")); + } + + public boolean isAlwaysWithinReachDescriptionTextDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem5-SecondFeature-Description']")); + } + + + public void clickOnConsentValidityButton() { + clickOnElement(driver, By.xpath("//*[@data-testid='DataShareContent-Selected-Validity-Times']")); + } + + public void clickOnConsentValidityAsCustom() { + clickOnElement(driver, By.xpath("//*[@data-testid='DataShareContent-Validity-Times-DropDown-Custom']")); + } + public void enterConsentValidityAsCustom(String string) { + enterText(driver, By.xpath("//*[@data-testid='CustomExpiryTimesContent-Times-Value']"), string); + } + + public void clickOnProccedCustomButton() { + clickOnElement(driver, By.xpath("(//*[@data-testid='DataShareFooter-Success-Button'])[2]")); + } + public void clickOnProccedConsentButton() { + clickOnElement(driver, By.xpath("(//*[@data-testid='DataShareFooter-Success-Button'])[1]")); + } + public boolean isAccessYourCredentialsImageDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem1-Image']")); + } + + public boolean isYourDocumentsDownloadedImageDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem2-Image']")); + } + + public boolean isEasySharingImageDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem3-Image']")); + } + + public boolean isSecureAndPrivateImageDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem4-Image']")); + } + + public boolean isWiderAccessAndCompatibilityImageDisplayed(){ + return isElementIsVisible(driver, By.xpath("//*[@data-testid='HomeFeatureItem5-Image']")); + } + + } diff --git a/inji-web-test/src/main/java/pages/SunbirdCredentials.java b/inji-web-test/src/main/java/pages/SunbirdCredentials.java index 06ba9ff2..9b32e8e7 100644 --- a/inji-web-test/src/main/java/pages/SunbirdCredentials.java +++ b/inji-web-test/src/main/java/pages/SunbirdCredentials.java @@ -29,12 +29,12 @@ public Boolean isSunbirdInsuranceDisplayed() { // TODO Auto-generated catch block e.printStackTrace(); } - return isElementIsVisible(driver, By.xpath("(//div[@class='justify-center items-center'])[1]")); + return isElementIsVisible(driver, By.xpath("//*[@data-testid='ItemBox-Outer-Container-0']")); } public void clickOnSunbirdInsurance() { - clickOnElement(driver, By.xpath("(//div[@class='justify-center items-center'])[1]")); + clickOnElement(driver, By.xpath("//*[@data-testid='ItemBox-Outer-Container-0']")); } public void clickOnDownloadSunbird() { @@ -96,11 +96,11 @@ public void clickOnLogin() { } public Boolean isLifeInceranceDisplayed() { - return isElementIsVisible(driver, By.xpath("(//div[@class='justify-center items-center'])[2]")); + return isElementIsVisible(driver, By.xpath("//*[@data-testid='ItemBox-Outer-Container-1']")); } public void clickOnLifeInsurance() { - clickOnElement(driver, By.xpath("(//div[@class='justify-center items-center'])[2]")); + clickOnElement(driver, By.xpath("//*[@data-testid='ItemBox-Outer-Container-1']")); } public Boolean isEnterPolicyNumberHeaderDisplayed() { @@ -126,11 +126,11 @@ public Boolean isVehicleInsuranceDisplayed() { // TODO Auto-generated catch block e.printStackTrace(); } - return isElementIsVisible(driver, By.xpath("(//div[@class='justify-center items-center'])[2]")); + return isElementIsVisible(driver, By.xpath("//*[@data-testid='ItemBox-Outer-Container-1']")); } public void clickOnVehicleInsurance() { - clickOnElement(driver, By.xpath("(//div[@class='justify-center items-center'])[2]")); + clickOnElement(driver, By.xpath("//*[@data-testid='ItemBox-Outer-Container-1']")); } } diff --git a/inji-web-test/src/test/java/stepdefinitions/StepDef.java b/inji-web-test/src/test/java/stepdefinitions/StepDef.java index 4eb0fc3f..cb1a2917 100644 --- a/inji-web-test/src/test/java/stepdefinitions/StepDef.java +++ b/inji-web-test/src/test/java/stepdefinitions/StepDef.java @@ -20,11 +20,10 @@ public class StepDef { String pageTitle; public WebDriver driver; BaseTest baseTest; - private GlobelConstants globelConstants; private HomePage homePage; private HelpPage helpPage; private SetNetwork setNetwork; - + private GlobelConstants globelConstants; public StepDef(BaseTest baseTest) { this.baseTest = baseTest; this.homePage = new HomePage(baseTest.getDriver()); @@ -152,9 +151,9 @@ public void user_click_on_arabic_langauge() { @Then("User verify home screens in arabic") public void user_verify_home_screens_in_arabic() { Assert.assertEquals(homePage.isHomePageTextDisplayed(), globelConstants.HomePageTextInArabic); - Assert.assertEquals(homePage.isHomePageDescriptionTextDisplayed(), globelConstants.isHomePageDescriptionTextnArabic); -// Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInArabic); -// Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInArabic); + Assert.assertEquals(homePage.getHomePageDescriptionText(), globelConstants.isHomePageDescriptionTextnArabic); + Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInArabic); + Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInArabic); } @Then("User click on tamil langauge") @@ -165,9 +164,9 @@ public void user_click_on_tamil_langauge() { @Then("User verify home screens in tamil") public void user_verify_home_screens_in_tamil() { Assert.assertEquals(homePage.isHomePageTextDisplayed(), globelConstants.HomePageTextInTamil); - Assert.assertEquals(homePage.isHomePageDescriptionTextDisplayed(), globelConstants.isHomePageDescriptionTextnTamil); -// Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInTamil); -// Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInTamil); + Assert.assertEquals(homePage.getHomePageDescriptionText(), globelConstants.isHomePageDescriptionTextnTamil); + Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInTamil); + Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInTamil); } @Then("User click on kannada langauge") @@ -178,9 +177,9 @@ public void user_click_on_kannada_langauge() { @Then("User verify home screens in kannada") public void user_verify_home_screens_in_kannada() { Assert.assertEquals(homePage.isHomePageTextDisplayed(), globelConstants.HomePageTextInKannada); - Assert.assertEquals(homePage.isHomePageDescriptionTextDisplayed(), globelConstants.HomePageDescriptionTextInKannada); -// Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInKannada); -// Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInKannada); + Assert.assertTrue(homePage.isHomePageDescriptionTextDisplayed()); + Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInKannada); + Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInKannada); } @Then("User click on hindi langauge") @@ -191,9 +190,9 @@ public void user_click_on_hindi_langauge() { @Then("User verify home screens in hindi") public void user_verify_home_screens_in_hindi() { Assert.assertEquals(homePage.isHomePageTextDisplayed(), globelConstants.HomePageTextInHindi); - Assert.assertEquals(homePage.isHomePageDescriptionTextDisplayed(),globelConstants.HomePageDescriptionTextInHindi); -// Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInHindi); -// Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInHindi); + Assert.assertEquals(homePage.getHomePageDescriptionText(),globelConstants.HomePageDescriptionTextInHindi); + Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInHindi); + Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInHindi); } @Then("User click on french langauge") @@ -203,12 +202,10 @@ public void user_click_on_french_langauge() { @Then("User verify home screens in french") public void user_verify_home_screens_in_french() { - System.out.println(homePage.isHomePageTextDisplayed()); - System.out.println(homePage.isHomePageDescriptionTextDisplayed()); Assert.assertEquals(homePage.isHomePageTextDisplayed(), globelConstants.HomePageTextInFrench); - Assert.assertEquals(homePage.isHomePageDescriptionTextDisplayed(), globelConstants.HomePageDescriptionTextInFrench); -// Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInFrench); -// Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInFrench); + Assert.assertEquals(homePage.getHomePageDescriptionText(), globelConstants.HomePageDescriptionTextInFrench); + Assert.assertEquals(homePage.isListOfIssuersTextDisplayed(), globelConstants.ListOfCredentialTypeOnHomePageInFrench); + Assert.assertEquals(homePage.isListOfIssuersDescriptionTextDisplayed(), globelConstants.ListOfCredentialDescriptionTextInFrench); } @Then("User validate the list of credential types title of the page") @@ -330,7 +327,7 @@ public void user_verify_the_only_one_faq_is_open() { public void user_verify_the_only_one_faq_is_at_a_time() { helpPage.ClickOnDownArrow(); Assert.assertEquals(helpPage.getUpArrowCount(),1); - Assert.assertEquals(helpPage.getDownArrowCount(),6); + Assert.assertEquals(helpPage.getDownArrowCount(),22); } @Then("User verify that help button displayed") @@ -369,4 +366,100 @@ public void user_verify_click_on_about_inji_page() { public void user_verify_the_logo_of_the_issuer() { homePage.isIssuerLogoDisplayed(); } + + + @Then("User verify that home banner heading") + public void user_verify_that_home_banner_heading() { + homePage.isHomeBannerHeadingDisplayed(); + } + @Then("User verify that home banner description") + public void user_verify_that_home_banner_description() { + homePage.isHomeBannerHeadingDescriptionDisplayed(); + } + @Then("User verify that home banner get started") + public void user_verify_that_home_banner_get_started() { + homePage.isGetStartedButtonDisplayed(); + } + @Then("User verify that home features heading") + public void user_verify_that_home_features_heading() { + homePage.isFeatureHeadingDisplayed(); + } + @Then("User verify that home features description1") + public void user_verify_that_home_features_description1() { + homePage.isFeatureDescriptionDisplayed(); + } + @Then("User verify that home features mobile image") + public void user_verify_that_home_features_mobile_image() { + homePage.isFeatureMobileImageDisplayed(); + } + @Then("User verify that home features desktop image") + public void user_verify_that_home_features_desktop_image() { + homePage.isFeatureDesktopImageDisplayed(); + } + @Then("User verify that home feature item image") + public void user_verify_that_home_feature_item_image() { + Assert.assertTrue(homePage.isAccessYourCredentialsImageDisplayed()); + Assert.assertTrue(homePage.isYourDocumentsDownloadedImageDisplayed()); + Assert.assertTrue(homePage.isEasySharingImageDisplayed()); + Assert.assertTrue(homePage.isSecureAndPrivateImageDisplayed()); + Assert.assertTrue(homePage.isWiderAccessAndCompatibilityImageDisplayed()); + } + @Then("User verify that home feature Heading") + public void user_verify_that_home_feature_item_heading() { + + Assert.assertTrue(homePage.isAccessYourCredentialsTextHeaderDisplayed()); + Assert.assertTrue(homePage.isYourDocumentsDownloadedTextHeaderDisplayed()); + Assert.assertTrue(homePage.isEasySharingTextHeaderDisplayed()); + Assert.assertTrue(homePage.isSecureAndPrivateDisplayed()); + Assert.assertTrue(homePage.isWiderAccessAndCompatibilityDisplayed()); + } + @Then("User verify that home feature item header for all") + public void user_verify_that_home_feature_first_item() { + Assert.assertTrue(homePage.isCredentialsSimplifiedTextDisplayed()); + Assert.assertTrue(homePage.isNoMorePaperworkTextDisplayed()); + Assert.assertTrue(homePage.isDownloadWithConfidenceTextDisplayed()); + Assert.assertTrue(homePage.isSafeAndSoundTextDisplayed()); + Assert.assertTrue(homePage.isShareWithQRCodeTextDisplayed()); + Assert.assertTrue(homePage.isReadSetShareTextDisplayed()); + Assert.assertTrue(homePage.isYourCredentialsProtectedTextDisplayed()); + Assert.assertTrue(homePage.isRestEasyTextDisplayed()); + Assert.assertTrue(homePage.isAvailableOnYourFavouriteBrowserTextDisplayed()); + Assert.assertTrue(homePage.isAlwaysWithinReachTextDisplayed()); + } + @Then("User verify that home feature feature description") + public void user_verify_that_home_feature_first_feature_description() { + Assert.assertTrue(homePage.isCredentialsSimplifiedDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isNomorePaperworkDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isDownloadwithConfidenceDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isSafeAndSoundDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isSharewithQRCodeDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isReadSetShareDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isYourCredentialsProtectedDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isRestEasyDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isAvailableOnYourFavouriteBrowserDescriptionTextDisplayed()); + Assert.assertTrue(homePage.isAlwaysWithinReachDescriptionTextDisplayed()); + } + + @Then("User click on get started button") + public void user_click_on_get_started_button() { + homePage.clickOnGetStartedButton(); + } + + @Then("User click on data share content validity") + public void user_click_on_data_share_content_validity() { + homePage.clickOnConsentValidityButton(); + } + @Then("User click on select custom validity button") + public void user_click_on_select_custom_validity_button() { + homePage.clickOnConsentValidityAsCustom(); + } + @Then("user enter validity for data share content {string}") + public void user_enter_validity_for_data_share_content(String string) { + homePage.enterConsentValidityAsCustom(string); + } + @Then("Use click on procced button") + public void use_click_on_procced_button() { + homePage.clickOnProccedCustomButton(); + homePage.clickOnProccedConsentButton(); + } } \ No newline at end of file diff --git a/inji-web-test/src/test/java/stepdefinitions/StepDefMosipCredentials.java b/inji-web-test/src/test/java/stepdefinitions/StepDefMosipCredentials.java index aaae3b85..1204d433 100644 --- a/inji-web-test/src/test/java/stepdefinitions/StepDefMosipCredentials.java +++ b/inji-web-test/src/test/java/stepdefinitions/StepDefMosipCredentials.java @@ -24,7 +24,7 @@ public class StepDefMosipCredentials { public WebDriver driver; BaseTest baseTest; private GlobelConstants globelConstants; - // private IssuersPage homePage; + // private HomePage homePage; // private HelpPage helpPage; private MosipCredentials mosipCredentials; // private SunbirdCredentials sunbirdCredentials; @@ -107,4 +107,4 @@ public void user_VerifyDownloadingInProgressDisplaed() { Assert.assertTrue(mosipCredentials.isDownloadingDescriptionTextDisplayed()); } -} +} \ No newline at end of file diff --git a/inji-web-test/src/test/java/stepdefinitions/StepDefSunbirdCredentials.java b/inji-web-test/src/test/java/stepdefinitions/StepDefSunbirdCredentials.java index 8acbb9d1..622ea2af 100644 --- a/inji-web-test/src/test/java/stepdefinitions/StepDefSunbirdCredentials.java +++ b/inji-web-test/src/test/java/stepdefinitions/StepDefSunbirdCredentials.java @@ -89,18 +89,18 @@ public void click_on_sunbird_cridentials_button() { @Then("User verify pdf is downloaded for Insurance") public String user_verify_pdf_is_downloaded_for_insurance() throws IOException { - baseTest.getJse().executeScript("browserstack_executor: {\"action\": \"fileExists\", \"arguments\": {\"fileName\": \"" + baseTest.PdfNameForInsurance + "\"}}"); - baseTest.getJse().executeScript("browserstack_executor: {\"action\": \"getFileProperties\", \"arguments\": {\"fileName\": \"" + baseTest.PdfNameForInsurance + "\"}}"); + baseTest.getJse().executeScript("browserstack_executor: {\"action\": \"fileExists\", \"arguments\": {\"fileName\": \"" + baseTest.PdfNameForLifeInsurance + "\"}}"); + baseTest.getJse().executeScript("browserstack_executor: {\"action\": \"getFileProperties\", \"arguments\": {\"fileName\": \"" + baseTest.PdfNameForLifeInsurance + "\"}}"); - String base64EncodedFile = (String) baseTest.getJse().executeScript("browserstack_executor: {\"action\": \"getFileContent\", \"arguments\": {\"fileName\": \"" + baseTest.PdfNameForInsurance + "\"}}"); + String base64EncodedFile = (String) baseTest.getJse().executeScript("browserstack_executor: {\"action\": \"getFileContent\", \"arguments\": {\"fileName\": \"" + baseTest.PdfNameForLifeInsurance + "\"}}"); byte[] data = Base64.getDecoder().decode(base64EncodedFile); - OutputStream stream = new FileOutputStream(baseTest.PdfNameForInsurance); + OutputStream stream = new FileOutputStream(baseTest.PdfNameForLifeInsurance); stream.write(data); System.out.println(stream); stream.close(); - File pdfFile = new File(System.getProperty("user.dir") + "/" + baseTest.PdfNameForInsurance); + File pdfFile = new File(System.getProperty("user.dir") + "/" + baseTest.PdfNameForLifeInsurance); PDDocument document = PDDocument.load(pdfFile); PDFTextStripper stripper = new PDFTextStripper(); diff --git a/inji-web-test/src/test/java/utils/BaseTest.java b/inji-web-test/src/test/java/utils/BaseTest.java index e8d10d34..bde92505 100644 --- a/inji-web-test/src/test/java/utils/BaseTest.java +++ b/inji-web-test/src/test/java/utils/BaseTest.java @@ -28,6 +28,7 @@ public void setDriver(WebDriver driver) { public JavascriptExecutor jse; public String PdfNameForMosip="MosipVerifiableCredential.pdf"; public String PdfNameForInsurance="InsuranceCredential.pdf"; + public String PdfNameForLifeInsurance="InsuranceCredential.pdf"; String accessKey = getKeyValueFromYaml("/browserstack.yml","accessKey"); String userName = getKeyValueFromYaml("/browserstack.yml","userName"); diff --git a/inji-web-test/src/test/java/utils/GlobelConstants.java b/inji-web-test/src/test/java/utils/GlobelConstants.java index 0a5912e1..0244076d 100644 --- a/inji-web-test/src/test/java/utils/GlobelConstants.java +++ b/inji-web-test/src/test/java/utils/GlobelConstants.java @@ -1,17 +1,16 @@ package utils; public class GlobelConstants { - public static final String HomePageTextInArabic = "تنزيل بيانات الاعتماد هو بنقرة واحدة!"; - public static final String isHomePageDescriptionTextnArabic = "يرجى البحث عن جهة الإصدار وفي الخطوة التالية، حدد بيانات الاعتماد للتنزيل."; - public static final String HomePageTextInTamil = "நற்சான்றிதழைப் பதிவிறக்குவது ஒரே கிளிக்கில் உள்ளது!"; - public static final String isHomePageDescriptionTextnTamil= "வழங்குபவரைத் தேடி, அடுத்த கட்டத்தில், பதிவிறக்குவதற்கான நற்சான்றிதழைத் தேர்ந்தெடுக்கவும்."; - public static final String HomePageTextInKannada ="ರುಜುವಾತುಗಳನ್ನು ಡೌನ್‌ಲೋಡ್ ಮಾಡುವುದು ಒಂದು ಕ್ಲಿಕ್ ದೂರದಲ್ಲಿದೆ!"; - public static final String HomePageDescriptionTextInKannada = "ದಯವಿಟ್ಟು ನೀಡುವವರಿಗಾಗಿ ಹುಡುಕಿ ಮತ್ತು ಮುಂದಿನ ಹಂತದಲ್ಲಿ, ಡೌನ್‌ಲೋಡ್ ಮಾಡಲು ರುಜುವಾತುಗಳನ್ನು ಆಯ್ಕೆಮಾಡಿ."; - public static final String HomePageTextInHindi= "क्रेडेंशियल डाउनलोड करना एक-क्लिक दूर है!"; - public static final String HomePageDescriptionTextInHindi = "कृपया जारीकर्ता को खोजें और अगले चरण में, डाउनलोड करने के लिए क्रेडेंशियल चुनें।"; - public static final String HomePageTextInFrench="Le téléchargement d'un identifiant se fait en un seul clic !"; - public static final String HomePageDescriptionTextInFrench ="Veuillez rechercher l'émetteur et, à l'étape suivante, sélectionnez les informations d'identification à télécharger."; - + public static final String HomePageTextInArabic = "الوصول إلى بيانات الاعتماد الخاصة بك التي يمكن التحقق منها بكل سهولة! with ease!"; + public static final String isHomePageDescriptionTextnArabic = "قم بتنزيل بيانات الاعتماد الخاصة بك ومشاركتها بشكل آمن على الفور."; + public static final String HomePageTextInTamil = "உங்கள் சரிபார்க்கக்கூடிய சான்றுகளை எளிதாக அணுகவும்! with ease!"; + public static final String isHomePageDescriptionTextnTamil= "உங்கள் நற்சான்றிதழ்களை உடனடியாகப் பாதுகாப்பாக பதிவிறக்கம் செய்து பகிரவும்."; + public static final String HomePageTextInKannada ="ನಿಮ್ಮ ಪರಿಶೀಲಿಸಬಹುದಾದ ರುಜುವಾತುಗಳನ್ನು ಸುಲಭವಾಗಿ ಪ್ರವೇಶಿಸಿ! with ease!"; + public static final String HomePageDescriptionTextInKannada = "ನಿಮ್ಮ ರುಜುವಾತುಗಳನ್ನು ಸುರಕ್ಷಿತವಾಗಿ ಡೌನ್\u200Cಲೋಡ್ ಮಾಡಿ ಮತ್ತು ತಕ್ಷಣವೇ ಹಂಚಿಕೊಳ್ಳಿ."; + public static final String HomePageTextInHindi= "अपने सत्यापन योग्य क्रेडेंशियल्स तक आसानी से पहुंचें! with ease!"; + public static final String HomePageDescriptionTextInHindi = "अपने क्रेडेंशियल्स को सुरक्षित रूप से डाउनलोड करें और तुरंत साझा करें।"; + public static final String HomePageTextInFrench="Accédez facilement à vos informations d'identification vérifiables ! with ease!"; + public static final String HomePageDescriptionTextInFrench ="Téléchargez et partagez en toute sécurité vos informations d'identification instantanément."; public static final String ListOfCredentialType ="List of Credential Types"; public static final String ListOfCredentialTypeInArabic ="قائمة أنواع الاعتمادات"; public static final String ListOfCredentialTypeInHindi= "क्रेडेंशियल प्रकारों की सूची"; diff --git a/inji-web-test/src/test/resources/featurefiles/downloadMosipCredentials.feature b/inji-web-test/src/test/resources/featurefiles/downloadMosipCredentials.feature index c351b079..78a85a9b 100644 --- a/inji-web-test/src/test/resources/featurefiles/downloadMosipCredentials.feature +++ b/inji-web-test/src/test/resources/featurefiles/downloadMosipCredentials.feature @@ -4,11 +4,16 @@ Feature: download mosip cridentials Scenario Outline: Mosip Natonal Id by e-Signet Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "National" When User click on download mosip credentials button Then User verify list of credential types displayed And User verify mosip national id by e-signet displayed When User click on mosip national id by e-signet button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User verify login page lables And User verify vid input box header And User enter the "" @@ -21,14 +26,15 @@ Feature: download mosip cridentials And User verify go back button Examples: - | vid | otp | - | 4391082978460254 | 111111 | + | vid | otp | Vailidty | + | 4391082978460254 | 111111 | 3 | @smoke @VerifySearchWithInvalidString Scenario: Mosip Natonal Id by e-Signet Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "qewqdda" And User Verify the no issuer found message And User search the issuers with "National" @@ -39,6 +45,7 @@ Feature: download mosip cridentials Scenario Outline: Mosip Natonal Id by e-Signet Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "National" And User verify the logo of the issuer When User click on download mosip credentials button @@ -46,6 +53,10 @@ Feature: download mosip cridentials Then User verify list of credential types displayed And User verify mosip national id by e-signet displayed When User click on mosip national id by e-signet button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User verify login page lables And User verify vid input box header And User enter the "" @@ -58,18 +69,23 @@ Feature: download mosip cridentials And User verify go back button Examples: - | vid | otp | - | 4391082978460254 | 111111 | + | vid | otp | Vailidty | + | 4391082978460254 | 111111 | 3 | @smoke @VerifyAndDownloadVcViaMosipNatinalIdAndRfreshPage Scenario Outline: Mosip Natonal Id by e-Signet Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "National" When User click on download mosip credentials button Then User verify list of credential types displayed And User verify mosip national id by e-signet displayed When User click on mosip national id by e-signet button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User verify login page lables And User verify vid input box header And User enter the "" @@ -83,6 +99,6 @@ Feature: download mosip cridentials And user verify the page after Refresh Examples: - | vid | otp | - | 4391082978460254 | 111111 | + | vid | otp | Vailidty | + | 4391082978460254 | 111111 | 3 | diff --git a/inji-web-test/src/test/resources/featurefiles/downloadSunbirdCredentials.feature b/inji-web-test/src/test/resources/featurefiles/downloadSunbirdCredentials.feature index 635af34d..bacd25a5 100644 --- a/inji-web-test/src/test/resources/featurefiles/downloadSunbirdCredentials.feature +++ b/inji-web-test/src/test/resources/featurefiles/downloadSunbirdCredentials.feature @@ -4,12 +4,17 @@ Feature: Login using Sunbird Credentials Scenario Outline: download vc via sunbird Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "Insurance" And User verify sunbird cridentials button And User click on sunbird cridentials button Then User verify list of credential types displayed And User verify sunbird rc insurance verifiable credential displayed And User click on sunbird rc insurance verifiable credential button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User enter the policy number "" And User enter the full name "" And User enter the date of birth "" @@ -20,19 +25,24 @@ Feature: Login using Sunbird Credentials And User verify go back button Examples: - | policy number | full name | date of birth | - | 120786786 | PolicyTestAutomation | 01-01-2024 | + | policy number | full name | date of birth | Vailidty | + | 120786786 | PolicyTestAutomation | 01-01-2024 |3| @smoke @VerifyAndDownloadVcViaSunbirdLife Scenario Outline: download vc via sunbird Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "Insurance" And User verify sunbird cridentials button And User click on sunbird cridentials button Then User verify list of credential types displayed And User verify life Insurance displayed And User click on life Insurance button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User verify policy number input box header And User enter the policy number "" And User verify full name input box header @@ -45,19 +55,24 @@ Feature: Login using Sunbird Credentials And User verify go back button Examples: - | policy number | full name | date of birth | - | 120786786 | PolicyTestAutomation | 01-01-2024 | + | policy number | full name | date of birth | Vailidty | + | 120786786 | PolicyTestAutomation | 01-01-2024 |3| # @smoke @VerifyAndDownloadVcViaSunbirdLifeWithInvalidPolicyNumber Scenario Outline: download vc via sunbird Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "Insurance" And User verify sunbird cridentials button And User click on sunbird cridentials button Then User verify list of credential types displayed And User verify life Insurance displayed And User click on life Insurance button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User verify policy number input box header And User enter the policy number "" And User verify full name input box header @@ -68,19 +83,24 @@ Feature: Login using Sunbird Credentials Then User verify authentication failed message Examples: - | policy number | full name | date of birth | - | 1207202 | PolicyTestName | 01-01-2024 | + | policy number | full name | date of birth | Vailidty | + | 1207202 | PolicyTestName | 01-01-2024 | 3 | # @smoke @VerifyAndDownloadVcViaVehicleInsuranceWithInvaildName Scenario Outline: download vc via sunbird Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "Insurance" And User verify sunbird cridentials button And User click on sunbird cridentials button Then User verify list of credential types displayed And User verify Vehicle Insurance displayed And User click on Vehicle Insurance button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User verify policy number input box header And User enter the policy number "" And User verify full name input box header @@ -91,19 +111,24 @@ Feature: Login using Sunbird Credentials Then User verify authentication failed message Examples: - | policy number | full name | date of birth | - | 120786786 | PolicyTestNam | 01-01-2024 | + | policy number | full name | date of birth | Vailidty | + | 120786786 | PolicyTestNam | 01-01-2024 | 3 | @smoke @VerifyAndDownloadVcViaVehicleInsurance Scenario Outline: download vc via sunbird Given Load application url "https://inji.qa-inji.mosip.net/" Then User gets the title of the page + Then User click on get started button And User search the issuers with "Insurance" And User verify sunbird cridentials button And User click on sunbird cridentials button Then User verify list of credential types displayed And User verify Vehicle Insurance displayed And User click on Vehicle Insurance button + Then User click on data share content validity + Then User click on select custom validity button + Then user enter validity for data share content "" + Then Use click on procced button And User verify policy number input box header And User enter the policy number "" And User verify full name input box header @@ -114,5 +139,5 @@ Feature: Login using Sunbird Credentials Then User verify Download Success text displayed Examples: - | policy number | full name | date of birth | - | 120786786 | PolicyTestAutomation | 01-01-2024 | \ No newline at end of file + | policy number | full name | date of birth | Vailidty | + | 120786786 | PolicyTestAutomation | 01-01-2024 | 3 | \ No newline at end of file diff --git a/inji-web-test/src/test/resources/featurefiles/homePage.feature b/inji-web-test/src/test/resources/featurefiles/homePage.feature index 4ef642b9..ce64b193 100644 --- a/inji-web-test/src/test/resources/featurefiles/homePage.feature +++ b/inji-web-test/src/test/resources/featurefiles/homePage.feature @@ -4,15 +4,24 @@ Feature: Inji web homepage testing Scenario: Verify the Inji web homepage Given User gets the title of the page Then User validate the title of the page + Then User verify that home banner heading + Then User verify that home banner description + Then User verify that home banner get started + Then User verify that home features heading + Then User verify that home features description1 + Then User verify that home features mobile image + Then User verify that home features desktop image + Then User verify that home feature item image + Then User verify that home feature Heading + Then User verify that home feature item header for all + Then User verify that home feature feature description + Then User click on get started button Then User verify header displayed Then User verify that home page container displayed Then User verify the footer on home page And User verify that inji web logo is displayed - And User verify that about inji web displayed And User verify that on home page searchbox is present And User verify that langauge button is displayed - And User verify click on about inji page - And User verify About inji open @smoke @verifyingHomepageInArabic Scenario: Verify the Inji web homepage diff --git a/inji-web-test/src/test/resources/featurefiles/multiLanguage.feature b/inji-web-test/src/test/resources/featurefiles/multiLanguage.feature index b1de5d2d..48574ce6 100644 --- a/inji-web-test/src/test/resources/featurefiles/multiLanguage.feature +++ b/inji-web-test/src/test/resources/featurefiles/multiLanguage.feature @@ -4,6 +4,7 @@ Feature: Inji web multilanguage testing Scenario: Verify the Inji web configured language Given User gets the title of the page Then User validate the title of the page + Then User click on get started button And User verify that inji web logo is displayed And User verify that langauge button is displayed And User click on langauge button @@ -13,6 +14,7 @@ Feature: Inji web multilanguage testing Scenario: Verify the Inji web homepage Given User gets the title of the page Then User validate the title of the page + Then User click on get started button And User verify that inji web logo is displayed And User verify that langauge button is displayed And User click on langauge button @@ -45,6 +47,7 @@ Feature: Inji web multilanguage testing Scenario: Verify the Credential Details Page Given User gets the title of the page Then User validate the title of the page + Then User click on get started button And User verify that inji web logo is displayed And User search the issuers with "National" When User click on download mosip credentials button @@ -69,6 +72,7 @@ Feature: Inji web multilanguage testing Scenario: Verify the Credential Details Page Given User gets the title of the page Then User validate the title of the page + Then User click on get started button And User verify that inji web logo is displayed And User search the issuers with "Insurance" And User verify sunbird cridentials button @@ -99,6 +103,7 @@ Feature: Inji web multilanguage testing Scenario: Verify the Credential Details Page Given User gets the title of the page Then User validate the title of the page + Then User click on get started button And User verify that inji web logo is displayed And User search the issuers with "National" When User click on download mosip credentials button @@ -143,6 +148,7 @@ Feature: Inji web multilanguage testing Scenario: Verify the Inji web homepage Given User gets the title of the page Then User validate the title of the page + Then User click on get started button And User verify that inji web logo is displayed And User verify that langauge button is displayed And User click on langauge button