Content-Length: 464775 | pFad | http://github.com/NativeScript/functional-tests/commit/593747514bbfee00e031f203f1964633e8240e5a

00 chore: resolve cyclic references · NativeScript/functional-tests@5937475 · GitHub
Skip to content

Commit 5937475

Browse files
committed
chore: resolve cyclic references
1 parent 6f4abd4 commit 5937475

File tree

3 files changed

+14
-33
lines changed

3 files changed

+14
-33
lines changed

src/test/java/uitests/Screens/Components/WebViewBasePage.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package uitests.Screens.Components;
22

3-
import functional.tests.core.enums.PlatformType;
43
import functional.tests.core.mobile.basetest.MobileContext;
54
import functional.tests.core.mobile.element.UIElement;
6-
import io.appium.java_client.MobileBy;
75
import org.testng.Assert;
86
import uitests.Screens.HomePageExtended;
97

@@ -18,36 +16,28 @@ public void navToPage(String page) {
1816
Assert.assertTrue(result, String.format("Failed to navigate to %s page.", page));
1917
}
2018

21-
private UIElement findElement(String text) {
22-
if (this.settings.platform == PlatformType.Android) {
23-
return this.findElement(text);
24-
} else {
25-
return this.wait.waitForVisible(MobileBy.AccessibilityId(text));
26-
}
27-
}
28-
2919
public void tapRelativeBtn() {
30-
this.findElement("rel").click();
20+
this.find.byText("rel").click();
3121
}
3222

3323
public void tapAbsoluteBtn() {
34-
this.findElement("abs").click();
24+
this.find.byText("abs").click();
3525
}
3626

3727
public void tapFileBtn() {
38-
this.findElement("file").click();
28+
this.find.byText("file").click();
3929
}
4030

4131
public void tapStringBtn() {
42-
this.findElement("str").click();
32+
this.find.byText("str").click();
4333
}
4434

4535
public UIElement srcWebView() {
46-
return this.findElement("someUrl | pathToLocalFile | htmlString");
36+
return this.find.byText("someUrl | pathToLocalFile | htmlString");
4737
}
4838

4939
public UIElement strResult() {
50-
return this.findElement("Result");
40+
return this.find.byText("Result");
5141
}
5242

5343
public UIElement strFooBar() {

src/test/java/uitests/Tests/Component/ApplicationTests.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
import functional.tests.core.enums.PlatformType;
44
import functional.tests.core.mobile.basetest.MobileTest;
5-
import functional.tests.core.mobile.element.UIElement;
65
import functional.tests.core.mobile.find.Wait;
7-
import io.appium.java_client.MobileBy;
86
import org.testng.Assert;
97
import org.testng.annotations.Test;
108
import uitests.Screens.UITestsBasePage;
@@ -52,21 +50,13 @@ public void tabview_with_scrollview_4022() throws Exception {
5250
UITestsBasePage basePage = new UITestsBasePage("issues", this.context);
5351
basePage.navigateTo("issues");
5452
basePage.navigateTo("tabview-with-scrollview_4022");
55-
findElement("Tab 2").click();
53+
this.find.byText("Tab 2").click();
5654
this.log.info("Run the application in background.");
5755
this.app.runInBackground(5);
58-
findElement("Tab 1").click();
59-
findElement("Tab 2").click();
60-
findElement("Tab 3").click();
56+
this.find.byText("Tab 1").click();
57+
this.find.byText("Tab 2").click();
58+
this.find.byText("Tab 3").click();
6159

6260
this.assertScreen(5);
6361
}
64-
65-
private UIElement findElement(String text) {
66-
if (this.settings.platform == PlatformType.Android) {
67-
return this.findElement(text);
68-
} else {
69-
return this.wait.waitForVisible(MobileBy.AccessibilityId(text));
70-
}
71-
}
7262
}

src/test/java/uitests/Tests/Component/HtmlViewTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package uitests.Tests.Component;
22

3-
import functional.tests.core.mobile.element.UIElement;
43
import functional.tests.core.mobile.basetest.MobileTest;
4+
import functional.tests.core.mobile.element.UIElement;
5+
import functional.tests.core.mobile.find.Wait;
56
import org.testng.Assert;
67
import org.testng.annotations.Test;
78
import uitests.Screens.HomePageExtended;
@@ -11,9 +12,9 @@ public class HtmlViewTests extends MobileTest {
1112
HomePageExtended homePage;
1213

1314
@Test(groups = {"android", "ios"})
14-
public void htmlView_01() throws Exception {
15+
public void htmlView_01() {
1516
this.homePage = new HomePageExtended("htmlview", this.context);
16-
this.homePage.context.client.setWait(1);
17+
Wait.sleep(1000);
1718
UIElement el = this.find.byTextContains("one");
1819
String htmlContent = el.getText();
1920
Assert.assertTrue(htmlContent.contains("one"));

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/functional-tests/commit/593747514bbfee00e031f203f1964633e8240e5a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy