forked from JasmineChiu/sample-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Next steps are: - tp implement sample of tests - to add comments.
- Loading branch information
1 parent
722b9dd
commit 621333d
Showing
4 changed files
with
251 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...st/java/com/saucelabs/appium/page_object/android/ApiDemosListViewScreenByAllPossible.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,27 @@ | ||
package com.saucelabs.appium.page_object.android; | ||
|
||
import io.appium.java_client.MobileElement; | ||
|
||
import java.util.List; | ||
import io.appium.java_client.android.AndroidElement; | ||
import io.appium.java_client.pagefactory.AndroidFindAll; | ||
import io.appium.java_client.pagefactory.AndroidFindBy; | ||
|
||
public class ApiDemosListViewScreenByAllPossible { | ||
|
||
@AndroidFindAll({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/Fakecontent\")"), | ||
@AndroidFindBy(id = "android:id/Faketext1"), | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), //by this locator element is found | ||
@AndroidFindBy(id = "android:id/FakeId") | ||
}) | ||
public List<MobileElement> findAllElementViews; | ||
|
||
@AndroidFindAll({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/Fakecontent\")"), | ||
@AndroidFindBy(id = "android:id/Faketext1"), | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), //by this locator element is found | ||
@AndroidFindBy(id = "android:id/FakeId") | ||
}) | ||
public AndroidElement findAllElementView; | ||
} |
59 changes: 59 additions & 0 deletions
59
...src/test/java/com/saucelabs/appium/page_object/android/ApiDemosListViewScreenChaided.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,59 @@ | ||
package com.saucelabs.appium.page_object.android; | ||
|
||
import io.appium.java_client.android.AndroidElement; | ||
import java.util.List; | ||
import org.openqa.selenium.WebElement; | ||
import io.appium.java_client.pagefactory.AndroidFindBy; | ||
import io.appium.java_client.pagefactory.AndroidFindBys; | ||
import io.appium.java_client.pagefactory.iOSFindBy; | ||
import io.appium.java_client.pagefactory.iOSFindBys; | ||
|
||
public class ApiDemosListViewScreenChaided { | ||
|
||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(className = "android.widget.TextView") | ||
}) | ||
public List<WebElement> chainElementViews; | ||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/content\")"), | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(id = "android:id/text1") | ||
}) | ||
@iOSFindBys({@iOSFindBy(uiAutomator = ".elements()[0]"), | ||
@iOSFindBy(xpath = "//someElement")}) | ||
public List<WebElement> chainAndroidOrIOSUIAutomatorViews; | ||
|
||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(className = "android.widget.TextView") | ||
}) | ||
public WebElement chainElementView; | ||
|
||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/content\")"), | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(id = "android:id/text1") | ||
}) | ||
@iOSFindBys({@iOSFindBy(uiAutomator = ".elements()[0]"), | ||
@iOSFindBy(xpath = "//someElement")}) | ||
public WebElement chainAndroidOrIOSUIAutomatorView; | ||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/content\")"), | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(id = "android:id/text1") | ||
}) | ||
public AndroidElement androidElementView; | ||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/content\")"), | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(id = "android:id/text1") | ||
}) | ||
public List<AndroidElement> androidElementViews; | ||
} |
65 changes: 65 additions & 0 deletions
65
.../src/test/java/com/saucelabs/appium/page_object/android/ApiDemosListViewScreenSimple.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,65 @@ | ||
package com.saucelabs.appium.page_object.android; | ||
|
||
import io.appium.java_client.MobileElement; | ||
import io.appium.java_client.pagefactory.AndroidFindBy; | ||
import io.appium.java_client.pagefactory.iOSFindBy; | ||
|
||
import java.util.List; | ||
|
||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.remote.RemoteWebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
|
||
public class ApiDemosListViewScreenSimple { | ||
|
||
@FindBy(className = "android.widget.TextView") | ||
public List<WebElement> textVieWs; | ||
|
||
@AndroidFindBy(className = "android.widget.TextView") | ||
public List<WebElement> androidTextViews; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public List<WebElement> iosTextViews; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
@AndroidFindBy(className = "android.widget.TextView") | ||
public List<WebElement> androidOriOsTextViews; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public List<WebElement> androidUIAutomatorViews; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public List<MobileElement> mobileElementViews; | ||
|
||
@FindBy(className = "android.widget.TextView") | ||
public List<MobileElement> mobiletextVieWs; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public List<RemoteWebElement> remoteElementViews; | ||
|
||
@FindBy(id = "android:id/text1") | ||
public WebElement textView; | ||
|
||
@AndroidFindBy(className = "android.widget.TextView") | ||
public WebElement androidTextView; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public WebElement iosTextView; | ||
|
||
@AndroidFindBy(className = "android.widget.TextView") | ||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public WebElement androidOriOsTextView; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public WebElement androidUIAutomatorView; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public MobileElement mobileElementView; | ||
|
||
@FindBy(className = "android.widget.TextView") | ||
public MobileElement mobiletextVieW; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public RemoteWebElement remotetextVieW; | ||
|
||
} |
100 changes: 100 additions & 0 deletions
100
.../java/junit/src/test/java/com/saucelabs/appium/page_object/ios/UICatalogScreenSimple.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,100 @@ | ||
package com.saucelabs.appium.page_object.ios; | ||
|
||
import io.appium.java_client.MobileElement; | ||
import io.appium.java_client.ios.IOSElement; | ||
import io.appium.java_client.pagefactory.AndroidFindBy; | ||
import io.appium.java_client.pagefactory.iOSFindBy; | ||
|
||
import java.util.List; | ||
|
||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.remote.RemoteWebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
|
||
import io.appium.java_client.pagefactory.AndroidFindBys; | ||
import io.appium.java_client.pagefactory.iOSFindAll;; | ||
|
||
public class UICatalogScreenSimple { | ||
|
||
@FindBy(className = "UIAButton") | ||
public List<WebElement> uiButtons; | ||
|
||
@FindBy(className = "UIAButton") | ||
public List<WebElement> iosUIButtons; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public List<WebElement> iosUIAutomatorButtons; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
@AndroidFindBy(className = "android.widget.TextView") | ||
public List<WebElement> androidOriOsTextViews; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public List<WebElement> androidUIAutomatorViews; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public List<MobileElement> mobileButtons; | ||
|
||
@FindBy(className = "UIAButton") | ||
public List<MobileElement> mobiletFindBy_Buttons; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public List<RemoteWebElement> remoteElementViews; | ||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(className = "android.widget.TextView") | ||
}) | ||
public List<WebElement> chainElementViews; | ||
|
||
|
||
@FindBy(className = "UIAButton") | ||
public WebElement uiButton; | ||
|
||
@FindBy(className = "UIAButton") | ||
public WebElement iosUIButton; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public WebElement iosUIAutomatorButton; | ||
|
||
@AndroidFindBy(className = "android.widget.TextView") | ||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public WebElement androidOriOsTextView; | ||
|
||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/text1\")") | ||
public WebElement androidUIAutomatorView; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public MobileElement mobileButton; | ||
|
||
@FindBy(className = "UIAButton") | ||
public MobileElement mobiletFindBy_Button; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public RemoteWebElement remotetextVieW; | ||
|
||
@AndroidFindBys({ | ||
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/list\")"), | ||
@AndroidFindBy(className = "android.widget.TextView") | ||
}) | ||
public WebElement chainElementView; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public IOSElement iosButton; | ||
|
||
@iOSFindBy(uiAutomator = ".elements()[0]") | ||
public List<IOSElement> iosButtons; | ||
|
||
@iOSFindAll({ | ||
@iOSFindBy(xpath = "ComputeSumButton_Test"), | ||
@iOSFindBy(name = "ComputeSumButton") //it is real locator | ||
}) | ||
public WebElement findAllElement; | ||
|
||
@iOSFindAll({ | ||
@iOSFindBy(xpath = "ComputeSumButton_Test"), | ||
@iOSFindBy(name = "ComputeSumButton") //it is real locator | ||
}) | ||
public List<WebElement> findAllElements; | ||
|
||
} |