@@ -33,21 +33,20 @@ describe("Camera", () => {
33
33
const takePictureButton = await driver . findElementByText ( "Take Picture" ) ;
34
34
await takePictureButton . click ( ) ;
35
35
if ( isAndroid ) {
36
- let allow = await driver . findElementByText ( "Allow" , SearchOptions . exact ) ;
37
- await allow . click ( ) ;
38
- let allowSecond = await driver . findElementByText ( "Allow" , SearchOptions . exact ) ;
39
- await allowSecond . click ( ) ;
40
- let allowLocation = await driver . findElementByText ( "Allow" , SearchOptions . exact ) ;
41
- await allowLocation . click ( ) ;
42
- let geoTagConfirm = await driver . findElementByTextIfExists ( "Next" , SearchOptions . contains )
43
- if ( geoTagConfirm !== undefined ) {
44
- await geoTagConfirm . click ( ) ;
36
+ let allow = await driver . findElementByTextIfExists ( "Allow" , SearchOptions . exact ) ;
37
+ if ( allow !== undefined ) {
38
+ await allow . click ( ) ;
39
+ allow = await driver . findElementByTextIfExists ( "Allow" , SearchOptions . exact ) ;
40
+ await allow . click ( ) ;
45
41
}
46
-
47
- let shutterBtn = await driver . findElementByAccessibilityId ( "Shutter" ) ;
48
- await shutterBtn . click ( ) ;
49
- let acceptBtn = await driver . findElementByAccessibilityId ( "Done" ) ;
50
- await acceptBtn . click ( ) ;
42
+ const deny = await driver . findElementByTextIfExists ( "Deny" , SearchOptions . exact ) ;
43
+ if ( deny !== undefined ) {
44
+ await deny . click ( ) ;
45
+ }
46
+ let images = await driver . findElementsByClassName ( driver . locators . image ) ; // Take a picture
47
+ await images [ 5 ] . click ( ) ;
48
+ images = await driver . findElementsByClassName ( driver . locators . image ) ; // Accept it
49
+ await images [ 4 ] . click ( ) ;
51
50
} else {
52
51
let ok = await driver . findElementByTextIfExists ( "OK" , SearchOptions . exact ) ;
53
52
if ( ok !== undefined ) {
0 commit comments