use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class RoundedViewsTests method roundBtn_01.
@Test(groups = { "android", "ios" })
public void roundBtn_01() throws Exception {
this.homePageExtended.navigateToMainPage();
UIElement el = this.homePageExtended.wait.waitForVisible(this.locators.byText("roundbtn", true, false), 3, true);
this.homePageExtended.navigateTo(el);
this.compareScreens(10, 0.2);
this.assertImagesResults();
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class IssuesTestsCommon method issue_3354_ios_hint.
@Test(groups = { "android", "ios" })
public void issue_3354_ios_hint() throws Exception {
this.issuesBasePage.navToPage("3354-ios");
if (this.settings.platform == PlatformType.iOS && this.settings.platformVersion == 11.2) {
this.assertScreen("issue_3354_ios_hint", 15, 0.02);
} else {
this.compareScreens(10, 0.02, true);
}
UIElement textField;
if (this.settings.platform == PlatformType.Android) {
textField = this.find.byLocator(this.locators.editTextLocator());
} else {
textField = this.find.byLocator(this.locators.textViewLocator());
}
textField.setText("11111");
if (this.settings.platform == PlatformType.Android) {
try {
Wait.sleep(3000);
this.client.driver.hideKeyboard();
} catch (Exception e) {
this.log.info("Failed to hide keyboard.");
}
}
if (this.settings.platform == PlatformType.iOS && this.settings.platformVersion == 11.2) {
if (this.imageVerification.compareScreens("issue_3354_ios_hint_2_with_suggestions", 15, 0, this.maxPixelTolerance, 0.02)) {
this.assertScreen("issue_3354_ios_hint_2_with_suggestions", 15, 0.02);
} else {
this.assertScreen("issue_3354_ios_hint_2_without_suggestions", 15, 0.02);
}
} else {
this.compareScreens(15, 0.02, true);
}
this.issuesBasePage.findElement("clear text").click();
if (this.settings.platform == PlatformType.iOS && this.settings.platformVersion == 11.2) {
this.assertScreen("issue_3354_ios_hint_3", 15, 0.02);
} else {
this.compareScreens(15, 0.02, true);
}
if (this.settings.platform == PlatformType.iOS && this.settings.platformVersion == 11.2) {
this.log.info("Skip image verification.");
} else {
this.assertImagesResults();
}
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class IssuesTestsCommon method issue_2942_keyBoardFocusInListViewTemplate.
@Test(groups = { "android", "ios" })
public void issue_2942_keyBoardFocusInListViewTemplate() throws Exception {
this.issuesBasePage.navToPage("2942");
this.find.byTextContains("Click me 1st").click();
// Hack to handle keyboard popup dialog
if (this.settings.platform == PlatformType.Android && this.settings.platformVersion == 8.0) {
this.client.driver.hideKeyboard();
this.find.byTextContains("Click me 1st").click();
}
if (this.settings.platform == PlatformType.Android && this.settings.platformVersion == 27.0) {
if (this.imageVerification.compareScreens("issue_2942_keyBoardFocusInListViewTemplate_with_suggestions", 5, 0, this.maxPixelTolerance, 0.05)) {
this.assertScreen("issue_2942_keyBoardFocusInListViewTemplate_with_suggestions", 5, 0.05);
} else if (this.imageVerification.compareScreens("issue_2942_keyBoardFocusInListViewTemplate_with_suggestions_info", 5, 0, this.maxPixelTolerance, 0.05)) {
this.assertScreen("issue_2942_keyBoardFocusInListViewTemplate_with_suggestions_info", 5, 0.05);
} else {
this.assertScreen("issue_2942_keyBoardFocusInListViewTemplate_without_suggestions", 5, 0.05);
}
} else {
this.compareScreens(15, 0.22);
}
UIElement textFieldSecond = this.find.byTextContains("Click me 2nd");
textFieldSecond.click();
if (this.settings.platform == PlatformType.Android && this.settings.platformVersion == 27.0) {
if (this.imageVerification.compareScreens("issue_2942_keyBoardFocusInListViewTemplate_2", 5, 0, this.maxPixelTolerance, 0.05)) {
this.assertScreen("issue_2942_keyBoardFocusInListViewTemplate_2", 5, 0.05);
} else {
this.assertScreen("issue_2942_keyBoardFocusInListViewTemplate_without_suggestions", 5, 0.05);
}
} else {
this.compareScreens(15, 0.40);
}
UIElement btn3rd;
if (this.settings.platform == PlatformType.Android) {
btn3rd = this.find.byTextContains("3rd");
btn3rd.click();
if (this.settings.platform == PlatformType.Android && this.settings.platformVersion == 27.0) {
if (this.imageVerification.compareScreens("issue_2942_keyBoardFocusInListViewTemplate_3", 5, 0, this.maxPixelTolerance, 0.05)) {
this.assertScreen("issue_2942_keyBoardFocusInListViewTemplate_3", 5, 0.05);
} else {
this.assertScreen("issue_2942_keyBoardFocusInListViewTemplate_without_suggestions", 5, 0.05);
}
} else {
this.compareScreens(15, 0.20);
}
}
if (this.settings.platform == PlatformType.Android && this.settings.platformVersion == 27.0) {
this.log.info("Skip image verification.");
} else {
this.assertImagesResults();
}
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class MemoryTest method navigateBack.
private void navigateBack() {
UIElement btnBack = this.performanceBasePage.context.find.byText("back");
this.performanceBasePage.navigateTo(btnBack);
this.addMemoryInfo();
}
use of functional.tests.core.mobile.element.UIElement in project functional-tests by NativeScript.
the class MemoryTest method navigateForward.
private void navigateForward() {
UIElement btnForward = this.performanceBasePage.context.find.byText("forward");
this.performanceBasePage.navigateTo(btnForward);
this.addMemoryInfo();
}
Aggregations