-
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.
Added webdriver config for Android and IOS
- Loading branch information
1 parent
a86717d
commit 9d83416
Showing
11 changed files
with
231 additions
and
309 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
34 changes: 34 additions & 0 deletions
34
appium/src/main/java/eu/tsystems/mms/tic/testframework/mobile/driver/AndroidConfig.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,34 @@ | ||
/* | ||
* Testerra | ||
* | ||
* (C) 2024, Martin Großmann, Deutsche Telekom 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.mobile.driver; | ||
|
||
import eu.tsystems.mms.tic.testframework.useragents.UserAgentConfig; | ||
import io.appium.java_client.android.options.UiAutomator2Options; | ||
import io.appium.java_client.ios.options.XCUITestOptions; | ||
|
||
/** | ||
* Created on 2024-07-18 | ||
* | ||
* @author mgn | ||
*/ | ||
public interface AndroidConfig extends UserAgentConfig<UiAutomator2Options> { | ||
} |
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
33 changes: 33 additions & 0 deletions
33
appium/src/main/java/eu/tsystems/mms/tic/testframework/mobile/driver/IOSConfig.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,33 @@ | ||
/* | ||
* Testerra | ||
* | ||
* (C) 2024, Martin Großmann, Deutsche Telekom 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.mobile.driver; | ||
|
||
import eu.tsystems.mms.tic.testframework.useragents.UserAgentConfig; | ||
import io.appium.java_client.ios.options.XCUITestOptions; | ||
|
||
/** | ||
* Created on 2024-07-18 | ||
* | ||
* @author mgn | ||
*/ | ||
public interface IOSConfig extends UserAgentConfig<XCUITestOptions> { | ||
} |
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
33 changes: 33 additions & 0 deletions
33
appium/src/main/java/eu/tsystems/mms/tic/testframework/mobile/driver/SafariMobileConfig.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,33 @@ | ||
/* | ||
* Testerra | ||
* | ||
* (C) 2024, Martin Großmann, Deutsche Telekom 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.mobile.driver; | ||
|
||
import eu.tsystems.mms.tic.testframework.useragents.UserAgentConfig; | ||
import io.appium.java_client.safari.options.SafariOptions; | ||
|
||
/** | ||
* Created on 2024-07-18 | ||
* | ||
* @author mgn | ||
*/ | ||
public interface SafariMobileConfig extends UserAgentConfig<SafariOptions> { | ||
} |
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
.../test/java/eu/tsystems/mms/tic/testframework/mobile/test/apps/TesterraMobileApp2Test.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 @@ | ||
package eu.tsystems.mms.tic.testframework.mobile.test.apps; | ||
|
||
import eu.tsystems.mms.tic.testframework.appium.Browsers; | ||
import eu.tsystems.mms.tic.testframework.mobile.driver.AndroidConfig; | ||
import eu.tsystems.mms.tic.testframework.mobile.driver.IOSConfig; | ||
import eu.tsystems.mms.tic.testframework.mobile.test.AbstractAppiumTest; | ||
import eu.tsystems.mms.tic.testframework.utils.TimerUtils; | ||
import eu.tsystems.mms.tic.testframework.utils.UITestUtils; | ||
import org.openqa.selenium.WebDriver; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* Created on 2024-07-17 | ||
* | ||
* @author mgn | ||
*/ | ||
public class TesterraMobileApp2Test extends AbstractAppiumTest { | ||
|
||
@BeforeClass | ||
public void initCaps() { | ||
WEB_DRIVER_MANAGER.setUserAgentConfig(Browsers.android, (AndroidConfig) options -> { | ||
options.setApp("cloud:com.telekom.mms.cqa.mdc.androidapp/.HomeActivity"); | ||
options.setAppPackage("com.telekom.mms.cqa.mdc.androidapp"); | ||
options.setAppActivity(".HomeActivity"); | ||
}); | ||
|
||
WEB_DRIVER_MANAGER.setUserAgentConfig(Browsers.ios, (IOSConfig) options -> { | ||
options.setApp("cloud:com.telekom.mms.cqa.mdc.iosapp"); | ||
options.setBundleId("com.telekom.mms.cqa.mdc.iosapp"); | ||
}); | ||
} | ||
|
||
/** | ||
* This test opens the mobile app on iOS and Android. | ||
* <p> | ||
* The platform specific caps are set by the method 'initCaps'. | ||
* The property 'tt.browser' defines which platform should used for test: | ||
* tt.browser=android or tt.browser=ios | ||
* <p> | ||
* If a device query is needed, the properties 'tt.mobile.device.query.ios' and | ||
* 'tt.mobile.device.query.android' are used to select a device from a cloud. | ||
*/ | ||
@Test | ||
public void testT01OpenApp() { | ||
WebDriver webDriver = WEB_DRIVER_MANAGER.getWebDriver(); | ||
TimerUtils.sleep(4000); | ||
UITestUtils.takeScreenshots(); | ||
} | ||
|
||
} |
Oops, something went wrong.