use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class ListPickerTest method beforeListPickerTestClass.
@BeforeClass(alwaysRun = true)
public void beforeListPickerTestClass() throws Exception {
this.homePage = new HomePage(ListPickerTest.LIST_PICKER_EXAMPLE, this.context);
UIElement listPicker = this.context.wait.waitForVisible(this.locators.byText(ListPickerTest.LIST_PICKER_EXAMPLE), 3, true);
this.homePage.navigateTo(listPicker, "list-picker-test-page");
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class SmokeTests method test_01_smoke.
@Test(groups = { "android", "ios" })
public void test_01_smoke() {
UIElement home = this.find.byText("Home");
Assert.notNull(home, "Failed to load home page.");
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class GetStartedPage method allowPermissions.
public void allowPermissions() {
if (this.settings.platform == PlatformType.iOS) {
UIElement btnAllow = this.find.byText("Allow", this.settings.shortTimeout);
if (btnAllow != null) {
btnAllow.tap();
this.log.info("Popup dialog handled!");
} else {
try {
this.client.driver.switchTo().alert().accept();
this.log.info("Popup dialog handled!");
} catch (Exception e) {
this.log.info("Popup dialog not found.");
}
}
}
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class CssAnimationsPage method init.
private void init(String page, MobileContext context) {
if (this.settings.platform == PlatformType.Android) {
ScrollableListObject scrollableListObject = new ScrollableListObject(context) {
@Override
public String getMainContainerLocatorName() {
return getMainContainerLocatorNameAsString();
}
@Override
public String getMainContainerItemsName() {
return getMainContainerItemsNameAsString();
}
};
scrollableListObject.setRetriesCount(3);
this.context.navigationManager.setScrollToRectangleMethod((p) -> scrollableListObject.scrollTo(p));
} else {
this.context.navigationManager.setNavigation((p) -> {
UIElement el = this.find.byLocator(By.xpath("//" + this.getMainContainerItemsNameAsString() + "[@label='" + p + "']"));
if (el != null) {
el.tap();
this.navigationManager.setCurrentPage(p);
}
});
}
if (page != null && !page.isEmpty()) {
this.context.navigationManager.navigateTo(page);
this.context.navigationManager.setMainPage(page);
this.context.navigationManager.setHomePageLocator(context.locators.byText(page));
}
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class HomePage method navigateTo.
public void navigateTo(String example, By locator) {
this.navigationManager.navigateToMainPage();
UIElement element;
if (this.settings.platform == PlatformType.Android) {
element = this.gestures.swipeInWindowToElement(SwipeElementDirection.DOWN, this.locators.byText(example), 10, 250, 250);
} else {
element = NavigationHelper.scrollTo(example, this.context, 5);
}
if (element == null) {
this.log.error("Example is not found");
} else {
this.navigateTo(element, example);
}
if (locator != null) {
this.wait.waitForVisible(locator, this.settings.shortTimeout, true);
}
}
Aggregations