Skip to content

Commit

Permalink
latest Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafamohab committed Feb 14, 2021
1 parent 11038fd commit 6599b84
Show file tree
Hide file tree
Showing 54 changed files with 1,953 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified excel.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Objects/dataDriven.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ArrayList<String> getData(String testcaseName) throws IOException {
}
k++;
}
System.out.println(coloumn);
//System.out.println(coloumn);

while (rows.hasNext()) {
Row rowvalue = rows.next();
Expand Down
6 changes: 3 additions & 3 deletions src/Testcases/Mainclass.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void setUp() {

// Using Implicit wait for all elements as a standard behaviour for script
// unless otherwise
driver.manage().timeouts().implicitlyWait(13, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(12, TimeUnit.SECONDS);

// Enter Website needed in driver credentials
driver.get("http://automationpractice.com/index.php");
Expand Down Expand Up @@ -78,7 +78,7 @@ public void signUp() throws IOException {

// Create new object of Webdriver wait class for a certain Usage in an
// explicit wait
WebDriverWait Wait = new WebDriverWait(driver, 6);
WebDriverWait Wait = new WebDriverWait(driver, 5);

// Use Explicit Wait in order for Mail appearing as valid in Screen
Wait.until(ExpectedConditions.elementToBeClickable(homepage.createAccount()));
Expand Down Expand Up @@ -229,7 +229,7 @@ public void cartCheckout() {

// Create new object of Webdriver wait class for a certain Usage in an
// explicit wait
WebDriverWait Wait = new WebDriverWait(driver, 20);
WebDriverWait Wait = new WebDriverWait(driver, 17);

// Use Explicit Wait in order for First Checkout button to appear in Screen
Wait.until(ExpectedConditions.visibilityOf(blouses.checkOut1()));
Expand Down
2 changes: 2 additions & 0 deletions target/classes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/Testcases/
/Objects/
Binary file modified target/classes/Objects/dataDriven.class
Binary file not shown.
Binary file modified target/classes/Testcases/Mainclass.class
Binary file not shown.
89 changes: 89 additions & 0 deletions test-output/Default suite/Default test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<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>2/0/0</td>
</tr><tr>
<td>Started on:</td><td>Sun Feb 14 18:37:58 EET 2021</td>
</tr>
<tr><td>Total time:</td><td>3 seconds (3036 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='Testcases.restAssured.getTest1()'><b>getTest1</b><br>Test class: Testcases.restAssured</td>
<td></td>
<td>2</td>
<td>Testcases.restAssured@4d1b0d2a</td></tr>
<tr>
<td title='Testcases.restAssured.getTest2()'><b>getTest2</b><br>Test class: Testcases.restAssured</td>
<td></td>
<td>0</td>
<td>Testcases.restAssured@4d1b0d2a</td></tr>
</table><p>
</body>
</html>
6 changes: 6 additions & 0 deletions test-output/Default suite/Default test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
<testsuite hostname="DESKTOP-EHTEC5D" ignored="0" name="Default test" tests="2" failures="0" timestamp="2021-02-14T18:38:01 EET" time="3.036" errors="0">
<testcase name="getTest1" time="2.411" classname="Testcases.restAssured"/>
<testcase name="getTest2" time="0.609" classname="Testcases.restAssured"/>
</testsuite> <!-- Default test -->
20 changes: 20 additions & 0 deletions test-output/Default suite/testng-failed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite guice-stage="DEVELOPMENT" name="Failed suite [Default suite]">
<test thread-count="5" name="Default test(failed)">
<classes>
<class name="Testcases.Mainclass">
<methods>
<include name="cartCheckout"/>
<include name="signIn"/>
<include name="setUp"/>
<include name="addtoCart"/>
<include name="createAccount"/>
<include name="signUp"/>
<include name="checkOrderDetails"/>
<include name="tearDown"/>
</methods>
</class> <!-- Testcases.Mainclass -->
</classes>
</test> <!-- Default test(failed) -->
</suite> <!-- Failed suite [Default suite] -->
119 changes: 119 additions & 0 deletions test-output/Suite/Test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<html>
<head>
<title>TestNG: 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'>Test</h2><table border='1' align="center">
<tr>
<td>Tests passed/Failed/Skipped:</td><td>8/0/0</td>
</tr><tr>
<td>Started on:</td><td>Sun Feb 14 19:08:15 EET 2021</td>
</tr>
<tr><td>Total time:</td><td>178 seconds (178011 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='Testcases.Mainclass.addtoCart()'><b>addtoCart</b><br>Test class: Testcases.Mainclass</td>
<td></td>
<td>23</td>
<td>Testcases.Mainclass@548ad73b</td></tr>
<tr>
<td title='Testcases.Mainclass.cartCheckout()'><b>cartCheckout</b><br>Test class: Testcases.Mainclass</td>
<td></td>
<td>64</td>
<td>Testcases.Mainclass@548ad73b</td></tr>
<tr>
<td title='Testcases.Mainclass.checkOrderDetails()'><b>checkOrderDetails</b><br>Test class: Testcases.Mainclass</td>
<td></td>
<td>23</td>
<td>Testcases.Mainclass@548ad73b</td></tr>
<tr>
<td title='Testcases.Mainclass.createAccount()'><b>createAccount</b><br>Test class: Testcases.Mainclass</td>
<td></td>
<td>36</td>
<td>Testcases.Mainclass@548ad73b</td></tr>
<tr>
<td title='Testcases.restAssured.getTest1()'><b>getTest1</b><br>Test class: Testcases.restAssured</td>
<td></td>
<td>1</td>
<td>Testcases.restAssured@4c762604</td></tr>
<tr>
<td title='Testcases.restAssured.getTest2()'><b>getTest2</b><br>Test class: Testcases.restAssured</td>
<td></td>
<td>0</td>
<td>Testcases.restAssured@4c762604</td></tr>
<tr>
<td title='Testcases.Mainclass.signIn()'><b>signIn</b><br>Test class: Testcases.Mainclass</td>
<td></td>
<td>14</td>
<td>Testcases.Mainclass@548ad73b</td></tr>
<tr>
<td title='Testcases.Mainclass.signUp()'><b>signUp</b><br>Test class: Testcases.Mainclass</td>
<td></td>
<td>12</td>
<td>Testcases.Mainclass@548ad73b</td></tr>
</table><p>
</body>
</html>
12 changes: 12 additions & 0 deletions test-output/Suite/Test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
<testsuite hostname="DESKTOP-EHTEC5D" ignored="0" name="Test" tests="8" failures="0" timestamp="2021-02-14T19:11:13 EET" time="178.011" errors="0">
<testcase name="signUp" time="12.933" classname="Testcases.Mainclass"/>
<testcase name="createAccount" time="36.515" classname="Testcases.Mainclass"/>
<testcase name="signIn" time="14.377" classname="Testcases.Mainclass"/>
<testcase name="addtoCart" time="23.497" classname="Testcases.Mainclass"/>
<testcase name="cartCheckout" time="64.806" classname="Testcases.Mainclass"/>
<testcase name="checkOrderDetails" time="23.363" classname="Testcases.Mainclass"/>
<testcase name="getTest1" time="1.889" classname="Testcases.restAssured"/>
<testcase name="getTest2" time="0.607" classname="Testcases.restAssured"/>
</testsuite> <!-- 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.
25 changes: 25 additions & 0 deletions test-output/emailable-report.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="https://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># Retried</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr>
<tr><th colspan="8">Suite</th></tr>
<tr><td><a href="#t0">Test</a></td><td class="num">8</td><td class="num">0</td><td class="num">0</td><td class="num">0</td><td class="num">178,011</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">Suite</th></tr></tbody><tbody id="t0"><tr><th colspan="4">Test &#8212; passed</th></tr><tr class="passedeven"><td rowspan="6">Testcases.Mainclass</td><td><a href="#m0">addtoCart</a></td><td rowspan="1">1613322559694</td><td rowspan="1">23497</td></tr><tr class="passedeven"><td><a href="#m1">cartCheckout</a></td><td rowspan="1">1613322583192</td><td rowspan="1">64806</td></tr><tr class="passedeven"><td><a href="#m2">checkOrderDetails</a></td><td rowspan="1">1613322647999</td><td rowspan="1">23363</td></tr><tr class="passedeven"><td><a href="#m3">createAccount</a></td><td rowspan="1">1613322508800</td><td rowspan="1">36515</td></tr><tr class="passedeven"><td><a href="#m4">signIn</a></td><td rowspan="1">1613322545316</td><td rowspan="1">14377</td></tr><tr class="passedeven"><td><a href="#m5">signUp</a></td><td rowspan="1">1613322495864</td><td rowspan="1">12933</td></tr><tr class="passedodd"><td rowspan="2">Testcases.restAssured</td><td><a href="#m6">getTest1</a></td><td rowspan="1">1613322671364</td><td rowspan="1">1889</td></tr><tr class="passedodd"><td><a href="#m7">getTest2</a></td><td rowspan="1">1613322673254</td><td rowspan="1">607</td></tr></tbody>
</table>
<h2>Test</h2><h3 id="m0">Testcases.Mainclass#addtoCart</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m1">Testcases.Mainclass#cartCheckout</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m2">Testcases.Mainclass#checkOrderDetails</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m3">Testcases.Mainclass#createAccount</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m4">Testcases.Mainclass#signIn</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m5">Testcases.Mainclass#signUp</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m6">Testcases.restAssured#getTest1</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m7">Testcases.restAssured#getTest2</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

0 comments on commit 6599b84

Please sign in to comment.