-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from telekom/feature/support-apps
Support native app automation
- Loading branch information
Showing
28 changed files
with
1,191 additions
and
376 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
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
51 changes: 51 additions & 0 deletions
51
appium/src/main/java/eu/tsystems/mms/tic/testframework/appium/AppiumContext.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,51 @@ | ||
/* | ||
* Testerra | ||
* | ||
* (C) 2022, Daniel Eckardt, T-Systems MMS GmbH, Deutsche Telekom AG | ||
* | ||
* Deutsche Telekom AG and all other contributors / | ||
* copyright owners license this file to you under the Apache | ||
* License, Version 2.0 (the "License"); you may not use this | ||
* file except in compliance with the License. | ||
* 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 eu.tsystems.mms.tic.testframework.appium; | ||
|
||
import io.appium.java_client.AppiumDriver; | ||
|
||
/** | ||
* Created on 2023-03-27 | ||
* | ||
* @author mgn | ||
*/ | ||
public enum AppiumContext { | ||
|
||
/** | ||
* The context ({@link AppiumDriver#getContext()}) of the current view of the application is an operating system native. | ||
*/ | ||
NATIVE_APP, | ||
/** | ||
* The context ({@link AppiumDriver#getContext()}) of the current view of the application is a (embedded) browser. {@see | ||
* http://appium.io/docs/en/writing-running-appium/web/hybrid/index.html} | ||
*/ | ||
WEBVIEW; | ||
|
||
public static AppiumContext parse(String string) { | ||
// there's only two NATIVE_APP contexts (NATIVE_APP and NATIVE_APP_INSTRUMENTED), | ||
// but an infinite amount of WEBVIEW contexts, like WEBVIEW, SAFARI, CHROMIUM, WEBVIEW_1, WEBVIEW_2 etc. | ||
// that's why we just assume that any context starting with NATIVE_APP is native and the rest WEBVIEW: | ||
AppiumContext result = string == null || string.toLowerCase().startsWith("native_app") ? NATIVE_APP : WEBVIEW; | ||
// LOGGER.debug(String.format("Parsed %s as %s", string, result)); | ||
return result; | ||
} | ||
|
||
} |
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.