1
1
import { AppiumDriver , createDriver , SearchOptions } from "nativescript-dev-appium" ;
2
- import { isSauceLab , runType , capabilitiesName } from "nativescript-dev-appium/lib/parser" ;
2
+ import { isSauceLab , runType } from "nativescript-dev-appium/lib/parser" ;
3
3
import { expect } from "chai" ;
4
4
5
5
const isSauceRun = isSauceLab ;
@@ -30,9 +30,8 @@ describe("Imagepicker", async function () {
30
30
// await driver.driver.resetApp();
31
31
const pickSingleButtonText = "Pick Single" ;
32
32
let confirmButtonText = isAndroid ? "Allow" : "OK" ;
33
- let uploadPicVerification = "image 0" ;
34
33
35
- const pickSingleButton = await driver . findElementByText ( pickSingleButtonText , SearchOptions . contains ) ;
34
+ let pickSingleButton = await driver . findElementByText ( pickSingleButtonText , SearchOptions . contains ) ;
36
35
await pickSingleButton . click ( ) ;
37
36
const confirmButton = await driver . findElementByText ( confirmButtonText ) ;
38
37
await confirmButton . click ( ) ;
@@ -44,8 +43,6 @@ describe("Imagepicker", async function () {
44
43
45
44
if ( isSauceRun && imagesFolder ) {
46
45
await imagesFolder . click ( ) ;
47
- const downloadFolder = await driver . findElementByClassName ( driver . locators . image ) ;
48
- await downloadFolder . click ( ) ;
49
46
}
50
47
} else {
51
48
const cameraRollFolder = await driver . findElementByText ( imagesFolderNameIos ) ;
@@ -55,7 +52,10 @@ describe("Imagepicker", async function () {
55
52
const pickedImage = await driver . findElementByClassName ( driver . locators . image ) ;
56
53
await pickedImage . click ( ) ;
57
54
58
- const result = await driver . findElementByText ( uploadPicVerification , SearchOptions . contains ) ;
55
+ pickSingleButton = await driver . findElementByText ( pickSingleButtonText , SearchOptions . contains ) ;
56
+ expect ( pickSingleButton ) . to . exist ;
57
+
58
+ const result = await driver . findElementByClassName ( driver . locators . image ) ;
59
59
expect ( result ) . to . exist ;
60
60
} ) ;
61
61
0 commit comments