Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://mosip.atlassian.net/browse/MOSIP-30972 adding new testcases for android and ios #1145

Merged
merged 6 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions injitest/src/main/java/inji/pages/AboutInjiPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ public class AboutInjiPage extends BasePage {
@AndroidFindBy(accessibility = "arrowLeft")
@iOSXCUITFindBy(accessibility = "arrowLeft")
private WebElement backButton;

@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Click here\")")
public WebElement clickHereButton;

@AndroidFindBy(accessibility = "Web View")
private WebElement WebView;

public AboutInjiPage(AppiumDriver driver) {
super(driver);
Expand All @@ -38,6 +44,10 @@ public boolean isAppIdCopiedTextDisplayed() {
public boolean isCopyTextDisplayed() {
return this.isElementDisplayed(copy);
}

public boolean isWebViewDisplayed() {
return this.isElementDisplayed(WebView);
}

public void clickOnCopyText() {
clickOnElement(copy);
Expand All @@ -46,4 +56,8 @@ public void clickOnCopyText() {
public void clickOnBackButton() {
clickOnElement(copy);
}

public void clickOnClickHereButton() {
clickOnElement(clickHereButton);
}
}
26 changes: 22 additions & 4 deletions injitest/src/main/java/inji/pages/AddNewCardPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class AddNewCardPage extends BasePage{

@AndroidFindBy(accessibility = "issuersScreenHeader")
@AndroidFindBy(accessibility = "title")
@iOSXCUITFindBy(accessibility = "title")
private WebElement addNewCardHeader;

Expand All @@ -29,6 +29,9 @@ public class AddNewCardPage extends BasePage{
@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Mangyaring piliin ang iyong gustong tagabigay mula sa mga opsyon sa ibaba upang magdagdag ng bagong card.\")")
private WebElement addNewCardGuideMessageInFillpino;

@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"नया कार्ड जोड़ने के लिए कृपया नीचे दिए गए विकल्पों में से अपना पसंदीदा जारीकर्ता चुनें।\")")
private WebElement addNewCardGuideMessageInHindi;

@AndroidFindBy(accessibility = "issuerDescription-Mosip")
@iOSXCUITFindBy(accessibility = "issuerDescription-Mosip")
private WebElement issuerDescriptionMosip;
Expand Down Expand Up @@ -66,10 +69,18 @@ public boolean isDownloadViaUinDisplayed() {
return this.isElementDisplayed(downloadViaUin);
}

public boolean isDownloadViaUinDisplayedInHindi() {
return this.isElementDisplayed(downloadViaUin);
}

public boolean isDownloadViaEsignetDisplayed() {
return this.isElementDisplayed(downloadViaEsignet);
}

public boolean isDownloadViaEsignetDisplayedInHindi() {
return this.isElementDisplayed(downloadViaEsignet);
}

public boolean isDownloadViaEsignetDisplayedinFillpino() {
return this.isElementDisplayed(downloadViaEsignet);
}
Expand All @@ -87,6 +98,9 @@ public boolean isAddNewCardGuideMessageDisplayedInFillopin() {
return this.isElementDisplayed(addNewCardGuideMessageInFillpino);
}

public boolean isAddNewCardGuideMessageDisplayedInHindi() {
return this.isElementDisplayed(addNewCardGuideMessageInHindi);
}
public boolean isIssuerDescriptionMosipDisplayed() {
return this.isElementDisplayed(issuerDescriptionMosip);
}
Expand All @@ -103,9 +117,13 @@ public boolean isIssuerSearchBarDisplayedInFilipino() {
return this.isElementDisplayed(issuerSearchBar);
}

public void sendTextInIssuerSearchBar(String text) {
clearTextBoxAndSendKeys(issuerSearchBar,text);
public boolean isIssuerSearchBarDisplayedInHindi() {
return this.isElementDisplayed(issuerSearchBar);
}

public AddNewCardPage sendTextInIssuerSearchBar(String env) {
clearTextBoxAndSendKeys(issuerSearchBar, env);
return this;
}


}
11 changes: 8 additions & 3 deletions injitest/src/main/java/inji/pages/DetailedVcViewPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.iOSXCUITFindBy;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

public class DetailedVcViewPage extends BasePage {
public class DetailedVcViewPage extends BasePage{
@AndroidFindBy(accessibility = "idDetailsHeader")
@iOSXCUITFindBy(accessibility = "idDetailsHeader")
private WebElement detailedVcViewPageTitle;
Expand Down Expand Up @@ -49,7 +50,10 @@ public class DetailedVcViewPage extends BasePage {
@AndroidFindBy(accessibility = "enableVerification")
@iOSXCUITFindBy(accessibility = "enableVerification")
private WebElement activateButton;


@AndroidFindBy(uiAutomator = "new UiScrollable(new UiSelector()).scrollIntoView(text(\"Activate\"));")
private WebElement scrollActivateButton;

@AndroidFindBy(accessibility = "profileAuthenticated")
@iOSXCUITFindBy(accessibility = "profileAuthenticated")
private WebElement profileAuthenticated;
Expand Down Expand Up @@ -130,7 +134,8 @@ public boolean isActivateButtonDisplayed() {
return this.isElementDisplayed(activateButton);
}

public PleaseConfirmPopupPage clickOnActivateButton() {
public PleaseConfirmPopupPage clickOnActivateButton(){
scrollActivateButton.isDisplayed();
clickOnElement(activateButton);
return new PleaseConfirmPopupPage(driver);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,29 @@ public HassleFreeAuthenticationPage(AppiumDriver driver) {
public boolean isHassleFreeAuthenticationPageLoaded() {
return this.isElementDisplayed(hassleFreeAuthenticationText);
}

public boolean isHassleFreeAuthenticationPageLoadedDisplayedInFilipnio() {
return this.isElementDisplayed(hassleFreeAuthenticationText);
}

public boolean isHassleFreeAuthenticationPageLoadedDisplayedInHindi() {
return this.isElementDisplayed(hassleFreeAuthenticationText);
}

public boolean isHassleFreeAuthenticationPageLoadedDisplayedInTamil() {
return this.isElementDisplayed(hassleFreeAuthenticationText);
}

public boolean isHassleFreeAuthenticationPageLoadedDisplayedInKannada() {
return this.isElementDisplayed(hassleFreeAuthenticationText);
}

public String getHassleFreeAuthenticationDescription() {
return this.getTextFromLocator(hassleFreeAuthenticationDescription);
}

public void clickOnGoBack() {
public HassleFreeAuthenticationPage clickOnGoBack() {
clickOnElement(goBackButton);
return this;
}
}
20 changes: 16 additions & 4 deletions injitest/src/main/java/inji/pages/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ public class HomePage extends BasePage {
@AndroidFindBy(accessibility = "nationalCard")
@iOSXCUITFindBy(accessibility = "nationalCard")
private WebElement idTypeValue;

@AndroidFindBy(accessibility = "tryAgain")
@iOSXCUITFindBy(accessibility = "errorTitle")
private WebElement tryAgainButton;

@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Subukan muli\")")
private WebElement tryAgainButtonInFillpino;

@AndroidFindBy(accessibility = "downloadingVcPopup")
private WebElement downloadingVcPopup;

public HomePage(AppiumDriver driver) {
super(driver);
Expand Down Expand Up @@ -138,6 +141,10 @@ public boolean isNoVCDownloaded() {
public boolean isNoVCDownloadedInFilipino() {
return this.isElementDisplayed(bringYourDigitalIdentity);
}

public boolean isNoVCDownloadedInHindi() {
return this.isElementDisplayed(bringYourDigitalIdentity);
}

public boolean isNoInternetConnectionDisplayed() {
return this.isElementDisplayed(noInternetConnection);
Expand Down Expand Up @@ -183,9 +190,14 @@ public boolean isTryAgainButtonNotDisplayed() {
public void clickOnTryAgainButton() {
clickOnElement(tryAgainButton);
}

public void clickOnTryAgainButtonInFlillpino() {
clickOnElement(tryAgainButtonInFillpino);

public HomePage clickOnTryAgainButtonInFlillpino() {
clickOnElement(tryAgainButtonInFillpino);
return this;
}

public boolean isDownloadingVcPopupDisplayed() {
return this.isElementDisplayed(downloadingVcPopup);
}

}
10 changes: 10 additions & 0 deletions injitest/src/main/java/inji/pages/ReceiveCardPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
public class ReceiveCardPage extends BasePage {
@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Allow\")")
private WebElement allowButton;

@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"com.android.permissioncontroller:id/permission_allow_foreground_only_button\")")
private WebElement allowPermissionPopupButton;

@AndroidFindBy(accessibility = "showQrCode")
private WebElement receiveCardHeader;
Expand All @@ -32,6 +35,13 @@ public void clickOnAllowButton() {
clickOnElement(allowButton);
}
}

public ReceiveCardPage acceptPermissionPopupForLocation() {
if (isElementDisplayed(allowPermissionPopupButton)) {
clickOnElement(allowButton);
}
return this;
}

public boolean isReceiveCardHeaderDisplayed() {
return this.isElementDisplayed(receiveCardHeader);
Expand Down
Loading