Skip to content

Commit

Permalink
Merge pull request #717 from TikhomirovSergey/master
Browse files Browse the repository at this point in the history
#714 FIX
  • Loading branch information
TikhomirovSergey authored Sep 2, 2017
2 parents 3c776c7 + feb1efb commit 4e47690
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 28 deletions.
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apply plugin: 'signing'
apply plugin: 'maven-publish'

group 'io.appium'
version '5.0.1'
version '5.0.2'

repositories {
jcenter()
Expand Down Expand Up @@ -38,7 +38,7 @@ configurations {
}

dependencies {
ecj 'org.eclipse.jdt.core.compiler:ecj:4.5.1'
ecj 'org.eclipse.jdt.core.compiler:ecj:4.6.1'
}

compileJava {
Expand All @@ -54,14 +54,18 @@ compileJava {
]
}

ext.seleniumVersion = '[3.5.2,3.5.2]'
ext.seleniumVersion = '[3.5.3,3.5.3]'

dependencies {
compile ("org.seleniumhq.selenium:selenium-java:${seleniumVersion}") {
force = true

exclude module: 'cglib'
exclude group: 'com.google.code.gson'
exclude module: 'phantomjsdriver'
exclude module: 'htmlunit-driver'
exclude group: 'net.sourceforge.htmlunit'

}
compile ("org.seleniumhq.selenium:selenium-support:${seleniumVersion}") {
force = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static io.appium.java_client.pagefactory.ThrowableUtil.isStaleElementReferenceException;


import com.google.common.base.Function;

import io.appium.java_client.pagefactory.locator.CacheableLocator;

import org.openqa.selenium.By;
Expand All @@ -38,6 +36,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.function.Supplier;

class AppiumElementLocator implements CacheableLocator {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package io.appium.java_client.android;

import static org.junit.Assert.assertNotEquals;
import static org.openqa.selenium.By.id;

import com.google.common.base.Function;

import org.junit.Test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.util.List;
Expand All @@ -17,18 +16,11 @@ public void openNotification() throws Exception {
driver.closeApp();
driver.openNotifications();
WebDriverWait wait = new WebDriverWait(driver, 20);
assertNotEquals(0, wait.until(new Function<WebDriver, List<AndroidElement>>() {
@Override
public List<AndroidElement> apply(WebDriver input) {
List<AndroidElement> result = driver
.findElementsById("com.android.systemui:id/carrier_label");
assertNotEquals(0, wait.until(input -> {
List<AndroidElement> result = input
.findElements(id("com.android.systemui:id/carrier_label"));

if (result.size() == 0) {
return null;
}

return result;
}
return result.isEmpty() ? null : result;
}).size());
}
}
15 changes: 5 additions & 10 deletions src/test/java/io/appium/java_client/ios/IOSElementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

import com.google.common.base.Function;

import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.WebDriverWait;

Expand All @@ -32,15 +30,12 @@ public class IOSElementTest extends UICatalogIOSTest {

WebDriverWait wait = new WebDriverWait(driver, 20);

IOSElement slider = (IOSElement) wait.until(new Function<WebDriver, List<WebElement>>() {
@Override
public List<WebElement> apply(WebDriver input) {
List<WebElement> result = input.findElements(By.className("UIASlider"));
if (result.size() == 0) {
return null;
}
return result;
IOSElement slider = (IOSElement) wait.until(input -> {
List<WebElement> result = input.findElements(By.className("UIASlider"));
if (result.size() == 0) {
return null;
}
return result;
}).get(1);
slider.setValue("0%");
assertEquals("0%", slider.getAttribute("value"));
Expand Down

0 comments on commit 4e47690

Please sign in to comment.