Skip to content

fix: android images location #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ demo-angular/report/stats.json
/src/platforms/android/nativescript_imagepicker.aar
/src/*.tgz
!demo-vue/app/app.js

// Tests
**/mochawesome-report/
test-results.xml
10 changes: 10 additions & 0 deletions tests/e2e/helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { AppiumDriver } from "nativescript-dev-appium";

export async function findAndroidImages(driver: AppiumDriver) {
const sidedrawer = await driver.findElementByAccessibilityId("Show roots");
await sidedrawer.click();
const images = await driver.findElementByText("Images");
await images.click();
const dcimFolder = await driver.findElementByText("DCIM");
await dcimFolder.click();
}
11 changes: 11 additions & 0 deletions tests/e2e/test.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
import { isSauceLab, runType } from "nativescript-dev-appium/lib/parser";
import { expect } from "chai";
import { findAndroidImages } from "./helper";
const fs = require('fs');
const addContext = require('mochawesome/addContext');
const rimraf = require('rimraf');
Expand Down Expand Up @@ -57,6 +58,11 @@ describe("Imagepicker", async function () {
const confirmButton = await driver.findElementByText(confirmButtonText);
await confirmButton.click();

// TODO remove when SauceLabs fix images location
if (isAndroid) {
await findAndroidImages(driver);
}

if (!isAndroid) {
const cameraRollFolder = await driver.findElementByAccessibilityId(imagesFolderNameIos);
await cameraRollFolder.click();
Expand All @@ -82,6 +88,11 @@ describe("Imagepicker", async function () {
const pickMultipleButton = await driver.findElementByText(pickMultipleButtonText, SearchOptions.contains);
await pickMultipleButton.click();

// TODO remove when SauceLabs fix images location
if (isAndroid) {
await findAndroidImages(driver);
}

if (!isAndroid) {
const cameraRollFolder = await driver.findElementByText(imagesFolderNameIos);
await cameraRollFolder.click();
Expand Down