use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class ModalViewTests method navigateBackIfElementNotExists.
private UIElement navigateBackIfElementNotExists(String text) {
UIElement el = this.wait.waitForVisible(this.locators.byText(text));
if (el == null) {
NavigationHelper.navigateBack(this.context);
el = this.wait.waitForVisible(this.locators.byText("undefined/undefined"), true);
}
return el;
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class ModalViewTests method modalView_03_popUpBack.
@Test(groups = { "android" })
public void modalView_03_popUpBack() {
this.modalViewPage.tapPopUpBtn();
NavigationHelper.navigateBack(this.context);
UIElement el = this.navigateBackIfElementNotExists("undefined/undefined");
Assert.assertEquals(el.getText(), "undefined/undefined");
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class HomePageExtended method uiTestsHomePageLoaded.
public void uiTestsHomePageLoaded(String element) {
UIElement btnElement = this.wait.waitForVisible(this.locators.byText(element));
if (btnElement == null) {
this.context.log.logScreen(this.context.getTestName() + "_fail", "OnNavigateTo_" + element);
this.app.restart();
Assert.fail("Couldn't resolve navigate to " + element);
}
boolean hasNavigated = this.navigateTo(btnElement, element);
if (hasNavigated) {
this.log.info("UITests app " + element + " page loaded.");
} else {
this.log.info("Failed to navigate to " + element + " page.");
}
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class LayoutsPage method basePageLoaded.
private void basePageLoaded() {
UIElement element;
if (this.settings.platform == PlatformType.Android) {
element = this.find.byText("pwrap");
} else {
element = this.find.byLocator(MobileBy.AccessibilityId("pwrap"));
}
Assert.assertNotNull(element, "LayoutsPage is not loaded");
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class MainPage method tapOnLogOff.
public void tapOnLogOff() {
UIElement button;
this.wait.waitForVisible(btnLogOffLocator());
if (this.settings.platform == PlatformType.Android) {
button = this.find.elementsByLocator(this.btnLogOffLocator()).get(2);
} else {
button = this.wait.waitForVisible(this.btnLogOffLocator());
}
button.tap();
}
Aggregations