Skip to content

Commit

Permalink
INJIWEB-951 UI Automation for Inji Web Landing Page & Multilane testc…
Browse files Browse the repository at this point in the history
…ases fixed (#192)

* INJIWEB-877 INJIWEB-680

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

* INJIWEB-877

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

* INJIWEB-877

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

* INJIWEB-877

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

* INJIWEB-951

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

* resolve conflicts

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

---------

Signed-off-by: Anup Nehe <[email protected]>
  • Loading branch information
anup-nehe authored Nov 14, 2024
1 parent 54387dd commit d57a42f
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 70 deletions.
197 changes: 190 additions & 7 deletions inji-web-test/src/main/java/pages/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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']"));
}
Expand Down Expand Up @@ -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]"));
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -178,7 +185,7 @@ public void clickOnLanguageButton() {
}

public boolean verifyLanguagesInLanguageFilter() {
List<String> expectedLanguages = Arrays.asList("English", "தமிழ்", "ಕನ್ನಡ", "हिंदी", "Français", "عربي");
List<String> expectedLanguages = Arrays.asList("English", "தமிழ்", "ಕನ್ನಡ", "हिंदी", "Français", "عربي","Português");
List<String> actualLanguages = null;
try {
actualLanguages = getElementTexts(driver, By.xpath("//ul[@class='py-1 divide-y divide-gray-200']//li"));
Expand Down Expand Up @@ -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']"));
}


}
12 changes: 6 additions & 6 deletions inji-web-test/src/main/java/pages/SunbirdCredentials.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand All @@ -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']"));
}

}
Loading

0 comments on commit d57a42f

Please sign in to comment.