Files
inji-wallet/injitest/src/main/java/inji/pages/SharePage.java
anup-nehe f0e977c1e9 MOSIP-31106 stabilizing and added test cases (#1217)
* MOSIP-31255 MOSIP-31106

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

* resolve conflicts

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

---------

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>
2024-01-31 10:42:07 +05:30

76 lines
2.1 KiB
Java

package inji.pages;
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 inji.utils.IosUtil;
public class SharePage extends BasePage {
@AndroidFindBy(accessibility = "camera")
private WebElement camera;
@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Bluetooth\")")
private WebElement bluetoothPopUp;
@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Allow\")")
private WebElement allowButton;
@AndroidFindBy(uiAutomator = "new UiSelector().textContains(\"Deny\")")
private WebElement denyButton;
@AndroidFindBy(accessibility = "noShareableVcs")
@iOSXCUITFindBy(accessibility = "noShareableVcs")
private WebElement noShareableCards;
@AndroidFindBy(accessibility = "flipCameraIcon")
private WebElement flipCamera;
@AndroidFindBy(accessibility = "holdPhoneSteadyMessage")
private WebElement holdCameraSteady;
@AndroidFindBy(accessibility = "bluetoothIsTurnedOffMessage")
private WebElement bluetoothIsTurnedOffMessage;
public SharePage(AppiumDriver driver) {
super(driver);
}
public SharePage acceptPermissionPopupBluetooth() {
if (isElementDisplayed(allowButton)) {
clickOnElement(allowButton);
}
return this;
}
public SharePage denyPermissionPopupBluetooth() {
if (isElementDisplayed(denyButton)) {
clickOnElement(denyButton);
}
return this;
}
public boolean isCameraOpen() {
return isElementDisplayed(camera);
}
public boolean isNoShareableCardsMessageDisplayed() {
return isElementDisplayed(noShareableCards);
}
public String isBluetoothIsTurnedOffMessageDisplayed() {
return getTextFromLocator(bluetoothIsTurnedOffMessage);
}
public boolean isCameraPageLoaded() {
return this.isElementEnabled(holdCameraSteady);
}
public boolean isFlipCameraClickable() {
return this.isElementEnabled(flipCamera);
}
}