Search in sources :

Example 66 with UIElement

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

the class SdkBaseTest method afterSdkBaseTestMethod.

@AfterMethod(alwaysRun = true)
public void afterSdkBaseTestMethod(ITestResult result) {
    if (result.getStatus() == ITestResult.SKIP) {
        result.setStatus(ITestResult.FAILURE);
        this.log.info("Set test result from SKIP to FAILURE.");
    }
    try {
        UIElement btnBack = this.mainPage.btnBack();
        if (btnBack != null) {
            this.mainPage.navigateBack(btnBack);
        } else {
            this.mainPage.navigateBack();
        }
    } catch (Exception ex) {
        this.log.error(ex.getMessage());
        result.setStatus(ITestResult.FAILURE);
    }
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) AfterMethod(org.testng.annotations.AfterMethod)

Example 67 with UIElement

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

the class SlideInEffectTests method slide_in_effect_02_animate.

@Test(groups = { "android", "ios" })
public void slide_in_effect_02_animate() throws Exception {
    UIElement btnAddItem = this.demoPage.context.find.byText("Add Item");
    for (int i = 0; i < 3; i++) {
        btnAddItem.click();
        Wait.sleep(1);
    }
    Wait.sleep(2);
    this.compareScreens(this.settings.shortTimeout, 0.5);
    this.assertImagesResults();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test) AnimationsBaseTest(animations.Tests.AnimationsBaseTest)

Example 68 with UIElement

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

the class SmokeTests method test_03_NavigatToHome.

@Test(description = "Verify home page looks OK.", groups = { "android", "ios" })
public void test_03_NavigatToHome() throws Exception {
    HomePage homePage = new HomePage();
    homePage.tabButton("Home");
    this.assertScreen("template-tab-navigation-home", this.settings.shortTimeout, 0.1);
    this.find.byText("Item 5").tap();
    UIElement detail = this.find.byText("Description for Item 5");
    Assert.notNull(detail, "Failed to navigate to details page.");
    homePage.navigateBack();
    this.assertScreen("template-tab-navigation-home", this.settings.shortTimeout, 0.1);
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) HomePage(templates.tabnavigation.pages.HomePage) Test(org.testng.annotations.Test) MobileTest(functional.tests.core.mobile.basetest.MobileTest)

Example 69 with UIElement

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

the class NavOptionsPage method update.

public void update() {
    UIElement element = this.wait.waitForVisible(this.locators.byText("update"));
    element.click();
    this.log.info("Click on update");
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement)

Example 70 with UIElement

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

the class NavOptionsPage method clearHistory.

public void clearHistory() {
    Wait.sleep(2000);
    UIElement element = this.wait.waitForVisible(this.locators.byText("clear-history"));
    this.log.info("Is clear-history isDisplayed " + element.isDisplayed());
    this.log.info("Is clear-history isEnabled " + element.isEnabled());
    element.tap();
    this.log.info("Click on clear-history");
}
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