-
-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repeatable annotations & HasSessionDetails API (#497)
* Migration to Java 8: Repeatable annotations - deprecated annotations: AndroidFindAll, AndroidFindBys, iOSFindAll, iOSFindBys, SelendroidFindAll, SelendroidFindBys. - new annotations were added: AndroidFindBySet, iOSFindBySet, SelendroidFindBySet, HowToUseLocators. * Additional refactoring: Required HasSessionDetails API was added - added interface HasSessionDetails which contains methods with default implementation. It is implemented by AppiumDriver and MobileElement - AndroidDriverTest was modified. * Additional refactoring: MobileElement doesn't implement HasSessionDetails API * Additional refactoring: Migration of page object tools to the HasSessionDetails API was finished * Migration to repeatable annotations is finished. It needs for the testing. * Migration to repeatable page object annotations is finished * chromedriver was updated for the testing * Documentation was updated * Missed javadocs were provided. Checkstyle issues were fixed. * Merge branch 'master' of https://github.com/appium/java-client into repeatable_annotations # Conflicts: # src/main/java/io/appium/java_client/AppiumDriver.java * The bug fix.
- Loading branch information
1 parent
728d400
commit e2dafc7
Showing
38 changed files
with
645 additions
and
255 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
38 changes: 38 additions & 0 deletions
38
src/main/java/io/appium/java_client/HasSessionDetails.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.appium.java_client; | ||
|
||
import static io.appium.java_client.MobileCommand.GET_SESSION; | ||
|
||
import org.openqa.selenium.remote.Response; | ||
|
||
import java.util.Map; | ||
|
||
public interface HasSessionDetails extends ExecutesMethod { | ||
/** | ||
* @return a map with values that hold session details. | ||
* | ||
*/ | ||
default Map<String, Object> getSessionDetails() { | ||
Response response = execute(GET_SESSION); | ||
return (Map<String, Object>) response.getValue(); | ||
} | ||
|
||
default Object getSessionDetail(String detail) { | ||
return getSessionDetails().get(detail); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.