Skip to content

Commit 0870cca

Browse files
author
Elena Hristova
committed
fix ui tests
1 parent f278abb commit 0870cca

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

demo/e2e/test.e2e.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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";
33
import { expect } from "chai";
44

55
const isSauceRun = isSauceLab;
@@ -30,9 +30,8 @@ describe("Imagepicker", async function () {
3030
// await driver.driver.resetApp();
3131
const pickSingleButtonText = "Pick Single";
3232
let confirmButtonText = isAndroid ? "Allow" : "OK";
33-
let uploadPicVerification = "image 0";
3433

35-
const pickSingleButton = await driver.findElementByText(pickSingleButtonText, SearchOptions.contains);
34+
let pickSingleButton = await driver.findElementByText(pickSingleButtonText, SearchOptions.contains);
3635
await pickSingleButton.click();
3736
const confirmButton = await driver.findElementByText(confirmButtonText);
3837
await confirmButton.click();
@@ -44,8 +43,6 @@ describe("Imagepicker", async function () {
4443

4544
if (isSauceRun && imagesFolder) {
4645
await imagesFolder.click();
47-
const downloadFolder = await driver.findElementByClassName(driver.locators.image);
48-
await downloadFolder.click();
4946
}
5047
} else {
5148
const cameraRollFolder = await driver.findElementByText(imagesFolderNameIos);
@@ -55,7 +52,10 @@ describe("Imagepicker", async function () {
5552
const pickedImage = await driver.findElementByClassName(driver.locators.image);
5653
await pickedImage.click();
5754

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);
5959
expect(result).to.exist;
6060
});
6161

0 commit comments

Comments
 (0)