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