-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File added #59
Open
SridattaRishi
wants to merge
2
commits into
master
Choose a base branch
from
SampleChatApp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
File added #59
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
Java/NewAppium_SampleProjects/Chapter9-SampleChatrApplication/Readme.md
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,17 @@ | ||
<h1 style="display:flex;flex-direction:row;align-items: center;"><a target="_blank" rel="noopener noreferrer" href="https://www.pcloudy.com"><img src="/images/pcloudy.png" style="max-width:100%;"></a><span>pCloudy Appium Sample Projects</span></h1> | ||
|
||
## About [pCloudy](https://www.pcloudy.com) | ||
|
||
pCloudy platform provides single click access to real Android and IOS devices directly from your browser. Use these real Mobile Devices to click-and-perform Manual Testing and Automation Testing for your App. Integrate our platform with CI for continuous Automation Testing and test your App on multiple real Mobile Devices with every change of your App. | ||
|
||
pCloudy is a popular mobile testing platform integrated with Appium script which enables you to automate test of mobile apps as well. | ||
|
||
Read more here https://www.pcloudy.com | ||
|
||
Clone the project | ||
Enter pCloudy username & APIKey in Runner class | ||
Enter apk name which should be already there in the cloud driver. | ||
Open Terminal | ||
cd to the directory which contains the project | ||
Run the command mvn test | ||
For more details, please refer below link: https://www.pcloudy.com/appium-integration-architecture-redefined-appium-runs-become-simpler-with-pcloudy/ |
Binary file added
BIN
+1.61 MB
Java/NewAppium_SampleProjects/Chapter9-SampleChatrApplication/pCloudyAppiumDemo.apk
Binary file not shown.
58 changes: 58 additions & 0 deletions
58
Java/NewAppium_SampleProjects/Chapter9-SampleChatrApplication/pom.xml
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,58 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>Chapter2-TestNgwithpCloudyonMultipleDeviceAndroid</groupId> | ||
<artifactId>Chapter2-TestNgwithpCloudyonMultipleDeviceAndroid</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.3</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.20</version> | ||
<configuration> | ||
<suiteXmlFiles> | ||
<suiteXmlFile>testng.xml</suiteXmlFile> | ||
</suiteXmlFiles> | ||
</configuration> | ||
</plugin> | ||
|
||
|
||
</plugins> | ||
</build> | ||
<packaging>jar</packaging> | ||
|
||
<name>Chapter2-TestNgwithpCloudyonMultipleDeviceAndroid</name> | ||
<url>http://maven.apache.org</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- https://mvnrepository.com/artifact/io.appium/java-client --> | ||
<dependency> | ||
<groupId>io.appium</groupId> | ||
<artifactId>java-client</artifactId> | ||
<version>6.0.0-BETA3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<version>6.11</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
</project> |
12 changes: 12 additions & 0 deletions
12
...ampleProjects/Chapter9-SampleChatrApplication/src/com/pCloudy/testNG/DriverIntialize.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,12 @@ | ||
package com.pCloudy.testNG; | ||
|
||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
|
||
import io.appium.java_client.AppiumDriver; | ||
public class DriverIntialize { | ||
|
||
public AppiumDriver<WebElement> driver; | ||
public DesiredCapabilities capability; | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
...wAppium_SampleProjects/Chapter9-SampleChatrApplication/src/com/pCloudy/testNG/Runner.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,72 @@ | ||
package com.pCloudy.testNG; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
import java.text.DateFormat; | ||
import java.text.SimpleDateFormat; | ||
import java.util.ArrayList; | ||
import java.util.Date; | ||
import org.apache.commons.io.FileUtils; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.OutputType; | ||
import org.openqa.selenium.TakesScreenshot; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.BeforeTest; | ||
import org.testng.annotations.Parameters; | ||
import org.testng.annotations.Test; | ||
import io.appium.java_client.AppiumDriver; | ||
import io.appium.java_client.android.AndroidDriver; | ||
import io.appium.java_client.service.local.AppiumDriverLocalService; | ||
|
||
public class Runner { | ||
|
||
AppiumDriverLocalService service; | ||
public AppiumDriver<WebElement> driver; | ||
DriverIntialize driverIntial=new DriverIntialize(); | ||
String folder_name; | ||
DateFormat df; | ||
static ArrayList<AppiumDriver> driverlistAppium=new ArrayList(); | ||
|
||
|
||
@Parameters({"deviceName"}) | ||
@BeforeMethod | ||
public void prepareTest(String deviceName) throws IOException, InterruptedException { | ||
|
||
DesiredCapabilities capabilities = new DesiredCapabilities(); | ||
|
||
capabilities.setCapability("pCloudy_Username", "[email protected]"); | ||
capabilities.setCapability("pCloudy_ApiKey", "m3pbymd6k69622p99dkjtj5k"); | ||
capabilities.setCapability("pCloudy_ApplicationName", "pCloudy_Appium_Demo.apk"); | ||
capabilities.setCapability("pCloudy_DurationInMinutes", 10); | ||
//capabilities.setCapability("pCloudy_DeviceManafacturer", deviceName); | ||
//capabilities.setCapability("pCloudy_DeviceVersion", "8.0.0"); | ||
capabilities.setCapability("pCloudy_DeviceFullName", deviceName); | ||
capabilities.setCapability("newCommandTimeout", 600); | ||
capabilities.setCapability("launchTimeout", 90000); | ||
capabilities.setCapability("appPackage", "com.pcloudy.appiumdemo"); | ||
capabilities.setCapability("appActivity", "com.ba.mobile.LaunchActivity"); | ||
capabilities.setCapability("pCloudy_EnableVideo", true); | ||
|
||
driverIntial.capability=capabilities; | ||
driverIntial.driver= new AndroidDriver(new URL("https://device.pcloudy.com/appiumcloud/wd/hub"), driverIntial.capability); | ||
driverlistAppium.add(driverIntial.driver); | ||
|
||
} | ||
|
||
|
||
|
||
@Test | ||
public void Test() throws IOException, InterruptedException { | ||
|
||
|
||
|
||
} | ||
|
||
|
||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...ppium_SampleProjects/Chapter9-SampleChatrApplication/src/com/pCloudy/testNG/TestCase.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,43 @@ | ||
package com.pCloudy.testNG; | ||
|
||
import java.io.IOException; | ||
|
||
import org.openqa.selenium.By; | ||
|
||
import org.openqa.selenium.WebElement; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.Test; | ||
|
||
import io.appium.java_client.AppiumDriver; | ||
|
||
public class TestCase extends Runner{ | ||
|
||
public AppiumDriver<WebElement> Hostdriver; | ||
public AppiumDriver<WebElement> Childdriver; | ||
|
||
@Test | ||
public void Test() throws IOException, InterruptedException { | ||
|
||
Hostdriver=driverlistAppium.get(0); | ||
Childdriver=driverlistAppium.get(1); | ||
|
||
System.out.println(driverlistAppium.size()); | ||
Hostdriver.findElement(By.xpath("//android.widget.Button[@resource-id='com.pcloudy.appiumdemo:id/accept']")).click(); | ||
Thread.sleep(5000); | ||
|
||
|
||
Childdriver.findElement(By.xpath("//android.widget.Button[@resource-id='com.pcloudy.appiumdemo:id/btnrefuse']")).click(); | ||
Thread.sleep(5000); | ||
|
||
|
||
} | ||
@AfterMethod | ||
public void endTest() throws IOException { | ||
|
||
Hostdriver.quit(); | ||
Childdriver.quit(); | ||
|
||
} | ||
|
||
|
||
} |
16 changes: 16 additions & 0 deletions
16
Java/NewAppium_SampleProjects/Chapter9-SampleChatrApplication/testng.xml
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> | ||
<suite thread-count="3" configfailurepolicy="continue" name="pCloudy Suite" parallel="tests"> | ||
<test name="Test"> | ||
<parameter name="deviceName" value="SAMSUNG_GalaxyJ4Plus_Android_9.0.0_94cc6"/> | ||
<classes> | ||
<class name="com.pCloudy.testNG.Runner"/> | ||
</classes> | ||
</test> <!-- Test --> | ||
<test name="Test1"> | ||
<parameter name="deviceName" value="SAMSUNG_GalaxyS8_Android_8.0.0_7a932"/> | ||
<classes> | ||
<class name="com.pCloudy.testNG.TestCase"/> | ||
</classes> | ||
</test> <!-- Test --> | ||
</suite> <!-- Suite --> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SridattaRishi still the list has been used. Please access the driver through some unique value like deviceName and all