Search in sources :

Example 16 with UIElement

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");
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) HomePage(testsappng.Screens.HomePage) BeforeClass(org.testng.annotations.BeforeClass)

Example 17 with UIElement

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.");
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test) MobileTest(functional.tests.core.mobile.basetest.MobileTest)

Example 18 with UIElement

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.");
            }
        }
    }
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement)

Example 19 with UIElement

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));
    }
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) ScrollableListObject(functional.tests.core.extensions.ScrollableListObject)

Example 20 with UIElement

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);
    }
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement)

Aggregations

UIElement (functional.tests.core.mobile.element.UIElement)79 Test (org.testng.annotations.Test)37 MobileTest (functional.tests.core.mobile.basetest.MobileTest)15 SdkBaseTest (sdkexamples.SdkBaseTest)8 By (org.openqa.selenium.By)3 AnimationsBaseTest (animations.Tests.AnimationsBaseTest)1 ScrollableListObject (functional.tests.core.extensions.ScrollableListObject)1 UIRectangle (functional.tests.core.mobile.element.UIRectangle)1 Point (org.openqa.selenium.Point)1 AfterMethod (org.testng.annotations.AfterMethod)1 BeforeClass (org.testng.annotations.BeforeClass)1 HomePage (templates.tabnavigation.pages.HomePage)1 HomePage (testsappng.Screens.HomePage)1 HomePageExtended (uitests.Screens.HomePageExtended)1