@@ -34,14 +34,14 @@ describe("sample scenario", () => {
34
34
await btnNav . tap ( ) ;
35
35
36
36
const secondPage = await driver . findElementByText ( "Second Page" ) ;
37
- const btn = await driver . findElementByText ( "btn" ) ;
38
-
39
- const result = await driver . compareElement ( btn , getButtonImageName ( ) ) ;
40
- assert . isTrue ( result ) ;
41
-
42
- await btn . tap ( ) ;
43
- assert . equal ( await btn . text ( ) , 1 ) ;
37
+ const btnZero = await driver . findElementByText ( "0" ) ;
38
+ await btnZero . tap ( ) ;
44
39
40
+ // In iOS, the `automationText` property applies on both `name` and `label`:
41
+ // https://github.com/NativeScript/NativeScript/issues/3150
42
+ // <XCUIElementTypeButton type="XCUIElementTypeButton" name="0" label="0" enabled="true" visible="true" x="132" y="395" width="111" height="110"/>
43
+ // <XCUIElementTypeButton type="XCUIElementTypeButton" name="btn" label="btn" enabled="true" visible="true" x="132" y="395" width="111" height="110"/>
44
+ const btnOne = await driver . findElementByText ( "1" ) ;
45
45
await driver . navBack ( ) ;
46
46
} ) ;
47
47
@@ -63,12 +63,10 @@ describe("sample scenario", () => {
63
63
for ( let styleType in styleTypes ) {
64
64
it ( `should find an element with ${ styleType } style applied` , async function ( ) {
65
65
const element = await driver . findElementByText ( styleTypes [ styleType ] ) ;
66
- const result = await driver . compareElement ( element , getPlatformImageName ( ) ) ;
66
+ const result = await driver . compareElement ( element , "style" ) ;
67
67
assert . isTrue ( result ) ;
68
68
} ) ;
69
69
}
70
70
71
- const getButtonImageName = ( ) => { return driver . isAndroid ? "btnAndroid" : "btnIOS" ; }
72
- const getPlatformImageName = ( ) => { return driver . isAndroid ? "styleAndroid" : "styleIOS" ; }
73
71
const getPlatformLabel = async ( ) => { return driver . isAndroid ? await driver . findElementByText ( "android" ) : await driver . findElementByText ( "ios" ) ; }
74
72
} ) ;
0 commit comments