Created
December 20, 2020 05:24
-
-
Save bbchriscesar/4e14bf1a12c255ac9ff99d6a0c7a86ba to your computer and use it in GitHub Desktop.
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
| from Common import Utility as ss | |
| import pytest | |
| import os | |
| appPackageappActivity = "com.android.settings/.Settings" | |
| @pytest.mark.parametrize("lang, udid, systemPort, appPackage, appActivity", [ | |
| ("en-US,ko,ja", "98151FFAZ002QN", "8201", "com.android.settings", ".Settings"), | |
| ("zh-TW,fr,hi", "99151FFAZ008YB", "8202", "com.android.settings", ".Settings") | |
| ] | |
| ) | |
| def test_AndroidTestCase(lang, appPackage, appActivity, udid, systemPort): | |
| for lang in lang.split(","): | |
| ss.setupDriver(appPackage, appActivity, udid, systemPort) | |
| ss.changeLocale(udid, lang) | |
| ss.stopApp(udid, appPackage) | |
| ss.startApp(udid, appPackageappActivity) | |
| path = '/usr/local/google/home/christiannec/IdeaProjects/SaraoAndroidFramework/Screenshots/Sample/' + lang | |
| if not os.path.exists(path): | |
| os.makedirs(path) | |
| # Start your script below... | |
| ss.findAndClickElements(ss.className, "android.widget.RelativeLayout", 0) | |
| ss.takeScreenshot(path + '/' + '001_androidscreenshot') | |
| ss.swipeDown(501, 1683, 501, 484, 100) | |
| # Always quit driver for every locale to avoid caching issue | |
| ss.tearDown(udid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment