Skip to content
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

#714 FIX #717

Merged
merged 5 commits into from
Sep 2, 2017
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
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]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point to set a range, which includes only one item? Isn't it simply equal to '3.5.3'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mykola-mokhnach The purpose is to make a valid pom.xml file. The version like 3.5+ is malformed for maven.


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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also see this import in several other sources - are they all expected?

Copy link
Contributor Author

@TikhomirovSergey TikhomirovSergey Sep 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mykola-mokhnach No
Except the AppiumFunction class. I improved sourses at my last commit


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