Alert API Implementation for iOS#459
Merged
TikhomirovSergey merged 1 commit intoappium:masterappium/java-client:masterfrom Aug 19, 2016
SrinivasanTarget:alerthandlingCopy head branch name to clipboard
Merged
Alert API Implementation for iOS#459TikhomirovSergey merged 1 commit intoappium:masterappium/java-client:masterfrom SrinivasanTarget:alerthandlingCopy head branch name to clipboard
TikhomirovSergey merged 1 commit intoappium:masterappium/java-client:masterfrom
SrinivasanTarget:alerthandlingCopy head branch name to clipboard
Conversation
Contributor
|
@SrinivasanTarget public class IOSDriver<T extends WebElement>
extends AppiumDriver<T>
implements IOSDeviceActionShortcuts,
FindsByIosUIAutomation<T> {
...
@Override public TargetLocator switchTo() {
return new InnerTargetLocator();
}
private class InnerTargetLocator extends RemoteTargetLocator {
@Override public Alert alert() {
return new IOSAlert(super.alert());
}
}
class IOSAlert implements Alert {
private final Alert alert;
IOSAlert(Alert alert) {
this.alert = alert;
}
@Override
public void dismiss() {
alert.dismiss();
}
@Override
public void accept() {
alert.accept();
}
@Override
public String getText() {
Response response = execute(DriverCommand.GET_ALERT_TEXT);
return response.getValue().toString();
}
@Override
public void sendKeys(String keysToSend) {
execute(DriverCommand.SET_ALERT_VALUE, prepareArguments("value", keysToSend));
}
@Override
public void setCredentials(Credentials credentials) {
alert.setCredentials(credentials);
}
@Override
public void authenticateUsing(Credentials credentials) {
alert.authenticateUsing(credentials);
}
}
} |
Contributor
|
There are new checkstyle issues: @SrinivasanTarget Please get it fixed |
| .IosUIAutomation(".elements().withName(\"show alert\")")).click(); | ||
| WebDriverWait wating = new WebDriverWait(driver, 10000); | ||
| wating.until(alertIsPresent()); | ||
| assertNotNull(driver.switchTo().alert().getText()); |
Contributor
There was a problem hiding this comment.
@SrinivasanTarget
I would like to advive you to
assertTrue(!StringUtils.isBlank(driver.switchTo().alert().getText()));What if the empty string would be returned? :)
Member
Author
|
@TikhomirovSergey Thanks.I have incorporated the changes now and squashed the commits. |
Implementation changes Fixed Checkstyle issues Fixed Checkstyle issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Change list
Alert Handling for iOS.Added below methods,
API is here: https://github.com/appium/appium-base-driver/blob/master/lib/mjsonwp/routes.js#L403
API's were not implemented for Android Driver on server side.We can port it to android driver on client side post server implementation.
New W3C API's here: https://github.com/appium/appium-base-driver/blob/master/lib/mjsonwp/routes.js#L414 are not been adapted by Appium (Legacy drivers on server) yet.
Types of changes
What types of changes are you proposing/introducing to Java client?
Put an
xin the boxes that apply@TikhomirovSergey please review