Search in sources :

Example 21 with UIElement

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

the class PropertiesTest method properties_performance.

@Test()
public void properties_performance() throws Exception {
    if (this.settings.platform == PlatformType.Android) {
        this.wait.waitForVisible(this.locators.buttonLocator()).tap();
    } else {
        this.wait.forVisibleElements(this.locators.buttonLocator(), 2, true).get(2).tap();
    }
    By locator = this.locators.editTextLocator();
    if (this.settings.platform == PlatformType.iOS) {
        locator = this.locators.textViewLocator();
    }
    UIElement result = this.wait.waitForVisible(locator);
    while (result == null) {
        result = this.wait.waitForVisible(locator);
    }
    String text = result.getText().toLowerCase();
    while (!text.contains("complete")) {
        text = result.getText().toLowerCase();
    }
    this.parseResults(text);
    this.logResults();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) By(org.openqa.selenium.By) Test(org.testng.annotations.Test)

Example 22 with UIElement

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

the class SdkPage method getLinksText.

public List<String> getLinksText() {
    List<String> linksText = new ArrayList<String>();
    List<UIElement> links = this.getLinks();
    for (UIElement link : links) {
        linksText.add(link.getText());
    }
    return linksText;
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement)

Example 23 with UIElement

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

the class SdkDialogsTests method sdkDialogsTest.

@Test(dataProvider = "example")
public void sdkDialogsTest(String example, String btn) throws Exception {
    this.mainPage.navigateTo(example);
    String buttonTitle = "Display " + example.replace("dialog", "Dialog");
    this.mainPage.find.byText(buttonTitle).click();
    if (buttonTitle.equalsIgnoreCase("Login dialog")) {
        this.mainPage.find.byLocator(By.id("return")).click();
        this.mainPage.find.byLocator(By.id("return")).click();
    }
    if (buttonTitle.equalsIgnoreCase("Prompt dialog")) {
        this.mainPage.find.byLocator(By.id("return")).click();
    }
    // Close dialogs
    UIElement btnSubmitDialog = this.find.byTextContains(btn);
    btnSubmitDialog.tap();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement) Test(org.testng.annotations.Test) SdkBaseTest(sdkexamples.SdkBaseTest)

Example 24 with UIElement

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

the class SearchBarTest method clearSearchBar.

private void clearSearchBar(int index) {
    UIElement clearBtn = this.find.elementsByLocator(this.locators.imageLocator()).get(index);
    clearBtn.tap();
}
Also used : UIElement(functional.tests.core.mobile.element.UIElement)

Example 25 with UIElement

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

the class RoundedViewsTests method roundImg_01.

@Test(groups = { "android", "ios" })
public void roundImg_01() throws Exception {
    this.homePageExtended.navigateToMainPage();
    UIElement el = this.homePageExtended.wait.waitForVisible(this.locators.byText("roundimg", true, false), 3, true);
    this.homePageExtended.navigateTo(el);
    this.compareScreens(10, 0.1);
    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