Skip to content
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 .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
25 changes: 13 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
<groupId>com.osa.ddd</groupId>
<artifactId>DDDFramework</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
</dependencies>


<dependencies>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>

</dependencies>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import org.testng.annotations.BeforeMethod;

public class Base {
public static void main(String[] args) {
WebDriver dr= Browser.openBrowser("chrome");

public WebDriver dr;
@BeforeClass
public void beforeClass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
public class Browser {
public static WebDriver openBrowser(String browser) {
WebDriver dr=null;
if(browser.toLowerCase().equals("chrome")) {
System.setProperty("webdriver.chrome.driver", "src\\main\\resources\\drivers\\chromedriver.exe");
dr=new ChromeDriver();
}else if(browser.toLowerCase().equals("firefox")) {
System.setProperty("webdriver.gecko.driver", "C:\\Users\\ahmed\\Desktop\\OSA0829202010A\\geckodriver.exe");
dr=new FirefoxDriver();
if(System.getProperty("os.name").toLowerCase().contains("windows")) {
System.out.println("===========The test is running on "+System.getProperty("os.name")+"==========");
if(browser.toLowerCase().equals("chrome")) {
Expand All @@ -26,6 +32,8 @@ public static WebDriver openBrowser(String browser) {
dr=new FirefoxDriver();
}
}
return dr;

}
return dr;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public void test1() {
@Test
public void test2() {
System.out.println("Test Two method");

}
@Test
public void test3() {
System.out.println("Test Two method");
System.out.println("Hello");
}
@BeforeClass
public void beforeClass() {
Expand Down
Binary file modified target/classes/com/osa/base/Browser.class
Binary file not shown.
Binary file modified target/classes/com/osa/utility/Utils.class
Binary file not shown.
Binary file removed target/classes/drivers/chromedriver.exe
Binary file not shown.
94 changes: 94 additions & 0 deletions test-output/Default suite/Default test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<html>
<head>
<title>TestNG: Default test</title>
<link href="../testng.css" rel="stylesheet" type="text/css" />
<link href="../my-testng.css" rel="stylesheet" type="text/css" />

<style type="text/css">
.log { display: none;}
.stack-trace { display: none;}
</style>
<script type="text/javascript">
<!--
function flip(e) {
current = e.style.display;
if (current == 'block') {
e.style.display = 'none';
return 0;
}
else {
e.style.display = 'block';
return 1;
}
}

function toggleBox(szDivId, elem, msg1, msg2)
{
var res = -1; if (document.getElementById) {
res = flip(document.getElementById(szDivId));
}
else if (document.all) {
// this is the way old msie versions work
res = flip(document.all[szDivId]);
}
if(elem) {
if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
}

}

function toggleAllBoxes() {
if (document.getElementsByTagName) {
d = document.getElementsByTagName('div');
for (i = 0; i < d.length; i++) {
if (d[i].className == 'log') {
flip(d[i]);
}
}
}
}

// -->
</script>

</head>
<body>
<h2 align='center'>Default test</h2><table border='1' align="center">
<tr>
<td>Tests passed/Failed/Skipped:</td><td>3/0/0</td>
</tr><tr>
<td>Started on:</td><td>Sun Mar 28 21:29:03 EDT 2021</td>
</tr>
<tr><td>Total time:</td><td>0 seconds (54 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
<td>Excluded groups:</td><td></td>
</tr>
</table><p/>
<small><i>(Hover the method name to see the test class name)</i></small><p/>
<table width='100%' border='1' class='invocation-passed'>
<tr><td colspan='4' align='center'><b>PASSED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='com.osa.base.Testing.test1()'><b>test1</b><br>Test class: com.osa.base.Testing</td>
<td></td>
<td>0</td>
<td>com.osa.base.Testing@45c7e403</td></tr>
<tr>
<td title='com.osa.base.Testing.test2()'><b>test2</b><br>Test class: com.osa.base.Testing</td>
<td></td>
<td>0</td>
<td>com.osa.base.Testing@45c7e403</td></tr>
<tr>
<td title='com.osa.base.Testing.test3()'><b>test3</b><br>Test class: com.osa.base.Testing</td>
<td></td>
<td>0</td>
<td>com.osa.base.Testing@45c7e403</td></tr>
</table><p>
</body>
</html>
7 changes: 7 additions & 0 deletions test-output/Default suite/Default test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
<testsuite ignored="0" hostname="LAPTOP-7O5G4UOM" failures="0" tests="3" name="Default test" time="0.054" errors="0" timestamp="29 Mar 2021 01:29:03 GMT">
<testcase classname="com.osa.base.Testing" name="test1" time="0.005"/>
<testcase classname="com.osa.base.Testing" name="test2" time="0.001"/>
<testcase classname="com.osa.base.Testing" name="test3" time="0.001"/>
</testsuite> <!-- Default test -->
Binary file added test-output/bullet_point.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test-output/collapseall.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions test-output/emailable-report.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>TestNG Report</title>
<style type="text/css">table {margin-bottom:10px;border-collapse:collapse;empty-cells:show}th,td {border:1px solid #009;padding:.25em .5em}th {vertical-align:bottom}td {vertical-align:top}table a {font-weight:bold}.stripe td {background-color: #E6EBF9}.num {text-align:right}.passedodd td {background-color: #3F3}.passedeven td {background-color: #0A0}.skippedodd td {background-color: #DDD}.skippedeven td {background-color: #CCC}.failedodd td,.attn {background-color: #F33}.failedeven td,.stripe .attn {background-color: #D00}.stacktrace {white-space:pre;font-family:monospace}.totop {font-size:85%;text-align:center;border-bottom:2px solid #000}.invisible {display:none}</style>
</head>
<body>
<table>
<tr><th>Test</th><th># Passed</th><th># Skipped</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr>
<tr><th colspan="7">Default suite</th></tr>
<tr><td><a href="#t0">Default test</a></td><td class="num">3</td><td class="num">0</td><td class="num">0</td><td class="num">54</td><td></td><td></td></tr>
</table>
<table id='summary'><thead><tr><th>Class</th><th>Method</th><th>Start</th><th>Time (ms)</th></tr></thead><tbody><tr><th colspan="4">Default suite</th></tr></tbody><tbody id="t0"><tr><th colspan="4">Default test &#8212; passed</th></tr><tr class="passedeven"><td rowspan="3">com.osa.base.Testing</td><td><a href="#m0">test1</a></td><td rowspan="1">1616981343740</td><td rowspan="1">5</td></tr><tr class="passedeven"><td><a href="#m1">test2</a></td><td rowspan="1">1616981343747</td><td rowspan="1">1</td></tr><tr class="passedeven"><td><a href="#m2">test3</a></td><td rowspan="1">1616981343750</td><td rowspan="1">1</td></tr></tbody>
</table>
<h2>Default test</h2><h3 id="m0">com.osa.base.Testing#test1</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m1">com.osa.base.Testing#test2</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m2">com.osa.base.Testing#test3</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
</body>
</html>
Binary file added test-output/failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading