Search in sources :

Example 36 with UIElement

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

the class HomePage method navigate.

public void navigate(String pageName) {
    this.find.byText(pageName).tap();
    UIElement browse = this.wait.waitForVisible(this.locators.findByTextLocator("Browse", true));
    Assert.assertNotNull(browse);
    this.log.info("Navigate to " + pageName);
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement)

Example 37 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 38 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 39 with UIElement

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

the class BindingTests method binding_02_xmlBasics.

@Test(groups = { "android", "ios" })
public void binding_02_xmlBasics() throws Exception {
    this.bindingsBasePage.navigateToMainPage();
    UIElement element = this.find.byTextContains("xmlbasics");
    this.bindingsBasePage.navigateTo(element);
    if (this.settings.platform == PlatformType.iOS) {
        this.compareScreens(5);
    } else {
        Assert.assertEquals(this.bindingsBasePage.bindingXmlBasicsPage.editTextField().getText(), "Text");
        Assert.assertEquals(this.bindingsBasePage.bindingXmlBasicsPage.btnText().getText(), "");
    }
    this.bindingsBasePage.bindingXmlBasicsPage.tapTextBtn();
    if (this.settings.platform == PlatformType.iOS) {
        this.compareScreens(5);
    } else {
        Assert.assertEquals(this.bindingsBasePage.bindingXmlBasicsPage.btnText().getText().toLowerCase(), "text");
    }
    this.bindingsBasePage.bindingXmlBasicsPage.tapBtn();
    if (this.settings.platform == PlatformType.iOS && this.settings.platformVersion <= 10) {
        this.compareScreens(5);
    } else {
        this.device.assertLogContains("### onTap event ###");
    }
    this.assertImagesResults();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test) MobileTest(functional.tests.core.mobile.basetest.MobileTest)

Example 40 with UIElement

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

the class BindingTests method binding_01_basics.

@Test(groups = { "android", "ios" })
public void binding_01_basics() throws Exception {
    if (this.settings.platform == PlatformType.iOS && this.settings.platformVersion < 11) {
        return;
    }
    UIElement btnBasics = this.bindingsBasePage.wait.waitForVisible(this.locators.byText("basics"));
    this.bindingsBasePage.navigateTo(btnBasics, "basics");
    this.bindingsBasePage.bindingBasicsPage.tapSetTextBtn();
    this.bindingsBasePage.bindingBasicsPage.tapOneWayBtn();
    if (this.settings.platform == PlatformType.iOS) {
        this.compareScreens(5);
    } else {
        Assert.assertEquals(this.bindingsBasePage.bindingBasicsPage.editTextFieldOneWay().getText(), "Test");
        Assert.assertEquals(this.bindingsBasePage.bindingBasicsPage.btnOneWay().getText().toLowerCase(), "oneway");
    }
    this.bindingsBasePage.bindingBasicsPage.tapTwoWayBtn();
    if (this.settings.platform == PlatformType.iOS) {
        this.compareScreens(5);
    } else {
        Assert.assertEquals(this.bindingsBasePage.bindingBasicsPage.editTextFieldTwoWay().getText(), "Test");
        Assert.assertEquals(this.bindingsBasePage.bindingBasicsPage.btnTwoWay().getText().toLowerCase(), "test");
    }
    this.assertImagesResults();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test) MobileTest(functional.tests.core.mobile.basetest.MobileTest)

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