Search in sources :

Example 41 with UIElement

use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.

the class CssCommonTests method clipPath_01.

@Test(groups = { "android", "ios" })
public void clipPath_01() throws Exception {
    this.cssBasePage.navToPage("clipPath");
    UIElement mainElement = this.cssBasePage.find.byText("clipPath", false, 3);
    if ((this.settings.platformVersion.toString().startsWith("4")) && (this.settings.deviceType == DeviceType.Emulator)) {
        this.compareElements(mainElement, 10, 20d);
    } else {
        this.compareElements(mainElement, 5, 1d);
    }
    this.assertImagesResults();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test)

Example 42 with UIElement

use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.

the class CssCommonTests method margins_paddings_with_percentage_15.

@Test(groups = { "android", "ios" })
public void margins_paddings_with_percentage_15() throws Exception {
    this.cssBasePage.navToPage("margins-paddings-with-percentage");
    UIElement btn = this.cssBasePage.wait.waitForVisible(this.locators.byText("css", false, false), 6, true);
    this.compareScreens(compareScreens, 5);
    btn.tap();
    this.compareScreens(compareScreens, 5);
    this.assertImagesResults();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test)

Example 43 with UIElement

use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.

the class TransitionsPage method navigateToTransition.

private boolean navigateToTransition(String buttonTextContent) {
    int timeOut = 20000;
    int displayTimeOut = timeOut;
    UIElement button = this.wait.waitForVisible(this.locators.byText(buttonTextContent), timeOut, false);
    if (button != null) {
        Point point = mainLayoutContainer().getLocation();
        this.log.info("Main container location before while cycle is: x = " + point.getX() + " y = " + point.getY());
        this.log.info("The button is visible before while cycle is: " + button.isDisplayed());
        while ((!button.isDisplayed() || point.getX() > 0) && displayTimeOut > 0) {
            this.log.info("The button is visible: " + button.isDisplayed());
            this.log.info("Display retries: " + displayTimeOut);
            point = mainLayoutContainer().getLocation();
            this.log.info("Main container location is: x = " + point.getX() + " y = " + point.getY());
            button = this.find.byText(buttonTextContent, timeOut);
            displayTimeOut -= 1000;
            if (displayTimeOut < 0) {
                this.log.error("The element is not visible: " + button);
            }
        }
        if (button.isDisplayed()) {
            this.log.info("Navigate to transition: " + buttonTextContent);
            return NavigationHelper.navigateTo(button, ClickType.Click, null, buttonTextContent);
        } else {
            this.log.error("Button is not visible");
            return false;
        }
    }
    return false;
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Point(org.openqa.selenium.Point) Point(org.openqa.selenium.Point)

Example 44 with UIElement

use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.

the class BindingsBasePage method navigateToBindings.

private void navigateToBindings() {
    UIElement btnBindings = this.wait.waitForVisible(this.locators.byText(BINDINGS));
    this.navigateTo(btnBindings, this.mainPage);
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement)

Example 45 with UIElement

use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.

the class NavOptionsTests method navOption_01_clearHistory_navigateBack.

@Test(groups = { "android", "ios" })
public void navOption_01_clearHistory_navigateBack() throws Exception {
    this.clearHistoryAndUpdate("0", "1");
    if (this.settings.platform == PlatformType.Android) {
        // Navigate back should go to home screen
        this.navOptionsPage.navigateBack();
        if (this.settings.platformVersion < 7.1) {
            UIElement phone = this.wait.waitForVisible(this.locators.byText("Phone"), false);
            UIElement people = this.wait.waitForVisible(this.locators.byText("People"), false);
            Assert.assertTrue((phone != null) || (people != null), "Back button do not set app in background.");
        } else {
            this.wait.waitForVisible(this.locators.byText("Chrome"), true);
        }
        this.app.restart();
        this.navOptionsPage.homePageLoaded();
        this.compareScreens(10, 5);
    } else if (this.settings.platform == PlatformType.iOS) {
        this.compareScreens(5);
        this.navOptionsPage.navigateWithBackToMain();
    }
    this.assertImagesResults();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test)

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