Skip to content

TTN-23587 updated java version and and locator starategy in both andr… #16

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ hs_err_pid*
.DS_Store
/.idea/
/target/
.idea/
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down
16 changes: 8 additions & 8 deletions src/test/java/com/lambdatest/android.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ public void setUp() throws Exception {
public void testSimple() throws Exception {
try {
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("color"))).click();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("geoLocation"))).click();
driver.findElement(MobileBy.id("color")).click();
driver.findElement(MobileBy.id("geoLocation")).click();
Thread.sleep(5000);
driver.navigate().back();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("Text"))).click();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("notification"))).click();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("toast"))).click();
wait.until(ExpectedConditions.elementToBeClickable(By.id("webview"))).click();
driver.findElement(MobileBy.id("Text")).click();
driver.findElement(MobileBy.id("notification")).click();
driver.findElement(MobileBy.id("toast")).click();
driver.findElement(By.id("webview")).click();
Thread.sleep(10000);
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("url"))).sendKeys("https://www.lambdatest.com/");
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("find"))).click();
driver.findElement(MobileBy.id("url")).sendKeys("https://www.lambdatest.com/");
driver.findElement(MobileBy.id("find")).click();
Thread.sleep(5000);
driver.navigate().back();
status = "passed";
Expand Down
49 changes: 37 additions & 12 deletions src/test/java/com/lambdatest/ios.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.By;
Expand Down Expand Up @@ -44,21 +45,45 @@ public void setUp() throws Exception {
@Test
public void testSimple() throws Exception {
try {
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("color"))).click();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("geoLocation"))).click();
Thread.sleep(5000);

WebDriverWait Wait = new WebDriverWait(driver, 30);
//Changing Locator type from Accessibility ID to Name as in the Proverbial app there is no Accessibility ID Attribute for Any Element
//Changes the color of the text
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("color"))).click();
Thread.sleep(1000);

//Changes the text to "Proverbial"
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("Text"))).click();
Thread.sleep(1000);

//Toast will be visible
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("toast"))).click();
Thread.sleep(1000);

//Notification will be visible
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("notification"))).click();
Thread.sleep(4000);

//Opens the geolocation page
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("geoLocation"))).click();
Thread.sleep(4000);

//Takes back
driver.navigate().back();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("Text"))).click();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("notification"))).click();
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("toast"))).click();
wait.until(ExpectedConditions.elementToBeClickable(By.id("Browser"))).click();
Thread.sleep(10000);
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("url"))).sendKeys("https://www.lambdatest.com/");
wait.until(ExpectedConditions.elementToBeClickable(MobileBy.id("find"))).click();
Thread.sleep(5000);

//Takes to speedtest page
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("speedTest"))).click();
Thread.sleep(4000);
driver.navigate().back();

//Opens the browser
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("Browser"))).click();
Thread.sleep(1000);
WebElement url = driver.findElement(By.name("url"));
url.click();
url.sendKeys("https://www.lambdatest.com");
Wait.until(ExpectedConditions.presenceOfElementLocated(By.name("find"))).click();
Thread.sleep(1000);
status = "passed";
} catch (Exception e) {
System.out.println(e.getMessage());
Expand Down