use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class MainPage method insertItem.
public UIElement insertItem(String text) {
if (this.addItemTextEdit == null) {
this.addItemTextEdit = this.textFieldAddAGroceryItem();
}
this.addItemTextEdit.tap();
this.addItemTextEdit.sendKeys(text);
UIElement addBtn = this.wait.forVisibleElements(this.locators.imageLocator(), 10, false).get(1);
if (this.settings.platform == PlatformType.Android) {
addBtn.click();
} else {
addBtn.tap();
}
Wait.sleep(2000);
return this.getListViewItem(0);
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class QsfDemosTests method test_example.
@Test(groups = { "android", "ios" }, dataProvider = "example")
public void test_example(String example) {
// Go to demo
this.homePage.navigateTo(example);
// Hack for Reservations demo which title ActionBar title is `DataForm`
if (example.equalsIgnoreCase("Reservations")) {
example = "DataForm";
}
// Verify it is loaded
By demoLocator = By.xpath("//*[@content-desc='ActionBar']//*[@text='" + example + "']");
if (this.settings.platform == PlatformType.iOS) {
demoLocator = By.xpath("//*[@name='ActionBar']//*[@label='" + example + "']");
}
UIElement demoTitle = this.wait.waitForVisible(demoLocator, this.settings.shortTimeout, false);
if (demoTitle == null) {
this.gestures.swipeInWindow(SwipeElementDirection.DOWN, 500, 500);
demoTitle = this.find.byText(example, this.settings.shortTimeout);
}
Assert.assertNotNull(demoTitle, demoTitle + "not loaded.");
// Log current screen
this.log.logScreen(example.replace(" ", ""), example);
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class CutenessActivitiesTests method enableOption.
private void enableOption(String optionName) {
this.log.info("Swiping to \"" + optionName + "\" option.");
UIElement optionBtn = this.find.byText(optionName, 3);
int count = 0;
while (optionBtn == null) {
if (count <= 5) {
optionBtn = this.gestures.scrollToElement(SwipeElementDirection.DOWN, optionName, 5);
} else {
Assert.fail("Failed to navigate to \"" + optionName + "\".");
}
count++;
}
optionBtn.click();
this.log.info("Tap on '" + optionName + "' option.");
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class GroceriesRecentItemsPage method selectItem.
public UIElement selectItem(int index) {
UIElement element = this.getListViewItems().get(index);
element.click();
return element;
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class LoginPage method login.
public SecondaryLoginPage login() {
UIElement login = this.wait.waitForVisible(this.btnLogin);
login.tap();
SecondaryLoginPage page = new SecondaryLoginPage();
return page;
}
Aggregations