Skip to content
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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ matrix:
script:
- npm i -g appium
- cd tests && npm i
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS
- travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_JS
- os: linux
env:
- Android="24"
Expand All @@ -129,7 +129,7 @@ matrix:
script:
- npm i -g appium
- cd tests && npm i
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_VUE
- travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_VUE
- os: linux
env:
- Android="24"
Expand All @@ -140,7 +140,7 @@ matrix:
script:
- npm i -g appium
- cd tests && npm i
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_NG
- travis_wait travis_retry npm run e2e -- --runType android28 --sauceLab --appPath $ANDROID_PACKAGE_NG
- os: linux
env:
- iOS="12.0"
Expand Down
7 changes: 7 additions & 0 deletions tests/e2e/config/appium.capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
"appium-version": "1.7.1",
"noReset": true
},
"android28": {
"platformName": "Android",
"platformVersion": "9.0",
"deviceName": "Android GoogleAPI Emulator",
"appiumVersion": "1.9.1",
"noReset": true
},
"sim11iPhone6": {
"platformName": "iOS",
"platformVersion": "11.0",
Expand Down
22 changes: 5 additions & 17 deletions tests/e2e/test.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,14 @@ describe("Imagepicker", async function () {
const confirmButton = await driver.findElementByText(confirmButtonText);
await confirmButton.click();

if (isAndroid) {
const imagesFolderXpath = await driver.elementHelper.getXPathByText(imagesFolderName, SearchOptions.contains);
await driver.driver.sleep(3000);
let imagesFolder = await driver.driver.elementByXPathIfExists(imagesFolderXpath, 10000);

if (isSauceRun && imagesFolder) {
await imagesFolder.click();
let dcimFolder = await driver.findElementByText("DCIM", SearchOptions.contains);
await dcimFolder.click();
imagesFolder = await driver.findElementByClassName(driver.locators.image);
await imagesFolder.click();
}
} else {
if (!isAndroid) {
const cameraRollFolder = await driver.findElementByAccessibilityId(imagesFolderNameIos);
await cameraRollFolder.click();
}

const imageLocator = isAndroid ? "android.widget.ImageView" : "XCUIElementTypeCell";
const image = await driver.findElementByClassName(imageLocator);
await image.tap();
const images = await driver.findElementsByClassName(imageLocator);
await images[1].tap();

pickSingleButton = await driver.findElementByText(pickSingleButtonText, SearchOptions.contains);
expect(pickSingleButton).to.exist;
Expand All @@ -101,8 +89,8 @@ describe("Imagepicker", async function () {

if (isAndroid) {
const allImages = await driver.findElementsByClassName("android.widget.ImageView");
await allImages[5].hold(); // second Image
await allImages[2].click(); // first image
await allImages[1].hold(); // second Image
await allImages[4].click(); // first image
} else {
const allImages = await driver.findElementsByClassName("XCUIElementTypeCell");
await allImages[0].click(); // first image
Expand Down