use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class HtmlViewTests method htmlView_01.
@Test(groups = { "android", "ios" })
public void htmlView_01() throws Exception {
this.homePage = new HomePageExtended("htmlview", this.context);
UIElement el = this.find.byTextContains("one");
String htmlContent = el.getText();
Assert.assertTrue(htmlContent.contains("one"));
Assert.assertTrue(htmlContent.contains("two"));
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class ModalsBaseTest method openAndAssertModalDialogs.
public void openAndAssertModalDialogs(String navigate, String openComponent) throws Exception {
this.modalPageBase.navigateToMainPage();
UIElement navigationButton = this.modalPageBase.wait.waitForVisible(this.locators.byText(navigate, false, false), 6, true);
this.modalPageBase.navigateTo(navigationButton);
UIElement optionButton = this.modalPageBase.wait.waitForVisible(this.locators.byText(openComponent, false, false), 6, true);
this.modalPageBase.navigateTo(optionButton);
this.compareScreens(this.getImageName(navigate, openComponent), 5);
this.modalPageBase.navigateBack(this.modalPageBase.btnOk());
this.compareScreens(5);
optionButton = this.modalPageBase.find.byTextContains(openComponent);
this.modalPageBase.navigateTo(optionButton);
this.compareScreens(this.getImageName(navigate, openComponent), 5);
this.modalPageBase.navigateBack(this.modalPageBase.btnCancel());
this.compareScreens(this.getImageName(navigate, openComponent), 5);
this.assertImagesResults();
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class NavOptionsTests method navOption_03_pageTransition.
@Test(groups = { "android", "ios" })
public void navOption_03_pageTransition() throws Exception {
double tollerance = 7.5;
if (this.settings.platform == PlatformType.Android) {
this.navOptionsPage.resetNavigationToLastPage();
} else {
UIElement btnNavOptions = this.wait.waitForVisible(this.locators.byText(NavOptionsPage.navOptionsPage), 3, true);
this.navOptionsPage.navigateTo(btnNavOptions);
tollerance = 19;
}
this.rect = this.navOptionsPage.getPageTransitionsBtn().getUIRectangle();
this.navOptionsPage.pageTransitions();
this.compareScreens(15, tollerance);
this.assertImagesResults();
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class LoginPage method login.
public void login(String userName, String userPass) {
loginButton().click();
// Handle Api26
if (this.settings.platform == PlatformType.Android) {
UIElement accept = this.find.byText("ACCEPT & CONTINUE", true, this.settings.shortTimeout);
if (accept != null) {
accept.click();
this.find.byText("NO THANKS", true, this.settings.shortTimeout).click();
}
}
UIElement userEditText = this.find.byLocator(this.locators.editTextLocator());
UIElement nextButton = this.find.byText("Next");
Wait.sleep(1000);
this.gestures.swipeInWindow(SwipeElementDirection.DOWN, 1000);
Wait.sleep(1000);
userEditText.setText(userName);
Wait.sleep(1000);
this.app.hideKeyboard();
Wait.sleep(1000);
nextButton.click();
Wait.sleep(3000);
UIElement passBox;
if (this.settings.platform == PlatformType.Android) {
passBox = this.find.byLocator(this.locators.editTextLocator());
} else {
passBox = this.find.byLocator(By.className("XCUIElementTypeSecureTextField"));
}
this.app.hideKeyboard();
Wait.sleep(1000);
passBox.setText(userPass);
this.find.byText("Sign in").click();
this.find.byText("Yes", false, this.settings.defaultTimeout).click();
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class SdkTextViewTests method sdkTextViewTest.
@Test(dataProvider = "example")
public void sdkTextViewTest(String example) {
this.mainPage.navigateTo(example);
if (example.equals("Usage")) {
String text = "This is very long text. This is very long text. This is very long text. " + "This is very long text. This is very long text.";
UIElement textField;
if (this.settings.platform == PlatformType.Android) {
textField = this.mainPage.wait.waitForVisible(this.locators.editTextLocator(), this.settings.shortTimeout, true);
} else {
textField = this.mainPage.find.byType("UIATextView");
}
textField.setText(text);
if (this.settings.platform == PlatformType.Android) {
this.mainPage.hideKeyboard();
}
}
}
Aggregations