@@ -12,7 +12,8 @@ interface ElementTuple {
12
12
button : UIElement ,
13
13
}
14
14
15
- describe ( "ngForOf scenario" , ( ) => {
15
+ describe ( "ngForOf scenario" , function ( ) {
16
+ this . retries ( 2 ) ;
16
17
let driver : AppiumDriver ;
17
18
let addButton : UIElement ;
18
19
let removeButton : UIElement ;
@@ -94,7 +95,11 @@ describe("ngForOf scenario", () => {
94
95
await button . click ( ) ;
95
96
} else {
96
97
index = elements . length - 1 ;
97
- await removeButton . click ( ) ;
98
+ if ( driver . platformName . toLowerCase ( ) . includes ( "ios" ) ) {
99
+ await removeButton . tap ( ) ;
100
+ } else {
101
+ await removeButton . click ( ) ;
102
+ }
98
103
}
99
104
100
105
elements . splice ( index , 1 ) ;
@@ -135,11 +140,22 @@ describe("ngForOf scenario", () => {
135
140
} ;
136
141
137
142
const getElement = async ( id : number ) => {
138
- const label = await driver . findElementByText (
139
- "label: " + id . toString ( ) , SearchOptions . exact ) ;
143
+ let label = null ;
144
+ let button = null ;
145
+
146
+ if ( driver . platformName . toLowerCase ( ) . includes ( "ios" ) ) {
147
+ label = await driver . findElementByAccessibilityId (
148
+ "label: " + id . toString ( ) ) ;
149
+
150
+ button = await driver . findElementByAccessibilityId (
151
+ id . toString ( ) ) ;
152
+ } else {
153
+ label = await driver . findElementByText (
154
+ "label: " + id . toString ( ) , SearchOptions . exact ) ;
140
155
141
- const button = await driver . findElementByText (
142
- id . toString ( ) , SearchOptions . exact ) ;
156
+ button = await driver . findElementByText (
157
+ id . toString ( ) , SearchOptions . exact ) ;
158
+ }
143
159
144
160
return { label, button } ;
145
161
} ;
0 commit comments