-
-
Notifications
You must be signed in to change notification settings - Fork 764
#714 FIX #717
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
Changes from 4 commits
2cec7be
2b2ebe5
6bdf9f7
168d9d8
feb1efb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,6 @@ | |
import static io.appium.java_client.pagefactory.ThrowableUtil.isStaleElementReferenceException; | ||
|
||
|
||
import com.google.common.base.Function; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mykola-mokhnach No |
||
|
||
import io.appium.java_client.pagefactory.locator.CacheableLocator; | ||
|
||
import org.openqa.selenium.By; | ||
|
@@ -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 { | ||
|
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; | ||
|
@@ -17,18 +16,15 @@ 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; | ||
if (result.size() == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. return result.isEmpty() ? null : result; |
||
return null; | ||
} | ||
|
||
return result; | ||
}).size()); | ||
} | ||
} |
There was a problem hiding this comment.
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'?
There was a problem hiding this comment.
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.