Skip to content

Commit 6d43358

Browse files
authored
Merge pull request #5 from browserstack/suite
added suite test
2 parents 0fd73f3 + 189e164 commit 6d43358

File tree

13 files changed

+319
-0
lines changed

13 files changed

+319
-0
lines changed

config/suite.testng.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
3+
<suite name="Pool" thread-count="4" parallel="classes">
4+
<test name="PoolTestChrome">
5+
<parameter name="config" value="suite.conf.json"/>
6+
<parameter name="environment" value="chrome"/>
7+
<classes>
8+
<class name="com.browserstack.suite.SuiteTest01"/>
9+
<class name="com.browserstack.suite.SuiteTest02"/>
10+
<class name="com.browserstack.suite.SuiteTest03"/>
11+
<class name="com.browserstack.suite.SuiteTest04"/>
12+
<class name="com.browserstack.suite.SuiteTest05"/>
13+
<class name="com.browserstack.suite.SuiteTest06"/>
14+
<class name="com.browserstack.suite.SuiteTest07"/>
15+
<class name="com.browserstack.suite.SuiteTest08"/>
16+
<class name="com.browserstack.suite.SuiteTest09"/>
17+
<class name="com.browserstack.suite.SuiteTest10"/>
18+
</classes>
19+
</test>
20+
21+
<test name="PoolTestFirefox">
22+
<parameter name="config" value="suite.conf.json"/>
23+
<parameter name="environment" value="firefox"/>
24+
<classes>
25+
<class name="com.browserstack.suite.SuiteTest01"/>
26+
<class name="com.browserstack.suite.SuiteTest02"/>
27+
<class name="com.browserstack.suite.SuiteTest03"/>
28+
<class name="com.browserstack.suite.SuiteTest04"/>
29+
<class name="com.browserstack.suite.SuiteTest05"/>
30+
<class name="com.browserstack.suite.SuiteTest06"/>
31+
<class name="com.browserstack.suite.SuiteTest07"/>
32+
<class name="com.browserstack.suite.SuiteTest08"/>
33+
<class name="com.browserstack.suite.SuiteTest09"/>
34+
<class name="com.browserstack.suite.SuiteTest10"/>
35+
</classes>
36+
</test>
37+
</suite>

pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@
112112
</plugins>
113113
</build>
114114
</profile>
115+
116+
<profile>
117+
<id>suite</id>
118+
<build>
119+
<plugins>
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-surefire-plugin</artifactId>
123+
<configuration>
124+
<suiteXmlFiles>
125+
<suiteXmlFile>config/suite.testng.xml</suiteXmlFile>
126+
</suiteXmlFiles>
127+
</configuration>
128+
</plugin>
129+
</plugins>
130+
</build>
131+
</profile>
115132
</profiles>
116133

117134
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest01 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_01() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
WebElement element = driver.findElement(By.name("q"));
17+
element.sendKeys("BrowserStack Test 01");
18+
element.submit();
19+
Thread.sleep(5000);
20+
21+
Assert.assertEquals("BrowserStack Test 01 - Google Search", driver.getTitle());
22+
}
23+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest02 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_02() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
Thread.sleep(5000);
17+
WebElement element = driver.findElement(By.name("q"));
18+
element.sendKeys("BrowserStack Test 02");
19+
element.submit();
20+
Thread.sleep(5000);
21+
22+
Assert.assertEquals("BrowserStack Test 02 - Google Search", driver.getTitle());
23+
}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest03 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_03() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
Thread.sleep(5000);
17+
WebElement element = driver.findElement(By.name("q"));
18+
element.sendKeys("BrowserStack Test 03");
19+
Thread.sleep(5000);
20+
element.submit();
21+
Thread.sleep(5000);
22+
23+
Assert.assertEquals("BrowserStack Test 03 - Google Search", driver.getTitle());
24+
}
25+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest04 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_04() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
WebElement element = driver.findElement(By.name("q"));
17+
element.sendKeys("BrowserStack Test 04");
18+
element.submit();
19+
Thread.sleep(7000);
20+
21+
Assert.assertEquals("BrowserStack Test 04 - Google Search", driver.getTitle());
22+
}
23+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest05 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_05() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
Thread.sleep(7000);
17+
WebElement element = driver.findElement(By.name("q"));
18+
element.sendKeys("BrowserStack Test 05");
19+
element.submit();
20+
Thread.sleep(7000);
21+
22+
Assert.assertEquals("BrowserStack Test 05 - Google Search", driver.getTitle());
23+
}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest06 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_06() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
Thread.sleep(7000);
17+
WebElement element = driver.findElement(By.name("q"));
18+
element.sendKeys("BrowserStack Test 06");
19+
Thread.sleep(7000);
20+
element.submit();
21+
Thread.sleep(7000);
22+
23+
Assert.assertEquals("BrowserStack Test 06 - Google Search", driver.getTitle());
24+
}
25+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest07 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_07() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
WebElement element = driver.findElement(By.name("q"));
17+
element.sendKeys("BrowserStack Test 07");
18+
element.submit();
19+
Thread.sleep(3000);
20+
21+
Assert.assertEquals("BrowserStack Test 07 - Google Search", driver.getTitle());
22+
}
23+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.browserstack.suite;
2+
3+
import org.openqa.selenium.By;
4+
import org.openqa.selenium.WebElement;
5+
6+
import org.testng.Assert;
7+
import org.testng.annotations.Test;
8+
9+
import com.browserstack.BrowserStackTestNGTest;
10+
11+
public class SuiteTest08 extends BrowserStackTestNGTest {
12+
13+
@Test
14+
public void test_08() throws Exception {
15+
driver.get("https://www.google.com/ncr");
16+
Thread.sleep(3000);
17+
WebElement element = driver.findElement(By.name("q"));
18+
element.sendKeys("BrowserStack Test 08");
19+
element.submit();
20+
Thread.sleep(3000);
21+
22+
Assert.assertEquals("BrowserStack Test 08 - Google Search", driver.getTitle());
23+
}
24+
}

0 commit comments

Comments
 (0)