|
7 | 7 | import java.util.HashMap;
|
8 | 8 | import java.util.List;
|
9 | 9 | import java.util.Map;
|
| 10 | +import java.util.regex.Pattern; |
10 | 11 | import java.io.File;
|
11 | 12 |
|
12 | 13 | import org.openqa.selenium.OutputType;
|
13 | 14 | import io.appium.java_client.MobileElement;
|
14 |
| -import kotlin.text.Regex; |
15 | 15 | import pro.truongsinh.appium_flutter.FlutterFinder;
|
16 | 16 |
|
17 | 17 | public class FlutterTest extends BaseDriver {
|
@@ -71,8 +71,7 @@ public void basicTest () throws InterruptedException {
|
71 | 71 |
|
72 | 72 | find.byTooltip("Increment").click();
|
73 | 73 |
|
74 |
| - // @todo param override |
75 |
| - assertEquals(find.descendant(find.byTooltip("counter_tooltip"), find.byValueKey("counter"), false).getText(), "3"); |
| 74 | + assertEquals(find.descendant(find.byTooltip("counter_tooltip"), find.byValueKey("counter")).getText(), "3"); |
76 | 75 |
|
77 | 76 | find.byType("FlatButton").click();
|
78 | 77 | driver.executeScript("flutter:waitForAbsent", buttonFinder);
|
@@ -101,19 +100,15 @@ public void basicTest () throws InterruptedException {
|
101 | 100 | driver.executeScript("flutter:enterText", "I can enter text"); // enter text
|
102 | 101 | driver.executeScript("flutter:waitFor", find.text("I can enter text")); // verify text appears on UI
|
103 | 102 |
|
104 |
| - // @todo should be `pageBack` |
105 |
| - find.pageback().click(); |
| 103 | + find.pageBack().click(); |
106 | 104 | driver.executeScript("flutter:waitFor", buttonFinder);
|
107 | 105 |
|
108 | 106 | find.descendant(
|
109 | 107 | find.ancestor(
|
110 |
| - // @todo should be Java Pattern |
111 |
| - find.bySemanticsLabel(new Regex("counter_semantic")), |
112 |
| - find.byType("Tooltip"), |
113 |
| - false |
| 108 | + find.bySemanticsLabel(Pattern.compile("counter_semantic")), |
| 109 | + find.byType("Tooltip") |
114 | 110 | ),
|
115 |
| - find.byType("Text"), |
116 |
| - false |
| 111 | + find.byType("Text") |
117 | 112 | )
|
118 | 113 | .click()
|
119 | 114 | ;
|
|
0 commit comments