Search in sources :

Example 56 with UIElement

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

Example 57 with UIElement

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

Example 58 with UIElement

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

Example 59 with UIElement

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

Example 60 with UIElement

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();
}
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